TDE network applications
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

76 lines
2.0 KiB

  1. /* $Id$ */
  2. #include <tdeapplication.h>
  3. #include <dcopclient.h>
  4. #include <dcopref.h>
  5. #include <tqdatastream.h>
  6. #include <tqstring.h>
  7. #include <tqstringlist.h>
  8. #include <tqcstring.h>
  9. #include <kdebug.h>
  10. #include <stdlib.h>
  11. /*
  12. class rssIface : virtual public DCOPObject
  13. {
  14. K_DCOP
  15. public:
  16. rssIface( TDEApplication *app)
  17. {
  18. // get our DCOP client and attach so that we may use it
  19. DCOPClient *client = app->dcopClient();
  20. client->attach();
  21. TQString error;
  22. TQCString appID;
  23. kdDebug() << "Looking for rss service..." << endl;
  24. if (!client->isApplicationRegistered("rssservice"))
  25. {
  26. kdDebug() << "Could not find service so I am starting it..." << endl;
  27. if(TDEApplication::startServiceByName("rssservice",TQStringList(), &error, &appID ))
  28. {
  29. kdDebug() << "Starting rssservice failed with message: " << error << endl;
  30. exit(0);
  31. }
  32. }
  33. kdDebug ()<< "Accessing rssservice..." << endl;
  34. if (!connectDCOPSignal(0,0, "documentUpdated(DCOPRef)",
  35. "refresh(DCOPRef)",false))
  36. kdDebug() << "Could not attach signal..." << endl;
  37. else
  38. kdDebug() << "attached dcop signals..." << endl;
  39. TQString url("http://freshmeat.net/backend/fm.rdf");
  40. DCOPRef m_rssservice("rssservice","RSSService");
  41. m_rssservice.call("load(TQString)", url);
  42. TQStringList returnList = m_rssservice.call("list()");
  43. DCOPRef doc = m_rssservice.call("document(TQString)", returnList[0]);
  44. TQString title = doc.call("title()");
  45. TQString link = doc.call("link()");
  46. TQString description = doc.call("description()");
  47. kdDebug() << title << endl;
  48. kdDebug() << link << endl;
  49. kdDebug() << description << endl;
  50. }
  51. k_dcop:
  52. virtual void refresh(DCOPRef doc)
  53. {
  54. TQString title = doc.call("title()");
  55. TQString link = doc.call("link()");
  56. TQString description = doc.call("description()");
  57. kdDebug() << title << endl;
  58. kdDebug() << link << endl;
  59. kdDebug() << description << endl;
  60. }
  61. private:
  62. };
  63. */
  64. int main(int argc, char **argv)
  65. {
  66. TDEApplication *app = new TDEApplication(argc, argv, "client", false);
  67. app->exec();
  68. }