Commit 7cb55bb2 authored by Edric Milaret's avatar Edric Milaret Committed by gerrit2

contact: fix 2x add of contact

- We'll use the filewatcher as if it was a native API callback, thus
we do not add the new Person directly but wait for the filewatcher to
kick in and add it himself.

Issue: #78873
Change-Id: I5b4d173d7c2d96daf83b393f47858d16fda88544
parent 15a009a6
......@@ -183,9 +183,6 @@ WindowsContactEditor::addNew(Person *item)
file.write(doc.toByteArray());
file.close();
//Add it to the collection
addExisting(item);
return true;
}
......@@ -222,11 +219,11 @@ WindowsContactBackend::load()
QtConcurrent::run(this, &WindowsContactBackend::loadRun);
watcher_->addPath(QStandardPaths::writableLocation
(QStandardPaths::HomeLocation) + "/Contacts");
//FIXME: Temporary disabling watch on the dir because of double add
// QObject::connect(watcher_, &QFileSystemWatcher::directoryChanged, [=](QString path) {
// Q_UNUSED(path)
// QtConcurrent::run(this, &WindowsContactBackend::loadRun);
// });
QObject::connect(watcher_, &QFileSystemWatcher::directoryChanged, [=](QString path) {
Q_UNUSED(path)
QtConcurrent::run(this, &WindowsContactBackend::loadRun);
});
return true;
}
......
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