musredit: improved file system watcher notification mechanism to prevent multiple user notifications.

This commit is contained in:
nemu
2010-10-15 07:36:00 +00:00
parent 99c1e8d17e
commit 3322097fdf
2 changed files with 8 additions and 1 deletions

View File

@ -2362,6 +2362,8 @@ void PTextEdit::fileChanged(const QString &fileName)
if (!fFileSystemWatcherActive)
return;
fFileSystemWatcherActive = false;
QString str = "File '" + fileName + "' changed on the system.\nDo you want to reload it?";
int result = QMessageBox::question(this, "**INFO**", str, QMessageBox::Yes, QMessageBox::No);
if (result == QMessageBox::Yes) {
@ -2374,8 +2376,10 @@ void PTextEdit::fileChanged(const QString &fileName)
}
}
if (idx == -1)
if (idx == -1) {
fileSystemWatcherActivation();
return;
}
// remove file from file system watcher
fFileSystemWatcher->removePath(fileName);
@ -2385,6 +2389,8 @@ void PTextEdit::fileChanged(const QString &fileName)
// load it
load(fileName, idx);
}
fileSystemWatcherActivation();
}
//----------------------------------------------------------------------------------------------------