Commit 2bac3af1 authored by Christoph Cullmann's avatar Christoph Cullmann

Merge branch 'vejnar/kate-master'

parents ba23be52 4306330e
......@@ -229,7 +229,13 @@ void KateViewManager::slotDocumentOpen()
} else {
startUrl = m_lastOpenDialogUrl;
}
const QList<QUrl> urls = QFileDialog::getOpenFileUrls(m_mainWindow, i18n("Open File"), startUrl);
// if file is not local, then remove filename from url
QList<QUrl> urls;
if (startUrl.isLocalFile()) {
urls = QFileDialog::getOpenFileUrls(m_mainWindow, i18n("Open File"), startUrl);
} else {
urls = QFileDialog::getOpenFileUrls(m_mainWindow, i18n("Open File"), startUrl.adjusted(QUrl::RemoveFilename));
}
/**
* emit size warning, for local files
......
......@@ -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