summaryrefslogtreecommitdiffstats
path: root/kresources/kolab/kabc/resourcekolab.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/kolab/kabc/resourcekolab.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/kolab/kabc/resourcekolab.cpp')
-rw-r--r--kresources/kolab/kabc/resourcekolab.cpp140
1 files changed, 70 insertions, 70 deletions
diff --git a/kresources/kolab/kabc/resourcekolab.cpp b/kresources/kolab/kabc/resourcekolab.cpp
index 464c9c610..034c32d78 100644
--- a/kresources/kolab/kabc/resourcekolab.cpp
+++ b/kresources/kolab/kabc/resourcekolab.cpp
@@ -45,11 +45,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>
@@ -63,7 +63,7 @@ class KolabFactory : public KRES::PluginFactoryBase
return new KABC::ResourceKolab( config );
}
- KRES::ConfigWidget *configWidget( QWidget* )
+ KRES::ConfigWidget *configWidget( TQWidget* )
{
return 0;
}
@@ -79,7 +79,7 @@ static const char* s_inlineMimeType = "text/x-vcard";
KABC::ResourceKolab::ResourceKolab( const KConfig *config )
: KPIM::ResourceABC( config ),
Kolab::ResourceKolabBase( "ResourceKolab-KABC" ),
- mCachedSubresource( QString::null ), mLocked( false )
+ mCachedSubresource( TQString::null ), mLocked( false )
{
setType( "imap" );
}
@@ -94,8 +94,8 @@ KABC::ResourceKolab::~ResourceKolab()
}
void KABC::ResourceKolab::loadSubResourceConfig( KConfig& config,
- const QString& name,
- const QString& label,
+ const TQString& name,
+ const TQString& label,
bool writable )
{
KConfigGroup group( &config, name );
@@ -110,11 +110,11 @@ bool KABC::ResourceKolab::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 );
}
@@ -148,12 +148,12 @@ KABC::Ticket * KABC::ResourceKolab::requestSaveTicket()
void KABC::ResourceKolab::releaseSaveTicket( Ticket* ticket )
{
mLocked = false;
- mCachedSubresource = QString::null;
+ mCachedSubresource = TQString::null;
delete ticket;
}
-QString KABC::ResourceKolab::loadContact( const QString& contactData,
- const QString& subResource,
+TQString KABC::ResourceKolab::loadContact( const TQString& contactData,
+ const TQString& subResource,
Q_UINT32 sernum,
KMailICalIface::StorageFormat format )
{
@@ -181,10 +181,10 @@ static const struct { const char* mimetype; KMailICalIface::StorageFormat format
{ s_inlineMimeType, KMailICalIface::StorageIcalVcard }
};
-bool KABC::ResourceKolab::loadSubResource( const QString& subResource )
+bool KABC::ResourceKolab::loadSubResource( const TQString& subResource )
{
int count = 0;
- if ( !kmailIncidencesCount( count, QString::null, subResource ) ) {
+ if ( !kmailIncidencesCount( count, TQString::null, subResource ) ) {
kdError() << "Communication problem in KABC::ResourceKolab::loadSubResource()\n";
return false;
}
@@ -210,11 +210,11 @@ bool KABC::ResourceKolab::loadSubResource( const QString& subResource )
// TODO it would be faster to pass the s_formats array to kmail and let it load
// all events - to avoid loading each mail 3 times. But then we need to extend the returned
- // QMap to also tell us the StorageFormat of each found contact...
+ // TQMap to also tell us the StorageFormat of each found contact...
for ( int indexFormat = 0; indexFormat < 3; ++indexFormat ) {
const char* mimetype = s_formats[indexFormat].mimetype;
KMailICalIface::StorageFormat format = s_formats[indexFormat].format;
- QMap<Q_UINT32, QString> lst;
+ TQMap<Q_UINT32, TQString> lst;
if ( !kmailIncidences( lst, mimetype, subResource, startIndex, nbMessages ) ) {
kdError() << "Communication problem in KABC::ResourceKolab::loadSubResource()\n";
if ( progressId )
@@ -222,7 +222,7 @@ bool KABC::ResourceKolab::loadSubResource( 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 );
}
@@ -280,24 +280,24 @@ bool KABC::ResourceKolab::save( Ticket* )
namespace Kolab {
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() ) {
@@ -313,7 +313,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() ) {
@@ -331,8 +331,8 @@ void AttachmentList::updateAttachment( const QByteArray& data, const QString& na
bool KABC::ResourceKolab::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();
@@ -355,11 +355,11 @@ bool KABC::ResourceKolab::kmailUpdateAddressee( const Addressee& addr )
return false;
sernum = 0;
}
- QString data;
- QString mimetype;
+ TQString data;
+ TQString mimetype;
AttachmentList att;
bool isXMLStorageFormat = kmailStorageFormat( subResource ) == KMailICalIface::StorageXML;
- QString subject = uid; // as per kolab2 spec
+ TQString subject = uid; // as per kolab2 spec
if ( isXMLStorageFormat ) {
Contact contact( &addr );
// The addressee is converted to: 1) the xml 2) the optional picture 3) the optional logo 4) the optional sound
@@ -393,7 +393,7 @@ bool KABC::ResourceKolab::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);
}
@@ -402,7 +402,7 @@ bool KABC::ResourceKolab::kmailUpdateAddressee( const Addressee& addr )
void KABC::ResourceKolab::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 ) ) {
@@ -419,10 +419,10 @@ void KABC::ResourceKolab::insertAddressee( const Addressee& addr )
void KABC::ResourceKolab::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;
@@ -440,18 +440,18 @@ void KABC::ResourceKolab::removeAddressee( const Addressee& addr )
* These are the DCOP slots that KMail call to notify when something
* changed.
*/
-bool KABC::ResourceKolab::fromKMailAddIncidence( const QString& type,
- const QString& subResource,
+bool KABC::ResourceKolab::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;
@@ -468,9 +468,9 @@ bool KABC::ResourceKolab::fromKMailAddIncidence( const QString& type,
return true;
}
-void KABC::ResourceKolab::fromKMailDelIncidence( const QString& type,
- const QString& subResource,
- const QString& uid )
+void KABC::ResourceKolab::fromKMailDelIncidence( const TQString& type,
+ const TQString& subResource,
+ const TQString& uid )
{
// Check if this is a contact
if( type != s_kmailContentsType || !subresourceActive( subResource ) )
@@ -492,8 +492,8 @@ void KABC::ResourceKolab::fromKMailDelIncidence( const QString& type,
}
}
-void KABC::ResourceKolab::fromKMailRefresh( const QString& type,
- const QString& /*subResource*/ )
+void KABC::ResourceKolab::fromKMailRefresh( const TQString& type,
+ const TQString& /*subResource*/ )
{
// Check if this is a contact
if( type != s_kmailContentsType ) return;
@@ -504,9 +504,9 @@ void KABC::ResourceKolab::fromKMailRefresh( const QString& type,
addressBook()->emitAddressBookChanged();
}
-void KABC::ResourceKolab::fromKMailAddSubresource( const QString& type,
- const QString& subResource,
- const QString& label,
+void KABC::ResourceKolab::fromKMailAddSubresource( const TQString& type,
+ const TQString& subResource,
+ const TQString& label,
bool writable,
bool )
{
@@ -524,8 +524,8 @@ void KABC::ResourceKolab::fromKMailAddSubresource( const QString& type,
emit signalSubresourceAdded( this, type, subResource );
}
-void KABC::ResourceKolab::fromKMailDelSubresource( const QString& type,
- const QString& subResource )
+void KABC::ResourceKolab::fromKMailDelSubresource( const TQString& type,
+ const TQString& subResource )
{
if( type != s_kmailContentsType ) return;
@@ -542,7 +542,7 @@ void KABC::ResourceKolab::fromKMailDelSubresource( const QString& type,
// Make a list of all uids to remove
Kolab::UidMap::ConstIterator mapIt;
- QStringList uids;
+ TQStringList uids;
for ( mapIt = mUidMap.begin(); mapIt != mUidMap.end(); ++mapIt )
if ( mapIt.data().resource() == subResource )
// We have a match
@@ -550,7 +550,7 @@ void KABC::ResourceKolab::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 );
@@ -564,13 +564,13 @@ void KABC::ResourceKolab::fromKMailDelSubresource( const QString& type,
-void KABC::ResourceKolab::fromKMailAsyncLoadResult( const QMap<Q_UINT32, QString>& map,
- const QString& /* type */,
- const QString& folder )
+void KABC::ResourceKolab::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() ){
@@ -579,12 +579,12 @@ void KABC::ResourceKolab::fromKMailAsyncLoadResult( const QMap<Q_UINT32, QString
addressBook()->emitAddressBookChanged();
}
-QStringList KABC::ResourceKolab::subresources() const
+TQStringList KABC::ResourceKolab::subresources() const
{
return mSubResources.keys();
}
-bool KABC::ResourceKolab::subresourceActive( const QString& subresource ) const
+bool KABC::ResourceKolab::subresourceActive( const TQString& subresource ) const
{
if ( mSubResources.contains( subresource ) ) {
return mSubResources[ subresource ].active();
@@ -596,7 +596,7 @@ bool KABC::ResourceKolab::subresourceActive( const QString& subresource ) const
return true;
}
-bool KABC::ResourceKolab::subresourceWritable( const QString& subresource ) const
+bool KABC::ResourceKolab::subresourceWritable( const TQString& subresource ) const
{
if ( mSubResources.contains( subresource ) ) {
return mSubResources[ subresource ].writable();
@@ -604,7 +604,7 @@ bool KABC::ResourceKolab::subresourceWritable( const QString& subresource ) cons
return false; //better a safe default
}
-int KABC::ResourceKolab::subresourceCompletionWeight( const QString& subresource ) const
+int KABC::ResourceKolab::subresourceCompletionWeight( const TQString& subresource ) const
{
if ( mSubResources.contains( subresource ) ) {
return mSubResources[ subresource ].completionWeight();
@@ -615,17 +615,17 @@ int KABC::ResourceKolab::subresourceCompletionWeight( const QString& subresource
return 80;
}
-QString KABC::ResourceKolab::subresourceLabel( const QString& subresource ) const
+TQString KABC::ResourceKolab::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::ResourceKolab::setSubresourceCompletionWeight( const QString& subresource, int completionWeight )
+void KABC::ResourceKolab::setSubresourceCompletionWeight( const TQString& subresource, int completionWeight )
{
if ( mSubResources.contains( subresource ) ) {
mSubResources[ subresource ].setCompletionWeight( completionWeight );
@@ -634,17 +634,17 @@ void KABC::ResourceKolab::setSubresourceCompletionWeight( const QString& subreso
}
}
-QMap<QString, QString> KABC::ResourceKolab::uidToResourceMap() const
+TQMap<TQString, TQString> KABC::ResourceKolab::uidToResourceMap() const
{
// TODO: Couldn't this be made simpler?
- QMap<QString, QString> map;
+ TQMap<TQString, TQString> map;
Kolab::UidMap::ConstIterator mapIt;
for ( mapIt = mUidMap.begin(); mapIt != mUidMap.end(); ++mapIt )
map[ mapIt.key() ] = mapIt.data().resource();
return map;
}
-void KABC::ResourceKolab::setSubresourceActive( const QString &subresource, bool active )
+void KABC::ResourceKolab::setSubresourceActive( const TQString &subresource, bool active )
{
if ( mSubResources.contains( subresource ) ) {
mSubResources[ subresource ].setActive( active );
@@ -656,13 +656,13 @@ void KABC::ResourceKolab::setSubresourceActive( const QString &subresource, bool
/*virtual*/
-bool KABC::ResourceKolab::addSubresource( const QString& label, const QString& parent )
+bool KABC::ResourceKolab::addSubresource( const TQString& label, const TQString& parent )
{
return kmailAddSubresource( label, parent, s_kmailContentsType );
}
/*virtual*/
-bool KABC::ResourceKolab::removeSubresource( const QString& id )
+bool KABC::ResourceKolab::removeSubresource( const TQString& id )
{
return kmailRemoveSubresource( id );
}