summaryrefslogtreecommitdiff
path: root/src/urlbar/completionwidget.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-12-12 18:47:35 +0100
committerAndrea Diamantini <adjam7@gmail.com>2012-12-12 18:47:35 +0100
commita1b660daae9dd252d84ec44e8a5102277539b395 (patch)
treec4cfc40343592860e985437fb672389719125715 /src/urlbar/completionwidget.cpp
parentgetSaveFileName --> getSaveUrl (diff)
downloadrekonq-a1b660daae9dd252d84ec44e8a5102277539b395.tar.xz
- Code style check (codestyle script round)
- restored CTRL + ENTER code - applied Vedant's patch about (thanks!!!) CCMAIL: vedant.kota@gmail.com REVIEW: 107662 REVIEWED-BY: Tirtha and me
Diffstat (limited to 'src/urlbar/completionwidget.cpp')
-rw-r--r--src/urlbar/completionwidget.cpp63
1 files changed, 33 insertions, 30 deletions
diff --git a/src/urlbar/completionwidget.cpp b/src/urlbar/completionwidget.cpp
index f227eec1..207cc3ca 100644
--- a/src/urlbar/completionwidget.cpp
+++ b/src/urlbar/completionwidget.cpp
@@ -264,39 +264,42 @@ bool CompletionWidget::eventFilter(QObject *obj, QEvent *ev)
{
w = qobject_cast<UrlBar *>(parent());
-// if (!w->text().startsWith(QL1S("http://"), Qt::CaseInsensitive))
-// {
-// QString append;
-// if (kev->modifiers() == Qt::ControlModifier)
-// {
-// append = QL1S(".com");
-// }
-// else if (kev->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier))
-// {
-// append = QL1S(".org");
-// }
-// else if (kev->modifiers() == Qt::ShiftModifier)
-// {
-// append = QL1S(".net");
-// }
-//
-// if (!append.isEmpty())
-// {
-// QUrl url(QL1S("http://") + w->text());
-// QString host = url.host();
-// if (!host.endsWith(append, Qt::CaseInsensitive))
-// {
-// host += append;
-// url.setHost(host);
-// }
-//
-// emit chosenUrl(url, Rekonq::CurrentTab);
-// }
-// }
+ if (!w->text().startsWith(QL1S("http://"), Qt::CaseInsensitive))
+ {
+ QString append;
+ if (kev->modifiers() == Qt::ControlModifier)
+ {
+ append = QL1S(".com");
+ }
+ else if (kev->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier))
+ {
+ append = QL1S(".org");
+ }
+ else if (kev->modifiers() == Qt::ShiftModifier)
+ {
+ append = QL1S(".net");
+ }
+
+ if (!append.isEmpty())
+ {
+ QUrl url(QL1S("http://") + w->text());
+ QString host = url.host();
+ if (!host.endsWith(append, Qt::CaseInsensitive))
+ {
+ host += append;
+ url.setHost(host);
+ }
+
+ emit chosenUrl(url, Rekonq::CurrentTab);
+ kev->accept();
+ hide();
+ return true;
+ }
+ }
KUrl urlToLoad;
Rekonq::OpenType type = Rekonq::CurrentTab;
-
+
if (_currentIndex == -1)
_currentIndex = 0;
child = findChild<ListItem *>(QString::number(_currentIndex));