diff options
Diffstat (limited to 'dcoprss')
-rw-r--r-- | dcoprss/article.cpp | 6 | ||||
-rw-r--r-- | dcoprss/cache.cpp | 46 | ||||
-rw-r--r-- | dcoprss/cache.h | 30 | ||||
-rw-r--r-- | dcoprss/client.cpp | 34 | ||||
-rw-r--r-- | dcoprss/document.cpp | 66 | ||||
-rw-r--r-- | dcoprss/feedbrowser.cpp | 62 | ||||
-rw-r--r-- | dcoprss/feedbrowser.h | 28 | ||||
-rw-r--r-- | dcoprss/query.cpp | 90 | ||||
-rw-r--r-- | dcoprss/query.h | 38 | ||||
-rw-r--r-- | dcoprss/rssnewsfeed.h | 94 | ||||
-rw-r--r-- | dcoprss/service.cpp | 22 | ||||
-rw-r--r-- | dcoprss/service.h | 82 | ||||
-rw-r--r-- | dcoprss/xmlrpciface.cpp | 202 | ||||
-rw-r--r-- | dcoprss/xmlrpciface.h | 132 |
14 files changed, 466 insertions, 466 deletions
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 <kdebug.h> #include <kstandarddirs.h> -#include <qdatastream.h> -#include <qfile.h> +#include <tqdatastream.h> +#include <tqfile.h> 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<QVariant> &args ) +TQString Cache::getCacheKey( const TQString &server, const TQString &method, + const TQValueList<TQVariant> &args ) { - QString key; - key = server + QString::fromLatin1( "__" ); - key += method + QString::fromLatin1( "__" ); - QValueList<QVariant>::ConstIterator it = args.begin(); - QValueList<QVariant>::ConstIterator end = args.end(); + TQString key; + key = server + TQString::fromLatin1( "__" ); + key += method + TQString::fromLatin1( "__" ); + TQValueList<TQVariant>::ConstIterator it = args.begin(); + TQValueList<TQVariant>::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<CacheEntry>::insert( key, entry ); + TQDict<CacheEntry>::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<CacheEntry> it( *this ); + TQDictIterator<CacheEntry> 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<CacheEntry>::insert( key, entry ); + TQDict<CacheEntry>::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 <qcstring.h> -#include <qdatetime.h> -#include <qdict.h> +#include <tqcstring.h> +#include <tqdatetime.h> +#include <tqdict.h> #include <xmlrpciface.h> 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<CacheEntry> +class Cache : public TQDict<CacheEntry> { public: static Cache &self(); - static QString getCacheKey( const QString &server, - const QString &method, - const QValueList<QVariant> &args ); + static TQString getCacheKey( const TQString &server, + const TQString &method, + const TQValueList<TQVariant> &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<CacheEntry> 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 <kapplication.h> #include <dcopclient.h> #include <dcopref.h> -#include <qdatastream.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qcstring.h> +#include <tqdatastream.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqcstring.h> #include <kdebug.h> #include <stdlib.h> /* @@ -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 <kdebug.h> -#include <qdatetime.h> +#include <tqdatetime.h> #include <kurl.h> #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 <klocale.h> #include <dcopclient.h> -#include <qcstring.h> -#include <qdatastream.h> -#include <qvbox.h> +#include <tqcstring.h> +#include <tqdatastream.h> +#include <tqvbox.h> -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 <qobject.h> +#include <tqobject.h> #include <dcopobject.h> #include <kdialogbase.h> #include <klistview.h> -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<QVariant> &args, +void QueryService::cachedCall( const TQString &method, + const TQValueList<TQVariant> &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<int> ids; + TQValueList<int> ids; - const QValueList<QVariant> values = result.data()[ 0 ].toList(); - QValueList<QVariant>::ConstIterator it = values.begin(); - QValueList<QVariant>::ConstIterator end = values.end(); + const TQValueList<TQVariant> values = result.data()[ 0 ].toList(); + TQValueList<TQVariant>::ConstIterator it = values.begin(); + TQValueList<TQVariant>::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<QString, QString> links; - QValueList<RSSNewsFeed> feeds; + TQMap<TQString, TQString> links; + TQValueList<RSSNewsFeed> feeds; - const QValueList<QVariant> feedInfos = result.data(); - QValueList<QVariant>::ConstIterator it = feedInfos.begin(); - QValueList<QVariant>::ConstIterator end = feedInfos.end(); + const TQValueList<TQVariant> feedInfos = result.data(); + TQValueList<TQVariant>::ConstIterator it = feedInfos.begin(); + TQValueList<TQVariant>::ConstIterator end = feedInfos.end(); for ( ; it != end; ++it ) { - const QMap<QString, QVariant> feedInfo = ( *it ).toMap(); + const TQMap<TQString, TQVariant> 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<QVariant> cats = result.data()[ 0 ].toList(); - QValueList<QVariant>::ConstIterator it = cats.begin(); - QValueList<QVariant>::ConstIterator end = cats.end(); + const TQValueList<TQVariant> cats = result.data()[ 0 ].toList(); + TQValueList<TQVariant>::ConstIterator it = cats.begin(); + TQValueList<TQVariant>::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<int> ids; + TQValueList<int> ids; - const QValueList<QVariant> values = result.data()[ 0 ].toList(); - QValueList<QVariant>::ConstIterator it = values.begin(); - QValueList<QVariant>::ConstIterator end = values.end(); + const TQValueList<TQVariant> values = result.data()[ 0 ].toList(); + TQValueList<TQVariant>::ConstIterator it = values.begin(); + TQValueList<TQVariant>::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 <dcopobject.h> -#include <qmap.h> -#include <qobject.h> -#include <qvaluelist.h> -#include <qvariant.h> +#include <tqmap.h> +#include <tqobject.h> +#include <tqvaluelist.h> +#include <tqvariant.h> 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<int> ids ); - void feedInfo(QMap<QString, QString> links); - void feedInfo(QValueList<RSSNewsFeed> feeds); - void gotCategories( const QStringList &categories ); - void gotFeedsInCategory( const QValueList<int> &ids ); + void feedIds( TQValueList<int> ids ); + void feedInfo(TQMap<TQString, TQString> links); + void feedInfo(TQValueList<RSSNewsFeed> feeds); + void gotCategories( const TQStringList &categories ); + void gotFeedsInCategory( const TQValueList<int> &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<QVariant> &args, + void cachedCall( const TQString &method, const TQValueList<TQVariant> &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 <qdatetime.h> -#include <qstringlist.h> -#include <qvariant.h> +#include <tqdatetime.h> +#include <tqstringlist.h> +#include <tqvariant.h> #include <kdatastream.h> 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<RSSDocument> itr(m_list); + TQStringList lst; + TQDictIterator<RSSDocument> 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<RSSDocument> itr(m_list); + TQStringList lst; + TQDictIterator<RSSDocument> 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 <dcopobject.h> #include <dcopref.h> -#include <qdict.h> -#include <qptrlist.h> -#include <qstringlist.h> -#include <qstring.h> -#include <qdatetime.h> -#include <qpixmap.h> +#include <tqdict.h> +#include <tqptrlist.h> +#include <tqstringlist.h> +#include <tqstring.h> +#include <tqdatetime.h> +#include <tqpixmap.h> #include <librss/global.h> #include <librss/loader.h> #include <librss/document.h> @@ -47,7 +47,7 @@ class RSSService : public DCOPObject private: - QDict<RSSDocument> m_list; + TQDict<RSSDocument> 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<RSSArticle> m_list; - QMap<QString,int> m_state; - QDateTime m_Timeout; + TQPixmap m_pix; + TQPtrList<RSSArticle> m_list; + TQMap<TQString,int> 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 <klocale.h> #include <kmdcodec.h> -#include <qdom.h> +#include <tqdom.h> 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<QVariant> &args, const QString &userAgent ) +void Query::call( const TQString &server, const TQString &method, + const TQValueList<TQVariant> &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<QVariant> &args ) const +TQString Query::markupCall( const TQString &cmd, + const TQValueList<TQVariant> &args ) const { - QString markup = "<?xml version='1.0' ?><methodCall>"; + TQString markup = "<?xml version='1.0' ?><methodCall>"; markup += "<methodName>" + cmd + "</methodName>"; if ( !args.isEmpty() ) { markup += "<params>"; - QValueList<QVariant>::ConstIterator it = args.begin(); - QValueList<QVariant>::ConstIterator end = args.end(); + TQValueList<TQVariant>::ConstIterator it = args.begin(); + TQValueList<TQVariant>::ConstIterator end = args.end(); for ( ; it != end; ++it ) markup += "<param>" + marshal( *it ) + "</param>"; markup += "</params>"; @@ -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 = "<value>"; + TQString s = "<value>"; switch ( arg.type() ) { - case QVariant::String: - case QVariant::CString: + case TQVariant::String: + case TQVariant::CString: s += "<string>" + arg.toString() + "</string>"; break; - case QVariant::Int: - s += "<int>" + QString::number( arg.toInt() ) + "</int>"; + case TQVariant::Int: + s += "<int>" + TQString::number( arg.toInt() ) + "</int>"; break; - case QVariant::Double: - s += "<double>" + QString::number( arg.toDouble() ) + "</double>"; + case TQVariant::Double: + s += "<double>" + TQString::number( arg.toDouble() ) + "</double>"; break; - case QVariant::Bool: + case TQVariant::Bool: s += "<boolean>"; s += arg.toBool() ? "true" : "false"; s += "</boolean>"; break; - case QVariant::ByteArray: + case TQVariant::ByteArray: s += "<base64>" + KCodecs::base64Encode( arg.toByteArray() ) + "</base64>"; break; - case QVariant::DateTime: + case TQVariant::DateTime: s += "<datetime.iso8601>" + arg.toDateTime().toString( Qt::ISODate ) + "</datetime.iso8601>"; break; - case QVariant::List: { + case TQVariant::List: { s += "<array><data>"; - const QValueList<QVariant> args = arg.toList(); - QValueList<QVariant>::ConstIterator it = args.begin(); - QValueList<QVariant>::ConstIterator end = args.end(); + const TQValueList<TQVariant> args = arg.toList(); + TQValueList<TQVariant>::ConstIterator it = args.begin(); + TQValueList<TQVariant>::ConstIterator end = args.end(); for ( ; it != end; ++it ) s += marshal( *it ); s += "</data></array>"; break; } - case QVariant::Map: { + case TQVariant::Map: { s += "<struct>"; - QMap<QString, QVariant> map = arg.toMap(); - QMap<QString, QVariant>::ConstIterator it = map.begin(); - QMap<QString, QVariant>::ConstIterator end = map.end(); + TQMap<TQString, TQVariant> map = arg.toMap(); + TQMap<TQString, TQVariant>::ConstIterator it = map.begin(); + TQMap<TQString, TQVariant>::ConstIterator end = map.end(); for ( ; it != end; ++it ) { s += "<member>"; s += "<name>" + it.key() + "</name>"; @@ -233,127 +233,127 @@ QString Query::marshal( const QVariant &arg ) return s + "</value>"; } -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<QVariant> values; - QDomNode valueNode = typeElement.firstChild().firstChild(); + TQValueList<TQVariant> 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<QString, QVariant> map; - QDomNode memberNode = typeElement.firstChild(); + TQMap<TQString, TQVariant> 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<QVariant> Server::toVariantList( const QVariant &arg ) +TQValueList<TQVariant> Server::toVariantList( const TQVariant &arg ) { - QValueList<QVariant> args; + TQValueList<TQVariant> args; args << arg ; return args; } -QValueList<QVariant> Server::toVariantList( int arg ) +TQValueList<TQVariant> Server::toVariantList( int arg ) { - QValueList<QVariant> args; + TQValueList<TQVariant> args; args << arg ; return args; } -QValueList<QVariant> Server::toVariantList( bool arg ) +TQValueList<TQVariant> Server::toVariantList( bool arg ) { - QValueList<QVariant> args; + TQValueList<TQVariant> args; args << arg ; return args; } -QValueList<QVariant> Server::toVariantList( double arg ) +TQValueList<TQVariant> Server::toVariantList( double arg ) { - QValueList<QVariant> args; + TQValueList<TQVariant> args; args << arg ; return args; } -QValueList<QVariant> Server::toVariantList( const QString &arg ) +TQValueList<TQVariant> Server::toVariantList( const TQString &arg ) { - QValueList<QVariant> args; + TQValueList<TQVariant> args; args << arg ; return args; } -QValueList<QVariant> Server::toVariantList( const QCString &arg ) +TQValueList<TQVariant> Server::toVariantList( const TQCString &arg ) { - QValueList<QVariant> args; + TQValueList<TQVariant> args; args << arg ; return args; } -QValueList<QVariant> Server::toVariantList( const QByteArray &arg ) +TQValueList<TQVariant> Server::toVariantList( const TQByteArray &arg ) { - QValueList<QVariant> args; + TQValueList<TQVariant> args; args << arg ; return args; } -QValueList<QVariant> Server::toVariantList( const QDateTime &arg ) +TQValueList<TQVariant> Server::toVariantList( const TQDateTime &arg ) { - QValueList<QVariant> args; + TQValueList<TQVariant> args; args << arg ; return args; } -QValueList<QVariant> Server::toVariantList( const QStringList &arg ) +TQValueList<TQVariant> Server::toVariantList( const TQStringList &arg ) { - QValueList<QVariant> args; - QStringList::ConstIterator it = arg.begin(); - QStringList::ConstIterator end = arg.end(); + TQValueList<TQVariant> 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<QVariant> &args, - QObject *receiver, const char *slot ) +void Server::call( const TQString &method, const TQValueList<TQVariant> &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<QVariant> &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<QVariant> &args, - QObject *receiver, const char *slot, - QObject *infoObject, const char *infoSlot ) +void Server::call( const TQString &method, const TQValueList<TQVariant> &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<QVariant> &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 <kurl.h> -#include <qbuffer.h> -#include <qdatastream.h> -#include <qobject.h> -#include <qvariant.h> -#include <qvaluelist.h> +#include <tqbuffer.h> +#include <tqdatastream.h> +#include <tqobject.h> +#include <tqvariant.h> +#include <tqvaluelist.h> 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<QVariant> data() const { return m_data; } - QString server() const { return m_server; } - QString method() const { return m_method; } - QValueList<QVariant> args() const { return m_args; } + TQString errorString() const { return m_errorString; } + TQValueList<TQVariant> data() const { return m_data; } + TQString server() const { return m_server; } + TQString method() const { return m_method; } + TQValueList<TQVariant> args() const { return m_args; } private: bool m_success; int m_errorCode; - QString m_errorString; - QValueList<QVariant> m_data; - QString m_server; - QString m_method; - QValueList<QVariant> m_args; + TQString m_errorString; + TQValueList<TQVariant> m_data; + TQString m_server; + TQString m_method; + TQValueList<TQVariant> 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<QVariant> &args = QValueList<QVariant>(), - const QString &userAgent = "KDE-XMLRPC" ); + void call( const TQString &server, const TQString &method, + const TQValueList<TQVariant> &args = TQValueList<TQVariant>(), + 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<QVariant> &args ) const; + TQString markupCall( const TQString &method, + const TQValueList<TQVariant> &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<QVariant> m_args; + TQBuffer m_buffer; + TQString m_server; + TQString m_method; + TQValueList<TQVariant> 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 <typename T> - void call( const QString &method, const QValueList<T> &arg, - QObject *object, const char *slot ); - - static QValueList<QVariant> toVariantList( const QVariant &arg ); - static QValueList<QVariant> toVariantList( int arg ); - static QValueList<QVariant> toVariantList( bool arg ); - static QValueList<QVariant> toVariantList( double arg ); - static QValueList<QVariant> toVariantList( const QString &arg ); - static QValueList<QVariant> toVariantList( const QCString &arg ); - static QValueList<QVariant> toVariantList( const QByteArray &arg ); - static QValueList<QVariant> toVariantList( const QDateTime &arg ); - static QValueList<QVariant> toVariantList( const QStringList &arg ); + void call( const TQString &method, const TQValueList<T> &arg, + TQObject *object, const char *slot ); + + static TQValueList<TQVariant> toVariantList( const TQVariant &arg ); + static TQValueList<TQVariant> toVariantList( int arg ); + static TQValueList<TQVariant> toVariantList( bool arg ); + static TQValueList<TQVariant> toVariantList( double arg ); + static TQValueList<TQVariant> toVariantList( const TQString &arg ); + static TQValueList<TQVariant> toVariantList( const TQCString &arg ); + static TQValueList<TQVariant> toVariantList( const TQByteArray &arg ); + static TQValueList<TQVariant> toVariantList( const TQDateTime &arg ); + static TQValueList<TQVariant> toVariantList( const TQStringList &arg ); signals: - void infoMessage( const QString &msg ); + void infoMessage( const TQString &msg ); public slots: - void call( const QString &method, const QValueList<QVariant> &args, - QObject *object, const char *slot ); - void call( const QString &method, const QValueList<QVariant> &args, - QObject *object, const char *slot, - QObject *infoObject, const char *infoSlot ); + void call( const TQString &method, const TQValueList<TQVariant> &args, + TQObject *object, const char *slot ); + void call( const TQString &method, const TQValueList<TQVariant> &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 <typename T> -void KXMLRPC::Server::call( const QString &method, const QValueList<T> &arg, - QObject *object, const char *slot ) +void KXMLRPC::Server::call( const TQString &method, const TQValueList<T> &arg, + TQObject *object, const char *slot ) { - QValueList<QVariant> args; + TQValueList<TQVariant> args; - typename QValueList<T>::ConstIterator it = arg.begin(); - typename QValueList<T>::ConstIterator end = arg.end(); + typename TQValueList<T>::ConstIterator it = arg.begin(); + typename TQValueList<T>::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(); |