Commit c9f3d195 authored by Stefano Crocco's avatar Stefano Crocco
Browse files

Fix crash caused by using original view rather than actual view

UrlLoader::decideEmbedOrSave used the original view when deciding
whether it could be reused to open the URL, instead of using the view
provided using UrlLoader::setView. If the URL was opened by clicking on
a sidebar item, this caused a sidebar view to be used, rather than the
correct dolphin part. This lead to a crash because the sidebar view is
a passive view, which caused KonqViewManager::chooseNextView to return
nullptr

BUG: 458933
parent 093e7672
Pipeline #235453 passed with stage
in 5 minutes and 15 seconds
......@@ -583,7 +583,7 @@ void KonqMainWindow::openUrl(KonqView *_view, const QUrl &_url,
loader->setView(view);
loader->setOldLocationBarUrl(oldLocationBarURL);
if (!loader->isReady()) {
if (loader->isAsync()) {
bool earlySetLocationBarURL = false;
if (!view && !m_currentView) { // no view yet, e.g. starting with url as argument
earlySetLocationBarURL = true;
......
......@@ -104,11 +104,7 @@ void UrlLoader::start()
}
}
if (isMimeTypeKnown(m_mimeType)) {
decideAction();
} else {
m_isAsync = true;
}
m_isAsync = !isMimeTypeKnown(m_mimeType);
}
bool UrlLoader::isViewLocked() const
......@@ -151,10 +147,12 @@ void UrlLoader::abort()
void UrlLoader::goOn()
{
if (m_ready) {
performAction();
} else {
if (m_isAsync) {
launchOpenUrlJob(true);
} else {
decideAction();
m_ready = true;
performAction();
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment