summaryrefslogtreecommitdiffstats
path: root/dcoprss/client.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbcb704366cb5e333a626c18c308c7e0448a8e69f (patch)
treef0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /dcoprss/client.cpp
downloadtdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz
tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'dcoprss/client.cpp')
-rw-r--r--dcoprss/client.cpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/dcoprss/client.cpp b/dcoprss/client.cpp
new file mode 100644
index 00000000..b74894de
--- /dev/null
+++ b/dcoprss/client.cpp
@@ -0,0 +1,75 @@
+/* $Id$ */
+#include <kapplication.h>
+#include <dcopclient.h>
+#include <dcopref.h>
+#include <qdatastream.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qcstring.h>
+#include <kdebug.h>
+#include <stdlib.h>
+/*
+class rssIface : virtual public DCOPObject
+{
+ K_DCOP
+public:
+
+ rssIface( KApplication *app)
+ {
+ // get our DCOP client and attach so that we may use it
+ DCOPClient *client = app->dcopClient();
+ client->attach();
+ QString error;
+ QCString appID;
+ kdDebug() << "Looking for rss service..." << endl;
+ if (!client->isApplicationRegistered("rssservice"))
+ {
+ kdDebug() << "Could not find service so I am starting it..." << endl;
+ if(KApplication::startServiceByName("rssservice",QStringList(), &error, &appID ))
+ {
+ kdDebug() << "Starting rssservice failed with message: " << error << endl;
+ exit(0);
+ }
+ }
+ kdDebug ()<< "Accessing rssservice..." << endl;
+
+ if (!connectDCOPSignal(0,0, "documentUpdated(DCOPRef)",
+ "refresh(DCOPRef)",false))
+ kdDebug() << "Could not attach signal..." << endl;
+ else
+ kdDebug() << "attached dcop signals..." << endl;
+
+ QString url("http://freshmeat.net/backend/fm.rdf");
+ DCOPRef m_rssservice("rssservice","RSSService");
+ m_rssservice.call("load(QString)", url);
+ QStringList returnList = m_rssservice.call("list()");
+ DCOPRef doc = m_rssservice.call("document(QString)", returnList[0]);
+ QString title = doc.call("title()");
+ QString link = doc.call("link()");
+ QString description = doc.call("description()");
+ kdDebug() << title << endl;
+ kdDebug() << link << endl;
+ kdDebug() << description << endl;
+ }
+
+ k_dcop:
+ virtual void refresh(DCOPRef doc)
+ {
+ QString title = doc.call("title()");
+ QString link = doc.call("link()");
+ QString description = doc.call("description()");
+ kdDebug() << title << endl;
+ kdDebug() << link << endl;
+ kdDebug() << description << endl;
+ }
+
+ private:
+
+};
+*/
+int main(int argc, char **argv)
+{
+ KApplication *app = new KApplication(argc, argv, "client", false);
+
+ app->exec();
+}