summaryrefslogtreecommitdiffstats
path: root/kword/mailmerge/kabc/KWMailMergeKABCConfig.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kword/mailmerge/kabc/KWMailMergeKABCConfig.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-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/KWMailMergeKABCConfig.cpp')
-rw-r--r--kword/mailmerge/kabc/KWMailMergeKABCConfig.cpp190
1 files changed, 95 insertions, 95 deletions
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 );
}
}