|
|
|
/* $Id$ */
|
|
|
|
#include <tdeapplication.h>
|
|
|
|
#include <dcopclient.h>
|
|
|
|
#include <dcopref.h>
|
|
|
|
#include <tqdatastream.h>
|
|
|
|
#include <tqstring.h>
|
|
|
|
#include <tqstringlist.h>
|
|
|
|
#include <tqcstring.h>
|
|
|
|
#include <kdebug.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
/*
|
|
|
|
class rssIface : virtual public DCOPObject
|
|
|
|
{
|
|
|
|
K_DCOP
|
|
|
|
public:
|
|
|
|
|
|
|
|
rssIface( TDEApplication *app)
|
|
|
|
{
|
|
|
|
// get our DCOP client and attach so that we may use it
|
|
|
|
DCOPClient *client = app->dcopClient();
|
|
|
|
client->attach();
|
|
|
|
TQString error;
|
|
|
|
TQCString appID;
|
|
|
|
kdDebug() << "Looking for rss service..." << endl;
|
|
|
|
if (!client->isApplicationRegistered("rssservice"))
|
|
|
|
{
|
|
|
|
kdDebug() << "Could not find service so I am starting it..." << endl;
|
|
|
|
if(TDEApplication::startServiceByName("rssservice",TQStringList(), &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;
|
|
|
|
|
|
|
|
TQString url("http://freshmeat.net/backend/fm.rdf");
|
|
|
|
DCOPRef m_rssservice("rssservice","RSSService");
|
|
|
|
m_rssservice.call("load(TQString)", url);
|
|
|
|
TQStringList returnList = m_rssservice.call("list()");
|
|
|
|
DCOPRef doc = m_rssservice.call("document(TQString)", returnList[0]);
|
|
|
|
TQString title = doc.call("title()");
|
|
|
|
TQString link = doc.call("link()");
|
|
|
|
TQString description = doc.call("description()");
|
|
|
|
kdDebug() << title << endl;
|
|
|
|
kdDebug() << link << endl;
|
|
|
|
kdDebug() << description << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
k_dcop:
|
|
|
|
virtual void refresh(DCOPRef doc)
|
|
|
|
{
|
|
|
|
TQString title = doc.call("title()");
|
|
|
|
TQString link = doc.call("link()");
|
|
|
|
TQString description = doc.call("description()");
|
|
|
|
kdDebug() << title << endl;
|
|
|
|
kdDebug() << link << endl;
|
|
|
|
kdDebug() << description << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
};
|
|
|
|
*/
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
TDEApplication *app = new TDEApplication(argc, argv, "client", false);
|
|
|
|
|
|
|
|
app->exec();
|
|
|
|
}
|