diff --git a/krusader/Panel/listpanel.cpp b/krusader/Panel/listpanel.cpp --- a/krusader/Panel/listpanel.cpp +++ b/krusader/Panel/listpanel.cpp @@ -1215,7 +1215,10 @@ QUrl url(cfg.readEntry("Url", "invalid")); if (!url.isValid()) url = QUrl::fromLocalFile(ROOT_DIR); - func->openUrl(url); + + // To mitigate locked tab misbehaviour while restoring a panel profile, + // we are calling ListPanelFunc::openUrlInitially to ignore "locked" property this time. + func->openUrlInitially(url); } setJumpBack(func->history->currentUrl()); diff --git a/krusader/Panel/panelfunc.h b/krusader/Panel/panelfunc.h --- a/krusader/Panel/panelfunc.h +++ b/krusader/Panel/panelfunc.h @@ -59,7 +59,10 @@ void execute(const QString&); void goInside(const QString&); void openUrl(const QUrl &path, const QString& nameToMakeCurrent = QString(), - bool manuallyEntered = false); + bool manuallyEntered = false, bool ignoreLockedTab = false); + void openUrlInitially(const QUrl &path) { + openUrl(path, QString(), false, true); + } void rename(const QString &oldname, const QString &newname); // actions @@ -144,9 +147,11 @@ bool isSyncing(const QUrl &url); // when externallyExecutable == true, the file can be executed or opened with other software void openFileNameInternal(const QString &name, bool externallyExecutable); - void immediateOpenUrl(const QUrl &url); + void immediateOpenUrl(const QUrl &url) { + openUrlInternal(url, QString(), true, false, false); + } void openUrlInternal(const QUrl &url, const QString& makeCurrent, - bool immediately, bool manuallyEntered); + bool immediately, bool manuallyEntered, bool ignoreLockedTab); void runCommand(QString cmd); ListPanel* panel; // our ListPanel diff --git a/krusader/Panel/panelfunc.cpp b/krusader/Panel/panelfunc.cpp --- a/krusader/Panel/panelfunc.cpp +++ b/krusader/Panel/panelfunc.cpp @@ -189,7 +189,7 @@ } void ListPanelFunc::openUrl(const QUrl &url, const QString& nameToMakeCurrent, - bool manuallyEntered) + bool manuallyEntered, bool ignoreLockedTab) { if (panel->syncBrowseButton->state() == SYNCBROWSE_CD) { //do sync-browse stuff.... @@ -199,22 +199,17 @@ QString relative = QDir(panel->virtualPath().path() + '/').relativeFilePath(url.path()); syncURL.setPath(QDir::cleanPath(syncURL.path() + '/' + relative)); panel->otherPanel()->gui->setLocked(false); - otherFunc()->openUrlInternal(syncURL, nameToMakeCurrent, false, false); + otherFunc()->openUrlInternal(syncURL, nameToMakeCurrent, false, false, false); } - openUrlInternal(url, nameToMakeCurrent, false, manuallyEntered); -} - -void ListPanelFunc::immediateOpenUrl(const QUrl &url) -{ - openUrlInternal(url, QString(), true, false); + openUrlInternal(url, nameToMakeCurrent, false, manuallyEntered, ignoreLockedTab); } void ListPanelFunc::openUrlInternal(const QUrl &url, const QString& nameToMakeCurrent, - bool immediately, bool manuallyEntered) + bool immediately, bool manuallyEntered, bool ignoreLockedTab) { const QUrl cleanUrl = cleanPath(url); - if (panel->isLocked() && + if (!ignoreLockedTab && panel->isLocked() && !files()->currentDirectory().matches(cleanUrl, QUrl::StripTrailingSlash)) { panel->_manager->newTab(url); urlManuallyEntered = false; diff --git a/krusader/krusaderview.cpp b/krusader/krusaderview.cpp --- a/krusader/krusaderview.cpp +++ b/krusader/krusaderview.cpp @@ -422,7 +422,7 @@ void KrusaderView::profiles(QString profileName) { - ProfileManager profileManager("Panel"); + ProfileManager profileManager("Panel", this); profileManager.hide(); connect(&profileManager, SIGNAL(saveToProfile(QString)), this, SLOT(savePanelProfiles(QString))); connect(&profileManager, SIGNAL(loadFromProfile(QString)), this, SLOT(loadPanelProfiles(QString)));