From a0528693a0a0570b2311105aeff3236c8c7e9ef8 Mon Sep 17 00:00:00 2001 From: eriolloan <15250783+eriolloan@users.noreply.github.com> Date: Thu, 11 Dec 2025 18:52:42 +0100 Subject: [PATCH 1/3] feat: Add option to disable CloudProviders sidebar integration Adds a new setting in General preferences to control whether synchronized folders appear in the file manager sidebar via CloudProviders on Linux. Changes: - Add 'showCloudProvidersInFileManager' config setting (defaults to true) - Add checkbox in General Settings UI (Linux only) - Check setting during CloudProviderManager initialization - Skip DBus registration when disabled The setting requires application restart to take effect. Signed-off-by: eriolloan <15250783+eriolloan@users.noreply.github.com> --- src/gui/cloudproviders/cloudprovidermanager.cpp | 11 +++++++++++ src/gui/generalsettings.cpp | 14 ++++++++++++++ src/gui/generalsettings.h | 1 + src/gui/generalsettings.ui | 10 ++++++++++ src/libsync/configfile.cpp | 13 +++++++++++++ src/libsync/configfile.h | 4 ++++ 6 files changed, 53 insertions(+) diff --git a/src/gui/cloudproviders/cloudprovidermanager.cpp b/src/gui/cloudproviders/cloudprovidermanager.cpp index b6adc9a159dce..b7e04adeb0fc9 100644 --- a/src/gui/cloudproviders/cloudprovidermanager.cpp +++ b/src/gui/cloudproviders/cloudprovidermanager.cpp @@ -11,6 +11,11 @@ #include "cloudprovidermanager.h" #include "account.h" #include "cloudproviderconfig.h" +#include "configfile.h" + +#include + +Q_DECLARE_LOGGING_CATEGORY(lcNextcloudCloudProviderIntegration) CloudProvidersProviderExporter *_providerExporter; @@ -42,6 +47,12 @@ void CloudProviderManager::registerSignals() CloudProviderManager::CloudProviderManager(QObject *parent) : QObject(parent) { + OCC::ConfigFile cfg; + if (!cfg.showCloudProvidersInFileManager()) { + qCInfo(lcNextcloudCloudProviderIntegration) << "CloudProviders disabled by user setting"; + return; + } + _folder_index = 0; g_bus_own_name (G_BUS_TYPE_SESSION, LIBCLOUDPROVIDERS_DBUS_BUS_NAME, G_BUS_NAME_OWNER_FLAGS_NONE, nullptr, on_name_acquired, nullptr, this, nullptr); } diff --git a/src/gui/generalsettings.cpp b/src/gui/generalsettings.cpp index bc6e01809fcb1..041de8f81111a 100644 --- a/src/gui/generalsettings.cpp +++ b/src/gui/generalsettings.cpp @@ -231,6 +231,8 @@ GeneralSettings::GeneralSettings(QWidget *parent) connect(_ui->showInExplorerNavigationPaneCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::slotShowInExplorerNavigationPane); + connect(_ui->showCloudProvidersCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::slotToggleCloudProviders); + // Rename 'Explorer' appropriately on non-Windows #ifdef Q_OS_MACOS QString txt = _ui->showInExplorerNavigationPaneCheckBox->text(); @@ -281,6 +283,11 @@ GeneralSettings::GeneralSettings(QWidget *parent) _ui->showInExplorerNavigationPaneCheckBox->setVisible(false); #endif + // Hide CloudProviders checkbox on non-Linux platforms +#ifndef Q_OS_LINUX + _ui->showCloudProvidersCheckBox->setVisible(false); +#endif + /* Set the left contents margin of the layout to zero to make the checkboxes * align properly vertically , fixes bug #3758 */ @@ -335,6 +342,7 @@ void GeneralSettings::loadMiscSettings() _ui->quotaWarningNotificationsCheckBox->setEnabled(cfgFile.optionalServerNotifications()); _ui->quotaWarningNotificationsCheckBox->setChecked(cfgFile.showQuotaWarningNotifications()); _ui->showInExplorerNavigationPaneCheckBox->setChecked(cfgFile.showInExplorerNavigationPane()); + _ui->showCloudProvidersCheckBox->setChecked(cfgFile.showCloudProvidersInFileManager()); _ui->newExternalStorage->setChecked(cfgFile.confirmExternalStorage()); _ui->monoIconsCheckBox->setChecked(cfgFile.monoIcons()); _ui->moveFilesToTrashCheckBox->setChecked(cfgFile.moveToTrash()); @@ -648,6 +656,12 @@ void GeneralSettings::slotShowInExplorerNavigationPane(bool checked) #endif } +void GeneralSettings::slotToggleCloudProviders(bool checked) +{ + ConfigFile cfgFile; + cfgFile.setShowCloudProvidersInFileManager(checked); +} + void GeneralSettings::slotIgnoreFilesEditor() { if (_ignoreEditor.isNull()) { diff --git a/src/gui/generalsettings.h b/src/gui/generalsettings.h index b62a7b3c07476..896247ea733b0 100644 --- a/src/gui/generalsettings.h +++ b/src/gui/generalsettings.h @@ -51,6 +51,7 @@ private slots: void slotToggleCallNotifications(bool); void slotToggleQuotaWarningNotifications(bool); void slotShowInExplorerNavigationPane(bool); + void slotToggleCloudProviders(bool); void slotIgnoreFilesEditor(); void slotCreateDebugArchive(); void loadMiscSettings(); diff --git a/src/gui/generalsettings.ui b/src/gui/generalsettings.ui index b26f433ed2653..2601da32d3bfa 100644 --- a/src/gui/generalsettings.ui +++ b/src/gui/generalsettings.ui @@ -65,6 +65,16 @@ + + + + Show synchronized folders in file manager sidebar + + + When enabled, synchronized folders will appear in the file manager's sidebar via CloudProviders (Linux only). Requires application restart. + + + diff --git a/src/libsync/configfile.cpp b/src/libsync/configfile.cpp index a04e71feb2862..348dffd955b99 100644 --- a/src/libsync/configfile.cpp +++ b/src/libsync/configfile.cpp @@ -231,6 +231,19 @@ void ConfigFile::setShowInExplorerNavigationPane(bool show) settings.sync(); } +bool ConfigFile::showCloudProvidersInFileManager() const +{ + QSettings settings(configFile(), QSettings::IniFormat); + return settings.value(showCloudProvidersInFileManagerC, true).toBool(); +} + +void ConfigFile::setShowCloudProvidersInFileManager(bool show) +{ + QSettings settings(configFile(), QSettings::IniFormat); + settings.setValue(showCloudProvidersInFileManagerC, show); + settings.sync(); +} + int ConfigFile::timeout() const { QSettings settings(configFile(), QSettings::IniFormat); diff --git a/src/libsync/configfile.h b/src/libsync/configfile.h index 86b77fadd235b..bf1b2e8f94c6b 100644 --- a/src/libsync/configfile.h +++ b/src/libsync/configfile.h @@ -172,6 +172,9 @@ class OWNCLOUDSYNC_EXPORT ConfigFile [[nodiscard]] bool showInExplorerNavigationPane() const; void setShowInExplorerNavigationPane(bool show); + [[nodiscard]] bool showCloudProvidersInFileManager() const; + void setShowCloudProvidersInFileManager(bool show); + [[nodiscard]] int timeout() const; [[nodiscard]] qint64 chunkSize() const; [[nodiscard]] qint64 maxChunkSize() const; @@ -296,6 +299,7 @@ class OWNCLOUDSYNC_EXPORT ConfigFile static constexpr char showQuotaWarningNotificationsC[] = "showQuotaWarningNotifications"; static constexpr char showChatNotificationsC[] = "showChatNotifications"; static constexpr char showInExplorerNavigationPaneC[] = "showInExplorerNavigationPane"; + static constexpr char showCloudProvidersInFileManagerC[] = "showCloudProvidersInFileManager"; static constexpr char confirmExternalStorageC[] = "confirmExternalStorage"; static constexpr char useNewBigFolderSizeLimitC[] = "useNewBigFolderSizeLimit"; static constexpr char newBigFolderSizeLimitC[] = "newBigFolderSizeLimit"; From a1ec3ad7715dced5a27382b9ffb18b0b9dcf059a Mon Sep 17 00:00:00 2001 From: eriolloan <15250783+eriolloan@users.noreply.github.com> Date: Mon, 15 Dec 2025 18:38:24 +0100 Subject: [PATCH 2/3] refactor: Move CloudProviders check to Application initialization Moves the setting check from CloudProviderManager constructor to Application startup, following the suggestion to check before calling setupCloudProviders rather than inside the manager itself. This keeps the initialization logic cleaner and more consistent with how other optional components are handled. Signed-off-by: eriolloan <15250783+eriolloan@users.noreply.github.com> --- src/gui/application.cpp | 4 +++- src/gui/cloudproviders/cloudprovidermanager.cpp | 11 ----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/gui/application.cpp b/src/gui/application.cpp index bea238ecc0a79..3c744bb0fc939 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -405,7 +405,9 @@ Application::Application(int &argc, char **argv) } #if WITH_LIBCLOUDPROVIDERS - _gui->setupCloudProviders(); + if (ConfigFile().showCloudProvidersInFileManager()) { + _gui->setupCloudProviders(); + } #endif if (_theme->doNotUseProxy()) { diff --git a/src/gui/cloudproviders/cloudprovidermanager.cpp b/src/gui/cloudproviders/cloudprovidermanager.cpp index b7e04adeb0fc9..b6adc9a159dce 100644 --- a/src/gui/cloudproviders/cloudprovidermanager.cpp +++ b/src/gui/cloudproviders/cloudprovidermanager.cpp @@ -11,11 +11,6 @@ #include "cloudprovidermanager.h" #include "account.h" #include "cloudproviderconfig.h" -#include "configfile.h" - -#include - -Q_DECLARE_LOGGING_CATEGORY(lcNextcloudCloudProviderIntegration) CloudProvidersProviderExporter *_providerExporter; @@ -47,12 +42,6 @@ void CloudProviderManager::registerSignals() CloudProviderManager::CloudProviderManager(QObject *parent) : QObject(parent) { - OCC::ConfigFile cfg; - if (!cfg.showCloudProvidersInFileManager()) { - qCInfo(lcNextcloudCloudProviderIntegration) << "CloudProviders disabled by user setting"; - return; - } - _folder_index = 0; g_bus_own_name (G_BUS_TYPE_SESSION, LIBCLOUDPROVIDERS_DBUS_BUS_NAME, G_BUS_NAME_OWNER_FLAGS_NONE, nullptr, on_name_acquired, nullptr, this, nullptr); } From 8c6204335f373ae7a0da7dc140c3aec448144f84 Mon Sep 17 00:00:00 2001 From: eriolloan <15250783+eriolloan@users.noreply.github.com> Date: Wed, 28 Jan 2026 21:50:52 +0100 Subject: [PATCH 3/3] refactor: Make CloudProviders setting config-only Remove UI checkbox from General Settings. Use showCloudProvidersInFileManager config file setting instead. Signed-off-by: eriolloan <15250783+eriolloan@users.noreply.github.com> --- src/gui/application.cpp | 11 +++++++++++ src/gui/generalsettings.cpp | 14 -------------- src/gui/generalsettings.h | 1 - src/gui/generalsettings.ui | 10 ---------- 4 files changed, 11 insertions(+), 25 deletions(-) diff --git a/src/gui/application.cpp b/src/gui/application.cpp index 3c744bb0fc939..7ef731f907adf 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -405,6 +405,17 @@ Application::Application(int &argc, char **argv) } #if WITH_LIBCLOUDPROVIDERS + // Configuration: showCloudProvidersInFileManager (default: true) + // This setting controls whether Nextcloud folders are exposed via the freedesktop + // CloudProviders D-Bus interface to file managers (Nautilus, etc.). + // + // Note: This is a config-file-only setting, not exposed in the UI, as it addresses + // a niche use case. + // + // Future: This global setting should be deprecated once file managers implement + // per-entry visibility controls for CloudProviders mount points. When that happens, + // users will be able to selectively hide individual cloud provider entries directly + // in their file manager preferences. if (ConfigFile().showCloudProvidersInFileManager()) { _gui->setupCloudProviders(); } diff --git a/src/gui/generalsettings.cpp b/src/gui/generalsettings.cpp index 041de8f81111a..bc6e01809fcb1 100644 --- a/src/gui/generalsettings.cpp +++ b/src/gui/generalsettings.cpp @@ -231,8 +231,6 @@ GeneralSettings::GeneralSettings(QWidget *parent) connect(_ui->showInExplorerNavigationPaneCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::slotShowInExplorerNavigationPane); - connect(_ui->showCloudProvidersCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::slotToggleCloudProviders); - // Rename 'Explorer' appropriately on non-Windows #ifdef Q_OS_MACOS QString txt = _ui->showInExplorerNavigationPaneCheckBox->text(); @@ -283,11 +281,6 @@ GeneralSettings::GeneralSettings(QWidget *parent) _ui->showInExplorerNavigationPaneCheckBox->setVisible(false); #endif - // Hide CloudProviders checkbox on non-Linux platforms -#ifndef Q_OS_LINUX - _ui->showCloudProvidersCheckBox->setVisible(false); -#endif - /* Set the left contents margin of the layout to zero to make the checkboxes * align properly vertically , fixes bug #3758 */ @@ -342,7 +335,6 @@ void GeneralSettings::loadMiscSettings() _ui->quotaWarningNotificationsCheckBox->setEnabled(cfgFile.optionalServerNotifications()); _ui->quotaWarningNotificationsCheckBox->setChecked(cfgFile.showQuotaWarningNotifications()); _ui->showInExplorerNavigationPaneCheckBox->setChecked(cfgFile.showInExplorerNavigationPane()); - _ui->showCloudProvidersCheckBox->setChecked(cfgFile.showCloudProvidersInFileManager()); _ui->newExternalStorage->setChecked(cfgFile.confirmExternalStorage()); _ui->monoIconsCheckBox->setChecked(cfgFile.monoIcons()); _ui->moveFilesToTrashCheckBox->setChecked(cfgFile.moveToTrash()); @@ -656,12 +648,6 @@ void GeneralSettings::slotShowInExplorerNavigationPane(bool checked) #endif } -void GeneralSettings::slotToggleCloudProviders(bool checked) -{ - ConfigFile cfgFile; - cfgFile.setShowCloudProvidersInFileManager(checked); -} - void GeneralSettings::slotIgnoreFilesEditor() { if (_ignoreEditor.isNull()) { diff --git a/src/gui/generalsettings.h b/src/gui/generalsettings.h index 896247ea733b0..b62a7b3c07476 100644 --- a/src/gui/generalsettings.h +++ b/src/gui/generalsettings.h @@ -51,7 +51,6 @@ private slots: void slotToggleCallNotifications(bool); void slotToggleQuotaWarningNotifications(bool); void slotShowInExplorerNavigationPane(bool); - void slotToggleCloudProviders(bool); void slotIgnoreFilesEditor(); void slotCreateDebugArchive(); void loadMiscSettings(); diff --git a/src/gui/generalsettings.ui b/src/gui/generalsettings.ui index 2601da32d3bfa..b26f433ed2653 100644 --- a/src/gui/generalsettings.ui +++ b/src/gui/generalsettings.ui @@ -65,16 +65,6 @@ - - - - Show synchronized folders in file manager sidebar - - - When enabled, synchronized folders will appear in the file manager's sidebar via CloudProviders (Linux only). Requires application restart. - - -