settings->remove(_definition.alias);
}
-bool Folder::isFileExcluded(const QString& fullPath) const
+bool Folder::isFileExcludedAbsolute(const QString& fullPath) const
{
QString myFullPath = fullPath;
if (myFullPath.endsWith(QLatin1Char('/'))) {
return excl != CSYNC_NOT_EXCLUDED;
}
+bool Folder::isFileExcludedRelative(const QString& relativePath) const
+{
+ return isFileExcludedAbsolute(path() + relativePath);
+}
+
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
/**
* Returns whether a file inside this folder should be excluded.
*/
- bool isFileExcluded(const QString& fullPath) const;
+ bool isFileExcludedAbsolute(const QString& fullPath) const;
+
+ /**
+ * Returns whether a file inside this folder should be excluded.
+ */
+ bool isFileExcludedRelative(const QString& relativePath) const;
signals:
void syncStateChange();
QMutableListIterator<QString> it(list);
while (it.hasNext()) {
it.next();
- if (parentInfo->_folder->isFileExcluded(it.value())) {
+ it.value().remove(pathToRemove);
+ if (parentInfo->_folder->isFileExcludedRelative(it.value())) {
it.remove();
- } else {
- it.value().remove(pathToRemove);
}
}
if( !_folder ) return false;
#ifndef OWNCLOUD_TEST
- if (_folder->isFileExcluded(path)) {
+ if (_folder->isFileExcludedAbsolute(path)) {
qDebug() << "* Ignoring file" << path;
return true;
}
QMutableListIterator<QString> it(list);
while (it.hasNext()) {
it.next();
- if (f.isFileExcluded(it.value())) {
+ QString path = it.value();
+ path.remove(pathToRemove);
+ if (f.isFileExcludedRelative(path)) {
it.remove();
}
}
if (_oldBlackList == QStringList("/")) {
_oldBlackList.clear();
foreach (QString path, list) {
- path.remove(pathToRemove);
if (path.isEmpty()) {
continue;
}
}
// Is it excluded?
- if( folder->isFileExcluded(file) ) {
+ if( folder->isFileExcludedAbsolute(file) ) {
return SyncFileStatus(SyncFileStatus::STATUS_IGNORE);
}