VFS: Prevent duplicated navigation panel icon
authorHannah von Reth <hannah.vonreth@owncloud.com>
Thu, 18 Jun 2020 14:10:02 +0000 (16:10 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:59:13 +0000 (10:59 +0100)
Issue: #7748

src/gui/accountsettings.cpp
src/gui/navigationpanehelper.cpp

index c88d2bb06fb8ccaa437dafa0e5670399a9855317..fa86144fb593ab5cc9c1679c109d2df41ac15385 100644 (file)
@@ -671,6 +671,9 @@ void AccountSettings::slotEnableVfsCurrentFolder()
         if (!enable || !folder)
             return;
 
+        // we might need to add or remove the panel entry as cfapi brings this feature out of the box
+        FolderMan::instance()->navigationPaneHelper().scheduleUpdateCloudStorageRegistry();
+
         // It is unsafe to switch on vfs while a sync is running - wait if necessary.
         auto connection = std::make_shared<QMetaObject::Connection>();
         auto switchVfsOn = [folder, connection, this]() {
@@ -738,6 +741,9 @@ void AccountSettings::slotDisableVfsCurrentFolder()
         if (msgBox->clickedButton() != acceptButton|| !folder)
             return;
 
+        // we might need to add or remove the panel entry as cfapi brings this feature out of the box
+        FolderMan::instance()->navigationPaneHelper().scheduleUpdateCloudStorageRegistry();
+
         // It is unsafe to switch off vfs while a sync is running - wait if necessary.
         auto connection = std::make_shared<QMetaObject::Connection>();
         auto switchVfsOff = [folder, connection, this]() {
index ce2bad09c2bb59d194cec51f6c0ae7c53aa75301..9b3c452ed905d24a76af2e5c4780e5871bd3ae35 100644 (file)
@@ -86,6 +86,9 @@ void NavigationPaneHelper::updateCloudStorageRegistry()
         // We currently don't distinguish between new and existing CLSIDs, if it's there we just
         // save over it. We at least need to update the tile in case we are suddently using multiple accounts.
         foreach (Folder *folder, _folderMan->map()) {
+            if (folder->vfs().mode() == Vfs::WindowsCfApi) {
+                continue;
+            }
             if (!folder->navigationPaneClsid().isNull()) {
                 // If it already exists, unmark it for removal, this is a valid sync root.
                 entriesToRemove.removeOne(folder->navigationPaneClsid());