summaryrefslogtreecommitdiff
path: root/src/webtab.cpp
diff options
context:
space:
mode:
authorBenjamin Poulain <benjamin.poulain@nokia.com>2010-11-20 19:05:33 +0100
committerBenjamin Poulain <benjamin.poulain@nokia.com>2010-11-20 19:10:14 +0100
commit11769558f3f9107c45457ba7c735a1991e42f625 (patch)
treeffd7057c77794364291a030aa73aa534fb0ea863 /src/webtab.cpp
parentRemove the destructor of MainView (diff)
parentFix markup: (diff)
downloadrekonq-11769558f3f9107c45457ba7c735a1991e42f625.tar.xz
Merge branch 'master' of git://git.kde.org/rekonq
Conflicts: src/mainview.cpp src/mainview.h src/webtab.cpp src/webtab.h
Diffstat (limited to 'src/webtab.cpp')
-rw-r--r--src/webtab.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/webtab.cpp b/src/webtab.cpp
index 0bc7503c..bac73fec 100644
--- a/src/webtab.cpp
+++ b/src/webtab.cpp
@@ -51,6 +51,7 @@ WebTab::WebTab(QWidget *parent)
, m_webView(new WebView(this))
, m_urlBar(new UrlBar(this))
, m_progress(0)
+ , m_part(0)
{
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
@@ -74,6 +75,7 @@ WebTab::WebTab(QWidget *parent)
connect(m_webView, SIGNAL(loadProgress(int)), this, SLOT(updateProgress(int)));
connect(m_webView, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
+ connect(m_webView, SIGNAL(titleChanged(const QString &)), this, SIGNAL(titleChanged(const QString &)));
}
@@ -81,13 +83,18 @@ WebTab::~WebTab()
{
m_walletBar.clear();
m_previewSelectorBar.clear();
+
+ delete m_part;
}
KUrl WebTab::url()
{
if(page() && page()->isOnRekonqPage())
+ {
+ kDebug() << "REKONQ PAGE. URL = " << page()->loadingUrl();
return page()->loadingUrl();
+ }
return view()->url();
}
@@ -203,3 +210,28 @@ void WebTab::showRSSInfo(QPoint pos)
RSSWidget *widget = new RSSWidget(map, window());
widget->showAt(pos);
}
+
+
+void WebTab::setPart(KParts::ReadOnlyPart *p, const KUrl &u)
+{
+ if(p)
+ {
+ // Ok, part exists. Insert & show it..
+ m_part = p;
+ qobject_cast<QVBoxLayout *>(layout())->insertWidget(1, p->widget());
+ p->openUrl(u);
+ m_webView->hide();
+
+ emit titleChanged(u.url());
+ return;
+ }
+
+ if(!m_part)
+ return;
+
+ // Part NO more exists. Let's clean up from webtab
+ m_webView->show();
+ qobject_cast<QVBoxLayout *>(layout())->removeWidget(m_part->widget());
+ delete m_part;
+ m_part = 0;
+}