author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kaddressbook/features/mergewidget.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-p1.zip kdepimpi-p1.tar.gz kdepimpi-p1.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'kaddressbook/features/mergewidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/features/mergewidget.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/kaddressbook/features/mergewidget.cpp b/kaddressbook/features/mergewidget.cpp index 2476e42..1becc2f 100644 --- a/kaddressbook/features/mergewidget.cpp +++ b/kaddressbook/features/mergewidget.cpp @@ -18,16 +18,18 @@ As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #include <qlayout.h> #include <qpushbutton.h> +//Added by qt3to4: +#include <Q3GridLayout> #ifndef KAB_EMBEDDED #include <kaccelmanager.h> #endif //KAB_EMBEDDED #include <kdebug.h> #include <klistview.h> #include <klocale.h> @@ -58,21 +60,21 @@ class MergeFactory : public ExtensionFactory extern "C" { void *init_libkaddrbk_merge() { return ( new MergeFactory ); } } #endif //KAB_EMBEDDED -class ContactItem : public QListViewItem +class ContactItem : public Q3ListViewItem { public: ContactItem( KListView *parent, const KABC::Addressee &addressee ) - : QListViewItem( parent ), mAddressee( addressee ) + : Q3ListViewItem( parent ), mAddressee( addressee ) { KABC::Field::List fieldList = KABC::Field::defaultFields(); KABC::Field::List::ConstIterator it; int i = 0; for ( it = fieldList.begin(); it != fieldList.end(); ++it ) setText( i++, (*it)->value( mAddressee ) ); } @@ -89,17 +91,17 @@ class ContactItem : public QListViewItem MergeWidget::MergeWidget( KABCore *core, QWidget *parent, const char *name ) : ExtensionWidget( core, parent, name ), mBlockUpdate( false ) { #ifdef KAB_EMBEDDED if (KGlobal::getOrientation() == KGlobal::Portrait) parent->setMaximumSize( KGlobal::getDesktopWidth() , 180); #endif //KAB_EMBEDDED - QGridLayout *topLayout = new QGridLayout( this, 3, 2, KDialog::marginHint(), + Q3GridLayout *topLayout = new Q3GridLayout( this, 3, 2, KDialog::marginHint(), KDialog::spacingHint() ); mContactView = new KListView( this ); KABC::Field::List fieldList = KABC::Field::defaultFields(); KABC::Field::List::ConstIterator it; for ( it = fieldList.begin(); it != fieldList.end(); ++it ) mContactView->addColumn( (*it)->label() ); @@ -209,17 +211,17 @@ void MergeWidget::mergeAndRemove() doMerge( item->addressee() ); KABC::Addressee::List retval; retval << mMasterAddressee; emit modified( retval ); mBlockUpdate = true; - core()->deleteContacts( oldUID ); + core()->deleteContacts( QStringList(oldUID) ); core()->setContactSelected( mMasterAddressee.uid() ); mBlockUpdate = false; updateView(); } void MergeWidget::merge() { @@ -364,11 +366,11 @@ void MergeWidget::doMerge( const KABC::Addressee &addr ) QStringList masterCustoms = mMasterAddressee.customs(); QStringList newCustoms( masterCustoms ); for ( it = customs.begin(); it != customs.end(); ++it ) if ( !masterCustoms.contains( *it ) ) newCustoms.append( *it ); mMasterAddressee.setCustoms( newCustoms ); } -#ifndef KAB_EMBEDDED -#include "mergewidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_mergewidget.cpp" #endif //KAB_EMBEDDED |