Summary: | Duplicated password save toolbar and error | ||
---|---|---|---|
Product: | [Unmaintained] rekonq | Reporter: | Vladimir Jakovlev <nvbn.rm> |
Component: | general | Assignee: | Andrea Diamantini <adjam7> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | pano_90, thomas.burdick, user581 |
Priority: | NOR | ||
Version: | 0.4.95 | ||
Target Milestone: | 0.6 | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Vladimir Jakovlev
2010-07-03 16:45:06 UTC
This HAS to be fixed for 1.0... *** Bug 227022 has been marked as a duplicate of this bug. *** *** Bug 246716 has been marked as a duplicate of this bug. *** commit d20575b65d9b6d0f13e3b284bff32d181b19a888 Author: Andrea Diamantini <adjam7@gmail.com> Date: Wed Aug 25 12:36:37 2010 +0200 Adding QWeakPointers for the walletbar and the previewselectorbar. While this can be overkilling for the previewselectorbar, I'd like doing it for all the bars in our next stable, moving them INSIDE the webtab class, so that each webtab has its findbar, its zoombar and so on. This should fix BUG: 243508 Please, let me know if it's not the case.. Thanks! diff --git a/src/webtab.cpp b/src/webtab.cpp index 0b58d7c..d5c5b47 100644 --- a/src/webtab.cpp +++ b/src/webtab.cpp @@ -92,6 +92,8 @@ WebTab::WebTab(QWidget *parent) WebTab::~WebTab() { + _walletBar.clear(); + _previewSelectorBar.clear(); } @@ -131,6 +133,12 @@ void WebTab::updateProgress(int p) void WebTab::loadFinished(bool) { m_progress = 0; + if(_walletBar.isNull()) + { + kDebug() << "OK, it's null"; + } + else + kDebug() << "NO, it's NOT null"; } @@ -142,27 +150,35 @@ void WebTab::createWalletBar(const QString &key, const QUrl &url) if (blackList.contains(urlString)) return; + if(!_walletBar.isNull()) + { + _walletBar.clear(); + } KWebWallet *wallet = page()->wallet(); - WalletBar *walletBar = new WalletBar(this); - walletBar->onSaveFormData(key, url); - qobject_cast<QVBoxLayout *>(layout())->insertWidget(0, walletBar); + _walletBar = new WalletBar(this); + _walletBar.data()->onSaveFormData(key, url); + qobject_cast<QVBoxLayout *>(layout())->insertWidget(0, _walletBar.data() ); - connect(walletBar, SIGNAL(saveFormDataAccepted(const QString &)), + connect(_walletBar.data(), SIGNAL(saveFormDataAccepted(const QString &)), wallet, SLOT(acceptSaveFormDataRequest(const QString &))); - connect(walletBar, SIGNAL(saveFormDataRejected(const QString &)), + connect(_walletBar.data(), SIGNAL(saveFormDataRejected(const QString &)), wallet, SLOT(rejectSaveFormDataRequest(const QString &))); } void WebTab::createPreviewSelectorBar(int index) { - PreviewSelectorBar *bar = new PreviewSelectorBar(index, this); - qobject_cast<QVBoxLayout *>(layout())->insertWidget(0, bar); + if(!_previewSelectorBar.isNull()) + { + _previewSelectorBar.clear(); + } + _previewSelectorBar = new PreviewSelectorBar(index, this); + qobject_cast<QVBoxLayout *>(layout())->insertWidget(0, _previewSelectorBar.data()); - connect(page(), SIGNAL(loadStarted()), bar, SLOT(loadProgress())); - connect(page(), SIGNAL(loadProgress(int)), bar, SLOT(loadProgress())); - connect(page(), SIGNAL(loadFinished(bool)), bar, SLOT(loadFinished())); - connect(page()->mainFrame(), SIGNAL(urlChanged(QUrl)), bar, SLOT(verifyUrl())); + connect(page(), SIGNAL(loadStarted()), _previewSelectorBar.data(), SLOT(loadProgress())); + connect(page(), SIGNAL(loadProgress(int)), _previewSelectorBar.data(), SLOT(loadProgress())); + connect(page(), SIGNAL(loadFinished(bool)), _previewSelectorBar.data(), SLOT(loadFinished())); + connect(page()->mainFrame(), SIGNAL(urlChanged(QUrl)), _previewSelectorBar.data(), SLOT(verifyUrl())); } diff --git a/src/webtab.h b/src/webtab.h index e34bbcc..a24418e 100644 --- a/src/webtab.h +++ b/src/webtab.h @@ -41,6 +41,11 @@ // Qt Includes #include <QWidget> +#include <QWeakPointer> + +// Forward Declarations +class WalletBar; +class PreviewSelectorBar; class REKONQ_TESTS_EXPORT WebTab : public QWidget @@ -74,6 +79,9 @@ private: WebView *_view; int m_progress; + + QWeakPointer<WalletBar> _walletBar; + QWeakPointer<PreviewSelectorBar> _previewSelectorBar; }; #endif |