From: Hannah von Reth Date: Thu, 18 Jun 2020 14:10:02 +0000 (+0200) Subject: VFS: Prevent duplicated navigation panel icon X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~96 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7fdb842ed23516ca30004570ad48f97a8698d594;p=nextcloud-desktop.git VFS: Prevent duplicated navigation panel icon Issue: #7748 --- diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index c88d2bb06..fa86144fb 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -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(); 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(); auto switchVfsOff = [folder, connection, this]() { diff --git a/src/gui/navigationpanehelper.cpp b/src/gui/navigationpanehelper.cpp index ce2bad09c..9b3c452ed 100644 --- a/src/gui/navigationpanehelper.cpp +++ b/src/gui/navigationpanehelper.cpp @@ -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());