https://bugs.kde.org/show_bug.cgi?id=380897

Eike Hein <h...@kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
      Latest Commit|                            |https://commits.kde.org/kio
                   |                            |/6ca0b93e6029dc53a09e9e498e
                   |                            |509ba714c2a1d7
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Eike Hein <h...@kde.org> ---
Git commit 6ca0b93e6029dc53a09e9e498e509ba714c2a1d7 by Eike Hein.
Committed on 30/06/2017 at 06:43.
Pushed by hein into branch 'master'.

Use KIO::rename instead of KIO::moveAs in setData

Summary:
We've recently been plagued by issues where renaming via KDirModel would
fail to call into the rename() implementation of kio_desktop (which is a
KIO::ForwardingSlaveBase). Instead it would end up doing a copy job on
its own, resulting in file removal + addition events, causing us to
ultimately lose icon positions on the desktop.

While I did work out why this happens through moveAs (it resolves to
local URLs and then does a direct rename on them, bypassing SimpleJob
calling into the slave), I failed to find anything wrong with it,
leaving the reasons for the behavior change as a mystery for now: It's
possible that fixes done to kio_desktop (e.g. 6911541421dc in plasma-
workspace) or porting away from kdelibs4support (f81c843dcfb3, same
repo) triggered it in some way in concert with KIO changes (super-
ficial bisecting didn't yield anything, though).

Meanwhile, this patch ports setData from moveAs to rename, which uses
SimpleJob directly, successfully calling into the slave (which we
really really want to do, as only the slave will trigger the right
KDirNotify change signals, avoiding a row remove+insert transaction
pair in the model).

This makes sense to me regardless of the behavior issue with moveAs.
While rename doesn't work across destination, setData operates on a
single model index, and only on the file name, so this can't happen
anyway, making rename the semantically correct call to make.
Related: bug 380898

Reviewers: #frameworks, dfaure, davidedmundson

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D6413

M  +2    -2    src/widgets/kdirmodel.cpp

https://commits.kde.org/kio/6ca0b93e6029dc53a09e9e498e509ba714c2a1d7

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to