summaryrefslogtreecommitdiffstats
path: root/kresources/blogging/API_Blogger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kresources/blogging/API_Blogger.cpp')
-rw-r--r--kresources/blogging/API_Blogger.cpp100
1 files changed, 50 insertions, 50 deletions
diff --git a/kresources/blogging/API_Blogger.cpp b/kresources/blogging/API_Blogger.cpp
index f30c56206..5cca14e1a 100644
--- a/kresources/blogging/API_Blogger.cpp
+++ b/kresources/blogging/API_Blogger.cpp
@@ -25,7 +25,7 @@
using namespace KBlog;
-QString APIBlogger::getFunctionName( blogFunctions type )
+TQString APIBlogger::getFunctionName( blogFunctions type )
{
switch ( type ) {
case bloggerGetUserInfo: return "blogger.getUserInfo";
@@ -37,7 +37,7 @@ QString APIBlogger::getFunctionName( blogFunctions type )
case bloggerGetPost: return "blogger.getPost";
case bloggerGetTemplate: return "blogger.getTemplate";
case bloggerSetTemplate: return "blogger.setTemplate";
- default: return QString::null;
+ default: return TQString::null;
}
}
@@ -47,7 +47,7 @@ QString APIBlogger::getFunctionName( blogFunctions type )
KIO::Job *APIBlogger::createUserInfoJob()
{
kdDebug() << "read user info..." << endl;
- QValueList<QVariant> args( defaultArgs() );
+ TQValueList<TQVariant> args( defaultArgs() );
return KIO::xmlrpcCall( mServerURL, getFunctionName( bloggerGetUserInfo ), args, false );
}
@@ -56,7 +56,7 @@ KIO::Job *APIBlogger::createListFoldersJob()
// TODO: Check if we're already authenticated. If not, do it!
// if ( isValid() ) {
kdDebug() << "Fetch List of Blogs..." << endl;
- QValueList<QVariant> args( defaultArgs() );
+ TQValueList<TQVariant> args( defaultArgs() );
return KIO::xmlrpcCall( mServerURL, getFunctionName( bloggerGetUsersBlogs ), args, false );
// } else {
// warningNotInitialized();
@@ -69,8 +69,8 @@ KIO::TransferJob *APIBlogger::createListItemsJob( const KURL &url )
// TODO: Check if we're already authenticated. If not, do it!
// if ( isValid() ) {
kdDebug() << "Fetch List of Posts..." << endl;
- QValueList<QVariant> args( defaultArgs( url.url() ) );
- args << QVariant( mDownloadCount );
+ TQValueList<TQVariant> args( defaultArgs( url.url() ) );
+ args << TQVariant( mDownloadCount );
return KIO::xmlrpcCall( mServerURL, getFunctionName( bloggerGetRecentPosts ), args, false );
// } else {
// warningNotInitialized();
@@ -82,7 +82,7 @@ KIO::TransferJob *APIBlogger::createDownloadJob( const KURL &url )
{
// if ( isValid() ){
kdDebug() << "Fetch Posting with url " << url.url() << endl;
- QValueList<QVariant> args( defaultArgs( url.url() ) );
+ TQValueList<TQVariant> args( defaultArgs( url.url() ) );
return KIO::xmlrpcCall( mServerURL, getFunctionName( bloggerGetPost ), args, false );
// } else {
// warningNotInitialized();
@@ -98,9 +98,9 @@ KIO::TransferJob *APIBlogger::createUploadJob( const KURL &url, KBlog::BlogPosti
}
// if ( isValid() ){
kdDebug() << "Uploading Posting with url " << url.url() << endl;
- QValueList<QVariant> args( defaultArgs( posting->postID() ) );
- args << QVariant( posting->content() );
- args << QVariant( /*publish=*/true, 0 );
+ TQValueList<TQVariant> args( defaultArgs( posting->postID() ) );
+ args << TQVariant( posting->content() );
+ args << TQVariant( /*publish=*/true, 0 );
return KIO::xmlrpcCall( mServerURL, getFunctionName( bloggerEditPost ), args, false );
// } else {
// warningNotInitialized();
@@ -116,9 +116,9 @@ KIO::TransferJob *APIBlogger::createUploadNewJob( KBlog::BlogPosting *posting )
}
// if ( isValid() ){
kdDebug() << "Creating new Posting with blogid " << posting->blogID() << " at url " << mServerURL << endl;
- QValueList<QVariant> args( defaultArgs( posting->blogID() ) );
- args << QVariant( posting->content() );
- args << QVariant( /*publish=*/true, 0 );
+ TQValueList<TQVariant> args( defaultArgs( posting->blogID() ) );
+ args << TQVariant( posting->content() );
+ args << TQVariant( /*publish=*/true, 0 );
return KIO::xmlrpcCall( mServerURL, getFunctionName( bloggerNewPost ), args, false );
// } else {
// warningNotInitialized();
@@ -126,12 +126,12 @@ KIO::TransferJob *APIBlogger::createUploadNewJob( KBlog::BlogPosting *posting )
// }
}
-KIO::Job *APIBlogger::createRemoveJob( const KURL &/*url*/, const QString &postid )
+KIO::Job *APIBlogger::createRemoveJob( const KURL &/*url*/, const TQString &postid )
{
kdDebug() << "APIBlogger::createRemoveJob: postid=" << postid << endl;
// if ( isValid() ){
- QValueList<QVariant> args( defaultArgs( postid ) );
- args << QVariant( /*publish=*/true, 0 );
+ TQValueList<TQVariant> args( defaultArgs( postid ) );
+ args << TQVariant( /*publish=*/true, 0 );
return KIO::xmlrpcCall( mServerURL, getFunctionName( bloggerDeletePost ), args, false );
// } else {
// warningNotInitialized();
@@ -151,18 +151,18 @@ bool APIBlogger::interpretUserInfoJob( KIO::Job *job )
// TODO: Error handling
return false;
} else if ( trfjob ) {
- QValueList<QVariant> message( trfjob->response() );
+ TQValueList<TQVariant> message( trfjob->response() );
kdDebug () << "TOP: " << message[ 0 ].typeName() << endl;
- const QValueList<QVariant> posts = message;
- QValueList<QVariant>::ConstIterator it = posts.begin();
- QValueList<QVariant>::ConstIterator end = posts.end();
+ const TQValueList<TQVariant> posts = message;
+ TQValueList<TQVariant>::ConstIterator it = posts.begin();
+ TQValueList<TQVariant>::ConstIterator end = posts.end();
for ( ; it != end; ++it ) {
kdDebug () << "MIDDLE: " << ( *it ).typeName() << endl;
- const QMap<QString, QVariant> postInfo = ( *it ).toMap();
- const QString nickname = postInfo[ "nickname" ].toString();
- const QString userid = postInfo[ "userid" ].toString();
- const QString email = postInfo[ "email" ].toString();
+ const TQMap<TQString, TQVariant> postInfo = ( *it ).toMap();
+ const TQString nickname = postInfo[ "nickname" ].toString();
+ const TQString userid = postInfo[ "userid" ].toString();
+ const TQString email = postInfo[ "email" ].toString();
kdDebug() << "Post " << nickname << " " << userid << " " << email << endl;
// FIXME: How about a BlogUserInfo class???
emit userInfoRetrieved( nickname, userid, email );
@@ -180,19 +180,19 @@ kdDebug() << "APIBlogger::interpretListFoldersJob" << endl;
// TODO: Error handling
} else {
kdDebug() << "APIBlogger::interpretListFoldersJob, no error!" << endl;
- QValueList<QVariant> message( trfjob->response() );
+ TQValueList<TQVariant> message( trfjob->response() );
kdDebug () << "TOP: " << message[ 0 ].typeName() << endl;
- const QValueList<QVariant> posts = message[ 0 ].toList();
- QValueList<QVariant>::ConstIterator it = posts.begin();
- QValueList<QVariant>::ConstIterator end = posts.end();
+ const TQValueList<TQVariant> posts = message[ 0 ].toList();
+ TQValueList<TQVariant>::ConstIterator it = posts.begin();
+ TQValueList<TQVariant>::ConstIterator end = posts.end();
for ( ; it != end; ++it ) {
kdDebug () << "MIDDLE: " << ( *it ).typeName() << endl;
- const QMap<QString, QVariant> postInfo = ( *it ).toMap();
+ const TQMap<TQString, TQVariant> postInfo = ( *it ).toMap();
- const QString id( postInfo[ "blogid" ].toString() );
- const QString name( postInfo[ "blogName" ].toString() );
- const QString url( postInfo[ "url" ].toString() );
+ const TQString id( postInfo[ "blogid" ].toString() );
+ const TQString name( postInfo[ "blogName" ].toString() );
+ const TQString url( postInfo[ "url" ].toString() );
// Use the Blog ID instead of the URL. The ID already indicates the correct blog, and the
// URL for all calls will be the XML-RPC interface, anyway.
@@ -220,17 +220,17 @@ bool APIBlogger::interpretDownloadItemsJob( KIO::Job *job )
} else {
//array of structs containing ISO.8601 dateCreated, String userid, String postid, String content;
// TODO: Time zone for the dateCreated!
- QValueList<QVariant> message( trfjob->response() );
+ TQValueList<TQVariant> message( trfjob->response() );
kdDebug () << "TOP: " << message[ 0 ].typeName() << endl;
- const QValueList<QVariant> postReceived = message[ 0 ].toList();
- QValueList<QVariant>::ConstIterator it = postReceived.begin();
- QValueList<QVariant>::ConstIterator end = postReceived.end();
+ const TQValueList<TQVariant> postReceived = message[ 0 ].toList();
+ TQValueList<TQVariant>::ConstIterator it = postReceived.begin();
+ TQValueList<TQVariant>::ConstIterator end = postReceived.end();
success = true;
for ( ; it != end; ++it ) {
BlogPosting posting;
kdDebug () << "MIDDLE: " << ( *it ).typeName() << endl;
- const QMap<QString, QVariant> postInfo = ( *it ).toMap();
+ const TQMap<TQString, TQVariant> postInfo = ( *it ).toMap();
if ( readPostingFromMap( &posting, postInfo ) ) {
KCal::Journal *j = journalFromPosting( &posting );
// dumpBlog( &posting );
@@ -252,19 +252,19 @@ bool APIBlogger::interpretDownloadItemsJob( KIO::Job *job )
}
-bool APIBlogger::readPostingFromMap( BlogPosting *post, const QMap<QString, QVariant> &postInfo )
+bool APIBlogger::readPostingFromMap( BlogPosting *post, const TQMap<TQString, TQVariant> &postInfo )
{
// FIXME:
if ( !post ) return false;
- QStringList mapkeys = postInfo.keys();
+ TQStringList mapkeys = postInfo.keys();
kdDebug() << endl << "Keys: " << mapkeys.join(", ") << endl << endl;
- QString fp( QString::null );
+ TQString fp( TQString::null );
- QDateTime dt( postInfo[ "dateCreated" ].toDateTime() );
+ TQDateTime dt( postInfo[ "dateCreated" ].toDateTime() );
if ( dt.isValid() && !dt.isNull() ) {
post->setCreationDateTime( dt );
- QString fp = dt.toString( Qt::ISODate );
+ TQString fp = dt.toString( Qt::ISODate );
}
dt = postInfo[ "postDate" ].toDateTime();
if ( dt.isValid() && !dt.isNull() ) {
@@ -281,10 +281,10 @@ bool APIBlogger::readPostingFromMap( BlogPosting *post, const QMap<QString, QVar
post->setUserID( postInfo[ "userid" ].toString() );
post->setPostID( postInfo[ "postid" ].toString() );
- QString title( postInfo[ "title" ].toString() );
- QString description( postInfo[ "description" ].toString() );
- QString contents( postInfo[ "content" ].toString() );
- QString category;
+ TQString title( postInfo[ "title" ].toString() );
+ TQString description( postInfo[ "description" ].toString() );
+ TQString contents( postInfo[ "content" ].toString() );
+ TQString category;
// TODO: Extract title and cats from the old-style blogger api without extensions
/*
@@ -294,10 +294,10 @@ bool APIBlogger::readPostingFromMap( BlogPosting *post, const QMap<QString, QVar
kdDebug() << "No title and description given, so it's an old-style "
"Blogger API without extensions" << endl;
- QString catTagOpen = mTemplate.categoryTagOpen();
- QString catTagClose = mTemplate.categoryTagClose();
- QString titleTagOpen = mTemplate.titleTagOpen();
- QString titleTagClose = mTemplate.titleTagClose();
+ TQString catTagOpen = mTemplate.categoryTagOpen();
+ TQString catTagClose = mTemplate.categoryTagClose();
+ TQString titleTagOpen = mTemplate.titleTagOpen();
+ TQString titleTagClose = mTemplate.titleTagClose();
int catStart = contents.find( catTagOpen, 0, false ) + catTagOpen.length();
int catEnd = contents.find( catTagClose, 0, false );