From 86896447cb57efe77925df58db5f3110ab67eea3 Mon Sep 17 00:00:00 2001 From: nowrep Date: Thu, 3 Mar 2011 15:54:12 +0100 Subject: [PATCH] [Crash Fix:] closing tabs (deleting WebTabs) --- src/autofill/autofillmodel.cpp | 2 +- src/navigation/locationbar.h | 2 +- src/webview/webview.cpp | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/autofill/autofillmodel.cpp b/src/autofill/autofillmodel.cpp index 6e2051242..b8a4cb137 100644 --- a/src/autofill/autofillmodel.cpp +++ b/src/autofill/autofillmodel.cpp @@ -2,7 +2,7 @@ #include "qupzilla.h" #include "webview.h" #include "mainapplication.h" -#include "autofillwidget.h" +#include "autofillnotification.h" AutoFillModel::AutoFillModel(QupZilla* mainClass, QObject *parent) : QObject(parent) diff --git a/src/navigation/locationbar.h b/src/navigation/locationbar.h index bcb3c4b06..695350768 100644 --- a/src/navigation/locationbar.h +++ b/src/navigation/locationbar.h @@ -37,6 +37,7 @@ public: public slots: void showUrl(const QUrl &url, bool empty = true); + void checkBookmark(); private slots: void siteIconChanged(); @@ -44,7 +45,6 @@ private slots: void textEdit(); void showPopup(); void bookmarkIconClicked(); - void checkBookmark(); void showSiteInfo(); void rssIconClicked(); diff --git a/src/webview/webview.cpp b/src/webview/webview.cpp index ab4972eae..98838174c 100644 --- a/src/webview/webview.cpp +++ b/src/webview/webview.cpp @@ -63,10 +63,11 @@ bool WebView::isCurrent() { if (!tabWidget()) return false; - if (qobject_cast(tabWidget()->widget(tabWidget()->currentIndex()))->view() == this) - return true; + WebTab* webTab = qobject_cast(tabWidget()->widget(tabWidget()->currentIndex())); + if (!webTab) + return false; - return false; + return (webTab->view() == this); } void WebView::urlChanged(const QUrl &url)