diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
commit | 47c8a359c5276062c4bc17f0e82410f29081b502 (patch) | |
tree | 2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /dcoprss/query.cpp | |
parent | 6f82532777a35e0e60bbd2b290b2e93e646f349b (diff) | |
download | tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'dcoprss/query.cpp')
-rw-r--r-- | dcoprss/query.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
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; |