Fix Explorer integration on Windows and the crash on other systems
authorMichael Schuster <michael@schuster.ms>
Mon, 13 Jan 2020 07:58:02 +0000 (08:58 +0100)
committerMichael Schuster <48932272+misch7@users.noreply.github.com>
Mon, 13 Jan 2020 08:25:01 +0000 (09:25 +0100)
- Ensure that the folder integration stays persistent in Explorer,
  the uninstaller removes the folder upon updating the client.
  Recreate all entries upon start. This has the benefit of removing
  old remains of non-working, outdated entries.

- Don't crash on the other systems when the user clicks the option
  button "Show sync folders in Explorer's Navigation Pane".
  Even though the option currently doesn't work on the other platforms,
  crashing is never good...

Signed-off-by: Michael Schuster <michael@schuster.ms>
src/gui/navigationpanehelper.cpp

index a5588108cf00c2362ad4c6bd5bf52cac6dc1a91a..d23b17463644daafb6028a3488ad022ff16be6b7 100644 (file)
@@ -32,6 +32,11 @@ NavigationPaneHelper::NavigationPaneHelper(FolderMan *folderMan)
 
     _updateCloudStorageRegistryTimer.setSingleShot(true);
     connect(&_updateCloudStorageRegistryTimer, &QTimer::timeout, this, &NavigationPaneHelper::updateCloudStorageRegistry);
+
+    // Ensure that the folder integration stays persistent in Explorer,
+    // the uninstaller removes the folder upon updating the client.
+    _showInExplorerNavigationPane = !_showInExplorerNavigationPane;
+    setShowInExplorerNavigationPane(!_showInExplorerNavigationPane);
 }
 
 void NavigationPaneHelper::setShowInExplorerNavigationPane(bool show)
@@ -139,7 +144,9 @@ void NavigationPaneHelper::updateCloudStorageRegistry()
 #else
             // This code path should only occur on Windows (the config will be false, and the checkbox invisible on other platforms).
             // Add runtime checks rather than #ifdefing out the whole code to help catch breakages when developing on other platforms.
-            Q_ASSERT(false);
+
+            // Don't crash, by any means!
+            // Q_ASSERT(false);
 #endif
         }
     }