[Pkg-owncloud-commits] [owncloud-client] 155/484: SocketApi: Fix returning ignore for the root item all the time
Sandro Knauß
hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:32 UTC 2015
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 05dd9554f9d4f168f2cbd5a8157fe1a9337ad50a
Author: Olivier Goffart <ogoffart at woboq.com>
Date: Tue Oct 27 16:06:38 2015 +0100
SocketApi: Fix returning ignore for the root item all the time
---
src/gui/folder.cpp | 10 +++++-----
src/gui/socketapi.cpp | 12 ++++++------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp
index 5d3db6a..d66b8d7 100644
--- a/src/gui/folder.cpp
+++ b/src/gui/folder.cpp
@@ -703,16 +703,16 @@ void Folder::removeFromSettings() const
bool Folder::isFileExcludedAbsolute(const QString& fullPath) const
{
+ if (!fullPath.startsWith(path())) {
+ // Mark paths we're not responsible for as excluded...
+ return true;
+ }
+
QString myFullPath = fullPath;
if (myFullPath.endsWith(QLatin1Char('/'))) {
myFullPath.chop(1);
}
- if (!myFullPath.startsWith(path())) {
- // Mark paths we're not responsible for as excluded...
- return true;
- }
-
QString relativePath = myFullPath.mid(path().size());
auto excl = ExcludedFiles::instance().isExcluded(myFullPath, relativePath, _definition.ignoreHiddenFiles);
return excl != CSYNC_NOT_EXCLUDED;
diff --git a/src/gui/socketapi.cpp b/src/gui/socketapi.cpp
index 75190f7..a3ffa93 100644
--- a/src/gui/socketapi.cpp
+++ b/src/gui/socketapi.cpp
@@ -542,8 +542,8 @@ SyncFileStatus SocketApi::fileStatus(Folder *folder, const QString& systemFileNa
QString fileName = systemFileName.normalized(QString::NormalizationForm_C);
QString fileNameSlash = fileName;
- if( fileName != QLatin1String("/") && !fileName.isEmpty() ) {
- file = folder->path() + fileName;
+ if(fileName != QLatin1String("/") && !fileName.isEmpty()) {
+ file += fileName;
}
if( fileName.endsWith(QLatin1Char('/')) ) {
@@ -576,7 +576,7 @@ SyncFileStatus SocketApi::fileStatus(Folder *folder, const QString& systemFileNa
}
// Is it excluded?
- if( folder->isFileExcludedAbsolute(file) ) {
+ if( folder->isFileExcludedRelative(fileName) ) {
return SyncFileStatus(SyncFileStatus::STATUS_IGNORE);
}
@@ -591,7 +591,7 @@ SyncFileStatus SocketApi::fileStatus(Folder *folder, const QString& systemFileNa
SyncJournalFileRecord rec = dbFileRecord_capi(folder, fileName );
if (folder->estimateState(fileName, type, &status)) {
- qDebug() << Q_FUNC_INFO << "Folder estimated status for" << fileName << "to" << status.toSocketAPIString();
+ qDebug() << "Folder estimated status for" << fileName << "to" << status.toSocketAPIString();
} else if (fileName == "") {
// sync folder itself
switch (folder->syncResult().status()) {
@@ -621,7 +621,7 @@ SyncFileStatus SocketApi::fileStatus(Folder *folder, const QString& systemFileNa
if (rec.isValid()) {
status.set(SyncFileStatus::STATUS_SYNC);
} else {
- qDebug() << Q_FUNC_INFO << "Could not determine state for folder" << fileName << "will set STATUS_NEW";
+ qDebug() << "Could not determine state for folder" << fileName << "will set STATUS_NEW";
status.set(SyncFileStatus::STATUS_NEW);
}
} else if (type == CSYNC_FTW_TYPE_FILE) {
@@ -636,7 +636,7 @@ SyncFileStatus SocketApi::fileStatus(Folder *folder, const QString& systemFileNa
}
}
} else {
- qDebug() << Q_FUNC_INFO << "Could not determine state for file" << fileName << "will set STATUS_NEW";
+ qDebug() << "Could not determine state for file" << fileName << "will set STATUS_NEW";
status.set(SyncFileStatus::STATUS_NEW);
}
}
--
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