Fix loading a panel profile with locked tabs
ClosedPublic

Authored by martinkostolny on May 7 2017, 4:34 PM.

Details

Summary

When one is loading a saved Panel profile, old tabs are removed and profile-saved tabs are restored from settings. But locked tabs are loaded twice with other problems. This patch should fix that.

Specifically: I've added a new bool (ignoreLockedTab) to openUrl & openUrlInternal method for tab-restore special use. If anybody can see a better way, please advise :).

I've also added a widget parent to profile's "add new entry" dialog so that it opens in the middle of Krusader window.

Test Plan

Multiple Panel profile creation (some of the tabs locked), restore in random order. Restore profiles after Krusader restart. Removing profiles, overwriting profiles.

Diff Detail

Repository
R167 Krusader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
martinkostolny created this revision.May 7 2017, 4:34 PM
abika added a subscriber: abika.May 7 2017, 4:51 PM

When one is loading a saved Panel profile, old tabs are removed and profile-saved tabs are restored from settings. But locked tabs are loaded twice with other problems.

Are you sure about that? I thought I fixed this with 339d6090 two weeks ago and cannot reproduce it anymore.
Or is it something else now? What are you exactly doing to trigger the bug?

My apologies, Alex, I must have missed your fix otherwise I'd test my workflow right away. Now I see You have fixed most of the issues. I've found only one edge-case. Loading a profile is reusing opened tabs, so if You already have a locked tab, it is locked before openUrl() is called. Here is the minimal exact steps to reproduce it:

  1. start fresh krusader (empty config)
    • we will focus on left panel only for this test
  2. go to e.g. Downloads
  3. save profile (e.g. "p1")
  4. go back to home folder and lock the tab
  5. load profile p1 -> You should see 2 tabs now instead of one

Now, when I realized what was really the culprit, I've simplified the fix greatly. Thanks for pointing me to the commit!

abika accepted this revision as: abika.May 8 2017, 5:42 PM

Yes, I can reproduce this. Looks like I solved an issue and created a new one.

But with your fix everything should be alright now. At least I can't find anything. Thanks!

This revision is now accepted and ready to land.May 8 2017, 5:42 PM
This revision was automatically updated to reflect the committed changes.