Skip to content

Dolphin and COSMIC Files integration - #3

Merged
bpresles merged 7 commits into
masterfrom
pdrive-file-managers-5338943f
Nov 13, 2026
Merged

bpresles merged 7 commits into
masterfrom
pdrive-file-managers-5338943f

Conversation

@bpresles

@bpresles bpresles commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • CLI: pdrive keep-offline PATH... and pdrive 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.
  • Dolphin (integrations/dolphin/, KDE Frameworks 6): a KOverlayIconPlugin shows the sync state emblems (non-blocking, bounded cache, refreshed on FileStatusChanged and on mount), and a KAbstractFileItemActionPlugin adds "Keep Available Offline" / "Free Up Space" for items inside the drive only.
  • pdrive-app integrations (integrations.rs): adds a "Proton Drive" place to user-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 setting file_manager_integration (default on, switch in the settings window) and pdrive-app --remove-integrations (called by uninstall.sh).
  • Packages: still a single package, now with the Nautilus extension and the Dolphin plugins. Plugin library dependencies are excluded (RPM __requires_exclude_from, DEB dh_shlibdeps -X), so a GNOME-only system does not pull KF6/Qt6 and a KDE one does not pull libnautilus-extension. Recommends: nautilus removed, Suggests: nautilus, dolphin added; Arch optdepends.
  • Scripts (install-system.sh builds what is detected), CI job dolphin-plugin (Debian 13), README, packaging/README.md, man pages, PLAN.md, French translations.
  • The "Open folder" button is unchanged (it follows mimeapps.list through GIO).
  • Known limitation: COSMIC Files has no extension API, so no emblems there; its context actions are shown on every file (hence the "PDrive:" prefix).

Test plan

  • cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings
  • cargo 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 -n on scripts, scripts/check-version.sh, rpmspec -P
  • Dolphin plugins build without warnings in Fedora and Debian 13 containers (KF 6.13 has KOverlayIconPlugin); both load through KPluginFactory
  • Toy RPM/DEB: no libKF6*, libQt6* or libnautilus-extension dependency with the exclusions
  • Package builds in containers (v0.3.0 native archive): RPM (Fedora 44) rpmlint 0 errors after 3719dec; DEB (Debian 13) lintian clean except the existing debug-file-with-no-debug-symbols of -dbgsym, Depends free of KF6/Qt6/libnautilus-extension; Arch namcap 0 errors after 42974c6 (warnings only)
  • AppImage build (unchanged by this PR)
  • CI job dolphin-plugin on GitHub (passes, with extension, native and rust)
  • COSMIC Files: the two context actions are present with the "PDrive :" prefix (French locale), checked by the user; folders load much faster with Faster folder loading in COSMIC Files, no full download for content sniffing #4
  • COSMIC Files: an action on a file outside the drive shows the notification (checked by the user)
  • COSMIC Files: switching the integration off removes the entries, on adds them back (checked by the user)
  • COSMIC Files: a single "ProtonDrive" favorite and exactly two PDrive actions in the COSMIC config after the off/on cycle (no duplicate of the favorite added by hand)
  • Dolphin 26.08 (Fedora 45, outside Plasma, test RPM): sync emblems shown, "Proton Drive" place present, no second volume under Devices (checked by the user). The emblem plugin was first silently dropped by Dolphin (fixed in 5248be1, verified with a loader that mimics Dolphin)
  • Dolphin: "Keep Available Offline" / "Free Up Space" in the context menu of drive files, and they work (checked by the user)
  • Dolphin: the actions are absent outside the drive (checked by the user)
  • Dolphin: emblems with the Breeze icon theme in a Plasma session
  • Switching from COSMIC to a KDE session without reinstalling
  • scripts/install-system.sh then uninstall.sh (42974c6) in a Fedora 45 container, as a user with sudo: the Nautilus extension, both Dolphin plugins (Qt plugin dir from qtpaths6), the cloud-providers .ini and pdrive.mo are installed, then all removed. Note: nautilus-devel does not pull gtk4-devel on Fedora 45 (already listed in the README requirements)
  • uninstall.sh with an install.sh installation (pdrive-app --remove-integrations from ~/.local/bin; the option itself was tested with a temporary HOME) and with plugins owned by a package (kept)

🤖 Generated with Claude Code

bpresles and others added 4 commits November 13, 2026 19:31
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>
bpresles and others added 3 commits November 13, 2026 21:16
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
bpresles merged commit beee7e2 into master Nov 13, 2026
4 checks passed
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>
@bpresles
bpresles deleted the pdrive-file-managers-5338943f branch November 14, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant