diff options
Diffstat (limited to 'libkdepim/completionordereditor.cpp')
-rw-r--r-- | libkdepim/completionordereditor.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/libkdepim/completionordereditor.cpp b/libkdepim/completionordereditor.cpp index 4f797c2c1..b507d9b97 100644 --- a/libkdepim/completionordereditor.cpp +++ b/libkdepim/completionordereditor.cpp @@ -41,10 +41,10 @@ #include <klistview.h> #include <kpushbutton.h> -#include <qhbox.h> -#include <qvbox.h> -#include <qheader.h> -#include <qtoolbutton.h> +#include <tqhbox.h> +#include <tqvbox.h> +#include <tqheader.h> +#include <tqtoolbutton.h> #include <kapplication.h> #include <dcopclient.h> @@ -75,7 +75,7 @@ using namespace KPIM; namespace KPIM { -int CompletionItemList::compareItems( QPtrCollection::Item s1, QPtrCollection::Item s2 ) +int CompletionItemList::compareItems( TQPtrCollection::Item s1, TQPtrCollection::Item s2 ) { int w1 = ( (CompletionItem*)s1 )->completionWeight(); int w2 = ( (CompletionItem*)s2 )->completionWeight(); @@ -87,7 +87,7 @@ class LDAPCompletionItem : public CompletionItem { public: LDAPCompletionItem( LdapClient* ldapClient ) : mLdapClient( ldapClient ) {} - virtual QString label() const { return i18n( "LDAP server %1" ).arg( mLdapClient->server().host() ); } + virtual TQString label() const { return i18n( "LDAP server %1" ).arg( mLdapClient->server().host() ); } virtual int completionWeight() const { return mLdapClient->completionWeight(); } virtual void save( CompletionOrderEditor* ); protected: @@ -101,7 +101,7 @@ void LDAPCompletionItem::save( CompletionOrderEditor* ) { KConfig config( "kabldaprc" ); config.setGroup( "LDAP" ); - config.writeEntry( QString( "SelectedCompletionWeight%1" ).arg( mLdapClient->clientNumber() ), + config.writeEntry( TQString( "SelectedCompletionWeight%1" ).arg( mLdapClient->clientNumber() ), mWeight ); config.sync(); } @@ -110,18 +110,18 @@ void LDAPCompletionItem::save( CompletionOrderEditor* ) class SimpleCompletionItem : public CompletionItem { public: - SimpleCompletionItem( CompletionOrderEditor* editor, const QString& label, const QString& identifier ) + SimpleCompletionItem( CompletionOrderEditor* editor, const TQString& label, const TQString& identifier ) : mLabel( label ), mIdentifier( identifier ) { KConfigGroup group( editor->configFile(), "CompletionWeights" ); mWeight = group.readNumEntry( mIdentifier, 60 ); } - virtual QString label() const { return mLabel; } + virtual TQString label() const { return mLabel; } virtual int completionWeight() const { return mWeight; } virtual void save( CompletionOrderEditor* ); protected: virtual void setCompletionWeight( int weight ) { mWeight = weight; } private: - QString mLabel, mIdentifier; + TQString mLabel, mIdentifier; int mWeight; }; @@ -137,10 +137,10 @@ void SimpleCompletionItem::save( CompletionOrderEditor* editor ) class KABCImapSubResCompletionItem : public CompletionItem { public: - KABCImapSubResCompletionItem( ResourceABC* resource, const QString& subResource ) + KABCImapSubResCompletionItem( ResourceABC* resource, const TQString& subResource ) : mResource( resource ), mSubResource( subResource ), mWeight( completionWeight() ) {} - virtual QString label() const { - return QString( "%1 %2" ).arg( mResource->resourceName() ).arg( mResource->subresourceLabel( mSubResource ) ); + virtual TQString label() const { + return TQString( "%1 %2" ).arg( mResource->resourceName() ).arg( mResource->subresourceLabel( mSubResource ) ); } virtual int completionWeight() const { return mResource->subresourceCompletionWeight( mSubResource ); @@ -153,7 +153,7 @@ public: } private: ResourceABC* mResource; - QString mSubResource; + TQString mSubResource; int mWeight; }; @@ -162,8 +162,8 @@ private: class CompletionViewItem : public QListViewItem { public: - CompletionViewItem( QListView* lv, CompletionItem* item ) - : QListViewItem( lv, lv->lastItem(), item->label() ), mItem( item ) {} + CompletionViewItem( TQListView* lv, CompletionItem* item ) + : TQListViewItem( lv, lv->lastItem(), item->label() ), mItem( item ) {} CompletionItem* item() const { return mItem; } void setItem( CompletionItem* i ) { mItem = i; setText( 0, mItem->label() ); } @@ -172,25 +172,25 @@ private: }; CompletionOrderEditor::CompletionOrderEditor( KPIM::LdapSearch* ldapSearch, - QWidget* parent, const char* name ) + TQWidget* parent, const char* name ) : KDialogBase( parent, name, true, i18n("Edit Completion Order"), Ok|Cancel, Ok, true ), mConfig( "kpimcompletionorder" ), mDirty( false ) { mItems.setAutoDelete( true ); // The first step is to gather all the data, creating CompletionItem objects - QValueList< LdapClient* > ldapClients = ldapSearch->clients(); - for( QValueList<LdapClient*>::const_iterator it = ldapClients.begin(); it != ldapClients.end(); ++it ) { + TQValueList< LdapClient* > ldapClients = ldapSearch->clients(); + for( TQValueList<LdapClient*>::const_iterator it = ldapClients.begin(); it != ldapClients.end(); ++it ) { //kdDebug(5300) << "LDAP: host " << (*it)->host() << " weight " << (*it)->completionWeight() << endl; mItems.append( new LDAPCompletionItem( *it ) ); } KABC::AddressBook *addressBook = KABC::StdAddressBook::self( true ); - QPtrList<KABC::Resource> resources = addressBook->resources(); - for( QPtrListIterator<KABC::Resource> resit( resources ); *resit; ++resit ) { + TQPtrList<KABC::Resource> resources = addressBook->resources(); + for( TQPtrListIterator<KABC::Resource> resit( resources ); *resit; ++resit ) { //kdDebug(5300) << "KABC Resource: " << (*resit)->className() << endl; ResourceABC* res = dynamic_cast<ResourceABC *>( *resit ); if ( res ) { // IMAP KABC resource - const QStringList subresources = res->subresources(); - for( QStringList::const_iterator it = subresources.begin(); it != subresources.end(); ++it ) { + const TQStringList subresources = res->subresources(); + for( TQStringList::const_iterator it = subresources.begin(); it != subresources.end(); ++it ) { mItems.append( new KABCImapSubResCompletionItem( res, *it ) ); } } else { // non-IMAP KABC resource @@ -207,18 +207,18 @@ CompletionOrderEditor::CompletionOrderEditor( KPIM::LdapSearch* ldapSearch, // Now sort the items, then create the GUI mItems.sort(); - QHBox* page = makeHBoxMainWidget(); + TQHBox* page = makeHBoxMainWidget(); mListView = new KListView( page ); mListView->setSorting( -1 ); - mListView->addColumn( QString::null ); + mListView->addColumn( TQString::null ); mListView->header()->hide(); - for( QPtrListIterator<CompletionItem> compit( mItems ); *compit; ++compit ) { + for( TQPtrListIterator<CompletionItem> compit( mItems ); *compit; ++compit ) { new CompletionViewItem( mListView, *compit ); kdDebug(5300) << " " << (*compit)->label() << " " << (*compit)->completionWeight() << endl; } - QVBox* upDownBox = new QVBox( page ); + TQVBox* upDownBox = new TQVBox( page ); mUpButton = new KPushButton( upDownBox, "mUpButton" ); mUpButton->setIconSet( BarIconSet( "up", KIcon::SizeSmall ) ); mUpButton->setEnabled( false ); // b/c no item is selected yet @@ -229,20 +229,20 @@ CompletionOrderEditor::CompletionOrderEditor( KPIM::LdapSearch* ldapSearch, mDownButton->setEnabled( false ); // b/c no item is selected yet mDownButton->setFocusPolicy( StrongFocus ); - QWidget* spacer = new QWidget( upDownBox ); + TQWidget* spacer = new TQWidget( upDownBox ); upDownBox->setStretchFactor( spacer, 100 ); - connect( mListView, SIGNAL( selectionChanged( QListViewItem* ) ), - SLOT( slotSelectionChanged( QListViewItem* ) ) ); - connect( mUpButton, SIGNAL( clicked() ), this, SLOT( slotMoveUp() ) ); - connect( mDownButton, SIGNAL( clicked() ), this, SLOT( slotMoveDown() ) ); + connect( mListView, TQT_SIGNAL( selectionChanged( TQListViewItem* ) ), + TQT_SLOT( slotSelectionChanged( TQListViewItem* ) ) ); + connect( mUpButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotMoveUp() ) ); + connect( mDownButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotMoveDown() ) ); } CompletionOrderEditor::~CompletionOrderEditor() { } -void CompletionOrderEditor::slotSelectionChanged( QListViewItem *item ) +void CompletionOrderEditor::slotSelectionChanged( TQListViewItem *item ) { mDownButton->setEnabled( item && item->itemBelow() ); mUpButton->setEnabled( item && item->itemAbove() ); @@ -283,7 +283,7 @@ void CompletionOrderEditor::slotOk() { if ( mDirty ) { int w = 100; - for ( QListViewItem* it = mListView->firstChild(); it; it = it->nextSibling() ) { + for ( TQListViewItem* it = mListView->firstChild(); it; it = it->nextSibling() ) { CompletionViewItem *item = static_cast<CompletionViewItem *>( it ); item->item()->setCompletionWeight( w ); item->item()->save( this ); @@ -294,7 +294,7 @@ void CompletionOrderEditor::slotOk() // Emit DCOP signal // The emitter is always set to KPIM::IMAPCompletionOrder, so that the connect works // This is why we can't use k_dcop_signals here, but need to use emitDCOPSignal - kapp->dcopClient()->emitDCOPSignal( "KPIM::IMAPCompletionOrder", "orderChanged()", QByteArray() ); + kapp->dcopClient()->emitDCOPSignal( "KPIM::IMAPCompletionOrder", "orderChanged()", TQByteArray() ); } KDialogBase::slotOk(); } |