summaryrefslogtreecommitdiff
path: root/src/urlbar
diff options
context:
space:
mode:
Diffstat (limited to 'src/urlbar')
-rw-r--r--src/urlbar/adblockwidget.cpp10
-rw-r--r--src/urlbar/completionwidget.cpp63
-rw-r--r--src/urlbar/completionwidget.h2
-rw-r--r--src/urlbar/urlbar.cpp2
-rw-r--r--src/urlbar/urlbar.h2
-rw-r--r--src/urlbar/urlsuggester.cpp8
-rw-r--r--src/urlbar/urlsuggester.h2
7 files changed, 46 insertions, 43 deletions
diff --git a/src/urlbar/adblockwidget.cpp b/src/urlbar/adblockwidget.cpp
index 136fd2f2..063658eb 100644
--- a/src/urlbar/adblockwidget.cpp
+++ b/src/urlbar/adblockwidget.cpp
@@ -65,7 +65,7 @@ AdBlockWidget::AdBlockWidget(const QUrl &url, QWidget *parent)
QStringList hList = ReKonfig::whiteReferer();
const QString urlHost = _pageUrl.host();
- Q_FOREACH(const QString &host, hList)
+ Q_FOREACH(const QString & host, hList)
{
if (host.contains(urlHost))
{
@@ -73,11 +73,11 @@ AdBlockWidget::AdBlockWidget(const QUrl &url, QWidget *parent)
break;
}
}
-
+
// Checkbox
_chBox->setText(i18n("Enable adblock for this site"));
_chBox->setChecked(_isAdblockEnabledHere);
-
+
layout->addWidget(title);
layout->addWidget(_chBox);
@@ -110,7 +110,7 @@ void AdBlockWidget::accept()
if (on != _isAdblockEnabledHere)
{
QStringList hosts = ReKonfig::whiteReferer();
-
+
if (on)
{
kDebug() << "REMOVING IT...";
@@ -122,7 +122,7 @@ void AdBlockWidget::accept()
}
ReKonfig::setWhiteReferer(hosts);
-
+
emit updateIcon();
}
close();
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));
diff --git a/src/urlbar/completionwidget.h b/src/urlbar/completionwidget.h
index bd73584a..2857bacf 100644
--- a/src/urlbar/completionwidget.h
+++ b/src/urlbar/completionwidget.h
@@ -57,7 +57,7 @@ public:
void suggestUrls(const QString &text);
KUrl activeSuggestion();
-
+
private Q_SLOTS:
void itemChosen(ListItem *item, Qt::MouseButton = Qt::LeftButton, Qt::KeyboardModifiers = Qt::NoModifier);
void updateSuggestionList(const UrlSuggestionList &list, const QString& text);
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp
index 1bab4ae3..b980cd95 100644
--- a/src/urlbar/urlbar.cpp
+++ b/src/urlbar/urlbar.cpp
@@ -217,7 +217,7 @@ void UrlBar::loadTypedUrl()
// fallback here
urlToLoad = UrlResolver::urlFromTextTyped(text());
- loadRequestedUrl(urlToLoad);
+ loadRequestedUrl(urlToLoad);
}
diff --git a/src/urlbar/urlbar.h b/src/urlbar/urlbar.h
index 48447975..beb1caf4 100644
--- a/src/urlbar/urlbar.h
+++ b/src/urlbar/urlbar.h
@@ -138,7 +138,7 @@ protected:
Q_SIGNALS:
void focusIn();
-
+
private:
/**
* Updates right icon position, given its number in the right icons list
diff --git a/src/urlbar/urlsuggester.cpp b/src/urlbar/urlsuggester.cpp
index 7fbb2204..d6aaaf52 100644
--- a/src/urlbar/urlsuggester.cpp
+++ b/src/urlbar/urlsuggester.cpp
@@ -139,7 +139,7 @@ UrlSuggestionList UrlSuggester::orderedSearchItems()
// << QL1S("about:tabs")
// << QL1S("about:info")
;
-
+
QStringList aboutUrlResults = aboutUrlList.filter(_typedString, Qt::CaseInsensitive);
UrlSuggestionList list;
@@ -281,7 +281,7 @@ UrlSuggestionList UrlSuggester::orderLists()
list += browseSearch + relevant + _history + _bookmarks;
else
list += relevant + browseSearch + _history + _bookmarks;
-
+
return list;
}
@@ -328,7 +328,7 @@ void UrlSuggester::computeWebSearches()
{
engine = SearchEngine::defaultEngine();
}
-
+
if (engine)
{
UrlSuggestionItem item = UrlSuggestionItem(UrlSuggestionItem::Search, SearchEngine::buildQuery(engine, query), query, engine->name());
@@ -451,6 +451,6 @@ void UrlSuggester::removeBookmarksDuplicates()
_bookmarks.removeOne(item);
break;
}
- }
+ }
}
}
diff --git a/src/urlbar/urlsuggester.h b/src/urlbar/urlsuggester.h
index f3732d91..18b63bd4 100644
--- a/src/urlbar/urlsuggester.h
+++ b/src/urlbar/urlsuggester.h
@@ -137,7 +137,7 @@ private:
void computeBookmarks();
void removeBookmarksDuplicates();
-
+
UrlSuggestionList orderLists();
QString _typedString;