diff options
| author | Méven Car <[email protected]> | 2024-07-18 19:39:42 +0200 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2024-07-19 07:28:38 +0000 |
| commit | 2059ce2986e2d2cf6e22041b2ffe28e50b913c7f (patch) | |
| tree | db2503c75f23370b7970db44ef2c70728080dbf0 | |
| parent | 209fb69c3a34f2c87459a4de8958099762fc56a7 (diff) | |
search: url encode parameters to filenamesearch:/
To allow to pass caracters outside of latin1 encoding.
| -rw-r--r-- | src/search/dolphinsearchbox.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index 8962bd3d2..56e6543e7 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -120,13 +120,13 @@ QUrl DolphinSearchBox::urlForSearching() const url.setScheme(QStringLiteral("filenamesearch")); QUrlQuery query; - query.addQueryItem(QStringLiteral("search"), m_searchInput->text()); + query.addQueryItem(QStringLiteral("search"), QUrl::toPercentEncoding(m_searchInput->text())); if (m_contentButton->isChecked()) { query.addQueryItem(QStringLiteral("checkContent"), QStringLiteral("yes")); } - query.addQueryItem(QStringLiteral("url"), searchPath().url()); - query.addQueryItem(QStringLiteral("title"), queryTitle(m_searchInput->text())); + query.addQueryItem(QStringLiteral("url"), QUrl::toPercentEncoding(searchPath().url())); + query.addQueryItem(QStringLiteral("title"), QUrl::toPercentEncoding(queryTitle(m_searchInput->text()))); url.setQuery(query); } @@ -141,11 +141,11 @@ void DolphinSearchBox::fromSearchUrl(const QUrl &url) updateFromQuery(query); } else if (url.scheme() == QLatin1String("filenamesearch")) { const QUrlQuery query(url); - setText(query.queryItemValue(QStringLiteral("search"))); + setText(query.queryItemValue(QStringLiteral("search"), QUrl::FullyDecoded)); if (m_searchPath.scheme() != url.scheme()) { m_searchPath = QUrl(); } - setSearchPath(QUrl::fromUserInput(query.queryItemValue(QStringLiteral("url")), QString(), QUrl::AssumeLocalFile)); + setSearchPath(QUrl::fromUserInput(query.queryItemValue(QStringLiteral("url"), QUrl::FullyDecoded), QString(), QUrl::AssumeLocalFile)); m_contentButton->setChecked(query.queryItemValue(QStringLiteral("checkContent")) == QLatin1String("yes")); } else { setText(QString()); |
