[Pkg-owncloud-commits] [owncloud-client] 238/470: Move the SyncFileStatusTracker directory slash suffix logic in a method

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu May 12 16:25:08 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 ef57d4ae1139a92cfc3e84c745d9d317cffe4971
Author: Jocelyn Turcotte <jturcotte at woboq.com>
Date:   Tue Mar 29 17:55:02 2016 +0200

    Move the SyncFileStatusTracker directory slash suffix logic in a method
---
 src/libsync/syncfilestatustracker.cpp | 29 ++++++++++++++---------------
 src/libsync/syncfilestatustracker.h   |  2 ++
 2 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/src/libsync/syncfilestatustracker.cpp b/src/libsync/syncfilestatustracker.cpp
index dd59a59..5b57975 100644
--- a/src/libsync/syncfilestatustracker.cpp
+++ b/src/libsync/syncfilestatustracker.cpp
@@ -110,13 +110,7 @@ void SyncFileStatusTracker::slotAboutToPropagate(SyncFileItemVector& items)
         else if (showWarningInSocketApi(*item))
             _syncProblems[item->_file] = SyncFileStatus::StatusWarning;
 
-        QString systemFileName = _syncEngine->localPath() + item->destination();
-        // the trailing slash for directories must be appended as the filenames coming in
-        // from the plugins have that too. Otherwise the matching entry item is not found
-        // in the plugin.
-        if( item->_type == SyncFileItem::Type::Directory )
-            systemFileName += QLatin1Char('/');
-        emit fileStatusChanged(systemFileName, fileStatus(*item));
+        emit fileStatusChanged(getSystemDestination(*item), fileStatus(*item));
     }
 
     // Make sure to push any status that might have been resolved indirectly since the last sync
@@ -146,14 +140,7 @@ void SyncFileStatusTracker::slotItemCompleted(const SyncFileItem &item)
         Q_ASSERT(_syncProblems.find(item._file) == _syncProblems.end());
     }
 
-    QString systemFileName = _syncEngine->localPath() + item.destination();
-    // the trailing slash for directories must be appended as the filenames coming in
-    // from the plugins have that too. Otherwise the matching entry item is not found
-    // in the plugin.
-    if( item._type == SyncFileItem::Type::Directory ) {
-        systemFileName += QLatin1Char('/');
-    }
-    emit fileStatusChanged(systemFileName, fileStatus(item));
+    emit fileStatusChanged(getSystemDestination(item), fileStatus(item));
 }
 
 SyncFileStatus SyncFileStatusTracker::fileStatus(const SyncFileItem& item)
@@ -191,4 +178,16 @@ void SyncFileStatusTracker::invalidateParentPaths(const QString& path)
     }
 }
 
+QString SyncFileStatusTracker::getSystemDestination(const SyncFileItem& item)
+{
+    QString systemFileName = _syncEngine->localPath() + item.destination();
+    // the trailing slash for directories must be appended as the filenames coming in
+    // from the plugins have that too. Otherwise the matching entry item is not found
+    // in the plugin.
+    if( item._type == SyncFileItem::Type::Directory ) {
+        systemFileName += QLatin1Char('/');
+    }
+    return systemFileName;
+}
+
 }
diff --git a/src/libsync/syncfilestatustracker.h b/src/libsync/syncfilestatustracker.h
index a6ae1b3..e8e3984 100644
--- a/src/libsync/syncfilestatustracker.h
+++ b/src/libsync/syncfilestatustracker.h
@@ -46,6 +46,8 @@ private slots:
 private:
     SyncFileStatus fileStatus(const SyncFileItem& item);
     void invalidateParentPaths(const QString& path);
+    QString getSystemDestination(const SyncFileItem& syncEnginePath);
+
     SyncEngine* _syncEngine;
     std::map<QString, SyncFileStatus::SyncFileStatusTag> _syncProblems;
 };

-- 
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