mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Ensure that external DB changes are always detected.
QFileSystemWatcher seems to reset itself occasionally. This patch works around the issue by re-applying the QFileSystemWatcher whenever a change is handled.
This commit is contained in:
parent
b432103b82
commit
86a01b6984
@ -182,6 +182,14 @@ void DatabaseTabWidget::fileChanged(const QString &fileName)
|
||||
{
|
||||
const bool wasEmpty = m_changedFiles.isEmpty();
|
||||
m_changedFiles.insert(fileName);
|
||||
bool found = false;
|
||||
Q_FOREACH (QString f, m_fileWatcher->files()) {
|
||||
if (f == fileName) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) m_fileWatcher->addPath(fileName);
|
||||
if (wasEmpty && !m_changedFiles.isEmpty())
|
||||
QTimer::singleShot(200, this, SLOT(checkReloadDatabases()));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user