From 94273bcb909fac42ef9427e3d8a614cab8c29c66 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Wed, 20 Feb 2013 16:27:27 -0600 Subject: Rename KABC namespace --- tderesources/kolab/kcal/resourcekolab.cpp | 4 +- tderesources/kolab/kcal/resourcekolab.h | 2 +- tderesources/kolab/shared/kolabbase.cpp | 16 +-- tderesources/kolab/shared/kolabbase.h | 6 +- tderesources/kolab/tdeabc/contact.cpp | 146 ++++++++++----------- tderesources/kolab/tdeabc/contact.h | 20 +-- tderesources/kolab/tdeabc/resourcekolab.cpp | 76 +++++------ tderesources/kolab/tdeabc/resourcekolab.h | 2 +- tderesources/kolab/tdeabc/resourcekolab_plugin.cpp | 2 +- 9 files changed, 137 insertions(+), 137 deletions(-) (limited to 'tderesources/kolab') diff --git a/tderesources/kolab/kcal/resourcekolab.cpp b/tderesources/kolab/kcal/resourcekolab.cpp index 064ea7589..5371ac119 100644 --- a/tderesources/kolab/kcal/resourcekolab.cpp +++ b/tderesources/kolab/kcal/resourcekolab.cpp @@ -1211,9 +1211,9 @@ void ResourceKolab::slotEmitResourceChanged() emit resourceChanged( this ); } -KABC::Lock* ResourceKolab::lock() +TDEABC::Lock* ResourceKolab::lock() { - return new KABC::LockNull( true ); + return new TDEABC::LockNull( true ); } Kolab::ResourceMap* ResourceKolab::subResourceMap( const TQString& contentsType ) diff --git a/tderesources/kolab/kcal/resourcekolab.h b/tderesources/kolab/kcal/resourcekolab.h index fdf952cc3..357c98040 100644 --- a/tderesources/kolab/kcal/resourcekolab.h +++ b/tderesources/kolab/kcal/resourcekolab.h @@ -145,7 +145,7 @@ public: virtual TQString subresourceType( const TQString &resource ); - KABC::Lock* lock(); + TDEABC::Lock* lock(); void beginAddingIncidences(); diff --git a/tderesources/kolab/shared/kolabbase.cpp b/tderesources/kolab/shared/kolabbase.cpp index 35ca5b2b8..1dc5418b8 100644 --- a/tderesources/kolab/shared/kolabbase.cpp +++ b/tderesources/kolab/shared/kolabbase.cpp @@ -80,7 +80,7 @@ void KolabBase::saveTo( KCal::Incidence* incidence ) const // TODO: Attachments } -void KolabBase::setFields( const KABC::Addressee* addressee ) +void KolabBase::setFields( const TDEABC::Addressee* addressee ) { // An addressee does not have a creation date, so somehow we should // make one, if this is a new entry @@ -114,16 +114,16 @@ void KolabBase::setFields( const KABC::Addressee* addressee ) const TQString newCreationDate = dateTimeToString( creationDate ); if ( creationString != newCreationDate ) { // We modified the creation date, so store it for future reference - const_cast( addressee ) + const_cast( addressee ) ->insertCustom( "KOLAB", "CreationDate", newCreationDate ); kdDebug(5006) << "Creation date modified. New one: " << newCreationDate << endl; } switch( addressee->secrecy().type() ) { - case KABC::Secrecy::Private: + case TDEABC::Secrecy::Private: setSensitivity( Private ); break; - case KABC::Secrecy::Confidential: + case TDEABC::Secrecy::Confidential: setSensitivity( Confidential ); break; default: @@ -133,7 +133,7 @@ void KolabBase::setFields( const KABC::Addressee* addressee ) // TODO: Attachments } -void KolabBase::saveTo( KABC::Addressee* addressee ) const +void KolabBase::saveTo( TDEABC::Addressee* addressee ) const { addressee->setUid( uid() ); addressee->setNote( body() ); @@ -144,13 +144,13 @@ void KolabBase::saveTo( KABC::Addressee* addressee ) const switch( sensitivity() ) { case Private: - addressee->setSecrecy( KABC::Secrecy( KABC::Secrecy::Private ) ); + addressee->setSecrecy( TDEABC::Secrecy( TDEABC::Secrecy::Private ) ); break; case Confidential: - addressee->setSecrecy( KABC::Secrecy( KABC::Secrecy::Confidential ) ); + addressee->setSecrecy( TDEABC::Secrecy( TDEABC::Secrecy::Confidential ) ); break; default: - addressee->setSecrecy( KABC::Secrecy( KABC::Secrecy::Public ) ); + addressee->setSecrecy( TDEABC::Secrecy( TDEABC::Secrecy::Public ) ); break; } diff --git a/tderesources/kolab/shared/kolabbase.h b/tderesources/kolab/shared/kolabbase.h index 294a7d81b..929004902 100644 --- a/tderesources/kolab/shared/kolabbase.h +++ b/tderesources/kolab/shared/kolabbase.h @@ -44,7 +44,7 @@ namespace KCal { class Incidence; } -namespace KABC { +namespace TDEABC { class Addressee; } @@ -130,10 +130,10 @@ protected: void saveTo( KCal::Incidence* ) const; /// Read all known fields from this contact - void setFields( const KABC::Addressee* ); + void setFields( const TDEABC::Addressee* ); /// Save all known fields into this contact - void saveTo( KABC::Addressee* ) const; + void saveTo( TDEABC::Addressee* ) const; // This just makes the initial dom tree with version and doctype static TQDomDocument domTree(); diff --git a/tderesources/kolab/tdeabc/contact.cpp b/tderesources/kolab/tdeabc/contact.cpp index fec56ec6f..337dbe5c1 100644 --- a/tderesources/kolab/tdeabc/contact.cpp +++ b/tderesources/kolab/tdeabc/contact.cpp @@ -50,14 +50,14 @@ static const char* s_soundAttachmentName = "sound"; static const char* s_unhandledTagAppName = "KOLABUNHANDLED"; // no hyphens in appnames! // saving (addressee->xml) -Contact::Contact( const KABC::Addressee* addr ) +Contact::Contact( const TDEABC::Addressee* addr ) : mHasGeo( false ) { setFields( addr ); } // loading (xml->addressee) -Contact::Contact( const TQString& xml, KABC::ResourceKolab* resource, const TQString& subResource, TQ_UINT32 sernum ) +Contact::Contact( const TQString& xml, TDEABC::ResourceKolab* resource, const TQString& subResource, TQ_UINT32 sernum ) : mHasGeo( false ) { load( xml ); @@ -859,11 +859,11 @@ TQString Contact::saveXML() const return document.toString(); } -static TQString addressTypeToString( int /*KABC::Address::Type*/ type ) +static TQString addressTypeToString( int /*TDEABC::Address::Type*/ type ) { - if ( type & KABC::Address::Home ) + if ( type & TDEABC::Address::Home ) return "home"; - if ( type & KABC::Address::Work ) + if ( type & TDEABC::Address::Work ) return "business"; return "other"; } @@ -871,110 +871,110 @@ static TQString addressTypeToString( int /*KABC::Address::Type*/ type ) static int addressTypeFromString( const TQString& type ) { if ( type == "home" ) - return KABC::Address::Home; + return TDEABC::Address::Home; if ( type == "business" ) - return KABC::Address::Work; + return TDEABC::Address::Work; // well, this shows "other" in the editor, which is what we want... - return KABC::Address::Dom | KABC::Address::Intl | KABC::Address::Postal | KABC::Address::Parcel; + return TDEABC::Address::Dom | TDEABC::Address::Intl | TDEABC::Address::Postal | TDEABC::Address::Parcel; } -static TQStringList phoneTypeToString( int /*KABC::PhoneNumber::Types*/ type ) +static TQStringList phoneTypeToString( int /*TDEABC::PhoneNumber::Types*/ type ) { // KABC has a bitfield, i.e. the same phone number can be used for work and home // and fax and cellphone etc. etc. // So when saving we need to create as many tags as bits that were set. TQStringList types; - if ( type & KABC::PhoneNumber::Fax ) { - if ( type & KABC::PhoneNumber::Home ) + if ( type & TDEABC::PhoneNumber::Fax ) { + if ( type & TDEABC::PhoneNumber::Home ) types << "homefax"; - else // assume work -- if ( type & KABC::PhoneNumber::Work ) + else // assume work -- if ( type & TDEABC::PhoneNumber::Work ) types << "businessfax"; - type = type & ~KABC::PhoneNumber::Home; - type = type & ~KABC::PhoneNumber::Work; + type = type & ~TDEABC::PhoneNumber::Home; + type = type & ~TDEABC::PhoneNumber::Work; } // To support both "home1" and "home2", map Home+Pref to home2 - if ( ( type & KABC::PhoneNumber::Home ) && ( type & KABC::PhoneNumber::Pref ) ) + if ( ( type & TDEABC::PhoneNumber::Home ) && ( type & TDEABC::PhoneNumber::Pref ) ) { types << "home2"; - type = type & ~KABC::PhoneNumber::Home; - type = type & ~KABC::PhoneNumber::Pref; + type = type & ~TDEABC::PhoneNumber::Home; + type = type & ~TDEABC::PhoneNumber::Pref; } // To support both "business1" and "business2", map Work+Pref to business2 - if ( ( type & KABC::PhoneNumber::Work ) && ( type & KABC::PhoneNumber::Pref ) ) + if ( ( type & TDEABC::PhoneNumber::Work ) && ( type & TDEABC::PhoneNumber::Pref ) ) { types << "business2"; - type = type & ~KABC::PhoneNumber::Work; - type = type & ~KABC::PhoneNumber::Pref; + type = type & ~TDEABC::PhoneNumber::Work; + type = type & ~TDEABC::PhoneNumber::Pref; } - if ( type & KABC::PhoneNumber::Home ) + if ( type & TDEABC::PhoneNumber::Home ) types << "home1"; - if ( type & KABC::PhoneNumber::Msg ) // Msg==messaging + if ( type & TDEABC::PhoneNumber::Msg ) // Msg==messaging types << "company"; - if ( type & KABC::PhoneNumber::Work ) + if ( type & TDEABC::PhoneNumber::Work ) types << "business1"; - if ( type & KABC::PhoneNumber::Pref ) + if ( type & TDEABC::PhoneNumber::Pref ) types << "primary"; - if ( type & KABC::PhoneNumber::Voice ) + if ( type & TDEABC::PhoneNumber::Voice ) types << "callback"; // ## - if ( type & KABC::PhoneNumber::Cell ) + if ( type & TDEABC::PhoneNumber::Cell ) types << "mobile"; - if ( type & KABC::PhoneNumber::Video ) + if ( type & TDEABC::PhoneNumber::Video ) types << "radio"; // ## - if ( type & KABC::PhoneNumber::Bbs ) + if ( type & TDEABC::PhoneNumber::Bbs ) types << "ttytdd"; - if ( type & KABC::PhoneNumber::Modem ) + if ( type & TDEABC::PhoneNumber::Modem ) types << "telex"; // # - if ( type & KABC::PhoneNumber::Car ) + if ( type & TDEABC::PhoneNumber::Car ) types << "car"; - if ( type & KABC::PhoneNumber::Isdn ) + if ( type & TDEABC::PhoneNumber::Isdn ) types << "isdn"; - if ( type & KABC::PhoneNumber::Pcs ) + if ( type & TDEABC::PhoneNumber::Pcs ) types << "assistant"; // ## Assistant is e.g. secretary - if ( type & KABC::PhoneNumber::Pager ) + if ( type & TDEABC::PhoneNumber::Pager ) types << "pager"; return types; } -static int /*KABC::PhoneNumber::Types*/ phoneTypeFromString( const TQString& type ) +static int /*TDEABC::PhoneNumber::Types*/ phoneTypeFromString( const TQString& type ) { if ( type == "homefax" ) - return KABC::PhoneNumber::Home | KABC::PhoneNumber::Fax; + return TDEABC::PhoneNumber::Home | TDEABC::PhoneNumber::Fax; if ( type == "businessfax" ) - return KABC::PhoneNumber::Work | KABC::PhoneNumber::Fax; + return TDEABC::PhoneNumber::Work | TDEABC::PhoneNumber::Fax; if ( type == "business2" ) - return KABC::PhoneNumber::Work | KABC::PhoneNumber::Pref; + return TDEABC::PhoneNumber::Work | TDEABC::PhoneNumber::Pref; if ( type == "business1" ) - return KABC::PhoneNumber::Work; + return TDEABC::PhoneNumber::Work; if ( type == "home2" ) - return KABC::PhoneNumber::Home | KABC::PhoneNumber::Pref; + return TDEABC::PhoneNumber::Home | TDEABC::PhoneNumber::Pref; if ( type == "home1" ) - return KABC::PhoneNumber::Home; + return TDEABC::PhoneNumber::Home; if ( type == "company" ) - return KABC::PhoneNumber::Msg; + return TDEABC::PhoneNumber::Msg; if ( type == "primary" ) - return KABC::PhoneNumber::Pref; + return TDEABC::PhoneNumber::Pref; if ( type == "callback" ) - return KABC::PhoneNumber::Voice; + return TDEABC::PhoneNumber::Voice; if ( type == "mobile" ) - return KABC::PhoneNumber::Cell; + return TDEABC::PhoneNumber::Cell; if ( type == "radio" ) - return KABC::PhoneNumber::Video; + return TDEABC::PhoneNumber::Video; if ( type == "ttytdd" ) - return KABC::PhoneNumber::Bbs; + return TDEABC::PhoneNumber::Bbs; if ( type == "telex" ) - return KABC::PhoneNumber::Modem; + return TDEABC::PhoneNumber::Modem; if ( type == "car" ) - return KABC::PhoneNumber::Car; + return TDEABC::PhoneNumber::Car; if ( type == "isdn" ) - return KABC::PhoneNumber::Isdn; + return TDEABC::PhoneNumber::Isdn; if ( type == "assistant" ) - return KABC::PhoneNumber::Pcs; + return TDEABC::PhoneNumber::Pcs; if ( type == "pager" ) - return KABC::PhoneNumber::Pager; - return KABC::PhoneNumber::Home; // whatever + return TDEABC::PhoneNumber::Pager; + return TDEABC::PhoneNumber::Home; // whatever } static const char* s_knownCustomFields[] = { @@ -991,7 +991,7 @@ static const char* s_knownCustomFields[] = { }; // The saving is addressee -> Contact -> xml, this is the first part -void Contact::setFields( const KABC::Addressee* addressee ) +void Contact::setFields( const TDEABC::Addressee* addressee ) { KolabBase::setFields( addressee ); @@ -1000,7 +1000,7 @@ void Contact::setFields( const KABC::Addressee* addressee ) // Hopefully all resources are available during saving, so we can look up // in the addressbook to get name+email from the UID. KPIM::DistributionList distrList( *addressee ); - const KPIM::DistributionList::Entry::List entries = distrList.entries( KABC::StdAddressBook::self() ); + const KPIM::DistributionList::Entry::List entries = distrList.entries( TDEABC::StdAddressBook::self() ); KPIM::DistributionList::Entry::List::ConstIterator it = entries.begin(); for ( ; it != entries.end() ; ++it ) { Member m; @@ -1042,7 +1042,7 @@ void Contact::setFields( const KABC::Addressee* addressee ) const TQStringList emails = addressee->emails(); // Conversion problem here: - // KABC::Addressee has only one full name and N addresses, but the XML format + // TDEABC::Addressee has only one full name and N addresses, but the XML format // has N times (fullname+address). So we just copy the fullname over and ignore it on loading. for ( TQStringList::ConstIterator it = emails.begin(); it != emails.end(); ++it ) { Email email; @@ -1053,8 +1053,8 @@ void Contact::setFields( const KABC::Addressee* addressee ) // Now the real-world addresses TQString preferredAddress = "home"; - const KABC::Address::List addresses = addressee->addresses(); - for ( KABC::Address::List::ConstIterator it = addresses.begin() ; it != addresses.end(); ++it ) { + const TDEABC::Address::List addresses = addressee->addresses(); + for ( TDEABC::Address::List::ConstIterator it = addresses.begin() ; it != addresses.end(); ++it ) { Address address; address.kdeAddressType = (*it).type(); address.type = addressTypeToString( address.kdeAddressType ); @@ -1067,14 +1067,14 @@ void Contact::setFields( const KABC::Addressee* addressee ) // ## TODO not in the XML format: extended address info. // ## KDE-specific tags? Or hiding those fields? Or adding a warning? addAddress( address ); - if ( address.kdeAddressType & KABC::Address::Pref ) { + if ( address.kdeAddressType & TDEABC::Address::Pref ) { preferredAddress = address.type; // home, business or other } } setPreferredAddress( preferredAddress ); - const KABC::PhoneNumber::List phones = addressee->phoneNumbers(); - for ( KABC::PhoneNumber::List::ConstIterator it = phones.begin(); it != phones.end(); ++it ) { + const TDEABC::PhoneNumber::List phones = addressee->phoneNumbers(); + for ( TDEABC::PhoneNumber::List::ConstIterator it = phones.begin(); it != phones.end(); ++it ) { // Create a tag per phone type set in the bitfield TQStringList types = phoneTypeToString( (*it).type() ); for( TQStringList::Iterator typit = types.begin(); typit != types.end(); ++typit ) { @@ -1113,7 +1113,7 @@ void Contact::setFields( const KABC::Addressee* addressee ) knownCustoms << TQString::fromLatin1( *p ); TQStringList customs = addressee->customs(); for( TQStringList::Iterator it = customs.begin(); it != customs.end(); ++it ) { - // KABC::Addressee doesn't offer a real way to iterate over customs, other than splitting strings ourselves + // TDEABC::Addressee doesn't offer a real way to iterate over customs, other than splitting strings ourselves // The format is "app-name:value". int pos = (*it).find( '-' ); if ( pos == -1 ) continue; @@ -1150,7 +1150,7 @@ void Contact::setFields( const KABC::Addressee* addressee ) } // The loading is: xml -> Contact -> addressee, this is the second part -void Contact::saveTo( KABC::Addressee* addressee ) +void Contact::saveTo( TDEABC::Addressee* addressee ) { // TODO: This needs the same set of TODOs as the setFields method KolabBase::saveTo( addressee ); @@ -1206,19 +1206,19 @@ void Contact::saveTo( KABC::Addressee* addressee ) // We need to store both the original attachment name and the picture data into the addressee. // This is important, otherwise we would save the image under another attachment name w/o deleting the original one! if ( !mPicture.isNull() ) - addressee->setPhoto( KABC::Picture( mPicture ) ); + addressee->setPhoto( TDEABC::Picture( mPicture ) ); // Note that we must save the filename in all cases, so that removing the picture // actually deletes the attachment. addressee->insertCustom( "KOLAB", "PictureAttachmentName", mPictureAttachmentName ); if ( !mLogo.isNull() ) - addressee->setLogo( KABC::Picture( mLogo ) ); + addressee->setLogo( TDEABC::Picture( mLogo ) ); addressee->insertCustom( "KOLAB", "LogoAttachmentName", mLogoAttachmentName ); if ( !mSound.isNull() ) - addressee->setSound( KABC::Sound( mSound ) ); + addressee->setSound( TDEABC::Sound( mSound ) ); addressee->insertCustom( "KOLAB", "SoundAttachmentName", mSoundAttachmentName ); if ( mHasGeo ) - addressee->setGeo( KABC::Geo( mLatitude, mLongitude ) ); + addressee->setGeo( TDEABC::Geo( mLatitude, mLongitude ) ); TQStringList emailAddresses; for ( TQValueList::ConstIterator it = mEmails.begin(); it != mEmails.end(); ++it ) { @@ -1228,12 +1228,12 @@ void Contact::saveTo( KABC::Addressee* addressee ) addressee->setEmails( emailAddresses ); for ( TQValueList
::ConstIterator it = mAddresses.begin(); it != mAddresses.end(); ++it ) { - KABC::Address address; + TDEABC::Address address; int type = (*it).kdeAddressType; if ( type == -1 ) { // no kde-specific type available type = addressTypeFromString( (*it).type ); if ( (*it).type == mPreferredAddress ) - type |= KABC::Address::Pref; + type |= TDEABC::Address::Pref; } address.setType( type ); address.setStreet( (*it).street ); @@ -1246,7 +1246,7 @@ void Contact::saveTo( KABC::Addressee* addressee ) } for ( TQValueList::ConstIterator it = mPhoneNumbers.begin(); it != mPhoneNumbers.end(); ++it ) { - KABC::PhoneNumber number; + TDEABC::PhoneNumber number; number.setType( phoneTypeFromString( (*it).type ) ); number.setNumber( (*it).number ); addressee->insertPhoneNumber( number ); @@ -1259,7 +1259,7 @@ void Contact::saveTo( KABC::Addressee* addressee ) //kdDebug(5006) << addressee->customs() << endl; } -TQImage Contact::loadPictureFromKMail( const TQString& attachmentName, KABC::ResourceKolab* resource, const TQString& subResource, TQ_UINT32 sernum ) +TQImage Contact::loadPictureFromKMail( const TQString& attachmentName, TDEABC::ResourceKolab* resource, const TQString& subResource, TQ_UINT32 sernum ) { TQImage img; KURL url; @@ -1271,7 +1271,7 @@ TQImage Contact::loadPictureFromKMail( const TQString& attachmentName, KABC::Res return img; } -TQImage Contact::loadPictureFromAddressee( const KABC::Picture& picture ) +TQImage Contact::loadPictureFromAddressee( const TDEABC::Picture& picture ) { TQImage img; if ( !picture.isIntern() && !picture.url().isEmpty() ) { @@ -1285,7 +1285,7 @@ TQImage Contact::loadPictureFromAddressee( const KABC::Picture& picture ) return img; } -TQByteArray Kolab::Contact::loadDataFromKMail( const TQString& attachmentName, KABC::ResourceKolab* resource, const TQString& subResource, TQ_UINT32 sernum ) +TQByteArray Kolab::Contact::loadDataFromKMail( const TQString& attachmentName, TDEABC::ResourceKolab* resource, const TQString& subResource, TQ_UINT32 sernum ) { TQByteArray data; KURL url; @@ -1300,7 +1300,7 @@ TQByteArray Kolab::Contact::loadDataFromKMail( const TQString& attachmentName, K return data; } -TQByteArray Kolab::Contact::loadSoundFromAddressee( const KABC::Sound& sound ) +TQByteArray Kolab::Contact::loadSoundFromAddressee( const TDEABC::Sound& sound ) { TQByteArray data; if ( !sound.isIntern() && !sound.url().isEmpty() ) { diff --git a/tderesources/kolab/tdeabc/contact.h b/tderesources/kolab/tdeabc/contact.h index 6e0de80bc..f13b0a7cb 100644 --- a/tderesources/kolab/tdeabc/contact.h +++ b/tderesources/kolab/tdeabc/contact.h @@ -36,7 +36,7 @@ #include #include -namespace KABC { +namespace TDEABC { class Addressee; class ResourceKolab; class Picture; @@ -58,7 +58,7 @@ public: Address() : kdeAddressType( -1 ) { } - int kdeAddressType; // KABC::Address::Type + int kdeAddressType; // TDEABC::Address::Type TQString type; // kolab-compliant address type: home, work or other TQString street; TQString pobox; @@ -68,11 +68,11 @@ public: TQString country; }; - explicit Contact( const KABC::Addressee* address ); - Contact( const TQString& xml, KABC::ResourceKolab* resource, const TQString& subResource, TQ_UINT32 sernum ); + explicit Contact( const TDEABC::Addressee* address ); + Contact( const TQString& xml, TDEABC::ResourceKolab* resource, const TQString& subResource, TQ_UINT32 sernum ); ~Contact(); - void saveTo( KABC::Addressee* address ); + void saveTo( TDEABC::Addressee* address ); TQString type() const { return "Contact"; } @@ -201,7 +201,7 @@ public: bool isDistributionList() const { return mIsDistributionList; } protected: - void setFields( const KABC::Addressee* ); + void setFields( const TDEABC::Addressee* ); private: bool loadNameAttribute( TQDomElement& element ); @@ -221,11 +221,11 @@ private: void loadDistrListMember( const TQDomElement& element ); void saveDistrListMembers( TQDomElement& element ) const; - TQImage loadPictureFromKMail( const TQString& attachmentName, KABC::ResourceKolab* resource, const TQString& subResource, TQ_UINT32 sernum ); - TQImage loadPictureFromAddressee( const KABC::Picture& picture ); + TQImage loadPictureFromKMail( const TQString& attachmentName, TDEABC::ResourceKolab* resource, const TQString& subResource, TQ_UINT32 sernum ); + TQImage loadPictureFromAddressee( const TDEABC::Picture& picture ); - TQByteArray loadDataFromKMail( const TQString& attachmentName, KABC::ResourceKolab* resource, const TQString& subResource, TQ_UINT32 sernum ); - TQByteArray loadSoundFromAddressee( const KABC::Sound& sound ); + TQByteArray loadDataFromKMail( const TQString& attachmentName, TDEABC::ResourceKolab* resource, const TQString& subResource, TQ_UINT32 sernum ); + TQByteArray loadSoundFromAddressee( const TDEABC::Sound& sound ); TQString productID() const; diff --git a/tderesources/kolab/tdeabc/resourcekolab.cpp b/tderesources/kolab/tdeabc/resourcekolab.cpp index 226d7da89..f4391f76d 100644 --- a/tderesources/kolab/tdeabc/resourcekolab.cpp +++ b/tderesources/kolab/tdeabc/resourcekolab.cpp @@ -60,7 +60,7 @@ class KolabFactory : public KRES::PluginFactoryBase public: KRES::Resource *resource( const TDEConfig *config ) { - return new KABC::ResourceKolab( config ); + return new TDEABC::ResourceKolab( config ); } KRES::ConfigWidget *configWidget( TQWidget* ) @@ -76,7 +76,7 @@ static const char* s_attachmentMimeTypeContact = "application/x-vnd.kolab.contac static const char* s_attachmentMimeTypeDistList = "application/x-vnd.kolab.contact.distlist"; static const char* s_inlineMimeType = "text/x-vcard"; -KABC::ResourceKolab::ResourceKolab( const TDEConfig *config ) +TDEABC::ResourceKolab::ResourceKolab( const TDEConfig *config ) : KPIM::ResourceABC( config ), Kolab::ResourceKolabBase( "ResourceKolab-KABC" ), mCachedSubresource( TQString() ), mCachedSubresourceNotFound( false ), mLocked( false ) @@ -87,7 +87,7 @@ KABC::ResourceKolab::ResourceKolab( const TDEConfig *config ) } } -KABC::ResourceKolab::~ResourceKolab() +TDEABC::ResourceKolab::~ResourceKolab() { // The resource is deleted on exit (StdAddressBook's KStaticDeleter), // and it wasn't closed before that, so close here to save the config. @@ -96,7 +96,7 @@ KABC::ResourceKolab::~ResourceKolab() } } -void KABC::ResourceKolab::loadSubResourceConfig( TDEConfig& config, +void TDEABC::ResourceKolab::loadSubResourceConfig( TDEConfig& config, const TQString& name, const TQString& label, bool writable ) @@ -108,7 +108,7 @@ void KABC::ResourceKolab::loadSubResourceConfig( TDEConfig& config, completionWeight ) ); } -bool KABC::ResourceKolab::doOpen() +bool TDEABC::ResourceKolab::doOpen() { TDEConfig config( configFile() ); @@ -125,12 +125,12 @@ bool KABC::ResourceKolab::doOpen() return true; } -void KABC::ResourceKolab::doClose() +void TDEABC::ResourceKolab::doClose() { writeConfig(); } -KABC::Ticket * KABC::ResourceKolab::requestSaveTicket() +TDEABC::Ticket * TDEABC::ResourceKolab::requestSaveTicket() { if ( !addressBook() ) { kdError() << "no addressbook" << endl; @@ -141,7 +141,7 @@ KABC::Ticket * KABC::ResourceKolab::requestSaveTicket() return createTicket( this ); } -void KABC::ResourceKolab::releaseSaveTicket( Ticket* ticket ) +void TDEABC::ResourceKolab::releaseSaveTicket( Ticket* ticket ) { mLocked = false; mCachedSubresource = TQString(); @@ -149,17 +149,17 @@ void KABC::ResourceKolab::releaseSaveTicket( Ticket* ticket ) delete ticket; } -TQString KABC::ResourceKolab::loadContact( const TQString& contactData, +TQString TDEABC::ResourceKolab::loadContact( const TQString& contactData, const TQString& subResource, TQ_UINT32 sernum, KMailICalIface::StorageFormat format ) { - KABC::Addressee addr; + TDEABC::Addressee addr; if ( format == KMailICalIface::StorageXML ) { Contact contact( contactData, this, subResource, sernum ); // load contact.saveTo( &addr ); } else { - KABC::VCardConverter converter; + TDEABC::VCardConverter converter; #if defined(KABC_VCARD_ENCODING_FIX) addr = converter.parseVCardRaw( contactData.utf8() ); #else @@ -169,7 +169,7 @@ TQString KABC::ResourceKolab::loadContact( const TQString& contactData, addr.setResource( this ); addr.setChanged( false ); - KABC::Resource::insertAddressee( addr ); // same as mAddrMap.insert( addr.uid(), addr ); + TDEABC::Resource::insertAddressee( addr ); // same as mAddrMap.insert( addr.uid(), addr ); mUidMap[ addr.uid() ] = StorageReference( subResource, sernum ); kdDebug(5650) << "Loaded contact uid=" << addr.uid() << " sernum=" << sernum << " fullName=" << addr.name() << endl; return addr.uid(); @@ -182,11 +182,11 @@ static const struct { const char* mimetype; KMailICalIface::StorageFormat format { s_inlineMimeType, KMailICalIface::StorageIcalVcard } }; -bool KABC::ResourceKolab::loadSubResource( const TQString& subResource ) +bool TDEABC::ResourceKolab::loadSubResource( const TQString& subResource ) { int count = 0; if ( !kmailIncidencesCount( count, TQString(), subResource ) ) { - kdError() << "Communication problem in KABC::ResourceKolab::loadSubResource()\n"; + kdError() << "Communication problem in TDEABC::ResourceKolab::loadSubResource()\n"; return false; } if ( !count ) @@ -217,7 +217,7 @@ bool KABC::ResourceKolab::loadSubResource( const TQString& subResource ) KMailICalIface::StorageFormat format = s_formats[indexFormat].format; TQMap lst; if ( !kmailIncidences( lst, mimetype, subResource, startIndex, nbMessages ) ) { - kdError() << "Communication problem in KABC::ResourceKolab::loadSubResource()\n"; + kdError() << "Communication problem in TDEABC::ResourceKolab::loadSubResource()\n"; if ( progressId ) uiserver.jobFinished( progressId ); return false; @@ -247,7 +247,7 @@ bool KABC::ResourceKolab::loadSubResource( const TQString& subResource ) return true; } -bool KABC::ResourceKolab::load() +bool TDEABC::ResourceKolab::load() { mUidMap.clear(); mAddrMap.clear(); @@ -265,7 +265,7 @@ bool KABC::ResourceKolab::load() return rc; } -bool KABC::ResourceKolab::save( Ticket* ) +bool TDEABC::ResourceKolab::save( Ticket* ) { bool rc = true; @@ -330,7 +330,7 @@ void AttachmentList::updateAttachment( const TQByteArray& data, const TQString& } } -bool KABC::ResourceKolab::kmailUpdateAddressee( const Addressee& addr ) +bool TDEABC::ResourceKolab::kmailUpdateAddressee( const Addressee& addr ) { const TQString uid = addr.uid(); TQString subResource; @@ -380,7 +380,7 @@ bool KABC::ResourceKolab::kmailUpdateAddressee( const Addressee& addr ) s_attachmentMimeTypeDistList : s_attachmentMimeTypeContact; } else { mimetype = s_inlineMimeType; - KABC::VCardConverter converter; + TDEABC::VCardConverter converter; #if defined(KABC_VCARD_ENCODING_FIX) data = TQString::fromUtf8( converter.createVCardRaw( addr ) ); #else @@ -411,7 +411,7 @@ bool KABC::ResourceKolab::kmailUpdateAddressee( const Addressee& addr ) return rc; } -void KABC::ResourceKolab::insertAddressee( const Addressee& addr ) +void TDEABC::ResourceKolab::insertAddressee( const Addressee& addr ) { const TQString uid = addr.uid(); //kdDebug(5650) << k_funcinfo << uid << endl; @@ -428,7 +428,7 @@ void KABC::ResourceKolab::insertAddressee( const Addressee& addr ) Resource::insertAddressee( addr ); } -void KABC::ResourceKolab::removeAddressee( const Addressee& addr ) +void TDEABC::ResourceKolab::removeAddressee( const Addressee& addr ) { const TQString uid = addr.uid(); if ( mUidMap.find( uid ) == mUidMap.end() ) return; @@ -451,7 +451,7 @@ 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 TQString& type, +bool TDEABC::ResourceKolab::fromKMailAddIncidence( const TQString& type, const TQString& subResource, TQ_UINT32 sernum, int format, @@ -479,7 +479,7 @@ bool KABC::ResourceKolab::fromKMailAddIncidence( const TQString& type, return true; } -void KABC::ResourceKolab::fromKMailDelIncidence( const TQString& type, +void TDEABC::ResourceKolab::fromKMailDelIncidence( const TQString& type, const TQString& subResource, const TQString& uid ) { @@ -503,7 +503,7 @@ void KABC::ResourceKolab::fromKMailDelIncidence( const TQString& type, } } -void KABC::ResourceKolab::fromKMailRefresh( const TQString& type, +void TDEABC::ResourceKolab::fromKMailRefresh( const TQString& type, const TQString& /*subResource*/ ) { // Check if this is a contact @@ -515,7 +515,7 @@ void KABC::ResourceKolab::fromKMailRefresh( const TQString& type, addressBook()->emitAddressBookChanged(); } -void KABC::ResourceKolab::fromKMailAddSubresource( const TQString& type, +void TDEABC::ResourceKolab::fromKMailAddSubresource( const TQString& type, const TQString& subResource, const TQString& label, bool writable, @@ -535,7 +535,7 @@ void KABC::ResourceKolab::fromKMailAddSubresource( const TQString& type, emit signalSubresourceAdded( this, type, subResource ); } -void KABC::ResourceKolab::fromKMailDelSubresource( const TQString& type, +void TDEABC::ResourceKolab::fromKMailDelSubresource( const TQString& type, const TQString& subResource ) { if( type != s_kmailContentsType ) return; @@ -575,7 +575,7 @@ void KABC::ResourceKolab::fromKMailDelSubresource( const TQString& type, -void KABC::ResourceKolab::fromKMailAsyncLoadResult( const TQMap& map, +void TDEABC::ResourceKolab::fromKMailAsyncLoadResult( const TQMap& map, const TQString& /* type */, const TQString& folder ) { @@ -590,12 +590,12 @@ void KABC::ResourceKolab::fromKMailAsyncLoadResult( const TQMapemitAddressBookChanged(); } -TQStringList KABC::ResourceKolab::subresources() const +TQStringList TDEABC::ResourceKolab::subresources() const { return mSubResources.keys(); } -bool KABC::ResourceKolab::subresourceActive( const TQString& subresource ) const +bool TDEABC::ResourceKolab::subresourceActive( const TQString& subresource ) const { if ( mSubResources.contains( subresource ) ) { return mSubResources[ subresource ].active(); @@ -607,7 +607,7 @@ bool KABC::ResourceKolab::subresourceActive( const TQString& subresource ) const return true; } -bool KABC::ResourceKolab::subresourceWritable( const TQString& subresource ) const +bool TDEABC::ResourceKolab::subresourceWritable( const TQString& subresource ) const { if ( mSubResources.contains( subresource ) ) { return mSubResources[ subresource ].writable(); @@ -615,7 +615,7 @@ bool KABC::ResourceKolab::subresourceWritable( const TQString& subresource ) con return false; //better a safe default } -int KABC::ResourceKolab::subresourceCompletionWeight( const TQString& subresource ) const +int TDEABC::ResourceKolab::subresourceCompletionWeight( const TQString& subresource ) const { if ( mSubResources.contains( subresource ) ) { return mSubResources[ subresource ].completionWeight(); @@ -626,7 +626,7 @@ int KABC::ResourceKolab::subresourceCompletionWeight( const TQString& subresourc return 80; } -TQString KABC::ResourceKolab::subresourceLabel( const TQString& subresource ) const +TQString TDEABC::ResourceKolab::subresourceLabel( const TQString& subresource ) const { if ( mSubResources.contains( subresource ) ) { return mSubResources[ subresource ].label(); @@ -636,7 +636,7 @@ TQString KABC::ResourceKolab::subresourceLabel( const TQString& subresource ) co return TQString(); } -void KABC::ResourceKolab::setSubresourceCompletionWeight( const TQString& subresource, int completionWeight ) +void TDEABC::ResourceKolab::setSubresourceCompletionWeight( const TQString& subresource, int completionWeight ) { if ( mSubResources.contains( subresource ) ) { mSubResources[ subresource ].setCompletionWeight( completionWeight ); @@ -645,7 +645,7 @@ void KABC::ResourceKolab::setSubresourceCompletionWeight( const TQString& subres } } -TQMap KABC::ResourceKolab::uidToResourceMap() const +TQMap TDEABC::ResourceKolab::uidToResourceMap() const { // TODO: Couldn't this be made simpler? TQMap map; @@ -655,7 +655,7 @@ TQMap KABC::ResourceKolab::uidToResourceMap() const return map; } -void KABC::ResourceKolab::setSubresourceActive( const TQString &subresource, bool active ) +void TDEABC::ResourceKolab::setSubresourceActive( const TQString &subresource, bool active ) { if ( mSubResources.contains( subresource ) ) { mSubResources[ subresource ].setActive( active ); @@ -668,18 +668,18 @@ void KABC::ResourceKolab::setSubresourceActive( const TQString &subresource, boo /*virtual*/ -bool KABC::ResourceKolab::addSubresource( const TQString& label, const TQString& parent ) +bool TDEABC::ResourceKolab::addSubresource( const TQString& label, const TQString& parent ) { return kmailAddSubresource( label, parent, s_kmailContentsType ); } /*virtual*/ -bool KABC::ResourceKolab::removeSubresource( const TQString& id ) +bool TDEABC::ResourceKolab::removeSubresource( const TQString& id ) { return kmailRemoveSubresource( id ); } -void KABC::ResourceKolab::writeConfig() +void TDEABC::ResourceKolab::writeConfig() { TDEConfig config( configFile() ); diff --git a/tderesources/kolab/tdeabc/resourcekolab.h b/tderesources/kolab/tdeabc/resourcekolab.h index 3a142b209..52fa93d35 100644 --- a/tderesources/kolab/tdeabc/resourcekolab.h +++ b/tderesources/kolab/tdeabc/resourcekolab.h @@ -40,7 +40,7 @@ #include #include -namespace KABC { +namespace TDEABC { class FormatPlugin; diff --git a/tderesources/kolab/tdeabc/resourcekolab_plugin.cpp b/tderesources/kolab/tdeabc/resourcekolab_plugin.cpp index 686f3403e..a66cb9bdd 100644 --- a/tderesources/kolab/tdeabc/resourcekolab_plugin.cpp +++ b/tderesources/kolab/tdeabc/resourcekolab_plugin.cpp @@ -39,7 +39,7 @@ class KolabFactory : public KRES::PluginFactoryBase public: KRES::Resource *resource( const TDEConfig *config ) { - return new KABC::ResourceKolab( config ); + return new TDEABC::ResourceKolab( config ); } KRES::ConfigWidget *configWidget( TQWidget* ) -- cgit v1.2.1