From 9337927722425b863022776ccc324a4c7e838a3b Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 28 Oct 2015 10:59:02 +0100 Subject: [PATCH] legacy propagator: Remove more code --- src/cmd/cmd.cpp | 3 --- src/gui/creds/shibbolethcredentials.cpp | 23 ----------------------- src/gui/creds/shibbolethcredentials.h | 2 -- src/gui/folder.cpp | 1 - src/libsync/creds/abstractcredentials.h | 2 -- src/libsync/creds/dummycredentials.cpp | 6 ------ src/libsync/creds/dummycredentials.h | 2 -- src/libsync/creds/httpcredentials.cpp | 10 ---------- src/libsync/creds/httpcredentials.h | 2 -- src/libsync/creds/tokencredentials.cpp | 10 ---------- src/libsync/creds/tokencredentials.h | 2 -- src/libsync/owncloudpropagator.h | 5 ----- src/libsync/progressdispatcher.cpp | 5 ----- src/libsync/progressdispatcher.h | 7 ------- src/libsync/syncengine.cpp | 7 ------- src/libsync/syncengine.h | 1 - 16 files changed, 88 deletions(-) diff --git a/src/cmd/cmd.cpp b/src/cmd/cmd.cpp index 77c231a14..11390dbf6 100644 --- a/src/cmd/cmd.cpp +++ b/src/cmd/cmd.cpp @@ -369,7 +369,6 @@ restart_sync: csync_set_log_level(options.silent ? 1 : 11); opts = &options; - cred->syncContextPreInit(_csync_ctx); if( csync_init( _csync_ctx ) < 0 ) { qFatal("Could not initialize csync!"); @@ -441,8 +440,6 @@ restart_sync: return EXIT_FAILURE; } - cred->syncContextPreStart(_csync_ctx); - Cmd cmd; SyncJournalDb db(options.source_dir); if (!selectiveSyncList.empty()) { diff --git a/src/gui/creds/shibbolethcredentials.cpp b/src/gui/creds/shibbolethcredentials.cpp index 2e8308812..c082a2bc1 100644 --- a/src/gui/creds/shibbolethcredentials.cpp +++ b/src/gui/creds/shibbolethcredentials.cpp @@ -73,29 +73,6 @@ void ShibbolethCredentials::setAccount(Account* account) } } - -void ShibbolethCredentials::syncContextPreInit(CSYNC* ctx) -{ - Q_UNUSED(ctx); -} - -QByteArray ShibbolethCredentials::prepareCookieData() const -{ - QString cookiesAsString; - QList cookies = accountCookies(_account); - - foreach(const QNetworkCookie &cookie, cookies) { - cookiesAsString += cookie.toRawForm(QNetworkCookie::NameAndValueOnly) + QLatin1String("; "); - } - - return cookiesAsString.toLatin1(); -} - -void ShibbolethCredentials::syncContextPreStart (CSYNC* ctx) -{ - Q_UNUSED(ctx); -} - bool ShibbolethCredentials::changed(AbstractCredentials* credentials) const { ShibbolethCredentials* other(qobject_cast< ShibbolethCredentials* >(credentials)); diff --git a/src/gui/creds/shibbolethcredentials.h b/src/gui/creds/shibbolethcredentials.h index f4024bb7c..ecf66be93 100644 --- a/src/gui/creds/shibbolethcredentials.h +++ b/src/gui/creds/shibbolethcredentials.h @@ -48,8 +48,6 @@ public: ShibbolethCredentials(const QNetworkCookie &cookie); void setAccount(Account* account) Q_DECL_OVERRIDE; - void syncContextPreInit(CSYNC* ctx) Q_DECL_OVERRIDE; - void syncContextPreStart(CSYNC* ctx) Q_DECL_OVERRIDE; bool changed(AbstractCredentials* credentials) const Q_DECL_OVERRIDE; QString authType() const Q_DECL_OVERRIDE; QString user() const Q_DECL_OVERRIDE; diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 9dad4c939..be873792c 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -111,7 +111,6 @@ bool Folder::init() csync_set_log_level( 11 ); Q_ASSERT( _accountState ); - _accountState->account()->credentials()->syncContextPreInit(_csync_ctx); if( csync_init( _csync_ctx ) < 0 ) { qDebug() << "Could not initialize csync!" << csync_get_status(_csync_ctx) << csync_get_status_string(_csync_ctx); diff --git a/src/libsync/creds/abstractcredentials.h b/src/libsync/creds/abstractcredentials.h index 607422641..10947b9ed 100644 --- a/src/libsync/creds/abstractcredentials.h +++ b/src/libsync/creds/abstractcredentials.h @@ -41,8 +41,6 @@ public: */ virtual void setAccount(Account* account); - virtual void syncContextPreInit(CSYNC* ctx) = 0; - virtual void syncContextPreStart(CSYNC* ctx) = 0; virtual bool changed(AbstractCredentials* credentials) const = 0; virtual QString authType() const = 0; virtual QString user() const = 0; diff --git a/src/libsync/creds/dummycredentials.cpp b/src/libsync/creds/dummycredentials.cpp index b0a043235..33b408670 100644 --- a/src/libsync/creds/dummycredentials.cpp +++ b/src/libsync/creds/dummycredentials.cpp @@ -17,12 +17,6 @@ namespace OCC { -void DummyCredentials::syncContextPreInit(CSYNC*) -{} - -void DummyCredentials::syncContextPreStart(CSYNC*) -{} - bool DummyCredentials::changed(AbstractCredentials* credentials) const { DummyCredentials* dummy(dynamic_cast< DummyCredentials* >(credentials)); diff --git a/src/libsync/creds/dummycredentials.h b/src/libsync/creds/dummycredentials.h index 4fa100b52..b1cc3cf5b 100644 --- a/src/libsync/creds/dummycredentials.h +++ b/src/libsync/creds/dummycredentials.h @@ -27,8 +27,6 @@ public: QString _user; QString _password; - void syncContextPreInit(CSYNC* ctx) Q_DECL_OVERRIDE; - void syncContextPreStart(CSYNC* ctx) Q_DECL_OVERRIDE; bool changed(AbstractCredentials* credentials) const Q_DECL_OVERRIDE; QString authType() const Q_DECL_OVERRIDE; QString user() const Q_DECL_OVERRIDE; diff --git a/src/libsync/creds/httpcredentials.cpp b/src/libsync/creds/httpcredentials.cpp index 69f132e67..4f29fb85e 100644 --- a/src/libsync/creds/httpcredentials.cpp +++ b/src/libsync/creds/httpcredentials.cpp @@ -57,16 +57,6 @@ HttpCredentials::HttpCredentials(const QString& user, const QString& password, c { } -void HttpCredentials::syncContextPreInit (CSYNC* ctx) -{ - Q_UNUSED(ctx); -} - -void HttpCredentials::syncContextPreStart (CSYNC* ctx) -{ - Q_UNUSED(ctx); -} - bool HttpCredentials::changed(AbstractCredentials* credentials) const { HttpCredentials* other(qobject_cast< HttpCredentials* >(credentials)); diff --git a/src/libsync/creds/httpcredentials.h b/src/libsync/creds/httpcredentials.h index ce3d9c42b..d09fb1a2a 100644 --- a/src/libsync/creds/httpcredentials.h +++ b/src/libsync/creds/httpcredentials.h @@ -38,8 +38,6 @@ public: explicit HttpCredentials(); HttpCredentials(const QString& user, const QString& password, const QString& certificatePath, const QString& certificatePasswd); - void syncContextPreInit(CSYNC* ctx) Q_DECL_OVERRIDE; - void syncContextPreStart(CSYNC* ctx) Q_DECL_OVERRIDE; bool changed(AbstractCredentials* credentials) const Q_DECL_OVERRIDE; QString authType() const Q_DECL_OVERRIDE; QNetworkAccessManager* getQNAM() const Q_DECL_OVERRIDE; diff --git a/src/libsync/creds/tokencredentials.cpp b/src/libsync/creds/tokencredentials.cpp index f5ed499ca..6187fda04 100644 --- a/src/libsync/creds/tokencredentials.cpp +++ b/src/libsync/creds/tokencredentials.cpp @@ -80,16 +80,6 @@ TokenCredentials::TokenCredentials(const QString& user, const QString& password, { } -void TokenCredentials::syncContextPreInit (CSYNC* ctx) -{ - Q_UNUSED(ctx); -} - -void TokenCredentials::syncContextPreStart (CSYNC* ctx) -{ - Q_UNUSED(ctx); -} - bool TokenCredentials::changed(AbstractCredentials* credentials) const { TokenCredentials* other(dynamic_cast< TokenCredentials* >(credentials)); diff --git a/src/libsync/creds/tokencredentials.h b/src/libsync/creds/tokencredentials.h index 3e5d1dfda..1564a28a9 100644 --- a/src/libsync/creds/tokencredentials.h +++ b/src/libsync/creds/tokencredentials.h @@ -40,8 +40,6 @@ public: TokenCredentials(); TokenCredentials(const QString& user, const QString& password, const QString &token); - void syncContextPreInit(CSYNC* ctx) Q_DECL_OVERRIDE; - void syncContextPreStart(CSYNC* ctx) Q_DECL_OVERRIDE; bool changed(AbstractCredentials* credentials) const Q_DECL_OVERRIDE; QString authType() const Q_DECL_OVERRIDE; QNetworkAccessManager* getQNAM() const Q_DECL_OVERRIDE; diff --git a/src/libsync/owncloudpropagator.h b/src/libsync/owncloudpropagator.h index 2e334856e..15189bbfe 100644 --- a/src/libsync/owncloudpropagator.h +++ b/src/libsync/owncloudpropagator.h @@ -354,11 +354,6 @@ signals: void itemCompleted(const SyncFileItem &, const PropagatorJob &); void progress(const SyncFileItem&, quint64 bytes); void finished(); - /** - * Called when we detect that the total number of bytes changes (because a download or upload - * turns out to be bigger or smaller than what was initially computed in the update phase - */ - void adjustTotalTransmissionSize( qint64 adjust ); private: diff --git a/src/libsync/progressdispatcher.cpp b/src/libsync/progressdispatcher.cpp index c599b1238..4caf81859 100644 --- a/src/libsync/progressdispatcher.cpp +++ b/src/libsync/progressdispatcher.cpp @@ -149,11 +149,6 @@ void ProgressInfo::adjustTotalsForFile(const SyncFileItem &item) } } -void ProgressInfo::adjustTotalSize(qint64 change) -{ - _sizeProgress._total += change; -} - quint64 ProgressInfo::totalFiles() const { return _fileProgress._total; diff --git a/src/libsync/progressdispatcher.h b/src/libsync/progressdispatcher.h index 0e68d15cf..0efcee71f 100644 --- a/src/libsync/progressdispatcher.h +++ b/src/libsync/progressdispatcher.h @@ -64,13 +64,6 @@ public: */ void adjustTotalsForFile(const SyncFileItem & item); - /** - * Adjust the total size by some value. - * - * Deprecated. Used only in the legacy propagator. - */ - void adjustTotalSize(qint64 change); - quint64 totalFiles() const; quint64 completedFiles() const; diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp index cab49b499..50197cd18 100644 --- a/src/libsync/syncengine.cpp +++ b/src/libsync/syncengine.cpp @@ -659,7 +659,6 @@ void SyncEngine::startSync() qDebug() << (usingSelectiveSync ? "====Using Selective Sync" : "====NOT Using Selective Sync"); csync_set_userdata(_csync_ctx, this); - _account->credentials()->syncContextPreStart(_csync_ctx); _stopWatch.start(); @@ -812,7 +811,6 @@ void SyncEngine::slotDiscoveryJobFinished(int discoveryResult) this, SLOT(slotItemCompleted(const SyncFileItem &, const PropagatorJob &))); connect(_propagator.data(), SIGNAL(progress(const SyncFileItem &,quint64)), this, SLOT(slotProgress(const SyncFileItem &,quint64))); - connect(_propagator.data(), SIGNAL(adjustTotalTransmissionSize(qint64)), this, SLOT(slotAdjustTotalTransmissionSize(qint64))); connect(_propagator.data(), SIGNAL(finished()), this, SLOT(slotFinished()), Qt::QueuedConnection); // apply the network limits to the propagator @@ -917,11 +915,6 @@ void SyncEngine::slotProgress(const SyncFileItem& item, quint64 current) } -void SyncEngine::slotAdjustTotalTransmissionSize(qint64 change) -{ - _progressInfo->adjustTotalSize(change); -} - /* Given a path on the remote, give the path as it is when the rename is done */ QString SyncEngine::adjustRenamedPath(const QString& original) { diff --git a/src/libsync/syncengine.h b/src/libsync/syncengine.h index 18379336f..e6c197191 100644 --- a/src/libsync/syncengine.h +++ b/src/libsync/syncengine.h @@ -125,7 +125,6 @@ private slots: void slotItemCompleted(const SyncFileItem& item, const PropagatorJob & job); void slotFinished(); void slotProgress(const SyncFileItem& item, quint64 curent); - void slotAdjustTotalTransmissionSize(qint64 change); void slotDiscoveryJobFinished(int updateResult); void slotCleanPollsJobAborted(const QString &error); -- 2.30.2