From 40d42f1230c4c0695f92edb69025b5c55d0d37e8 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Mon, 9 Oct 2017 12:06:25 +0200 Subject: [PATCH] LoadRequest: Replace isEmpty with isValid Also test for QUrl being valid, not just not empty --- src/lib/navigation/locationbar.cpp | 4 ++-- src/lib/webengine/loadrequest.cpp | 4 ++-- src/lib/webengine/loadrequest.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/navigation/locationbar.cpp b/src/lib/navigation/locationbar.cpp index 5d6a628e3..bdd51808c 100644 --- a/src/lib/navigation/locationbar.cpp +++ b/src/lib/navigation/locationbar.cpp @@ -204,7 +204,7 @@ LoadRequest LocationBar::createLoadRequest() const req.setUrl(item->url()); } - if (req.isEmpty()) { + if (!req.isValid()) { // One word needs special handling, because QUrl::fromUserInput // would convert it to QUrl("http://WORD") if (!t.contains(QL1C(' ')) && !t.contains(QL1C('.'))) { @@ -219,7 +219,7 @@ LoadRequest LocationBar::createLoadRequest() const } // Search when creating url failed - if (!req.url().isValid()) { + if (!req.isValid()) { req = mApp->searchEnginesManager()->searchResult(t); } diff --git a/src/lib/webengine/loadrequest.cpp b/src/lib/webengine/loadrequest.cpp index 9c490ae09..55c07d180 100644 --- a/src/lib/webengine/loadrequest.cpp +++ b/src/lib/webengine/loadrequest.cpp @@ -44,9 +44,9 @@ LoadRequest &LoadRequest::operator=(const LoadRequest &other) return *this; } -bool LoadRequest::isEmpty() const +bool LoadRequest::isValid() const { - return m_url.isEmpty(); + return m_url.isValid(); } QUrl LoadRequest::url() const diff --git a/src/lib/webengine/loadrequest.h b/src/lib/webengine/loadrequest.h index eecf23b7e..994cc9c4e 100644 --- a/src/lib/webengine/loadrequest.h +++ b/src/lib/webengine/loadrequest.h @@ -40,7 +40,7 @@ public: LoadRequest &operator=(const LoadRequest &other); - bool isEmpty() const; + bool isValid() const; QUrl url() const; void setUrl(const QUrl &url);