Repository navigation
Dolphin and COSMIC Files integration - #3
Merged
Merged
Conversation
Run the KeepOffline and FreeUpSpace actions of the daemon from a command line, for file managers that can only launch a command (COSMIC Files) and for scripts. Paths are made absolute and must be inside the mount point or its target; the others are ignored. When none is, or when the daemon is not running, the reason is printed, a desktop notification is shown through org.freedesktop.Notifications and the exit status is 1. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
At every start, and when the mount point or the new setting file_manager_integration (on by default, switch in the settings) changes, pdrive-app sets up the user's file manager configuration according to what is installed, never to the current session: - Dolphin: a "Proton Drive" entry in user-places.xbel, marked with an ID, only when the file exists. - COSMIC Files (when its desktop file is installed): a favorite and two context-menu actions running "pdrive keep-offline" / "pdrive free-up-space". The RON files are edited as text so that nothing else in them changes. Writes are atomic, idempotent and limited to our own entries. The option --remove-integrations removes them and exits. The new key is accepted by the strict parser of the daemon. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Two C++ plugins in integrations/dolphin/, built with CMake and talking to the daemon over D-Bus like the Nautilus extension: - pdriveoverlay (KOverlayIconPlugin): the sync state emblems. getOverlays never blocks: it answers from a bounded cache and asks the daemon asynchronously, then emits overlaysChanged. FileStatusChanged refreshes what is shown, a mount makes Dolphin list the folder again. - pdriveactions (KAbstractFileItemActionPlugin): "Keep Available Offline" and "Free Up Space", only when every selected item is in the drive. The texts come from the existing "pdrive" gettext domain through i18nd, so Dolphin's own domain is untouched; update-po.sh extracts i18nd. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ration One package holds the Nautilus extension and the Dolphin plugins, without dependencies on KF6, Qt6 or libnautilus-extension: the RPM excludes the automatic requirements of both plugin directories, the DEB drops libnautilus-extension4 and runs dh_shlibdeps with -X on the plugins, the Arch package lists nautilus and dolphin as optdepends. Recommends: nautilus is replaced by Suggests: nautilus, dolphin, so that no file manager is favored. install-system.sh builds and installs what it detects (Nautilus, Dolphin), uninstall.sh also removes the Dolphin plugins and runs pdrive-app --remove-integrations. Build dependencies are added to the spec, control, PKGBUILD and the container scripts, and CI builds the plugins in a Debian 13 container. README, packaging/README.md and PLAN.md describe the file manager support and its limits. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
10 tasks done
The file managers are listed in the long descriptions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dolphin loads overlay plugins with QPluginLoader::instance() and a qobject_cast to KOverlayIconPlugin, so the plugin class must be the root object of the library (Q_PLUGIN_METADATA). With K_PLUGIN_CLASS_WITH_JSON the root object is a KPluginFactory and Dolphin silently dropped the plugin: no emblem was ever shown. Files Dolphin asks about before the daemon has answered with the mount point are now remembered and asked for again once it is known. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
namcap reported qt6-base, kio, kcoreaddons and ki18n as missing dependencies (errors). They are optional on purpose: one package serves every desktop, and dolphin brings them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bpresles
added a commit
that referenced
this pull request
Nov 14, 2026
* CLI: pdrive keep-offline and free-up-space Run the KeepOffline and FreeUpSpace actions of the daemon from a command line, for file managers that can only launch a command (COSMIC Files) and for scripts. Paths are made absolute and must be inside the mount point or its target; the others are ignored. When none is, or when the daemon is not running, the reason is printed, a desktop notification is shown through org.freedesktop.Notifications and the exit status is 1. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * pdrive-app: add the drive to Dolphin and COSMIC Files At every start, and when the mount point or the new setting file_manager_integration (on by default, switch in the settings) changes, pdrive-app sets up the user's file manager configuration according to what is installed, never to the current session: - Dolphin: a "Proton Drive" entry in user-places.xbel, marked with an ID, only when the file exists. - COSMIC Files (when its desktop file is installed): a favorite and two context-menu actions running "pdrive keep-offline" / "pdrive free-up-space". The RON files are edited as text so that nothing else in them changes. Writes are atomic, idempotent and limited to our own entries. The option --remove-integrations removes them and exits. The new key is accepted by the strict parser of the daemon. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Dolphin: emblems and offline actions plugins (KDE Frameworks 6) Two C++ plugins in integrations/dolphin/, built with CMake and talking to the daemon over D-Bus like the Nautilus extension: - pdriveoverlay (KOverlayIconPlugin): the sync state emblems. getOverlays never blocks: it answers from a bounded cache and asks the daemon asynchronously, then emits overlaysChanged. FileStatusChanged refreshes what is shown, a mount makes Dolphin list the folder again. - pdriveactions (KAbstractFileItemActionPlugin): "Keep Available Offline" and "Free Up Space", only when every selected item is in the drive. The texts come from the existing "pdrive" gettext domain through i18nd, so Dolphin's own domain is untouched; update-po.sh extracts i18nd. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Packages, scripts, CI and docs for the Dolphin and COSMIC Files integration One package holds the Nautilus extension and the Dolphin plugins, without dependencies on KF6, Qt6 or libnautilus-extension: the RPM excludes the automatic requirements of both plugin directories, the DEB drops libnautilus-extension4 and runs dh_shlibdeps with -X on the plugins, the Arch package lists nautilus and dolphin as optdepends. Recommends: nautilus is replaced by Suggests: nautilus, dolphin, so that no file manager is favored. install-system.sh builds and installs what it detects (Nautilus, Dolphin), uninstall.sh also removes the Dolphin plugins and runs pdrive-app --remove-integrations. Build dependencies are added to the spec, control, PKGBUILD and the container scripts, and CI builds the plugins in a Debian 13 container. README, packaging/README.md and PLAN.md describe the file manager support and its limits. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Packages: shorter summary (rpmlint summary-too-long) The file managers are listed in the long descriptions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Dolphin: emblems plugin loadable by Dolphin Dolphin loads overlay plugins with QPluginLoader::instance() and a qobject_cast to KOverlayIconPlugin, so the plugin class must be the root object of the library (Q_PLUGIN_METADATA). With K_PLUGIN_CLASS_WITH_JSON the root object is a KPluginFactory and Dolphin silently dropped the plugin: no emblem was ever shown. Files Dolphin asks about before the daemon has answered with the mount point are now remembered and asked for again once it is known. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Arch: list the libraries of the Dolphin plugins as optional dependencies namcap reported qt6-base, kio, kcoreaddons and ki18n as missing dependencies (errors). They are optional on purpose: one package serves every desktop, and dolphin brings them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pdrive keep-offline PATH...andpdrive free-up-space PATH...call the daemon over D-Bus; paths outside the drive are skipped, with a desktop notification when nothing applies or when the daemon is not running.integrations/dolphin/, KDE Frameworks 6): aKOverlayIconPluginshows the sync state emblems (non-blocking, bounded cache, refreshed onFileStatusChangedand on mount), and aKAbstractFileItemActionPluginadds "Keep Available Offline" / "Free Up Space" for items inside the drive only.integrations.rs): adds a "Proton Drive" place touser-places.xbel(Dolphin, KDE file dialogs), and a favorite plus two context actions ("PDrive: Keep Available Offline", "PDrive: Free Up Space") to COSMIC Files. Decided from the installed file managers, never from the current session, so switching desktops works. Idempotent, atomic writes, only PDrive entries touched. New settingfile_manager_integration(default on, switch in the settings window) andpdrive-app --remove-integrations(called byuninstall.sh).__requires_exclude_from, DEBdh_shlibdeps -X), so a GNOME-only system does not pull KF6/Qt6 and a KDE one does not pull libnautilus-extension.Recommends: nautilusremoved,Suggests: nautilus, dolphinadded; Archoptdepends.install-system.shbuilds what is detected), CI jobdolphin-plugin(Debian 13), README,packaging/README.md, man pages,PLAN.md, French translations.mimeapps.listthrough GIO).Test plan
cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warningscargo test --workspace: 137 passed (pdrived 90, pdrive-app 29, pdi18n 6, pdsdk 5, pdrive 4, pdcore 3)make -C extension,msgfmt --check po/*.po,bash -non scripts,scripts/check-version.sh,rpmspec -PKOverlayIconPlugin); both load throughKPluginFactorylibKF6*,libQt6*orlibnautilus-extensiondependency with the exclusionsdebug-file-with-no-debug-symbolsof-dbgsym,Dependsfree of KF6/Qt6/libnautilus-extension; Arch namcap 0 errors after 42974c6 (warnings only)dolphin-pluginon GitHub (passes, with extension, native and rust)scripts/install-system.shthenuninstall.sh(42974c6) in a Fedora 45 container, as a user with sudo: the Nautilus extension, both Dolphin plugins (Qt plugin dir fromqtpaths6), the cloud-providers.iniandpdrive.moare installed, then all removed. Note:nautilus-develdoes not pullgtk4-develon Fedora 45 (already listed in the README requirements)uninstall.shwith aninstall.shinstallation (pdrive-app --remove-integrationsfrom~/.local/bin; the option itself was tested with a temporary HOME) and with plugins owned by a package (kept)🤖 Generated with Claude Code