diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /libkdepim/addresseeselector.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdepim/addresseeselector.cpp')
-rw-r--r-- | libkdepim/addresseeselector.cpp | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/libkdepim/addresseeselector.cpp b/libkdepim/addresseeselector.cpp index 26562335f..5bd73b5d7 100644 --- a/libkdepim/addresseeselector.cpp +++ b/libkdepim/addresseeselector.cpp @@ -19,11 +19,11 @@ Boston, MA 02110-1301, USA. */ -#include <qheader.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qsignalmapper.h> -#include <qtoolbutton.h> +#include <tqheader.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqsignalmapper.h> +#include <tqtoolbutton.h> #include <kabc/stdaddressbook.h> #include <kcombobox.h> @@ -41,36 +41,36 @@ using namespace KPIM; class AddresseeSelector::AddressBookManager { public: - QStringList titles() const; + TQStringList titles() const; void addResource( KABC::Resource* ); - void addAddressBook( const QString &title, SelectionItem::List &list ); + void addAddressBook( const TQString &title, SelectionItem::List &list ); void clear(); bool contains( uint index, const SelectionItem& ); private: struct AddressBookEntry { - QString title; + TQString title; SelectionItem::List list; }; - QValueList<KABC::Resource*> mResources; - QValueList<AddressBookEntry> mAddressBooks; + TQValueList<KABC::Resource*> mResources; + TQValueList<AddressBookEntry> mAddressBooks; }; -QStringList AddresseeSelector::AddressBookManager::titles() const +TQStringList AddresseeSelector::AddressBookManager::titles() const { - QStringList titles; + TQStringList titles; // we've always an 'all' entry titles.append( i18n( "All" ) ); - QValueList<KABC::Resource*>::ConstIterator resIt; + TQValueList<KABC::Resource*>::ConstIterator resIt; for ( resIt = mResources.begin(); resIt != mResources.end(); ++resIt ) titles.append( (*resIt)->resourceName() ); - QValueList<AddressBookEntry>::ConstIterator abIt; + TQValueList<AddressBookEntry>::ConstIterator abIt; for ( abIt = mAddressBooks.begin(); abIt != mAddressBooks.end(); ++abIt ) titles.append( (*abIt).title ); @@ -83,7 +83,7 @@ void AddresseeSelector::AddressBookManager::addResource( KABC::Resource *resourc mResources.append( resource ); } -void AddresseeSelector::AddressBookManager::addAddressBook( const QString &title, +void AddresseeSelector::AddressBookManager::addAddressBook( const TQString &title, SelectionItem::List &list ) { AddressBookEntry entry; @@ -187,9 +187,9 @@ uint SelectionItem::index() const class SelectionViewItem : public QListViewItem { public: - SelectionViewItem( QListView *parent, Selection *selection, + SelectionViewItem( TQListView *parent, Selection *selection, SelectionItem *item ) - : QListViewItem( parent, "" ), mSelection( selection ), mItem( item ) + : TQListViewItem( parent, "" ), mSelection( selection ), mItem( item ) { if ( mItem->distributionList() == 0 ) mIcon = mSelection->itemIcon( mItem->addressee(), mItem->index() ); @@ -197,7 +197,7 @@ class SelectionViewItem : public QListViewItem mIcon = mSelection->distributionListIcon( mItem->distributionList() ); } - QString text( int column ) const + TQString text( int column ) const { if ( column == 0 ) { if ( mItem->distributionList() == 0 ) @@ -205,10 +205,10 @@ class SelectionViewItem : public QListViewItem else return mSelection->distributionListText( mItem->distributionList() ); } else - return QString::null; + return TQString::null; } - const QPixmap* pixmap( int column ) const + const TQPixmap* pixmap( int column ) const { if ( column == 0 ) { return &mIcon; @@ -221,14 +221,14 @@ class SelectionViewItem : public QListViewItem private: Selection *mSelection; SelectionItem *mItem; - QPixmap mIcon; + TQPixmap mIcon; }; -AddresseeSelector::AddresseeSelector( Selection *selection, QWidget *parent, const char *name ) - : QWidget( parent, name ), mSelection( selection ), mManager( 0 ) +AddresseeSelector::AddresseeSelector( Selection *selection, TQWidget *parent, const char *name ) + : TQWidget( parent, name ), mSelection( selection ), mManager( 0 ) { - mMoveMapper = new QSignalMapper( this ); - mRemoveMapper = new QSignalMapper( this ); + mMoveMapper = new TQSignalMapper( this ); + mRemoveMapper = new TQSignalMapper( this ); mAddressBookManager = new AddressBookManager(); @@ -250,33 +250,33 @@ AddresseeSelector::~AddresseeSelector() void AddresseeSelector::init() { - connect( KABC::StdAddressBook::self( true ), SIGNAL( addressBookChanged( AddressBook* ) ), - this, SLOT( reloadAddressBook() ) ); - connect( mAddresseeFilter, SIGNAL( textChanged( const QString& ) ), - this, SLOT( updateAddresseeView() ) ); - connect( mAddressBookCombo, SIGNAL( activated( int ) ), - this, SLOT( updateAddresseeView() ) ); - - connect( mMoveMapper, SIGNAL( mapped( int ) ), - this, SLOT( move( int ) ) ); - connect( mRemoveMapper, SIGNAL( mapped( int ) ), - this, SLOT( remove( int ) ) ); + connect( KABC::StdAddressBook::self( true ), TQT_SIGNAL( addressBookChanged( AddressBook* ) ), + this, TQT_SLOT( reloadAddressBook() ) ); + connect( mAddresseeFilter, TQT_SIGNAL( textChanged( const TQString& ) ), + this, TQT_SLOT( updateAddresseeView() ) ); + connect( mAddressBookCombo, TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( updateAddresseeView() ) ); + + connect( mMoveMapper, TQT_SIGNAL( mapped( int ) ), + this, TQT_SLOT( move( int ) ) ); + connect( mRemoveMapper, TQT_SIGNAL( mapped( int ) ), + this, TQT_SLOT( remove( int ) ) ); reloadAddressBook(); } void AddresseeSelector::initGUI() { - QGridLayout *layout = new QGridLayout( this, 2, 3, KDialog::marginHint(), KDialog::spacingHint() ); - QGridLayout *topLayout = new QGridLayout( this, 2, 2, KDialog::marginHint() ); + TQGridLayout *layout = new TQGridLayout( this, 2, 3, KDialog::marginHint(), KDialog::spacingHint() ); + TQGridLayout *topLayout = new TQGridLayout( this, 2, 2, KDialog::marginHint() ); - QLabel *label = new QLabel( i18n( "Address book:" ), this ); + TQLabel *label = new TQLabel( i18n( "Address book:" ), this ); mAddressBookCombo = new KComboBox( false, this ); topLayout->addWidget( label, 0, 0 ); topLayout->addWidget( mAddressBookCombo, 0, 1 ); - label = new QLabel( i18n( "Search:" ), this ); + label = new TQLabel( i18n( "Search:" ), this ); mAddresseeFilter = new KLineEdit( this ); topLayout->addWidget( label, 1, 0 ); @@ -288,8 +288,8 @@ void AddresseeSelector::initGUI() int row = 1; - QIconSet moveSet = KGlobal::iconLoader()->loadIconSet( "next", KIcon::Small ); - QIconSet removeSet = KGlobal::iconLoader()->loadIconSet( "previous", KIcon::Small ); + TQIconSet moveSet = KGlobal::iconLoader()->loadIconSet( "next", KIcon::Small ); + TQIconSet removeSet = KGlobal::iconLoader()->loadIconSet( "previous", KIcon::Small ); uint count = mSelection->fieldCount(); for ( uint i = 0; i < count; ++i, ++row ) { @@ -298,30 +298,30 @@ void AddresseeSelector::initGUI() listView->setFullWidth( true ); mSelectionViews.append( listView ); - connect( listView, SIGNAL( doubleClicked( QListViewItem*, const QPoint&, int ) ), - mRemoveMapper, SLOT( map() ) ); + connect( listView, TQT_SIGNAL( doubleClicked( TQListViewItem*, const TQPoint&, int ) ), + mRemoveMapper, TQT_SLOT( map() ) ); mRemoveMapper->setMapping( listView, i ); - QVBoxLayout *buttonLayout = new QVBoxLayout( this ); + TQVBoxLayout *buttonLayout = new TQVBoxLayout( this ); buttonLayout->setAlignment( Qt::AlignBottom ); layout->addLayout( buttonLayout, row, 1 ); // move button - QToolButton *moveButton = new QToolButton( this ); + TQToolButton *moveButton = new TQToolButton( this ); moveButton->setIconSet( moveSet ); moveButton->setFixedSize( 30, 30 ); - connect( moveButton, SIGNAL( clicked() ), - mMoveMapper, SLOT( map() ) ); + connect( moveButton, TQT_SIGNAL( clicked() ), + mMoveMapper, TQT_SLOT( map() ) ); mMoveMapper->setMapping( moveButton, i ); // remove button - QToolButton *removeButton = new QToolButton( this ); + TQToolButton *removeButton = new TQToolButton( this ); removeButton->setIconSet( removeSet ); removeButton->setFixedSize( 30, 30 ); - connect( removeButton, SIGNAL( clicked() ), - mRemoveMapper, SLOT( map() ) ); + connect( removeButton, TQT_SIGNAL( clicked() ), + mRemoveMapper, TQT_SLOT( map() ) ); mRemoveMapper->setMapping( removeButton, i ); buttonLayout->addWidget( moveButton ); @@ -423,7 +423,7 @@ void AddresseeSelector::setItemSelected( uint fieldIndex, const KABC::Addressee } void AddresseeSelector::setItemSelected( uint fieldIndex, const KABC::Addressee &addr, - uint itemIndex, const QString &text ) + uint itemIndex, const TQString &text ) { bool found = false; @@ -514,9 +514,9 @@ void AddresseeSelector::reloadAddressBook() mManager->load(); - QStringList lists = mManager->listNames(); + TQStringList lists = mManager->listNames(); - QStringList::Iterator listIt; + TQStringList::Iterator listIt; for ( listIt = lists.begin(); listIt != lists.end(); ++listIt ) { KABC::DistributionList *list = mManager->list( *listIt ); SelectionItem item( list, 0 ); @@ -528,8 +528,8 @@ void AddresseeSelector::reloadAddressBook() // update address book combo mAddressBookCombo->clear(); - QPtrList<KABC::Resource> resources = KABC::StdAddressBook::self( true )->resources(); - QPtrListIterator<KABC::Resource> resIt( resources ); + TQPtrList<KABC::Resource> resources = KABC::StdAddressBook::self( true )->resources(); + TQPtrListIterator<KABC::Resource> resIt( resources ); while ( resIt.current() ) { if ( resIt.current()->isActive() ) mAddressBookManager->addResource( resIt ); @@ -561,11 +561,11 @@ void AddresseeSelector::reloadAddressBook() AddresseeSelectorDialog::AddresseeSelectorDialog( Selection *selection, - QWidget *parent, const char *name ) + TQWidget *parent, const char *name ) : KDialogBase( Plain, "", Ok | Cancel, Ok, parent, name, true ) { - QFrame *frame = plainPage(); - QVBoxLayout *layout = new QVBoxLayout( frame ); + TQFrame *frame = plainPage(); + TQVBoxLayout *layout = new TQVBoxLayout( frame ); mSelector = new KPIM::AddresseeSelector( selection, frame ); layout->addWidget( mSelector ); @@ -575,7 +575,7 @@ AddresseeSelectorDialog::AddresseeSelectorDialog( Selection *selection, void AddresseeSelectorDialog::accept() { mSelector->finish(); - QDialog::accept(); + TQDialog::accept(); } #include "addresseeselector.moc" |