diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-02-24 15:55:23 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-02-24 15:55:23 +0100 |
commit | 10d01088d7189de8def4dab1e73a043607859b58 (patch) | |
tree | c7a52223cc550b9d890c84737123b1e29213d7c1 /src | |
parent | rekonq 0.3.95 (diff) | |
download | rekonq-10d01088d7189de8def4dab1e73a043607859b58.tar.xz |
Again, saving one WebView pointer for each tab
Diffstat (limited to 'src')
-rw-r--r-- | src/webtab.cpp | 34 | ||||
-rw-r--r-- | src/webtab.h | 7 |
2 files changed, 21 insertions, 20 deletions
diff --git a/src/webtab.cpp b/src/webtab.cpp index 4172103b..10898d46 100644 --- a/src/webtab.cpp +++ b/src/webtab.cpp @@ -62,12 +62,8 @@ WebTab::WebTab(QWidget *parent) : QWidget(parent) - , m_view( new WebView(this) ) , m_progress(0) { - // fix focus handling - setFocusProxy( m_view ); - QVBoxLayout *l = new QVBoxLayout(this); l->setMargin(0); l->setSpacing(0); @@ -80,10 +76,14 @@ WebTab::WebTab(QWidget *parent) l2->setMargin(0); l2->setSpacing(0); - l->addWidget(m_view); - m_view->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); - - KWebWallet *wallet = page()->wallet(); + WebView *view = new WebView(this); + l->addWidget(view); + view->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + + // fix focus handling + setFocusProxy( view ); + + KWebWallet *wallet = view->page()->wallet(); if(wallet) { @@ -91,34 +91,34 @@ WebTab::WebTab(QWidget *parent) this, SLOT(createWalletBar(const QString &, const QUrl &))); } - connect(page(), SIGNAL(statusBarMessage(const QString&)), this, SLOT(setStatusBarText(const QString&))); + connect(view->page(), SIGNAL(statusBarMessage(const QString&)), this, SLOT(setStatusBarText(const QString&))); - connect(m_view, SIGNAL(loadProgress(int)), this, SLOT(updateProgress(int))); - connect(m_view, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool))); + connect(view, SIGNAL(loadProgress(int)), this, SLOT(updateProgress(int))); + connect(view, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool))); } WebTab::~WebTab() { - delete m_view; } WebView *WebTab::view() { - return m_view; + WebView *view = qobject_cast<WebView *>( layout()->itemAt(1)->widget() ); + return view; } WebPage *WebTab::page() { - return m_view->page(); // FIXME + return view()->page(); } -KUrl WebTab::url() const -{ - return KUrl(m_view->url()); +KUrl WebTab::url() +{ + return KUrl( view()->url() ); } diff --git a/src/webtab.h b/src/webtab.h index d54ae5f8..8f434ee7 100644 --- a/src/webtab.h +++ b/src/webtab.h @@ -31,7 +31,9 @@ // KDE Includes #include <KUrl> -#include <KWebView> + +// Qt Includes +#include <QWidget> // Forward Declarations class WebPage; @@ -48,7 +50,7 @@ public: WebView *view(); WebPage *page(); - KUrl url() const; + KUrl url(); QString lastStatusBarText() const; int progress(); void createPreviewSelectorBar(int index); @@ -61,7 +63,6 @@ private slots: void createWalletBar(const QString &, const QUrl &); private: - WebView *const m_view; int m_progress; QString m_statusBarText; }; |