From 72e0446fbc7017e7703102f733568a4f2e3c5195 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 16 Apr 2010 03:14:48 +0200 Subject: Fixing Lionel's merge request: - clean/fix APIs - removed no more used methods/signals from CompletionWidget - use item->url() (as it has been defined) - Change the "pointing out text" from underline to bold (better, IMO) - QString --> Q/K url, as needed - Restore UrlFromUserInput engine: why it has been deleted? - Comment out the isHttp() check. That way I cannot in any way connect to localhost or to my home server. Apart from typing their IPs.. - Partially fixed the switch search engine implementation. Btw, I have to say I really don't like rekonq switch my default engine just because one time I decided to give a try to another... Not sure about. - Something more coming.. But tomorrow! Now it's 3:20 am here. Good night! --- src/urlbar/completionwidget.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/urlbar/completionwidget.cpp') diff --git a/src/urlbar/completionwidget.cpp b/src/urlbar/completionwidget.cpp index 42824af9..83e99f9d 100644 --- a/src/urlbar/completionwidget.cpp +++ b/src/urlbar/completionwidget.cpp @@ -45,8 +45,8 @@ #include -CompletionWidget::CompletionWidget( QWidget *parent) - :QFrame( parent, Qt::ToolTip) +CompletionWidget::CompletionWidget(QWidget *parent) + : QFrame( parent, Qt::ToolTip) , _parent(parent) , _currentIndex(-1) { @@ -206,12 +206,12 @@ bool CompletionWidget::eventFilter( QObject *o, QEvent *e ) case Qt::Key_Enter: case Qt::Key_Return: - hide(); - if(_currentIndex >= 0) - emit chosenUrl(_list.at(_currentIndex).url, Rekonq::CurrentTab); - else - emit loadTypedUrl(); + + // need this to let ListItem magic work.. + ListItem *child = findChild( QString::number(_currentIndex) ); + emit chosenUrl( child->url(), Rekonq::CurrentTab); ev->accept(); + hide(); return true; break; } @@ -233,6 +233,7 @@ void CompletionWidget::setVisible( bool visible ) Application::instance()->removeEventFilter(this); } + QFrame::setVisible(visible); } @@ -240,8 +241,8 @@ void CompletionWidget::setVisible( bool visible ) void CompletionWidget::itemChosen(ListItem *item, Qt::MouseButton button) { if(button == Qt::MidButton) - emit chosenUrl(_list.at(layout()->indexOf(item)).url, Rekonq::NewCurrentTab); + emit chosenUrl( item->url(), Rekonq::NewCurrentTab); else - emit chosenUrl(_list.at(layout()->indexOf(item)).url, Rekonq::CurrentTab); + emit chosenUrl( item->url(), Rekonq::CurrentTab); hide(); } -- cgit v1.2.1