LocationBar: Fix correctly loading "localhost" instead of launching search

Closes #2028
remotes/origin/Falkon/3.0
David Rosca 8 years ago
parent f0488c33c3
commit f3b7be2b5e
  1. 4
      src/lib/navigation/locationbar.cpp

@ -1,6 +1,6 @@
/* ============================================================
* Falkon - Qt web browser
* Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
* Copyright (C) 2010-2018 David Rosca <nowrep@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -207,7 +207,7 @@ LoadRequest LocationBar::createLoadRequest() const
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('.'))) {
if (t != QL1S("localhost") && !t.contains(QL1C(' ')) && !t.contains(QL1C('.'))) {
req.setUrl(QUrl(t));
} else {
const QUrl &guessed = QUrl::fromUserInput(t);

Loading…
Cancel
Save