[Pkg-owncloud-commits] [owncloud-client] 216/470: Remove the tainted folder logic

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu May 12 16:25:05 UTC 2016


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 6d3fe9d865d5f0f4c4e2d03f289762ecbb521f68
Author: Jocelyn Turcotte <jturcotte at woboq.com>
Date:   Thu Mar 17 19:38:44 2016 +0100

    Remove the tainted folder logic
    
    This currently is no-op code since the socket API isn't notified
    that the tainted folder list changed, and the result is the same
    since a sync will be triggered within the next 5 seconds and the
    modified folder will be shown as SYNC at that point anyway.
    
    Removing the dependency to the file watcher allows moving the
    status estimation logic to libsync.
---
 src/gui/folder.cpp    | 38 --------------------------------------
 src/gui/folder.h      |  1 -
 src/gui/folderman.cpp |  3 ---
 3 files changed, 42 deletions(-)

diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp
index c0d0741..272d544 100644
--- a/src/gui/folder.cpp
+++ b/src/gui/folder.cpp
@@ -626,10 +626,6 @@ void Folder::slotThreadTreeWalkResult(const SyncFileItemVector& items)
 
 void Folder::slotAboutToPropagate(SyncFileItemVector& items)
 {
-    // empty the tainted list since the status generation code will use the _syncedItems
-    // (which imply the folder) to generate the syncing state icon now.
-    _stateTaintedFolders.clear();
-
     addErroredSyncItemPathsToList(items, &this->_stateLastSyncItemsWithErrorNew);
 }
 
@@ -648,14 +644,6 @@ bool Folder::estimateState(QString fn, csync_ftw_type_e t, SyncFileStatus* s)
                 return true;
             }
         }
-        if(!fn.endsWith(QLatin1Char('/'))) {
-            fn.append(QLatin1Char('/'));
-        }
-        if (Utility::doesSetContainPrefix(_stateTaintedFolders, fn)) {
-            qDebug() << Q_FUNC_INFO << "Folder is tainted, EVAL!" << fn;
-            s->set(SyncFileStatus::STATUS_EVAL);
-            return true;
-        }
         return false;
     } else if ( t== CSYNC_FTW_TYPE_FILE) {
         // check if errorList has the directory/file
@@ -700,31 +688,6 @@ bool Folder::isFileExcludedRelative(const QString& relativePath) const
     return _engine->excludedFiles().isExcluded(path() + relativePath, path(), _definition.ignoreHiddenFiles);
 }
 
-void Folder::watcherSlot(QString fn)
-{
-    // FIXME: On OS X we could not do this "if" since on OS X the file watcher ignores events for ourselves
-    // however to have the same behaviour atm on all platforms, we don't do it
-    if (_engine->isSyncRunning()) {
-        qDebug() << Q_FUNC_INFO << "Sync running, IGNORE event for " << fn;
-        return;
-    }
-    QFileInfo fi(fn);
-    if (fi.isFile()) {
-        fn = fi.path(); // depending on OS, file watcher might be for dir or file
-    }
-    // Make it a relative path depending on the folder
-    QString relativePath = fn.remove(0, path().length());
-    if( !relativePath.endsWith(QLatin1Char('/'))) {
-        relativePath.append(QLatin1Char('/'));
-    }
-    qDebug() << Q_FUNC_INFO << fi.canonicalFilePath() << fn << relativePath;
-    _stateTaintedFolders.insert(relativePath);
-
-    // Notify the SocketAPI?
-}
-
-
-
 void Folder::slotTerminateSync()
 {
     qDebug() << "folder " << alias() << " Terminating!";
@@ -913,7 +876,6 @@ void Folder::slotSyncFinished(bool success)
     // This is for sync state calculation
     _stateLastSyncItemsWithError = _stateLastSyncItemsWithErrorNew;
     _stateLastSyncItemsWithErrorNew.clear();
-    _stateTaintedFolders.clear(); // heuristic: assume the sync had been done, new file watches needed to taint dirs
 
     if (_csyncError) {
         _syncResult.setStatus(SyncResult::Error);
diff --git a/src/gui/folder.h b/src/gui/folder.h
index 8a7976a..59fa7f6 100644
--- a/src/gui/folder.h
+++ b/src/gui/folder.h
@@ -267,7 +267,6 @@ private slots:
 
     void slotEmitFinishedDelayed();
 
-    void watcherSlot(QString);
     void slotNewBigFolderDiscovered(const QString &);
 
 private:
diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp
index 4215ae0..69d028c 100644
--- a/src/gui/folderman.cpp
+++ b/src/gui/folderman.cpp
@@ -147,9 +147,6 @@ void FolderMan::registerFolderMonitor( Folder *folder )
         // is lost this way, but we do not need it for the current implementation.
         connect(fw, SIGNAL(pathChanged(QString)), folder, SLOT(slotWatchedPathChanged(QString)));
         _folderWatchers.insert(folder->alias(), fw);
-
-        // This is at the moment only for the behaviour of the SocketApi.
-        connect(fw, SIGNAL(pathChanged(QString)), folder, SLOT(watcherSlot(QString)));
     }
 
     // register the folder with the socket API

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list