diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2011-08-31 11:22:25 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2011-08-31 11:22:25 +0200 |
commit | c61d78ed048e0404389cb43867e2b238d7109b36 (patch) | |
tree | 1caaccb68e3341d0ef65e66369c3f878173e1c65 /src | |
parent | Remove "Ad Bk" and "New Bk Folder" actions from the bk folders menu (diff) | |
download | rekonq-c61d78ed048e0404389cb43867e2b238d7109b36.tar.xz |
Fix SSL widget crash
This was the crash (probably) occurred during ds2011 presentation.
Check if a list is empty before pulling something (with QList::first()
method).
Diffstat (limited to 'src')
-rw-r--r-- | src/urlbar/sslwidget.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/urlbar/sslwidget.cpp b/src/urlbar/sslwidget.cpp index 64275e81..1366d5cc 100644 --- a/src/urlbar/sslwidget.cpp +++ b/src/urlbar/sslwidget.cpp @@ -58,14 +58,13 @@ SSLWidget::SSLWidget(const QUrl &url, const WebSslInfo &info, QWidget *parent) QStringList firstCertErrorList; if (!certErrorList.isEmpty()) firstCertErrorList = certErrorList.first(); - QGridLayout *layout = new QGridLayout(this); QLabel *label; QLabel *imageLabel; int rows = 0; - // ------------------------------------------------------------------------------------------------------------------ + // ------------------------------------------------------------------------------------------------------ imageLabel = new QLabel(this); layout->addWidget(imageLabel, rows , 0, Qt::AlignCenter); @@ -82,9 +81,7 @@ SSLWidget::SSLWidget(const QUrl &url, const WebSslInfo &info, QWidget *parent) if (cert.isNull()) { label->setText(i18n("Warning: this site is NOT carrying a certificate!")); - imageLabel->setPixmap(KIcon("security-low").pixmap(32)); - layout->addWidget(label, rows++, 1); } else @@ -119,7 +116,7 @@ SSLWidget::SSLWidget(const QUrl &url, const WebSslInfo &info, QWidget *parent) layout->addWidget(label, rows++, 1); } - // ------------------------------------------------------------------------------------------------------------------ + // ------------------------------------------------------------------------------------------------------------- label = new QLabel(this); label->setWordWrap(true); label->setText(i18n("Encryption")); @@ -206,7 +203,10 @@ SSLWidget::SSLWidget(const QUrl &url, const WebSslInfo &info, QWidget *parent) label = new QLabel(this); label->setWordWrap(true); - HistoryItem firstVisit = rApp->historyManager()->find(url.toString()).first(); + QList<HistoryItem> hList = rApp->historyManager()->find(url.toString()); + HistoryItem firstVisit = hList.isEmpty() ? + HistoryItem() : + hList.first() ; if (firstVisit.visitCount == 1) { |