summaryrefslogtreecommitdiff
path: root/src/urlbar
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2013-07-12 15:46:50 +0200
committerAndrea Diamantini <adjam7@gmail.com>2013-07-12 15:46:50 +0200
commit27addebee71183965720662b05be2caf619d4d57 (patch)
tree789c9e2e5953571f54c7f40d972b111adf96058a /src/urlbar
parentAdd missing include (diff)
downloadrekonq-27addebee71183965720662b05be2caf619d4d57.tar.xz
Review ssl widget generation code.
This also seems to fix some way problem about multiple widget creations What about you, guys? CCBUG:321226
Diffstat (limited to 'src/urlbar')
-rw-r--r--src/urlbar/urlbar.cpp25
-rw-r--r--src/urlbar/urlbar.h3
2 files changed, 24 insertions, 4 deletions
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp
index 6775e02c..87e30f48 100644
--- a/src/urlbar/urlbar.cpp
+++ b/src/urlbar/urlbar.cpp
@@ -45,6 +45,7 @@
#include "adblockwidget.h"
#include "bookmarkwidget.h"
#include "rsswidget.h"
+#include "sslwidget.h"
#include "completionwidget.h"
#include "urlresolver.h"
@@ -61,6 +62,7 @@
#include <KMenu>
#include <KIcon>
#include <KIconLoader>
+#include <KMessageBox>
#include <KStandardAction>
#include <KAction>
@@ -647,7 +649,7 @@ void UrlBar::suggest()
void UrlBar::refreshFavicon()
{
- disconnect(_icon);
+ _icon->disconnect();
const QString scheme = _tab->url().protocol();
@@ -668,7 +670,7 @@ void UrlBar::refreshFavicon()
_icon->setIcon(KIcon("security-low"));
}
- connect(_icon, SIGNAL(clicked(QPoint)), _tab->page(), SLOT(showSSLInfo(QPoint)));
+ connect(_icon, SIGNAL(clicked(QPoint)), this, SLOT(showSSLInfo(QPoint)), Qt::UniqueConnection);
return;
}
@@ -759,7 +761,7 @@ void UrlBar::updateRightIconPosition(IconButton *icon, int iconsCount)
}
-void UrlBar::showRSSInfo(const QPoint &pos)
+void UrlBar::showRSSInfo(QPoint pos)
{
QWebElementCollection col = _tab->page()->mainFrame()->findAllElements("link[type=\"application/rss+xml\"]");
col.append(_tab->page()->mainFrame()->findAllElements("link[type=\"application/atom+xml\"]"));
@@ -793,6 +795,23 @@ void UrlBar::showRSSInfo(const QPoint &pos)
}
+void UrlBar::showSSLInfo(QPoint pos)
+{
+ if (_tab->url().scheme() == QL1S("https"))
+ {
+ SSLWidget *widget = new SSLWidget(_tab->url(), _tab->page()->sslInfo(), this);
+ widget->showAt(pos);
+ }
+ else
+ {
+ KMessageBox::information(this,
+ i18n("This site does not contain SSL information."),
+ i18nc("Secure Sockets Layer", "SSL")
+ );
+ }
+}
+
+
void UrlBar::manageStarred(QPoint pos)
{
KMenu menu;
diff --git a/src/urlbar/urlbar.h b/src/urlbar/urlbar.h
index 9c645f00..324e489b 100644
--- a/src/urlbar/urlbar.h
+++ b/src/urlbar/urlbar.h
@@ -127,7 +127,8 @@ private Q_SLOTS:
*/
void loadTypedUrl();
- void showRSSInfo(const QPoint &);
+ void showRSSInfo(QPoint);
+ void showSSLInfo(QPoint);
protected:
void paintEvent(QPaintEvent *event);