Skip to content

Conversation

@eriolloan
Copy link

@eriolloan eriolloan commented Dec 11, 2025

Summary

Adds a new user setting to optionally disable CloudProviders D-Bus integration on Linux, allowing users to hide synchronized folders from the file manager sidebar while keeping sync functionality intact.

Changes

  • Adds checkbox in Settings → General: "Show synchronized folders in file manager sidebar"
  • Default: enabled (maintains current behavior)
  • When disabled: CloudProviders integration is not initialized
  • Linux-only feature (CloudProviders is Linux-specific via libcloudproviders)

Implementation details

  • New config setting: showCloudProvidersInFileManager (defaults to true)
  • UI checkbox only visible on Linux builds (#ifndef Q_OS_LINUX)
  • Early return in CloudProviderManager constructor when disabled
  • Requires application restart to take effect (CloudProviders initialized at startup)

Testing

  • Checkbox appears in General Settings (Linux only)
  • Default is enabled
  • Disabling + restart removes folders from Nautilus sidebar
  • Re-enabling + restart restores folders
  • Sync functionality works in both states

Screenshot

image

Related issues

Fixes #1982

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>
@eriolloan eriolloan force-pushed the feature/optional-cloudproviders-sidebar branch from 3d821a7 to cc8a441 Compare December 11, 2025 18:40
Comment on lines 50 to 55
OCC::ConfigFile cfg;
if (!cfg.showCloudProvidersInFileManager()) {
qCInfo(lcNextcloudCloudProviderIntegration) << "CloudProviders disabled by user setting";
return;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes more sense to move this logic to application.cpp, do the check before calling ownCloudGui::setupCloudProviders:

_gui->setupCloudProviders();

void GeneralSettings::slotToggleCloudProviders(bool checked)
{
ConfigFile cfgFile;
cfgFile.setShowCloudProvidersInFileManager(checked);
Copy link
Member

@camilasan camilasan Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beyond changing the config file, you need to call here ownCloudGui::setupCloudProviders (I could be wrong, maybe another function), so the change will take effect without restarting the client.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks I'll look into it tomorrow

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>
@eriolloan
Copy link
Author

Thanks for the review! I've moved the check to application.cpp.

Regarding making the toggle take effect without restart - I looked into this and ran into a few complications. Tell me if I'm mistaken but it looks like :

  1. setupCloudProviders() creates the manager with new CloudProviderManager(this) but doesn't store the pointer anywhere
  2. To dynamically enable/disable, we'd need to store _cloudProviderManager in ownCloudGui and implement a cleanup method
  3. More importantly, the manager registers with DBus (g_bus_own_name) during construction, and I'm not sure if simply destroying the object would properly unregister from DBus or if we'd need explicit cleanup

Is keeping the restart requirement acceptable for now? The tooltip does mention it's needed.
But i can look into what modifications would be needed.

@camilasan
Copy link
Member

camilasan commented Dec 16, 2025

Thanks for the review! I've moved the check to application.cpp.

Thanks for the PR.

We discussed your changes in the team and I am afraid I didn't realize the implications of your changes when I first reviewed it.

So we would like to propose the following:

  • remove the UI option: we think this new setting is very niche, most people will still use the default to enable the cloud providers. Keep it only in the config file.
    • for this I would suggest to also update the documentation so people will know it exists.

Regarding making the toggle take effect without restart - I looked into this and ran into a few complications. Tell me if I'm mistaken but it looks like :

  1. setupCloudProviders() creates the manager with new CloudProviderManager(this) but doesn't store the pointer anywhere

I think you can leave this as it is now.

  1. To dynamically enable/disable, we'd need to store _cloudProviderManager in ownCloudGui and implement a cleanup method

  2. More importantly, the manager registers with DBus (g_bus_own_name) during construction, and I'm not sure if simply destroying the object would properly unregister from DBus or if we'd need explicit cleanup

Given that now it would require to change the config file by hand, then items 2 and 3 are not a concern anymore.

I hope this proposal is OK with you :)

@eriolloan
Copy link
Author

Thanks for discussing this with the team! I'm happy to make the changes you suggest.

Before I do though, I'd like to share some context on why I thought a UI option would be valuable:

The problem affects several user groups:

  1. Users with multiple sync folders - the sidebar gets cluttered with many items, pushing devices and network mounts and other bookmarks down in Nautilus (sometimes requiring scrolling)

  2. Users who already bookmarked their folders - CloudProviders creates duplicates of folders they manually added to bookmarks

  3. Users on immutable distributions (like Fedora Silverblue/Kinoite, NixOS, etc.) - they can't easily edit the .desktop file workaround that some users recommend (example)

  4. Non-technical users - editing config files isn't intuitive for everyone

There are existing reports of this issue: issue #3361 (from 2021, still open) and I found myself in a combination of some of these situations, prompting the PR.

That said, I fully understand the concern about UI clutter for a niche feature.
Si if you prefer to keep it config-only with some documentation, I'm totally fine with that! Just wanted to make sure the use cases were clear. Let me know what you'd like me to do and I'll update the PR accordingly.

@github-actions
Copy link

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to disable file explorer integration

3 participants