From 47c8a359c5276062c4bc17f0e82410f29081b502 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:48:06 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- dcoprss/article.cpp | 6 +- dcoprss/cache.cpp | 46 +++++------ dcoprss/cache.h | 30 +++---- dcoprss/client.cpp | 34 ++++---- dcoprss/document.cpp | 66 ++++++++-------- dcoprss/feedbrowser.cpp | 62 +++++++-------- dcoprss/feedbrowser.h | 28 +++---- dcoprss/query.cpp | 90 ++++++++++----------- dcoprss/query.h | 38 ++++----- dcoprss/rssnewsfeed.h | 94 +++++++++++----------- dcoprss/service.cpp | 22 +++--- dcoprss/service.h | 82 ++++++++++---------- dcoprss/xmlrpciface.cpp | 202 ++++++++++++++++++++++++------------------------ dcoprss/xmlrpciface.h | 132 +++++++++++++++---------------- 14 files changed, 466 insertions(+), 466 deletions(-) (limited to 'dcoprss') diff --git a/dcoprss/article.cpp b/dcoprss/article.cpp index d191bd74..4d06a7d8 100644 --- a/dcoprss/article.cpp +++ b/dcoprss/article.cpp @@ -32,18 +32,18 @@ RSSArticle::~RSSArticle() delete m_Art; } -QString RSSArticle::title() +TQString RSSArticle::title() { //kdDebug() << "Get title " << m_Art->title() << endl; return m_Art->title(); } -QString RSSArticle::description() +TQString RSSArticle::description() { return m_Art->description(); } -QString RSSArticle::link() +TQString RSSArticle::link() { return m_Art->link().prettyURL(); } diff --git a/dcoprss/cache.cpp b/dcoprss/cache.cpp index 9c80a9a3..c4a566aa 100644 --- a/dcoprss/cache.cpp +++ b/dcoprss/cache.cpp @@ -28,14 +28,14 @@ #include #include -#include -#include +#include +#include bool CacheEntry::isValid() const { // Cache entries get invalid after on hour. One shouldn't hardcode this // but for now it'll do. - return m_timeStamp.secsTo( QDateTime::currentDateTime() ) < 3600; + return m_timeStamp.secsTo( TQDateTime::currentDateTime() ) < 3600; } Cache *Cache::m_instance = 0; @@ -47,14 +47,14 @@ Cache &Cache::self() return *m_instance; } -QString Cache::getCacheKey( const QString &server, const QString &method, - const QValueList &args ) +TQString Cache::getCacheKey( const TQString &server, const TQString &method, + const TQValueList &args ) { - QString key; - key = server + QString::fromLatin1( "__" ); - key += method + QString::fromLatin1( "__" ); - QValueList::ConstIterator it = args.begin(); - QValueList::ConstIterator end = args.end(); + TQString key; + key = server + TQString::fromLatin1( "__" ); + key += method + TQString::fromLatin1( "__" ); + TQValueList::ConstIterator it = args.begin(); + TQValueList::ConstIterator end = args.end(); for ( ; it != end; ++it ) key += KXMLRPC::Query::marshal( *it ); @@ -73,56 +73,56 @@ Cache::~Cache() void Cache::load() { - QFile file( cacheFileName() ); + TQFile file( cacheFileName() ); if ( !file.open( IO_ReadOnly ) ) { kdDebug() << "Failed to open cache file " << cacheFileName() << endl; return; } - QDataStream stream( &file ); + TQDataStream stream( &file ); while ( !stream.atEnd() ) { - QString key; + TQString key; stream >> key; CacheEntry *entry = new CacheEntry; stream >> *entry; - QDict::insert( key, entry ); + TQDict::insert( key, entry ); } } void Cache::save() { - QFile file( cacheFileName() ); + TQFile file( cacheFileName() ); if ( !file.open( IO_WriteOnly ) ) { kdDebug() << "Failed to open cache file " << cacheFileName() << endl; return; } - QDataStream stream( &file ); + TQDataStream stream( &file ); - QDictIterator it( *this ); + TQDictIterator it( *this ); for ( ; it.current() != 0; ++it ) stream << it.currentKey() << *it.current(); } -void Cache::touch( const QString &key ) +void Cache::touch( const TQString &key ) { CacheEntry *entry = find( key ); if ( !entry ) return; - entry->m_timeStamp = QDateTime::currentDateTime(); + entry->m_timeStamp = TQDateTime::currentDateTime(); } -void Cache::insert( const QString &key, const KXMLRPC::Query::Result &result ) +void Cache::insert( const TQString &key, const KXMLRPC::Query::Result &result ) { CacheEntry *entry = new CacheEntry; - entry->m_timeStamp = QDateTime::currentDateTime(); + entry->m_timeStamp = TQDateTime::currentDateTime(); entry->m_result = result; - QDict::insert( key, entry ); + TQDict::insert( key, entry ); } -QString Cache::cacheFileName() const +TQString Cache::cacheFileName() const { return locateLocal( "appdata", "cache/dcoprss.cache" ); } diff --git a/dcoprss/cache.h b/dcoprss/cache.h index 8248b609..3bf73e12 100644 --- a/dcoprss/cache.h +++ b/dcoprss/cache.h @@ -25,41 +25,41 @@ #ifndef CACHE_H #define CACHE_H -#include -#include -#include +#include +#include +#include #include class CacheEntry { friend class Cache; - friend QDataStream &operator>>( QDataStream &s, CacheEntry &e ); + friend TQDataStream &operator>>( TQDataStream &s, CacheEntry &e ); public: - const QDateTime &timeStamp() const { return m_timeStamp; } + const TQDateTime &timeStamp() const { return m_timeStamp; } const KXMLRPC::Query::Result result() const { return m_result; } bool isValid() const; private: - QDateTime m_timeStamp; + TQDateTime m_timeStamp; KXMLRPC::Query::Result m_result; }; -class Cache : public QDict +class Cache : public TQDict { public: static Cache &self(); - static QString getCacheKey( const QString &server, - const QString &method, - const QValueList &args ); + static TQString getCacheKey( const TQString &server, + const TQString &method, + const TQValueList &args ); void load(); void save(); - void touch( const QString &key ); + void touch( const TQString &key ); - void insert( const QString &key, const KXMLRPC::Query::Result &result ); + void insert( const TQString &key, const KXMLRPC::Query::Result &result ); private: Cache(); @@ -67,17 +67,17 @@ class Cache : public QDict Cache &operator=( const Cache &rhs ); // disabled ~Cache(); - QString cacheFileName() const; + TQString cacheFileName() const; static Cache *m_instance; }; -inline QDataStream &operator<<( QDataStream &s, const CacheEntry &e ) +inline TQDataStream &operator<<( TQDataStream &s, const CacheEntry &e ) { return s << e.timeStamp() << e.result(); } -inline QDataStream &operator>>( QDataStream &s, CacheEntry &e ) +inline TQDataStream &operator>>( TQDataStream &s, CacheEntry &e ) { return s >> e.m_timeStamp >> e.m_result; } diff --git a/dcoprss/client.cpp b/dcoprss/client.cpp index b74894de..f84fc0f9 100644 --- a/dcoprss/client.cpp +++ b/dcoprss/client.cpp @@ -2,10 +2,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include /* @@ -19,13 +19,13 @@ public: // get our DCOP client and attach so that we may use it DCOPClient *client = app->dcopClient(); client->attach(); - QString error; - QCString appID; + 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(KApplication::startServiceByName("rssservice",QStringList(), &error, &appID )) + if(KApplication::startServiceByName("rssservice",TQStringList(), &error, &appID )) { kdDebug() << "Starting rssservice failed with message: " << error << endl; exit(0); @@ -39,14 +39,14 @@ public: else kdDebug() << "attached dcop signals..." << endl; - QString url("http://freshmeat.net/backend/fm.rdf"); + TQString 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()"); + 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; @@ -55,9 +55,9 @@ public: k_dcop: virtual void refresh(DCOPRef doc) { - QString title = doc.call("title()"); - QString link = doc.call("link()"); - QString description = doc.call("description()"); + TQString title = doc.call("title()"); + TQString link = doc.call("link()"); + TQString description = doc.call("description()"); kdDebug() << title << endl; kdDebug() << link << endl; kdDebug() << description << endl; diff --git a/dcoprss/document.cpp b/dcoprss/document.cpp index b43f600e..fb5cd904 100644 --- a/dcoprss/document.cpp +++ b/dcoprss/document.cpp @@ -16,20 +16,20 @@ * * ***************************************************************************/ #include -#include +#include #include #include "service.h" -RSSDocument::RSSDocument(const QString& url) : - QObject(), DCOPObject(), m_Url(url) +RSSDocument::RSSDocument(const TQString& url) : + TQObject(), DCOPObject(), m_Url(url) { m_list.setAutoDelete( true ); m_Doc = 0L; - m_pix = QPixmap(); + m_pix = TQPixmap(); m_isLoading = false; m_maxAge = 60; - m_Timeout = QDateTime::currentDateTime(); + m_Timeout = TQDateTime::currentDateTime(); m_state.clear(); } @@ -79,8 +79,8 @@ void RSSDocument::loadingComplete(Loader *ldr, Document doc, Status stat) Image *img = m_Doc->image(); if ( img ) { - connect(img, SIGNAL(gotPixmap(const QPixmap &)), - SLOT(pixmapLoaded(const QPixmap &))); + connect(img, TQT_SIGNAL(gotPixmap(const TQPixmap &)), + TQT_SLOT(pixmapLoaded(const TQPixmap &))); img->getPixmap(); pixmapUpdating(DCOPRef(this)); } @@ -94,13 +94,13 @@ void RSSDocument::loadingComplete(Loader *ldr, Document doc, Status stat) } } -void RSSDocument::pixmapLoaded(const QPixmap &pix ) +void RSSDocument::pixmapLoaded(const TQPixmap &pix ) { m_pix = pix; pixmapUpdated(DCOPRef(this)); } -QString RSSDocument::webMaster() +TQString RSSDocument::webMaster() { if( m_Doc != 0L) return m_Doc->webMaster(); @@ -108,7 +108,7 @@ QString RSSDocument::webMaster() return ""; } -QString RSSDocument::managingEditor() +TQString RSSDocument::managingEditor() { if( m_Doc != 0L) return m_Doc->managingEditor(); @@ -116,7 +116,7 @@ QString RSSDocument::managingEditor() return ""; } -QString RSSDocument::rating() +TQString RSSDocument::rating() { if( m_Doc != 0L) return m_Doc->rating(); @@ -124,23 +124,23 @@ QString RSSDocument::rating() return ""; } -QDateTime RSSDocument::lastBuildDate() +TQDateTime RSSDocument::lastBuildDate() { if( m_Doc != 0L) return m_Doc->lastBuildDate(); else - return QDateTime::currentDateTime(); + return TQDateTime::currentDateTime(); } -QDateTime RSSDocument::pubDate() +TQDateTime RSSDocument::pubDate() { if( m_Doc != 0L) return m_Doc->pubDate(); else - return QDateTime::currentDateTime(); + return TQDateTime::currentDateTime(); } -QString RSSDocument::copyright() +TQString RSSDocument::copyright() { if( m_Doc != 0L) return m_Doc->copyright(); @@ -148,20 +148,20 @@ QString RSSDocument::copyright() return ""; } -QStringList RSSDocument::articles() +TQStringList RSSDocument::articles() { if( m_Doc != 0L) { kdDebug() << "Document giving articles..." << endl; Article::List list = m_Doc->articles(); - QStringList stringList; + TQStringList stringList; for(Article::List::ConstIterator it = list.begin(); it != list.end(); ++it) stringList.append((*it).title()); return stringList; } else - return QStringList(); + return TQStringList(); } DCOPRef RSSDocument::article(int idx) @@ -179,7 +179,7 @@ int RSSDocument::count() return 0; } -QString RSSDocument::link() +TQString RSSDocument::link() { if( m_Doc != 0L) return m_Doc->link().prettyURL(); @@ -187,7 +187,7 @@ QString RSSDocument::link() return ""; } -QString RSSDocument::description() +TQString RSSDocument::description() { if( m_Doc != 0L) return m_Doc->description(); @@ -195,7 +195,7 @@ QString RSSDocument::description() return ""; } -QString RSSDocument::title() +TQString RSSDocument::title() { if( m_Doc != 0L) return m_Doc->title(); @@ -203,7 +203,7 @@ QString RSSDocument::title() return ""; } -QString RSSDocument::verbVersion() +TQString RSSDocument::verbVersion() { if( m_Doc != 0L) return m_Doc->verbVersion(); @@ -211,7 +211,7 @@ QString RSSDocument::verbVersion() return ""; } -QString RSSDocument::pixmapURL() +TQString RSSDocument::pixmapURL() { if( m_Doc != 0L) if( m_Doc->image() ) @@ -222,7 +222,7 @@ QString RSSDocument::pixmapURL() return ""; } -QPixmap RSSDocument::pixmap() +TQPixmap RSSDocument::pixmap() { return m_pix; } @@ -243,14 +243,14 @@ bool RSSDocument::pixmapValid() void RSSDocument::refresh() { kdDebug() << "Mod time " << m_Timeout.toString() << endl; - kdDebug() << "Current time " << QDateTime::currentDateTime().toString() << endl; + kdDebug() << "Current time " << TQDateTime::currentDateTime().toString() << endl; - if(!m_isLoading && (QDateTime::currentDateTime() >= m_Timeout)) + if(!m_isLoading && (TQDateTime::currentDateTime() >= m_Timeout)) { kdDebug() << "Document going to refresh" << endl; m_isLoading = true; Loader *loader = Loader::create(this, - SLOT(loadingComplete(Loader *, Document, Status))); + TQT_SLOT(loadingComplete(Loader *, Document, Status))); loader->loadFrom(KURL( m_Url ), new FileRetriever()); documentUpdating(DCOPRef(this)); } @@ -266,8 +266,8 @@ void RSSDocument::refresh() Image *img = m_Doc->image(); if ( img ) { - connect(img, SIGNAL(gotPixmap(const QPixmap &)), - SLOT(pixmapLoaded(const QPixmap &))); + connect(img, TQT_SIGNAL(gotPixmap(const TQPixmap &)), + TQT_SLOT(pixmapLoaded(const TQPixmap &))); img->getPixmap(); pixmapUpdating(DCOPRef(this)); } @@ -289,17 +289,17 @@ void RSSDocument::setMaxAge(int _min) m_Timeout.addSecs(m_maxAge); } -int RSSDocument::state( const QString &title) const +int RSSDocument::state( const TQString &title) const { return m_state[title]; } -void RSSDocument::setState( const QString &title, int s ) +void RSSDocument::setState( const TQString &title, int s ) { m_state[title] = s; } -void RSSDocument::read( const QString &title) +void RSSDocument::read( const TQString &title) { m_state[title] = 3; } diff --git a/dcoprss/feedbrowser.cpp b/dcoprss/feedbrowser.cpp index 59a55040..eae10f63 100644 --- a/dcoprss/feedbrowser.cpp +++ b/dcoprss/feedbrowser.cpp @@ -9,18 +9,18 @@ #include #include -#include -#include -#include +#include +#include +#include -CategoryItem::CategoryItem( KListView *parent, const QString &category ) +CategoryItem::CategoryItem( KListView *parent, const TQString &category ) : KListViewItem( parent ), m_category( category ) { init(); } -CategoryItem::CategoryItem( KListViewItem *parent, const QString &category ) +CategoryItem::CategoryItem( KListViewItem *parent, const TQString &category ) : KListViewItem( parent ), m_category( category ) { @@ -47,18 +47,18 @@ void CategoryItem::setOpen( bool open ) void CategoryItem::populate() { m_dcopIface = new DCOPRSSIface( this, "m_dcopIface" ); - connect( m_dcopIface, SIGNAL( gotCategories( const QStringList & ) ), - this, SLOT( gotCategories( const QStringList & ) ) ); + connect( m_dcopIface, TQT_SIGNAL( gotCategories( const TQStringList & ) ), + this, TQT_SLOT( gotCategories( const TQStringList & ) ) ); m_dcopIface->getCategories( m_category ); } -void CategoryItem::gotCategories( const QStringList &categories ) +void CategoryItem::gotCategories( const TQStringList &categories ) { delete m_dcopIface; m_dcopIface = 0; - QStringList::ConstIterator it = categories.begin(); - QStringList::ConstIterator end = categories.end(); + TQStringList::ConstIterator it = categories.begin(); + TQStringList::ConstIterator end = categories.end(); for ( ; it != end; ++it ) new CategoryItem( this, *it ); @@ -66,45 +66,45 @@ void CategoryItem::gotCategories( const QStringList &categories ) KListViewItem::setOpen( true ); } -DCOPRSSIface::DCOPRSSIface( QObject *parent, const char *name ) : - QObject( parent, name ), DCOPObject( "FeedBrowser" ) +DCOPRSSIface::DCOPRSSIface( TQObject *parent, const char *name ) : + TQObject( parent, name ), DCOPObject( "FeedBrowser" ) { - connectDCOPSignal( "rssservice", "RSSQuery", "gotCategories(QStringList)", - "slotGotCategories(QStringList)", false ); + connectDCOPSignal( "rssservice", "RSSQuery", "gotCategories(TQStringList)", + "slotGotCategories(TQStringList)", false ); } -void DCOPRSSIface::getCategories( const QString &cat ) +void DCOPRSSIface::getCategories( const TQString &cat ) { - QByteArray data; - QDataStream stream( data, IO_WriteOnly ); + TQByteArray data; + TQDataStream stream( data, IO_WriteOnly ); stream << cat; kapp->dcopClient()->send( "rssservice", "RSSQuery", - "getCategories(QString)", data ); + "getCategories(TQString)", data ); } -void DCOPRSSIface::slotGotCategories( const QStringList &categories ) +void DCOPRSSIface::slotGotCategories( const TQStringList &categories ) { emit gotCategories( categories ); } -FeedBrowserDlg::FeedBrowserDlg( QWidget *parent, const char *name ) +FeedBrowserDlg::FeedBrowserDlg( TQWidget *parent, const char *name ) : KDialogBase( parent, name, true, i18n( "DCOPRSS Feed Browser" ), Close, Close, true ) { m_dcopIface = new DCOPRSSIface( this, "m_dcopIface" ); - connect( m_dcopIface, SIGNAL( gotCategories( const QStringList & ) ), - this, SLOT( gotTopCategories( const QStringList & ) ) ); + connect( m_dcopIface, TQT_SIGNAL( gotCategories( const TQStringList & ) ), + this, TQT_SLOT( gotTopCategories( const TQStringList & ) ) ); - QVBox *mainWidget = makeVBoxMainWidget(); + TQVBox *mainWidget = makeVBoxMainWidget(); m_feedList = new KListView( mainWidget, "m_feedList" ); m_feedList->setAllColumnsShowFocus( true ); m_feedList->setRootIsDecorated( true ); m_feedList->addColumn( i18n( "Name" ) ); - connect( m_feedList, SIGNAL( executed( QListViewItem * ) ), - this, SLOT( itemSelected( QListViewItem * ) ) ); - connect( m_feedList, SIGNAL( returnPressed( QListViewItem * ) ), - this, SLOT( itemSelected( QListViewItem * ) ) ); + connect( m_feedList, TQT_SIGNAL( executed( TQListViewItem * ) ), + this, TQT_SLOT( itemSelected( TQListViewItem * ) ) ); + connect( m_feedList, TQT_SIGNAL( returnPressed( TQListViewItem * ) ), + this, TQT_SLOT( itemSelected( TQListViewItem * ) ) ); resize( 500, 400 ); @@ -116,15 +116,15 @@ void FeedBrowserDlg::getTopCategories() m_dcopIface->getCategories( "Top" ); } -void FeedBrowserDlg::gotTopCategories( const QStringList &categories ) +void FeedBrowserDlg::gotTopCategories( const TQStringList &categories ) { - QStringList::ConstIterator it = categories.begin(); - QStringList::ConstIterator end = categories.end(); + TQStringList::ConstIterator it = categories.begin(); + TQStringList::ConstIterator end = categories.end(); for ( ; it != end; ++it ) new CategoryItem( m_feedList, *it ); } -void FeedBrowserDlg::itemSelected( QListViewItem *item ) +void FeedBrowserDlg::itemSelected( TQListViewItem *item ) { item->setOpen( !item->isOpen() ); } diff --git a/dcoprss/feedbrowser.h b/dcoprss/feedbrowser.h index 829ecd5e..9b8ce86f 100644 --- a/dcoprss/feedbrowser.h +++ b/dcoprss/feedbrowser.h @@ -1,45 +1,45 @@ #ifndef FEEDBROWSER_H #define FEEDBROWSER_H -#include +#include #include #include #include -class DCOPRSSIface : public QObject, public DCOPObject +class DCOPRSSIface : public TQObject, public DCOPObject { K_DCOP Q_OBJECT public: - DCOPRSSIface( QObject *parent, const char *name = 0 ); + DCOPRSSIface( TQObject *parent, const char *name = 0 ); k_dcop: - void slotGotCategories( const QStringList &categories ); + void slotGotCategories( const TQStringList &categories ); public slots: - void getCategories( const QString &cat = "Top" ); + void getCategories( const TQString &cat = "Top" ); signals: - void gotCategories( const QStringList &categories ); + void gotCategories( const TQStringList &categories ); }; -class CategoryItem : public QObject, public KListViewItem +class CategoryItem : public TQObject, public KListViewItem { Q_OBJECT public: - CategoryItem( KListView *parent, const QString &category ); - CategoryItem( KListViewItem *parent, const QString &category ); + CategoryItem( KListView *parent, const TQString &category ); + CategoryItem( KListViewItem *parent, const TQString &category ); virtual void setOpen( bool open ); private slots: - void gotCategories( const QStringList &categories ); + void gotCategories( const TQStringList &categories ); private: void populate(); void init(); - QString m_category; + TQString m_category; bool m_populated; DCOPRSSIface *m_dcopIface; }; @@ -49,11 +49,11 @@ class FeedBrowserDlg : public KDialogBase Q_OBJECT friend class CategoryItem; public: - FeedBrowserDlg( QWidget *parent, const char *name = 0 ); + FeedBrowserDlg( TQWidget *parent, const char *name = 0 ); private slots: - void itemSelected( QListViewItem *item ); - void gotTopCategories( const QStringList &categories ); + void itemSelected( TQListViewItem *item ); + void gotTopCategories( const TQStringList &categories ); private: void getTopCategories(); diff --git a/dcoprss/query.cpp b/dcoprss/query.cpp index b2c29fdf..9c324890 100644 --- a/dcoprss/query.cpp +++ b/dcoprss/query.cpp @@ -27,35 +27,35 @@ using KXMLRPC::Server; -void SlotCaller::call( QObject *object, const char *slot, +void SlotCaller::call( TQObject *object, const char *slot, const KXMLRPC::Query::Result &result ) { SlotCaller caller; - connect( &caller, SIGNAL( signal( const KXMLRPC::Query::Result &) ), + connect( &caller, TQT_SIGNAL( signal( const KXMLRPC::Query::Result &) ), object, slot ); emit caller.signal( result ); } -QueryService::QueryService( RSSService *service ) : QObject(), DCOPObject( "RSSQuery" ), +QueryService::QueryService( RSSService *service ) : TQObject(), DCOPObject( "RSSQuery" ), m_service( service ) { m_xmlrpcServer = new KXMLRPC::Server( KURL( "http://www.syndic8.com/xmlrpc.php"), this ); } -QStringList QueryService::listActive() +TQStringList QueryService::listActive() { if ( !m_service ) - return QStringList(); + return TQStringList(); return m_service->list(); } -void QueryService::cachedCall( const QString &method, - const QValueList &args, +void QueryService::cachedCall( const TQString &method, + const TQValueList &args, const char *slot ) { kdDebug() << "Calling " << method << endl; - const QString cacheKey = Cache::getCacheKey( m_xmlrpcServer->url().url(), + const TQString cacheKey = Cache::getCacheKey( m_xmlrpcServer->url().url(), method, args ); CacheEntry *cacheEntry = Cache::self().find( cacheKey ); @@ -70,7 +70,7 @@ void QueryService::cachedCall( const QString &method, void QueryService::updateCache( const KXMLRPC::Query::Result &result ) { - const QString cacheKey = Cache::getCacheKey( result.server(), + const TQString cacheKey = Cache::getCacheKey( result.server(), result.method(), result.args() ); @@ -81,57 +81,57 @@ void QueryService::updateCache( const KXMLRPC::Query::Result &result ) } } -void QueryService::findFeeds( const QString &query ) +void QueryService::findFeeds( const TQString &query ) { kdDebug() << "QueryService::findFeeds()" << endl; - QStringList args; + TQStringList args; args << query << "headlines_rank"; cachedCall( "syndic8.FindFeeds", Server::toVariantList( args ), - SLOT( slotFoundFeeds( const KXMLRPC::Query::Result & ) ) ); + TQT_SLOT( slotFoundFeeds( const KXMLRPC::Query::Result & ) ) ); } -void QueryService::findSites( const QString& query ) +void QueryService::findSites( const TQString& query ) { kdDebug() << "QueryService::findSites()" << endl; cachedCall( "syndic8.FindSites", Server::toVariantList( query ), - SLOT( slotFoundFeeds( const KXMLRPC::Query::Result & ) ) ); + TQT_SLOT( slotFoundFeeds( const KXMLRPC::Query::Result & ) ) ); } -void QueryService::getFeedInfo( const QVariant& ids ) +void QueryService::getFeedInfo( const TQVariant& ids ) { kdDebug() << "QueryService::getFeedInfo()" << endl; cachedCall( "syndic8.GetFeedInfo", Server::toVariantList( ids ), - SLOT( slotGotFeedInfo( const KXMLRPC::Query::Result & ) ) ); + TQT_SLOT( slotGotFeedInfo( const KXMLRPC::Query::Result & ) ) ); } -void QueryService::getCategories( const QString &category ) +void QueryService::getCategories( const TQString &category ) { kdDebug() << "QueryService::getCategories()" << endl; if ( category == "Top" ) { - cachedCall( "syndic8.GetCategoryRoots", Server::toVariantList( QString::fromLatin1( "DMOZ" ) ), - SLOT( slotGotCategories( const KXMLRPC::Query::Result & ) ) ); + cachedCall( "syndic8.GetCategoryRoots", Server::toVariantList( TQString::fromLatin1( "DMOZ" ) ), + TQT_SLOT( slotGotCategories( const KXMLRPC::Query::Result & ) ) ); } else { - QStringList args; + TQStringList args; args << "DMOZ" << category; cachedCall( "syndic8.GetCategoryChildren", Server::toVariantList( args ), - SLOT( slotGotCategories( const KXMLRPC::Query::Result & ) ) ); + TQT_SLOT( slotGotCategories( const KXMLRPC::Query::Result & ) ) ); } } -void QueryService::getFeedsInCategory( const QString &category ) +void QueryService::getFeedsInCategory( const TQString &category ) { kdDebug() << "QueryService::getFeedsInCategory()" << endl; - QStringList args; + TQStringList args; args << "DMOZ" << category; cachedCall( "syndic8.GetFeedsInCategory", Server::toVariantList( args ), - SLOT( slotGotFeedsInCategory( const KXMLRPC::Query::Result & ) ) ); + TQT_SLOT( slotGotFeedsInCategory( const KXMLRPC::Query::Result & ) ) ); } void QueryService::slotFoundFeeds( const KXMLRPC::Query::Result &result ) @@ -144,11 +144,11 @@ void QueryService::slotFoundFeeds( const KXMLRPC::Query::Result &result ) updateCache( result ); - QValueList ids; + TQValueList ids; - const QValueList values = result.data()[ 0 ].toList(); - QValueList::ConstIterator it = values.begin(); - QValueList::ConstIterator end = values.end(); + const TQValueList values = result.data()[ 0 ].toList(); + TQValueList::ConstIterator it = values.begin(); + TQValueList::ConstIterator end = values.end(); for ( ; it != end; ++it ) { ids << ( *it ).toInt(); kdDebug() << "Found feed #" << ( *it ).toInt() << endl; @@ -166,17 +166,17 @@ void QueryService::slotGotFeedInfo( const KXMLRPC::Query::Result &result ) updateCache( result ); - QMap links; - QValueList feeds; + TQMap links; + TQValueList feeds; - const QValueList feedInfos = result.data(); - QValueList::ConstIterator it = feedInfos.begin(); - QValueList::ConstIterator end = feedInfos.end(); + const TQValueList feedInfos = result.data(); + TQValueList::ConstIterator it = feedInfos.begin(); + TQValueList::ConstIterator end = feedInfos.end(); for ( ; it != end; ++it ) { - const QMap feedInfo = ( *it ).toMap(); + const TQMap feedInfo = ( *it ).toMap(); - const QString name = feedInfo[ "sitename" ].toString(); - const QString link = feedInfo[ "dataurl" ].toString(); + const TQString name = feedInfo[ "sitename" ].toString(); + const TQString link = feedInfo[ "dataurl" ].toString(); links[ name ] = link; RSSNewsFeed feed; @@ -189,7 +189,7 @@ void QueryService::slotGotFeedInfo( const KXMLRPC::Query::Result &result ) feed.m_editor = feedInfo[ "editor" ].toString(); feed.m_publisher = feedInfo[ "publisher" ].toString(); feed.m_creator = feedInfo[ "creator" ].toString(); - QDateTime dateTime; + TQDateTime dateTime; dateTime.setTime_t( KRFCDate::parseDate( feedInfo[ "date_created" ].toString() ) ); feed.m_dateCreated = dateTime; dateTime.setTime_t( KRFCDate::parseDate( feedInfo[ "date_approved" ].toString() ) ); @@ -231,11 +231,11 @@ void QueryService::slotGotCategories( const KXMLRPC::Query::Result &result ) updateCache( result ); - QStringList categories; + TQStringList categories; - const QValueList cats = result.data()[ 0 ].toList(); - QValueList::ConstIterator it = cats.begin(); - QValueList::ConstIterator end = cats.end(); + const TQValueList cats = result.data()[ 0 ].toList(); + TQValueList::ConstIterator it = cats.begin(); + TQValueList::ConstIterator end = cats.end(); for ( ; it != end; ++it ) categories << ( *it ).toString(); @@ -254,11 +254,11 @@ void QueryService::slotGotFeedsInCategory( const KXMLRPC::Query::Result &result updateCache( result ); - QValueList ids; + TQValueList ids; - const QValueList values = result.data()[ 0 ].toList(); - QValueList::ConstIterator it = values.begin(); - QValueList::ConstIterator end = values.end(); + const TQValueList values = result.data()[ 0 ].toList(); + TQValueList::ConstIterator it = values.begin(); + TQValueList::ConstIterator end = values.end(); for ( ; it != end; ++it ) { ids << ( *it ).toInt(); kdDebug() << "Got feed in category: #" << ( *it ).toInt() << endl; diff --git a/dcoprss/query.h b/dcoprss/query.h index d87e0505..dbaf5093 100644 --- a/dcoprss/query.h +++ b/dcoprss/query.h @@ -24,10 +24,10 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include class RSSService; @@ -39,7 +39,7 @@ class SlotCaller : public QObject { Q_OBJECT public: - static void call( QObject *object, const char *slot, + static void call( TQObject *object, const char *slot, const KXMLRPC::Query::Result &value ); signals: @@ -49,7 +49,7 @@ class SlotCaller : public QObject SlotCaller() { } }; -class QueryService : public QObject, public DCOPObject +class QueryService : public TQObject, public DCOPObject { K_DCOP Q_OBJECT @@ -57,23 +57,23 @@ class QueryService : public QObject, public DCOPObject QueryService( RSSService *service ); k_dcop_signals: - void feedIds( QValueList ids ); - void feedInfo(QMap links); - void feedInfo(QValueList feeds); - void gotCategories( const QStringList &categories ); - void gotFeedsInCategory( const QValueList &ids ); + void feedIds( TQValueList ids ); + void feedInfo(TQMap links); + void feedInfo(TQValueList feeds); + void gotCategories( const TQStringList &categories ); + void gotFeedsInCategory( const TQValueList &ids ); k_dcop: /** * Lists the active feeds in use... **/ - QStringList listActive(); // just for testing... + TQStringList listActive(); // just for testing... /** * Query the www.syndic8.com XML-RPC interface for the * string. The RSS ids are treturned in a integer list. **/ - void findFeeds( const QString& query ); + void findFeeds( const TQString& query ); /** * Query the www.syndic8.com XML-RPC interface for the @@ -81,26 +81,26 @@ class QueryService : public QObject, public DCOPObject * each feed in the feed list. The RSS ids are treturned * in a integer list. **/ - void findSites( const QString& query ); + void findSites( const TQString& query ); /** * Query the www.syndic8.com XML-RPC interface for the - * requested RSS feed(s). Returned is a QMap with the format + * requested RSS feed(s). Returned is a TQMap with the format * of Name (Site URL), RSS URL **/ - void getFeedInfo( const QVariant& ids ); + void getFeedInfo( const TQVariant& ids ); /** * Returns the list of subcategories in the specified category. * If no "Top" is specified, the root categories are returned. */ - void getCategories( const QString &category ); + void getCategories( const TQString &category ); /** * Queries the database for the list of needsfeed ID's which are * associated with the given category. */ - void getFeedsInCategory( const QString &category ); + void getFeedsInCategory( const TQString &category ); private slots: @@ -110,7 +110,7 @@ class QueryService : public QObject, public DCOPObject void slotGotFeedsInCategory( const KXMLRPC::Query::Result &result ); private: - void cachedCall( const QString &method, const QValueList &args, + void cachedCall( const TQString &method, const TQValueList &args, const char *slot ); void updateCache( const KXMLRPC::Query::Result &result ); diff --git a/dcoprss/rssnewsfeed.h b/dcoprss/rssnewsfeed.h index 3c2e04b5..ee300655 100644 --- a/dcoprss/rssnewsfeed.h +++ b/dcoprss/rssnewsfeed.h @@ -11,76 +11,76 @@ #ifndef RSSNEWSFEED_H #define RSSNEWSFEED_H -#include -#include -#include +#include +#include +#include #include class QueryService; class RSSNewsFeed { - friend QDataStream &operator>>( QDataStream &stream, RSSNewsFeed &feed ); - friend QDataStream &operator<<( QDataStream &stream, const RSSNewsFeed &feed ); + friend TQDataStream &operator>>( TQDataStream &stream, RSSNewsFeed &feed ); + friend TQDataStream &operator<<( TQDataStream &stream, const RSSNewsFeed &feed ); friend class QueryService; public: unsigned int id() const { return m_id; } - QString name() const { return m_name; } - QString description() const { return m_description; } - QString origin() const { return m_origin; } - QString languageCode() const { return m_languageCode; } - QString status() const { return m_status; } - QString version() const { return m_version; } - QString homePage() const { return m_homePage; } - QString sourceFile() const { return m_sourceFile; } - QString imageUrl() const { return m_imageUrl; } - QString webmaster() const { return m_webmaster; } - QString editor() const { return m_editor; } - QString publisher() const { return m_publisher; } - QString creator() const { return m_creator; } - const QDateTime &dateCreated() const { return m_dateCreated; } - const QDateTime &dateApproved() const { return m_dateApproved; } - const QDateTime dateXmlChanged() const { return m_dateXmlChanged; } + TQString name() const { return m_name; } + TQString description() const { return m_description; } + TQString origin() const { return m_origin; } + TQString languageCode() const { return m_languageCode; } + TQString status() const { return m_status; } + TQString version() const { return m_version; } + TQString homePage() const { return m_homePage; } + TQString sourceFile() const { return m_sourceFile; } + TQString imageUrl() const { return m_imageUrl; } + TQString webmaster() const { return m_webmaster; } + TQString editor() const { return m_editor; } + TQString publisher() const { return m_publisher; } + TQString creator() const { return m_creator; } + const TQDateTime &dateCreated() const { return m_dateCreated; } + const TQDateTime &dateApproved() const { return m_dateApproved; } + const TQDateTime dateXmlChanged() const { return m_dateXmlChanged; } bool fetchable() const { return m_fetchable; } unsigned int views() const { return m_views; } unsigned int headlinesPerDay() const { return m_headlinesPerDay; } unsigned int headlinesRank() const { return m_headlinesRank; } - QString toolkit() const { return m_toolkit; } - QString toolkitVersion() const { return m_toolkitVersion; } + TQString toolkit() const { return m_toolkit; } + TQString toolkitVersion() const { return m_toolkitVersion; } unsigned int pollingInterval() const { return m_pollingInterval; } - const QDateTime &lastPoll() const { return m_lastPoll; } - QStringList categories() const { return m_categories; } + const TQDateTime &lastPoll() const { return m_lastPoll; } + TQStringList categories() const { return m_categories; } private: unsigned int m_id; - QString m_name; - QString m_description; - QString m_origin; - QString m_languageCode; - QString m_status; - QString m_version; - QString m_homePage; - QString m_sourceFile; - QString m_imageUrl; - QString m_webmaster; - QString m_editor; - QString m_publisher; - QString m_creator; - QDateTime m_dateCreated; - QDateTime m_dateApproved; - QDateTime m_dateXmlChanged; + TQString m_name; + TQString m_description; + TQString m_origin; + TQString m_languageCode; + TQString m_status; + TQString m_version; + TQString m_homePage; + TQString m_sourceFile; + TQString m_imageUrl; + TQString m_webmaster; + TQString m_editor; + TQString m_publisher; + TQString m_creator; + TQDateTime m_dateCreated; + TQDateTime m_dateApproved; + TQDateTime m_dateXmlChanged; bool m_fetchable; unsigned int m_views; unsigned int m_headlinesPerDay; unsigned int m_headlinesRank; - QString m_toolkit; - QString m_toolkitVersion; + TQString m_toolkit; + TQString m_toolkitVersion; unsigned int m_pollingInterval; - QDateTime m_lastPoll; - QStringList m_categories; + TQDateTime m_lastPoll; + TQStringList m_categories; }; -inline QDataStream &operator<<( QDataStream &stream, const RSSNewsFeed &feed ) +inline TQDataStream &operator<<( TQDataStream &stream, const RSSNewsFeed &feed ) { return stream << feed.m_id << feed.m_name << feed.m_description << feed.m_origin << feed.m_languageCode << feed.m_status @@ -94,7 +94,7 @@ inline QDataStream &operator<<( QDataStream &stream, const RSSNewsFeed &feed ) << feed.m_categories; } -inline QDataStream &operator>>( QDataStream &stream, RSSNewsFeed &feed ) +inline TQDataStream &operator>>( TQDataStream &stream, RSSNewsFeed &feed ) { int i; stream >> feed.m_id >> feed.m_name >> feed.m_description diff --git a/dcoprss/service.cpp b/dcoprss/service.cpp index 74544dc1..54e987b2 100644 --- a/dcoprss/service.cpp +++ b/dcoprss/service.cpp @@ -34,16 +34,16 @@ RSSService::~RSSService() } -QStringList RSSService::list() +TQStringList RSSService::list() { - QStringList lst; - QDictIterator itr(m_list); + TQStringList lst; + TQDictIterator itr(m_list); for(; itr.current(); ++itr) lst.append(itr.currentKey()); return lst; } -DCOPRef RSSService::add(QString id) +DCOPRef RSSService::add(TQString id) { if(m_list.find(id) == 0L) { // add a new one only if we need to m_list.insert(id, new RSSDocument(id)); @@ -53,14 +53,14 @@ DCOPRef RSSService::add(QString id) return document(id); } -void RSSService::remove(QString id) +void RSSService::remove(TQString id) { m_list.remove(id); removed(id); saveLinks(); } -DCOPRef RSSService::document(QString id) +DCOPRef RSSService::document(TQString id) { if( m_list[id] ) return DCOPRef(m_list[id]); @@ -81,9 +81,9 @@ void RSSService::loadLinks() { KConfig *conf = kapp->config(); conf->setGroup("RSS Links"); - const QStringList links = conf->readListEntry ("links"); - QStringList::ConstIterator it = links.begin(); - QStringList::ConstIterator end = links.end(); + const TQStringList links = conf->readListEntry ("links"); + TQStringList::ConstIterator it = links.begin(); + TQStringList::ConstIterator end = links.end(); for ( ; it != end; ++it ) add( *it ); } @@ -92,8 +92,8 @@ void RSSService::saveLinks() { KConfig *conf = kapp->config(); conf->setGroup("RSS Links"); - QStringList lst; - QDictIterator itr(m_list); + TQStringList lst; + TQDictIterator itr(m_list); for(; itr.current(); ++itr) lst.append(itr.currentKey()); diff --git a/dcoprss/service.h b/dcoprss/service.h index 35cf229e..64a3589e 100644 --- a/dcoprss/service.h +++ b/dcoprss/service.h @@ -21,12 +21,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -47,7 +47,7 @@ class RSSService : public DCOPObject private: - QDict m_list; + TQDict m_list; public: RSSService(); @@ -59,14 +59,14 @@ class RSSService : public DCOPObject k_dcop_signals: /** * Emmitted when a new document has been added. You can then - * use document(QString) to get the dcop ref for the object. + * use document(TQString) to get the dcop ref for the object. * Note: this document may or may not be valid at this * point so you should connect your dcop signals and then * do a documentValid() on the dcop ref to make sure of its * state. **/ - void added(QString); + void added(TQString); /** * Emmitted when the document has been removed. * note at this point the DCOPRef for this object is @@ -75,7 +75,7 @@ class RSSService : public DCOPObject * process of loading the document call will be safely ignored * and you will be notified of the updates. **/ - void removed(QString); + void removed(TQString); k_dcop: /** * Add a new rdf file resource. This will return a dcop reference to the resource. If its a new @@ -83,50 +83,50 @@ class RSSService : public DCOPObject * once this reference has been returned you may connect dcop signals and then call * refresh on the RSSDocument. The document will not be updated until refresh is called. **/ - DCOPRef add(QString url); + DCOPRef add(TQString url); /** * Return a list of current rss documents **/ - QStringList list(); + TQStringList list(); /** * Remove an rss document resource. NOTE: Be aware that others may be using this * resource and if you remove it they may break. Likewise be aware that someone may * decide to remove your resource on you so you should always check to see if the resource * is valid before you access it. **/ - void remove(QString url); + void remove(TQString url); /** * Return the reference to a requested resource. If this resource is not present a null dcopref is * returned. **/ - DCOPRef document(QString url); + DCOPRef document(TQString url); /** * Exit the RSSService. This will clean everything up and exit. **/ void exit(); }; -class RSSDocument : public QObject, public DCOPObject +class RSSDocument : public TQObject, public DCOPObject { Q_OBJECT K_DCOP private: bool m_isLoading; - QString m_Url; + TQString m_Url; Document *m_Doc; - QPixmap m_pix; - QPtrList m_list; - QMap m_state; - QDateTime m_Timeout; + TQPixmap m_pix; + TQPtrList m_list; + TQMap m_state; + TQDateTime m_Timeout; int m_maxAge; private slots: - void pixmapLoaded(const QPixmap&); + void pixmapLoaded(const TQPixmap&); void loadingComplete(Loader *, Document, Status); public: - RSSDocument(const QString& url); + RSSDocument(const TQString& url); ~RSSDocument(); k_dcop_signals: @@ -161,31 +161,31 @@ class RSSDocument : public QObject, public DCOPObject /** * Return the webmaster information from the RSS::Document **/ - QString webMaster(); + TQString webMaster(); /** * Return the manageing editor from the RSS::Document **/ - QString managingEditor(); + TQString managingEditor(); /** * Returns the rating of the RSS::Document **/ - QString rating(); + TQString rating(); /** * Returns the last build date from the RSS::Document **/ - QDateTime lastBuildDate(); + TQDateTime lastBuildDate(); /** * Returns the publication date from the RSS::Document **/ - QDateTime pubDate(); + TQDateTime pubDate(); /** * Returns the copyright information from the RSS::Document **/ - QString copyright(); + TQString copyright(); /** * Returns a list of article titles **/ - QStringList articles(); + TQStringList articles(); /** * Returns the number of articles **/ @@ -197,27 +197,27 @@ class RSSDocument : public QObject, public DCOPObject /** * Returns the link from the RSS::Document **/ - QString link(); + TQString link(); /** * Returns the description from the RSS::Document **/ - QString description(); + TQString description(); /** * Returns the title from the RSS::Document **/ - QString title(); + TQString title(); /** * Returns the text version from the RSS::Document **/ - QString verbVersion(); + TQString verbVersion(); /** * Returns the url for the pixmap from the RSS::Document **/ - QString pixmapURL(); + TQString pixmapURL(); /** * Returns the actual pixmap from the RSS::Document's RSS::Image **/ - QPixmap pixmap(); + TQPixmap pixmap(); /** * Returns if the RSSDocument contains a valid RSS::Document yet. **/ @@ -249,17 +249,17 @@ class RSSDocument : public QObject, public DCOPObject * 2 - unread * 3 - read */ - int state( const QString &title) const; + int state( const TQString &title) const; /** * Set the article state */ - void setState( const QString &title, int s ); + void setState( const TQString &title, int s ); /** * Convience method that will set a title to read. */ - void read( const QString &title); + void read( const TQString &title); }; class RSSArticle : public DCOPObject @@ -277,14 +277,14 @@ class RSSArticle : public DCOPObject /** * Return the articles title **/ - QString title(); + TQString title(); /** * Return the articles description **/ - QString description(); + TQString description(); /** * Return the link to the article **/ - QString link(); + TQString link(); }; #endif diff --git a/dcoprss/xmlrpciface.cpp b/dcoprss/xmlrpciface.cpp index e86639eb..64259bbb 100644 --- a/dcoprss/xmlrpciface.cpp +++ b/dcoprss/xmlrpciface.cpp @@ -29,46 +29,46 @@ #include #include -#include +#include using namespace KXMLRPC; -Query *Query::create( QObject *parent, const char *name ) +Query *Query::create( TQObject *parent, const char *name ) { return new Query( parent, name ); } -void Query::call( const QString &server, const QString &method, - const QValueList &args, const QString &userAgent ) +void Query::call( const TQString &server, const TQString &method, + const TQValueList &args, const TQString &userAgent ) { m_buffer.open( IO_ReadWrite ); m_server = server; m_method = method; m_args = args; - const QString xmlMarkup = markupCall( method, args ); + const TQString xmlMarkup = markupCall( method, args ); - QByteArray postData; - QDataStream stream( postData, IO_WriteOnly ); + TQByteArray postData; + TQDataStream stream( postData, IO_WriteOnly ); stream.writeRawBytes( xmlMarkup.utf8(), xmlMarkup.length() ); KIO::TransferJob *job = KIO::http_post( KURL( server ), postData, false ); job->addMetaData( "UserAgent", userAgent ); job->addMetaData( "content-type", "Content-Type: text/xml; charset=utf-8" ); - connect( job, SIGNAL( infoMessage( KIO::Job *, const QString & ) ), - this, SLOT( slotInfoMessage( KIO::Job *, const QString & ) ) ); - connect( job, SIGNAL( data( KIO::Job *, const QByteArray & ) ), - this, SLOT( slotData( KIO::Job *, const QByteArray & ) ) ); - connect( job, SIGNAL( result( KIO::Job * ) ), - this, SLOT( slotResult( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( infoMessage( KIO::Job *, const TQString & ) ), + this, TQT_SLOT( slotInfoMessage( KIO::Job *, const TQString & ) ) ); + connect( job, TQT_SIGNAL( data( KIO::Job *, const TQByteArray & ) ), + this, TQT_SLOT( slotData( KIO::Job *, const TQByteArray & ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), + this, TQT_SLOT( slotResult( KIO::Job * ) ) ); } -void Query::slotInfoMessage( KIO::Job *, const QString &msg ) +void Query::slotInfoMessage( KIO::Job *, const TQString &msg ) { emit infoMessage( msg ); } -void Query::slotData( KIO::Job *, const QByteArray &data ) +void Query::slotData( KIO::Job *, const TQByteArray &data ) { m_buffer.writeBlock( data ); } @@ -90,7 +90,7 @@ void Query::slotResult( KIO::Job *job ) return; } - QDomDocument doc; + TQDomDocument doc; if ( !doc.setContent( m_buffer.buffer() ) ) { response.m_errorCode = -1; response.m_errorString = i18n( "Received invalid XML markup" ); @@ -119,17 +119,17 @@ void Query::slotResult( KIO::Job *job ) delete this; } -bool Query::isMessageResponse( const QDomDocument &doc ) const +bool Query::isMessageResponse( const TQDomDocument &doc ) const { return doc.documentElement().firstChild().toElement().tagName().lower() == "params"; } -Query::Result Query::parseMessageResponse( const QDomDocument &doc ) const +Query::Result Query::parseMessageResponse( const TQDomDocument &doc ) const { Result response; response.m_success = true; - QDomNode paramNode = doc.documentElement().firstChild().firstChild(); + TQDomNode paramNode = doc.documentElement().firstChild().firstChild(); while ( !paramNode.isNull() ) { response.m_data << demarshal( paramNode.firstChild().toElement() ); paramNode = paramNode.nextSibling(); @@ -138,35 +138,35 @@ Query::Result Query::parseMessageResponse( const QDomDocument &doc ) const return response; } -bool Query::isFaultResponse( const QDomDocument &doc ) const +bool Query::isFaultResponse( const TQDomDocument &doc ) const { return doc.documentElement().firstChild().toElement().tagName().lower() == "fault"; } -Query::Result Query::parseFaultResponse( const QDomDocument &doc ) const +Query::Result Query::parseFaultResponse( const TQDomDocument &doc ) const { Result response; response.m_success = false; - QDomNode errorNode = doc.documentElement().firstChild().firstChild(); - const QVariant errorVariant = demarshal( errorNode.toElement() ); + TQDomNode errorNode = doc.documentElement().firstChild().firstChild(); + const TQVariant errorVariant = demarshal( errorNode.toElement() ); response.m_errorCode = errorVariant.toMap()[ "faultCode" ].toInt(); response.m_errorString = errorVariant.toMap()[ "faultString" ].toString(); return response; } -QString Query::markupCall( const QString &cmd, - const QValueList &args ) const +TQString Query::markupCall( const TQString &cmd, + const TQValueList &args ) const { - QString markup = ""; + TQString markup = ""; markup += "" + cmd + ""; if ( !args.isEmpty() ) { markup += ""; - QValueList::ConstIterator it = args.begin(); - QValueList::ConstIterator end = args.end(); + TQValueList::ConstIterator it = args.begin(); + TQValueList::ConstIterator end = args.end(); for ( ; it != end; ++it ) markup += "" + marshal( *it ) + ""; markup += ""; @@ -177,46 +177,46 @@ QString Query::markupCall( const QString &cmd, return markup; } -QString Query::marshal( const QVariant &arg ) +TQString Query::marshal( const TQVariant &arg ) { - QString s = ""; + TQString s = ""; switch ( arg.type() ) { - case QVariant::String: - case QVariant::CString: + case TQVariant::String: + case TQVariant::CString: s += "" + arg.toString() + ""; break; - case QVariant::Int: - s += "" + QString::number( arg.toInt() ) + ""; + case TQVariant::Int: + s += "" + TQString::number( arg.toInt() ) + ""; break; - case QVariant::Double: - s += "" + QString::number( arg.toDouble() ) + ""; + case TQVariant::Double: + s += "" + TQString::number( arg.toDouble() ) + ""; break; - case QVariant::Bool: + case TQVariant::Bool: s += ""; s += arg.toBool() ? "true" : "false"; s += ""; break; - case QVariant::ByteArray: + case TQVariant::ByteArray: s += "" + KCodecs::base64Encode( arg.toByteArray() ) + ""; break; - case QVariant::DateTime: + case TQVariant::DateTime: s += "" + arg.toDateTime().toString( Qt::ISODate ) + ""; break; - case QVariant::List: { + case TQVariant::List: { s += ""; - const QValueList args = arg.toList(); - QValueList::ConstIterator it = args.begin(); - QValueList::ConstIterator end = args.end(); + const TQValueList args = arg.toList(); + TQValueList::ConstIterator it = args.begin(); + TQValueList::ConstIterator end = args.end(); for ( ; it != end; ++it ) s += marshal( *it ); s += ""; break; } - case QVariant::Map: { + case TQVariant::Map: { s += ""; - QMap map = arg.toMap(); - QMap::ConstIterator it = map.begin(); - QMap::ConstIterator end = map.end(); + TQMap map = arg.toMap(); + TQMap::ConstIterator it = map.begin(); + TQMap::ConstIterator end = map.end(); for ( ; it != end; ++it ) { s += ""; s += "" + it.key() + ""; @@ -233,127 +233,127 @@ QString Query::marshal( const QVariant &arg ) return s + ""; } -QVariant Query::demarshal( const QDomElement &elem ) +TQVariant Query::demarshal( const TQDomElement &elem ) { Q_ASSERT( elem.tagName().lower() == "value" ); if ( !elem.firstChild().isElement() ) - return QVariant( elem.text() ); + return TQVariant( elem.text() ); - const QDomElement typeElement = elem.firstChild().toElement(); - const QString typeName = typeElement.tagName().lower(); + const TQDomElement typeElement = elem.firstChild().toElement(); + const TQString typeName = typeElement.tagName().lower(); if ( typeName == "string" ) - return QVariant( typeElement.text() ); + return TQVariant( typeElement.text() ); else if ( typeName == "i4" || typeName == "int" ) - return QVariant( typeElement.text().toInt() ); + return TQVariant( typeElement.text().toInt() ); else if ( typeName == "double" ) - return QVariant( typeElement.text().toDouble() ); + return TQVariant( typeElement.text().toDouble() ); else if ( typeName == "boolean" ) { if ( typeElement.text().lower() == "true" || typeElement.text() == "1" ) - return QVariant( true ); + return TQVariant( true ); else - return QVariant( false ); + return TQVariant( false ); } else if ( typeName == "base64" ) - return QVariant( KCodecs::base64Decode( typeElement.text().latin1() ) ); + return TQVariant( KCodecs::base64Decode( typeElement.text().latin1() ) ); else if ( typeName == "datetime" || typeName == "datetime.iso8601" ) - return QVariant( QDateTime::fromString( typeElement.text(), Qt::ISODate ) ); + return TQVariant( TQDateTime::fromString( typeElement.text(), Qt::ISODate ) ); else if ( typeName == "array" ) { - QValueList values; - QDomNode valueNode = typeElement.firstChild().firstChild(); + TQValueList values; + TQDomNode valueNode = typeElement.firstChild().firstChild(); while ( !valueNode.isNull() ) { values << demarshal( valueNode.toElement() ); valueNode = valueNode.nextSibling(); } - return QVariant( values ); + return TQVariant( values ); } else if ( typeName == "struct" ) { - QMap map; - QDomNode memberNode = typeElement.firstChild(); + TQMap map; + TQDomNode memberNode = typeElement.firstChild(); while ( !memberNode.isNull() ) { - const QString key = memberNode.toElement().elementsByTagName( "name" ).item( 0 ).toElement().text(); - const QVariant data = demarshal( memberNode.toElement().elementsByTagName( "value" ).item( 0 ).toElement() ); + const TQString key = memberNode.toElement().elementsByTagName( "name" ).item( 0 ).toElement().text(); + const TQVariant data = demarshal( memberNode.toElement().elementsByTagName( "value" ).item( 0 ).toElement() ); map[ key ] = data; memberNode = memberNode.nextSibling(); } - return QVariant( map ); + return TQVariant( map ); } else kdWarning() << "Cannot demarshal unknown type " << typeName << endl; - return QVariant(); + return TQVariant(); } -Query::Query( QObject *parent, const char *name ) : QObject( parent, name ) +Query::Query( TQObject *parent, const char *name ) : TQObject( parent, name ) { } -QValueList Server::toVariantList( const QVariant &arg ) +TQValueList Server::toVariantList( const TQVariant &arg ) { - QValueList args; + TQValueList args; args << arg ; return args; } -QValueList Server::toVariantList( int arg ) +TQValueList Server::toVariantList( int arg ) { - QValueList args; + TQValueList args; args << arg ; return args; } -QValueList Server::toVariantList( bool arg ) +TQValueList Server::toVariantList( bool arg ) { - QValueList args; + TQValueList args; args << arg ; return args; } -QValueList Server::toVariantList( double arg ) +TQValueList Server::toVariantList( double arg ) { - QValueList args; + TQValueList args; args << arg ; return args; } -QValueList Server::toVariantList( const QString &arg ) +TQValueList Server::toVariantList( const TQString &arg ) { - QValueList args; + TQValueList args; args << arg ; return args; } -QValueList Server::toVariantList( const QCString &arg ) +TQValueList Server::toVariantList( const TQCString &arg ) { - QValueList args; + TQValueList args; args << arg ; return args; } -QValueList Server::toVariantList( const QByteArray &arg ) +TQValueList Server::toVariantList( const TQByteArray &arg ) { - QValueList args; + TQValueList args; args << arg ; return args; } -QValueList Server::toVariantList( const QDateTime &arg ) +TQValueList Server::toVariantList( const TQDateTime &arg ) { - QValueList args; + TQValueList args; args << arg ; return args; } -QValueList Server::toVariantList( const QStringList &arg ) +TQValueList Server::toVariantList( const TQStringList &arg ) { - QValueList args; - QStringList::ConstIterator it = arg.begin(); - QStringList::ConstIterator end = arg.end(); + TQValueList args; + TQStringList::ConstIterator it = arg.begin(); + TQStringList::ConstIterator end = arg.end(); for ( ; it != end; ++it ) - args << QVariant( *it ); + args << TQVariant( *it ); return args; } -Server::Server( const KURL &url, QObject *parent, const char *name ) - : QObject( parent, name ) +Server::Server( const KURL &url, TQObject *parent, const char *name ) + : TQObject( parent, name ) { if ( url.isValid() ) m_url = url; @@ -364,8 +364,8 @@ void Server::setUrl( const KURL &url ) m_url = url.isValid() ? url : KURL(); } -void Server::call( const QString &method, const QValueList &args, - QObject *receiver, const char *slot ) +void Server::call( const TQString &method, const TQValueList &args, + TQObject *receiver, const char *slot ) { if ( m_url.isEmpty() ) { kdWarning() << "Cannot execute call to " << method << ": empty server URL" << endl; @@ -373,16 +373,16 @@ void Server::call( const QString &method, const QValueList &args, } Query *query = Query::create( this ); - connect( query, SIGNAL( infoMessage( const QString & ) ), - this, SIGNAL( infoMessage( const QString & ) ) ); - connect( query, SIGNAL( finished( const KXMLRPC::Query::Result & ) ), + connect( query, TQT_SIGNAL( infoMessage( const TQString & ) ), + this, TQT_SIGNAL( infoMessage( const TQString & ) ) ); + connect( query, TQT_SIGNAL( finished( const KXMLRPC::Query::Result & ) ), receiver, slot ); query->call( m_url.url(), method, args, m_userAgent ); } -void Server::call( const QString &method, const QValueList &args, - QObject *receiver, const char *slot, - QObject *infoObject, const char *infoSlot ) +void Server::call( const TQString &method, const TQValueList &args, + TQObject *receiver, const char *slot, + TQObject *infoObject, const char *infoSlot ) { if ( m_url.isEmpty() ) { kdWarning() << "Cannot execute call to " << method << ": empty server URL" << endl; @@ -390,9 +390,9 @@ void Server::call( const QString &method, const QValueList &args, } Query *query = Query::create( this ); - connect( query, SIGNAL( infoMessage( const QString &msg ) ), + connect( query, TQT_SIGNAL( infoMessage( const TQString &msg ) ), infoObject, infoSlot ); - connect( query, SIGNAL( finished( const KXMLRPC::Query::Result & ) ), + connect( query, TQT_SIGNAL( finished( const KXMLRPC::Query::Result & ) ), receiver, slot ); query->call( m_url.url(), method, args, m_userAgent ); } diff --git a/dcoprss/xmlrpciface.h b/dcoprss/xmlrpciface.h index f7897e10..d3b1a4b0 100644 --- a/dcoprss/xmlrpciface.h +++ b/dcoprss/xmlrpciface.h @@ -27,11 +27,11 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include class QDomDocument; class QDomElement; @@ -54,62 +54,62 @@ namespace KXMLRPC class Result { friend class Query; - friend QDataStream &operator>>( QDataStream &s, Query::Result &r ); + friend TQDataStream &operator>>( TQDataStream &s, Query::Result &r ); public: Result() { } bool success() const { return m_success; } int errorCode() const { return m_errorCode; } - QString errorString() const { return m_errorString; } - QValueList data() const { return m_data; } - QString server() const { return m_server; } - QString method() const { return m_method; } - QValueList args() const { return m_args; } + TQString errorString() const { return m_errorString; } + TQValueList data() const { return m_data; } + TQString server() const { return m_server; } + TQString method() const { return m_method; } + TQValueList args() const { return m_args; } private: bool m_success; int m_errorCode; - QString m_errorString; - QValueList m_data; - QString m_server; - QString m_method; - QValueList m_args; + TQString m_errorString; + TQValueList m_data; + TQString m_server; + TQString m_method; + TQValueList m_args; }; - static Query *create( QObject *parent = 0, const char *name = 0 ); - static QString marshal( const QVariant &v ); - static QVariant demarshal( const QDomElement &e ); + static Query *create( TQObject *parent = 0, const char *name = 0 ); + static TQString marshal( const TQVariant &v ); + static TQVariant demarshal( const TQDomElement &e ); public slots: - void call( const QString &server, const QString &method, - const QValueList &args = QValueList(), - const QString &userAgent = "KDE-XMLRPC" ); + void call( const TQString &server, const TQString &method, + const TQValueList &args = TQValueList(), + const TQString &userAgent = "KDE-XMLRPC" ); signals: - void infoMessage( const QString &msg ); + void infoMessage( const TQString &msg ); void finished( const KXMLRPC::Query::Result &result ); private slots: - void slotInfoMessage( KIO::Job *job, const QString &msg ); - void slotData( KIO::Job *job, const QByteArray &data ); + void slotInfoMessage( KIO::Job *job, const TQString &msg ); + void slotData( KIO::Job *job, const TQByteArray &data ); void slotResult( KIO::Job *job ); private: - bool isMessageResponse( const QDomDocument &doc ) const; - bool isFaultResponse( const QDomDocument &doc ) const; + bool isMessageResponse( const TQDomDocument &doc ) const; + bool isFaultResponse( const TQDomDocument &doc ) const; - Result parseMessageResponse( const QDomDocument &doc ) const; - Result parseFaultResponse( const QDomDocument &doc ) const; + Result parseMessageResponse( const TQDomDocument &doc ) const; + Result parseFaultResponse( const TQDomDocument &doc ) const; - QString markupCall( const QString &method, - const QValueList &args ) const; + TQString markupCall( const TQString &method, + const TQValueList &args ) const; - Query( QObject *parent = 0, const char *name = 0 ); + Query( TQObject *parent = 0, const char *name = 0 ); - QBuffer m_buffer; - QString m_server; - QString m_method; - QValueList m_args; + TQBuffer m_buffer; + TQString m_server; + TQString m_method; + TQValueList m_args; }; class Server : public QObject @@ -117,44 +117,44 @@ namespace KXMLRPC Q_OBJECT public: Server( const KURL &url = KURL(), - QObject *parent = 0, const char *name = 0 ); + TQObject *parent = 0, const char *name = 0 ); const KURL &url() const { return m_url; } void setUrl( const KURL &url ); - QString userAgent() const { return m_userAgent; } - void setUserAgent( const QString &userAgent) { m_userAgent = userAgent; } + TQString userAgent() const { return m_userAgent; } + void setUserAgent( const TQString &userAgent) { m_userAgent = userAgent; } template - void call( const QString &method, const QValueList &arg, - QObject *object, const char *slot ); - - static QValueList toVariantList( const QVariant &arg ); - static QValueList toVariantList( int arg ); - static QValueList toVariantList( bool arg ); - static QValueList toVariantList( double arg ); - static QValueList toVariantList( const QString &arg ); - static QValueList toVariantList( const QCString &arg ); - static QValueList toVariantList( const QByteArray &arg ); - static QValueList toVariantList( const QDateTime &arg ); - static QValueList toVariantList( const QStringList &arg ); + void call( const TQString &method, const TQValueList &arg, + TQObject *object, const char *slot ); + + static TQValueList toVariantList( const TQVariant &arg ); + static TQValueList toVariantList( int arg ); + static TQValueList toVariantList( bool arg ); + static TQValueList toVariantList( double arg ); + static TQValueList toVariantList( const TQString &arg ); + static TQValueList toVariantList( const TQCString &arg ); + static TQValueList toVariantList( const TQByteArray &arg ); + static TQValueList toVariantList( const TQDateTime &arg ); + static TQValueList toVariantList( const TQStringList &arg ); signals: - void infoMessage( const QString &msg ); + void infoMessage( const TQString &msg ); public slots: - void call( const QString &method, const QValueList &args, - QObject *object, const char *slot ); - void call( const QString &method, const QValueList &args, - QObject *object, const char *slot, - QObject *infoObject, const char *infoSlot ); + void call( const TQString &method, const TQValueList &args, + TQObject *object, const char *slot ); + void call( const TQString &method, const TQValueList &args, + TQObject *object, const char *slot, + TQObject *infoObject, const char *infoSlot ); private: KURL m_url; - QString m_userAgent; + TQString m_userAgent; }; - inline QDataStream &operator>>( QDataStream &s, Query::Result &r ) + inline TQDataStream &operator>>( TQDataStream &s, Query::Result &r ) { return s >> r.m_errorCode >> r.m_errorString >> r.m_data >> r.m_server >> r.m_method >> r.m_args; @@ -162,20 +162,20 @@ namespace KXMLRPC } template -void KXMLRPC::Server::call( const QString &method, const QValueList &arg, - QObject *object, const char *slot ) +void KXMLRPC::Server::call( const TQString &method, const TQValueList &arg, + TQObject *object, const char *slot ) { - QValueList args; + TQValueList args; - typename QValueList::ConstIterator it = arg.begin(); - typename QValueList::ConstIterator end = arg.end(); + typename TQValueList::ConstIterator it = arg.begin(); + typename TQValueList::ConstIterator end = arg.end(); for ( ; it != end; ++it ) - args << QVariant( *it ); + args << TQVariant( *it ); call( method, args, object, slot ); } -inline QDataStream &operator<<( QDataStream &s, const KXMLRPC::Query::Result &r ) +inline TQDataStream &operator<<( TQDataStream &s, const KXMLRPC::Query::Result &r ) { return s << r.errorCode() << r.errorString() << r.data() << r.server() << r.method() << r.args(); -- cgit v1.2.1