summaryrefslogtreecommitdiff
path: root/src/webtab
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2013-01-27 01:47:55 +0100
committerAndrea Diamantini <adjam7@gmail.com>2013-01-27 01:47:55 +0100
commita0b27fd9c8cec145c8c16d0ab5f99d030ced7fb8 (patch)
tree4dd3f661648366b6899ad055f3061f154cc7aef6 /src/webtab
parentFix kpart window half shown (diff)
downloadrekonq-a0b27fd9c8cec145c8c16d0ab5f99d030ced7fb8.tar.xz
Fix tab when showing a kpart. Let also see title where needed
Diffstat (limited to 'src/webtab')
-rw-r--r--src/webtab/protocolhandler.cpp2
-rw-r--r--src/webtab/webtab.cpp49
-rw-r--r--src/webtab/webtab.h14
3 files changed, 48 insertions, 17 deletions
diff --git a/src/webtab/protocolhandler.cpp b/src/webtab/protocolhandler.cpp
index 69583284..4f2e765e 100644
--- a/src/webtab/protocolhandler.cpp
+++ b/src/webtab/protocolhandler.cpp
@@ -283,7 +283,7 @@ void ProtocolHandler::showResults(const KFileItemList &list)
if (ww)
{
ww->urlBar()->setQUrl(_url);
- ww->view()->setFocus();
+ ww->tabView()->setFocus();
}
if (_frame->page()->settings()->testAttribute(QWebSettings::PrivateBrowsingEnabled))
diff --git a/src/webtab/webtab.cpp b/src/webtab/webtab.cpp
index 74fe720f..2060ddab 100644
--- a/src/webtab/webtab.cpp
+++ b/src/webtab/webtab.cpp
@@ -102,20 +102,24 @@ WebTab::WebTab(QWidget *parent, bool isPrivateBrowsing)
this, SLOT(createWalletBar(QString,QUrl)));
}
+ // Connect webview signals with related webtab ones
+ connect(view(), SIGNAL(loadFinished(bool)), this, SIGNAL(loadFinished(bool)));
+ connect(view(), SIGNAL(loadProgress(int)), this, SIGNAL(loadProgress (int)));
+ connect(view(), SIGNAL(loadStarted()), this, SIGNAL(loadStarted()));
+ connect(view(), SIGNAL(urlChanged(QUrl)), this, SIGNAL(urlChanged(QUrl)));
+ connect(view(), SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged(QString)));
+ connect(view(), SIGNAL(iconChanged()), this, SIGNAL(iconChanged()));
+
+ if (!parent)
+ {
+ connect(this, SIGNAL(titleChanged(QString)), this, SLOT(webAppTitleChanged(QString)));
+ connect(this, SIGNAL(iconChanged()), this, SLOT(webAppIconChanged()));
+ }
+
connect(view(), SIGNAL(loadProgress(int)), this, SLOT(updateProgress(int)));
connect(view(), SIGNAL(loadStarted()), this, SLOT(resetProgress()));
connect(view(), SIGNAL(loadFinished(bool)), this, SLOT(loadFinished()));
- if (parent)
- {
- connect(view(), SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged(QString)));
- }
- else
- {
- connect(view(), SIGNAL(titleChanged(QString)), this, SLOT(webAppTitleChanged(QString)));
- connect(view(), SIGNAL(iconChanged()), this, SLOT(webAppIconChanged()));
- }
-
// Session Manager
connect(view(), SIGNAL(loadFinished(bool)), SessionManager::self(), SLOT(saveSession()));
}
@@ -172,6 +176,22 @@ KUrl WebTab::url()
}
+QString WebTab::title()
+{
+ if (page() && page()->isOnRekonqPage())
+ {
+ return url().url();
+ }
+
+ if (view())
+ return view()->title();
+
+ kDebug() << "OOPS... NO web classes survived! Returning an empty title...";
+ return QString();
+
+}
+
+
void WebTab::updateProgress(int p)
{
m_progress = p;
@@ -258,10 +278,10 @@ void WebTab::createPreviewSelectorBar(int index)
m_previewSelectorBar.data()->animatedHide();
}
- connect(page(), SIGNAL(loadStarted()), m_previewSelectorBar.data(), SLOT(loadProgress()), Qt::UniqueConnection);
- connect(page(), SIGNAL(loadProgress(int)), m_previewSelectorBar.data(), SLOT(loadProgress()), Qt::UniqueConnection);
- connect(page(), SIGNAL(loadFinished(bool)), m_previewSelectorBar.data(), SLOT(loadFinished()), Qt::UniqueConnection);
- connect(page()->mainFrame(), SIGNAL(urlChanged(QUrl)), m_previewSelectorBar.data(), SLOT(verifyUrl()), Qt::UniqueConnection);
+ connect(this, SIGNAL(loadStarted()), m_previewSelectorBar.data(), SLOT(loadProgress()), Qt::UniqueConnection);
+ connect(this, SIGNAL(loadProgress(int)), m_previewSelectorBar.data(), SLOT(loadProgress()), Qt::UniqueConnection);
+ connect(this, SIGNAL(loadFinished(bool)), m_previewSelectorBar.data(), SLOT(loadFinished()), Qt::UniqueConnection);
+ connect(this, SIGNAL(urlChanged(QUrl)), m_previewSelectorBar.data(), SLOT(verifyUrl()), Qt::UniqueConnection);
}
@@ -288,6 +308,7 @@ void WebTab::setPart(KParts::ReadOnlyPart *p, const KUrl &u)
view()->hide();
m_splitter->hide();
emit titleChanged(u.url());
+ emit urlChanged(u.url());
return;
}
diff --git a/src/webtab/webtab.h b/src/webtab/webtab.h
index a168e55d..5fc06994 100644
--- a/src/webtab/webtab.h
+++ b/src/webtab/webtab.h
@@ -71,7 +71,8 @@ public:
}
KUrl url();
-
+ QString title();
+
bool hasRSSInfo();
void createPreviewSelectorBar(int index);
@@ -107,9 +108,18 @@ private Q_SLOTS:
void toggleInspector(bool);
Q_SIGNALS:
- void loadProgressing();
+ // NOTE: These signals are here to NOT expose webview directly and let
+ // others use webtab instead. This will give us the ability to generate
+ // our own signals when needed.
+ void iconChanged();
+ void loadFinished(bool);
+ void loadProgress (int);
+ void loadStarted();
+ void urlChanged(const QUrl &);
void titleChanged(const QString &);
+ void loadProgressing();
+
void triggerPartPrint();
void infoToShow(QString);