diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /kresources/blogging | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kresources/blogging')
-rw-r--r-- | kresources/blogging/API_Blog.cpp | 30 | ||||
-rw-r--r-- | kresources/blogging/API_Blog.h | 110 | ||||
-rw-r--r-- | kresources/blogging/API_Blogger.cpp | 100 | ||||
-rw-r--r-- | kresources/blogging/API_Blogger.h | 16 | ||||
-rw-r--r-- | kresources/blogging/bloggingcalendaradaptor.cpp | 46 | ||||
-rw-r--r-- | kresources/blogging/bloggingcalendaradaptor.h | 26 | ||||
-rw-r--r-- | kresources/blogging/bloggingglobals.cpp | 18 | ||||
-rw-r--r-- | kresources/blogging/bloggingglobals.h | 12 | ||||
-rw-r--r-- | kresources/blogging/kcal_resourceblogging.cpp | 2 | ||||
-rw-r--r-- | kresources/blogging/kcal_resourcebloggingconfig.cpp | 2 | ||||
-rw-r--r-- | kresources/blogging/kcal_resourcebloggingconfig.h | 2 | ||||
-rw-r--r-- | kresources/blogging/xmlrpcjob.cpp | 192 | ||||
-rw-r--r-- | kresources/blogging/xmlrpcjob.h | 54 |
13 files changed, 305 insertions, 305 deletions
diff --git a/kresources/blogging/API_Blog.cpp b/kresources/blogging/API_Blog.cpp index 670cd1661..b6ac3752b 100644 --- a/kresources/blogging/API_Blog.cpp +++ b/kresources/blogging/API_Blog.cpp @@ -8,13 +8,13 @@ ***************************************************************************/ #include "API_Blog.h" #include <kdebug.h> -#include <qvariant.h> +#include <tqvariant.h> using namespace KBlog; -APIBlog::APIBlog( const KURL &url, QObject *parent, const char *name ) : - QObject( parent, name ), - mServerURL( url ), mAppID( QString::null ), mDownloadCount( 20 ) +APIBlog::APIBlog( const KURL &url, TQObject *parent, const char *name ) : + TQObject( parent, name ), + mServerURL( url ), mAppID( TQString::null ), mDownloadCount( 20 ) {} APIBlog::~APIBlog() @@ -42,7 +42,7 @@ BlogTemplate APIBlog::templateTags() const return mTemplate; }*/ -/*void APIBlog::deletePost( const QString &postID ) +/*void APIBlog::deletePost( const TQString &postID ) { BlogPosting *post = new BlogPosting(); post->setPostID( postID ); @@ -50,15 +50,15 @@ BlogTemplate APIBlog::templateTags() const delete post; }*/ -QValueList<QVariant> APIBlog::defaultArgs( const QString &id ) +TQValueList<TQVariant> APIBlog::defaultArgs( const TQString &id ) { - QValueList<QVariant> args; - args << QVariant( mAppID ); + TQValueList<TQVariant> args; + args << TQVariant( mAppID ); if ( !id.isNull() ) { - args << QVariant( id ); + args << TQVariant( id ); } - args << QVariant( mUsername ) - << QVariant( mPassword ); + args << TQVariant( mUsername ) + << TQVariant( mPassword ); return args; } @@ -67,9 +67,9 @@ KCal::Journal *APIBlog::journalFromPosting( KBlog::BlogPosting *blog ) { if ( !blog ) return 0; KCal::Journal *j = new KCal::Journal(); - QDateTime dt = blog->dateTime(); - QDateTime creationDt = blog->creationDateTime(); - QDateTime modificationDt = blog->modificationDateTime(); + TQDateTime dt = blog->dateTime(); + TQDateTime creationDt = blog->creationDateTime(); + TQDateTime modificationDt = blog->modificationDateTime(); kdDebug() << "dt ="<<dt.toString( Qt::ISODate ) << endl; kdDebug() << "creationDt ="<<creationDt.toString( Qt::ISODate ) << endl; kdDebug() << "modificationDt="<<modificationDt.toString( Qt::ISODate ) << endl; @@ -88,7 +88,7 @@ kdDebug() << "modificationDt="<<modificationDt.toString( Qt::ISODate ) << endl; << blog->dateTime().toString()<<endl; j->setSummary( blog->title() ); j->setDescription( blog->content() ); - j->setCategories( QStringList( blog->category() ) ); + j->setCategories( TQStringList( blog->category() ) ); j->setOrganizer( blog->userID() ); j->setCustomProperty( "KCalBloggerRes", "UserID", blog->userID() ); j->setCustomProperty( "KCalBloggerRes", "BlogID", blog->blogID() ); diff --git a/kresources/blogging/API_Blog.h b/kresources/blogging/API_Blog.h index 77c27d68b..18bc1be0f 100644 --- a/kresources/blogging/API_Blog.h +++ b/kresources/blogging/API_Blog.h @@ -13,10 +13,10 @@ #include <kio/job.h> #include <libkcal/journal.h> -#include <qobject.h> -#include <qstring.h> -#include <qvaluelist.h> -#include <qdatetime.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqvaluelist.h> +#include <tqdatetime.h> /** This is the main interface for blog backends @@ -31,53 +31,53 @@ public: BlogPosting() {} virtual ~BlogPosting() {} - QString userID() const { return mUserID; } - void setUserID( const QString &userID ) { mUserID = userID; } + TQString userID() const { return mUserID; } + void setUserID( const TQString &userID ) { mUserID = userID; } - QString blogID() const { return mBlogID; } - void setBlogID( const QString &blogID ) { mBlogID = blogID; } + TQString blogID() const { return mBlogID; } + void setBlogID( const TQString &blogID ) { mBlogID = blogID; } - QString postID() const { return mPostID; } - void setPostID( const QString &postID ) { assignPostID( postID ); mPostID = postID; } + TQString postID() const { return mPostID; } + void setPostID( const TQString &postID ) { assignPostID( postID ); mPostID = postID; } - QString title() const { return mTitle; } - void setTitle( const QString &title ) { mTitle = title; } + TQString title() const { return mTitle; } + void setTitle( const TQString &title ) { mTitle = title; } - QString content() const { return mContent; } - void setContent( const QString &content ) { mContent = content; } + TQString content() const { return mContent; } + void setContent( const TQString &content ) { mContent = content; } - QString category() const { return mCategory; } - void setCategory( const QString &category ) { mCategory = category; } + TQString category() const { return mCategory; } + void setCategory( const TQString &category ) { mCategory = category; } - QString fingerprint() const { return mFingerprint; } - void setFingerprint( const QString &fp ) { mFingerprint = fp; } + TQString fingerprint() const { return mFingerprint; } + void setFingerprint( const TQString &fp ) { mFingerprint = fp; } - QDateTime dateTime() const { return mDateTime; } - void setDateTime( const QDateTime &datetime ) { mDateTime = datetime; } + TQDateTime dateTime() const { return mDateTime; } + void setDateTime( const TQDateTime &datetime ) { mDateTime = datetime; } - QDateTime creationDateTime() const { return mCreationDateTime; } - void setCreationDateTime( const QDateTime &datetime ) { mCreationDateTime = datetime; } + TQDateTime creationDateTime() const { return mCreationDateTime; } + void setCreationDateTime( const TQDateTime &datetime ) { mCreationDateTime = datetime; } - QDateTime modificationDateTime() const { return mModificationDateTime; } - void setModificationDateTime( const QDateTime &datetime ) { mModificationDateTime = datetime; } + TQDateTime modificationDateTime() const { return mModificationDateTime; } + void setModificationDateTime( const TQDateTime &datetime ) { mModificationDateTime = datetime; } virtual void wasDeleted( bool ) {} virtual void wasUploaded( bool ) {} - virtual void error( int /*code*/, const QString &/*error*/ ) {} + virtual void error( int /*code*/, const TQString &/*error*/ ) {} protected: // Override this method to detect the new postID assigned when adding a new post - virtual void assignPostID( const QString &/*postID*/ ) {} - QString mUserID; - QString mBlogID; - QString mPostID; - QString mTitle; - QString mContent; - QString mCategory; - QString mFingerprint; - QDateTime mDateTime; - QDateTime mCreationDateTime; - QDateTime mModificationDateTime; + virtual void assignPostID( const TQString &/*postID*/ ) {} + TQString mUserID; + TQString mBlogID; + TQString mPostID; + TQString mTitle; + TQString mContent; + TQString mCategory; + TQString mFingerprint; + TQDateTime mDateTime; + TQDateTime mCreationDateTime; + TQDateTime mModificationDateTime; }; @@ -85,18 +85,18 @@ class APIBlog : public QObject { Q_OBJECT public: - APIBlog( const KURL &server, QObject *parent = 0L, const char *name = 0L ); + APIBlog( const KURL &server, TQObject *parent = 0L, const char *name = 0L ); virtual ~APIBlog(); - virtual QString interfaceName() const = 0; + virtual TQString interfaceName() const = 0; - void setAppID( const QString &appID ) { mAppID = appID; } - QString appID() const { return mAppID; } + void setAppID( const TQString &appID ) { mAppID = appID; } + TQString appID() const { return mAppID; } - void setPassword( const QString &pass ) { mPassword = pass; } - QString password() const { return mPassword; } + void setPassword( const TQString &pass ) { mPassword = pass; } + TQString password() const { return mPassword; } - void setUsername( const QString &uname ) { mUsername = uname; } - QString username() const { return mUsername; } + void setUsername( const TQString &uname ) { mUsername = uname; } + TQString username() const { return mUsername; } void setURL( const KURL& url ) { mServerURL = url; } KURL url() const { return mServerURL; } @@ -119,8 +119,8 @@ class APIBlog : public QObject bloggerSetTemplate }; - virtual QString getFunctionName( blogFunctions type ) = 0; - virtual QValueList<QVariant> defaultArgs( const QString &id = QString::null ); + virtual TQString getFunctionName( blogFunctions type ) = 0; + virtual TQValueList<TQVariant> defaultArgs( const TQString &id = TQString::null ); virtual KIO::Job *createUserInfoJob() = 0; virtual KIO::Job *createListFoldersJob() = 0; @@ -128,7 +128,7 @@ class APIBlog : public QObject virtual KIO::TransferJob *createDownloadJob( const KURL &url ) = 0; virtual KIO::TransferJob *createUploadJob( const KURL &url, KBlog::BlogPosting *posting ) = 0; virtual KIO::TransferJob *createUploadNewJob( KBlog::BlogPosting *posting ) = 0; - virtual KIO::Job *createRemoveJob( const KURL &url, const QString &postid ) = 0; + virtual KIO::Job *createRemoveJob( const KURL &url, const TQString &postid ) = 0; virtual bool interpretUserInfoJob( KIO::Job *job ) = 0; virtual void interpretListFoldersJob( KIO::Job *job ) = 0; @@ -140,21 +140,21 @@ class APIBlog : public QObject signals: // TODO: Connect these - void userInfoRetrieved( const QString &nickname, const QString &userid, const QString &email ); - void folderInfoRetrieved( const QString &id, const QString &name ); + void userInfoRetrieved( const TQString &nickname, const TQString &userid, const TQString &email ); + void folderInfoRetrieved( const TQString &id, const TQString &name ); void itemOnServer( const KURL &remoteURL ); - void itemDownloaded( KCal::Incidence *j, const QString &localID, - const KURL &remoteURL, const QString &fingerprint, - const QString &storageLocation ); + void itemDownloaded( KCal::Incidence *j, const TQString &localID, + const KURL &remoteURL, const TQString &fingerprint, + const TQString &storageLocation ); protected: KURL mServerURL; - QString mPassword; - QString mUsername; - QString mAppID; + TQString mPassword; + TQString mUsername; + TQString mAppID; int mDownloadCount; }; 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 ); diff --git a/kresources/blogging/API_Blogger.h b/kresources/blogging/API_Blogger.h index 3195b472e..32610bf60 100644 --- a/kresources/blogging/API_Blogger.h +++ b/kresources/blogging/API_Blogger.h @@ -23,18 +23,18 @@ #include "API_Blog.h" -#include <qstring.h> -#include <qvariant.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqvariant.h> +#include <tqvaluelist.h> namespace KBlog { class APIBlogger : public APIBlog { public: - APIBlogger( const KURL &server, QObject *parent = 0L, const char *name = 0L ) : APIBlog( server, parent, name ) {} - QString getFunctionName( blogFunctions type ); - QString interfaceName() const { return "Blogger API 1.0"; } + APIBlogger( const KURL &server, TQObject *parent = 0L, const char *name = 0L ) : APIBlog( server, parent, name ) {} + TQString getFunctionName( blogFunctions type ); + TQString interfaceName() const { return "Blogger API 1.0"; } KIO::Job *createUserInfoJob(); @@ -43,14 +43,14 @@ class APIBlogger : public APIBlog KIO::TransferJob *createDownloadJob( const KURL &url ); KIO::TransferJob *createUploadJob( const KURL &url, KBlog::BlogPosting *posting ); KIO::TransferJob *createUploadNewJob( KBlog::BlogPosting *posting ); - KIO::Job *createRemoveJob( const KURL &url, const QString &postid ); + KIO::Job *createRemoveJob( const KURL &url, const TQString &postid ); bool interpretUserInfoJob( KIO::Job *job ); void interpretListFoldersJob( KIO::Job *job ); bool interpretListItemsJob( KIO::Job *job ); bool interpretDownloadItemsJob( KIO::Job *job ); protected: - bool readPostingFromMap( BlogPosting *post, const QMap<QString, QVariant> &postInfo ); + bool readPostingFromMap( BlogPosting *post, const TQMap<TQString, TQVariant> &postInfo ); }; } diff --git a/kresources/blogging/bloggingcalendaradaptor.cpp b/kresources/blogging/bloggingcalendaradaptor.cpp index 252452788..1255cab38 100644 --- a/kresources/blogging/bloggingcalendaradaptor.cpp +++ b/kresources/blogging/bloggingcalendaradaptor.cpp @@ -36,8 +36,8 @@ using namespace KCal; // http://www.blogger.com/developers/api/1_docs/register.html // for the "KDE-Pim libkcal blogging resource". // TODO: -/*QString BloggingCalendarAdaptor::mAppID = - QString("20ffffffd7ffffffc5ffffffbdffffff87ffffffb72d39fffffffe5c4bfffff" +/*TQString BloggingCalendarAdaptor::mAppID = + TQString("20ffffffd7ffffffc5ffffffbdffffff87ffffffb72d39fffffffe5c4bfffff" "fcfffffff80ffffffd4665cfffffff375ffffff88ffffff871a0cffffff8029"); */ @@ -102,18 +102,18 @@ void BloggingCalendarAdaptor::setAPI( KBlog::APIBlog *api ) delete mAPI; mAPI = api; mAuthenticated = false; - connect( api, SIGNAL( userInfoRetrieved( const QString &, const QString &, - const QString & ) ), - SLOT( slotUserInfoRetrieved( const QString &, const QString &, - const QString & ) ) ); - connect( api, SIGNAL( folderInfoRetrieved( const QString &, const QString & ) ), - SLOT( slotFolderInfoRetrieved( const QString&, const QString & ) ) ); - connect( api, SIGNAL( itemOnServer( const KURL & ) ), - SIGNAL( itemOnServer( const KURL & ) ) ); - connect( api, SIGNAL( itemDownloaded( KCal::Incidence *, const QString &, - const KURL &, const QString &, const QString & ) ), - SLOT( calendarItemDownloaded( KCal::Incidence *, const QString &, - const KURL &, const QString &, const QString & ) ) ); + connect( api, TQT_SIGNAL( userInfoRetrieved( const TQString &, const TQString &, + const TQString & ) ), + TQT_SLOT( slotUserInfoRetrieved( const TQString &, const TQString &, + const TQString & ) ) ); + connect( api, TQT_SIGNAL( folderInfoRetrieved( const TQString &, const TQString & ) ), + TQT_SLOT( slotFolderInfoRetrieved( const TQString&, const TQString & ) ) ); + connect( api, TQT_SIGNAL( itemOnServer( const KURL & ) ), + TQT_SIGNAL( itemOnServer( const KURL & ) ) ); + connect( api, TQT_SIGNAL( itemDownloaded( KCal::Incidence *, const TQString &, + const KURL &, const TQString &, const TQString & ) ), + TQT_SLOT( calendarItemDownloaded( KCal::Incidence *, const TQString &, + const KURL &, const TQString &, const TQString & ) ) ); } @@ -125,13 +125,13 @@ KPIM::GroupwareUploadItem *BloggingCalendarAdaptor::newUploadItem( KCal::Inciden -void BloggingCalendarAdaptor::slotFolderInfoRetrieved( const QString &id, const QString &name ) +void BloggingCalendarAdaptor::slotFolderInfoRetrieved( const TQString &id, const TQString &name ) { emit folderInfoRetrieved( KURL(id), name, KPIM::FolderLister::Journal ); } -void BloggingCalendarAdaptor::slotUserInfoRetrieved( const QString &/*nick*/, - const QString &/*user*/, const QString &/*email*/ ) +void BloggingCalendarAdaptor::slotUserInfoRetrieved( const TQString &/*nick*/, + const TQString &/*user*/, const TQString &/*email*/ ) { kdDebug() << "BloggingCalendarAdaptor::slotUserInfoRetrieved"<<endl; mAuthenticated = true; @@ -144,7 +144,7 @@ void BloggingCalendarAdaptor::setBaseURL( const KURL &url ) } } -void BloggingCalendarAdaptor::setUser( const QString &user ) +void BloggingCalendarAdaptor::setUser( const TQString &user ) { CalendarAdaptor::setUser( user ); if ( mAPI ) { @@ -152,7 +152,7 @@ void BloggingCalendarAdaptor::setUser( const QString &user ) } } -void BloggingCalendarAdaptor::setPassword( const QString &password ) +void BloggingCalendarAdaptor::setPassword( const TQString &password ) { CalendarAdaptor::setPassword( password ); if ( mAPI ) { @@ -168,8 +168,8 @@ void BloggingCalendarAdaptor::setUserPassword( KURL & ) KIO::Job *BloggingCalendarAdaptor::createLoginJob( const KURL &url, - const QString &user, - const QString &password ) + const TQString &user, + const TQString &password ) { if ( mAPI ) { mAPI->setURL( url ); @@ -236,7 +236,7 @@ kdDebug() << "BloggingCalendarAdaptor::interpretListFoldersJob" << endl; bool BloggingCalendarAdaptor::interpretListItemsJob( KIO::Job *job, - const QString &/*jobData*/ ) + const TQString &/*jobData*/ ) { if ( mAPI ) { return mAPI->interpretListItemsJob( job ); @@ -247,7 +247,7 @@ bool BloggingCalendarAdaptor::interpretListItemsJob( KIO::Job *job, bool BloggingCalendarAdaptor::interpretDownloadItemsJob( KIO::Job *job, - const QString &/*jobData*/ ) + const TQString &/*jobData*/ ) { if ( mAPI ) { return mAPI->interpretDownloadItemsJob( job ); diff --git a/kresources/blogging/bloggingcalendaradaptor.h b/kresources/blogging/bloggingcalendaradaptor.h index b078a744a..2b7a4899b 100644 --- a/kresources/blogging/bloggingcalendaradaptor.h +++ b/kresources/blogging/bloggingcalendaradaptor.h @@ -53,27 +53,27 @@ class BloggingCalendarAdaptor : public CalendarAdaptor Q_OBJECT public: BloggingCalendarAdaptor(); - QValueList<KPIM::FolderLister::ContentType> supportedTypes() + TQValueList<KPIM::FolderLister::ContentType> supportedTypes() { - QValueList<KPIM::FolderLister::ContentType> types; + TQValueList<KPIM::FolderLister::ContentType> types; types << KPIM::FolderLister::Journal; return types; } - QCString identifier() const { return "KCalResourceBlogging"; } + TQCString identifier() const { return "KCalResourceBlogging"; } long flags() const { return GWResNeedsLogon; } void setBaseURL( const KURL &url ); - void setUser( const QString &user ); - void setPassword( const QString &password ); + void setUser( const TQString &user ); + void setPassword( const TQString &password ); // We don't want to set the username / pw for the URL! void setUserPassword( KURL &url ); KBlog::APIBlog *api() const; void setAPI( KBlog::APIBlog *api ); - KIO::Job *createLoginJob( const KURL &url, const QString &user, - const QString &password ); + KIO::Job *createLoginJob( const KURL &url, const TQString &user, + const TQString &password ); KIO::Job *createListFoldersJob( const KURL &url ); KIO::TransferJob *createListItemsJob( const KURL &url ); KIO::TransferJob *createDownloadJob( const KURL &url, @@ -82,13 +82,13 @@ Q_OBJECT bool interpretLoginJob( KIO::Job *job ); void interpretListFoldersJob( KIO::Job *job, KPIM::FolderLister * ); - bool interpretListItemsJob( KIO::Job *job, const QString &jobData ); - bool interpretDownloadItemsJob( KIO::Job *job, const QString &jobData ); + bool interpretListItemsJob( KIO::Job *job, const TQString &jobData ); + bool interpretDownloadItemsJob( KIO::Job *job, const TQString &jobData ); public slots: - void slotFolderInfoRetrieved( const QString &id, const QString &name ); - void slotUserInfoRetrieved( const QString &nick, const QString &user, - const QString &email ); + void slotFolderInfoRetrieved( const TQString &id, const TQString &name ); + void slotUserInfoRetrieved( const TQString &nick, const TQString &user, + const TQString &email ); protected: KPIM::GroupwareUploadItem *newUploadItem( KCal::Incidence*it, @@ -96,7 +96,7 @@ Q_OBJECT KBlog::APIBlog *mAPI; bool mAuthenticated; - static QString mAppID; + static TQString mAppID; }; } diff --git a/kresources/blogging/bloggingglobals.cpp b/kresources/blogging/bloggingglobals.cpp index fae91610f..247ed9014 100644 --- a/kresources/blogging/bloggingglobals.cpp +++ b/kresources/blogging/bloggingglobals.cpp @@ -21,9 +21,9 @@ #include "bloggingglobals.h" -QString BloggingGlobals::mAppID = QString("20ffffffd7ffffffc5ffffffbdffffff87ffffffb72d39fffffffe5c4bffffffcfffffff80ffffffd4665cfffffff375ffffff88ffffff871a0cffffff8029"); +TQString BloggingGlobals::mAppID = TQString("20ffffffd7ffffffc5ffffffbdffffff87ffffffb72d39fffffffe5c4bffffffcfffffff80ffffffd4665cfffffff375ffffff88ffffff871a0cffffff8029"); -QString BloggingGlobals::getFunctionName( blogFunctions type ) +TQString BloggingGlobals::getFunctionName( blogFunctions type ) { switch ( type ) { case bloggerGetUserInfo: return "blogger.getUserInfo"; @@ -35,19 +35,19 @@ QString BloggingGlobals::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; } } -QValueList<QVariant> BloggingGlobals::defaultArgs( const QString &user, const QString &pw, const QString &id ) +TQValueList<TQVariant> BloggingGlobals::defaultArgs( const TQString &user, const TQString &pw, const TQString &id ) { - QValueList<QVariant> args; - args << QVariant( mAppID ); + TQValueList<TQVariant> args; + args << TQVariant( mAppID ); if ( !id.isNull() ) { - args << QVariant( id ); + args << TQVariant( id ); } - args << QVariant( user ) - << QVariant( pw ); + args << TQVariant( user ) + << TQVariant( pw ); return args; } diff --git a/kresources/blogging/bloggingglobals.h b/kresources/blogging/bloggingglobals.h index 7d6ed786b..b55029f1a 100644 --- a/kresources/blogging/bloggingglobals.h +++ b/kresources/blogging/bloggingglobals.h @@ -21,9 +21,9 @@ #ifndef BLOGGINGGLOBALS_H #define BLOGGINGGLOBALS_H -#include <qstring.h> -#include <qvariant.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqvariant.h> +#include <tqvaluelist.h> class BloggingGlobals { @@ -42,9 +42,9 @@ class BloggingGlobals bloggerSetTemplate }; - static QString getFunctionName( blogFunctions type ); - static QValueList<QVariant> defaultArgs( const QString &user, const QString &pw, const QString &id = QString::null ); - static QString mAppID; + static TQString getFunctionName( blogFunctions type ); + static TQValueList<TQVariant> defaultArgs( const TQString &user, const TQString &pw, const TQString &id = TQString::null ); + static TQString mAppID; }; #endif diff --git a/kresources/blogging/kcal_resourceblogging.cpp b/kresources/blogging/kcal_resourceblogging.cpp index bffce10d3..6f7ed46ec 100644 --- a/kresources/blogging/kcal_resourceblogging.cpp +++ b/kresources/blogging/kcal_resourceblogging.cpp @@ -62,7 +62,7 @@ void ResourceBlogging::readConfig( const KConfig *config ) ad->setPassword( prefs()->password() ); ad->setBaseURL( prefs()->url() ); } -// QString url = config->readEntry( "URL" ); +// TQString url = config->readEntry( "URL" ); // mUrl = KURL( url ); // mServerAPI = config->readNumEntry( "ServerAPI" ); diff --git a/kresources/blogging/kcal_resourcebloggingconfig.cpp b/kresources/blogging/kcal_resourcebloggingconfig.cpp index 6e2348288..d68584a2b 100644 --- a/kresources/blogging/kcal_resourcebloggingconfig.cpp +++ b/kresources/blogging/kcal_resourcebloggingconfig.cpp @@ -25,7 +25,7 @@ using namespace KCal; -ResourceBloggingConfig::ResourceBloggingConfig( QWidget *parent, const char *name ) : ResourceGroupwareBaseConfig( parent, name ) +ResourceBloggingConfig::ResourceBloggingConfig( TQWidget *parent, const char *name ) : ResourceGroupwareBaseConfig( parent, name ) { } diff --git a/kresources/blogging/kcal_resourcebloggingconfig.h b/kresources/blogging/kcal_resourcebloggingconfig.h index a7a7a4b00..8495595b6 100644 --- a/kresources/blogging/kcal_resourcebloggingconfig.h +++ b/kresources/blogging/kcal_resourcebloggingconfig.h @@ -29,7 +29,7 @@ class KDE_EXPORT ResourceBloggingConfig : public ResourceGroupwareBaseConfig { Q_OBJECT public: - ResourceBloggingConfig( QWidget *parent = 0, const char *name = 0 ); + ResourceBloggingConfig( TQWidget *parent = 0, const char *name = 0 ); public slots: virtual void saveSettings( KRES::Resource *resource ); diff --git a/kresources/blogging/xmlrpcjob.cpp b/kresources/blogging/xmlrpcjob.cpp index 76bee44f8..d99e8add8 100644 --- a/kresources/blogging/xmlrpcjob.cpp +++ b/kresources/blogging/xmlrpcjob.cpp @@ -26,8 +26,8 @@ #include "xmlrpcjob.h" -#include <qvariant.h> -#include <qregexp.h> +#include <tqvariant.h> +#include <tqregexp.h> #include <kdebug.h> #include <klocale.h> @@ -36,8 +36,8 @@ #include <kio/davjob.h> -#define KIO_ARGS QByteArray packedArgs; \ - QDataStream stream( packedArgs, IO_WriteOnly ); stream +#define KIO_ARGS TQByteArray packedArgs; \ + TQDataStream stream( packedArgs, IO_WriteOnly ); stream using namespace KIO; @@ -49,32 +49,32 @@ namespace KIO { XMLRPCResult() {} 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; } + TQString errorString() const { return m_errorString; } + TQValueList<TQVariant> data() const { return m_data; } private: bool m_success; int m_errorCode; - QString m_errorString; - QValueList<QVariant> m_data; + TQString m_errorString; + TQValueList<TQVariant> m_data; }; } class XmlrpcJob::XmlrpcJobPrivate { public: -// QByteArray savedStaticData; +// TQByteArray savedStaticData; }; -XmlrpcJob::XmlrpcJob( const KURL& url, const QString& method, - const QValueList<QVariant> ¶ms, bool showProgressInfo) - : TransferJob( url, KIO::CMD_SPECIAL, QByteArray(), QByteArray(), +XmlrpcJob::XmlrpcJob( const KURL& url, const TQString& method, + const TQValueList<TQVariant> ¶ms, bool showProgressInfo) + : TransferJob( url, KIO::CMD_SPECIAL, TQByteArray(), TQByteArray(), showProgressInfo ) { d = new XmlrpcJobPrivate; // We couldn't set the args when calling the parent constructor, // so do it now. - QDataStream stream( m_packedArgs, IO_WriteOnly ); + TQDataStream stream( m_packedArgs, IO_WriteOnly ); stream << (int)1 << url; kdDebug()<<"XMLrpcJob::url="<<url.url()<<endl; kdDebug()<<"XmlrpcJob::XmlrpcJob, method="<<method<<endl; @@ -82,7 +82,7 @@ kdDebug()<<"XmlrpcJob::XmlrpcJob, method="<<method<<endl; if ( ! method.isEmpty() ) { kdDebug()<<"XmlrpcJob::XmlrpcJob, method not empty."<<endl; - QString call = markupCall( method, params ); + TQString call = markupCall( method, params ); staticData = call.utf8(); staticData.truncate( staticData.size() - 1 ); kdDebug() << "Message: " << call << endl; @@ -99,19 +99,19 @@ XmlrpcJob::~XmlrpcJob() d = 0; } -QString XmlrpcJob::markupCall( const QString &cmd, - const QValueList<QVariant> &args ) +TQString XmlrpcJob::markupCall( const TQString &cmd, + const TQValueList<TQVariant> &args ) { kdDebug()<<"XmlrpcJob::markupCall, cmd="<<cmd<<endl; - QString markup = "<?xml version=\"1.0\" ?>\r\n<methodCall>\r\n"; + TQString markup = "<?xml version=\"1.0\" ?>\r\n<methodCall>\r\n"; markup += "<methodName>" + cmd + "</methodName>\r\n"; if ( !args.isEmpty() ) { markup += "<params>\r\n"; - 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>\r\n" + marshal( *it ) + "</param>\r\n"; markup += "</params>\r\n"; @@ -126,11 +126,11 @@ kdDebug()<<"XmlrpcJob::markupCall, cmd="<<cmd<<endl; -void XmlrpcJob::slotData( const QByteArray& data ) +void XmlrpcJob::slotData( const TQByteArray& data ) { kdDebug()<<"XmlrpcJob::slotData()"<<endl; if ( m_redirectionURL.isEmpty() || !m_redirectionURL.isValid() || m_error ) - m_str_response.append( QString( data ) ); + m_str_response.append( TQString( data ) ); } void XmlrpcJob::slotFinished() @@ -140,7 +140,7 @@ kdDebug() << m_str_response << endl; // TODO: Redirection with XML-RPC?? /* if (! m_redirectionURL.isEmpty() && m_redirectionURL.isValid() ) { - QDataStream istream( m_packedArgs, IO_ReadOnly ); + TQDataStream istream( m_packedArgs, IO_ReadOnly ); int s_cmd, s_method; KURL s_url; istream >> s_cmd; @@ -149,14 +149,14 @@ kdDebug() << m_str_response << endl; // PROPFIND if ( (s_cmd == 7) && (s_method == (int)KIO::HTTP_POST) ) { m_packedArgs.truncate(0); - QDataStream stream( m_packedArgs, IO_WriteOnly ); + TQDataStream stream( m_packedArgs, IO_WriteOnly ); stream << (int)7 << m_redirectionURL << (int)KIO::HTTP_POST; } } else */ kdDebug() << "\033[35;40mResult: " << m_str_response << "\033[0;0m" << endl; - QDomDocument doc; - QString errMsg; + TQDomDocument doc; + TQString errMsg; int errLine, errCol; if ( doc.setContent( m_str_response, false, &errMsg, &errLine, &errCol ) ) { if ( isMessageResponse( doc ) ) { @@ -165,12 +165,12 @@ kdDebug() << m_str_response << endl; } else if ( isFaultResponse( doc ) ) { // TODO: Set the error of the job m_response.clear(); - m_response << QVariant( parseFaultResponse( doc ).errorString() ); + m_response << TQVariant( parseFaultResponse( doc ).errorString() ); m_responseType = XMLRPCFaultResponse; } else { // TODO: Set the error of the job m_response.clear(); - m_response << QVariant( i18n( "Unknown type of XML markup received. " + m_response << TQVariant( i18n( "Unknown type of XML markup received. " "Markup: \n %1" ).arg( m_str_response ) ); m_responseType = XMLRPCUnknownResponse; } @@ -190,18 +190,18 @@ kdDebug() << m_str_response << endl; -bool XmlrpcJob::isMessageResponse( const QDomDocument &doc ) +bool XmlrpcJob::isMessageResponse( const TQDomDocument &doc ) { return doc.documentElement().firstChild().toElement() .tagName().lower() == "params"; } -XMLRPCResult XmlrpcJob::parseMessageResponse( const QDomDocument &doc ) +XMLRPCResult XmlrpcJob::parseMessageResponse( const TQDomDocument &doc ) { XMLRPCResult 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(); @@ -214,19 +214,19 @@ XMLRPCResult XmlrpcJob::parseMessageResponse( const QDomDocument &doc ) -bool XmlrpcJob::isFaultResponse( const QDomDocument &doc ) +bool XmlrpcJob::isFaultResponse( const TQDomDocument &doc ) { return doc.documentElement().firstChild().toElement() .tagName().lower() == "fault"; } -XMLRPCResult XmlrpcJob::parseFaultResponse( const QDomDocument &doc ) +XMLRPCResult XmlrpcJob::parseFaultResponse( const TQDomDocument &doc ) { XMLRPCResult 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(); @@ -237,50 +237,50 @@ XMLRPCResult XmlrpcJob::parseFaultResponse( const QDomDocument &doc ) -QString XmlrpcJob::marshal( const QVariant &arg ) +TQString XmlrpcJob::marshal( const TQVariant &arg ) { switch ( arg.type() ) { - case QVariant::String: - case QVariant::CString: + case TQVariant::String: + case TQVariant::CString: return "<value><string>" + arg.toString() + "</string></value>\r\n"; - case QVariant::Int: - return "<value><int>" + QString::number( arg.toInt() ) + + case TQVariant::Int: + return "<value><int>" + TQString::number( arg.toInt() ) + "</int></value>\r\n"; - case QVariant::Double: - return "<value><double>" + QString::number( arg.toDouble() ) + + case TQVariant::Double: + return "<value><double>" + TQString::number( arg.toDouble() ) + "</double></value>\r\n"; - case QVariant::Bool: + case TQVariant::Bool: { - QString markup = "<value><boolean>"; + TQString markup = "<value><boolean>"; markup += arg.toBool() ? "1" : "0"; markup += "</boolean></value>\r\n"; return markup; } - case QVariant::ByteArray: + case TQVariant::ByteArray: return "<value><base64>" + KCodecs::base64Encode( arg.toByteArray() ) + "</base64></value>\r\n"; - case QVariant::DateTime: + case TQVariant::DateTime: return "<value><datetime.iso8601>" + arg.toDateTime().toString( Qt::ISODate ) + "</datetime.iso8601></value>\r\n"; - case QVariant::List: + case TQVariant::List: { - QString markup = "<value><array><data>\r\n"; - const QValueList<QVariant> args = arg.toList(); - QValueList<QVariant>::ConstIterator it = args.begin(); - QValueList<QVariant>::ConstIterator end = args.end(); + TQString markup = "<value><array><data>\r\n"; + const TQValueList<TQVariant> args = arg.toList(); + TQValueList<TQVariant>::ConstIterator it = args.begin(); + TQValueList<TQVariant>::ConstIterator end = args.end(); for ( ; it != end; ++it ) markup += marshal( *it ); markup += "</data></array></value>\r\n"; return markup; } - case QVariant::Map: + case TQVariant::Map: { - QString markup = "<value><struct>\r\n"; - QMap<QString, QVariant> map = arg.toMap(); - QMap<QString, QVariant>::ConstIterator it = map.begin(); - QMap<QString, QVariant>::ConstIterator end = map.end(); + TQString markup = "<value><struct>\r\n"; + TQMap<TQString, TQVariant> map = arg.toMap(); + TQMap<TQString, TQVariant>::ConstIterator it = map.begin(); + TQMap<TQString, TQVariant>::ConstIterator end = map.end(); for ( ; it != end; ++it ) { markup += "<member>\r\n"; @@ -295,10 +295,10 @@ QString XmlrpcJob::marshal( const QVariant &arg ) kdWarning() << "Failed to marshal unknown variant type: " << arg.type() << endl; }; - return QString::null; + return TQString::null; } -QVariant XmlrpcJob::demarshal( const QDomElement &elem ) +TQVariant XmlrpcJob::demarshal( const TQDomElement &elem ) { Q_ASSERT( elem.tagName().lower() == "value" ); @@ -310,71 +310,71 @@ QVariant XmlrpcJob::demarshal( const QDomElement &elem ) // Actually, the element will still have a child node, so this will not help here. // The dirty hack is at the end of this method. kdDebug()<<"XmlrpcJob::demarshal: No child nodes, assume type=string. Text: "<<elem.text()<<endl; - return QVariant( elem.text() ); + return TQVariant( elem.text() ); } kdDebug()<<"Demarshalling element \"" << elem.text() <<"\"" << endl; - 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" ) { - QString text( typeElement.text() ); - if ( text.find( QRegExp("^[0-9]{8,8}T") ) >= 0 ) { + TQString text( typeElement.text() ); + if ( text.find( TQRegExp("^[0-9]{8,8}T") ) >= 0 ) { // It's in the format 20041120T...., so adjust it to correct - // ISO 8601 Format 2004-11-20T..., else QDateTime::fromString won't work: + // ISO 8601 Format 2004-11-20T..., else TQDateTime::fromString won't work: text = text.insert( 6, '-' ); text = text.insert( 4, '-' ); } - return QVariant( QDateTime::fromString( text, Qt::ISODate ) ); + return TQVariant( TQDateTime::fromString( 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 << ", text= " << typeElement.text() << endl; // FIXME: This is just a workaround, for the issue mentioned at the beginning of this method. - return QVariant( elem.text() ); + return TQVariant( elem.text() ); } - return QVariant(); + return TQVariant(); } @@ -383,7 +383,7 @@ kdDebug()<<"Demarshalling element \"" << elem.text() <<"\"" << endl; /* Convenience methods */ -XmlrpcJob* KIO::xmlrpcCall( const KURL& url, const QString &method, const QValueList<QVariant> ¶ms, bool showProgressInfo ) +XmlrpcJob* KIO::xmlrpcCall( const KURL& url, const TQString &method, const TQValueList<TQVariant> ¶ms, bool showProgressInfo ) { if ( url.isEmpty() ) { kdWarning() << "Cannot execute call to " << method << ": empty server URL" << endl; @@ -395,35 +395,35 @@ XmlrpcJob* KIO::xmlrpcCall( const KURL& url, const QString &method, const QValue return job; } -XmlrpcJob* KIO::xmlrpcCall( const KURL& url, const QString &method, - const QVariant &arg, bool showProgressInfo ) +XmlrpcJob* KIO::xmlrpcCall( const KURL& url, const TQString &method, + const TQVariant &arg, bool showProgressInfo ) { - QValueList<QVariant> args; + TQValueList<TQVariant> args; args << arg; return KIO::xmlrpcCall( url, method, args, showProgressInfo ); } -XmlrpcJob* KIO::xmlrpcCall( const KURL& url, const QString &method, - const QStringList &arg, bool showProgressInfo ) +XmlrpcJob* KIO::xmlrpcCall( const KURL& url, const TQString &method, + const TQStringList &arg, bool showProgressInfo ) { - 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 KIO::xmlrpcCall( url, method, args, showProgressInfo ); } template <typename T> -XmlrpcJob* KIO::xmlrpcCall( const KURL& url, const QString &method, - const QValueList<T>&arg, bool showProgressInfo ) +XmlrpcJob* KIO::xmlrpcCall( const KURL& url, const TQString &method, + const TQValueList<T>&arg, bool showProgressInfo ) { - 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 ); return KIO::xmlrpcCall( url, method, args, showProgressInfo ); } diff --git a/kresources/blogging/xmlrpcjob.h b/kresources/blogging/xmlrpcjob.h index cd657aa3b..7bb18b159 100644 --- a/kresources/blogging/xmlrpcjob.h +++ b/kresources/blogging/xmlrpcjob.h @@ -25,9 +25,9 @@ #include <kurl.h> -#include <qstring.h> -#include <qvaluelist.h> -#include <qdom.h> +#include <tqstring.h> +#include <tqvaluelist.h> +#include <tqdom.h> #include <kio/jobclasses.h> #include <kio/global.h> @@ -59,42 +59,42 @@ Q_OBJECT * Use KIO::xmlrpcPropFind(), KIO::xmlrpcPropPatch() and * KIO::xmlrpcSearch() to create a new XmlrpcJob. */ - XmlrpcJob( const KURL& url, const QString& method, - const QValueList<QVariant> ¶ms, bool showProgressInfo ); + XmlrpcJob( const KURL& url, const TQString& method, + const TQValueList<TQVariant> ¶ms, bool showProgressInfo ); virtual ~XmlrpcJob(); /** - * Returns the response as a QDomDocument. + * Returns the response as a TQDomDocument. * @return the response document */ - QValueList<QVariant> &response() { return m_response; } + TQValueList<TQVariant> &response() { return m_response; } /** * Returns the type of the response. * @return the type of the response */ XMLRPCResponseType responseType() const { return m_responseType; } - static QString markupCall( const QString &cmd, - const QValueList<QVariant> &args ); + static TQString markupCall( const TQString &cmd, + const TQValueList<TQVariant> &args ); protected slots: virtual void slotFinished(); - virtual void slotData( const QByteArray &data); + virtual void slotData( const TQByteArray &data); protected: - static QString marshal( const QVariant &arg ); - static QVariant demarshal( const QDomElement &e ); + static TQString marshal( const TQVariant &arg ); + static TQVariant demarshal( const TQDomElement &e ); - static bool isMessageResponse( const QDomDocument &doc ); - static bool isFaultResponse( const QDomDocument &doc ); + static bool isMessageResponse( const TQDomDocument &doc ); + static bool isFaultResponse( const TQDomDocument &doc ); - static XMLRPCResult parseMessageResponse( const QDomDocument &doc ); - static XMLRPCResult parseFaultResponse( const QDomDocument &doc ); + static XMLRPCResult parseMessageResponse( const TQDomDocument &doc ); + static XMLRPCResult parseFaultResponse( const TQDomDocument &doc ); private: class XmlrpcJobPrivate; XmlrpcJobPrivate *d; - QString m_str_response; - QValueList<QVariant> m_response; + TQString m_str_response; + TQValueList<TQVariant> m_response; XMLRPCResponseType m_responseType; }; @@ -103,21 +103,21 @@ Q_OBJECT * * @param url the URL of the XML-RPC Interface of the server * @param method the name of the method to call - * @param params the arguments (as QValueList<QVariant>) for the method call. + * @param params the arguments (as TQValueList<TQVariant>) for the method call. * @param showProgressInfo true to show progress information * @return the new XmlrpcJob */ -XmlrpcJob* xmlrpcCall( const KURL& url, const QString &method, - const QValueList<QVariant> ¶ms, +XmlrpcJob* xmlrpcCall( const KURL& url, const TQString &method, + const TQValueList<TQVariant> ¶ms, bool showProgressInfo = true ); -XmlrpcJob* xmlrpcCall( const KURL& url, const QString &method, - const QVariant &arg, bool showProgressInfo = true ); -XmlrpcJob* xmlrpcCall( const KURL& url, const QString &method, - const QStringList &arg, bool showProgressInfo = true ); +XmlrpcJob* xmlrpcCall( const KURL& url, const TQString &method, + const TQVariant &arg, bool showProgressInfo = true ); +XmlrpcJob* xmlrpcCall( const KURL& url, const TQString &method, + const TQStringList &arg, bool showProgressInfo = true ); template <typename T> -XmlrpcJob* xmlrpcCall( const KURL& url, const QString &method, - const QValueList<T>&arg,bool showProgressInfo = true ); +XmlrpcJob* xmlrpcCall( const KURL& url, const TQString &method, + const TQValueList<T>&arg,bool showProgressInfo = true ); } #endif |