summaryrefslogtreecommitdiff
path: root/src/webtab
diff options
context:
space:
mode:
Diffstat (limited to 'src/webtab')
-rw-r--r--src/webtab/webtab.cpp109
-rw-r--r--src/webtab/webtab.h17
2 files changed, 5 insertions, 121 deletions
diff --git a/src/webtab/webtab.cpp b/src/webtab/webtab.cpp
index 81f63499..2dce52d4 100644
--- a/src/webtab/webtab.cpp
+++ b/src/webtab/webtab.cpp
@@ -39,13 +39,10 @@
#include "messagebar.h"
#include "previewselectorbar.h"
-// #include "rsswidget.h"
#include "searchenginebar.h"
-// #include "urlbar.h"
#include "walletbar.h"
#include "webpage.h"
#include "websnap.h"
-// #include "webshortcutwidget.h"
#include "webwindow.h"
@@ -54,9 +51,6 @@
#include <KStandardShortcut>
#include <KMenu>
#include <KActionMenu>
-#include <KWebView>
-#include <KDebug>
-#include <KBuildSycocaProgressDialog>
#include <kdeprintdialog.h>
#include <KLocalizedString>
@@ -237,54 +231,15 @@ void WebTab::createPreviewSelectorBar(int index)
}
-bool WebTab::hasRSSInfo()
-{
- QWebElementCollection col = page()->mainFrame()->findAllElements("link[type=\"application/rss+xml\"]");
- col.append(page()->mainFrame()->findAllElements("link[type=\"application/atom+xml\"]"));
- if (col.count() != 0)
- return true;
-
- return false;
-}
-
-
-void WebTab::showRSSInfo(const QPoint &pos)
+void WebTab::hideSelectorBar()
{
- QWebElementCollection col = page()->mainFrame()->findAllElements("link[type=\"application/rss+xml\"]");
- col.append(page()->mainFrame()->findAllElements("link[type=\"application/atom+xml\"]"));
-
- QMap<KUrl, QString> map;
-
- Q_FOREACH(const QWebElement & el, col)
- {
- QString urlString;
- if (el.attribute("href").startsWith(QL1S("http")))
- urlString = el.attribute("href");
- else
- {
- KUrl u = url();
- // NOTE
- // cd() is probably better than setPath() here,
- // for all those url sites just having a path
- if (u.cd(el.attribute("href")))
- urlString = u.toMimeDataString();
- }
-
- QString title = el.attribute("title");
- if (title.isEmpty())
- title = el.attribute("href");
-
- map.insert(KUrl(urlString), title);
- }
-
-// FIXME RSSWidget *widget = new RSSWidget(map, window());
-// widget->showAt(pos);
+ m_previewSelectorBar.data()->animatedHide();
}
-void WebTab::hideSelectorBar()
+KParts::ReadOnlyPart *WebTab::part()
{
- m_previewSelectorBar.data()->animatedHide();
+ return m_part;
}
@@ -313,62 +268,6 @@ void WebTab::setPart(KParts::ReadOnlyPart *p, const KUrl &u)
}
-KUrl WebTab::extractOpensearchUrl(QWebElement e)
-{
- QString href = e.attribute(QL1S("href"));
- KUrl url = KUrl(href);
- if (!href.contains(":"))
- {
- KUrl docUrl = m_webView->url();
- QString host = docUrl.scheme() + "://" + docUrl.host();
- if (docUrl.port() != -1)
- {
- host += QL1C(':') + QString::number(docUrl.port());
- }
- url = KUrl(docUrl, href);
- }
- return url;
-}
-
-
-bool WebTab::hasNewSearchEngine()
-{
-// QWebElement e = page()->mainFrame()->findFirstElement(QL1S("head >link[rel=\"search\"][ type=\"application/opensearchdescription+xml\"]"));
-// return !e.isNull() && !rApp->opensearchManager()->engineExists(extractOpensearchUrl(e));
- return false; // FIXME
-}
-
-
-void WebTab::showSearchEngine(const QPoint &pos)
-{
- QWebElement e = page()->mainFrame()->findFirstElement(QL1S("head >link[rel=\"search\"][ type=\"application/opensearchdescription+xml\"]"));
- QString title = e.attribute(QL1S("title"));
- if (!title.isEmpty())
- {
- // FIXME
-// WebShortcutWidget *widget = new WebShortcutWidget(window());
-// widget->setWindowFlags(Qt::Popup);
-//
-// connect(widget, SIGNAL(webShortcutSet(KUrl, QString, QString)),
-// rApp->opensearchManager(), SLOT(addOpenSearchEngine(KUrl, QString, QString)));
-// connect(rApp->opensearchManager(), SIGNAL(openSearchEngineAdded(QString)),
-// this, SLOT(openSearchEngineAdded()));
-//
-// widget->show(extractOpensearchUrl(e), title, pos);
- }
-}
-
-
-void WebTab::openSearchEngineAdded()
-{
-// // If the providers changed, tell sycoca to rebuild its database...
-// KBuildSycocaProgressDialog::rebuildKSycoca(this);
-//
-// disconnect(rApp->opensearchManager(), SIGNAL(openSearchEngineAdded(QString, QString, QString)),
-// this, SLOT(openSearchEngineAdded()));
-}
-
-
void WebTab::showMessageBar()
{
MessageBar *msgBar = new MessageBar(i18n("It seems rekonq was not closed properly. Do you want "
diff --git a/src/webtab/webtab.h b/src/webtab/webtab.h
index 617e0782..f875071d 100644
--- a/src/webtab/webtab.h
+++ b/src/webtab/webtab.h
@@ -71,20 +71,11 @@ public:
KUrl url();
void createPreviewSelectorBar(int index);
-
void hideSelectorBar();
- bool hasRSSInfo();
-
bool isPageLoading();
- bool hasNewSearchEngine();
-
- KParts::ReadOnlyPart *part()
- {
- return m_part;
- }
-
+ KParts::ReadOnlyPart *part();
void setPart(KParts::ReadOnlyPart *p, const KUrl &u);
private Q_SLOTS:
@@ -92,9 +83,6 @@ private Q_SLOTS:
void resetProgress();
void createWalletBar(const QString &, const QUrl &);
- void showRSSInfo(const QPoint &pos);
- void showSearchEngine(const QPoint &pos);
- void openSearchEngineAdded();
void showMessageBar();
void loadFinished();
@@ -103,9 +91,6 @@ private Q_SLOTS:
void printFrame();
-private:
- KUrl extractOpensearchUrl(QWebElement e);
-
Q_SIGNALS:
void loadProgressing();
void titleChanged(const QString &);