summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/filterurljob.cpp11
-rw-r--r--src/urlbar/completionwidget.cpp6
-rw-r--r--src/urlbar/completionwidget.h3
-rw-r--r--src/urlbar/urlbar.cpp13
-rw-r--r--src/urlbar/urlbar.h2
5 files changed, 26 insertions, 9 deletions
diff --git a/src/filterurljob.cpp b/src/filterurljob.cpp
index e74f8ec8..f94b7810 100644
--- a/src/filterurljob.cpp
+++ b/src/filterurljob.cpp
@@ -58,7 +58,12 @@ void FilterUrlJob::run()
// the beautiful KDE web browsing shortcuts
KUriFilterData data(_urlString);
data.setCheckForExecutables(false); // if true, queries like "rekonq" or "dolphin" are considered as executables
- _url = KUriFilter::self()->filterUri(data)
- ? data.uri().pathOrUrl()
- : QUrl::fromUserInput( _urlString );
+
+ if(KUriFilter::self()->filterUri(data) && data.uriType() != KUriFilterData::Error)
+ {
+ QString tempUrlString = data.uri().url();
+ _url = KUrl(tempUrlString);
+ }
+ else
+ _url = QUrl::fromUserInput( _urlString );
}
diff --git a/src/urlbar/completionwidget.cpp b/src/urlbar/completionwidget.cpp
index 740f1471..0733b1f0 100644
--- a/src/urlbar/completionwidget.cpp
+++ b/src/urlbar/completionwidget.cpp
@@ -97,7 +97,6 @@ void CompletionWidget::sizeAndPosition()
void CompletionWidget::popup()
{
- down();
sizeAndPosition();
if (!isVisible())
show();
@@ -210,7 +209,10 @@ bool CompletionWidget::eventFilter( QObject *o, QEvent *e )
case Qt::Key_Enter:
case Qt::Key_Return:
hide();
- emit chosenUrl(_list.at(_currentIndex).url, Rekonq::CurrentTab);
+ if(_currentIndex >= 0)
+ emit chosenUrl(_list.at(_currentIndex).url, Rekonq::CurrentTab);
+ else
+ emit loadTypedUrl();
ev->accept();
return true;
break;
diff --git a/src/urlbar/completionwidget.h b/src/urlbar/completionwidget.h
index ab78e489..57a8bed0 100644
--- a/src/urlbar/completionwidget.h
+++ b/src/urlbar/completionwidget.h
@@ -59,7 +59,8 @@ private slots:
signals:
void chosenUrl(const KUrl &, Rekonq::OpenType);
-
+ void loadTypedUrl();
+
private:
void sizeAndPosition();
void up();
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp
index 3b79b06b..5423e5d0 100644
--- a/src/urlbar/urlbar.cpp
+++ b/src/urlbar/urlbar.cpp
@@ -74,6 +74,7 @@ UrlBar::UrlBar(QWidget *parent)
// suggestions
installEventFilter(_box);
connect(_box, SIGNAL(chosenUrl(const KUrl &, Rekonq::OpenType)), SLOT(activated(const KUrl &, Rekonq::OpenType)));
+ connect(_box, SIGNAL(loadTypedUrl()), this, SLOT(activated()));
}
@@ -108,8 +109,16 @@ void UrlBar::activated(const KUrl& url, Rekonq::OpenType type)
disconnect(this, SIGNAL(textChanged(const QString &)), this, SLOT(suggestUrls(const QString &)));
clearFocus();
- setUrl(url);
- Application::instance()->loadUrl(url, type);
+ KUrl loadingUrl;
+
+ if(url.isEmpty())
+ loadingUrl = KUrl(text());
+ else
+ loadingUrl = url;
+
+ setUrl(loadingUrl);
+
+ Application::instance()->loadUrl(loadingUrl, type);
}
diff --git a/src/urlbar/urlbar.h b/src/urlbar/urlbar.h
index a473638b..684a205e 100644
--- a/src/urlbar/urlbar.h
+++ b/src/urlbar/urlbar.h
@@ -60,7 +60,7 @@ public:
void setPrivateMode(bool on);
private slots:
- void activated(const KUrl& url, Rekonq::OpenType = Rekonq::CurrentTab);
+ void activated(const KUrl& url = KUrl(), Rekonq::OpenType = Rekonq::CurrentTab);
void suggestUrls(const QString &editedText);
void setQUrl(const QUrl &url);