Make sure we always have a CLSID when Explorer integration is used
authorKevin Ottens <kevin.ottens@nextcloud.com>
Mon, 3 Aug 2020 15:09:08 +0000 (17:09 +0200)
committerKevin Ottens <ervin@ipsquad.net>
Tue, 4 Aug 2020 05:33:53 +0000 (07:33 +0200)
We update properly the CLSID of folders to integrate them with the
Explorer pane when they are added or removed from the GUI. That said,
there might be cases of users adding folders to sync straight from the
GUI. In such a case the CLSID might be missing on config load so now we
assign one on the fly when that happens.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
src/gui/folderman.cpp

index 2ac7b6d2f663b3e7bdfad14493b40ad41e090bcf..be3a2f1e2abf51f09547a2b1024215872354c765 100644 (file)
@@ -945,6 +945,11 @@ Folder *FolderMan::addFolderInternal(FolderDefinition folderDefinition,
 
     auto folder = new Folder(folderDefinition, accountState, this);
 
+    if (_navigationPaneHelper.showInExplorerNavigationPane() && folderDefinition.navigationPaneClsid.isNull()) {
+        folder->setNavigationPaneClsid(QUuid::createUuid());
+        folder->saveToSettings();
+    }
+
     qCInfo(lcFolderMan) << "Adding folder to Folder Map " << folder << folder->alias();
     _folderMap[folder->alias()] = folder;
     if (folder->syncPaused()) {