diff options
author | Yoann Laissus <yoann.laissus@gmail.com> | 2010-03-29 18:32:16 +0200 |
---|---|---|
committer | Yoann Laissus <yoann.laissus@gmail.com> | 2010-03-29 18:32:16 +0200 |
commit | c6e137acee1f707d33afd6bf5bbbe994167d6a2f (patch) | |
tree | 0ee0f7aa32a5b5d5939f5e03a4d40fc3d3c85328 /src/urlbar/completionwidget.cpp | |
parent | rekonq 0.4.57 (diff) | |
download | rekonq-c6e137acee1f707d33afd6bf5bbbe994167d6a2f.tar.xz |
Add mid click support for the completition widget of the url bar
Diffstat (limited to 'src/urlbar/completionwidget.cpp')
-rw-r--r-- | src/urlbar/completionwidget.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/urlbar/completionwidget.cpp b/src/urlbar/completionwidget.cpp index 42abcb73..3ea35a0b 100644 --- a/src/urlbar/completionwidget.cpp +++ b/src/urlbar/completionwidget.cpp @@ -72,7 +72,7 @@ void CompletionWidget::insertSearchList(const UrlSearchList &list) { UrlSearchItem item = list.at(i); ListItem *suggestion = new ListItem(item); - connect(suggestion, SIGNAL(itemClicked(ListItem *)), this, SLOT(itemChosen(ListItem *))); + connect(suggestion, SIGNAL(itemClicked(ListItem *, Qt::MouseButton)), this, SLOT(itemChosen(ListItem *, Qt::MouseButton))); suggestion->setObjectName( QString::number(i) ); layout()->addWidget( suggestion ); } @@ -208,7 +208,7 @@ bool CompletionWidget::eventFilter( QObject *o, QEvent *e ) case Qt::Key_Return: hide(); - emit chosenUrl(currentUrl().url()); + emit chosenUrl(currentUrl().url(), Rekonq::CurrentTab); ev->accept(); return true; break; @@ -235,8 +235,11 @@ void CompletionWidget::setVisible( bool visible ) } -void CompletionWidget::itemChosen(ListItem *item) +void CompletionWidget::itemChosen(ListItem *item, Qt::MouseButton button) { - emit chosenUrl(_list.at(layout()->indexOf(item)).url); + if(button == Qt::MidButton) + emit chosenUrl(_list.at(layout()->indexOf(item)).url, Rekonq::NewCurrentTab); + else + emit chosenUrl(_list.at(layout()->indexOf(item)).url, Rekonq::CurrentTab); hide(); -}
\ No newline at end of file +} |