summaryrefslogtreecommitdiffstats
path: root/sinksh/syntax_modules/sink_upgrade.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-07-03 14:02:27 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-07-03 14:02:27 +0200
commit55fe06979ceebe67553135b43aa47e70d931304b (patch)
tree16b10a744879cc1872d6c07624b59ae64469ddbf /sinksh/syntax_modules/sink_upgrade.cpp
parent56fae95f49a1ca8ca614bd9f89b0ea5f872765e9 (diff)
parent288946f1694c2abe1d2c5800c87339d1e8780e4b (diff)
downloadsink-55fe06979ceebe67553135b43aa47e70d931304b.tar.gz
sink-55fe06979ceebe67553135b43aa47e70d931304b.zip
Merge branch 'develop'
Diffstat (limited to 'sinksh/syntax_modules/sink_upgrade.cpp')
-rw-r--r--sinksh/syntax_modules/sink_upgrade.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/sinksh/syntax_modules/sink_upgrade.cpp b/sinksh/syntax_modules/sink_upgrade.cpp
new file mode 100644
index 0000000..c399048
--- /dev/null
+++ b/sinksh/syntax_modules/sink_upgrade.cpp
@@ -0,0 +1,47 @@
1/*
2 * Copyright (C) 2017 Christian Mollekopf <mollekopf@kolabsys.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20#include <QDebug>
21#include <QObject> // tr()
22#include <QTimer>
23
24#include "common/store.h"
25
26#include "state.h"
27#include "syntaxtree.h"
28
29namespace SinkUpgrade
30{
31
32bool upgrade(const QStringList &args, State &state)
33{
34 state.print(QObject::tr("Upgrading..."));
35 Sink::Store::upgrade().exec().waitForFinished();
36 state.printLine(QObject::tr("done"));
37 return true;
38}
39
40Syntax::List syntax()
41{
42 return Syntax::List() << Syntax{"upgrade", QObject::tr("Upgrades your storage to the latest version (be careful!)"), &SinkUpgrade::upgrade, Syntax::NotInteractive};
43}
44
45REGISTER_SYNTAX(SinkUpgrade)
46
47}