summaryrefslogtreecommitdiff
path: root/src/webtab.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webtab.cpp')
-rw-r--r--src/webtab.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/webtab.cpp b/src/webtab.cpp
index b4e59d84..fd44cc10 100644
--- a/src/webtab.cpp
+++ b/src/webtab.cpp
@@ -49,6 +49,7 @@
#include <KActionMenu>
#include <KWebView>
#include <kwebwallet.h>
+#include <KDE/KMessageBox>
// Qt Includes
#include <QContextMenuEvent>
@@ -59,6 +60,9 @@
#include <QAction>
#include <QVBoxLayout>
+// Defines
+#define QL1S(x) QLatin1String(x)
+
WebTab::WebTab(QWidget *parent)
: QWidget(parent)
@@ -171,3 +175,33 @@ void WebTab::createPreviewSelectorBar(int index)
connect(page(), SIGNAL(loadFinished(bool)), bar, SLOT(loadFinished()));
connect(page()->mainFrame(), SIGNAL(urlChanged(QUrl)), bar, SLOT(verifyUrl()));
}
+
+
+bool WebTab::hasRSSInfo()
+{
+ _rssList.clear();
+ QWebElementCollection col = page()->mainFrame()->findAllElements("link");
+ foreach(QWebElement el, col)
+ {
+ if( el.attribute("type") == QL1S("application/rss+xml") || el.attribute("type") == QL1S("application/rss+xml") )
+ _rssList << KUrl( el.attribute("href") );
+ }
+
+ return !_rssList.isEmpty();
+}
+
+
+void WebTab::showRSSInfo()
+{
+ QString urlList = QString("Here are the rss link found: <br /><br />");
+ foreach(const KUrl &url, _rssList)
+ {
+ urlList += QString("<a href=\"") + url.url() + QString("\">") + url.url() + QString("</a><br />");
+ }
+ urlList += QString("<br />Enough for now.. waiting for some cool akonadi based feeds management :)");
+
+ KMessageBox::information( view(),
+ urlList,
+ "RSS Management"
+ );
+}