legacy propagator: Remove more code
authorMarkus Goetz <markus@woboq.com>
Wed, 28 Oct 2015 09:59:02 +0000 (10:59 +0100)
committerMarkus Goetz <markus@woboq.com>
Wed, 28 Oct 2015 09:59:02 +0000 (10:59 +0100)
16 files changed:
src/cmd/cmd.cpp
src/gui/creds/shibbolethcredentials.cpp
src/gui/creds/shibbolethcredentials.h
src/gui/folder.cpp
src/libsync/creds/abstractcredentials.h
src/libsync/creds/dummycredentials.cpp
src/libsync/creds/dummycredentials.h
src/libsync/creds/httpcredentials.cpp
src/libsync/creds/httpcredentials.h
src/libsync/creds/tokencredentials.cpp
src/libsync/creds/tokencredentials.h
src/libsync/owncloudpropagator.h
src/libsync/progressdispatcher.cpp
src/libsync/progressdispatcher.h
src/libsync/syncengine.cpp
src/libsync/syncengine.h

index 77c231a14af0481b1be6b8d532a5fda802dd15e6..11390dbf678f1ec10c529e6ee8da83115379cb3b 100644 (file)
@@ -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()) {
index 2e8308812e6541508e574f54695ee3c563b712b4..c082a2bc1a2dc0f8dff11ac10cf6322ea0b66850 100644 (file)
@@ -73,29 +73,6 @@ void ShibbolethCredentials::setAccount(Account* account)
     }
 }
 
-
-void ShibbolethCredentials::syncContextPreInit(CSYNC* ctx)
-{
-    Q_UNUSED(ctx);
-}
-
-QByteArray ShibbolethCredentials::prepareCookieData() const
-{
-    QString cookiesAsString;
-    QList<QNetworkCookie> 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));
index f4024bb7cd55cc5abd153193ffaaa72c9362934d..ecf66be9320988581534476046963bd69562de46 100644 (file)
@@ -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;
index 9dad4c9392a5b02adb081f9cf88cddeec1398662..be873792c9c91bb05a67b0e3ff676e51727251a9 100644 (file)
@@ -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);
index 607422641578fececcfa3512437772e01ed504c7..10947b9ed6d5a3a7ac2996a1617f2597894bde0a 100644 (file)
@@ -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;
index b0a0432350c4b8f599617f52d8ae2ef3d3cac8e6..33b408670aa2037031b13ebca1f46f4b81b6256c 100644 (file)
 namespace OCC
 {
 
-void DummyCredentials::syncContextPreInit(CSYNC*)
-{}
-
-void DummyCredentials::syncContextPreStart(CSYNC*)
-{}
-
 bool DummyCredentials::changed(AbstractCredentials* credentials) const
 {
     DummyCredentials* dummy(dynamic_cast< DummyCredentials* >(credentials));
index 4fa100b5267ab497bd1e6eee7245a7027d70a8ac..b1cc3cf5b9172fcec4818825405c4fca33bd0c2b 100644 (file)
@@ -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;
index 69f132e67883efc077ddc5bdd26fae34f0d8196b..4f29fb85e15c590098799a445b38d310bd463c62 100644 (file)
@@ -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));
index ce3d9c42b532299bb4b78b1a930e9bfcfb211245..d09fb1a2acc4689e1ea25fc4727af24e5ae71e6f 100644 (file)
@@ -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;
index f5ed499ca5474d21209a18fd2a6aa5482dddcfbf..6187fda0469ca37f3b56971d46673ff9ea24107d 100644 (file)
@@ -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));
index 3e5d1dfda9e7ceb6abb1ce938ee06c19a437b529..1564a28a947f2759fcc9cddb44a47c6d502cd329 100644 (file)
@@ -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;
index 2e334856e80a068602d9318423a958d7dd8134ef..15189bbfead8bf9377e12219411ff2db0f755827 100644 (file)
@@ -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:
 
index c599b1238a2e0beb006185aa5c3802fe47e8d2be..4caf81859756ca808f0104b6fa6f803de21a3684 100644 (file)
@@ -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;
index 0e68d15cfb3476a3fb7c03ec5f7fb037d9822eb5..0efcee71f70c5d704b10a6adf360339fa691d497 100644 (file)
@@ -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;
 
index cab49b499edfa65aeb92b85e43b1cb74ab6ee3a2..50197cd185b3fb524c1fc30e6159590468201526 100644 (file)
@@ -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)
 {
index 18379336f168b591cca73cc9df309630bf2c627a..e6c197191850b56b11c4e922da0de4fee55ad196 100644 (file)
@@ -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);