aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKåre Särs <kare.sars@iki.fi>2014-01-20 13:37:32 (GMT)
committerKåre Särs <kare.sars@iki.fi>2014-01-20 13:38:37 (GMT)
commitf4585e8a37eadac4931c42aa9a1450e7c125d890 (patch)
treeebbb984fba39b9c8e9b8c16dbf3202e96dd0be04
parent82d1b8daea4285c65600220c67b03319b982da46 (diff)
Fix opening of files by using QUrl::fromUserInput() in stead of QUrl()
-rw-r--r--addons/kate/search/plugin_search.cpp10
-rw-r--r--addons/kate/search/replace_matches.cpp4
2 files changed, 7 insertions, 7 deletions
diff --git a/addons/kate/search/plugin_search.cpp b/addons/kate/search/plugin_search.cpp
index 85b751e..a233078 100644
--- a/addons/kate/search/plugin_search.cpp
+++ b/addons/kate/search/plugin_search.cpp
@@ -648,7 +648,7 @@ QTreeWidgetItem * KatePluginSearchView::rootFileItem(const QString &url, const Q
}
// FIXME KF5
- QUrl kurl(url);
+ QUrl kurl = QUrl::fromUserInput(url);
QString path = kurl.isLocalFile() ? localFileDirUp (kurl).path() : kurl.url();
path.replace(m_resultBaseDir, QString());
QString name = kurl.fileName();
@@ -669,7 +669,7 @@ QTreeWidgetItem * KatePluginSearchView::rootFileItem(const QString &url, const Q
}
for (int i=0; i<root->childCount(); i++) {
- qDebug() << root->child(i)->data(0, ReplaceMatches::FileNameRole).toString() << fName;
+ //qDebug() << root->child(i)->data(0, ReplaceMatches::FileNameRole).toString() << fName;
if ((root->child(i)->data(0, ReplaceMatches::FileUrlRole).toString() == url)&&
(root->child(i)->data(0, ReplaceMatches::FileNameRole).toString() == fName)) {
int matches = root->child(i)->data(0, ReplaceMatches::LineRole).toInt() + 1;
@@ -788,7 +788,7 @@ void KatePluginSearchView::matchFound(const QString &url, const QString &fName,
doc = m_replacer.findNamed(fName);
}
else {
- doc = m_kateApp->findUrl(QUrl(url));
+ doc = m_kateApp->findUrl(QUrl::fromUserInput(url));
}
addMatchMark(doc, line, column, matchLen);
}
@@ -1345,7 +1345,7 @@ void KatePluginSearchView::itemSelected(QTreeWidgetItem *item)
KTextEditor::Document* doc;
QString url = item->data(0, ReplaceMatches::FileUrlRole).toString();
if (!url.isEmpty()) {
- doc = m_kateApp->findUrl(QUrl(url));
+ doc = m_kateApp->findUrl(QUrl::fromUserInput(url));
}
else {
doc = m_replacer.findNamed(item->data(0, ReplaceMatches::FileNameRole).toString());
@@ -1353,7 +1353,7 @@ void KatePluginSearchView::itemSelected(QTreeWidgetItem *item)
// add the marks to the document if it is not already open
if (!doc) {
- doc = m_kateApp->openUrl(QUrl(url));
+ doc = m_kateApp->openUrl(QUrl::fromUserInput(url));
if (doc) {
int line;
int column;
diff --git a/addons/kate/search/replace_matches.cpp b/addons/kate/search/replace_matches.cpp
index 354212b..0539b71 100644
--- a/addons/kate/search/replace_matches.cpp
+++ b/addons/kate/search/replace_matches.cpp
@@ -107,9 +107,9 @@ void ReplaceMatches::doReplaceNextMatch()
doc = findNamed(rootItem->data(0, FileNameRole).toString());
}
else {
- doc = m_manager->findUrl(QUrl(docUrl));
+ doc = m_manager->findUrl(QUrl::fromUserInput(docUrl));
if (!doc) {
- doc = m_manager->openUrl(QUrl(rootItem->data(0, FileUrlRole).toString()));
+ doc = m_manager->openUrl(QUrl::fromUserInput(rootItem->data(0, FileUrlRole).toString()));
}
}