Commit db88a569 authored by Nate Graham's avatar Nate Graham 🔩

Find aggregation.dbx at its new location

Summary: This file hasn't existed at that location for years. This patch updates the logic to find it at one of the several locations where it may live now.

Test Plan:
Dolphin no longer shows `inotify_add_watch("/home/name/.dropbox/aggregation.dbx") failed: "No such file or directory"` in the console output

BUG: 410355
FIXED-IN: 19.08.1

Reviewers: #dolphin, vialav

Reviewed By: vialav

Subscribers: vialav

Differential Revision: https://phabricator.kde.org/D22993
parent 058c71f6
......@@ -75,9 +75,20 @@ FileViewDropboxPlugin::FileViewDropboxPlugin(QObject* parent, const QVariantList
d->controlSocketPath = QDir::toNativeSeparators(dropboxDir % QLatin1String("command_socket"));
d->controlSocket->connectToServer(d->controlSocketPath);
connect(d->databaseFileWatcher, SIGNAL(fileChanged(QString)), SIGNAL(itemVersionsChanged()));
d->databaseFileWatcher->addPath(QDir::toNativeSeparators(dropboxDir % QLatin1String("aggregation.dbx")));
// Find and watch aggregation.dbx file
QDir dir(dropboxDir);
QStringList nameFilter("instance*");
QStringList instanceDirs = dir.entryList(nameFilter);
QString aggregationDB = "";
for (const QString &instance : instanceDirs) {
aggregationDB = dropboxDir + "/" + instance + "/" + "aggregation.dbx";
if (QFile::exists(aggregationDB)) {
d->databaseFileWatcher->addPath(aggregationDB);
break;
}
}
connect(d->databaseFileWatcher, SIGNAL(fileChanged(QString)), SIGNAL(itemVersionsChanged()));
connect(d->contextActions, SIGNAL(actionTriggered(QAction*)), SLOT(handleContextAction(QAction*)));
}
......
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