mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 13:25:52 +03:00
parent
1d09f6b60f
commit
d5a481f132
4 changed files with 14 additions and 14 deletions
|
@ -621,11 +621,6 @@ void Folder::removeFromSettings() const
|
|||
settings->remove(FolderMan::escapeAlias(_definition.alias));
|
||||
}
|
||||
|
||||
bool Folder::isFileExcludedAbsolute(const QString& fullPath) const
|
||||
{
|
||||
return _engine->excludedFiles().isExcluded(fullPath, path(), _definition.ignoreHiddenFiles);
|
||||
}
|
||||
|
||||
bool Folder::isFileExcludedRelative(const QString& relativePath) const
|
||||
{
|
||||
return _engine->excludedFiles().isExcluded(path() + relativePath, path(), _definition.ignoreHiddenFiles);
|
||||
|
|
|
@ -184,11 +184,6 @@ public:
|
|||
/// Removes the folder from the account's settings.
|
||||
void removeFromSettings() const;
|
||||
|
||||
/**
|
||||
* Returns whether a file inside this folder should be excluded.
|
||||
*/
|
||||
bool isFileExcludedAbsolute(const QString& fullPath) const;
|
||||
|
||||
/**
|
||||
* Returns whether a file inside this folder should be excluded.
|
||||
*/
|
||||
|
|
|
@ -41,7 +41,9 @@ FolderWatcher::FolderWatcher(const QString &root, Folder* folder)
|
|||
: QObject(folder),
|
||||
_folder(folder)
|
||||
{
|
||||
_d.reset(new FolderWatcherPrivate(this, root));
|
||||
_canonicalFolderPath = QFileInfo(root).canonicalFilePath();
|
||||
|
||||
_d.reset(new FolderWatcherPrivate(this, _canonicalFolderPath));
|
||||
|
||||
_timer.start();
|
||||
}
|
||||
|
@ -55,10 +57,17 @@ bool FolderWatcher::pathIsIgnored( const QString& path )
|
|||
if( !_folder ) return false;
|
||||
|
||||
#ifndef OWNCLOUD_TEST
|
||||
if (_folder->isFileExcludedAbsolute(path)) {
|
||||
qDebug() << "* Ignoring file" << path;
|
||||
QString relPath = path;
|
||||
if (relPath.startsWith(_canonicalFolderPath)) {
|
||||
relPath = relPath.remove(0, _canonicalFolderPath.length()+1);
|
||||
if (_folder->isFileExcludedRelative(relPath)) {
|
||||
qDebug() << "* Ignoring file" << relPath << "in" << _canonicalFolderPath;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// there could be an odd watch event not being inside the _canonicalFolderPath
|
||||
// We will just not ignore it then, who knows.
|
||||
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -89,6 +89,7 @@ private:
|
|||
QTime _timer;
|
||||
QSet<QString> _lastPaths;
|
||||
Folder* _folder;
|
||||
QString _canonicalFolderPath;
|
||||
|
||||
friend class FolderWatcherPrivate;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue