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/scalix/kabc/resourcescalix.cpp | |
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/scalix/kabc/resourcescalix.cpp')
-rw-r--r-- | kresources/scalix/kabc/resourcescalix.cpp | 134 |
1 files changed, 67 insertions, 67 deletions
diff --git a/kresources/scalix/kabc/resourcescalix.cpp b/kresources/scalix/kabc/resourcescalix.cpp index 6cbf10832..31ccdf2c9 100644 --- a/kresources/scalix/kabc/resourcescalix.cpp +++ b/kresources/scalix/kabc/resourcescalix.cpp @@ -44,11 +44,11 @@ #include <kapplication.h> #include <dcopclient.h> -#include <qobject.h> -#include <qtimer.h> -#include <qstring.h> -#include <qfile.h> -#include <qapplication.h> +#include <tqobject.h> +#include <tqtimer.h> +#include <tqstring.h> +#include <tqfile.h> +#include <tqapplication.h> #include <assert.h> @@ -64,7 +64,7 @@ class ScalixFactory : public KRES::PluginFactoryBase return new KABC::ResourceScalix( config ); } - KRES::ConfigWidget *configWidget( QWidget* ) + KRES::ConfigWidget *configWidget( TQWidget* ) { return 0; } @@ -80,7 +80,7 @@ static const char* s_inlineMimeType = "application/scalix-properties"; KABC::ResourceScalix::ResourceScalix( const KConfig *config ) : KPIM::ResourceABC( config ), Scalix::ResourceScalixBase( "ResourceScalix-KABC" ), - mCachedSubresource( QString::null ), mLocked( false ) + mCachedSubresource( TQString::null ), mLocked( false ) { setType( "scalix" ); } @@ -95,8 +95,8 @@ KABC::ResourceScalix::~ResourceScalix() } void KABC::ResourceScalix::loadSubResourceConfig( KConfig& config, - const QString& name, - const QString& label, + const TQString& name, + const TQString& label, bool writable ) { KConfigGroup group( &config, name ); @@ -111,11 +111,11 @@ bool KABC::ResourceScalix::doOpen() KConfig config( configFile() ); // Read the calendar entries - QValueList<KMailICalIface::SubResource> subResources; + TQValueList<KMailICalIface::SubResource> subResources; if ( !kmailSubresources( subResources, s_kmailContentsType ) ) return false; mSubResources.clear(); - QValueList<KMailICalIface::SubResource>::ConstIterator it; + TQValueList<KMailICalIface::SubResource>::ConstIterator it; for ( it = subResources.begin(); it != subResources.end(); ++it ) { loadSubResourceConfig( config, (*it).location, (*it).label, (*it).writable ); } @@ -149,12 +149,12 @@ KABC::Ticket * KABC::ResourceScalix::requestSaveTicket() void KABC::ResourceScalix::releaseSaveTicket( Ticket* ticket ) { mLocked = false; - mCachedSubresource = QString::null; + mCachedSubresource = TQString::null; delete ticket; } -QString KABC::ResourceScalix::loadContact( const QString& contactData, - const QString& subResource, +TQString KABC::ResourceScalix::loadContact( const TQString& contactData, + const TQString& subResource, Q_UINT32 sernum, KMailICalIface::StorageFormat ) { @@ -168,7 +168,7 @@ QString KABC::ResourceScalix::loadContact( const QString& contactData, return addr.uid(); } -bool KABC::ResourceScalix::loadSubResource( const QString& subResource ) +bool KABC::ResourceScalix::loadSubResource( const TQString& subResource ) { bool scalixcontacts = loadSubResourceHelper( subResource, s_attachmentMimeTypeContact, KMailICalIface::StorageXML ); bool scalixdistlists = loadSubResourceHelper( subResource, s_attachmentMimeTypeDistList, KMailICalIface::StorageXML ); @@ -176,7 +176,7 @@ bool KABC::ResourceScalix::loadSubResource( const QString& subResource ) return scalixcontacts && scalixdistlists && vcardstyle; } -bool KABC::ResourceScalix::loadSubResourceHelper( const QString& subResource, +bool KABC::ResourceScalix::loadSubResourceHelper( const TQString& subResource, const char* mimetype, KMailICalIface::StorageFormat format ) { @@ -204,7 +204,7 @@ bool KABC::ResourceScalix::loadSubResourceHelper( const QString& subResource, } for ( int startIndex = 0; startIndex < count; startIndex += nbMessages ) { - QMap<Q_UINT32, QString> lst; + TQMap<Q_UINT32, TQString> lst; if ( !kmailIncidences( lst, mimetype, subResource, startIndex, nbMessages ) ) { kdError() << "Communication problem in ResourceScalix::load()\n"; @@ -213,7 +213,7 @@ bool KABC::ResourceScalix::loadSubResourceHelper( const QString& subResource, return false; } - for( QMap<Q_UINT32, QString>::ConstIterator it = lst.begin(); it != lst.end(); ++it ) { + for( TQMap<Q_UINT32, TQString>::ConstIterator it = lst.begin(); it != lst.end(); ++it ) { loadContact( it.data(), subResource, it.key(), format ); } if ( progressId ) { @@ -263,24 +263,24 @@ bool KABC::ResourceScalix::save( Ticket* ) namespace Scalix { struct AttachmentList { - QStringList attachmentURLs; - QStringList attachmentNames; - QStringList attachmentMimeTypes; - QStringList deletedAttachments; - QValueList<KTempFile *> tempFiles; + TQStringList attachmentURLs; + TQStringList attachmentNames; + TQStringList attachmentMimeTypes; + TQStringList deletedAttachments; + TQValueList<KTempFile *> tempFiles; - void addAttachment( const QString& url, const QString& name, const QString& mimetype ) { + void addAttachment( const TQString& url, const TQString& name, const TQString& mimetype ) { attachmentURLs.append( url ); attachmentNames.append( name ); attachmentMimeTypes.append( mimetype ); } - void updatePictureAttachment( const QImage& image, const QString& name ); - void updateAttachment( const QByteArray& data, const QString& name, const char* mimetype ); + void updatePictureAttachment( const TQImage& image, const TQString& name ); + void updateAttachment( const TQByteArray& data, const TQString& name, const char* mimetype ); }; } // namespace -void AttachmentList::updatePictureAttachment( const QImage& image, const QString& name ) +void AttachmentList::updatePictureAttachment( const TQImage& image, const TQString& name ) { assert( !name.isEmpty() ); if ( !image.isNull() ) { @@ -296,7 +296,7 @@ void AttachmentList::updatePictureAttachment( const QImage& image, const QString } } -void AttachmentList::updateAttachment( const QByteArray& data, const QString& name, const char* mimetype ) +void AttachmentList::updateAttachment( const TQByteArray& data, const TQString& name, const char* mimetype ) { assert( !name.isEmpty() ); if ( !data.isNull() ) { @@ -314,8 +314,8 @@ void AttachmentList::updateAttachment( const QByteArray& data, const QString& na bool KABC::ResourceScalix::kmailUpdateAddressee( const Addressee& addr ) { - const QString uid = addr.uid(); - QString subResource; + const TQString uid = addr.uid(); + TQString subResource; Q_UINT32 sernum; if ( mUidMap.find( uid ) != mUidMap.end() ) { subResource = mUidMap[ uid ].resource(); @@ -340,11 +340,11 @@ bool KABC::ResourceScalix::kmailUpdateAddressee( const Addressee& addr ) } AttachmentList att; - QString subject = addr.formattedName(); + TQString subject = addr.formattedName(); - QString mimetype = s_inlineMimeType; + TQString mimetype = s_inlineMimeType; - QString data = Contact::toXml( addr ); + TQString data = Contact::toXml( addr ); CustomHeaderMap customHeaders; customHeaders.insert( "X-Scalix-Class", "IPM.Contact" ); @@ -365,7 +365,7 @@ bool KABC::ResourceScalix::kmailUpdateAddressee( const Addressee& addr ) const_cast<Addressee&>(addr).setChanged( false ); } - for( QValueList<KTempFile *>::Iterator it = att.tempFiles.begin(); it != att.tempFiles.end(); ++it ) { + for( TQValueList<KTempFile *>::Iterator it = att.tempFiles.begin(); it != att.tempFiles.end(); ++it ) { (*it)->setAutoDelete( true ); delete (*it); } @@ -374,7 +374,7 @@ bool KABC::ResourceScalix::kmailUpdateAddressee( const Addressee& addr ) void KABC::ResourceScalix::insertAddressee( const Addressee& addr ) { - const QString uid = addr.uid(); + const TQString uid = addr.uid(); //kdDebug(5650) << k_funcinfo << uid << endl; bool ok = false; if ( mUidMap.contains( uid ) ) { @@ -391,10 +391,10 @@ void KABC::ResourceScalix::insertAddressee( const Addressee& addr ) void KABC::ResourceScalix::removeAddressee( const Addressee& addr ) { - const QString uid = addr.uid(); + const TQString uid = addr.uid(); if ( mUidMap.find( uid ) == mUidMap.end() ) return; //kdDebug(5650) << k_funcinfo << uid << endl; - const QString resource = mUidMap[ uid ].resource(); + const TQString resource = mUidMap[ uid ].resource(); if ( !subresourceWritable( resource ) ) { kdWarning() << "Wow! Something tried to delete a non-writable addressee! Fix this caller: " << kdBacktrace() << endl; return; @@ -412,18 +412,18 @@ void KABC::ResourceScalix::removeAddressee( const Addressee& addr ) * These are the DCOP slots that KMail call to notify when something * changed. */ -bool KABC::ResourceScalix::fromKMailAddIncidence( const QString& type, - const QString& subResource, +bool KABC::ResourceScalix::fromKMailAddIncidence( const TQString& type, + const TQString& subResource, Q_UINT32 sernum, int format, - const QString& contactXML ) + const TQString& contactXML ) { // Check if this is a contact if( type != s_kmailContentsType || !subresourceActive( subResource ) ) return false; // Load contact to find the UID - const QString uid = loadContact( contactXML, subResource, sernum, + const TQString uid = loadContact( contactXML, subResource, sernum, ( KMailICalIface::StorageFormat )format ); //kdDebug(5650) << k_funcinfo << uid << endl; @@ -440,9 +440,9 @@ bool KABC::ResourceScalix::fromKMailAddIncidence( const QString& type, return true; } -void KABC::ResourceScalix::fromKMailDelIncidence( const QString& type, - const QString& subResource, - const QString& uid ) +void KABC::ResourceScalix::fromKMailDelIncidence( const TQString& type, + const TQString& subResource, + const TQString& uid ) { // Check if this is a contact if( type != s_kmailContentsType || !subresourceActive( subResource ) ) @@ -464,8 +464,8 @@ void KABC::ResourceScalix::fromKMailDelIncidence( const QString& type, } } -void KABC::ResourceScalix::fromKMailRefresh( const QString& type, - const QString& /*subResource*/ ) +void KABC::ResourceScalix::fromKMailRefresh( const TQString& type, + const TQString& /*subResource*/ ) { // Check if this is a contact if( type != s_kmailContentsType ) return; @@ -476,9 +476,9 @@ void KABC::ResourceScalix::fromKMailRefresh( const QString& type, addressBook()->emitAddressBookChanged(); } -void KABC::ResourceScalix::fromKMailAddSubresource( const QString& type, - const QString& subResource, - const QString& label, +void KABC::ResourceScalix::fromKMailAddSubresource( const TQString& type, + const TQString& subResource, + const TQString& label, bool writable ) { if( type != s_kmailContentsType ) return; @@ -495,8 +495,8 @@ void KABC::ResourceScalix::fromKMailAddSubresource( const QString& type, emit signalSubresourceAdded( this, type, subResource ); } -void KABC::ResourceScalix::fromKMailDelSubresource( const QString& type, - const QString& subResource ) +void KABC::ResourceScalix::fromKMailDelSubresource( const TQString& type, + const TQString& subResource ) { if( type != s_kmailContentsType ) return; @@ -513,7 +513,7 @@ void KABC::ResourceScalix::fromKMailDelSubresource( const QString& type, // Make a list of all uids to remove Scalix::UidMap::ConstIterator mapIt; - QStringList uids; + TQStringList uids; for ( mapIt = mUidMap.begin(); mapIt != mUidMap.end(); ++mapIt ) if ( mapIt.data().resource() == subResource ) // We have a match @@ -521,7 +521,7 @@ void KABC::ResourceScalix::fromKMailDelSubresource( const QString& type, // Finally delete all the incidences if ( !uids.isEmpty() ) { - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for ( it = uids.begin(); it != uids.end(); ++it ) { mAddrMap.remove( *it ); mUidMap.remove( *it ); @@ -535,13 +535,13 @@ void KABC::ResourceScalix::fromKMailDelSubresource( const QString& type, -void KABC::ResourceScalix::fromKMailAsyncLoadResult( const QMap<Q_UINT32, QString>& map, - const QString& /* type */, - const QString& folder ) +void KABC::ResourceScalix::fromKMailAsyncLoadResult( const TQMap<Q_UINT32, TQString>& map, + const TQString& /* type */, + const TQString& folder ) { // FIXME KMailICalIface::StorageFormat format = KMailICalIface::StorageXML; - for( QMap<Q_UINT32, QString>::ConstIterator it = map.begin(); it != map.end(); ++it ) { + for( TQMap<Q_UINT32, TQString>::ConstIterator it = map.begin(); it != map.end(); ++it ) { loadContact( it.data(), folder, it.key(), format ); } if ( !addressBook() ){ @@ -550,12 +550,12 @@ void KABC::ResourceScalix::fromKMailAsyncLoadResult( const QMap<Q_UINT32, QStrin addressBook()->emitAddressBookChanged(); } -QStringList KABC::ResourceScalix::subresources() const +TQStringList KABC::ResourceScalix::subresources() const { return mSubResources.keys(); } -bool KABC::ResourceScalix::subresourceActive( const QString& subresource ) const +bool KABC::ResourceScalix::subresourceActive( const TQString& subresource ) const { if ( mSubResources.contains( subresource ) ) { return mSubResources[ subresource ].active(); @@ -567,7 +567,7 @@ bool KABC::ResourceScalix::subresourceActive( const QString& subresource ) const return true; } -bool KABC::ResourceScalix::subresourceWritable( const QString& subresource ) const +bool KABC::ResourceScalix::subresourceWritable( const TQString& subresource ) const { if ( mSubResources.contains( subresource ) ) { return mSubResources[ subresource ].writable(); @@ -575,7 +575,7 @@ bool KABC::ResourceScalix::subresourceWritable( const QString& subresource ) con return false; //better a safe default } -int KABC::ResourceScalix::subresourceCompletionWeight( const QString& subresource ) const +int KABC::ResourceScalix::subresourceCompletionWeight( const TQString& subresource ) const { if ( mSubResources.contains( subresource ) ) { return mSubResources[ subresource ].completionWeight(); @@ -586,17 +586,17 @@ int KABC::ResourceScalix::subresourceCompletionWeight( const QString& subresourc return 80; } -QString KABC::ResourceScalix::subresourceLabel( const QString& subresource ) const +TQString KABC::ResourceScalix::subresourceLabel( const TQString& subresource ) const { if ( mSubResources.contains( subresource ) ) { return mSubResources[ subresource ].label(); } kdDebug(5650) << "subresourceLabel( " << subresource << " ): not found!\n"; - return QString::null; + return TQString::null; } -void KABC::ResourceScalix::setSubresourceCompletionWeight( const QString& subresource, int completionWeight ) +void KABC::ResourceScalix::setSubresourceCompletionWeight( const TQString& subresource, int completionWeight ) { if ( mSubResources.contains( subresource ) ) { mSubResources[ subresource ].setCompletionWeight( completionWeight ); @@ -605,17 +605,17 @@ void KABC::ResourceScalix::setSubresourceCompletionWeight( const QString& subres } } -QMap<QString, QString> KABC::ResourceScalix::uidToResourceMap() const +TQMap<TQString, TQString> KABC::ResourceScalix::uidToResourceMap() const { // TODO: Couldn't this be made simpler? - QMap<QString, QString> map; + TQMap<TQString, TQString> map; Scalix::UidMap::ConstIterator mapIt; for ( mapIt = mUidMap.begin(); mapIt != mUidMap.end(); ++mapIt ) map[ mapIt.key() ] = mapIt.data().resource(); return map; } -void KABC::ResourceScalix::setSubresourceActive( const QString &subresource, bool active ) +void KABC::ResourceScalix::setSubresourceActive( const TQString &subresource, bool active ) { if ( mSubResources.contains( subresource ) ) { mSubResources[ subresource ].setActive( active ); |