Commit 94e8d15a authored by Charles Vejnar's avatar Charles Vejnar

Patch for Bug 408174. KWrite opens non-existing remote folder.

parent d36b82f5
......@@ -236,7 +236,13 @@ void KWrite::slotNew()
void KWrite::slotOpen()
{
const QList<QUrl> urls = QFileDialog::getOpenFileUrls(this, i18n("Open File"), m_view->document()->url());
// if file is not local, then remove filename from url
QList<QUrl> urls;
if (m_view->document()->url().isLocalFile()) {
urls = QFileDialog::getOpenFileUrls(this, i18n("Open File"), m_view->document()->url());
} else {
urls = QFileDialog::getOpenFileUrls(this, i18n("Open File"), m_view->document()->url().adjusted(QUrl::RemoveFilename));
}
for (const QUrl &url : urls) {
slotOpen(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