D27951: Allow users to change dropAction to MoveAction through kdeglobals

Méven Car noreply at phabricator.kde.org
Wed Apr 1 14:20:52 BST 2020


meven added a comment.


  In D27951#637792 <https://phabricator.kde.org/D27951#637792>, @trmdi wrote:
  
  > In D27951#637690 <https://phabricator.kde.org/D27951#637690>, @meven wrote:
  >
  > > Look into kde connect kioslave.
  > >  That does not concern this diff much though.
  >
  >
  > I don't understand this. I'm using KMountPoint to check if source and dest are on the same partion, it's working as expected.
  >  But if I switch to use `KIO::StatJob`, it will fail, because for the file inside a KDE Connect directory, `KIO::UDSEntry::UDS_DEVICE_ID` return the same value with the root partion.
  
  
  Maybe you don't much about KIO.
  
  Anything that uses `KIO::` calls is treated by ioslave which are programs to handle protocols.
  For instance file:/ (that handles /) or kdeconnect:/
  Anything that concerns a kdeconnet:/ url is handled by the kdeconnect ioslave, including the stat call made in `KIO::StatJob`.
  It is in the kdeconnect code base, the issue you point to is there.
  
  > Another question, will UDSEntry::UDS_DEVICE_ID be available on Windows?
  
  I am not a Windows specialist but I imagine we could hack together an equivalent solution (I am saying this should be possible not that we will implement, feel free to give it a try in file_win.cpp ;) ).

INLINE COMMENTS

> dropjob.cpp:309
> +            const QString &sourceDevice = mountPoints.findByPath(url.path())->mountedFrom();
> +            if (sourceDevice != destDevice && !KFileItem(url).isLink()) {
> +                allItemsAreSameDevice = false;

You can create a `KFileItem(url)` before, so that you can reuse it line 314, instead of building one again.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D27951

To: trmdi, ngraham, dfaure, meven, #vdg, davidedmundson
Cc: elvisangelaccio, davidedmundson, meven, kde-frameworks-devel, LeGast00n, cblack, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200401/bdbf8bea/attachment.html>


More information about the Kde-frameworks-devel mailing list