mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01: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:
@@ -182,6 +182,14 @@ void DatabaseTabWidget::fileChanged(const QString &fileName)
|
|||||||
{
|
{
|
||||||
const bool wasEmpty = m_changedFiles.isEmpty();
|
const bool wasEmpty = m_changedFiles.isEmpty();
|
||||||
m_changedFiles.insert(fileName);
|
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())
|
if (wasEmpty && !m_changedFiles.isEmpty())
|
||||||
QTimer::singleShot(200, this, SLOT(checkReloadDatabases()));
|
QTimer::singleShot(200, this, SLOT(checkReloadDatabases()));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user