summaryrefslogtreecommitdiffstats
path: root/kresources/egroupware/knotes_resourcexmlrpc.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /kresources/egroupware/knotes_resourcexmlrpc.cpp
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-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/egroupware/knotes_resourcexmlrpc.cpp')
-rw-r--r--kresources/egroupware/knotes_resourcexmlrpc.cpp94
1 files changed, 47 insertions, 47 deletions
diff --git a/kresources/egroupware/knotes_resourcexmlrpc.cpp b/kresources/egroupware/knotes_resourcexmlrpc.cpp
index c30da41f0..b0bdb5b0d 100644
--- a/kresources/egroupware/knotes_resourcexmlrpc.cpp
+++ b/kresources/egroupware/knotes_resourcexmlrpc.cpp
@@ -19,8 +19,8 @@
Boston, MA 02110-1301, USA.
*/
-#include <qapplication.h>
-#include <qstringlist.h>
+#include <tqapplication.h>
+#include <tqstringlist.h>
#include <kdebug.h>
#include <klocale.h>
@@ -44,13 +44,13 @@ using namespace KNotes;
typedef KRES::PluginFactory< ResourceXMLRPC, ResourceXMLRPCConfig> XMLRPCFactory;
K_EXPORT_COMPONENT_FACTORY( knotes_xmlrpc, XMLRPCFactory )
-static const QString SearchNotesCommand = "infolog.boinfolog.search";
-static const QString AddNoteCommand = "infolog.boinfolog.write";
-static const QString DeleteNoteCommand = "infolog.boinfolog.delete";
-static const QString LoadNoteCategoriesCommand = "infolog.boinfolog.categories";
+static const TQString SearchNotesCommand = "infolog.boinfolog.search";
+static const TQString AddNoteCommand = "infolog.boinfolog.write";
+static const TQString DeleteNoteCommand = "infolog.boinfolog.delete";
+static const TQString LoadNoteCategoriesCommand = "infolog.boinfolog.categories";
ResourceXMLRPC::ResourceXMLRPC( const KConfig* config )
- : ResourceNotes( config ), mCalendar( QString::fromLatin1("UTC") ),
+ : ResourceNotes( config ), mCalendar( TQString::fromLatin1("UTC") ),
mServer( 0 )
{
init();
@@ -62,7 +62,7 @@ ResourceXMLRPC::ResourceXMLRPC( const KConfig* config )
}
ResourceXMLRPC::ResourceXMLRPC( )
- : ResourceNotes( 0 ), mCalendar( QString::fromLatin1("UTC") ),
+ : ResourceNotes( 0 ), mCalendar( TQString::fromLatin1("UTC") ),
mServer( 0 )
{
init();
@@ -114,14 +114,14 @@ bool ResourceXMLRPC::load()
mServer->setUrl( KURL( mPrefs->url() ) );
mServer->setUserAgent( "KDE-Notes" );
- QMap<QString, QVariant> args, columns;
+ TQMap<TQString, TQVariant> args, columns;
args.insert( "domain", mPrefs->domain() );
args.insert( "username", mPrefs->user() );
args.insert( "password", mPrefs->password() );
- mServer->call( "system.login", QVariant( args ),
- this, SLOT( loginFinished( const QValueList<QVariant>&, const QVariant& ) ),
- this, SLOT( fault( int, const QString&, const QVariant& ) ) );
+ mServer->call( "system.login", TQVariant( args ),
+ this, TQT_SLOT( loginFinished( const TQValueList<TQVariant>&, const TQVariant& ) ),
+ this, TQT_SLOT( fault( int, const TQString&, const TQVariant& ) ) );
mSynchronizer->start();
@@ -132,8 +132,8 @@ bool ResourceXMLRPC::load()
args.insert( "order", "id_parent" );
mServer->call( SearchNotesCommand, args,
- this, SLOT( listNotesFinished( const QValueList<QVariant>&, const QVariant& ) ),
- this, SLOT( fault( int, const QString&, const QVariant& ) ) );
+ this, TQT_SLOT( listNotesFinished( const TQValueList<TQVariant>&, const TQVariant& ) ),
+ this, TQT_SLOT( fault( int, const TQString&, const TQVariant& ) ) );
mSynchronizer->start();
@@ -149,7 +149,7 @@ bool ResourceXMLRPC::save()
bool ResourceXMLRPC::addNote( KCal::Journal *journal )
{
- QMap<QString, QVariant> args;
+ TQMap<TQString, TQVariant> args;
writeNote( journal, args );
KCal::Journal *oldJournal = mCalendar.journal( journal->uid() );
@@ -159,17 +159,17 @@ bool ResourceXMLRPC::addNote( KCal::Journal *journal )
if ( !oldJournal->isReadOnly() ) {
writeNote( journal, args );
args.insert( "id", mUidMap[ journal->uid() ].toInt() );
- mServer->call( AddNoteCommand, QVariant( args ),
- this, SLOT( updateNoteFinished( const QValueList<QVariant>&, const QVariant& ) ),
- this, SLOT( fault( int, const QString&, const QVariant& ) ) );
+ mServer->call( AddNoteCommand, TQVariant( args ),
+ this, TQT_SLOT( updateNoteFinished( const TQValueList<TQVariant>&, const TQVariant& ) ),
+ this, TQT_SLOT( fault( int, const TQString&, const TQVariant& ) ) );
mCalendar.addJournal( journal );
added = true;
}
} else {
- mServer->call( AddNoteCommand, QVariant( args ),
- this, SLOT( addNoteFinished( const QValueList<QVariant>&, const QVariant& ) ),
- this, SLOT( fault( int, const QString&, const QVariant& ) ),
- QVariant( journal->uid() ) );
+ mServer->call( AddNoteCommand, TQVariant( args ),
+ this, TQT_SLOT( addNoteFinished( const TQValueList<TQVariant>&, const TQVariant& ) ),
+ this, TQT_SLOT( fault( int, const TQString&, const TQVariant& ) ),
+ TQVariant( journal->uid() ) );
mCalendar.addJournal( journal );
added = true;
@@ -186,28 +186,28 @@ bool ResourceXMLRPC::deleteNote( KCal::Journal *journal )
int id = mUidMap[ journal->uid() ].toInt();
mServer->call( DeleteNoteCommand, id,
- this, SLOT( deleteNoteFinished( const QValueList<QVariant>&, const QVariant& ) ),
- this, SLOT( fault( int, const QString&, const QVariant& ) ),
- QVariant( journal->uid() ) );
+ this, TQT_SLOT( deleteNoteFinished( const TQValueList<TQVariant>&, const TQVariant& ) ),
+ this, TQT_SLOT( fault( int, const TQString&, const TQVariant& ) ),
+ TQVariant( journal->uid() ) );
mSynchronizer->start();
return true;
}
-KCal::Alarm::List ResourceXMLRPC::alarms( const QDateTime& from, const QDateTime& to )
+KCal::Alarm::List ResourceXMLRPC::alarms( const TQDateTime& from, const TQDateTime& to )
{
KCal::Alarm::List alarms;
KCal::Journal::List notes = mCalendar.journals();
KCal::Journal::List::ConstIterator note;
for ( note = notes.begin(); note != notes.end(); ++note )
{
- QDateTime preTime = from.addSecs( -1 );
+ TQDateTime preTime = from.addSecs( -1 );
KCal::Alarm::List::ConstIterator it;
for( it = (*note)->alarms().begin(); it != (*note)->alarms().end(); ++it )
{
if ( (*it)->enabled() )
{
- QDateTime dt = (*it)->nextRepetition( preTime );
+ TQDateTime dt = (*it)->nextRepetition( preTime );
if ( dt.isValid() && dt <= to )
alarms.append( *it );
}
@@ -217,10 +217,10 @@ KCal::Alarm::List ResourceXMLRPC::alarms( const QDateTime& from, const QDateTime
return alarms;
}
-void ResourceXMLRPC::loginFinished( const QValueList<QVariant>& variant,
- const QVariant& )
+void ResourceXMLRPC::loginFinished( const TQValueList<TQVariant>& variant,
+ const TQVariant& )
{
- QMap<QString, QVariant> map = variant[ 0 ].toMap();
+ TQMap<TQString, TQVariant> map = variant[ 0 ].toMap();
KURL url = KURL( mPrefs->url() );
if ( map[ "GOAWAY" ].toString() == "XOXO" ) { // failed
@@ -237,10 +237,10 @@ void ResourceXMLRPC::loginFinished( const QValueList<QVariant>& variant,
mSynchronizer->stop();
}
-void ResourceXMLRPC::logoutFinished( const QValueList<QVariant>& variant,
- const QVariant& )
+void ResourceXMLRPC::logoutFinished( const TQValueList<TQVariant>& variant,
+ const TQVariant& )
{
- QMap<QString, QVariant> map = variant[ 0 ].toMap();
+ TQMap<TQString, TQVariant> map = variant[ 0 ].toMap();
if ( map[ "GOODBYE" ].toString() != "XOXO" )
kdError() << "logout failed" << endl;
@@ -254,9 +254,9 @@ void ResourceXMLRPC::logoutFinished( const QValueList<QVariant>& variant,
mSynchronizer->stop();
}
-void ResourceXMLRPC::listNotesFinished( const QValueList<QVariant> &list, const QVariant& )
+void ResourceXMLRPC::listNotesFinished( const TQValueList<TQVariant> &list, const TQVariant& )
{
- QMap<QString, QString>::Iterator uidIt;
+ TQMap<TQString, TQString>::Iterator uidIt;
for ( uidIt = mUidMap.begin(); uidIt != mUidMap.end(); ++uidIt ) {
KCal::Journal *journal = mCalendar.journal( uidIt.key() );
mCalendar.deleteJournal( journal );
@@ -264,15 +264,15 @@ void ResourceXMLRPC::listNotesFinished( const QValueList<QVariant> &list, const
mUidMap.clear();
- QValueList<QVariant> noteList = list[ 0 ].toList();
- QValueList<QVariant>::Iterator noteIt;
+ TQValueList<TQVariant> noteList = list[ 0 ].toList();
+ TQValueList<TQVariant>::Iterator noteIt;
for ( noteIt = noteList.begin(); noteIt != noteList.end(); ++noteIt ) {
- QMap<QString, QVariant> map = (*noteIt).toMap();
+ TQMap<TQString, TQVariant> map = (*noteIt).toMap();
KCal::Journal *journal = new KCal::Journal();
- QString uid;
+ TQString uid;
readNote( map, journal, uid );
mUidMap.insert( journal->uid(), uid );
@@ -283,20 +283,20 @@ void ResourceXMLRPC::listNotesFinished( const QValueList<QVariant> &list, const
mSynchronizer->stop();
}
-void ResourceXMLRPC::addNoteFinished( const QValueList<QVariant> &list, const QVariant &id )
+void ResourceXMLRPC::addNoteFinished( const TQValueList<TQVariant> &list, const TQVariant &id )
{
int uid = list[ 0 ].toInt();
- mUidMap.insert( id.toString(), QString::number( uid ) );
+ mUidMap.insert( id.toString(), TQString::number( uid ) );
mSynchronizer->stop();
}
-void ResourceXMLRPC::updateNoteFinished( const QValueList<QVariant>&, const QVariant& )
+void ResourceXMLRPC::updateNoteFinished( const TQValueList<TQVariant>&, const TQVariant& )
{
mSynchronizer->stop();
}
-void ResourceXMLRPC::deleteNoteFinished( const QValueList<QVariant>&, const QVariant &id )
+void ResourceXMLRPC::deleteNoteFinished( const TQValueList<TQVariant>&, const TQVariant &id )
{
mUidMap.erase( id.toString() );
@@ -306,13 +306,13 @@ void ResourceXMLRPC::deleteNoteFinished( const QValueList<QVariant>&, const QVar
mSynchronizer->stop();
}
-void ResourceXMLRPC::fault( int error, const QString& errorMsg, const QVariant& )
+void ResourceXMLRPC::fault( int error, const TQString& errorMsg, const TQVariant& )
{
kdError() << "Server send error " << error << ": " << errorMsg << endl;
mSynchronizer->stop();
}
-void ResourceXMLRPC::writeNote( KCal::Journal* journal, QMap<QString, QVariant>& args )
+void ResourceXMLRPC::writeNote( KCal::Journal* journal, TQMap<TQString, TQVariant>& args )
{
args.insert( "subject", journal->summary() );
args.insert( "des", journal->description() );
@@ -320,7 +320,7 @@ void ResourceXMLRPC::writeNote( KCal::Journal* journal, QMap<QString, QVariant>&
(journal->secrecy() == KCal::Journal::SecrecyPublic ? "public" : "private" ) );
}
-void ResourceXMLRPC::readNote( const QMap<QString, QVariant>& args, KCal::Journal *journal, QString &uid )
+void ResourceXMLRPC::readNote( const TQMap<TQString, TQVariant>& args, KCal::Journal *journal, TQString &uid )
{
uid = args[ "id" ].toString();