diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2021-06-08 17:41:48 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2021-06-15 14:49:54 +0300 |
commit | d5bf6f5c10ce9ce75ade59b5948c15f7829198a8 (patch) | |
tree | 6fcd4822205387716dc49c97e09f59fbdc9cc540 /src | |
parent | f2a2ea817f8ca5c1b8d930f237262b53ad36ae0e (diff) |
Remove dead code
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd/cmd.cpp | 17 | ||||
-rw-r--r-- | src/cmd/cmd.h | 40 |
2 files changed, 5 insertions, 52 deletions
diff --git a/src/cmd/cmd.cpp b/src/cmd/cmd.cpp index f002ef5dd..4a9999210 100644 --- a/src/cmd/cmd.cpp +++ b/src/cmd/cmd.cpp @@ -39,9 +39,6 @@ #include "config.h" #include "csync_exclude.h" - -#include "cmd.h" - #include "theme.h" #include "netrcparser.h" #include "libsync/logger.h" @@ -147,21 +144,20 @@ void sync(const SyncCTX &ctx, int restartCount) opt.verifyChunkSizes(); auto engine = new SyncEngine(ctx.account, ctx.options.source_dir, ctx.folder, db); engine->setParent(db); - auto cmd = new Cmd(engine); - QObject::connect(engine, &SyncEngine::finished, engine, [engine, ctx, cmd](bool result) { + QObject::connect(engine, &SyncEngine::finished, engine, [engine, ctx, restartCount = std::make_shared<int>(0)](bool result) { if (!result) { qWarning() << "Failed to sync"; qApp->exit(EXIT_FAILURE); } else { if (engine->isAnotherSyncNeeded() != NoFollowUpSync) { - if (cmd->_restartCount < ctx.options.restartTimes) { - cmd->_restartCount++; - qDebug() << "Restarting Sync, because another sync is needed" << cmd->_restartCount; + if (*restartCount < ctx.options.restartTimes) { + (*restartCount)++; + qDebug() << "Restarting Sync, because another sync is needed" << *restartCount; engine->startSync(); return; } - qWarning() << "Another sync is needed, but not done because restart count is exceeded" << cmd->_restartCount; + qWarning() << "Another sync is needed, but not done because restart count is exceeded" << *restartCount; } else { qApp->quit(); } @@ -170,7 +166,6 @@ void sync(const SyncCTX &ctx, int restartCount) engine->setSyncOptions(opt); engine->setIgnoreHiddenFiles(ctx.options.ignoreHiddenFiles); engine->setNetworkLimits(ctx.options.uplimit, ctx.options.downlimit); - QObject::connect(engine, &SyncEngine::transmissionProgress, cmd, &Cmd::transmissionProgressSlot); QObject::connect(engine, &SyncEngine::syncError, engine, [](const QString &error) { qWarning() << "Sync error:" << error; }); @@ -413,8 +408,6 @@ int main(int argc, char **argv) QString opensslConf = QCoreApplication::applicationDirPath() + QString("/openssl.cnf"); qputenv("OPENSSL_CONF", opensslConf.toLocal8Bit()); #endif - - qsrand(std::random_device()()); SyncCTX ctx { parseOptions(app.arguments()) }; diff --git a/src/cmd/cmd.h b/src/cmd/cmd.h deleted file mode 100644 index c2acae973..000000000 --- a/src/cmd/cmd.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) by Olivier Goffart <ogoffart@owncloud.com> - * Copyright (C) by Klaas Freitag <freitag@owncloud.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - */ - -#ifndef CMD_H -#define CMD_H - -#include <QObject> - -/** - * @brief Helper class for command line client - * @ingroup cmd - */ -class Cmd : public QObject -{ - Q_OBJECT -public: - Cmd(QObject *parent) - : QObject(parent) - { - } - int _restartCount = 0; -public slots: - void transmissionProgressSlot() - { - } -}; - -#endif |