diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kword/mailmerge/kabc | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kword/mailmerge/kabc')
-rw-r--r-- | kword/mailmerge/kabc/KWMailMergeKABC.cpp | 92 | ||||
-rw-r--r-- | kword/mailmerge/kabc/KWMailMergeKABC.h | 39 | ||||
-rw-r--r-- | kword/mailmerge/kabc/KWMailMergeKABCConfig.cpp | 190 | ||||
-rw-r--r-- | kword/mailmerge/kabc/KWMailMergeKABCConfig.h | 33 | ||||
-rw-r--r-- | kword/mailmerge/kabc/addresspicker.ui | 32 |
5 files changed, 194 insertions, 192 deletions
diff --git a/kword/mailmerge/kabc/KWMailMergeKABC.cpp b/kword/mailmerge/kabc/KWMailMergeKABC.cpp index a5df7e73..aeadae4c 100644 --- a/kword/mailmerge/kabc/KWMailMergeKABC.cpp +++ b/kword/mailmerge/kabc/KWMailMergeKABC.cpp @@ -33,8 +33,8 @@ #include "KWMailMergeKABC.h" #include "KWMailMergeKABCConfig.h" -KWMailMergeKABC::KWMailMergeKABC( KInstance *inst, QObject *parent ) - : KWMailMergeDataSource( inst, parent ) +KWMailMergeKABC::KWMailMergeKABC( KInstance *inst, TQObject *tqparent ) + : KWMailMergeDataSource( inst, tqparent ) { _addressBook = KABC::StdAddressBook::self(); _iterator = _addressBook->begin(); @@ -85,12 +85,12 @@ KWMailMergeKABC::KWMailMergeKABC( KInstance *inst, QObject *parent ) sampleRecord[ ("sortString" ) ] = KABC::Addressee::sortStringLabel(); sampleRecord[ ("URL" ) ] = KABC::Addressee::urlLabel(); sampleRecord[ ("Secrecy" ) ] = KABC::Addressee::secrecyLabel(); - sampleRecord[ ("Preferred address: Street" ) ] = QString( "preferedAddressStreet" ); - sampleRecord[ ("Preferred address: Locality" ) ] = QString( "preferedAddressLocality" ); - sampleRecord[ ("Preferred address: Region" ) ] = QString( "preferedAddressRegion" ); - sampleRecord[ ("Preferred address: Postal code" ) ] = QString( "preferedAddressPostalCode" ); - sampleRecord[ ("Preferred address: Country" ) ] = QString( "preferedAddressCountry" ); - sampleRecord[ ("Preferred address: Label" ) ] = QString( "preferedAddressLabel" ); + sampleRecord[ ("Preferred address: Street" ) ] = TQString( "preferedAddressStreet" ); + sampleRecord[ ("Preferred address: Locality" ) ] = TQString( "preferedAddressLocality" ); + sampleRecord[ ("Preferred address: Region" ) ] = TQString( "preferedAddressRegion" ); + sampleRecord[ ("Preferred address: Postal code" ) ] = TQString( "preferedAddressPostalCode" ); + sampleRecord[ ("Preferred address: Country" ) ] = TQString( "preferedAddressCountry" ); + sampleRecord[ ("Preferred address: Label" ) ] = TQString( "preferedAddressLabel" ); } @@ -100,14 +100,14 @@ KWMailMergeKABC::~KWMailMergeKABC() } -void KWMailMergeKABC::addEntry( const QString &uid ) +void KWMailMergeKABC::addEntry( const TQString &uid ) { _individualUIDs.append( uid ); makeUIDsExclusive(); } -void KWMailMergeKABC::addList( const QString &id ) +void KWMailMergeKABC::addList( const TQString &id ) { _lists.append( id ); parseList( id ); @@ -131,7 +131,7 @@ int KWMailMergeKABC::getNumRecords() const } -QString KWMailMergeKABC::getValue( const QString &name, int record ) const +TQString KWMailMergeKABC::getValue( const TQString &name, int record ) const { kdDebug() << "KWMailMergeKABC::getValue(" << name << ", " << record << ")" << endl; if ( record < 0 ) @@ -168,7 +168,7 @@ QString KWMailMergeKABC::getValue( const QString &name, int record ) const if( !uidAvailable ) { - return ( i18n ( "KAddressbook entry '%1' not available." ).arg( *_UIDIterator ) ); + return ( i18n ( "KAddressbook entry '%1' not available." ).tqarg( *_UIDIterator ) ); } @@ -342,24 +342,24 @@ QString KWMailMergeKABC::getValue( const QString &name, int record ) const if ( name == "Time zone" ) { KABC::TimeZone zone = addr.timeZone(); - return QString::number( zone.offset() ); + return TQString::number( zone.offset() ); } if ( name == "Geographic position" ) { KABC::Geo geo = addr.geo(); - QString lat; - QString longi; + TQString lat; + TQString longi; if( geo.latitude()<0 ) - lat = QString( i18n("%1 South") ).arg( -geo.latitude() ); + lat = TQString( i18n("%1 South") ).tqarg( -geo.latitude() ); else - lat = QString( i18n("%1 North") ).arg( geo.latitude() ); + lat = TQString( i18n("%1 North") ).tqarg( geo.latitude() ); if( geo.longitude()<0 ) // There is something going wrong, because "W" is replaced by "q ". // Needs fix. - longi = QString( i18n("%1 West") ).arg( -geo.longitude() ); + longi = TQString( i18n("%1 West") ).tqarg( -geo.longitude() ); else - longi = QString( i18n("%1 East") ).arg( geo.longitude() ); + longi = TQString( i18n("%1 East") ).tqarg( geo.longitude() ); return i18n( "Geographic coordinates", "%1, %2" ).arg ( lat, longi ); } @@ -390,34 +390,34 @@ QString KWMailMergeKABC::getValue( const QString &name, int record ) const } -QStringList KWMailMergeKABC::lists() const +TQStringList KWMailMergeKABC::lists() const { return _lists; } -void KWMailMergeKABC::load( QDomElement& parentElem ) +void KWMailMergeKABC::load( TQDomElement& tqparentElem ) { clear(); - QDomNode contentNode=parentElem.namedItem("CONTENT"); + TQDomNode contentNode=tqparentElem.namedItem("CONTENT"); if( contentNode.isNull() ) return; - for( QDomNode rec=contentNode.firstChild(); !rec.isNull(); rec=rec.nextSibling() ) + for( TQDomNode rec=contentNode.firstChild(); !rec.isNull(); rec=rec.nextSibling() ) { if( rec.nodeName()== "RECORD" ) { - for( QDomElement recEnt=rec.firstChild().toElement(); !recEnt.isNull(); + for( TQDomElement recEnt=rec.firstChild().toElement(); !recEnt.isNull(); recEnt=recEnt.nextSibling().toElement() ) { - addEntry( recEnt.attribute( QString::fromLatin1("uid") ) ); + addEntry( recEnt.attribute( TQString::tqfromLatin1("uid") ) ); } } else if( rec.nodeName() == "LIST" ) { - for( QDomElement recEnt=rec.firstChild().toElement(); !recEnt.isNull(); + for( TQDomElement recEnt=rec.firstChild().toElement(); !recEnt.isNull(); recEnt=recEnt.nextSibling().toElement() ) { - addList( recEnt.attribute( QString::fromLatin1("listid") ) ); + addList( recEnt.attribute( TQString::tqfromLatin1("listid") ) ); } } else @@ -432,8 +432,8 @@ void KWMailMergeKABC::makeUIDsExclusive() _exclusiveUIDs.sort(); kdDebug() << "KWMailMergeKABC::makeUIDsExclusive(): before: " << _exclusiveUIDs.join(",") << endl; - QString uid; - for( QStringList::Iterator it=_exclusiveUIDs.begin(); + TQString uid; + for( TQStringList::Iterator it=_exclusiveUIDs.begin(); it!=_exclusiveUIDs.end(); ++it ) { if( *it == uid ) @@ -447,7 +447,7 @@ void KWMailMergeKABC::makeUIDsExclusive() } -void KWMailMergeKABC::parseList( const QString& listName ) +void KWMailMergeKABC::parseList( const TQString& listName ) { if( listName.isEmpty() ) return; @@ -456,7 +456,7 @@ void KWMailMergeKABC::parseList( const QString& listName ) KABC::DistributionListManager dlm ( _addressBook ); dlm.load(); - QStringList::Iterator listIt; + TQStringList::Iterator listIt; KABC::DistributionList* list = dlm.list( listName ); KABC::DistributionList::Entry::List entries = list->entries(); @@ -480,33 +480,33 @@ void KWMailMergeKABC::refresh( bool ) } -void KWMailMergeKABC::save( QDomDocument& doc, QDomElement& parent) +void KWMailMergeKABC::save( TQDomDocument& doc, TQDomElement& tqparent) { - QDomElement cont=doc.createElement(QString::fromLatin1("CONTENT")); - parent.appendChild(cont); + TQDomElement cont=doc.createElement(TQString::tqfromLatin1("CONTENT")); + tqparent.appendChild(cont); - QValueList<QString>::ConstIterator it = _individualUIDs.begin(); + TQValueList<TQString>::ConstIterator it = _individualUIDs.begin(); for( ; it != _individualUIDs.end(); ++it ) { - QDomElement rec=doc.createElement(QString::fromLatin1("RECORD")); + TQDomElement rec=doc.createElement(TQString::tqfromLatin1("RECORD")); cont.appendChild(rec); - QDomElement recEnt=doc.createElement(QString::fromLatin1("ITEM")); - recEnt.setAttribute(QString::fromLatin1("uid"),*it); + TQDomElement recEnt=doc.createElement(TQString::tqfromLatin1("ITEM")); + recEnt.setAttribute(TQString::tqfromLatin1("uid"),*it); rec.appendChild(recEnt); } it = _lists.begin(); for( ; !(it == _lists.end()); ++it ) { - QDomElement rec=doc.createElement(QString::fromLatin1("LIST")); + TQDomElement rec=doc.createElement(TQString::tqfromLatin1("LIST")); cont.appendChild(rec); - QDomElement recEnt=doc.createElement(QString::fromLatin1("ITEM")); - recEnt.setAttribute(QString::fromLatin1("listid"),*it); + TQDomElement recEnt=doc.createElement(TQString::tqfromLatin1("ITEM")); + recEnt.setAttribute(TQString::tqfromLatin1("listid"),*it); rec.appendChild(recEnt); } } -bool KWMailMergeKABC::showConfigDialog( QWidget* par, int action ) +bool KWMailMergeKABC::showConfigDialog( TQWidget* par, int action ) { bool ret=false; if (action == KWSLCreate ) @@ -518,7 +518,7 @@ bool KWMailMergeKABC::showConfigDialog( QWidget* par, int action ) { KWMailMergeKABCConfig *dia=new KWMailMergeKABCConfig( par, this ); - ret=( dia->exec() == QDialog::Accepted ); + ret=( dia->exec() == TQDialog::Accepted ); kdDebug() << "KWMailMergeKABCConfig::Accepted " << ret << endl; delete dia; } @@ -528,7 +528,7 @@ bool KWMailMergeKABC::showConfigDialog( QWidget* par, int action ) } -QStringList KWMailMergeKABC::singleRecords() const +TQStringList KWMailMergeKABC::singleRecords() const { return _individualUIDs; } @@ -537,9 +537,9 @@ QStringList KWMailMergeKABC::singleRecords() const extern "C" { - KWORD_MAILMERGE_EXPORT KWMailMergeDataSource *create_kwmailmerge_kabc( KInstance *inst, QObject *parent ) + KWORD_MAILMERGE_EXPORT KWMailMergeDataSource *create_kwmailmerge_kabc( KInstance *inst, TQObject *tqparent ) { - return new KWMailMergeKABC( inst, parent ); + return new KWMailMergeKABC( inst, tqparent ); } } diff --git a/kword/mailmerge/kabc/KWMailMergeKABC.h b/kword/mailmerge/kabc/KWMailMergeKABC.h index 2787ac6f..f2754117 100644 --- a/kword/mailmerge/kabc/KWMailMergeKABC.h +++ b/kword/mailmerge/kabc/KWMailMergeKABC.h @@ -23,8 +23,8 @@ #ifndef _KWMAILMERGE_KABC_H_ #define _KWMAILMERGE_KABC_H_ -#include <qdom.h> -#include <qguardedptr.h> +#include <tqdom.h> +#include <tqguardedptr.h> #include <kabc/addressbook.h> @@ -33,20 +33,21 @@ class KWMailMergeKABC: public KWMailMergeDataSource { Q_OBJECT + TQ_OBJECT public: - KWMailMergeKABC( KInstance *inst, QObject *parent ); + KWMailMergeKABC( KInstance *inst, TQObject *tqparent ); ~KWMailMergeKABC(); /** Saves the mail merge list to the kword document. */ - virtual void save( QDomDocument&, QDomElement& ); + virtual void save( TQDomDocument&, TQDomElement& ); /** Loads the mail merge list stored in the kword document. */ - virtual void load( QDomElement& ); + virtual void load( TQDomElement& ); /** @param name The name of the value e.g. "Family name". @@ -55,7 +56,7 @@ public: If @p record equals -1, @p name is returned. */ - virtual class QString getValue( const class QString &name, int record = -1 ) const; + virtual class TQString getValue( const class TQString &name, int record = -1 ) const; /** @return The number of available contacts in mail merge list. @@ -72,7 +73,7 @@ public: /** Shows a KWMailMergeKABCConfig dialog for selecting entries from KAddressbook. */ - virtual bool showConfigDialog( QWidget*, int action); + virtual bool showConfigDialog( TQWidget*, int action); protected: friend class KWMailMergeKABCConfig; @@ -86,7 +87,7 @@ protected: @param uid The entry's KABC::Addressee::uid(). */ - void addEntry( const QString &uid ); + void addEntry( const TQString &uid ); /** Adds a distribution list to the mail merge list. @@ -96,7 +97,7 @@ protected: @param id The DistributionList::name(). */ - void addList( const QString &id ); + void addList( const TQString &id ); /** Removes all entries and distribution lists from the mail merge list. @@ -108,7 +109,7 @@ protected: To be called by KWMailMergeKABCConfig::initSelectedLists() */ - virtual QStringList lists() const; + virtual TQStringList lists() const; /** @return The KABC::Addressee::uid() of all individually selected @@ -116,7 +117,7 @@ protected: To be called by KWMailMergeKABCConfig::initSelectedAddressees() */ - virtual QStringList singleRecords() const; + virtual TQStringList singleRecords() const; private: /** @@ -132,47 +133,47 @@ private: /** Just an Iterator. */ - mutable QStringList::ConstIterator _UIDIterator; + mutable TQStringList::ConstIterator _UIDIterator; /** - The "real" mail merge list. A list of QStrings. Each represents + The "real" mail merge list. A list of TQStrings. Each represents the KABC::Addressee::uid() of a KAdressbook entry. There is no UID twice in this list. Needed because selected contacts may appear in a selected distribution list, too. And we don't want to print it multiple. */ - QStringList _exclusiveUIDs; + TQStringList _exclusiveUIDs; /** This list contains all the KABC::Addressee::uid() selected individually with the KWMailMergeKABCConfig dialog. */ - QStringList _individualUIDs; + TQStringList _individualUIDs; /** This list contains all the KABC::Addressee::uid() from the distribution lists selected with the KWMailMergeKABCConfig dialog. */ - QStringList _listUIDs; + TQStringList _listUIDs; /** This list contains all the DistributionList::name() selected with the KWMailMergeKABCConfig dialog. */ - QStringList _lists; + TQStringList _lists; /** Appends all KABC::Addressee::uid() of a distribution list to _listUIDs and updates the mail merge list. - To be used by KWMailMergeKABCConfig::addList( const QString &id ) + To be used by KWMailMergeKABCConfig::addList( const TQString &id ) only. @param listName The DistributionList::name() of the distribution list. */ - void parseList( const QString& listName ); + void parseList( const TQString& listName ); /** Removes duplicate entries in the mail merge list. diff --git a/kword/mailmerge/kabc/KWMailMergeKABCConfig.cpp b/kword/mailmerge/kabc/KWMailMergeKABCConfig.cpp index dee519c3..1e54d0b9 100644 --- a/kword/mailmerge/kabc/KWMailMergeKABCConfig.cpp +++ b/kword/mailmerge/kabc/KWMailMergeKABCConfig.cpp @@ -19,9 +19,9 @@ */ -#include <qvbox.h> -#include <qlayout.h> -#include <qlineedit.h> +#include <tqvbox.h> +#include <tqlayout.h> +#include <tqlineedit.h> #include <kapplication.h> #include <kdebug.h> @@ -39,13 +39,13 @@ #include "KWMailMergeKABCConfig.h" -KWMailMergeKABCConfig::KWMailMergeKABCConfig( QWidget *parent, KWMailMergeKABC *db_) +KWMailMergeKABCConfig::KWMailMergeKABCConfig( TQWidget *tqparent, KWMailMergeKABC *db_) :KDialogBase( Plain, i18n( "Mail Merge - Editor" ), - Ok | Cancel, Ok, parent, "", true) + Ok | Cancel, Ok, tqparent, "", true) { _db = db_; - (new QVBoxLayout(plainPage()))->setAutoAdd(true); + (new TQVBoxLayout(plainPage()))->setAutoAdd(true); setMainWidget( _ui=new AddressPickerUI( plainPage() ) ); updateAvailable(); @@ -65,13 +65,13 @@ void KWMailMergeKABCConfig::acceptSelection() { _db->clear(); - QListViewItem* top = _ui->mSelectedView->firstChild(); + TQListViewItem* top = _ui->mSelectedView->firstChild(); while(top) { kdDebug() << "acceptSelection(): " << top->text(0) << endl; if( top->text(0) == i18n("Distribution Lists") ) { - QListViewItem* item = top->firstChild(); + TQListViewItem* item = top->firstChild(); while(item) { kdDebug() << "acceptSelection(): " << item->text(0) << endl; @@ -81,7 +81,7 @@ void KWMailMergeKABCConfig::acceptSelection() } else if( top->text(0) == i18n("Single Entries") ) { - QListViewItem* item = top->firstChild(); + TQListViewItem* item = top->firstChild(); while(item) { kdDebug() << "acceptSelection(): " << item->text(0) << endl; @@ -97,16 +97,16 @@ void KWMailMergeKABCConfig::acceptSelection() void KWMailMergeKABCConfig::addSelectedContacts() { - QListViewItemIterator it( _ui->mAvailableView, QListViewItemIterator::Selected ); - QListViewItem* selected = _ui->mSelectedView->findItem( - i18n("Single Entries"), 0, Qt::ExactMatch ); - QListViewItem* selectedLists = _ui->mSelectedView->findItem( - i18n("Distribution Lists"), 0, Qt::ExactMatch ); + TQListViewItemIterator it( _ui->mAvailableView, TQListViewItemIterator::Selected ); + TQListViewItem* selected = _ui->mSelectedView->tqfindItem( + i18n("Single Entries"), 0, TQt::ExactMatch ); + TQListViewItem* selectedLists = _ui->mSelectedView->tqfindItem( + i18n("Distribution Lists"), 0, TQt::ExactMatch ); while ( it.current() ) { if( it.current()->depth() > 0 ) { - QString uid = it.current()->text( -1 ); + TQString uid = it.current()->text( -1 ); kdDebug() << "addSelectedContacts(): uid :" << uid << endl; if( !uid.isEmpty() ) { @@ -119,7 +119,7 @@ void KWMailMergeKABCConfig::addSelectedContacts() destroyAvailableClones( uid ); } } - else if( it.current()->parent()->text(0) == i18n("Distribution Lists") ) + else if( it.current()->tqparent()->text(0) == i18n("Distribution Lists") ) { if( selectedLists ) { @@ -134,12 +134,12 @@ void KWMailMergeKABCConfig::addSelectedContacts() } -void KWMailMergeKABCConfig::destroyAvailableClones( const QString& uid ) +void KWMailMergeKABCConfig::destroyAvailableClones( const TQString& uid ) { if( uid.isEmpty() ) return; - QListViewItemIterator it( _ui->mAvailableView ); + TQListViewItemIterator it( _ui->mAvailableView ); while ( it.current() ) { @@ -155,18 +155,18 @@ void KWMailMergeKABCConfig::destroyAvailableClones( const QString& uid ) } -void KWMailMergeKABCConfig::filterChanged( const QString& txt ) +void KWMailMergeKABCConfig::filterChanged( const TQString& txt ) { kdDebug() << "KWMailMergeKABCConfig::filterChanged( " << txt << " )" << endl; bool showAll = txt.isEmpty(); - QListViewItem* category = _ui->mAvailableView->firstChild(); + TQListViewItem* category = _ui->mAvailableView->firstChild(); while(category) { if( category->text(0)!=i18n("Distribution Lists") ) { - QListViewItem* item = category->firstChild(); + TQListViewItem* item = category->firstChild(); while(item) { if(showAll) @@ -175,7 +175,7 @@ void KWMailMergeKABCConfig::filterChanged( const QString& txt ) } else { - item->setVisible( item->text(0).contains( txt, false ) ); + item->setVisible( item->text(0).tqcontains( txt, false ) ); } item = item->nextSibling(); } @@ -192,11 +192,11 @@ void KWMailMergeKABCConfig::filterChanged( const QString& txt ) void KWMailMergeKABCConfig::initSelectedAddressees() { - QStringList records = _db->singleRecords(); + TQStringList records = _db->singleRecords(); - QListViewItem* category = _ui->mAvailableView->firstChild(); - QListViewItem* selected = _ui->mSelectedView->findItem( - i18n("Single Entries"), 0, Qt::ExactMatch ); + TQListViewItem* category = _ui->mAvailableView->firstChild(); + TQListViewItem* selected = _ui->mSelectedView->tqfindItem( + i18n("Single Entries"), 0, TQt::ExactMatch ); while ( category && (records.count()>0) ) { if( category->text(0) != i18n("Distribution Lists") ) @@ -210,10 +210,10 @@ void KWMailMergeKABCConfig::initSelectedAddressees() KWMailMergeKABCConfigListItem* nextItem = static_cast<KWMailMergeKABCConfigListItem*> ( item->nextSibling() ); - for( QStringList::Iterator itRecords = records.begin(); + for( TQStringList::Iterator itRecords = records.begin(); itRecords != records.end(); ++itRecords ) { - QString uid = *itRecords; + TQString uid = *itRecords; if( item->text(-1) == uid ) { selected->insertItem( item ); @@ -235,24 +235,24 @@ void KWMailMergeKABCConfig::initSelectedAddressees() void KWMailMergeKABCConfig::initSelectedLists() { - QStringList lists = _db->lists(); + TQStringList lists = _db->lists(); kdDebug() << "::initSelectedLists()" << lists.join(",") << endl; - QListViewItem* l = _ui->mAvailableView->findItem( - i18n("Distribution Lists"), 0, Qt::ExactMatch ); - QListViewItem* selected = _ui->mSelectedView->findItem( - i18n("Distribution Lists"), 0, Qt::ExactMatch ); + TQListViewItem* l = _ui->mAvailableView->tqfindItem( + i18n("Distribution Lists"), 0, TQt::ExactMatch ); + TQListViewItem* selected = _ui->mSelectedView->tqfindItem( + i18n("Distribution Lists"), 0, TQt::ExactMatch ); - QListViewItem* item = ( l->firstChild() ); + TQListViewItem* item = ( l->firstChild() ); while( item && (lists.count()>0) ) { - QListViewItem* nextItem = item->nextSibling(); + TQListViewItem* nextItem = item->nextSibling(); - for( QStringList::Iterator itLists = lists.begin(); + for( TQStringList::Iterator itLists = lists.begin(); itLists != lists.end(); ++itLists ) { - QString id = *itLists; + TQString id = *itLists; if( item->text(0) == id ) { selected->insertItem( item ); @@ -267,34 +267,34 @@ void KWMailMergeKABCConfig::initSelectedLists() void KWMailMergeKABCConfig::initSlotSignalConnections() { - connect( this, SIGNAL( okClicked() ), SLOT( acceptSelection() ) ); - connect( _ui->mAddButton, SIGNAL( clicked() ), SLOT( addSelectedContacts() ) ); - connect( _ui->mAddressBook, SIGNAL( clicked() ), SLOT( launchAddressbook() ) ); - - connect( _ui->mAvailableView, SIGNAL( doubleClicked( QListViewItem *, const QPoint &, int ) ), - SLOT( addSelectedContacts() ) ); - - connect( _ui->mFilterEdit, SIGNAL( textChanged(const QString &) ), - SLOT( filterChanged(const QString &) ) ); - connect( _ui->mRemoveButton, SIGNAL( clicked() ), SLOT( removeSelectedContacts() ) ); - connect( _ui->mSaveList, SIGNAL( clicked() ), SLOT( saveDistributionList() ) ); - connect( _ui->mSelectedView, SIGNAL( doubleClicked( QListViewItem *, const QPoint &, int ) ), - SLOT( removeSelectedContacts() ) ); + connect( this, TQT_SIGNAL( okClicked() ), TQT_SLOT( acceptSelection() ) ); + connect( _ui->mAddButton, TQT_SIGNAL( clicked() ), TQT_SLOT( addSelectedContacts() ) ); + connect( _ui->mAddressBook, TQT_SIGNAL( clicked() ), TQT_SLOT( launchAddressbook() ) ); + + connect( _ui->mAvailableView, TQT_SIGNAL( doubleClicked( TQListViewItem *, const TQPoint &, int ) ), + TQT_SLOT( addSelectedContacts() ) ); + + connect( _ui->mFilterEdit, TQT_SIGNAL( textChanged(const TQString &) ), + TQT_SLOT( filterChanged(const TQString &) ) ); + connect( _ui->mRemoveButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeSelectedContacts() ) ); + connect( _ui->mSaveList, TQT_SIGNAL( clicked() ), TQT_SLOT( saveDistributionList() ) ); + connect( _ui->mSelectedView, TQT_SIGNAL( doubleClicked( TQListViewItem *, const TQPoint &, int ) ), + TQT_SLOT( removeSelectedContacts() ) ); } void KWMailMergeKABCConfig::launchAddressbook() const { - kapp->startServiceByDesktopName( "kaddressbook", QString() ); + kapp->startServiceByDesktopName( "kaddressbook", TQString() ); } -void KWMailMergeKABCConfig::removeContact( QListViewItem* item ) +void KWMailMergeKABCConfig::removeContact( TQListViewItem* item ) { - QStringList& categories = _usedCategories; - QListViewItem* availableLists = _ui->mAvailableView->findItem( - i18n("Distribution Lists"), 0, Qt::ExactMatch ); + TQStringList& categories = _usedCategories; + TQListViewItem* availableLists = _ui->mAvailableView->tqfindItem( + i18n("Distribution Lists"), 0, TQt::ExactMatch ); if( item->depth() > 0 ) { if( !item->text( -1 ).isEmpty() ) // remove selected single entry here @@ -302,14 +302,14 @@ void KWMailMergeKABCConfig::removeContact( QListViewItem* item ) KWMailMergeKABCConfigListItem* rightItem = static_cast<KWMailMergeKABCConfigListItem*> ( item ); - QStringList entryCategories = rightItem->addressee().categories(); - for ( QStringList::Iterator itEntryCat = entryCategories.begin(); + TQStringList entryCategories = rightItem->addressee().categories(); + for ( TQStringList::Iterator itEntryCat = entryCategories.begin(); itEntryCat != entryCategories.end(); ++itEntryCat ) { - int i = categories.findIndex(*itEntryCat); + int i = categories.tqfindIndex(*itEntryCat); if( i == -1 ) { - QListViewItem* category = new QListViewItem( _ui->mAvailableView, + TQListViewItem* category = new TQListViewItem( _ui->mAvailableView, *itEntryCat ); categories.append( *itEntryCat ); @@ -320,23 +320,23 @@ void KWMailMergeKABCConfig::removeContact( QListViewItem* item ) { KWMailMergeKABCConfigListItem* leftItem = new KWMailMergeKABCConfigListItem( - _ui->mAvailableView->findItem( + _ui->mAvailableView->tqfindItem( *itEntryCat, 0, - Qt::ExactMatch), + TQt::ExactMatch), rightItem->addressee() ); } } if( entryCategories.isEmpty() ) { - QString noCat = i18n("no category"); + TQString noCat = i18n("no category"); KWMailMergeKABCConfigListItem* leftItem = new KWMailMergeKABCConfigListItem( - _ui->mAvailableView->findItem( - noCat, 0, Qt::ExactMatch), + _ui->mAvailableView->tqfindItem( + noCat, 0, TQt::ExactMatch), rightItem->addressee() ); } delete item; } - else if( item->parent()->text(0) == i18n("Distribution Lists") ) // remove a list + else if( item->tqparent()->text(0) == i18n("Distribution Lists") ) // remove a list { if( availableLists ) availableLists->insertItem( item ); @@ -346,7 +346,7 @@ void KWMailMergeKABCConfig::removeContact( QListViewItem* item ) void KWMailMergeKABCConfig::removeSelectedContacts() { - QListViewItemIterator it( _ui->mSelectedView, QListViewItemIterator::Selected ); + TQListViewItemIterator it( _ui->mSelectedView, TQListViewItemIterator::Selected ); while( it.current() ) { @@ -364,9 +364,9 @@ void KWMailMergeKABCConfig::saveDistributionList() dlm.load(); bool ok = false; - QString listName = KInputDialog::getText( i18n("New Distribution List"), + TQString listName = KInputDialog::getText( i18n("New Distribution List"), i18n("Please enter name:"), - QString::null, &ok, + TQString(), &ok, this ); if ( !ok || listName.isEmpty() ) return; @@ -376,15 +376,15 @@ void KWMailMergeKABCConfig::saveDistributionList() KMessageBox::information( 0, i18n( "<qt>Distribution list with the given name <b>%1</b> " "already exists. Please select a different name.</qt>" ) - .arg( listName ) ); + .tqarg( listName ) ); return; } KABC::DistributionList *distList = new KABC::DistributionList( &dlm, listName ); - QListViewItem* newListItem = new QListViewItem( _ui->mSelectedView->findItem( - i18n("Distribution Lists"),0 , Qt::ExactMatch), listName ); + TQListViewItem* newListItem = new TQListViewItem( _ui->mSelectedView->tqfindItem( + i18n("Distribution Lists"),0 , TQt::ExactMatch), listName ); - QListViewItem* category = _ui->mSelectedView->firstChild(); + TQListViewItem* category = _ui->mSelectedView->firstChild(); while(category) { if( category->text(0)==i18n("Single Entries") ) @@ -397,15 +397,15 @@ void KWMailMergeKABCConfig::saveDistributionList() distList->insertEntry( item->addressee() ); KABC::Addressee addr = item->addressee(); - QString formattedName = addr.formattedName(); - QListViewItem* newItem = new QListViewItem( + TQString formattedName = addr.formattedName(); + TQListViewItem* newItem = new TQListViewItem( newListItem, item->addressee().formattedName() ); newItem->setEnabled( false ); item = static_cast<KWMailMergeKABCConfigListItem*>( item->nextSibling() ); } - QListViewItemIterator it ( category->firstChild() ); + TQListViewItemIterator it ( category->firstChild() ); while( it.current() ) { removeContact( it.current() ); @@ -428,10 +428,10 @@ void KWMailMergeKABCConfig::updateAvailable() // // First append the addressees. // - QListViewItem* noCategory = new QListViewItem( _ui->mAvailableView, + TQListViewItem* noCategory = new TQListViewItem( _ui->mAvailableView, i18n("no category") ); - QStringList& categories = _usedCategories ; + TQStringList& categories = _usedCategories ; categories.clear(); KABC::AddressBook *addressBook = KABC::StdAddressBook::self(); @@ -439,16 +439,16 @@ void KWMailMergeKABCConfig::updateAvailable() itAddr != addressBook->end(); ++itAddr ) { - QStringList entryCategories = itAddr->categories(); - for ( QStringList::Iterator itCat = entryCategories.begin(); + TQStringList entryCategories = itAddr->categories(); + for ( TQStringList::Iterator itCat = entryCategories.begin(); itCat != entryCategories.end(); ++itCat ) { - int i = categories.findIndex(*itCat); + int i = categories.tqfindIndex(*itCat); // Create category, if not yet in listview and append item to it. if( i == -1 ) { - QListViewItem* category = new QListViewItem( _ui->mAvailableView, *itCat ); + TQListViewItem* category = new TQListViewItem( _ui->mAvailableView, *itCat ); categories.append( *itCat ); KWMailMergeKABCConfigListItem* item = new KWMailMergeKABCConfigListItem( @@ -458,8 +458,8 @@ void KWMailMergeKABCConfig::updateAvailable() else { KWMailMergeKABCConfigListItem* item = new KWMailMergeKABCConfigListItem( - _ui->mAvailableView->findItem( - *itCat, 0, Qt::ExactMatch), + _ui->mAvailableView->tqfindItem( + *itCat, 0, TQt::ExactMatch), *itAddr ); } @@ -478,11 +478,11 @@ void KWMailMergeKABCConfig::updateAvailable() KABC::DistributionListManager dlm ( addressBook ); dlm.load(); - QStringList distributionLists = dlm.listNames(); - QListViewItem* distributionListsItem = new QListViewItem( _ui->mAvailableView, + TQStringList distributionLists = dlm.listNames(); + TQListViewItem* distributionListsItem = new TQListViewItem( _ui->mAvailableView, i18n("Distribution Lists") ); - QStringList::Iterator itDistributionLists; + TQStringList::Iterator itDistributionLists; for( itDistributionLists = distributionLists.begin(); itDistributionLists != distributionLists.end(); ++itDistributionLists ) @@ -491,15 +491,15 @@ void KWMailMergeKABCConfig::updateAvailable() KABC::DistributionList::Entry::List entries = list->entries(); - QListViewItem* listItem = new QListViewItem( distributionListsItem, + TQListViewItem* listItem = new TQListViewItem( distributionListsItem, *itDistributionLists ); KABC::DistributionList::Entry::List::Iterator itList; for ( itList = entries.begin(); itList != entries.end(); ++itList ) { - // Create a normal QListViewItem and disable it, because this is not a + // Create a normal TQListViewItem and disable it, because this is not a // distribution-list-editor. KAddressbook should be used instead. - QListViewItem* item = new QListViewItem( + TQListViewItem* item = new TQListViewItem( listItem, (*itList).addressee.formattedName() ); item->setEnabled( false ); } @@ -509,15 +509,15 @@ void KWMailMergeKABCConfig::updateAvailable() -KWMailMergeKABCConfigListItem::KWMailMergeKABCConfigListItem( QListView *parent, - const KABC::Addressee& addressEntry ) : QListViewItem( parent ) +KWMailMergeKABCConfigListItem::KWMailMergeKABCConfigListItem( TQListView *tqparent, + const KABC::Addressee& addressEntry ) : TQListViewItem( tqparent ) { setText( 0, addressEntry.formattedName() ); _addressEntry = addressEntry; } -KWMailMergeKABCConfigListItem::KWMailMergeKABCConfigListItem( QListViewItem *parent, - const KABC::Addressee& addressEntry ) : QListViewItem( parent ) +KWMailMergeKABCConfigListItem::KWMailMergeKABCConfigListItem( TQListViewItem *tqparent, + const KABC::Addressee& addressEntry ) : TQListViewItem( tqparent ) { setText( 0, addressEntry.formattedName() ); _addressEntry = addressEntry; @@ -531,7 +531,7 @@ KABC::Addressee KWMailMergeKABCConfigListItem::addressee() const return _addressEntry; } -QString KWMailMergeKABCConfigListItem::text( int column ) const +TQString KWMailMergeKABCConfigListItem::text( int column ) const { if( column == -1 ) { @@ -539,7 +539,7 @@ QString KWMailMergeKABCConfigListItem::text( int column ) const } else { - return QListViewItem::text( column ); + return TQListViewItem::text( column ); } } diff --git a/kword/mailmerge/kabc/KWMailMergeKABCConfig.h b/kword/mailmerge/kabc/KWMailMergeKABCConfig.h index 335574b8..32fe74cd 100644 --- a/kword/mailmerge/kabc/KWMailMergeKABCConfig.h +++ b/kword/mailmerge/kabc/KWMailMergeKABCConfig.h @@ -34,8 +34,9 @@ class KWMailMergeKABC; class KWMailMergeKABCConfig: public KDialogBase { Q_OBJECT + TQ_OBJECT public: - KWMailMergeKABCConfig( QWidget *parent, KWMailMergeKABC *db_ ); + KWMailMergeKABCConfig( TQWidget *tqparent, KWMailMergeKABC *db_ ); virtual ~KWMailMergeKABCConfig(); @@ -57,14 +58,14 @@ private slots: void launchAddressbook() const; /** - Updates the parent's mail merge list from items in the right Listview. + Updates the tqparent's mail merge list from items in the right Listview. */ void acceptSelection(); /** Hides items in the left listview, which are not matching @p txt. */ - void filterChanged( const QString& txt ); + void filterChanged( const TQString& txt ); /** Saves the selected single entries to a new KABC::DistributionList in KAddressbook. @@ -79,7 +80,7 @@ private: /** Store all categories used in the addressbook, to avoid some iterator cycles. */ - QStringList _usedCategories; + TQStringList _usedCategories; /** The mail merge list. @@ -87,17 +88,17 @@ private: KWMailMergeKABC *_db; /** - Removes duplicates in the left QListView, when moving an item to the right. + Removes duplicates in the left TQListView, when moving an item to the right. */ - void destroyAvailableClones( const QString& uid ); + void destroyAvailableClones( const TQString& uid ); /** - Appends the previously selected entries to the right QListView. + Appends the previously selected entries to the right TQListView. */ void initSelectedAddressees(); /** - Appends the previously selected distribution lists to the right QListView. + Appends the previously selected distribution lists to the right TQListView. */ void initSelectedLists(); @@ -111,22 +112,22 @@ private: Called by KWMailMergeKABCConfig::removeSelectedContacts(). */ - void removeContact( QListViewItem* item ); + void removeContact( TQListViewItem* item ); /** Appends all KAddressbook entries in KABC::StdAddressBook::self() and all - KABC::DistributionLists to the left QListView. + KABC::DistributionLists to the left TQListView. */ void updateAvailable(); }; -class KWMailMergeKABCConfigListItem : public QListViewItem +class KWMailMergeKABCConfigListItem : public TQListViewItem { public: - KWMailMergeKABCConfigListItem( QListView *parent, const KABC::Addressee& addressEntry ); - KWMailMergeKABCConfigListItem( QListViewItem *parent, const KABC::Addressee& addressEntry ); + KWMailMergeKABCConfigListItem( TQListView *tqparent, const KABC::Addressee& addressEntry ); + KWMailMergeKABCConfigListItem( TQListViewItem *tqparent, const KABC::Addressee& addressEntry ); virtual ~KWMailMergeKABCConfigListItem(); /** @@ -135,11 +136,11 @@ public: KABC::Addressee addressee() const; /** - This is an overloaded member function of QListViewItem::text( int column ). + This is an overloaded member function of TQListViewItem::text( int column ). It Returns the KABC::Addressee::uid(), if column is set to -1. - Otherwise QListViewItem::text( int column ) is returned. + Otherwise TQListViewItem::text( int column ) is returned. */ - QString text( int column ) const; + TQString text( int column ) const; private: diff --git a/kword/mailmerge/kabc/addresspicker.ui b/kword/mailmerge/kabc/addresspicker.ui index ec179c3b..40521704 100644 --- a/kword/mailmerge/kabc/addresspicker.ui +++ b/kword/mailmerge/kabc/addresspicker.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.2" stdsetdef="1"> <class>AddressPickerUI</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>AddressPickerUI</cstring> </property> @@ -19,9 +19,9 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget" row="1" column="1"> + <widget class="TQLayoutWidget" row="1" column="1"> <property name="name"> - <cstring>layout10</cstring> + <cstring>tqlayout10</cstring> </property> <vbox> <property name="name"> @@ -37,7 +37,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>16</height> @@ -76,7 +76,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> @@ -85,7 +85,7 @@ </spacer> </vbox> </widget> - <widget class="QPushButton" row="2" column="2"> + <widget class="TQPushButton" row="2" column="2"> <property name="name"> <cstring>mSaveList</cstring> </property> @@ -99,15 +99,15 @@ <string>Save selected single entries to a new distribution list.</string> </property> </widget> - <widget class="QLayoutWidget" row="2" column="0"> + <widget class="TQLayoutWidget" row="2" column="0"> <property name="name"> - <cstring>layout1</cstring> + <cstring>tqlayout1</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>TextLabel2</cstring> </property> @@ -118,7 +118,7 @@ <cstring>mFilterEdit</cstring> </property> </widget> - <widget class="QLineEdit"> + <widget class="TQLineEdit"> <property name="name"> <cstring>mFilterEdit</cstring> </property> @@ -194,7 +194,7 @@ <bool>true</bool> </property> </widget> - <widget class="QPushButton" row="2" column="1"> + <widget class="TQPushButton" row="2" column="1"> <property name="name"> <cstring>mAddressBook</cstring> </property> @@ -205,7 +205,7 @@ <string>Launch KAddressbook</string> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -217,14 +217,14 @@ <property name="text"> <string>&Address Book</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>WordBreak|AlignCenter</set> </property> <property name="buddy" stdset="0"> <cstring>mAvailableView</cstring> </property> </widget> - <widget class="QLabel" row="0" column="2"> + <widget class="TQLabel" row="0" column="2"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -236,7 +236,7 @@ <property name="text"> <string>&Selected Addresses</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>WordBreak|AlignCenter</set> </property> <property name="buddy" stdset="0"> @@ -287,7 +287,7 @@ </widget> </grid> </widget> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kpushbutton.h</includehint> <includehint>kpushbutton.h</includehint> |