diff options
Diffstat (limited to 'libtdepim')
31 files changed, 369 insertions, 369 deletions
diff --git a/libtdepim/Makefile.am b/libtdepim/Makefile.am index 935691b51..b8657d3f8 100644 --- a/libtdepim/Makefile.am +++ b/libtdepim/Makefile.am @@ -45,7 +45,7 @@ AddressBookServiceIface_DIR = $(srcdir)/interfaces libtdepim_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 1:0:0 $(LIB_QT) -ltdecore libtdepim_la_LIBADD = $(top_builddir)/libkcal/libkcal.la \ $(top_builddir)/libemailfunctions/libemailfunctions.la \ - $(LIB_KIO) $(LIB_KABC) $(LIB_KPARTS) $(LIB_KIMPROXY) $(LIB_POLL) $(LIB_QUI) + $(LIB_KIO) $(LIB_TDEABC) $(LIB_KPARTS) $(LIB_KIMPROXY) $(LIB_POLL) $(LIB_QUI) # $top_builddir)/libtdepim/resources/libkpimresources.la include_HEADERS = tdepimmacros.h kpimprefs.h diff --git a/libtdepim/addresseediffalgo.cpp b/libtdepim/addresseediffalgo.cpp index d36b7ac94..ab1f2eeb0 100644 --- a/libtdepim/addresseediffalgo.cpp +++ b/libtdepim/addresseediffalgo.cpp @@ -31,8 +31,8 @@ static bool compareString( const TQString &left, const TQString &right ) return left == right; } -AddresseeDiffAlgo::AddresseeDiffAlgo( const KABC::Addressee &leftAddressee, - const KABC::Addressee &rightAddressee ) +AddresseeDiffAlgo::AddresseeDiffAlgo( const TDEABC::Addressee &leftAddressee, + const TDEABC::Addressee &rightAddressee ) : mLeftAddressee( leftAddressee ), mRightAddressee( rightAddressee ) { } @@ -42,68 +42,68 @@ void AddresseeDiffAlgo::run() begin(); if ( !compareString( mLeftAddressee.uid(), mRightAddressee.uid() ) ) - conflictField( KABC::Addressee::uidLabel(), mLeftAddressee.uid(), mRightAddressee.uid() ); + conflictField( TDEABC::Addressee::uidLabel(), mLeftAddressee.uid(), mRightAddressee.uid() ); if ( !compareString( mLeftAddressee.name(), mRightAddressee.name() ) ) - conflictField( KABC::Addressee::nameLabel(), mLeftAddressee.name(), mRightAddressee.name() ); + conflictField( TDEABC::Addressee::nameLabel(), mLeftAddressee.name(), mRightAddressee.name() ); if ( !compareString( mLeftAddressee.formattedName(), mRightAddressee.formattedName() ) ) - conflictField( KABC::Addressee::formattedNameLabel(), mLeftAddressee.formattedName(), mRightAddressee.formattedName() ); + conflictField( TDEABC::Addressee::formattedNameLabel(), mLeftAddressee.formattedName(), mRightAddressee.formattedName() ); if ( !compareString( mLeftAddressee.familyName(), mRightAddressee.familyName() ) ) - conflictField( KABC::Addressee::familyNameLabel(), mLeftAddressee.familyName(), mRightAddressee.familyName() ); + conflictField( TDEABC::Addressee::familyNameLabel(), mLeftAddressee.familyName(), mRightAddressee.familyName() ); if ( !compareString( mLeftAddressee.givenName(), mRightAddressee.givenName() ) ) - conflictField( KABC::Addressee::givenNameLabel(), mLeftAddressee.givenName(), mRightAddressee.givenName() ); + conflictField( TDEABC::Addressee::givenNameLabel(), mLeftAddressee.givenName(), mRightAddressee.givenName() ); if ( !compareString( mLeftAddressee.additionalName(), mRightAddressee.additionalName() ) ) - conflictField( KABC::Addressee::additionalNameLabel(), mLeftAddressee.additionalName(), mRightAddressee.additionalName() ); + conflictField( TDEABC::Addressee::additionalNameLabel(), mLeftAddressee.additionalName(), mRightAddressee.additionalName() ); if ( !compareString( mLeftAddressee.prefix(), mRightAddressee.prefix() ) ) - conflictField( KABC::Addressee::prefixLabel(), mLeftAddressee.prefix(), mRightAddressee.prefix() ); + conflictField( TDEABC::Addressee::prefixLabel(), mLeftAddressee.prefix(), mRightAddressee.prefix() ); if ( !compareString( mLeftAddressee.suffix(), mRightAddressee.suffix() ) ) - conflictField( KABC::Addressee::suffixLabel(), mLeftAddressee.suffix(), mRightAddressee.suffix() ); + conflictField( TDEABC::Addressee::suffixLabel(), mLeftAddressee.suffix(), mRightAddressee.suffix() ); if ( !compareString( mLeftAddressee.nickName(), mRightAddressee.nickName() ) ) - conflictField( KABC::Addressee::nickNameLabel(), mLeftAddressee.nickName(), mRightAddressee.nickName() ); + conflictField( TDEABC::Addressee::nickNameLabel(), mLeftAddressee.nickName(), mRightAddressee.nickName() ); if ( mLeftAddressee.birthday() != mRightAddressee.birthday() ) - conflictField( KABC::Addressee::birthdayLabel(), mLeftAddressee.birthday().toString(), + conflictField( TDEABC::Addressee::birthdayLabel(), mLeftAddressee.birthday().toString(), mRightAddressee.birthday().toString() ); if ( !compareString( mLeftAddressee.mailer(), mRightAddressee.mailer() ) ) - conflictField( KABC::Addressee::mailerLabel(), mLeftAddressee.mailer(), mRightAddressee.mailer() ); + conflictField( TDEABC::Addressee::mailerLabel(), mLeftAddressee.mailer(), mRightAddressee.mailer() ); if ( mLeftAddressee.timeZone() != mRightAddressee.timeZone() ) - conflictField( KABC::Addressee::timeZoneLabel(), mLeftAddressee.timeZone().asString(), mRightAddressee.timeZone().asString() ); + conflictField( TDEABC::Addressee::timeZoneLabel(), mLeftAddressee.timeZone().asString(), mRightAddressee.timeZone().asString() ); if ( mLeftAddressee.geo() != mRightAddressee.geo() ) - conflictField( KABC::Addressee::geoLabel(), mLeftAddressee.geo().asString(), mRightAddressee.geo().asString() ); + conflictField( TDEABC::Addressee::geoLabel(), mLeftAddressee.geo().asString(), mRightAddressee.geo().asString() ); if ( !compareString( mLeftAddressee.title(), mRightAddressee.title() ) ) - conflictField( KABC::Addressee::titleLabel(), mLeftAddressee.title(), mRightAddressee.title() ); + conflictField( TDEABC::Addressee::titleLabel(), mLeftAddressee.title(), mRightAddressee.title() ); if ( !compareString( mLeftAddressee.role(), mRightAddressee.role() ) ) - conflictField( KABC::Addressee::roleLabel(), mLeftAddressee.role(), mRightAddressee.role() ); + conflictField( TDEABC::Addressee::roleLabel(), mLeftAddressee.role(), mRightAddressee.role() ); if ( !compareString( mLeftAddressee.organization(), mRightAddressee.organization() ) ) - conflictField( KABC::Addressee::organizationLabel(), mLeftAddressee.organization(), mRightAddressee.organization() ); + conflictField( TDEABC::Addressee::organizationLabel(), mLeftAddressee.organization(), mRightAddressee.organization() ); if ( !compareString( mLeftAddressee.note(), mRightAddressee.note() ) ) - conflictField( KABC::Addressee::noteLabel(), mLeftAddressee.note(), mRightAddressee.note() ); + conflictField( TDEABC::Addressee::noteLabel(), mLeftAddressee.note(), mRightAddressee.note() ); if ( !compareString( mLeftAddressee.productId(), mRightAddressee.productId() ) ) - conflictField( KABC::Addressee::productIdLabel(), mLeftAddressee.productId(), mRightAddressee.productId() ); + conflictField( TDEABC::Addressee::productIdLabel(), mLeftAddressee.productId(), mRightAddressee.productId() ); if ( !compareString( mLeftAddressee.sortString(), mRightAddressee.sortString() ) ) - conflictField( KABC::Addressee::sortStringLabel(), mLeftAddressee.sortString(), mRightAddressee.sortString() ); + conflictField( TDEABC::Addressee::sortStringLabel(), mLeftAddressee.sortString(), mRightAddressee.sortString() ); if ( mLeftAddressee.secrecy() != mRightAddressee.secrecy() ) { - conflictField( KABC::Addressee::secrecyLabel(), mLeftAddressee.secrecy().asString(), mRightAddressee.secrecy().asString() ); + conflictField( TDEABC::Addressee::secrecyLabel(), mLeftAddressee.secrecy().asString(), mRightAddressee.secrecy().asString() ); } if ( mLeftAddressee.url()!= mRightAddressee.url() ) - conflictField( KABC::Addressee::urlLabel(), mLeftAddressee.url().prettyURL(), + conflictField( TDEABC::Addressee::urlLabel(), mLeftAddressee.url().prettyURL(), mRightAddressee.url().prettyURL() ); if ( mLeftAddressee.logo() != mRightAddressee.logo() ) { @@ -120,12 +120,12 @@ void AddresseeDiffAlgo::run() end(); } -TQString AddresseeDiffAlgo::toString( const KABC::PhoneNumber &number ) +TQString AddresseeDiffAlgo::toString( const TDEABC::PhoneNumber &number ) { return number.number(); } -TQString AddresseeDiffAlgo::toString( const KABC::Address &addr ) +TQString AddresseeDiffAlgo::toString( const TDEABC::Address &addr ) { return addr.formattedAddress(); } diff --git a/libtdepim/addresseediffalgo.h b/libtdepim/addresseediffalgo.h index 991d46fbd..7b133823d 100644 --- a/libtdepim/addresseediffalgo.h +++ b/libtdepim/addresseediffalgo.h @@ -30,7 +30,7 @@ namespace KPIM { class KDE_EXPORT AddresseeDiffAlgo : public DiffAlgo { public: - AddresseeDiffAlgo( const KABC::Addressee &leftAddressee, const KABC::Addressee &rightAddressee ); + AddresseeDiffAlgo( const TDEABC::Addressee &leftAddressee, const TDEABC::Addressee &rightAddressee ); void run(); @@ -38,11 +38,11 @@ class KDE_EXPORT AddresseeDiffAlgo : public DiffAlgo template <class L> void diffList( const TQString &id, const TQValueList<L> &left, const TQValueList<L> &right ); - TQString toString( const KABC::PhoneNumber &number ); - TQString toString( const KABC::Address &address ); + TQString toString( const TDEABC::PhoneNumber &number ); + TQString toString( const TDEABC::Address &address ); - KABC::Addressee mLeftAddressee; - KABC::Addressee mRightAddressee; + TDEABC::Addressee mLeftAddressee; + TDEABC::Addressee mRightAddressee; }; } diff --git a/libtdepim/addresseeemailselection.cpp b/libtdepim/addresseeemailselection.cpp index 11e9af2c6..4be538e6e 100644 --- a/libtdepim/addresseeemailselection.cpp +++ b/libtdepim/addresseeemailselection.cpp @@ -72,17 +72,17 @@ TQStringList AddresseeEmailSelection::bcc() const return mBccEmailList; } -KABC::Addressee::List AddresseeEmailSelection::toAddresses() const +TDEABC::Addressee::List AddresseeEmailSelection::toAddresses() const { return mToAddresseeList; } -KABC::Addressee::List AddresseeEmailSelection::ccAddresses() const +TDEABC::Addressee::List AddresseeEmailSelection::ccAddresses() const { return mCcAddresseeList; } -KABC::Addressee::List AddresseeEmailSelection::bccAddresses() const +TDEABC::Addressee::List AddresseeEmailSelection::bccAddresses() const { return mBccAddresseeList; } @@ -118,17 +118,17 @@ void AddresseeEmailSelection::setSelectedBCC( const TQStringList &emails ) } -uint AddresseeEmailSelection::itemCount( const KABC::Addressee &addressee ) const +uint AddresseeEmailSelection::itemCount( const TDEABC::Addressee &addressee ) const { return addressee.emails().count(); } -TQString AddresseeEmailSelection::itemText( const KABC::Addressee &addressee, uint index ) const +TQString AddresseeEmailSelection::itemText( const TDEABC::Addressee &addressee, uint index ) const { return addressee.formattedName() + " " + email( addressee, index ); } -TQPixmap AddresseeEmailSelection::itemIcon( const KABC::Addressee &addressee, uint ) const +TQPixmap AddresseeEmailSelection::itemIcon( const TDEABC::Addressee &addressee, uint ) const { if ( !addressee.photo().data().isNull() ) return addressee.photo().data().smoothScale( 16, 16 ); @@ -136,46 +136,46 @@ TQPixmap AddresseeEmailSelection::itemIcon( const KABC::Addressee &addressee, ui return TDEGlobal::iconLoader()->loadIcon( "personal", TDEIcon::Small ); } -bool AddresseeEmailSelection::itemEnabled( const KABC::Addressee &addressee, uint ) const +bool AddresseeEmailSelection::itemEnabled( const TDEABC::Addressee &addressee, uint ) const { return addressee.emails().count() != 0; } -bool AddresseeEmailSelection::itemMatches( const KABC::Addressee &addressee, uint index, const TQString &pattern ) const +bool AddresseeEmailSelection::itemMatches( const TDEABC::Addressee &addressee, uint index, const TQString &pattern ) const { return addressee.formattedName().startsWith( pattern, false ) || email( addressee, index ).startsWith( pattern, false ); } -bool AddresseeEmailSelection::itemEquals( const KABC::Addressee &addressee, uint index, const TQString &pattern ) const +bool AddresseeEmailSelection::itemEquals( const TDEABC::Addressee &addressee, uint index, const TQString &pattern ) const { return (pattern == addressee.formattedName() + " " + email( addressee, index )) || (addressee.emails().contains( pattern )); } -TQString AddresseeEmailSelection::distributionListText( const KABC::DistributionList *distributionList ) const +TQString AddresseeEmailSelection::distributionListText( const TDEABC::DistributionList *distributionList ) const { return distributionList->name(); } -TQPixmap AddresseeEmailSelection::distributionListIcon( const KABC::DistributionList* ) const +TQPixmap AddresseeEmailSelection::distributionListIcon( const TDEABC::DistributionList* ) const { return TDEGlobal::iconLoader()->loadIcon( "tdmconfig", TDEIcon::Small ); } -bool AddresseeEmailSelection::distributionListEnabled( const KABC::DistributionList* ) const +bool AddresseeEmailSelection::distributionListEnabled( const TDEABC::DistributionList* ) const { return true; } -bool AddresseeEmailSelection::distributionListMatches( const KABC::DistributionList *distributionList, +bool AddresseeEmailSelection::distributionListMatches( const TDEABC::DistributionList *distributionList, const TQString &pattern ) const { // check whether the name of the distribution list matches the pattern or one of its entries. bool ok = distributionList->name().startsWith( pattern, false ); - KABC::DistributionList::Entry::List entries = distributionList->entries(); - KABC::DistributionList::Entry::List::ConstIterator it; + TDEABC::DistributionList::Entry::List entries = distributionList->entries(); + TDEABC::DistributionList::Entry::List::ConstIterator it; for ( it = entries.begin(); it != entries.end(); ++it ) { ok = ok || (*it).addressee.formattedName().startsWith( pattern, false ) || (*it).email.startsWith( pattern, false ); @@ -198,17 +198,17 @@ TQString AddresseeEmailSelection::addressBookTitle( uint index ) const return TQString(); } -KABC::Addressee::List AddresseeEmailSelection::addressBookContent( uint index ) const +TDEABC::Addressee::List AddresseeEmailSelection::addressBookContent( uint index ) const { if ( index == 0 ) { TDEConfig config( "kmailrc" ); return RecentAddresses::self( &config )->kabcAddresses(); } else { - return KABC::Addressee::List(); + return TDEABC::Addressee::List(); } } -TQString AddresseeEmailSelection::email( const KABC::Addressee &addressee, uint index ) const +TQString AddresseeEmailSelection::email( const TDEABC::Addressee &addressee, uint index ) const { return addressee.emails()[ index ]; } @@ -217,14 +217,14 @@ void AddresseeEmailSelection::setSelectedItem( uint fieldIndex, const TQStringLi { TQStringList::ConstIterator it; for ( it = emails.begin(); it != emails.end(); ++it ) { - KABC::Addressee addr; + TDEABC::Addressee addr; addr.insertEmail( *it, true ); selector()->setItemSelected( fieldIndex, addr, 0, *it ); } } -void AddresseeEmailSelection::addSelectedAddressees( uint fieldIndex, const KABC::Addressee &addressee, uint itemIndex ) +void AddresseeEmailSelection::addSelectedAddressees( uint fieldIndex, const TDEABC::Addressee &addressee, uint itemIndex ) { switch ( fieldIndex ) { case 0: @@ -245,7 +245,7 @@ void AddresseeEmailSelection::addSelectedAddressees( uint fieldIndex, const KABC } } -void AddresseeEmailSelection::addSelectedDistributionList( uint fieldIndex, const KABC::DistributionList *list ) +void AddresseeEmailSelection::addSelectedDistributionList( uint fieldIndex, const TDEABC::DistributionList *list ) { switch ( fieldIndex ) { case 0: diff --git a/libtdepim/addresseeemailselection.h b/libtdepim/addresseeemailselection.h index 4ecb946e3..f4394a93f 100644 --- a/libtdepim/addresseeemailselection.h +++ b/libtdepim/addresseeemailselection.h @@ -44,52 +44,52 @@ class KDE_EXPORT AddresseeEmailSelection : public Selection /** Returns the number of items for the given addressee. */ - virtual uint itemCount( const KABC::Addressee &addresse ) const; + virtual uint itemCount( const TDEABC::Addressee &addresse ) const; /** Returns the text that's used for the item specified by index. */ - virtual TQString itemText( const KABC::Addressee &addresse, uint index ) const; + virtual TQString itemText( const TDEABC::Addressee &addresse, uint index ) const; /** Returns the icon that's used for the item specified by index. */ - virtual TQPixmap itemIcon( const KABC::Addressee &addresse, uint index ) const; + virtual TQPixmap itemIcon( const TDEABC::Addressee &addresse, uint index ) const; /** Returns whether the item specified by index is enabled. */ - virtual bool itemEnabled( const KABC::Addressee &addresse, uint index ) const; + virtual bool itemEnabled( const TDEABC::Addressee &addresse, uint index ) const; /** Returns whether the item specified by index matches the passed pattern. */ - virtual bool itemMatches( const KABC::Addressee &addresse, uint index, const TQString &pattern ) const; + virtual bool itemMatches( const TDEABC::Addressee &addresse, uint index, const TQString &pattern ) const; /** Returns whether the item specified by index equals the passed pattern. */ - virtual bool itemEquals( const KABC::Addressee &addresse, uint index, const TQString &pattern ) const; + virtual bool itemEquals( const TDEABC::Addressee &addresse, uint index, const TQString &pattern ) const; /** Returns the text that's used for the given distribution list. */ - virtual TQString distributionListText( const KABC::DistributionList *distributionList ) const; + virtual TQString distributionListText( const TDEABC::DistributionList *distributionList ) const; /** Returns the icon that's used for the given distribution list. */ - virtual TQPixmap distributionListIcon( const KABC::DistributionList *distributionList ) const; + virtual TQPixmap distributionListIcon( const TDEABC::DistributionList *distributionList ) const; /** Returns whether the given distribution list is enabled. */ - virtual bool distributionListEnabled( const KABC::DistributionList *distributionList ) const; + virtual bool distributionListEnabled( const TDEABC::DistributionList *distributionList ) const; /** Returns whether the given distribution list matches the passed pattern. */ - virtual bool distributionListMatches( const KABC::DistributionList *distributionList, + virtual bool distributionListMatches( const TDEABC::DistributionList *distributionList, const TQString &pattern ) const; /** @@ -105,15 +105,15 @@ class KDE_EXPORT AddresseeEmailSelection : public Selection /** Returns the content for an additional address book. */ - virtual KABC::Addressee::List addressBookContent( uint index ) const; + virtual TDEABC::Addressee::List addressBookContent( uint index ) const; TQStringList to() const; TQStringList cc() const; TQStringList bcc() const; - KABC::Addressee::List toAddresses() const; - KABC::Addressee::List ccAddresses() const; - KABC::Addressee::List bccAddresses() const; + TDEABC::Addressee::List toAddresses() const; + TDEABC::Addressee::List ccAddresses() const; + TDEABC::Addressee::List bccAddresses() const; TQStringList toDistributionLists() const; TQStringList ccDistributionLists() const; @@ -124,15 +124,15 @@ class KDE_EXPORT AddresseeEmailSelection : public Selection void setSelectedBCC( const TQStringList &emails ); private: - virtual void addSelectedAddressees( uint fieldIndex, const KABC::Addressee&, uint itemIndex ); - virtual void addSelectedDistributionList( uint fieldIndex, const KABC::DistributionList* ); + virtual void addSelectedAddressees( uint fieldIndex, const TDEABC::Addressee&, uint itemIndex ); + virtual void addSelectedDistributionList( uint fieldIndex, const TDEABC::DistributionList* ); - TQString email( const KABC::Addressee&, uint ) const; + TQString email( const TDEABC::Addressee&, uint ) const; void setSelectedItem( uint fieldIndex, const TQStringList& ); - KABC::Addressee::List mToAddresseeList; - KABC::Addressee::List mCcAddresseeList; - KABC::Addressee::List mBccAddresseeList; + TDEABC::Addressee::List mToAddresseeList; + TDEABC::Addressee::List mCcAddresseeList; + TDEABC::Addressee::List mBccAddresseeList; TQStringList mToEmailList; TQStringList mCcEmailList; diff --git a/libtdepim/addresseelineedit.cpp b/libtdepim/addresseelineedit.cpp index 2277182bc..adb3a7300 100644 --- a/libtdepim/addresseelineedit.cpp +++ b/libtdepim/addresseelineedit.cpp @@ -555,16 +555,16 @@ void AddresseeLineEdit::loadContacts() TDEConfig config( "kpimcompletionorder" ); // The weights for non-imap kabc resources is there. config.setGroup( "CompletionWeights" ); - KABC::AddressBook *addressBook = KABC::StdAddressBook::self( true ); + TDEABC::AddressBook *addressBook = TDEABC::StdAddressBook::self( true ); // Can't just use the addressbook's iterator, we need to know which subresource // is behind which contact. - TQPtrList<KABC::Resource> resources( addressBook->resources() ); - for( TQPtrListIterator<KABC::Resource> resit( resources ); *resit; ++resit ) { - KABC::Resource* resource = *resit; + TQPtrList<TDEABC::Resource> resources( addressBook->resources() ); + for( TQPtrListIterator<TDEABC::Resource> resit( resources ); *resit; ++resit ) { + TDEABC::Resource* resource = *resit; KPIM::ResourceABC* resabc = dynamic_cast<ResourceABC *>( resource ); if ( resabc ) { // IMAP KABC resource; need to associate each contact with the subresource const TQMap<TQString, TQString> uidToResourceMap = resabc->uidToResourceMap(); - KABC::Resource::Iterator it; + TDEABC::Resource::Iterator it; for ( it = resource->begin(); it != resource->end(); ++it ) { TQString uid = (*it).uid(); TQMap<TQString, TQString>::const_iterator wit = uidToResourceMap.find( uid ); @@ -578,7 +578,7 @@ void AddresseeLineEdit::loadContacts() } else { // KABC non-imap resource int weight = config.readNumEntry( resource->identifier(), 60 ); int sourceIndex = addCompletionSource( resource->resourceName(), weight ); - KABC::Resource::Iterator it; + TDEABC::Resource::Iterator it; for ( it = resource->begin(); it != resource->end(); ++it ) { addContact( *it, weight, sourceIndex ); } @@ -587,7 +587,7 @@ void AddresseeLineEdit::loadContacts() #ifndef TDEPIM_NEW_DISTRLISTS // new distr lists are normal contact, already done above int weight = config.readNumEntry( "DistributionLists", 60 ); - KABC::DistributionListManager manager( addressBook ); + TDEABC::DistributionListManager manager( addressBook ); manager.load(); const TQStringList distLists = manager.listNames(); TQStringList::const_iterator listIt; @@ -612,7 +612,7 @@ void AddresseeLineEdit::loadContacts() } } -void AddresseeLineEdit::addContact( const KABC::Addressee& addr, int weight, int source ) +void AddresseeLineEdit::addContact( const TDEABC::Addressee& addr, int weight, int source ) { #ifdef TDEPIM_NEW_DISTRLISTS if ( KPIM::DistributionList::isDistributionList( addr ) ) { @@ -817,7 +817,7 @@ void AddresseeLineEdit::slotLDAPSearchData( const KPIM::LdapResultList& adrs ) return; for ( KPIM::LdapResultList::ConstIterator it = adrs.begin(); it != adrs.end(); ++it ) { - KABC::Addressee addr; + TDEABC::Addressee addr; addr.setNameFromString( (*it).name ); addr.setEmails( (*it).email ); diff --git a/libtdepim/addresseelineedit.h b/libtdepim/addresseelineedit.h index 169d807e0..278c8e087 100644 --- a/libtdepim/addresseelineedit.h +++ b/libtdepim/addresseelineedit.h @@ -79,7 +79,7 @@ class KDE_EXPORT AddresseeLineEdit : public ClickLineEdit, public DCOPObject protected slots: virtual void loadContacts(); protected: - void addContact( const KABC::Addressee&, int weight, int source = -1 ); + void addContact( const TDEABC::Addressee&, int weight, int source = -1 ); virtual void keyPressEvent( TQKeyEvent* ); /** * Reimplemented for smart insertion of email addresses. @@ -148,7 +148,7 @@ class KDE_EXPORT AddresseeLineEdit : public ClickLineEdit, public DCOPObject bool m_useSemiColonAsSeparator; bool m_allowDistLists; - //TQMap<TQString, KABC::Addressee> m_contactMap; + //TQMap<TQString, TDEABC::Addressee> m_contactMap; static bool s_addressesDirty; static KMailCompletion *s_completion; diff --git a/libtdepim/addresseeselector.cpp b/libtdepim/addresseeselector.cpp index 30288d0aa..2234b9a75 100644 --- a/libtdepim/addresseeselector.cpp +++ b/libtdepim/addresseeselector.cpp @@ -43,7 +43,7 @@ class AddresseeSelector::AddressBookManager public: TQStringList titles() const; - void addResource( KABC::Resource* ); + void addResource( TDEABC::Resource* ); void addAddressBook( const TQString &title, SelectionItem::List &list ); void clear(); @@ -55,7 +55,7 @@ class AddresseeSelector::AddressBookManager SelectionItem::List list; }; - TQValueList<KABC::Resource*> mResources; + TQValueList<TDEABC::Resource*> mResources; TQValueList<AddressBookEntry> mAddressBooks; }; @@ -66,7 +66,7 @@ TQStringList AddresseeSelector::AddressBookManager::titles() const // we've always an 'all' entry titles.append( i18n( "All" ) ); - TQValueList<KABC::Resource*>::ConstIterator resIt; + TQValueList<TDEABC::Resource*>::ConstIterator resIt; for ( resIt = mResources.begin(); resIt != mResources.end(); ++resIt ) titles.append( (*resIt)->resourceName() ); @@ -77,7 +77,7 @@ TQStringList AddresseeSelector::AddressBookManager::titles() const return titles; } -void AddresseeSelector::AddressBookManager::addResource( KABC::Resource *resource ) +void AddresseeSelector::AddressBookManager::addResource( TDEABC::Resource *resource ) { if ( mResources.find( resource ) == mResources.end() ) mResources.append( resource ); @@ -135,13 +135,13 @@ bool AddresseeSelector::AddressBookManager::contains( uint index, const Selectio } -SelectionItem::SelectionItem( const KABC::Addressee &addressee, uint index ) +SelectionItem::SelectionItem( const TDEABC::Addressee &addressee, uint index ) : mAddressee( addressee ), mDistributionList( 0 ), mIndex( index ) { mField.fill( false, 10 ); } -SelectionItem::SelectionItem( KABC::DistributionList *list, uint index ) +SelectionItem::SelectionItem( TDEABC::DistributionList *list, uint index ) : mDistributionList( list ), mIndex( index ) { mField.fill( false, 10 ); @@ -168,12 +168,12 @@ bool SelectionItem::isInField( int index ) return mField.testBit( index ); } -KABC::Addressee SelectionItem::addressee() const +TDEABC::Addressee SelectionItem::addressee() const { return mAddressee; } -KABC::DistributionList* SelectionItem::distributionList() const +TDEABC::DistributionList* SelectionItem::distributionList() const { return mDistributionList; } @@ -250,7 +250,7 @@ AddresseeSelector::~AddresseeSelector() void AddresseeSelector::init() { - connect( KABC::StdAddressBook::self( true ), TQT_SIGNAL( addressBookChanged( AddressBook* ) ), + connect( TDEABC::StdAddressBook::self( true ), TQT_SIGNAL( addressBookChanged( AddressBook* ) ), this, TQT_SLOT( reloadAddressBook() ) ); connect( mAddresseeFilter, TQT_SIGNAL( textChanged( const TQString& ) ), this, TQT_SLOT( updateAddresseeView() ) ); @@ -400,7 +400,7 @@ void AddresseeSelector::remove( int index ) } } -void AddresseeSelector::setItemSelected( uint fieldIndex, const KABC::Addressee &addr, uint itemIndex ) +void AddresseeSelector::setItemSelected( uint fieldIndex, const TDEABC::Addressee &addr, uint itemIndex ) { bool found = false; @@ -422,7 +422,7 @@ void AddresseeSelector::setItemSelected( uint fieldIndex, const KABC::Addressee updateSelectionView( fieldIndex ); } -void AddresseeSelector::setItemSelected( uint fieldIndex, const KABC::Addressee &addr, +void AddresseeSelector::setItemSelected( uint fieldIndex, const TDEABC::Addressee &addr, uint itemIndex, const TQString &text ) { bool found = false; @@ -466,8 +466,8 @@ void AddresseeSelector::updateSelectionViews() void AddresseeSelector::reloadAddressBook() { // load contacts - KABC::Addressee::List list = KABC::StdAddressBook::self( true )->allAddressees(); - KABC::Addressee::List::Iterator it; + TDEABC::Addressee::List list = TDEABC::StdAddressBook::self( true )->allAddressees(); + TDEABC::Addressee::List::Iterator it; SelectionItem::List selectedItems; @@ -510,7 +510,7 @@ void AddresseeSelector::reloadAddressBook() // load distribution lists delete mManager; - mManager = new KABC::DistributionListManager( KABC::StdAddressBook::self( true ) ); + mManager = new TDEABC::DistributionListManager( TDEABC::StdAddressBook::self( true ) ); mManager->load(); @@ -518,7 +518,7 @@ void AddresseeSelector::reloadAddressBook() TQStringList::Iterator listIt; for ( listIt = lists.begin(); listIt != lists.end(); ++listIt ) { - KABC::DistributionList *list = mManager->list( *listIt ); + TDEABC::DistributionList *list = mManager->list( *listIt ); SelectionItem item( list, 0 ); mSelectionItems.append( item ); } @@ -528,8 +528,8 @@ void AddresseeSelector::reloadAddressBook() // update address book combo mAddressBookCombo->clear(); - TQPtrList<KABC::Resource> resources = KABC::StdAddressBook::self( true )->resources(); - TQPtrListIterator<KABC::Resource> resIt( resources ); + TQPtrList<TDEABC::Resource> resources = TDEABC::StdAddressBook::self( true )->resources(); + TQPtrListIterator<TDEABC::Resource> resIt( resources ); while ( resIt.current() ) { if ( resIt.current()->isActive() ) mAddressBookManager->addResource( resIt ); @@ -540,7 +540,7 @@ void AddresseeSelector::reloadAddressBook() for ( uint i = 0; i < mSelection->addressBookCount(); ++i ) { SelectionItem::List itemList; - KABC::Addressee::List addrList = mSelection->addressBookContent( i ); + TDEABC::Addressee::List addrList = mSelection->addressBookContent( i ); for ( it = addrList.begin(); it != addrList.end(); ++it ) { uint itemCount = mSelection->itemCount( *it ); for ( uint index = 0; index < itemCount; ++index ) { diff --git a/libtdepim/addresseeselector.h b/libtdepim/addresseeselector.h index 92c544789..2fa40f4e4 100644 --- a/libtdepim/addresseeselector.h +++ b/libtdepim/addresseeselector.h @@ -61,52 +61,52 @@ class KDE_EXPORT Selection /** Returns the number of items for the given addressee. */ - virtual uint itemCount( const KABC::Addressee &addresse ) const = 0; + virtual uint itemCount( const TDEABC::Addressee &addresse ) const = 0; /** Returns the text that's used for the item specified by index. */ - virtual TQString itemText( const KABC::Addressee &addresse, uint index ) const = 0; + virtual TQString itemText( const TDEABC::Addressee &addresse, uint index ) const = 0; /** Returns the icon that's used for the item specified by index. */ - virtual TQPixmap itemIcon( const KABC::Addressee &addresse, uint index ) const = 0; + virtual TQPixmap itemIcon( const TDEABC::Addressee &addresse, uint index ) const = 0; /** Returns whether the item specified by index is enabled. */ - virtual bool itemEnabled( const KABC::Addressee &addresse, uint index ) const = 0; + virtual bool itemEnabled( const TDEABC::Addressee &addresse, uint index ) const = 0; /** Returns whether the item specified by index matches the passed pattern. */ - virtual bool itemMatches( const KABC::Addressee &addresse, uint index, const TQString &pattern ) const = 0; + virtual bool itemMatches( const TDEABC::Addressee &addresse, uint index, const TQString &pattern ) const = 0; /** Returns whether the item specified by index equals the passed pattern. */ - virtual bool itemEquals( const KABC::Addressee &addresse, uint index, const TQString &pattern ) const = 0; + virtual bool itemEquals( const TDEABC::Addressee &addresse, uint index, const TQString &pattern ) const = 0; /** Returns the text that's used for the given distribution list. */ - virtual TQString distributionListText( const KABC::DistributionList *distributionList ) const = 0; + virtual TQString distributionListText( const TDEABC::DistributionList *distributionList ) const = 0; /** Returns the icon that's used for the given distribution list. */ - virtual TQPixmap distributionListIcon( const KABC::DistributionList *distributionList ) const = 0; + virtual TQPixmap distributionListIcon( const TDEABC::DistributionList *distributionList ) const = 0; /** Returns whether the given distribution list is enabled. */ - virtual bool distributionListEnabled( const KABC::DistributionList *distributionList ) const = 0; + virtual bool distributionListEnabled( const TDEABC::DistributionList *distributionList ) const = 0; /** Returns whether the given distribution list matches the passed pattern. */ - virtual bool distributionListMatches( const KABC::DistributionList *distributionList, + virtual bool distributionListMatches( const TDEABC::DistributionList *distributionList, const TQString &pattern ) const = 0; /** @@ -122,14 +122,14 @@ class KDE_EXPORT Selection /** Returns the content for an additional address book. */ - virtual KABC::Addressee::List addressBookContent( uint index ) const = 0; + virtual TDEABC::Addressee::List addressBookContent( uint index ) const = 0; protected: AddresseeSelector* selector() { return mSelector; } private: - virtual void addSelectedAddressees( uint fieldIndex, const KABC::Addressee&, uint itemIndex ) = 0; - virtual void addSelectedDistributionList( uint fieldIndex, const KABC::DistributionList* ) = 0; + virtual void addSelectedAddressees( uint fieldIndex, const TDEABC::Addressee&, uint itemIndex ) = 0; + virtual void addSelectedDistributionList( uint fieldIndex, const TDEABC::DistributionList* ) = 0; void setSelector( AddresseeSelector *selector ) { mSelector = selector; } @@ -144,21 +144,21 @@ class SelectionItem public: typedef TQValueList<SelectionItem> List; - SelectionItem( const KABC::Addressee &addressee, uint index ); - SelectionItem( KABC::DistributionList *list, uint index ); + SelectionItem( const TDEABC::Addressee &addressee, uint index ); + SelectionItem( TDEABC::DistributionList *list, uint index ); SelectionItem(); void addToField( int index ); void removeFromField( int index ); bool isInField( int index ); - KABC::Addressee addressee() const; - KABC::DistributionList* distributionList() const; + TDEABC::Addressee addressee() const; + TDEABC::DistributionList* distributionList() const; uint index() const; private: - KABC::Addressee mAddressee; - KABC::DistributionList *mDistributionList; + TDEABC::Addressee mAddressee; + TDEABC::DistributionList *mDistributionList; uint mIndex; TQBitArray mField; }; @@ -178,8 +178,8 @@ class KDE_EXPORT AddresseeSelector : public TQWidget */ void finish(); - void setItemSelected( uint fieldIndex, const KABC::Addressee&, uint itemIndex ); - void setItemSelected( uint fieldIndex, const KABC::Addressee&, + void setItemSelected( uint fieldIndex, const TDEABC::Addressee&, uint itemIndex ); + void setItemSelected( uint fieldIndex, const TDEABC::Addressee&, uint itemIndex, const TQString& ); private slots: @@ -207,7 +207,7 @@ class KDE_EXPORT AddresseeSelector : public TQWidget TQSignalMapper *mMoveMapper; TQSignalMapper *mRemoveMapper; - KABC::DistributionListManager *mManager; + TDEABC::DistributionListManager *mManager; class AddressBookManager; AddressBookManager *mAddressBookManager; diff --git a/libtdepim/addresseeview.cpp b/libtdepim/addresseeview.cpp index aebb108cd..29cbf1c2b 100644 --- a/libtdepim/addresseeview.cpp +++ b/libtdepim/addresseeview.cpp @@ -129,7 +129,7 @@ AddresseeView::~AddresseeView() mKIMProxy = 0; } -void AddresseeView::setAddressee( const KABC::Addressee& addr ) +void AddresseeView::setAddressee( const TDEABC::Addressee& addr ) { mAddressee = addr; @@ -148,7 +148,7 @@ void AddresseeView::enableLinks( int linkMask ) mLinkMask = linkMask; } -TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *proxy, LinkMask linkMask, +TQString AddresseeView::vCardAsHTML( const TDEABC::Addressee& addr, ::KIMProxy *proxy, LinkMask linkMask, bool internalLoading, FieldMask fieldMask ) { TQString image = TQString( "contact_%1_image" ).arg( addr.uid() ); @@ -201,7 +201,7 @@ TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pr if ( !internalLoading ) { - KABC::Picture pic = addr.photo(); + TDEABC::Picture pic = addr.photo(); if ( pic.isIntern() && !pic.data().isNull() ) { image = pixmapAsDataUrl( pic.data() ); } else if ( !pic.url().isEmpty() ) { @@ -216,25 +216,25 @@ TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pr if ( date.isValid() ) dynamicPart += rowFmtStr - .arg( KABC::Addressee::birthdayLabel() ) + .arg( TDEABC::Addressee::birthdayLabel() ) .arg( TDEGlobal::locale()->formatDate( date, true ) ); } if ( fieldMask & PhoneFields ) { - KABC::PhoneNumber::List phones = addr.phoneNumbers(); - KABC::PhoneNumber::List::ConstIterator phoneIt; + TDEABC::PhoneNumber::List phones = addr.phoneNumbers(); + TDEABC::PhoneNumber::List::ConstIterator phoneIt; for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) { TQString number = TQStyleSheet::escape( (*phoneIt).number() ); TQString url; - if ( (*phoneIt).type() & KABC::PhoneNumber::Fax ) + if ( (*phoneIt).type() & TDEABC::PhoneNumber::Fax ) url = TQString::fromLatin1( "fax:" ) + number; else url = TQString::fromLatin1( "phone:" ) + number; if ( linkMask & PhoneLinks ) { TQString smsURL; - if ( (*phoneIt).type() & KABC::PhoneNumber::Cell ) + if ( (*phoneIt).type() & TDEABC::PhoneNumber::Cell ) smsURL = TQString(" (<a href=\"sms:%1\">%2</a>)" ).arg( number ).arg( i18n( "SMS") ); dynamicPart += rowFmtStr @@ -289,8 +289,8 @@ TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pr } if ( fieldMask & AddressFields ) { - KABC::Address::List addresses = addr.addresses(); - KABC::Address::List::ConstIterator addrIt; + TDEABC::Address::List addresses = addr.addresses(); + TDEABC::Address::List::ConstIterator addrIt; for ( addrIt = addresses.begin(); addrIt != addresses.end(); ++addrIt ) { if ( (*addrIt).label().isEmpty() ) { TQString formattedAddress; @@ -303,11 +303,11 @@ TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pr if ( linkMask & AddressLinks ) { dynamicPart += rowFmtStr - .arg( KABC::Address::typeLabel( (*addrIt).type() ) ) + .arg( TDEABC::Address::typeLabel( (*addrIt).type() ) ) .arg( link ); } else { dynamicPart += rowFmtStr - .arg( KABC::Address::typeLabel( (*addrIt).type() ) ) + .arg( TDEABC::Address::typeLabel( (*addrIt).type() ) ) .arg( formattedAddress ); } } else { @@ -316,11 +316,11 @@ TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pr if ( linkMask & AddressLinks ) { dynamicPart += rowFmtStr - .arg( KABC::Address::typeLabel( (*addrIt).type() ) ) + .arg( TDEABC::Address::typeLabel( (*addrIt).type() ) ) .arg( link ); } else { dynamicPart += rowFmtStr - .arg( KABC::Address::typeLabel( (*addrIt).type() ) ) + .arg( TDEABC::Address::typeLabel( (*addrIt).type() ) ) .arg( (*addrIt).label().replace( '\n', "<br>" ) ); } } @@ -538,7 +538,7 @@ void AddresseeView::updateView() TQString imageURL = TQString( "contact_%1_image" ).arg( mAddressee.uid() ); - KABC::Picture picture = mAddressee.photo(); + TDEABC::Picture picture = mAddressee.photo(); if ( picture.isIntern() && !picture.data().isNull() ) TQMimeSourceFactory::defaultFactory()->setImage( imageURL, picture.data() ); else { @@ -562,7 +562,7 @@ void AddresseeView::updateView() setText( strAddr ); } -KABC::Addressee AddresseeView::addressee() const +TDEABC::Addressee AddresseeView::addressee() const { return mAddressee; } diff --git a/libtdepim/addresseeview.h b/libtdepim/addresseeview.h index af7ee4b19..fd8c900b6 100644 --- a/libtdepim/addresseeview.h +++ b/libtdepim/addresseeview.h @@ -61,12 +61,12 @@ class KDE_EXPORT AddresseeView : public KTextBrowser @param addr The addressee object. */ - void setAddressee( const KABC::Addressee& addr ); + void setAddressee( const TDEABC::Addressee& addr ); /** Returns the current addressee object. */ - KABC::Addressee addressee() const; + TDEABC::Addressee addressee() const; /** @@ -128,7 +128,7 @@ class KDE_EXPORT AddresseeView : public KTextBrowser @param fieldMask The mask for which fields of the contact will be displayed. */ - static TQString vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *proxy, LinkMask linkMask = DefaultLinks, + static TQString vCardAsHTML( const TDEABC::Addressee& addr, ::KIMProxy *proxy, LinkMask linkMask = DefaultLinks, bool internalLoading = true, FieldMask fieldMask = DefaultFields ); /** @@ -192,7 +192,7 @@ class KDE_EXPORT AddresseeView : public KTextBrowser TDEToggleAction *mActionShowIMAddresses; TDEToggleAction *mActionShowCustomFields; - KABC::Addressee mAddressee; + TDEABC::Addressee mAddressee; int mLinkMask; class AddresseeViewPrivate; diff --git a/libtdepim/addressesdialog.cpp b/libtdepim/addressesdialog.cpp index aa52f4625..3083cdf46 100644 --- a/libtdepim/addressesdialog.cpp +++ b/libtdepim/addressesdialog.cpp @@ -61,9 +61,9 @@ namespace KPIM { // private start : struct AddresseeViewItem::AddresseeViewItemPrivate { - KABC::Addressee address; + TDEABC::Addressee address; AddresseeViewItem::Category category; - KABC::Addressee::List addresses; + TDEABC::Addressee::List addresses; }; struct AddressesDialog::AddressesDialogPrivate { @@ -86,12 +86,12 @@ struct AddressesDialog::AddressesDialogPrivate { TQDict<AddresseeViewItem> groupDict; - KABC::Addressee::List recentAddresses; + TDEABC::Addressee::List recentAddresses; LDAPSearchDialog *ldapSearchDialog; }; // privates end -AddresseeViewItem::AddresseeViewItem( AddresseeViewItem *parent, const KABC::Addressee& addr, +AddresseeViewItem::AddresseeViewItem( AddresseeViewItem *parent, const TDEABC::Addressee& addr, int emailIndex ) : TQObject( 0 ), TDEListViewItem( parent, addr.realName(), ( emailIndex == 0 ? addr.preferredEmail() : addr.emails()[ emailIndex ] ) ) @@ -121,7 +121,7 @@ AddresseeViewItem::AddresseeViewItem( TDEListView *lv, const TQString& name, Cat } AddresseeViewItem::AddresseeViewItem( AddresseeViewItem *parent, const TQString& name, - const KABC::Addressee::List &lst ) + const TDEABC::Addressee::List &lst ) : TQObject(0), TDEListViewItem( parent, name, i18n("<group>") ) { d = new AddresseeViewItemPrivate; @@ -144,13 +144,13 @@ AddresseeViewItem::~AddresseeViewItem() d = 0; } -KABC::Addressee +TDEABC::Addressee AddresseeViewItem::addressee() const { return d->address; } -KABC::Addressee::List +TDEABC::Addressee::List AddresseeViewItem::addresses() const { return d->addresses; @@ -220,7 +220,7 @@ AddressesDialog::AddressesDialog( TQWidget *widget, const char *name ) d = new AddressesDialogPrivate; d->ui = new AddressPickerUI( page ); - KABC::StdAddressBook::self( true ); + TDEABC::StdAddressBook::self( true ); updateAvailableAddressees(); initConnections(); @@ -274,8 +274,8 @@ AddressesDialog::setSelectedTo( const TQStringList& l ) { TQString name, email; for ( TQStringList::ConstIterator it = l.begin(); it != l.end(); ++it ) { - KABC::Addressee addr; - KABC::Addressee::parseEmailAddress( *it, name, email ); + TDEABC::Addressee addr; + TDEABC::Addressee::parseEmailAddress( *it, name, email ); addr.setNameFromString( name ); addr.insertEmail( email ); addAddresseeToSelected( addr, selectedToItem() ); @@ -287,8 +287,8 @@ AddressesDialog::setSelectedCC( const TQStringList& l ) { TQString name, email; for ( TQStringList::ConstIterator it = l.begin(); it != l.end(); ++it ) { - KABC::Addressee addr; - KABC::Addressee::parseEmailAddress( *it, name, email ); + TDEABC::Addressee addr; + TDEABC::Addressee::parseEmailAddress( *it, name, email ); addr.setNameFromString( name ); addr.insertEmail( email ); addAddresseeToSelected( addr, selectedCcItem() ); @@ -300,8 +300,8 @@ AddressesDialog::setSelectedBCC( const TQStringList& l ) { TQString name, email; for ( TQStringList::ConstIterator it = l.begin(); it != l.end(); ++it ) { - KABC::Addressee addr; - KABC::Addressee::parseEmailAddress( *it, name, email ); + TDEABC::Addressee addr; + TDEABC::Addressee::parseEmailAddress( *it, name, email ); addr.setNameFromString( name ); addr.insertEmail( email ); addAddresseeToSelected( addr, selectedBccItem() ); @@ -309,7 +309,7 @@ AddressesDialog::setSelectedBCC( const TQStringList& l ) } void -AddressesDialog::setRecentAddresses( const KABC::Addressee::List& list ) +AddressesDialog::setRecentAddresses( const TDEABC::Addressee::List& list ) { d->recentAddresses = list; @@ -331,7 +331,7 @@ AddressesDialog::updateRecentAddresses() d->groupDict.insert( recentGroup, d->recent ); } - KABC::Addressee::List::ConstIterator it; + TDEABC::Addressee::List::ConstIterator it; for ( it = d->recentAddresses.begin(); it != d->recentAddresses.end(); ++it ) addAddresseeToAvailable( *it, d->recent ); @@ -357,7 +357,7 @@ TQStringList AddressesDialog::to() const { TQStringList emails = allDistributionLists( d->toItem ); - KABC::Addressee::List l = toAddresses(); + TDEABC::Addressee::List l = toAddresses(); emails += entryToString( l ); return emails; @@ -367,7 +367,7 @@ TQStringList AddressesDialog::cc() const { TQStringList emails = allDistributionLists( d->ccItem ); - KABC::Addressee::List l = ccAddresses(); + TDEABC::Addressee::List l = ccAddresses(); emails += entryToString( l ); return emails; @@ -378,43 +378,43 @@ AddressesDialog::bcc() const { TQStringList emails = allDistributionLists( d->bccItem ); - KABC::Addressee::List l = bccAddresses(); + TDEABC::Addressee::List l = bccAddresses(); emails += entryToString( l ); return emails; } -KABC::Addressee::List +TDEABC::Addressee::List AddressesDialog::toAddresses() const { return allAddressee( d->toItem ); } -KABC::Addressee::List +TDEABC::Addressee::List AddressesDialog::allToAddressesNoDuplicates() const { - KABC::Addressee::List aList = allAddressee( d->toItem ); + TDEABC::Addressee::List aList = allAddressee( d->toItem ); const TQStringList dList = toDistributionLists(); - KABC::AddressBook* abook = KABC::StdAddressBook::self( true ); + TDEABC::AddressBook* abook = TDEABC::StdAddressBook::self( true ); #ifdef TDEPIM_NEW_DISTRLISTS for ( TQStringList::ConstIterator it = dList.begin(); it != dList.end(); ++it ) { const TQValueList<KPIM::DistributionList::Entry> eList = KPIM::DistributionList::findByName(abook, *it).entries(abook); TQValueList<KPIM::DistributionList::Entry>::ConstIterator eit; for( eit = eList.begin(); eit != eList.end(); ++eit ) { - KABC::Addressee a = (*eit).addressee; + TDEABC::Addressee a = (*eit).addressee; if ( !a.preferredEmail().isEmpty() && aList.find( a ) == aList.end() ) { aList.append( a ) ; } } } #else - KABC::DistributionListManager manager( abook ); + TDEABC::DistributionListManager manager( abook ); manager.load(); for ( TQStringList::ConstIterator it = dList.begin(); it != dList.end(); ++it ) { - const TQValueList<KABC::DistributionList::Entry> eList = manager.list( *it )->entries(); - TQValueList<KABC::DistributionList::Entry>::ConstIterator eit; + const TQValueList<TDEABC::DistributionList::Entry> eList = manager.list( *it )->entries(); + TQValueList<TDEABC::DistributionList::Entry>::ConstIterator eit; for( eit = eList.begin(); eit != eList.end(); ++eit ) { - KABC::Addressee a = (*eit).addressee; + TDEABC::Addressee a = (*eit).addressee; if ( !a.preferredEmail().isEmpty() && aList.find( a ) == aList.end() ) { aList.append( a ) ; } @@ -424,13 +424,13 @@ AddressesDialog::allToAddressesNoDuplicates() const return aList; } -KABC::Addressee::List +TDEABC::Addressee::List AddressesDialog::ccAddresses() const { return allAddressee( d->ccItem ); } -KABC::Addressee::List +TDEABC::Addressee::List AddressesDialog::bccAddresses() const { return allAddressee( d->bccItem ); @@ -469,8 +469,8 @@ AddressesDialog::updateAvailableAddressees() d->personal->setVisible( false ); d->groupDict.insert( personalGroup, d->personal ); - KABC::AddressBook *addressBook = KABC::StdAddressBook::self( true ); - for( KABC::AddressBook::Iterator it = addressBook->begin(); + TDEABC::AddressBook *addressBook = TDEABC::StdAddressBook::self( true ); + for( TDEABC::AddressBook::Iterator it = addressBook->begin(); it != addressBook->end(); ++it ) { addAddresseeToAvailable( *it, d->personal ); } @@ -594,16 +594,16 @@ AddressesDialog::initConnections() TQT_SLOT(removeEntry()) ); #ifndef TDEPIM_NEW_DISTRLISTS - connect( KABC::DistributionListWatcher::self(), TQT_SIGNAL( changed() ), + connect( TDEABC::DistributionListWatcher::self(), TQT_SIGNAL( changed() ), this, TQT_SLOT( updateAvailableAddressees() ) ); #endif - connect( KABC::StdAddressBook::self( true ), TQT_SIGNAL( addressBookChanged(AddressBook*) ), + connect( TDEABC::StdAddressBook::self( true ), TQT_SIGNAL( addressBookChanged(AddressBook*) ), this, TQT_SLOT( updateAvailableAddressees() ) ); } void -AddressesDialog::addAddresseeToAvailable( const KABC::Addressee& addr, AddresseeViewItem* defaultParent, bool useCategory ) +AddressesDialog::addAddresseeToAvailable( const TDEABC::Addressee& addr, AddresseeViewItem* defaultParent, bool useCategory ) { if ( addr.preferredEmail().isEmpty() ) return; @@ -640,7 +640,7 @@ AddressesDialog::addAddresseeToAvailable( const KABC::Addressee& addr, Addressee } void -AddressesDialog::addAddresseeToSelected( const KABC::Addressee& addr, AddresseeViewItem* defaultParent ) +AddressesDialog::addAddresseeToSelected( const TDEABC::Addressee& addr, AddresseeViewItem* defaultParent ) { if ( addr.preferredEmail().isEmpty() ) return; @@ -709,11 +709,11 @@ AddressesDialog::addAddresseesToSelected( AddresseeViewItem *parent, } TQStringList -AddressesDialog::entryToString( const KABC::Addressee::List& l ) const +AddressesDialog::entryToString( const TDEABC::Addressee::List& l ) const { TQStringList entries; - for( KABC::Addressee::List::ConstIterator it = l.begin(); it != l.end(); ++it ) { + for( TDEABC::Addressee::List::ConstIterator it = l.begin(); it != l.end(); ++it ) { entries += (*it).fullEmail(); } return entries; @@ -854,13 +854,13 @@ AddressesDialog::removeEntry() // copied from kabcore.cpp :( // KDE4: should be in libkabc I think -static KABC::Resource *requestResource( KABC::AddressBook* abook, TQWidget *parent ) +static TDEABC::Resource *requestResource( TDEABC::AddressBook* abook, TQWidget *parent ) { - TQPtrList<KABC::Resource> kabcResources = abook->resources(); + TQPtrList<TDEABC::Resource> kabcResources = abook->resources(); TQPtrList<KRES::Resource> kresResources; - TQPtrListIterator<KABC::Resource> resIt( kabcResources ); - KABC::Resource *resource; + TQPtrListIterator<TDEABC::Resource> resIt( kabcResources ); + TDEABC::Resource *resource; while ( ( resource = resIt.current() ) != 0 ) { ++resIt; if ( !resource->readOnly() ) { @@ -871,7 +871,7 @@ static KABC::Resource *requestResource( KABC::AddressBook* abook, TQWidget *pare } KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent ); - return static_cast<KABC::Resource*>( res ); + return static_cast<TDEABC::Resource*>( res ); } #endif @@ -879,7 +879,7 @@ void AddressesDialog::saveAs() { #ifndef TDEPIM_NEW_DISTRLISTS - KABC::DistributionListManager manager( KABC::StdAddressBook::self( true ) ); + TDEABC::DistributionListManager manager( TDEABC::StdAddressBook::self( true ) ); manager.load(); #endif @@ -901,7 +901,7 @@ AddressesDialog::saveAs() bool alreadyExists = false; #ifdef TDEPIM_NEW_DISTRLISTS - KABC::AddressBook* abook = KABC::StdAddressBook::self( true ); + TDEABC::AddressBook* abook = TDEABC::StdAddressBook::self( true ); KPIM::DistributionList dlist = KPIM::DistributionList::findByName( abook, name ); alreadyExists = !dlist.isEmpty(); #else @@ -917,22 +917,22 @@ AddressesDialog::saveAs() } #ifdef TDEPIM_NEW_DISTRLISTS - KABC::Resource* resource = requestResource( abook, this ); + TDEABC::Resource* resource = requestResource( abook, this ); if ( !resource ) return; dlist.setResource( resource ); dlist.setName( name ); - KABC::Addressee::List addrl = allAddressee( d->ui->mSelectedView, false ); - for ( KABC::Addressee::List::iterator itr = addrl.begin(); + TDEABC::Addressee::List addrl = allAddressee( d->ui->mSelectedView, false ); + for ( TDEABC::Addressee::List::iterator itr = addrl.begin(); itr != addrl.end(); ++itr ) { dlist.insertEntry( *itr ); } abook->insertAddressee( dlist ); #else - KABC::DistributionList *dlist = new KABC::DistributionList( &manager, name ); - KABC::Addressee::List addrl = allAddressee( d->ui->mSelectedView, false ); - for ( KABC::Addressee::List::iterator itr = addrl.begin(); + TDEABC::DistributionList *dlist = new TDEABC::DistributionList( &manager, name ); + TDEABC::Addressee::List addrl = allAddressee( d->ui->mSelectedView, false ); + for ( TDEABC::Addressee::List::iterator itr = addrl.begin(); itr != addrl.end(); ++itr ) { dlist->insertEntry( *itr ); } @@ -962,7 +962,7 @@ AddressesDialog::ldapSearchResult() TQString name; TQString email; KPIM::getNameAndMail( (*it), name, email ); - KABC::Addressee ad; + TDEABC::Addressee ad; ad.setNameFromString( name ); ad.insertEmail( email ); addAddresseeToSelected( ad, selectedToItem() ); @@ -1062,10 +1062,10 @@ AddressesDialog::filterChanged( const TQString& txt ) } } -KABC::Addressee::List +TDEABC::Addressee::List AddressesDialog::allAddressee( TDEListView* view, bool onlySelected ) const { - KABC::Addressee::List lst; + TDEABC::Addressee::List lst; TQListViewItemIterator it( view ); while ( it.current() ) { AddresseeViewItem* item = static_cast<AddresseeViewItem*>( it.current() ); @@ -1086,10 +1086,10 @@ AddressesDialog::allAddressee( TDEListView* view, bool onlySelected ) const return lst; } -KABC::Addressee::List +TDEABC::Addressee::List AddressesDialog::allAddressee( AddresseeViewItem* parent ) const { - KABC::Addressee::List lst; + TDEABC::Addressee::List lst; if ( !parent ) return lst; @@ -1133,13 +1133,13 @@ AddressesDialog::allDistributionLists( AddresseeViewItem* parent ) const void AddressesDialog::addDistributionLists() { - KABC::AddressBook* abook = KABC::StdAddressBook::self( true ); + TDEABC::AddressBook* abook = TDEABC::StdAddressBook::self( true ); #ifdef TDEPIM_NEW_DISTRLISTS const TQValueList<KPIM::DistributionList> distLists = KPIM::DistributionList::allDistributionLists( abook ); #else - KABC::DistributionListManager manager( abook ); + TDEABC::DistributionListManager manager( abook ); manager.load(); TQStringList distLists = manager.listNames(); @@ -1163,8 +1163,8 @@ AddressesDialog::addDistributionLists() KPIM::DistributionList dlist = *listIt; KPIM::DistributionList::Entry::List entries = dlist.entries(abook); #else - KABC::DistributionList& dlist = *manager.list( *listIt ); - KABC::DistributionList::Entry::List entries = dlist.entries(); + TDEABC::DistributionList& dlist = *manager.list( *listIt ); + TDEABC::DistributionList::Entry::List entries = dlist.entries(); #endif AddresseeViewItem *item = new AddresseeViewItem( d->topdist, dlist.name() ); @@ -1175,7 +1175,7 @@ AddressesDialog::addDistributionLists() #ifdef TDEPIM_NEW_DISTRLISTS KPIM::DistributionList::Entry::List::Iterator itemIt; #else - KABC::DistributionList::Entry::List::Iterator itemIt; + TDEABC::DistributionList::Entry::List::Iterator itemIt; #endif for ( itemIt = entries.begin(); itemIt != entries.end(); ++itemIt ) { addAddresseeToAvailable( (*itemIt).addressee, item, false ); diff --git a/libtdepim/addressesdialog.h b/libtdepim/addressesdialog.h index c27ed68bf..1cc383b21 100644 --- a/libtdepim/addressesdialog.h +++ b/libtdepim/addressesdialog.h @@ -50,14 +50,14 @@ namespace KPIM { FilledGroup =5, DistList =6 }; - AddresseeViewItem( AddresseeViewItem *parent, const KABC::Addressee& addr, int emailIndex = 0 ); + AddresseeViewItem( AddresseeViewItem *parent, const TDEABC::Addressee& addr, int emailIndex = 0 ); AddresseeViewItem( TDEListView *lv, const TQString& name, Category cat=Group ); - AddresseeViewItem( AddresseeViewItem *parent, const TQString& name, const KABC::Addressee::List &lst ); + AddresseeViewItem( AddresseeViewItem *parent, const TQString& name, const TDEABC::Addressee::List &lst ); AddresseeViewItem( AddresseeViewItem *parent, const TQString& name ); ~AddresseeViewItem(); - KABC::Addressee addressee() const; - KABC::Addressee::List addresses() const; + TDEABC::Addressee addressee() const; + TDEABC::Addressee::List addresses() const; Category category() const; TQString name() const; @@ -98,26 +98,26 @@ namespace KPIM { TQStringList bcc() const; /** - * Returns the list of picked "To" addresses as KABC::Addressee::List. + * Returns the list of picked "To" addresses as TDEABC::Addressee::List. * Note that this doesn't include the distribution lists */ - KABC::Addressee::List toAddresses() const; + TDEABC::Addressee::List toAddresses() const; /** - * Returns the list of picked "To" addresses as KABC::Addressee::List. + * Returns the list of picked "To" addresses as TDEABC::Addressee::List. * Note that this does include the distribution lists * Multiple Addressees are removed */ - KABC::Addressee::List allToAddressesNoDuplicates() const; + TDEABC::Addressee::List allToAddressesNoDuplicates() const; /** - * Returns the list of picked "CC" addresses as KABC::Addressee::List. + * Returns the list of picked "CC" addresses as TDEABC::Addressee::List. * Note that this doesn't include the distribution lists */ - KABC::Addressee::List ccAddresses() const; + TDEABC::Addressee::List ccAddresses() const; /** - * Returns the list of picked "BCC" addresses as KABC::Addressee::List. + * Returns the list of picked "BCC" addresses as TDEABC::Addressee::List. * Note that this doesn't include the distribution lists */ - KABC::Addressee::List bccAddresses() const; + TDEABC::Addressee::List bccAddresses() const; /** * Returns the list of picked "To" distribution lists. @@ -150,7 +150,7 @@ namespace KPIM { * If called adds "Recent Addresses" item to the picker list view, * with the addresses given in @p addr. */ - void setRecentAddresses( const KABC::Addressee::List& addr ); + void setRecentAddresses( const TDEABC::Addressee::List& addr ); /** * Adds addresses in @p l to the selected "To" group. */ @@ -190,15 +190,15 @@ namespace KPIM { void initConnections(); void addDistributionLists(); - void addAddresseeToAvailable( const KABC::Addressee& addr, + void addAddresseeToAvailable( const TDEABC::Addressee& addr, AddresseeViewItem* defaultParent=0, bool useCategory=true ); - void addAddresseeToSelected( const KABC::Addressee& addr, + void addAddresseeToSelected( const TDEABC::Addressee& addr, AddresseeViewItem* defaultParent=0 ); void addAddresseesToSelected( AddresseeViewItem *parent, const TQPtrList<AddresseeViewItem>& addresses ); - TQStringList entryToString( const KABC::Addressee::List& l ) const; - KABC::Addressee::List allAddressee( AddresseeViewItem* parent ) const; - KABC::Addressee::List allAddressee( TDEListView* view, bool onlySelected = true ) const; + TQStringList entryToString( const TDEABC::Addressee::List& l ) const; + TDEABC::Addressee::List allAddressee( AddresseeViewItem* parent ) const; + TDEABC::Addressee::List allAddressee( TDEListView* view, bool onlySelected = true ) const; TQStringList allDistributionLists( AddresseeViewItem* parent ) const; private: diff --git a/libtdepim/completionordereditor.cpp b/libtdepim/completionordereditor.cpp index a94b62217..7b82ad5ba 100644 --- a/libtdepim/completionordereditor.cpp +++ b/libtdepim/completionordereditor.cpp @@ -128,7 +128,7 @@ private: void SimpleCompletionItem::save( CompletionOrderEditor* editor ) { - // Maybe KABC::Resource could have a completionWeight setting (for readConfig/writeConfig) + // Maybe TDEABC::Resource could have a completionWeight setting (for readConfig/writeConfig) // But for tdelibs-3.2 compat purposes I can't do that. TDEConfigGroup group( editor->configFile(), "CompletionWeights" ); group.writeEntry( mIdentifier, mWeight ); @@ -184,9 +184,9 @@ CompletionOrderEditor::CompletionOrderEditor( KPIM::LdapSearch* ldapSearch, //kdDebug(5300) << "LDAP: host " << (*it)->host() << " weight " << (*it)->completionWeight() << endl; mItems.append( new LDAPCompletionItem( *it ) ); } - KABC::AddressBook *addressBook = KABC::StdAddressBook::self( true ); - TQPtrList<KABC::Resource> resources = addressBook->resources(); - for( TQPtrListIterator<KABC::Resource> resit( resources ); *resit; ++resit ) { + TDEABC::AddressBook *addressBook = TDEABC::StdAddressBook::self( true ); + TQPtrList<TDEABC::Resource> resources = addressBook->resources(); + for( TQPtrListIterator<TDEABC::Resource> resit( resources ); *resit; ++resit ) { //kdDebug(5300) << "KABC Resource: " << (*resit)->className() << endl; ResourceABC* res = dynamic_cast<ResourceABC *>( *resit ); if ( res ) { // IMAP KABC resource diff --git a/libtdepim/distributionlist.cpp b/libtdepim/distributionlist.cpp index f5742a144..2fd50f5ac 100644 --- a/libtdepim/distributionlist.cpp +++ b/libtdepim/distributionlist.cpp @@ -4,13 +4,13 @@ static const char* s_customFieldName = "DistributionList"; KPIM::DistributionList::DistributionList() - : KABC::Addressee() + : TDEABC::Addressee() { // can't insert the custom entry here, we need to remain a null addressee } -KPIM::DistributionList::DistributionList( const KABC::Addressee& addr ) - : KABC::Addressee( addr ) +KPIM::DistributionList::DistributionList( const TDEABC::Addressee& addr ) + : TDEABC::Addressee( addr ) { } @@ -91,19 +91,19 @@ void KPIM::DistributionList::removeEntry( const TQString& uid, const TQString& e insertCustom( "KADDRESSBOOK", s_customFieldName, str ); // replace old value } -bool KPIM::DistributionList::isDistributionList( const KABC::Addressee& addr ) +bool KPIM::DistributionList::isDistributionList( const TDEABC::Addressee& addr ) { const TQString str = addr.custom( "KADDRESSBOOK", s_customFieldName ); return !str.isEmpty(); } -// ###### KDE4: add findByFormattedName to KABC::AddressBook -static KABC::Addressee::List findByFormattedName( KABC::AddressBook* book, +// ###### KDE4: add findByFormattedName to TDEABC::AddressBook +static TDEABC::Addressee::List findByFormattedName( TDEABC::AddressBook* book, const TQString& name, bool caseSensitive = true ) { - KABC::Addressee::List res; - KABC::AddressBook::Iterator abIt; + TDEABC::Addressee::List res; + TDEABC::AddressBook::Iterator abIt; for ( abIt = book->begin(); abIt != book->end(); ++abIt ) { if ( caseSensitive && (*abIt).formattedName() == name ) @@ -114,11 +114,11 @@ static KABC::Addressee::List findByFormattedName( KABC::AddressBook* book, return res; } -KPIM::DistributionList KPIM::DistributionList::findByName( KABC::AddressBook* book, +KPIM::DistributionList KPIM::DistributionList::findByName( TDEABC::AddressBook* book, const TQString& name, bool caseSensitive ) { - KABC::AddressBook::Iterator abIt; + TDEABC::AddressBook::Iterator abIt; for ( abIt = book->begin(); abIt != book->end(); ++abIt ) { if ( isDistributionList( *abIt ) ) { @@ -131,16 +131,16 @@ KPIM::DistributionList KPIM::DistributionList::findByName( KABC::AddressBook* bo return DistributionList(); } -static KABC::Addressee findByUidOrName( KABC::AddressBook* book, const TQString& uidOrName, const TQString& email ) +static TDEABC::Addressee findByUidOrName( TDEABC::AddressBook* book, const TQString& uidOrName, const TQString& email ) { - KABC::Addressee a = book->findByUid( uidOrName ); + TDEABC::Addressee a = book->findByUid( uidOrName ); if ( a.isEmpty() ) { // UID not found, maybe it is a name instead. // If we have an email, let's use that for the lookup. // [This is used by e.g. the Kolab resource] if ( !email.isEmpty() ) { - KABC::Addressee::List lst = book->findByEmail( email ); - KABC::Addressee::List::ConstIterator listit = lst.begin(); + TDEABC::Addressee::List lst = book->findByEmail( email ); + TDEABC::Addressee::List::ConstIterator listit = lst.begin(); for ( ; listit != lst.end(); ++listit ) if ( (*listit).formattedName() == uidOrName ) { a = *listit; @@ -153,7 +153,7 @@ static KABC::Addressee findByUidOrName( KABC::AddressBook* book, const TQString& // If we don't have an email, or if we didn't find any match for it, look up by full name if ( a.isEmpty() ) { // (But this has to be done here, since when loading we might not have the entries yet) - KABC::Addressee::List lst = findByFormattedName( book, uidOrName ); + TDEABC::Addressee::List lst = findByFormattedName( book, uidOrName ); if ( !lst.isEmpty() ) a = lst.first(); } @@ -161,7 +161,7 @@ static KABC::Addressee findByUidOrName( KABC::AddressBook* book, const TQString& return a; } -KPIM::DistributionList::Entry::List KPIM::DistributionList::entries( KABC::AddressBook* book ) const +KPIM::DistributionList::Entry::List KPIM::DistributionList::entries( TDEABC::AddressBook* book ) const { Entry::List res; const TQString str = custom( "KADDRESSBOOK", s_customFieldName ); @@ -170,7 +170,7 @@ KPIM::DistributionList::Entry::List KPIM::DistributionList::entries( KABC::Addre const TQString uid = (*it).first; const TQString email = (*it).second; // look up contact - KABC::Addressee a = findByUidOrName( book, uid, email ); + TDEABC::Addressee a = findByUidOrName( book, uid, email ); if ( a.isEmpty() ) { // ## The old DistributionListManager had a "missing entries" list... kdWarning() << "Addressee not found: " << uid << endl; @@ -181,7 +181,7 @@ KPIM::DistributionList::Entry::List KPIM::DistributionList::entries( KABC::Addre return res; } -TQStringList KPIM::DistributionList::emails( KABC::AddressBook* book ) const +TQStringList KPIM::DistributionList::emails( TDEABC::AddressBook* book ) const { TQStringList emails; @@ -192,7 +192,7 @@ TQStringList KPIM::DistributionList::emails( KABC::AddressBook* book ) const const TQString thisEmail = (*it).second; // look up contact - KABC::Addressee a = findByUidOrName( book, thisUid, thisEmail ); + TDEABC::Addressee a = findByUidOrName( book, thisUid, thisEmail ); if ( a.isEmpty() ) { // ## The old DistributionListManager had a "missing entries" list... continue; @@ -209,10 +209,10 @@ TQStringList KPIM::DistributionList::emails( KABC::AddressBook* book ) const } TQValueList<KPIM::DistributionList> - KPIM::DistributionList::allDistributionLists( KABC::AddressBook* book ) + KPIM::DistributionList::allDistributionLists( TDEABC::AddressBook* book ) { TQValueList<KPIM::DistributionList> lst; - KABC::AddressBook::Iterator abIt; + TDEABC::AddressBook::Iterator abIt; for ( abIt = book->begin(); abIt != book->end(); ++abIt ) { if ( isDistributionList( *abIt ) ) { diff --git a/libtdepim/distributionlist.h b/libtdepim/distributionlist.h index 433e95b5c..6a96a7c53 100644 --- a/libtdepim/distributionlist.h +++ b/libtdepim/distributionlist.h @@ -23,7 +23,7 @@ #include <tdeabc/addressee.h> -namespace KABC { +namespace TDEABC { class AddressBook; } @@ -40,7 +40,7 @@ namespace KPIM { * * @author David Faure <faure@kde.org> */ -class DistributionList : public KABC::Addressee +class DistributionList : public TDEABC::Addressee { public: /** @@ -72,7 +72,7 @@ class DistributionList : public KABC::Addressee * Create a distribution list from an addressee object * (this is a kind of down-cast) */ - DistributionList( const KABC::Addressee& addr ); + DistributionList( const TDEABC::Addressee& addr ); /** * Destructor. @@ -108,26 +108,26 @@ class DistributionList : public KABC::Addressee These addresses can be directly used by e.g. a mail client. @param book necessary to look up entries */ - TQStringList emails( KABC::AddressBook* book ) const; + TQStringList emails( TDEABC::AddressBook* book ) const; /** Return list of entries belonging to this distribution list. This function is mainly useful for a distribution list editor. @param book necessary to look up entries */ - Entry::List entries( KABC::AddressBook* book ) const; + Entry::List entries( TDEABC::AddressBook* book ) const; // KDE4: should be a method of Addressee - static bool isDistributionList( const KABC::Addressee& addr ); + static bool isDistributionList( const TDEABC::Addressee& addr ); // KDE4: should be a method of AddressBook - static DistributionList findByName( KABC::AddressBook* book, + static DistributionList findByName( TDEABC::AddressBook* book, const TQString& name, bool caseSensitive = true ); // KDE4: should be a method of AddressBook // A bit slow (but no more than findByName). // From KAddressbook, use Core::distributionLists() instead. - static TQValueList<DistributionList> allDistributionLists( KABC::AddressBook* book ); + static TQValueList<DistributionList> allDistributionLists( TDEABC::AddressBook* book ); private: diff --git a/libtdepim/kaddrbook.cpp b/libtdepim/kaddrbook.cpp index 291669216..2befdded5 100644 --- a/libtdepim/kaddrbook.cpp +++ b/libtdepim/kaddrbook.cpp @@ -36,9 +36,9 @@ void KAddrBookExternal::openEmail( const TQString &addr, TQWidget *parent ) { TQString email; TQString name; - KABC::Addressee::parseEmailAddress( addr, name, email ); + TDEABC::Addressee::parseEmailAddress( addr, name, email ); - KABC::AddressBook *ab = KABC::StdAddressBook::self( true ); + TDEABC::AddressBook *ab = TDEABC::StdAddressBook::self( true ); // force a reload of the address book file so that changes that were made // by other programs are loaded @@ -56,7 +56,7 @@ void KAddrBookExternal::openEmail( const TQString &addr, TQWidget *parent ) { } #endif - KABC::Addressee::List addressees = ab->findByEmail( email ); + TDEABC::Addressee::List addressees = ab->findByEmail( email ); if ( addressees.count() > 0 ) { if ( kapp->dcopClient()->isApplicationRegistered( "kaddressbook" ) ){ @@ -87,11 +87,11 @@ void KAddrBookExternal::addEmail( const TQString& addr, TQWidget *parent) { TQString email; TQString name; - KABC::Addressee::parseEmailAddress( addr, name, email ); + TDEABC::Addressee::parseEmailAddress( addr, name, email ); - KABC::AddressBook *ab = KABC::StdAddressBook::self( true ); + TDEABC::AddressBook *ab = TDEABC::StdAddressBook::self( true ); - ab->setErrorHandler( new KABC::GuiErrorHandler( parent ) ); + ab->setErrorHandler( new TDEABC::GuiErrorHandler( parent ) ); // force a reload of the address book file so that changes that were made // by other programs are loaded @@ -109,10 +109,10 @@ void KAddrBookExternal::addEmail( const TQString& addr, TQWidget *parent) { } #endif - KABC::Addressee::List addressees = ab->findByEmail( email ); + TDEABC::Addressee::List addressees = ab->findByEmail( email ); if ( addressees.isEmpty() ) { - KABC::Addressee a; + TDEABC::Addressee a; a.setNameFromString( name ); a.insertEmail( email, true ); @@ -173,14 +173,14 @@ void KAddrBookExternal::addNewAddressee( TQWidget* ) call.send("newContact()"); } -bool KAddrBookExternal::addVCard( const KABC::Addressee& addressee, TQWidget *parent ) +bool KAddrBookExternal::addVCard( const TDEABC::Addressee& addressee, TQWidget *parent ) { - KABC::AddressBook *ab = KABC::StdAddressBook::self( true ); + TDEABC::AddressBook *ab = TDEABC::StdAddressBook::self( true ); bool inserted = false; - ab->setErrorHandler( new KABC::GuiErrorHandler( parent ) ); + ab->setErrorHandler( new TDEABC::GuiErrorHandler( parent ) ); - KABC::Addressee::List addressees = + TDEABC::Addressee::List addressees = ab->findByEmail( addressee.preferredEmail() ); if ( addressees.isEmpty() ) { @@ -204,16 +204,16 @@ bool KAddrBookExternal::addVCard( const KABC::Addressee& addressee, TQWidget *pa return inserted; } -bool KAddrBookExternal::addAddressee( const KABC::Addressee& addr ) +bool KAddrBookExternal::addAddressee( const TDEABC::Addressee& addr ) { - KABC::AddressBook *addressBook = KABC::StdAddressBook::self( true ); - KABC::Resource *kabcResource = selectResourceForSaving( addressBook ); + TDEABC::AddressBook *addressBook = TDEABC::StdAddressBook::self( true ); + TDEABC::Resource *kabcResource = selectResourceForSaving( addressBook ); if( !kabcResource ) return false; - KABC::Ticket *ticket = addressBook->requestSaveTicket( kabcResource ); + TDEABC::Ticket *ticket = addressBook->requestSaveTicket( kabcResource ); bool saved = false; if ( ticket ) { - KABC::Addressee addressee( addr ); + TDEABC::Addressee addressee( addr ); addressee.setResource( kabcResource ); addressBook->insertAddressee( addressee ); saved = addressBook->save( ticket ); @@ -232,14 +232,14 @@ TQString KAddrBookExternal::expandDistributionList( const TQString& listName ) return TQString(); const TQString lowerListName = listName.lower(); - KABC::AddressBook *addressBook = KABC::StdAddressBook::self( true ); + TDEABC::AddressBook *addressBook = TDEABC::StdAddressBook::self( true ); #ifdef TDEPIM_NEW_DISTRLISTS KPIM::DistributionList distrList = KPIM::DistributionList::findByName( addressBook, lowerListName, false ); if ( !distrList.isEmpty() ) { return distrList.emails( addressBook ).join( ", " ); } #else - KABC::DistributionListManager manager( addressBook ); + TDEABC::DistributionListManager manager( addressBook ); manager.load(); const TQStringList listNames = manager.listNames(); @@ -254,7 +254,7 @@ TQString KAddrBookExternal::expandDistributionList( const TQString& listName ) return TQString(); } -KABC::Resource* KAddrBookExternal::selectResourceForSaving( KABC::AddressBook *addressBook ) +TDEABC::Resource* KAddrBookExternal::selectResourceForSaving( TDEABC::AddressBook *addressBook ) { #if KDE_IS_VERSION(3,4,89) // This ugly hack will be removed in 4.0 @@ -267,11 +267,11 @@ KABC::Resource* KAddrBookExternal::selectResourceForSaving( KABC::AddressBook *a #endif // Select a resource - TQPtrList<KABC::Resource> kabcResources = addressBook->resources(); + TQPtrList<TDEABC::Resource> kabcResources = addressBook->resources(); TQPtrList<KRES::Resource> kresResources; - TQPtrListIterator<KABC::Resource> resIt( kabcResources ); - KABC::Resource *kabcResource; + TQPtrListIterator<TDEABC::Resource> resIt( kabcResources ); + TDEABC::Resource *kabcResource; while ( ( kabcResource = resIt.current() ) != 0 ) { ++resIt; if ( !kabcResource->readOnly() ) { @@ -281,5 +281,5 @@ KABC::Resource* KAddrBookExternal::selectResourceForSaving( KABC::AddressBook *a } } - return static_cast<KABC::Resource*>( KRES::SelectDialog::getResource( kresResources, 0 ) ); + return static_cast<TDEABC::Resource*>( KRES::SelectDialog::getResource( kresResources, 0 ) ); } diff --git a/libtdepim/kaddrbook.h b/libtdepim/kaddrbook.h index 10b896098..a9e2c8c57 100644 --- a/libtdepim/kaddrbook.h +++ b/libtdepim/kaddrbook.h @@ -11,7 +11,7 @@ #include <tdeabc/addressee.h> #include <tdepimmacros.h> -namespace KABC { +namespace TDEABC { class AddressBook; } @@ -24,7 +24,7 @@ public: static void openEmail( const TQString &addr, TQWidget *parent ); static void openAddressBook( TQWidget *parent ); - static bool addVCard( const KABC::Addressee& addressee, TQWidget *parent ); + static bool addVCard( const TDEABC::Addressee& addressee, TQWidget *parent ); static TQString expandDistributionList( const TQString& listName ); @@ -36,10 +36,10 @@ public: * async and loading is not yet finished, this method will run an eventloop until the * addressbook is loaded. */ - static KABC::Resource* selectResourceForSaving( KABC::AddressBook *addressBook ); + static TDEABC::Resource* selectResourceForSaving( TDEABC::AddressBook *addressBook ); private: - static bool addAddressee( const KABC::Addressee& addressee ); + static bool addAddressee( const TDEABC::Addressee& addressee ); }; #endif /*KAddrBook_h*/ diff --git a/libtdepim/kvcarddrag.cpp b/libtdepim/kvcarddrag.cpp index 285224497..0cc168b42 100644 --- a/libtdepim/kvcarddrag.cpp +++ b/libtdepim/kvcarddrag.cpp @@ -82,15 +82,15 @@ bool KVCardDrag::decode( TQMimeSource *e, TQString &content ) } #endif -bool KVCardDrag::decode( TQMimeSource *e, KABC::Addressee::List& addressees ) +bool KVCardDrag::decode( TQMimeSource *e, TDEABC::Addressee::List& addressees ) { if ( !canDecode( e ) ) { return false; } #if defined(KABC_VCARD_ENCODING_FIX) - addressees = KABC::VCardConverter().parseVCardsRaw( e->encodedData( vcard_mime_string ).data() ); + addressees = TDEABC::VCardConverter().parseVCardsRaw( e->encodedData( vcard_mime_string ).data() ); #else - addressees = KABC::VCardConverter().parseVCards( e->encodedData( vcard_mime_string ) ); + addressees = TDEABC::VCardConverter().parseVCards( e->encodedData( vcard_mime_string ) ); #endif return true; } diff --git a/libtdepim/kvcarddrag.h b/libtdepim/kvcarddrag.h index 83c7f3e50..40263ac55 100644 --- a/libtdepim/kvcarddrag.h +++ b/libtdepim/kvcarddrag.h @@ -83,7 +83,7 @@ class KDE_EXPORT KVCardDrag : public TQStoredDrag /** * Decodes the MIME source @p e and puts the resulting vcard into @p addresseess. */ - static bool decode( TQMimeSource *e, KABC::Addressee::List& addressees ); + static bool decode( TQMimeSource *e, TDEABC::Addressee::List& addressees ); protected: virtual void virtual_hook( int id, void* data ); diff --git a/libtdepim/ldapclient.cpp b/libtdepim/ldapclient.cpp index 290238403..8e4783882 100644 --- a/libtdepim/ldapclient.cpp +++ b/libtdepim/ldapclient.cpp @@ -53,7 +53,7 @@ TQString LdapObject::toString() const for ( LdapAttrMap::ConstIterator it = attrs.begin(); it != attrs.end(); ++it ) { TQString attr = it.key(); for ( LdapAttrValue::ConstIterator it2 = (*it).begin(); it2 != (*it).end(); ++it2 ) { - result += TQString::fromUtf8( KABC::LDIF::assembleLine( attr, *it2, 76 ) ) + "\n"; + result += TQString::fromUtf8( TDEABC::LDIF::assembleLine( attr, *it2, 76 ) ) + "\n"; } } @@ -105,7 +105,7 @@ void LdapClient::setAttrs( const TQStringList& attrs ) void LdapClient::startQuery( const TQString& filter ) { cancelQuery(); - KABC::LDAPUrl url; + TDEABC::LDAPUrl url; url.setProtocol( ( mServer.security() == LdapServer::SSL ) ? "ldaps" : "ldap" ); if ( mServer.auth() != LdapServer::Anonymous ) { @@ -129,7 +129,7 @@ void LdapClient::startQuery( const TQString& filter ) TQString::number( mServer.sizeLimit() ) ); url.setAttributes( mAttrs ); - url.setScope( mScope == "one" ? KABC::LDAPUrl::One : KABC::LDAPUrl::Sub ); + url.setScope( mScope == "one" ? TDEABC::LDAPUrl::One : TDEABC::LDAPUrl::Sub ); url.setFilter( "("+filter+")" ); kdDebug(5300) << "LdapClient: Doing query: " << url.prettyURL() << endl; @@ -232,12 +232,12 @@ void LdapClient::parseLDIF( const TQByteArray& data ) mLdif.endLDIF(); } - KABC::LDIF::ParseVal ret; + TDEABC::LDIF::ParseVal ret; TQString name; do { ret = mLdif.nextItem(); switch ( ret ) { - case KABC::LDIF::Item: + case TDEABC::LDIF::Item: { name = mLdif.attr(); // Must make a copy! TQByteArray is explicitely shared @@ -250,13 +250,13 @@ void LdapClient::parseLDIF( const TQByteArray& data ) //kdDebug(5300) << "LdapClient::parseLDIF(): name=" << name << " value=" << TQCString(value.data(), value.size()+1) << endl; } break; - case KABC::LDIF::EndEntry: + case TDEABC::LDIF::EndEntry: finishCurrentObject(); break; default: break; } - } while ( ret != KABC::LDIF::MoreData ); + } while ( ret != TDEABC::LDIF::MoreData ); } int LdapClient::clientNumber() const diff --git a/libtdepim/ldapclient.h b/libtdepim/ldapclient.h index 51701272b..3b8d737a8 100644 --- a/libtdepim/ldapclient.h +++ b/libtdepim/ldapclient.h @@ -216,7 +216,7 @@ class KDE_EXPORT LdapClient : public TQObject LdapObject mCurrentObject; private: - KABC::LDIF mLdif; + TDEABC::LDIF mLdif; int mClientNumber; int mCompletionWeight; diff --git a/libtdepim/ldapsearchdialog.cpp b/libtdepim/ldapsearchdialog.cpp index b6e49c8a2..87b84bae9 100644 --- a/libtdepim/ldapsearchdialog.cpp +++ b/libtdepim/ldapsearchdialog.cpp @@ -227,7 +227,7 @@ void LDAPSearchDialog::restoreSettings() // then read the config file and register all selected // server in the list - TDEConfig* config = KABC::AddressLineEdit::config(); // singleton kabldaprc config object + TDEConfig* config = TDEABC::AddressLineEdit::config(); // singleton kabldaprc config object TDEConfigGroupSaver saver( config, "LDAP" ); mNumHosts = config->readUnsignedNumEntry( "NumSelectedHosts" ); if ( !mNumHosts ) { diff --git a/libtdepim/recentaddresses.cpp b/libtdepim/recentaddresses.cpp index 6698b263d..a3ed83d7d 100644 --- a/libtdepim/recentaddresses.cpp +++ b/libtdepim/recentaddresses.cpp @@ -79,9 +79,9 @@ void RecentAddresses::load( TDEConfig *config ) m_maxCount = config->readNumEntry( "Maximum Recent Addresses", 40 ); addresses = config->readListEntry( "Recent Addresses" ); for ( TQStringList::Iterator it = addresses.begin(); it != addresses.end(); ++it ) { - KABC::Addressee::parseEmailAddress( *it, name, email ); + TDEABC::Addressee::parseEmailAddress( *it, name, email ); if ( !email.isEmpty() ) { - KABC::Addressee addr; + TDEABC::Addressee addr; addr.setNameFromString( name ); addr.insertEmail( email, true ); m_addresseeList.append( addr ); @@ -107,11 +107,11 @@ void RecentAddresses::add( const TQString& entry ) continue; TQString email; TQString fullName; - KABC::Addressee addr; + TDEABC::Addressee addr; - KABC::Addressee::parseEmailAddress( *e_it, fullName, email ); + TDEABC::Addressee::parseEmailAddress( *e_it, fullName, email ); - for ( KABC::Addressee::List::Iterator it = m_addresseeList.begin(); + for ( TDEABC::Addressee::List::Iterator it = m_addresseeList.begin(); it != m_addresseeList.end(); ++it ) { if ( email == (*it).preferredEmail() ) { @@ -149,7 +149,7 @@ void RecentAddresses::clear() TQStringList RecentAddresses::addresses() const { TQStringList addresses; - for ( KABC::Addressee::List::ConstIterator it = m_addresseeList.begin(); + for ( TDEABC::Addressee::List::ConstIterator it = m_addresseeList.begin(); it != m_addresseeList.end(); ++it ) { addresses.append( (*it).fullEmail() ); diff --git a/libtdepim/recentaddresses.h b/libtdepim/recentaddresses.h index 547986370..9a6281e23 100644 --- a/libtdepim/recentaddresses.h +++ b/libtdepim/recentaddresses.h @@ -78,7 +78,7 @@ public: * like "Foo <foo@bar.org>, Bar Baz <bar@baz.org>". */ TQStringList addresses() const; - const KABC::Addressee::List& kabcAddresses() const { return m_addresseeList; } + const TDEABC::Addressee::List& kabcAddresses() const { return m_addresseeList; } /** * Adds an entry to the list. @@ -118,7 +118,7 @@ public: private: RecentAddresses(TDEConfig *config = 0L); - KABC::Addressee::List m_addresseeList; + TDEABC::Addressee::List m_addresseeList; void adjustSize(); diff --git a/libtdepim/resourceabc.cpp b/libtdepim/resourceabc.cpp index 16eeadc5b..81d677927 100644 --- a/libtdepim/resourceabc.cpp +++ b/libtdepim/resourceabc.cpp @@ -27,7 +27,7 @@ using namespace KPIM; ResourceABC::ResourceABC( const TDEConfig* config ) - : KABC::Resource( config ) + : TDEABC::Resource( config ) { } diff --git a/libtdepim/resourceabc.h b/libtdepim/resourceabc.h index ccd350f5f..54a2843cb 100644 --- a/libtdepim/resourceabc.h +++ b/libtdepim/resourceabc.h @@ -41,7 +41,7 @@ namespace KPIM { * handle subresources. */ -class KDE_EXPORT ResourceABC : public KABC::Resource +class KDE_EXPORT ResourceABC : public TDEABC::Resource { Q_OBJECT diff --git a/libtdepim/tdeabcresourcecached.cpp b/libtdepim/tdeabcresourcecached.cpp index 4cb4901a8..3bb96112d 100644 --- a/libtdepim/tdeabcresourcecached.cpp +++ b/libtdepim/tdeabcresourcecached.cpp @@ -27,10 +27,10 @@ #include "tdeabcresourcecached.h" -using namespace KABC; +using namespace TDEABC; ResourceCached::ResourceCached( const TDEConfig *config ) - : KABC::Resource( config ), mIdMapper( "tdeabc/uidmaps/" ), + : TDEABC::Resource( config ), mIdMapper( "tdeabc/uidmaps/" ), mReloadPolicy( ReloadInterval ), mReloadInterval( 10 ), mKABCReloadTimer( 0, "mKABCReloadTimer" ), mReloaded( false ), mSavePolicy( SaveDelayed ), mSaveInterval( 10 ), @@ -102,7 +102,7 @@ void ResourceCached::writeConfig( TDEConfig *config ) config->writeEntry( "LastLoad", mLastLoad ); config->writeEntry( "LastSave", mLastSave ); - KABC::Resource::writeConfig( config ); + TDEABC::Resource::writeConfig( config ); } void ResourceCached::readConfig( TDEConfig *config ) @@ -157,7 +157,7 @@ void ResourceCached::slotKABCSave() kdDebug(5800) << "ResourceCached::slotKABCSave()" << endl; - KABC::Ticket *ticket = requestSaveTicket(); + TDEABC::Ticket *ticket = requestSaveTicket(); if ( ticket ) { save( ticket ); } @@ -178,7 +178,7 @@ void ResourceCached::insertAddressee( const Addressee &addr ) mAddrMap.insert( addr.uid(), addr ); mAddedAddressees.insert( addr.uid(), addr ); } else { - KABC::Addressee oldAddressee = mAddrMap.find( addr.uid() ).data(); + TDEABC::Addressee oldAddressee = mAddrMap.find( addr.uid() ).data(); if ( oldAddressee != addr ) { mAddrMap.remove( addr.uid() ); mAddrMap.insert( addr.uid(), addr ); @@ -213,13 +213,13 @@ void ResourceCached::loadCache() return; - KABC::VCardConverter converter; + TDEABC::VCardConverter converter; #if defined(KABC_VCARD_ENCODING_FIX) - KABC::Addressee::List list = converter.parseVCardsRaw( file.readAll().data() ); + TDEABC::Addressee::List list = converter.parseVCardsRaw( file.readAll().data() ); #else - KABC::Addressee::List list = converter.parseVCards( TQString::fromUtf8( file.readAll() ) ); + TDEABC::Addressee::List list = converter.parseVCards( TQString::fromUtf8( file.readAll() ) ); #endif - KABC::Addressee::List::Iterator it; + TDEABC::Addressee::List::Iterator it; for ( it = list.begin(); it != list.end(); ++it ) { (*it).setResource( this ); @@ -240,9 +240,9 @@ void ResourceCached::saveCache() if ( !file.open( IO_WriteOnly ) ) return; - KABC::Addressee::List list = mAddrMap.values(); + TDEABC::Addressee::List list = mAddrMap.values(); - KABC::VCardConverter converter; + TDEABC::VCardConverter converter; #if defined(KABC_VCARD_ENCODING_FIX) TQCString vCard = converter.createVCardsRaw( list ); file.writeBlock( vCard, vCard.length() ); @@ -259,7 +259,7 @@ void ResourceCached::clearCache() mAddrMap.clear(); } -void ResourceCached::cleanUpCache( const KABC::Addressee::List &addrList ) +void ResourceCached::cleanUpCache( const TDEABC::Addressee::List &addrList ) { // load cache TQFile file( cacheFile() ); @@ -267,14 +267,14 @@ void ResourceCached::cleanUpCache( const KABC::Addressee::List &addrList ) return; - KABC::VCardConverter converter; + TDEABC::VCardConverter converter; #if defined(KABC_VCARD_ENCODING_FIX) - KABC::Addressee::List list = converter.parseVCardsRaw( file.readAll().data() ); + TDEABC::Addressee::List list = converter.parseVCardsRaw( file.readAll().data() ); #else - KABC::Addressee::List list = converter.parseVCards( TQString::fromUtf8( file.readAll() ) ); + TDEABC::Addressee::List list = converter.parseVCards( TQString::fromUtf8( file.readAll() ) ); #endif - KABC::Addressee::List::Iterator cacheIt; - KABC::Addressee::List::ConstIterator it; + TDEABC::Addressee::List::Iterator cacheIt; + TDEABC::Addressee::List::ConstIterator it; for ( cacheIt = list.begin(); cacheIt != list.end(); ++cacheIt ) { bool found = false; @@ -311,7 +311,7 @@ void ResourceCached::clearChanges() mDeletedAddressees.clear(); } -void ResourceCached::clearChange( const KABC::Addressee &addr ) +void ResourceCached::clearChange( const TDEABC::Addressee &addr ) { mAddedAddressees.remove( addr.uid() ); mChangedAddressees.remove( addr.uid() ); @@ -325,17 +325,17 @@ void ResourceCached::clearChange( const TQString &uid ) mDeletedAddressees.remove( uid ); } -KABC::Addressee::List ResourceCached::addedAddressees() const +TDEABC::Addressee::List ResourceCached::addedAddressees() const { return mAddedAddressees.values(); } -KABC::Addressee::List ResourceCached::changedAddressees() const +TDEABC::Addressee::List ResourceCached::changedAddressees() const { return mChangedAddressees.values(); } -KABC::Addressee::List ResourceCached::deletedAddressees() const +TDEABC::Addressee::List ResourceCached::deletedAddressees() const { return mDeletedAddressees.values(); } @@ -350,11 +350,11 @@ TQString ResourceCached::changesCacheFile( const TQString &type ) const return locateLocal( "cache", "tdeabc/changescache/" + identifier() + "_" + type ); } -void ResourceCached::saveChangesCache( const TQMap<TQString, KABC::Addressee> &map, const TQString &type ) +void ResourceCached::saveChangesCache( const TQMap<TQString, TDEABC::Addressee> &map, const TQString &type ) { TQFile file( changesCacheFile( type ) ); - const KABC::Addressee::List list = map.values(); + const TDEABC::Addressee::List list = map.values(); if ( list.isEmpty() ) { file.remove(); } else { @@ -363,7 +363,7 @@ void ResourceCached::saveChangesCache( const TQMap<TQString, KABC::Addressee> &m return; } - KABC::VCardConverter converter; + TDEABC::VCardConverter converter; #if defined(KABC_VCARD_ENCODING_FIX) const TQCString vCards = converter.createVCardsRaw( list ); file.writeBlock( vCards, vCards.length() ); @@ -382,20 +382,20 @@ void ResourceCached::saveChangesCache() saveChangesCache( mChangedAddressees, "changed" ); } -void ResourceCached::loadChangesCache( TQMap<TQString, KABC::Addressee> &map, const TQString &type ) +void ResourceCached::loadChangesCache( TQMap<TQString, TDEABC::Addressee> &map, const TQString &type ) { TQFile file( changesCacheFile( type ) ); if ( !file.open( IO_ReadOnly ) ) return; - KABC::VCardConverter converter; + TDEABC::VCardConverter converter; #if defined(KABC_VCARD_ENCODING_FIX) - const KABC::Addressee::List list = converter.parseVCardsRaw( file.readAll().data() ); + const TDEABC::Addressee::List list = converter.parseVCardsRaw( file.readAll().data() ); #else - const KABC::Addressee::List list = converter.parseVCards( TQString::fromUtf8( file.readAll() ) ); + const TDEABC::Addressee::List list = converter.parseVCards( TQString::fromUtf8( file.readAll() ) ); #endif - KABC::Addressee::List::ConstIterator it; + TDEABC::Addressee::List::ConstIterator it; for ( it = list.begin(); it != list.end(); ++it ) map.insert( (*it).uid(), *it ); diff --git a/libtdepim/tdeabcresourcecached.h b/libtdepim/tdeabcresourcecached.h index aab4a192a..b187b6fb0 100644 --- a/libtdepim/tdeabcresourcecached.h +++ b/libtdepim/tdeabcresourcecached.h @@ -29,7 +29,7 @@ #include "libemailfunctions/idmapper.h" -namespace KABC { +namespace TDEABC { class KDE_EXPORT ResourceCached : public Resource { @@ -133,7 +133,7 @@ class KDE_EXPORT ResourceCached : public Resource void loadCache(); void saveCache(); void clearCache(); - void cleanUpCache( const KABC::Addressee::List &list ); + void cleanUpCache( const TDEABC::Addressee::List &list ); /** Returns a reference to the id mapper. @@ -142,12 +142,12 @@ class KDE_EXPORT ResourceCached : public Resource bool hasChanges() const; void clearChanges(); - void clearChange( const KABC::Addressee& ); + void clearChange( const TDEABC::Addressee& ); void clearChange( const TQString& ); - KABC::Addressee::List addedAddressees() const; - KABC::Addressee::List changedAddressees() const; - KABC::Addressee::List deletedAddressees() const; + TDEABC::Addressee::List addedAddressees() const; + TDEABC::Addressee::List changedAddressees() const; + TDEABC::Addressee::List deletedAddressees() const; protected: virtual TQString cacheFile() const; @@ -156,17 +156,17 @@ class KDE_EXPORT ResourceCached : public Resource Functions for keeping the changes persistent. */ virtual TQString changesCacheFile( const TQString& ) const; - void loadChangesCache( TQMap<TQString, KABC::Addressee>&, const TQString& ); + void loadChangesCache( TQMap<TQString, TDEABC::Addressee>&, const TQString& ); void loadChangesCache(); - void saveChangesCache( const TQMap<TQString, KABC::Addressee>&, const TQString& ); + void saveChangesCache( const TQMap<TQString, TDEABC::Addressee>&, const TQString& ); void saveChangesCache(); void setIdMapperIdentifier(); private: - TQMap<TQString, KABC::Addressee> mAddedAddressees; - TQMap<TQString, KABC::Addressee> mChangedAddressees; - TQMap<TQString, KABC::Addressee> mDeletedAddressees; + TQMap<TQString, TDEABC::Addressee> mAddedAddressees; + TQMap<TQString, TDEABC::Addressee> mChangedAddressees; + TQMap<TQString, TDEABC::Addressee> mDeletedAddressees; KPIM::IdMapper mIdMapper; diff --git a/libtdepim/tdeabcresourcenull.h b/libtdepim/tdeabcresourcenull.h index dfc731f79..043a10cf1 100644 --- a/libtdepim/tdeabcresourcenull.h +++ b/libtdepim/tdeabcresourcenull.h @@ -23,7 +23,7 @@ #include <tdeabc/resource.h> -namespace KABC { +namespace TDEABC { /** This resource does nothing. diff --git a/libtdepim/tests/testdistrlist.cpp b/libtdepim/tests/testdistrlist.cpp index 0bbb536d7..f2d6b68b1 100644 --- a/libtdepim/tests/testdistrlist.cpp +++ b/libtdepim/tests/testdistrlist.cpp @@ -61,11 +61,11 @@ int main(int argc, char *argv[]) void TestDistrList::setup() { // We need a std addressbook - KABC::AddressBook *ab = KABC::StdAddressBook::self(); - KABC::StdAddressBook::setAutomaticSave( false ); + TDEABC::AddressBook *ab = TDEABC::StdAddressBook::self(); + TDEABC::StdAddressBook::setAutomaticSave( false ); // and two contacts - KABC::Addressee addr1; + TDEABC::Addressee addr1; addr1.setName( "addr1" ); addr1.setFormattedName( "addr1" ); addr1.insertEmail( "addr1@kde.org", true ); @@ -73,7 +73,7 @@ void TestDistrList::setup() ab->insertAddressee( addr1 ); assert( addr1.emails().count() == 2 ); - KABC::Addressee addr2; + TDEABC::Addressee addr2; addr2.setName( "addr2" ); addr2.insertEmail( "addr2@kde.org", true ); addr2.insertEmail( "addr2-alternate@kde.org" ); @@ -146,9 +146,9 @@ static bool removeDirAndContentsRecursively( const TQString & path ) void TestDistrList::cleanup() { kdDebug() << k_funcinfo << endl; - KABC::AddressBook *ab = KABC::StdAddressBook::self(); + TDEABC::AddressBook *ab = TDEABC::StdAddressBook::self(); ab->clear(); - KABC::StdAddressBook::close(); + TDEABC::StdAddressBook::close(); TQString tdehome = TQFile::decodeName( getenv("TDEHOME") ); KURL urltdehome; urltdehome.setPath( tdehome ); @@ -173,17 +173,17 @@ void TestDistrList::testNewList() check( "name set", dl.formattedName(), "foo" ); assert( DistributionList::isDistributionList( dl ) ); - KABC::AddressBook *ab = KABC::StdAddressBook::self(); + TDEABC::AddressBook *ab = TDEABC::StdAddressBook::self(); ab->insertAddressee( dl ); -#if 0 // can't do that until we have KABC::AddressBook::findByFormattedName, or we use setName() - KABC::Addressee::List addrList = ab->findByName( "foo" ); +#if 0 // can't do that until we have TDEABC::AddressBook::findByFormattedName, or we use setName() + TDEABC::Addressee::List addrList = ab->findByName( "foo" ); assert( addrList.count() == 1 ); - KABC::Addressee addr = addrList.first(); + TDEABC::Addressee addr = addrList.first(); assert( !addr.isEmpty() ); check( "correct name", addr.name(), "foo" ); assert( DistributionList::isDistributionList( addr ) ); #else - KABC::Addressee addr = dl; + TDEABC::Addressee addr = dl; #endif DistributionList dl2 = DistributionList::findByName( ab, "foo" ); @@ -201,19 +201,19 @@ void TestDistrList::testNewList() void TestDistrList::testInsertEntry() { kdDebug() << k_funcinfo << endl; - KABC::AddressBook *ab = KABC::StdAddressBook::self(); + TDEABC::AddressBook *ab = TDEABC::StdAddressBook::self(); DistributionList dl = DistributionList::findByName( ab, "foo" ); assert( !dl.isEmpty() ); #if 0 // the usual method - KABC::Addressee addr1 = ab->findByName( "addr1" ).first(); + TDEABC::Addressee addr1 = ab->findByName( "addr1" ).first(); assert( !addr1.isEmpty() ); dl.insertEntry( addr1 ); #else // the kolab-resource method dl.insertEntry( "addr1" ); #endif - KABC::Addressee addr2 = ab->findByName( "addr2" ).first(); + TDEABC::Addressee addr2 = ab->findByName( "addr2" ).first(); assert( !addr2.isEmpty() ); dl.insertEntry( addr2, "addr2-alternate@kde.org" ); @@ -248,17 +248,17 @@ void TestDistrList::testInsertEntry() void TestDistrList::testRemoveEntry() { kdDebug() << k_funcinfo << endl; - KABC::AddressBook *ab = KABC::StdAddressBook::self(); + TDEABC::AddressBook *ab = TDEABC::StdAddressBook::self(); DistributionList dl = DistributionList::findByName( ab, "foo" ); assert( !dl.isEmpty() ); DistributionList::Entry::List entries = dl.entries( ab ); check( "entries count before removeEntry", TQString::number( entries.count() ), "3" ); // Removing an empty entry shouldn't do anything - dl.removeEntry( KABC::Addressee() ); + dl.removeEntry( TDEABC::Addressee() ); check( "entries count after removing empty entry", TQString::number( dl.entries(ab).count() ), "3" ); - KABC::Addressee addr1 = ab->findByName( "addr1" ).first(); + TDEABC::Addressee addr1 = ab->findByName( "addr1" ).first(); assert( !addr1.isEmpty() ); // Removing an entry with the wrong email passed, shouldn't do anything dl.removeEntry( addr1, "foo@foobar.com" ); @@ -272,7 +272,7 @@ void TestDistrList::testRemoveEntry() check( "first email", emails[0], "addr2 <addr2-alternate@kde.org>" ); // Now move on to addr2. First remove with no or a wrong email (nothing should happen) - KABC::Addressee addr2 = ab->findByName( "addr2" ).first(); + TDEABC::Addressee addr2 = ab->findByName( "addr2" ).first(); assert( !addr2.isEmpty() ); dl.removeEntry( addr2 ); check( "entries count after removing entry with no email", TQString::number( dl.entries(ab).count() ), "2" ); @@ -293,14 +293,14 @@ void TestDistrList::testDuplicate() { kdDebug() << k_funcinfo << endl; // This is a special test for the case where we have a contact and a distr list with the same name - KABC::AddressBook *ab = KABC::StdAddressBook::self(); - KABC::Addressee addr; + TDEABC::AddressBook *ab = TDEABC::StdAddressBook::self(); + TDEABC::Addressee addr; addr.setName( "foo" ); addr.insertEmail( "foo@kde.org", true ); ab->insertAddressee( addr ); #if 0 // we need a findByFormattedName - KABC::Addressee::List addrList = ab->findByName( "foo" ); + TDEABC::Addressee::List addrList = ab->findByName( "foo" ); assert( addrList.count() == 2 ); bool a = DistributionList::isDistributionList( addrList.first() ); @@ -321,7 +321,7 @@ void TestDistrList::testDeleteList() { kdDebug() << k_funcinfo << endl; - KABC::AddressBook *ab = KABC::StdAddressBook::self(); + TDEABC::AddressBook *ab = TDEABC::StdAddressBook::self(); DistributionList dl = DistributionList::findByName( ab, "foo" ); assert( !dl.isEmpty() ); ab->removeAddressee( dl ); |