Fix View Mode session restore
ClosedPublic

Authored by muhlenpfordt on Apr 16 2018, 1:15 PM.

Details

Summary

While restoring a saved session the last URL is selected but
View Mode is not triggered. This is caused by wrong order of
switching mode and setting the current URL.

BUG: 393176
FIXED-IN: 18.04.1

Test Plan
  • Open one or more instances of Gwenview in different states
  • Logout with session restore enabled
  • Login
  • All Gwenview windows should restore in Browse or View Mode

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.Apr 16 2018, 1:15 PM
muhlenpfordt created this revision.

Tested in a VM with Kubuntu 17.10 and with xsm.

app/mainwindow.cpp
1646

Not needed since it's set in showStartMainPage().

rkflx accepted this revision.Apr 18 2018, 9:29 PM
rkflx added a subscriber: rkflx.

While I first thought the problem has been there forever, via git blame it turns out that this is actually yet another sideeffect of D8196: Try to keep ContextManager in sync with viewed files in MainWindow, which on purpose prevented opening View without a valid URL. Your patch makes sense when you think about it in this light…

Thanks for fixing it on such short notice! LGTM

app/mainwindow.cpp
1644

If you are touching this, you might as well add a const ;)

1646

Agreed, but please split this out into a separate commit on master (no need for a Diff).

This revision is now accepted and ready to land.Apr 18 2018, 9:29 PM
muhlenpfordt marked 2 inline comments as done.

Added const / Readded setting mCurrentMainPageId

This revision was automatically updated to reflect the committed changes.

Agreed, but please split this out into a separate commit on master (no need for a Diff).

Changed here: 9b443ddf3510.