Update selection after renaming a file
ClosedPublic

Authored by muhlenpfordt on Dec 4 2017, 8:17 AM.

Details

Summary

After a file is renamed, update selection in ContextManager to reference new filename.
Without this patch the window title is not updated after rename an a reload with F5 fails.

BUG: 249001

Test Plan
  1. Open a picture in Gwenview (single image view mode)
  2. Press F2 and rename the picture -> window title should be updated to new name
  3. Press F5 to reload picture -> image should still be viewed

Diff Detail

Repository
R260 Gwenview
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
muhlenpfordt requested review of this revision.Dec 4 2017, 8:17 AM
muhlenpfordt created this revision.
ngraham accepted this revision.Dec 4 2017, 2:04 PM

Nice simple patch. Looks good to me. Couldn't break it in testing.

This revision is now accepted and ready to land.Dec 4 2017, 2:04 PM
rkflx added a comment.Dec 5 2017, 12:44 AM

Thanks for yet another patch :) If you plan on contributing more in the future, I can recommend to setup the arc tool. This gets rid of "Context not available" in Phabricator's diff view, the committer does not have to add your authorship information manually and for you it is much easier to upload and update a Diff.


Regarding the commit message, it would be great if you could repeat the basic gist from the bug reports here, i.e. what was wrong before (window title, reload, …) and how it works now. The commit should be self-sufficient and reading the bug optional. Maybe just add a "test plan", which includes the steps to reproduce the failure / the fix in the running app.

I'll test some more tomorrow, but I don't expect to find any issues.

@ngraham I had to reopen https://bugs.kde.org/show_bug.cgi?id=345980, because this patch does not fix it.

lib/contextmanager.h
88

This suggests, that

changing the access rights to some functions or data members, for example from private to public. With some compilers, this information may be part of the signature.

…is BIC.

However, give me a day or two to finally figure this out in general. I hope we can just ignore any BC issues.

muhlenpfordt edited the summary of this revision. (Show Details)Dec 5 2017, 6:57 PM
muhlenpfordt edited the test plan for this revision. (Show Details)
muhlenpfordt added inline comments.Dec 5 2017, 7:02 PM
lib/contextmanager.h
88

No problem to insert a new member function (updateSelection?) which calls the private slot. Just give me a hint if I should change it.

rkflx accepted this revision.Dec 6 2017, 6:13 PM

Thanks, commit message looks excellent now. No issues found while testing.

I also looked at emitted signals and existing connections with gammaray and thought we could reuse those, because this way the Information sidebar is updated correctly even without your patch. But even emit contextManger()->selectionChanged() would not work, which is weird, because slotSelectionChanged does the same basically. Given these experiments, I'm confident you are doing the right thing.

lib/contextmanager.h
88

Finally got around to look into this, see D8785#176817. Let's not worry about BC in Gwenview anymore.

This revision was automatically updated to reflect the committed changes.