diff options
author | Panagiotis Papadopoulos <pano_90@gmx.net> | 2009-12-09 17:23:35 +0100 |
---|---|---|
committer | Panagiotis Papadopoulos <pano_90@gmx.net> | 2009-12-09 17:23:35 +0100 |
commit | ba21553e2e6ce17fc4ad84b5ab587b4e7bc5345c (patch) | |
tree | 64f7b3a5cec066f06268e954899a78523dcaedf5 /src/urlbar | |
parent | Change a bit the WebKit settings UI (diff) | |
parent | xss attach prevention. (diff) | |
download | rekonq-ba21553e2e6ce17fc4ad84b5ab587b4e7bc5345c.tar.xz |
Merge branch 'master' of git://gitorious.org/rekonq/mainline into click-to-flash-ui
Diffstat (limited to 'src/urlbar')
-rw-r--r-- | src/urlbar/urlbar.cpp | 36 | ||||
-rw-r--r-- | src/urlbar/urlbar.h | 1 |
2 files changed, 17 insertions, 20 deletions
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index 2adfcd17..e9952c01 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -138,12 +138,13 @@ void UrlBar::setUrl(const QUrl& url) { if(url.scheme() == "about") { - m_currentUrl = ""; + m_currentUrl = KUrl(); setFocus(); } else - m_currentUrl = url; - + { + m_currentUrl = KUrl(url); + } updateUrl(); } @@ -166,8 +167,14 @@ void UrlBar::updateUrl() } KIcon icon; - if(m_currentUrl.isEmpty()) icon = KIcon("arrow-right"); - else icon = Application::icon(m_currentUrl); + if(m_currentUrl.isEmpty()) + { + icon = KIcon("arrow-right"); + } + else + { + icon = Application::icon(m_currentUrl); + } if (count()) { @@ -190,14 +197,14 @@ void UrlBar::updateUrl() } -void UrlBar::activated(const QString& url) +void UrlBar::activated(const QString& urlString) { - if (url.isEmpty()) + if (urlString.isEmpty()) return; - setUrl(url); + setUrl(urlString); - Application::historyManager()->addHistoryEntry(url); + Application::historyManager()->addHistoryEntry(urlString); emit activated(m_currentUrl); } @@ -260,15 +267,6 @@ void UrlBar::paintEvent(QPaintEvent *event) } -void UrlBar::focusOutEvent(QFocusEvent *event) -{ - // set back last loaded url in case user cleared it - if (!m_currentUrl.equals(KUrl(lineEdit()->text()))) setUrl(m_currentUrl); - - KHistoryComboBox::focusOutEvent(event); -} - - QSize UrlBar::sizeHint() const { return lineEdit()->sizeHint(); @@ -293,7 +291,7 @@ QLinearGradient UrlBar::generateGradient(const QColor &color, int height) void UrlBar::setBackgroundColor(QColor c) { - s_defaultBaseColor=c; + s_defaultBaseColor = c; repaint(); } diff --git a/src/urlbar/urlbar.h b/src/urlbar/urlbar.h index 0e8bab26..8d267b2c 100644 --- a/src/urlbar/urlbar.h +++ b/src/urlbar/urlbar.h @@ -78,7 +78,6 @@ private slots: protected: virtual void paintEvent(QPaintEvent *event); - virtual void focusOutEvent(QFocusEvent *event); virtual void keyPressEvent(QKeyEvent *event); private: |