Sync terminal with KIOFuse mount when browing remote directories
ClosedPublic

Authored by feverfew on Mar 25 2020, 8:30 PM.

Details

Summary

Adds the capability to sync the terminal with a KIOFuse mount if the URL is remote.
Partly based on the existence of another DBus currenly in review:
https://invent.kde.org/kde/kio-fuse/-/merge_requests/21

Syncing works in both "directions". Changing the URL to a remote URLin the
DolphinView will change the URL in the terminal to the KIOFuse local path equivalent.
Conversely changing the URL in the terminal to one that happens to be in a KIOFuse
mount will change the URL in the DolphinView to the remote URL equivalent.

Test Plan

Manual testing (see video in comments).

  1. Checking that changing directory in DolphinView from remote/local to local doesn't

cause any regressions.

  1. Checking that changing directory in terminal from local to local (but not in

KIOFUse mount) doesn't cause any regressions.

  1. Checking that changing directory in DolphinView from remote/local to remote

correctly changes URL in terminal to KIOFuse equivalent.

  1. Checking that changing directory in terminal from local to KIOFuse path

correctly changes the URL in the DolphinView to the remote equivalent.

  1. Checking the KIOFuse not being installed doesn't cause any regressions.
  2. Changing directories very quickly does not cause any slowdown.

Diff Detail

Repository
R318 Dolphin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
feverfew created this revision.Mar 25 2020, 8:30 PM
Restricted Application added a project: Dolphin. · View Herald TranscriptMar 25 2020, 8:30 PM
Restricted Application added a subscriber: kfm-devel. · View Herald Transcript
feverfew requested review of this revision.Mar 25 2020, 8:30 PM

Demo of feature:

fvogt requested changes to this revision.Mar 28 2020, 3:11 PM
fvogt added a subscriber: fvogt.
fvogt added inline comments.
src/panels/terminal/terminalpanel.cpp
282

IMO this should first check that it's inside a fuse mount before making an expensive DBus call.

This could be done using statvfs and checking for f_fsid == 0x65735546 // FUSE_SUPER_MAGIC or use KMountPoint which might be more expensive.

289

Has to be kiofuse_iface.remoteUrl(m_konsolePartCurrentDirectory); now

This revision now requires changes to proceed.Mar 28 2020, 3:11 PM
elvisangelaccio requested changes to this revision.Mar 29 2020, 10:26 AM
elvisangelaccio added a subscriber: elvisangelaccio.
elvisangelaccio added inline comments.
src/panels/terminal/terminalpanel.cpp
256

Please use camelCase

282

Please use KMountPoint or Solid or whatever is the framework for this stuff, because terminalpanel.cpp is also built on Windows.

feverfew updated this revision to Diff 78888.Mar 30 2020, 12:42 PM
  • Only do DBus call if mount is KIOFuse mount
  • make interface member of class
  • switch to camel case
elvisangelaccio accepted this revision.Apr 5 2020, 2:26 PM
elvisangelaccio added inline comments.
src/panels/terminal/terminalpanel.cpp
288

Prefer QLatin1String for comparisons.

@fvogt, all good now?

fvogt accepted this revision.Apr 6 2020, 6:17 AM
fvogt added inline comments.
src/panels/terminal/terminalpanel.cpp
288

Only for comparisons with const char* AFAICT. Here it would probably cause a malloc on each comparison instead.

This revision is now accepted and ready to land.Apr 6 2020, 6:17 AM
This revision was automatically updated to reflect the committed changes.