mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
Fix searching for strings with special whitespaces from locationbar
This fixes eg. search terms with double byte space. Closes #1622
This commit is contained in:
parent
27f0f9afac
commit
626bf8f4bb
|
@ -557,6 +557,15 @@ bool QzTools::isUtf8(const char* string)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool QzTools::containsSpace(const QString &str)
|
||||
{
|
||||
Q_FOREACH (const QChar &c, str) {
|
||||
if (c.isSpace())
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
QString QzTools::getExistingDirectory(const QString &name, QWidget* parent, const QString &caption, const QString &dir, QFileDialog::Options options)
|
||||
{
|
||||
Settings settings;
|
||||
|
|
|
@ -72,6 +72,8 @@ public:
|
|||
static QIcon iconFromFileName(const QString &fileName);
|
||||
static bool isUtf8(const char* string);
|
||||
|
||||
static bool containsSpace(const QString &str);
|
||||
|
||||
// QFileDialog static functions that remembers last used directory
|
||||
static QString getExistingDirectory(const QString &name, QWidget* parent = 0, const QString &caption = QString(), const QString &dir = QString(), QFileDialog::Options options = QFileDialog::ShowDirsOnly);
|
||||
static QString getOpenFileName(const QString &name, QWidget* parent = 0, const QString &caption = QString(), const QString &dir = QString(), const QString &filter = QString(), QString* selectedFilter = 0, QFileDialog::Options options = 0);
|
||||
|
|
|
@ -173,7 +173,7 @@ void WebView::load(const LoadRequest &request)
|
|||
// Make sure to correctly load hosts like localhost (eg. without the dot)
|
||||
if (!reqUrl.isEmpty() &&
|
||||
reqUrl.scheme().isEmpty() &&
|
||||
!reqUrl.path().contains(QL1C(' ')) &&
|
||||
!QzTools::containsSpace(reqUrl.path()) && // See #1622
|
||||
!reqUrl.path().contains(QL1C('.'))
|
||||
) {
|
||||
QUrl u(QSL("http://") + reqUrl.path());
|
||||
|
|
Loading…
Reference in New Issue
Block a user