Fix scrolling to renamed file when using the rename dialog
ClosedPublic

Authored by elvisangelaccio on Sun, Jun 3, 4:34 PM.

Details

Summary

The RenameDialog::slotResult() slot is currently never called because
the dialog is deleted first, due to the usage of the WA_DeleteOnClose
attribute. This breaks the scroll-to-renamed-file feature when the
inline renaming is disabled.

Instead of deleting the dialog on close, we can use deleteLater() when
we are sure the dialog has actually finished its job, which is when the
KIO move job emits the result signal.

Test Plan
  • Disable inline renaming
  • Rename a file so that it goes out of the view
  • Check whether the view scrolls to the renamed file.

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.
elvisangelaccio created this revision.Sun, Jun 3, 4:34 PM
Restricted Application added a project: Dolphin. · View Herald TranscriptSun, Jun 3, 4:34 PM
Restricted Application added a subscriber: kfm-devel. · View Herald Transcript
elvisangelaccio requested review of this revision.Sun, Jun 3, 4:34 PM
ngraham accepted this revision.Sun, Jun 3, 6:17 PM
ngraham added a subscriber: ngraham.

Works great, couldn't break it.

This revision is now accepted and ready to land.Sun, Jun 3, 6:17 PM

Works for me as well. One potential issue is that the object is not deleted if the rename operation is cancelled as the flag is not there anymore.

Works for me as well. One potential issue is that the object is not deleted if the rename operation is cancelled as the flag is not there anymore.

Good catch, we can easily fix this.

  • Also delete when the dialog is rejected
emateli accepted this revision.Mon, Jun 4, 9:49 PM
This revision was automatically updated to reflect the committed changes.