Commit b8870e5b authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Stat the file before switching to it

This way if the document does not exist at least we do not loose the current file
FIXED-IN: 4.8.0
BUGS: 267344
parent 2c979407
......@@ -718,9 +718,14 @@ void Part::openUrlFromDocument(const KUrl &url)
if ( m_embedMode == PrintPreviewMode )
return;
m_bExtension->openUrlNotify();
m_bExtension->setLocationBarUrl(url.prettyUrl());
openUrl(url);
if (KIO::NetAccess::exists(url, KIO::NetAccess::SourceSide, widget()))
{
m_bExtension->openUrlNotify();
m_bExtension->setLocationBarUrl(url.prettyUrl());
openUrl(url);
} else {
KMessageBox::error( widget(), i18n("Could not open '%1'. File does not exist", url.pathOrUrl() ) );
}
}
void Part::openUrlFromBookmarks(const KUrl &_url)
......
Markdown is supported
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