Commit 3cd9c596 authored by dt's avatar dt
Browse files

Optimize which folders we recursively enumerate

Reviewed-By: hunger
parent f6402f16
......@@ -644,15 +644,22 @@ void Qt4PriFileNode::watchFolders(const QSet<QString> &folders)
m_watchedFolders = folders;
}
void Qt4PriFileNode::folderChanged(const QString &)
void Qt4PriFileNode::folderChanged(const QString &folder)
{
//qDebug()<<"########## Qt4PriFileNode::folderChanged";
// So, we need to figure out which files changed.
QString changedFolder = folder;
if (!changedFolder.endsWith(QLatin1Char('/')))
changedFolder.append(QLatin1Char('/'));
// Collect all the files
QSet<QString> newFiles;
foreach (const QString &folder, m_watchedFolders) {
newFiles += recursiveEnumerate(folder);
newFiles += recursiveEnumerate(changedFolder);
foreach (const QString &file, m_recursiveEnumerateFiles) {
if (!file.startsWith(changedFolder))
newFiles.insert(file);
}
QSet<QString> addedFiles = newFiles;
......
......@@ -155,7 +155,7 @@ public:
bool renameFile(const FileType fileType,
const QString &filePath, const QString &newFilePath);
void folderChanged(const QString &folder);
void folderChanged(const QString &changedFolder);
bool deploysFolder(const QString &folder) const;
......
......@@ -1258,7 +1258,6 @@ void CentralizedFolderWatcher::folderChanged(const QString &folder)
if (!folder.endsWith('/'))
folderWithSlash.append('/');
// If a subdirectory was added, watch it too
QSet<QString> tmp = recursiveDirs(folderWithSlash);
if (!tmp.isEmpty()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment