summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Unidiff
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/addresseditwidget.cpp55
-rw-r--r--kaddressbook/addresseditwidget.h18
-rw-r--r--kaddressbook/addresseeconfig.cpp6
-rw-r--r--kaddressbook/addresseeconfig.h6
-rw-r--r--kaddressbook/addresseeeditordialog.cpp9
-rw-r--r--kaddressbook/addresseeeditorwidget.cpp46
-rw-r--r--kaddressbook/addresseeeditorwidget.h12
-rw-r--r--kaddressbook/addresseeutil.cpp2
-rw-r--r--kaddressbook/addviewdialog.cpp16
-rw-r--r--kaddressbook/addviewdialog.h10
-rw-r--r--kaddressbook/details/detailsviewcontainer.cpp19
-rw-r--r--kaddressbook/details/detailsviewcontainer.h8
-rw-r--r--kaddressbook/details/look_basic.cpp6
-rw-r--r--kaddressbook/details/look_basic.h4
-rw-r--r--kaddressbook/details/look_details.cpp12
-rw-r--r--kaddressbook/details/look_details.h4
-rw-r--r--kaddressbook/details/look_html.cpp6
-rw-r--r--kaddressbook/emaileditwidget.cpp16
-rw-r--r--kaddressbook/emaileditwidget.h10
-rw-r--r--kaddressbook/extensionmanager.cpp14
-rw-r--r--kaddressbook/extensionmanager.h10
-rw-r--r--kaddressbook/extensionwidget.cpp5
-rw-r--r--kaddressbook/extensionwidget.h4
-rw-r--r--kaddressbook/features/distributionlistwidget.cpp39
-rw-r--r--kaddressbook/features/distributionlistwidget.h13
-rw-r--r--kaddressbook/features/mergewidget.cpp14
-rw-r--r--kaddressbook/features/mergewidget.h2
-rw-r--r--kaddressbook/filter.cpp2
-rw-r--r--kaddressbook/filter.h4
-rw-r--r--kaddressbook/filtereditdialog.cpp38
-rw-r--r--kaddressbook/filtereditdialog.h9
-rw-r--r--kaddressbook/geowidget.cpp35
-rw-r--r--kaddressbook/geowidget.h4
-rw-r--r--kaddressbook/imagewidget.cpp32
-rw-r--r--kaddressbook/imagewidget.h3
-rw-r--r--kaddressbook/incsearchwidget.cpp14
-rw-r--r--kaddressbook/jumpbuttonbar.cpp13
-rw-r--r--kaddressbook/jumpbuttonbar.h11
-rw-r--r--kaddressbook/kabcore.cpp146
-rw-r--r--kaddressbook/kabcore.h40
-rw-r--r--kaddressbook/kabprefs.cpp4
-rw-r--r--kaddressbook/kabprefs.h8
-rw-r--r--kaddressbook/kaddressbook.pro46
-rw-r--r--kaddressbook/kaddressbookE.pro6
-rw-r--r--kaddressbook/kaddressbookmain.cpp22
-rw-r--r--kaddressbook/kaddressbookmain.h14
-rw-r--r--kaddressbook/kaddressbookview.cpp8
-rw-r--r--kaddressbook/kaddressbookview.h12
-rw-r--r--kaddressbook/kcmconfigs/addresseewidget.cpp36
-rw-r--r--kaddressbook/kcmconfigs/addresseewidget.h8
-rw-r--r--kaddressbook/kcmconfigs/extensionconfigdialog.cpp11
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.cpp59
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.h6
-rw-r--r--kaddressbook/kcmconfigs/kcmkabconfig.cpp8
-rw-r--r--kaddressbook/keywidget.cpp28
-rw-r--r--kaddressbook/mainembedded.cpp5
-rw-r--r--kaddressbook/nameeditdialog.cpp12
-rw-r--r--kaddressbook/old_mainwindow.cpp12
-rw-r--r--kaddressbook/phoneeditwidget.cpp60
-rw-r--r--kaddressbook/phoneeditwidget.h24
-rw-r--r--kaddressbook/secrecywidget.cpp8
-rw-r--r--kaddressbook/undo.cpp4
-rw-r--r--kaddressbook/undo.h4
-rw-r--r--kaddressbook/undocmds.cpp2
-rw-r--r--kaddressbook/viewconfigurefieldspage.cpp54
-rw-r--r--kaddressbook/viewconfigurefieldspage.h8
-rw-r--r--kaddressbook/viewconfigurefilterpage.cpp15
-rw-r--r--kaddressbook/viewconfigurefilterpage.h4
-rw-r--r--kaddressbook/viewconfigurewidget.cpp19
-rw-r--r--kaddressbook/viewconfigurewidget.h4
-rw-r--r--kaddressbook/viewmanager.cpp30
-rw-r--r--kaddressbook/viewmanager.h12
-rw-r--r--kaddressbook/views/cardview.cpp114
-rw-r--r--kaddressbook/views/cardview.h14
-rw-r--r--kaddressbook/views/colorlistbox.cpp25
-rw-r--r--kaddressbook/views/colorlistbox.h15
-rw-r--r--kaddressbook/views/configurecardviewdialog.cpp57
-rw-r--r--kaddressbook/views/configurecardviewdialog.h6
-rw-r--r--kaddressbook/views/configuretableviewdialog.cpp35
-rw-r--r--kaddressbook/views/configuretableviewdialog.h6
-rw-r--r--kaddressbook/views/contactlistview.cpp32
-rw-r--r--kaddressbook/views/contactlistview.h6
-rw-r--r--kaddressbook/views/kaddressbookcardview.cpp19
-rw-r--r--kaddressbook/views/kaddressbookcardview.h3
-rw-r--r--kaddressbook/views/kaddressbookiconview.cpp60
-rw-r--r--kaddressbook/views/kaddressbookiconview.h29
-rw-r--r--kaddressbook/views/kaddressbooktableview.cpp56
-rw-r--r--kaddressbook/views/kaddressbooktableview.h18
-rw-r--r--kaddressbook/xxport/csv_xxport.cpp14
-rw-r--r--kaddressbook/xxport/csvimportdialog.cpp66
-rw-r--r--kaddressbook/xxport/csvimportdialog.h12
-rw-r--r--kaddressbook/xxport/kde2_xxport.cpp4
-rw-r--r--kaddressbook/xxport/vcard_xxport.cpp20
-rw-r--r--kaddressbook/xxportmanager.cpp17
-rw-r--r--kaddressbook/xxportmanager.h4
-rw-r--r--kaddressbook/xxportobject.cpp4
-rw-r--r--kaddressbook/xxportselectdialog.cpp59
-rw-r--r--kaddressbook/xxportselectdialog.h12
98 files changed, 1095 insertions, 882 deletions
diff --git a/kaddressbook/addresseditwidget.cpp b/kaddressbook/addresseditwidget.cpp
index 3dcd592..83908d0 100644
--- a/kaddressbook/addresseditwidget.cpp
+++ b/kaddressbook/addresseditwidget.cpp
@@ -19,30 +19,37 @@
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24 24
25#include <qbuttongroup.h> 25#include <q3buttongroup.h>
26#include <qcheckbox.h> 26#include <qcheckbox.h>
27#include <qhbox.h> 27#include <q3hbox.h>
28#include <qlabel.h> 28#include <qlabel.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qlistbox.h> 30#include <q3listbox.h>
31#include <qlistview.h> 31#include <q3listview.h>
32#include <qpushbutton.h> 32#include <qpushbutton.h>
33#include <qsignal.h> 33#include <q3signal.h>
34#include <qstring.h> 34#include <qstring.h>
35#include <qapplication.h> 35#include <qapplication.h>
36#include <QDesktopWidget>
37
38#include <Q3VBoxLayout>
39#include <Q3GridLayout>
36 40
37#ifndef KAB_EMBEDDED 41#ifndef KAB_EMBEDDED
38#include <qtextedit.h> 42#include <q3textedit.h>
43//Added by qt3to4:
44#include <Q3ValueList>
45#include <Q3VBoxLayout>
39#include <kaccelmanager.h> 46#include <kaccelmanager.h>
40#include <kbuttonbox.h> 47#include <kbuttonbox.h>
41#else //KAB_EMBEDDED 48#else //KAB_EMBEDDED
42#include <qmultilineedit.h> 49#include <q3multilineedit.h>
43#endif //KAB_EMBEDDED 50#endif //KAB_EMBEDDED
44 51
45#include <qtoolbutton.h> 52#include <qtoolbutton.h>
46#include <qtooltip.h> 53#include <qtooltip.h>
47 54
48#include <kapplication.h> 55#include <kapplication.h>
@@ -64,15 +71,15 @@
64 71
65AddressEditWidget::AddressEditWidget( QWidget *parent, const char *name ) 72AddressEditWidget::AddressEditWidget( QWidget *parent, const char *name )
66 : QWidget( parent, name ) 73 : QWidget( parent, name )
67{ 74{
68 75
69 mConfig = AddresseeConfig::instance(); 76 mConfig = AddresseeConfig::instance();
70 QVBoxLayout *layout = new QVBoxLayout( this ); 77 Q3VBoxLayout *layout = new Q3VBoxLayout( this );
71 layout->setSpacing( KDialog::spacingHintSmall() ); 78 layout->setSpacing( KDialog::spacingHintSmall() );
72 QHBox *b1 = new QHBox( this); 79 Q3HBox *b1 = new Q3HBox( this);
73 //QLabel * label = new QLabel( b1 ); 80 //QLabel * label = new QLabel( b1 );
74 //label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) ); 81 //label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) );
75 82
76 83
77 //label->setAlignment( AlignCenter); 84 //label->setAlignment( AlignCenter);
78 layout->addWidget( b1 ); 85 layout->addWidget( b1 );
@@ -81,17 +88,17 @@ AddressEditWidget::AddressEditWidget( QWidget *parent, const char *name )
81 b1 ); 88 b1 );
82 connect( mTypeCombo, SIGNAL( activated( int ) ), 89 connect( mTypeCombo, SIGNAL( activated( int ) ),
83 SLOT( updateAddressEdit() ) ); 90 SLOT( updateAddressEdit() ) );
84 // layout->addWidget( mTypeCombo ); 91 // layout->addWidget( mTypeCombo );
85 92
86#ifndef KAB_EMBEDDED 93#ifndef KAB_EMBEDDED
87 mAddressTextEdit = new QTextEdit( this ); 94 mAddressTextEdit = new Q3TextEdit( this );
88 mAddressTextEdit->setReadOnly( true ); 95 mAddressTextEdit->setReadOnly( true );
89 mAddressTextEdit->setMinimumHeight( 20 ); 96 mAddressTextEdit->setMinimumHeight( 20 );
90#else //KAB_EMBEDDED 97#else //KAB_EMBEDDED
91 mAddressTextEdit = new QMultiLineEdit( this ); 98 mAddressTextEdit = new Q3MultiLineEdit( this );
92 mAddressTextEdit->setReadOnly( true ); 99 mAddressTextEdit->setReadOnly( true );
93 mAddressTextEdit->setMinimumHeight( 20 ); 100 mAddressTextEdit->setMinimumHeight( 20 );
94#endif //KAB_EMBEDDED 101#endif //KAB_EMBEDDED
95 102
96 layout->addWidget( mAddressTextEdit ); 103 layout->addWidget( mAddressTextEdit );
97 104
@@ -123,19 +130,19 @@ void AddressEditWidget::setAddresses( const KABC::Addressee &addr,
123 130
124 mAddressList.clear(); 131 mAddressList.clear();
125 132
126 // Insert types for existing numbers. 133 // Insert types for existing numbers.
127 mTypeCombo->insertTypeList( list ); 134 mTypeCombo->insertTypeList( list );
128 135
129 QValueList<int> defaultTypes; 136 Q3ValueList<int> defaultTypes;
130 defaultTypes << KABC::Address::Home; 137 defaultTypes << KABC::Address::Home;
131 defaultTypes << KABC::Address::Work; 138 defaultTypes << KABC::Address::Work;
132 139
133 mConfig->setUid( mAddressee.uid() ); 140 mConfig->setUid( mAddressee.uid() );
134 QValueList<int> configList = mConfig->noDefaultAddrTypes(); 141 Q3ValueList<int> configList = mConfig->noDefaultAddrTypes();
135 QValueList<int>::ConstIterator it; 142 Q3ValueList<int>::ConstIterator it;
136 for ( it = configList.begin(); it != configList.end(); ++it ) 143 for ( it = configList.begin(); it != configList.end(); ++it )
137 defaultTypes.remove( *it ); 144 defaultTypes.remove( *it );
138 145
139 // Insert default types. 146 // Insert default types.
140 // Doing this for mPrefCombo is enough because the list is shared by all 147 // Doing this for mPrefCombo is enough because the list is shared by all
141 // combos. 148 // combos.
@@ -178,13 +185,13 @@ void AddressEditWidget::edit()
178 if ( !(*it).isEmpty() ) 185 if ( !(*it).isEmpty() )
179 hasWork = true; 186 hasWork = true;
180 } 187 }
181 } 188 }
182 189
183 mConfig->setUid( mAddressee.uid() ); 190 mConfig->setUid( mAddressee.uid() );
184 QValueList<int> configList; 191 Q3ValueList<int> configList;
185 if ( !hasHome ) { 192 if ( !hasHome ) {
186 configList << KABC::Address::Home; 193 configList << KABC::Address::Home;
187 } 194 }
188 if ( !hasWork ) { 195 if ( !hasWork ) {
189 configList << KABC::Address::Work; 196 configList << KABC::Address::Work;
190 } 197 }
@@ -252,26 +259,26 @@ AddressEditDialog::AddressEditDialog( const KABC::Address::List &list,
252 mPreviousAddress( 0 ) 259 mPreviousAddress( 0 )
253{ 260{
254 mAddressList = list; 261 mAddressList = list;
255 262
256 QWidget *page = plainPage(); 263 QWidget *page = plainPage();
257 264
258 QGridLayout *topLayout = new QGridLayout( page, 8, 2 ); 265 Q3GridLayout *topLayout = new Q3GridLayout( page, 8, 2 );
259 topLayout->setSpacing( spacingHintSmall() ); 266 topLayout->setSpacing( spacingHintSmall() );
260 267
261 mTypeCombo = new AddressTypeCombo( mAddressList, page ); 268 mTypeCombo = new AddressTypeCombo( mAddressList, page );
262 topLayout->addMultiCellWidget( mTypeCombo, 0, 0, 0, 1 ); 269 topLayout->addMultiCellWidget( mTypeCombo, 0, 0, 0, 1 );
263 270
264 QLabel *label = new QLabel( i18n( "Street:" ), page ); 271 QLabel *label = new QLabel( i18n( "Street:" ), page );
265 label->setAlignment( Qt::AlignTop | Qt::AlignLeft ); 272 label->setAlignment( Qt::AlignTop | Qt::AlignLeft );
266 topLayout->addWidget( label, 1, 0 ); 273 topLayout->addWidget( label, 1, 0 );
267 274
268#ifndef KAB_EMBEDDED 275#ifndef KAB_EMBEDDED
269 mStreetTextEdit = new QTextEdit( page ); 276 mStreetTextEdit = new Q3TextEdit( page );
270#else //KAB_EMBEDDED 277#else //KAB_EMBEDDED
271 mStreetTextEdit = new QMultiLineEdit( page ); 278 mStreetTextEdit = new Q3MultiLineEdit( page );
272//US qDebug("AddressEditDialog::AddressEditDialog has to be changed"); 279//US qDebug("AddressEditDialog::AddressEditDialog has to be changed");
273#endif //KAB_EMBEDDED 280#endif //KAB_EMBEDDED
274 281
275 label->setBuddy( mStreetTextEdit ); 282 label->setBuddy( mStreetTextEdit );
276 topLayout->addWidget( mStreetTextEdit, 1, 1 ); 283 topLayout->addWidget( mStreetTextEdit, 1, 1 );
277 284
@@ -308,20 +315,20 @@ AddressEditDialog::AddressEditDialog( const KABC::Address::List &list,
308 mCountryCombo->setEditable( true ); 315 mCountryCombo->setEditable( true );
309 mCountryCombo->setDuplicatesEnabled( false ); 316 mCountryCombo->setDuplicatesEnabled( false );
310 mCountryCombo->setAutoCompletion( true ); 317 mCountryCombo->setAutoCompletion( true );
311 fillCountryCombo(); 318 fillCountryCombo();
312 label->setBuddy( mCountryCombo ); 319 label->setBuddy( mCountryCombo );
313 topLayout->addWidget( mCountryCombo, 6, 1 ); 320 topLayout->addWidget( mCountryCombo, 6, 1 );
314 mCountryCombo->setSizeLimit( 8); 321 mCountryCombo->setMaxVisibleItems( 8);
315 mPreferredCheckBox = new QCheckBox( i18n( "This is the preferred address" ), page ); 322 mPreferredCheckBox = new QCheckBox( i18n( "This is the preferred address" ), page );
316 topLayout->addMultiCellWidget( mPreferredCheckBox, 7, 7, 0, 1 ); 323 topLayout->addMultiCellWidget( mPreferredCheckBox, 7, 7, 0, 1 );
317 /* 324 /*
318 KSeparator *sep = new KSeparator( KSeparator::HLine, page ); 325 KSeparator *sep = new KSeparator( KSeparator::HLine, page );
319 topLayout->addMultiCellWidget( sep, 8, 8, 0, 1 ); 326 topLayout->addMultiCellWidget( sep, 8, 8, 0, 1 );
320 */ 327 */
321 QHBox *buttonBox = new QHBox( page ); 328 Q3HBox *buttonBox = new Q3HBox( page );
322 buttonBox->setSpacing( spacingHint() ); 329 buttonBox->setSpacing( spacingHint() );
323 topLayout->addMultiCellWidget( buttonBox, 9, 9, 0, 1 ); 330 topLayout->addMultiCellWidget( buttonBox, 9, 9, 0, 1 );
324 331
325 QPushButton *addButton = new QPushButton( i18n( "New..." ), buttonBox ); 332 QPushButton *addButton = new QPushButton( i18n( "New..." ), buttonBox );
326 connect( addButton, SIGNAL( clicked() ), SLOT( addAddress() ) ); 333 connect( addButton, SIGNAL( clicked() ), SLOT( addAddress() ) );
327 334
@@ -580,15 +587,15 @@ void AddressEditDialog::fillCountryCombo()
580 587
581AddressTypeDialog::AddressTypeDialog( int type, QWidget *parent ) 588AddressTypeDialog::AddressTypeDialog( int type, QWidget *parent )
582 : KDialogBase( Plain, i18n( "Edit Address Type" ), Ok | Cancel, Ok, 589 : KDialogBase( Plain, i18n( "Edit Address Type" ), Ok | Cancel, Ok,
583 parent, "AddressTypeDialog" ) 590 parent, "AddressTypeDialog" )
584{ 591{
585 QWidget *page = plainPage(); 592 QWidget *page = plainPage();
586 QVBoxLayout *layout = new QVBoxLayout( page ); 593 Q3VBoxLayout *layout = new Q3VBoxLayout( page );
587 594
588 mGroup = new QButtonGroup( 2, Horizontal, i18n( "Address Types" ), page ); 595 mGroup = new Q3ButtonGroup( 2, Qt::Horizontal, i18n( "Address Types" ), page );
589 layout->addWidget( mGroup ); 596 layout->addWidget( mGroup );
590 597
591 mTypeList = KABC::Address::typeList(); 598 mTypeList = KABC::Address::typeList();
592 mTypeList.remove( KABC::Address::Pref ); 599 mTypeList.remove( KABC::Address::Pref );
593 600
594 KABC::Address::TypeList::Iterator it; 601 KABC::Address::TypeList::Iterator it;
@@ -614,9 +621,9 @@ int AddressTypeDialog::type() const
614 type += mTypeList[ i ]; 621 type += mTypeList[ i ];
615 } 622 }
616 623
617 return type; 624 return type;
618} 625}
619 626
620#ifndef KAB_EMBEDDED 627#ifndef KAB_EMBEDDED_
621#include "addresseditwidget.moc" 628#include "moc_addresseditwidget.cpp"
622#endif //KAB_EMBEDDED 629#endif //KAB_EMBEDDED
diff --git a/kaddressbook/addresseditwidget.h b/kaddressbook/addresseditwidget.h
index bc96d74..1d4e138 100644
--- a/kaddressbook/addresseditwidget.h
+++ b/kaddressbook/addresseditwidget.h
@@ -30,19 +30,19 @@
30#include <kabc/address.h> 30#include <kabc/address.h>
31#include <kabc/addressee.h> 31#include <kabc/addressee.h>
32 32
33#include "addresseeconfig.h" 33#include "addresseeconfig.h"
34#include "typecombo.h" 34#include "typecombo.h"
35 35
36class QButtonGroup; 36class Q3ButtonGroup;
37class QCheckBox; 37class QCheckBox;
38class QListView; 38class Q3ListView;
39#ifndef KAB_EMBEDDED 39#ifndef KAB_EMBEDDED
40class QTextEdit; 40class Q3TextEdit;
41#else //KAB_EMBEDDED 41#else //KAB_EMBEDDED
42class QMultiLineEdit; 42class Q3MultiLineEdit;
43#endif //KAB_EMBEDDED 43#endif //KAB_EMBEDDED
44class QToolButton; 44class QToolButton;
45 45
46class KComboBox; 46class KComboBox;
47class KLineEdit; 47class KLineEdit;
48class KListView; 48class KListView;
@@ -78,15 +78,15 @@ class AddressEditWidget : public QWidget
78 private: 78 private:
79 AddresseeConfig * mConfig; 79 AddresseeConfig * mConfig;
80 AddressTypeCombo *mTypeCombo; 80 AddressTypeCombo *mTypeCombo;
81 81
82 QPushButton *mEditButton; 82 QPushButton *mEditButton;
83#ifndef KAB_EMBEDDED 83#ifndef KAB_EMBEDDED
84 QTextEdit *mAddressTextEdit; 84 Q3TextEdit *mAddressTextEdit;
85#else //KAB_EMBEDDED 85#else //KAB_EMBEDDED
86 QMultiLineEdit *mAddressTextEdit; 86 Q3MultiLineEdit *mAddressTextEdit;
87#endif //KAB_EMBEDDED 87#endif //KAB_EMBEDDED
88 88
89 KABC::Address::List mAddressList; 89 KABC::Address::List mAddressList;
90 KABC::Addressee mAddressee; 90 KABC::Addressee mAddressee;
91 int mIndex; 91 int mIndex;
92}; 92};
@@ -117,15 +117,15 @@ class AddressEditDialog : public KDialogBase
117 private: 117 private:
118 void saveAddress( KABC::Address &addr ); 118 void saveAddress( KABC::Address &addr );
119 void fillCountryCombo(); 119 void fillCountryCombo();
120 120
121 AddressTypeCombo *mTypeCombo; 121 AddressTypeCombo *mTypeCombo;
122#ifndef KAB_EMBEDDED 122#ifndef KAB_EMBEDDED
123 QTextEdit *mStreetTextEdit; 123 Q3TextEdit *mStreetTextEdit;
124#else //KAB_EMBEDDED 124#else //KAB_EMBEDDED
125 QMultiLineEdit *mStreetTextEdit; 125 Q3MultiLineEdit *mStreetTextEdit;
126#endif //KAB_EMBEDDED 126#endif //KAB_EMBEDDED
127 KComboBox *mCountryCombo; 127 KComboBox *mCountryCombo;
128 KLineEdit *mRegionEdit; 128 KLineEdit *mRegionEdit;
129 KLineEdit *mLocalityEdit; 129 KLineEdit *mLocalityEdit;
130 KLineEdit *mPostalCodeEdit; 130 KLineEdit *mPostalCodeEdit;
131 KLineEdit *mPOBoxEdit; 131 KLineEdit *mPOBoxEdit;
@@ -148,12 +148,12 @@ class AddressTypeDialog : public KDialogBase
148 AddressTypeDialog( int type, QWidget *parent ); 148 AddressTypeDialog( int type, QWidget *parent );
149 ~AddressTypeDialog(); 149 ~AddressTypeDialog();
150 150
151 int type() const; 151 int type() const;
152 152
153 private: 153 private:
154 QButtonGroup *mGroup; 154 Q3ButtonGroup *mGroup;
155 155
156 KABC::Address::TypeList mTypeList; 156 KABC::Address::TypeList mTypeList;
157}; 157};
158 158
159#endif 159#endif
diff --git a/kaddressbook/addresseeconfig.cpp b/kaddressbook/addresseeconfig.cpp
index ea0436f..81b1bf4 100644
--- a/kaddressbook/addresseeconfig.cpp
+++ b/kaddressbook/addresseeconfig.cpp
@@ -23,12 +23,14 @@
23 23
24#include "addresseeconfig.h" 24#include "addresseeconfig.h"
25#include "kabprefs.h" 25#include "kabprefs.h"
26//US 26//US
27#include <kstandarddirs.h> 27#include <kstandarddirs.h>
28#include <qfileinfo.h> 28#include <qfileinfo.h>
29//Added by qt3to4:
30#include <Q3ValueList>
29 31
30using namespace KABC; 32using namespace KABC;
31 33
32static AddresseeConfig* extern_AddresseeConfig = 0; 34static AddresseeConfig* extern_AddresseeConfig = 0;
33static KConfig * extern_Config = 0; 35static KConfig * extern_Config = 0;
34 36
@@ -74,19 +76,19 @@ void AddresseeConfig::setAutomaticNameParsing( bool value )
74{ 76{
75 77
76 return AddresseeConfig::config()->readBoolEntry( "AutomaticNameParsing", 78 return AddresseeConfig::config()->readBoolEntry( "AutomaticNameParsing",
77 KABPrefs::instance()->mAutomaticNameParsing ); 79 KABPrefs::instance()->mAutomaticNameParsing );
78} 80}
79 81
80void AddresseeConfig::setNoDefaultAddrTypes( const QValueList<int> &types ) 82void AddresseeConfig::setNoDefaultAddrTypes( const Q3ValueList<int> &types )
81{ 83{
82 AddresseeConfig::config()->writeEntry( "NoDefaultAddrTypes", types ); 84 AddresseeConfig::config()->writeEntry( "NoDefaultAddrTypes", types );
83 AddresseeConfig::config()->sync(); 85 AddresseeConfig::config()->sync();
84} 86}
85 87
86 QValueList<int> AddresseeConfig::noDefaultAddrTypes() const 88 Q3ValueList<int> AddresseeConfig::noDefaultAddrTypes() const
87{ 89{
88 return AddresseeConfig::config()->readIntListEntry( "NoDefaultAddrTypes" ); 90 return AddresseeConfig::config()->readIntListEntry( "NoDefaultAddrTypes" );
89} 91}
90 92
91void AddresseeConfig::remove( const QString & uid ) 93void AddresseeConfig::remove( const QString & uid )
92{ 94{
diff --git a/kaddressbook/addresseeconfig.h b/kaddressbook/addresseeconfig.h
index 47fbdd6..f6bb3e9 100644
--- a/kaddressbook/addresseeconfig.h
+++ b/kaddressbook/addresseeconfig.h
@@ -23,12 +23,14 @@
23 23
24#ifndef ADDRESSEECONFIG_H 24#ifndef ADDRESSEECONFIG_H
25#define ADDRESSEECONFIG_H 25#define ADDRESSEECONFIG_H
26 26
27#include <kabc/addressee.h> 27#include <kabc/addressee.h>
28#include <kconfig.h> 28#include <kconfig.h>
29//Added by qt3to4:
30#include <Q3ValueList>
29 31
30using namespace KABC; 32using namespace KABC;
31 33
32class AddresseeConfig 34class AddresseeConfig
33{ 35{
34 public: 36 public:
@@ -40,14 +42,14 @@ class AddresseeConfig
40 Addressee addressee(); 42 Addressee addressee();
41 43
42 void setUid( const QString & uid ); 44 void setUid( const QString & uid );
43 void setAutomaticNameParsing( bool value ); 45 void setAutomaticNameParsing( bool value );
44 bool automaticNameParsing(); 46 bool automaticNameParsing();
45 47
46 void setNoDefaultAddrTypes( const QValueList<int> &types ); 48 void setNoDefaultAddrTypes( const Q3ValueList<int> &types );
47 QValueList<int> noDefaultAddrTypes() const; 49 Q3ValueList<int> noDefaultAddrTypes() const;
48 50
49 void remove( const QString & uid); 51 void remove( const QString & uid);
50 52
51 private: 53 private:
52 QString mUid; 54 QString mUid;
53}; 55};
diff --git a/kaddressbook/addresseeeditordialog.cpp b/kaddressbook/addresseeeditordialog.cpp
index b5a60f2..b925a07 100644
--- a/kaddressbook/addresseeeditordialog.cpp
+++ b/kaddressbook/addresseeeditordialog.cpp
@@ -20,12 +20,15 @@
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qapplication.h> 25#include <qapplication.h>
26#include <QDesktopWidget>
27//Added by qt3to4:
28#include <Q3VBoxLayout>
26 29
27#include <kdebug.h> 30#include <kdebug.h>
28#include <klocale.h> 31#include <klocale.h>
29#include <kglobal.h> 32#include <kglobal.h>
30 33
31#include "addresseeeditorwidget.h" 34#include "addresseeeditorwidget.h"
@@ -40,13 +43,13 @@ AddresseeEditorDialog::AddresseeEditorDialog( KABCore *core, QWidget *parent,
40 KDialogBase::Ok, parent, name, true ) 43 KDialogBase::Ok, parent, name, true )
41{ 44{
42 45
43 46
44 QWidget *page = plainPage(); 47 QWidget *page = plainPage();
45 48
46 QVBoxLayout *layout = new QVBoxLayout( page ); 49 Q3VBoxLayout *layout = new Q3VBoxLayout( page );
47 50
48 mEditorWidget = new AddresseeEditorWidget( core, false, page ); 51 mEditorWidget = new AddresseeEditorWidget( core, false, page );
49 connect( mEditorWidget, SIGNAL( modified( const KABC::Addressee::List& ) ), 52 connect( mEditorWidget, SIGNAL( modified( const KABC::Addressee::List& ) ),
50 SLOT( widgetModified() ) ); 53 SLOT( widgetModified() ) );
51 layout->addWidget( mEditorWidget ); 54 layout->addWidget( mEditorWidget );
52 55
@@ -115,9 +118,9 @@ void AddresseeEditorDialog::slotCancel()
115{ 118{
116 KDialogBase::slotCancel(); 119 KDialogBase::slotCancel();
117 120
118 121
119} 122}
120 123
121#ifndef KAB_EMBEDDED 124#ifndef KAB_EMBEDDED_
122#include "addresseeeditordialog.moc" 125#include "moc_addresseeeditordialog.cpp"
123#endif //KAB_EMBEDDED 126#endif //KAB_EMBEDDED
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp
index 4313998..a95db03 100644
--- a/kaddressbook/addresseeeditorwidget.cpp
+++ b/kaddressbook/addresseeeditorwidget.cpp
@@ -19,29 +19,33 @@
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qcheckbox.h> 24#include <qcheckbox.h>
25#include <qhbox.h> 25#include <q3hbox.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qlistbox.h> 28#include <q3listbox.h>
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30#include <qtabwidget.h> 30#include <qtabwidget.h>
31#include <qapplication.h> 31#include <qapplication.h>
32 32
33#ifndef KAB_EMBEDDED 33#ifndef KAB_EMBEDDED
34#include <qtextedit.h> 34#include <q3textedit.h>
35//Added by qt3to4:
36#include <Q3GridLayout>
37#include <Q3PopupMenu>
38#include <Q3VBoxLayout>
35 39
36#include <kaccelmanager.h> 40#include <kaccelmanager.h>
37#include "keywidget.h" 41#include "keywidget.h"
38#include "soundwidget.h" 42#include "soundwidget.h"
39 43
40#else //KAB_EMBEDDED 44#else //KAB_EMBEDDED
41#include <qmultilineedit.h> 45#include <q3multilineedit.h>
42#endif //KAB_EMBEDDED 46#endif //KAB_EMBEDDED
43 47
44 48
45#include "keywidget.h" 49#include "keywidget.h"
46#include "geowidget.h" 50#include "geowidget.h"
47#include "imagewidget.h" 51#include "imagewidget.h"
@@ -127,13 +131,13 @@ void AddresseeEditorWidget::textChanged( const QString& )
127{ 131{
128 emitModified(); 132 emitModified();
129} 133}
130 134
131void AddresseeEditorWidget::initGUI() 135void AddresseeEditorWidget::initGUI()
132{ 136{
133 QVBoxLayout *layout = new QVBoxLayout( this ); 137 Q3VBoxLayout *layout = new Q3VBoxLayout( this );
134 138
135 mTabWidget = new QTabWidget( this ); 139 mTabWidget = new QTabWidget( this );
136 layout->addWidget( mTabWidget ); 140 layout->addWidget( mTabWidget );
137 141
138 setupTab1(); 142 setupTab1();
139 setupTab1_1(); 143 setupTab1_1();
@@ -157,13 +161,13 @@ void AddresseeEditorWidget::setupTab1()
157 bool horLayout = false; 161 bool horLayout = false;
158 int maxCol = 1; 162 int maxCol = 1;
159 if ( QApplication::desktop()->width() == 640 || QApplication::desktop()->width() == 320 ) { 163 if ( QApplication::desktop()->width() == 640 || QApplication::desktop()->width() == 320 ) {
160 horLayout = true; 164 horLayout = true;
161 maxCol = 3; 165 maxCol = 3;
162 } 166 }
163 QGridLayout *layout = new QGridLayout( tab1, 7-maxCol, maxCol ); 167 Q3GridLayout *layout = new Q3GridLayout( tab1, 7-maxCol, maxCol );
164 168
165 layout->setMargin( KDialogBase::marginHintSmall() ); 169 layout->setMargin( KDialogBase::marginHintSmall() );
166 layout->setSpacing( KDialogBase::spacingHintSmall() ); 170 layout->setSpacing( KDialogBase::spacingHintSmall() );
167 171
168 QLabel *label; 172 QLabel *label;
169 KSeparator* bar; 173 KSeparator* bar;
@@ -324,23 +328,23 @@ void AddresseeEditorWidget::setupTab1()
324 layout->addColSpacing( 6, 50 ); 328 layout->addColSpacing( 6, 50 );
325 329
326 bar = new KSeparator( KSeparator::HLine, tab1 ); 330 bar = new KSeparator( KSeparator::HLine, tab1 );
327 layout->addMultiCellWidget( bar, 10, 10, 0, 6 ); 331 layout->addMultiCellWidget( bar, 10, 10, 0, 6 );
328*/ 332*/
329 /////////////////////////////////////// 333 ///////////////////////////////////////
330 QHBox *categoryBox = new QHBox( tab1 ,"cato"); 334 Q3HBox *categoryBox = new Q3HBox( tab1 ,"cato");
331 categoryBox->setSpacing( KDialogBase::spacingHint() ); 335 categoryBox->setSpacing( KDialogBase::spacingHint() );
332 categoryBox->setMargin( KDialogBase::marginHintSmall() ); 336 categoryBox->setMargin( KDialogBase::marginHintSmall() );
333 337
334 // Categories 338 // Categories
335 button = new QPushButton( i18n( "Categories" )+":", categoryBox ); 339 button = new QPushButton( i18n( "Categories" )+":", categoryBox );
336 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) ); 340 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) );
337 341
338 mCategoryEdit = new QPushButton ( categoryBox ); 342 mCategoryEdit = new QPushButton ( categoryBox );
339 mCategoryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) ); 343 mCategoryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) );
340 mCatPopup = new QPopupMenu ( categoryBox ); 344 mCatPopup = new Q3PopupMenu ( categoryBox );
341 mCategoryEdit->setPopup( mCatPopup ); 345 mCategoryEdit->setPopup( mCatPopup );
342 connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup())); 346 connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup()));
343 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int ))); 347 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int )));
344 //connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), 348 //connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ),
345 // SLOT( textChanged( const QString& ) ) ); 349 // SLOT( textChanged( const QString& ) ) );
346 350
@@ -408,13 +412,13 @@ void AddresseeEditorWidget::setCompany2FN()
408void AddresseeEditorWidget::setupTab1_1() 412void AddresseeEditorWidget::setupTab1_1()
409{ 413{
410 // This is the Address tab 414 // This is the Address tab
411 QWidget *tab1_1 = new QWidget( mTabWidget ); 415 QWidget *tab1_1 = new QWidget( mTabWidget );
412 416
413//US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 ); 417//US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 );
414 QGridLayout *layout = new QGridLayout( tab1_1, 7, 2 ); 418 Q3GridLayout *layout = new Q3GridLayout( tab1_1, 7, 2 );
415 layout->setMargin( KDialogBase::marginHintSmall() ); 419 layout->setMargin( KDialogBase::marginHintSmall() );
416 layout->setSpacing( KDialogBase::spacingHintSmall() ); 420 layout->setSpacing( KDialogBase::spacingHintSmall() );
417 421
418 QLabel *label; 422 QLabel *label;
419 KSeparator* bar; 423 KSeparator* bar;
420 QPushButton *button; 424 QPushButton *button;
@@ -609,13 +613,13 @@ qDebug("AddresseeEditorWidget::setupTab1 has to be changed");
609 613
610void AddresseeEditorWidget::setupTab2() 614void AddresseeEditorWidget::setupTab2()
611{ 615{
612 // This is the Details tab 616 // This is the Details tab
613 QWidget *tab2 = new QWidget( mTabWidget ); 617 QWidget *tab2 = new QWidget( mTabWidget );
614 618
615 QGridLayout *layout = new QGridLayout( tab2, 8, 3 ); 619 Q3GridLayout *layout = new Q3GridLayout( tab2, 8, 3 );
616 layout->setMargin( KDialogBase::marginHintSmall() ); 620 layout->setMargin( KDialogBase::marginHintSmall() );
617 layout->setSpacing( KDialogBase::spacingHintSmall() ); 621 layout->setSpacing( KDialogBase::spacingHintSmall() );
618 622
619 QLabel *label; 623 QLabel *label;
620 KSeparator* bar; 624 KSeparator* bar;
621 625
@@ -688,13 +692,13 @@ void AddresseeEditorWidget::setupTab2()
688 //layout->addMultiCellWidget( label, 6, 7, 0, 0 ); 692 //layout->addMultiCellWidget( label, 6, 7, 0, 0 );
689 693
690 694
691 int iii = 6; 695 int iii = 6;
692 696
693 if ( QApplication::desktop()->width() == 640 ) { 697 if ( QApplication::desktop()->width() == 640 ) {
694 QHBox * nbox = new QHBox ( tab2 ); 698 Q3HBox * nbox = new Q3HBox ( tab2 );
695 label = new QLabel( i18n( "Nick name:" )+" ", nbox ); 699 label = new QLabel( i18n( "Nick name:" )+" ", nbox );
696 mNicknameEdit = new KLineEdit( nbox ); 700 mNicknameEdit = new KLineEdit( nbox );
697 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), 701 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ),
698 SLOT( textChanged( const QString& ) ) ); 702 SLOT( textChanged( const QString& ) ) );
699 label->setBuddy( mNicknameEdit ); 703 label->setBuddy( mNicknameEdit );
700 704
@@ -732,13 +736,13 @@ void AddresseeEditorWidget::setupTab2()
732 connect( mChildEdit, SIGNAL( textChanged( const QString& ) ), 736 connect( mChildEdit, SIGNAL( textChanged( const QString& ) ),
733 SLOT( textChanged( const QString& ) ) ); 737 SLOT( textChanged( const QString& ) ) );
734 label->setBuddy( mChildEdit ); 738 label->setBuddy( mChildEdit );
735 layout->addWidget( mChildEdit, iii, 2 ); 739 layout->addWidget( mChildEdit, iii, 2 );
736 ++iii; 740 ++iii;
737 if ( QApplication::desktop()->width() == 640 ) { 741 if ( QApplication::desktop()->width() == 640 ) {
738 QHBox * nbox = new QHBox ( tab2 ); 742 Q3HBox * nbox = new Q3HBox ( tab2 );
739 label = new QLabel( i18n( "Birthday:" )+" ", nbox ); 743 label = new QLabel( i18n( "Birthday:" )+" ", nbox );
740 mBirthdayPicker = new KDateEdit( nbox ); 744 mBirthdayPicker = new KDateEdit( nbox );
741 //mBirthdayPicker->toggleDateFormat(); 745 //mBirthdayPicker->toggleDateFormat();
742 mBirthdayPicker->setHandleInvalid( true ); 746 mBirthdayPicker->setHandleInvalid( true );
743 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), 747 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
744 SLOT( dateChanged( QDate ) ) ); 748 SLOT( dateChanged( QDate ) ) );
@@ -801,13 +805,13 @@ void AddresseeEditorWidget::setupTab2()
801 805
802void AddresseeEditorWidget::setupTab2_1() 806void AddresseeEditorWidget::setupTab2_1()
803{ 807{
804 // This is the Details tab 808 // This is the Details tab
805 QWidget *tab2_2 = new QWidget( mTabWidget ); 809 QWidget *tab2_2 = new QWidget( mTabWidget );
806 810
807 QGridLayout *layout = new QGridLayout( tab2_2, 1, 2 ); 811 Q3GridLayout *layout = new Q3GridLayout( tab2_2, 1, 2 );
808 layout->setMargin( KDialogBase::marginHintSmall() ); 812 layout->setMargin( KDialogBase::marginHintSmall() );
809 layout->setSpacing( KDialogBase::spacingHintSmall() ); 813 layout->setSpacing( KDialogBase::spacingHintSmall() );
810 814
811 QLabel *label; 815 QLabel *label;
812 KSeparator* bar; 816 KSeparator* bar;
813 817
@@ -923,18 +927,18 @@ void AddresseeEditorWidget::setupTab2_1()
923 // Notes 927 // Notes
924 label = new QLabel( i18n( "Note:" ), tab2_2 ); 928 label = new QLabel( i18n( "Note:" ), tab2_2 );
925 label->setAlignment( Qt::AlignTop | Qt::AlignLeft ); 929 label->setAlignment( Qt::AlignTop | Qt::AlignLeft );
926//US layout->addWidget( label, 7, 0 ); 930//US layout->addWidget( label, 7, 0 );
927 layout->addWidget( label, 0, 0 ); 931 layout->addWidget( label, 0, 0 );
928#ifndef KAB_EMBEDDED 932#ifndef KAB_EMBEDDED
929 mNoteEdit = new QTextEdit( tab2_2 ); 933 mNoteEdit = new Q3TextEdit( tab2_2 );
930 mNoteEdit->setWordWrap( QTextEdit::WidgetWidth ); 934 mNoteEdit->setWordWrap( Q3TextEdit::WidgetWidth );
931 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); 935 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() );
932#else //KAB_EMBEDDED 936#else //KAB_EMBEDDED
933 mNoteEdit = new QMultiLineEdit( tab2_2 ); 937 mNoteEdit = new Q3MultiLineEdit( tab2_2 );
934 mNoteEdit->setWordWrap( QMultiLineEdit::WidgetWidth ); 938 mNoteEdit->setWordWrap( Q3MultiLineEdit::WidgetWidth );
935 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); 939 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() );
936#endif //KAB_EMBEDDED 940#endif //KAB_EMBEDDED
937 941
938 connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) ); 942 connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) );
939 label->setBuddy( mNoteEdit ); 943 label->setBuddy( mNoteEdit );
940//US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 ); 944//US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 );
@@ -950,13 +954,13 @@ void AddresseeEditorWidget::setupTab2_1()
950 954
951void AddresseeEditorWidget::setupTab3() 955void AddresseeEditorWidget::setupTab3()
952{ 956{
953 // This is the Misc tab 957 // This is the Misc tab
954 QWidget *tab3 = new QWidget( mTabWidget ); 958 QWidget *tab3 = new QWidget( mTabWidget );
955 959
956 QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); 960 Q3GridLayout *layout = new Q3GridLayout( tab3, 1, 1 );
957 layout->setMargin( KDialogBase::marginHintSmall() ); 961 layout->setMargin( KDialogBase::marginHintSmall() );
958 layout->setSpacing( KDialogBase::spacingHintSmall() ); 962 layout->setSpacing( KDialogBase::spacingHintSmall() );
959//US layout->setColStretch( 2, 1 ); 963//US layout->setColStretch( 2, 1 );
960 964
961 ////////////////////////////////////// 965 //////////////////////////////////////
962 // Geo 966 // Geo
@@ -1002,13 +1006,13 @@ qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be
1002void AddresseeEditorWidget::setupTab3_1() 1006void AddresseeEditorWidget::setupTab3_1()
1003{ 1007{
1004 // This is the Misc tab 1008 // This is the Misc tab
1005 QWidget *tab3 = new QWidget( mTabWidget ); 1009 QWidget *tab3 = new QWidget( mTabWidget );
1006 1010
1007//US QGridLayout *layout = new QGridLayout( tab3, 2, 3 ); 1011//US QGridLayout *layout = new QGridLayout( tab3, 2, 3 );
1008 QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); 1012 Q3GridLayout *layout = new Q3GridLayout( tab3, 1, 1 );
1009 layout->setMargin( KDialogBase::marginHint() ); 1013 layout->setMargin( KDialogBase::marginHint() );
1010 layout->setSpacing( KDialogBase::spacingHint() ); 1014 layout->setSpacing( KDialogBase::spacingHint() );
1011//US layout->setColStretch( 2, 1 ); 1015//US layout->setColStretch( 2, 1 );
1012 1016
1013/*US 1017/*US
1014 ////////////////////////////////////// 1018 //////////////////////////////////////
@@ -1427,9 +1431,9 @@ QString AddresseeEditorWidget::title() const
1427 1431
1428QString AddresseeEditorWidget::identifier() const 1432QString AddresseeEditorWidget::identifier() const
1429{ 1433{
1430 return i18n( "contact_editor" ); 1434 return i18n( "contact_editor" );
1431} 1435}
1432 1436
1433#ifndef KAB_EMBEDDED 1437#ifndef KAB_EMBEDDED_
1434#include "addresseeeditorwidget.moc" 1438#include "moc_addresseeeditorwidget.cpp"
1435#endif //KAB_EMBEDDED 1439#endif //KAB_EMBEDDED
diff --git a/kaddressbook/addresseeeditorwidget.h b/kaddressbook/addresseeeditorwidget.h
index 816bbb5..aa1207e 100644
--- a/kaddressbook/addresseeeditorwidget.h
+++ b/kaddressbook/addresseeeditorwidget.h
@@ -22,13 +22,13 @@
22*/ 22*/
23 23
24#ifndef ADDRESSEEEDITORWIDGET_H 24#ifndef ADDRESSEEEDITORWIDGET_H
25#define ADDRESSEEEDITORWIDGET_H 25#define ADDRESSEEEDITORWIDGET_H
26 26
27#include <qdatetime.h> 27#include <qdatetime.h>
28#include <qpopupmenu.h> 28#include <q3popupmenu.h>
29#include <qcombobox.h> 29#include <qcombobox.h>
30 30
31#include <kabc/addressee.h> 31#include <kabc/addressee.h>
32#include <kdialogbase.h> 32#include <kdialogbase.h>
33#include <kjanuswidget.h> 33#include <kjanuswidget.h>
34 34
@@ -37,15 +37,15 @@
37class AddresseeConfig; 37class AddresseeConfig;
38class QCheckBox; 38class QCheckBox;
39class QSpinBox; 39class QSpinBox;
40class QTabWidget; 40class QTabWidget;
41 41
42#ifndef KAB_EMBEDDED 42#ifndef KAB_EMBEDDED
43class QTextEdit; 43class Q3TextEdit;
44#else //KAB_EMBEDDED 44#else //KAB_EMBEDDED
45class QMultiLineEdit; 45class Q3MultiLineEdit;
46#endif //KAB_EMBEDDED 46#endif //KAB_EMBEDDED
47 47
48class KComboBox; 48class KComboBox;
49class KDateEdit; 49class KDateEdit;
50class KLineEdit; 50class KLineEdit;
51class KSqueezedTextLabel; 51class KSqueezedTextLabel;
@@ -152,13 +152,13 @@ class AddresseeEditorWidget : public ExtensionWidget
152 AddressEditWidget *mAddressEditWidget; 152 AddressEditWidget *mAddressEditWidget;
153 EmailEditWidget *mEmailWidget; 153 EmailEditWidget *mEmailWidget;
154 PhoneEditWidget *mPhoneEditWidget; 154 PhoneEditWidget *mPhoneEditWidget;
155 KLineEdit *mURLEdit; 155 KLineEdit *mURLEdit;
156 KLineEdit *mIMAddressEdit; 156 KLineEdit *mIMAddressEdit;
157 QPushButton *mCategoryEdit; 157 QPushButton *mCategoryEdit;
158 QPopupMenu *mCatPopup; 158 Q3PopupMenu *mCatPopup;
159 SecrecyWidget *mSecrecyWidget; 159 SecrecyWidget *mSecrecyWidget;
160 KSqueezedTextLabel *mNameLabel; 160 KSqueezedTextLabel *mNameLabel;
161 161
162 // Tab2 and Tab2_2 162 // Tab2 and Tab2_2
163 KLineEdit *mDepartmentEdit; 163 KLineEdit *mDepartmentEdit;
164 KLineEdit *mOfficeEdit; 164 KLineEdit *mOfficeEdit;
@@ -169,15 +169,15 @@ class AddresseeEditorWidget : public ExtensionWidget
169 KLineEdit *mSpouseEdit; 169 KLineEdit *mSpouseEdit;
170 KLineEdit *mChildEdit; 170 KLineEdit *mChildEdit;
171 QComboBox *mGenderBox; 171 QComboBox *mGenderBox;
172 KDateEdit *mBirthdayPicker; 172 KDateEdit *mBirthdayPicker;
173 KDateEdit *mAnniversaryPicker; 173 KDateEdit *mAnniversaryPicker;
174#ifndef KAB_EMBEDDED 174#ifndef KAB_EMBEDDED
175 QTextEdit *mNoteEdit; 175 Q3TextEdit *mNoteEdit;
176#else //KAB_EMBEDDED 176#else //KAB_EMBEDDED
177 QMultiLineEdit *mNoteEdit; 177 Q3MultiLineEdit *mNoteEdit;
178#endif //KAB_EMBEDDED 178#endif //KAB_EMBEDDED
179 179
180 QSpinBox *mTimeZoneSpin; 180 QSpinBox *mTimeZoneSpin;
181 QSpinBox *mGeoLat; 181 QSpinBox *mGeoLat;
182 QSpinBox *mGeoLon; 182 QSpinBox *mGeoLon;
183 183
diff --git a/kaddressbook/addresseeutil.cpp b/kaddressbook/addresseeutil.cpp
index 366384a..a860f6d 100644
--- a/kaddressbook/addresseeutil.cpp
+++ b/kaddressbook/addresseeutil.cpp
@@ -43,13 +43,13 @@ QString AddresseeUtil::addresseesToClipboard( const KABC::Addressee::List &list
43 43
44 return vcard; 44 return vcard;
45} 45}
46 46
47KABC::Addressee::List AddresseeUtil::clipboardToAddressees( const QString &data ) 47KABC::Addressee::List AddresseeUtil::clipboardToAddressees( const QString &data )
48{ 48{
49 uint numVCards = data.contains( "BEGIN:VCARD", false ); 49 uint numVCards = data.count( "BEGIN:VCARD", Qt::CaseInsensitive );
50 QStringList dataList = QStringList::split( "\r\n\r\n", data ); 50 QStringList dataList = QStringList::split( "\r\n\r\n", data );
51 51
52 KABC::Addressee::List addrList; 52 KABC::Addressee::List addrList;
53 for ( uint i = 0; i < numVCards && i < dataList.count(); ++i ) { 53 for ( uint i = 0; i < numVCards && i < dataList.count(); ++i ) {
54 KABC::VCardConverter converter; 54 KABC::VCardConverter converter;
55 KABC::Addressee addr; 55 KABC::Addressee addr;
diff --git a/kaddressbook/addviewdialog.cpp b/kaddressbook/addviewdialog.cpp
index 6def26b..b52a83c 100644
--- a/kaddressbook/addviewdialog.cpp
+++ b/kaddressbook/addviewdialog.cpp
@@ -22,54 +22,56 @@
22*/ 22*/
23 23
24#ifndef KAB_EMBEDDED 24#ifndef KAB_EMBEDDED
25#endif //KAB_EMBEDDED 25#endif //KAB_EMBEDDED
26 26
27#include <qradiobutton.h> 27#include <qradiobutton.h>
28#include <qbuttongroup.h> 28#include <q3buttongroup.h>
29#include <qlabel.h> 29#include <qlabel.h>
30#include <qlineedit.h> 30#include <qlineedit.h>
31#include <qlayout.h> 31#include <qlayout.h>
32//Added by qt3to4:
33#include <Q3GridLayout>
32 34
33#include <klocale.h> 35#include <klocale.h>
34#include <kglobal.h> 36#include <kglobal.h>
35#include "kaddressbookview.h" 37#include "kaddressbookview.h"
36#include "addviewdialog.h" 38#include "addviewdialog.h"
37 39
38AddViewDialog::AddViewDialog( QDict<ViewFactory> *viewFactoryDict, 40AddViewDialog::AddViewDialog( Q3Dict<ViewFactory> *viewFactoryDict,
39 QWidget *parent, const char *name ) 41 QWidget *parent, const char *name )
40 : KDialogBase( KDialogBase::Plain, i18n( "Add View" ), 42 : KDialogBase( KDialogBase::Plain, i18n( "Add View" ),
41 KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, 43 KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok,
42 parent, name ), 44 parent, name ),
43 mViewFactoryDict( viewFactoryDict ) 45 mViewFactoryDict( viewFactoryDict )
44{ 46{
45//US setMinimumSize( KMIN(KGlobal::getDesktopWidth(), 300), KMIN(KGlobal::getDesktopHeight(), 300)); 47//US setMinimumSize( KMIN(KGlobal::getDesktopWidth(), 300), KMIN(KGlobal::getDesktopHeight(), 300));
46 48
47 mTypeId = 0; 49 mTypeId = 0;
48 50
49 QWidget *page = plainPage(); 51 QWidget *page = plainPage();
50 52
51 QGridLayout *layout = new QGridLayout( page, 2, 2 ); 53 Q3GridLayout *layout = new Q3GridLayout( page, 2, 2 );
52 layout->setSpacing( spacingHint() ); 54 layout->setSpacing( spacingHint() );
53 layout->setRowStretch( 1, 1 ); 55 layout->setRowStretch( 1, 1 );
54 layout->setColStretch( 1, 1 ); 56 layout->setColStretch( 1, 1 );
55 57
56 QLabel *label = new QLabel( i18n( "View name:" ), page ); 58 QLabel *label = new QLabel( i18n( "View name:" ), page );
57 layout->addWidget( label, 0, 0 ); 59 layout->addWidget( label, 0, 0 );
58 60
59 mViewNameEdit = new QLineEdit( page ); 61 mViewNameEdit = new QLineEdit( page );
60 connect( mViewNameEdit, SIGNAL( textChanged( const QString& ) ), 62 connect( mViewNameEdit, SIGNAL( textChanged( const QString& ) ),
61 SLOT( textChanged( const QString& ) ) ); 63 SLOT( textChanged( const QString& ) ) );
62 layout->addWidget( mViewNameEdit, 0, 1 ); 64 layout->addWidget( mViewNameEdit, 0, 1 );
63 65
64 mTypeGroup = new QButtonGroup( 2, Qt::Horizontal, i18n( "View Type" ), page ); 66 mTypeGroup = new Q3ButtonGroup( 2, Qt::Horizontal, i18n( "View Type" ), page );
65 connect( mTypeGroup, SIGNAL( clicked( int ) ), this, SLOT( clicked( int ) ) ); 67 connect( mTypeGroup, SIGNAL( clicked( int ) ), this, SLOT( clicked( int ) ) );
66 layout->addMultiCellWidget( mTypeGroup, 1, 1, 0, 1 ); 68 layout->addMultiCellWidget( mTypeGroup, 1, 1, 0, 1 );
67 69
68 // Now create the radio buttons. This needs some layout work. 70 // Now create the radio buttons. This needs some layout work.
69 QDictIterator<ViewFactory> iter( *mViewFactoryDict ); 71 Q3DictIterator<ViewFactory> iter( *mViewFactoryDict );
70 for ( iter.toFirst(); iter.current(); ++iter ) { 72 for ( iter.toFirst(); iter.current(); ++iter ) {
71//US i am not quit sure, why I can nopt use (*iter)-> here 73//US i am not quit sure, why I can nopt use (*iter)-> here
72//US new QRadioButton( (*iter)->type(), mTypeGroup ); 74//US new QRadioButton( (*iter)->type(), mTypeGroup );
73//US label = new QLabel( (*iter)->description(), mTypeGroup ); 75//US label = new QLabel( (*iter)->description(), mTypeGroup );
74#ifdef DESKTOP_VERSION 76#ifdef DESKTOP_VERSION
75 new QRadioButton( (*iter)->type(), mTypeGroup ); 77 new QRadioButton( (*iter)->type(), mTypeGroup );
@@ -110,9 +112,9 @@ void AddViewDialog::clicked( int id )
110 112
111void AddViewDialog::textChanged( const QString &text ) 113void AddViewDialog::textChanged( const QString &text )
112{ 114{
113 enableButton( KDialogBase::Ok, !text.isEmpty() ); 115 enableButton( KDialogBase::Ok, !text.isEmpty() );
114} 116}
115 117
116#ifndef KAB_EMBEDDED 118#ifndef KAB_EMBEDDED_
117#include "addviewdialog.moc" 119#include "moc_addviewdialog.cpp"
118#endif //KAB_EMBEDDED 120#endif //KAB_EMBEDDED
diff --git a/kaddressbook/addviewdialog.h b/kaddressbook/addviewdialog.h
index 8cc12f5..c3e8efd 100644
--- a/kaddressbook/addviewdialog.h
+++ b/kaddressbook/addviewdialog.h
@@ -22,17 +22,17 @@
22*/ 22*/
23 23
24#ifndef ADDVIEWDIALOG_H 24#ifndef ADDVIEWDIALOG_H
25#define ADDVIEWDIALOG_H 25#define ADDVIEWDIALOG_H
26 26
27#include <kdialogbase.h> 27#include <kdialogbase.h>
28#include <qdict.h> 28#include <q3dict.h>
29#include <qstring.h> 29#include <qstring.h>
30 30
31class ViewFactory; 31class ViewFactory;
32class QButtonGroup; 32class Q3ButtonGroup;
33class QLineEdit; 33class QLineEdit;
34 34
35 35
36/** 36/**
37 Modal dialog used for adding a new view. The dialog asks for the name of 37 Modal dialog used for adding a new view. The dialog asks for the name of
38 the view as well as the type. Someday it would be nice for this to be a 38 the view as well as the type. Someday it would be nice for this to be a
@@ -40,13 +40,13 @@ class QLineEdit;
40 */ 40 */
41class AddViewDialog : public KDialogBase 41class AddViewDialog : public KDialogBase
42{ 42{
43 Q_OBJECT 43 Q_OBJECT
44 44
45 public: 45 public:
46 AddViewDialog( QDict<ViewFactory> *viewFactoryDict, QWidget *parent, 46 AddViewDialog( Q3Dict<ViewFactory> *viewFactoryDict, QWidget *parent,
47 const char *name = 0 ); 47 const char *name = 0 );
48 ~AddViewDialog(); 48 ~AddViewDialog();
49 49
50 QString viewName()const; 50 QString viewName()const;
51 51
52 QString viewType()const ; 52 QString viewType()const ;
@@ -60,14 +60,14 @@ class AddViewDialog : public KDialogBase
60 /** 60 /**
61 Called when the user changes the text in the name of the view. 61 Called when the user changes the text in the name of the view.
62 */ 62 */
63 void textChanged( const QString &text ); 63 void textChanged( const QString &text );
64 64
65 private: 65 private:
66 QDict<ViewFactory> *mViewFactoryDict; 66 Q3Dict<ViewFactory> *mViewFactoryDict;
67 QLineEdit *mViewNameEdit; 67 QLineEdit *mViewNameEdit;
68 QButtonGroup *mTypeGroup; 68 Q3ButtonGroup *mTypeGroup;
69 69
70 int mTypeId; 70 int mTypeId;
71}; 71};
72 72
73#endif 73#endif
diff --git a/kaddressbook/details/detailsviewcontainer.cpp b/kaddressbook/details/detailsviewcontainer.cpp
index cee5886..4a86aca 100644
--- a/kaddressbook/details/detailsviewcontainer.cpp
+++ b/kaddressbook/details/detailsviewcontainer.cpp
@@ -19,16 +19,19 @@
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qcombobox.h> 24#include <qcombobox.h>
25#include <qframe.h> 25#include <q3frame.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qwidgetstack.h> 28#include <q3widgetstack.h>
29//Added by qt3to4:
30#include <Q3HBoxLayout>
31#include <Q3VBoxLayout>
29 32
30#include <kapplication.h> 33#include <kapplication.h>
31#include <kdebug.h> 34#include <kdebug.h>
32#include <kdialog.h> 35#include <kdialog.h>
33 36
34#include "look_basic.h" 37#include "look_basic.h"
@@ -42,32 +45,32 @@
42 45
43#include "detailsviewcontainer.h" 46#include "detailsviewcontainer.h"
44 47
45ViewContainer::ViewContainer( QWidget *parent, const char* name ) 48ViewContainer::ViewContainer( QWidget *parent, const char* name )
46 : QWidget( parent, name ), mCurrentLook( 0 ) 49 : QWidget( parent, name ), mCurrentLook( 0 )
47{ 50{
48 QBoxLayout *topLayout = new QVBoxLayout( this ); 51 Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
49 //topLayout->setMargin( KDialog::marginHint() ); 52 //topLayout->setMargin( KDialog::marginHint() );
50 //topLayout->setSpacing( KDialog::spacingHint() ); 53 //topLayout->setSpacing( KDialog::spacingHint() );
51 topLayout->setMargin( 0 ); 54 topLayout->setMargin( 0 );
52 topLayout->setSpacing( 0 ); 55 topLayout->setSpacing( 0 );
53 56
54 QBoxLayout *styleLayout = new QHBoxLayout( topLayout ); 57 Q3BoxLayout *styleLayout = new Q3HBoxLayout( topLayout );
55 58
56 QLabel *label = new QLabel( i18n("Style:"), this ); 59 QLabel *label = new QLabel( i18n("Style:"), this );
57 styleLayout->addWidget( label ); 60 styleLayout->addWidget( label );
58 61
59 mStyleCombo = new QComboBox( this ); 62 mStyleCombo = new QComboBox( this );
60 styleLayout->addWidget( mStyleCombo ); 63 styleLayout->addWidget( mStyleCombo );
61 64
62 QFrame *frameRuler = new QFrame( this ); 65 Q3Frame *frameRuler = new Q3Frame( this );
63//US frameRuler->setFrameShape( QFrame::HLine ); 66//US frameRuler->setFrameShape( QFrame::HLine );
64//US frameRuler->setFrameShadow( QFrame::Sunken ); 67//US frameRuler->setFrameShadow( QFrame::Sunken );
65//US topLayout->addWidget( frameRuler ); 68//US topLayout->addWidget( frameRuler );
66 69
67 mDetailsStack = new QWidgetStack( this ); 70 mDetailsStack = new Q3WidgetStack( this );
68 topLayout->addWidget( mDetailsStack, 1 ); 71 topLayout->addWidget( mDetailsStack, 1 );
69 72
70 registerLooks(); 73 registerLooks();
71 74
72#if 1 75#if 1
73 // Hide detailed view selection combo box, because we currently have 76 // Hide detailed view selection combo box, because we currently have
@@ -156,9 +159,9 @@ KABC::Addressee ViewContainer::addressee()
156void ViewContainer::setReadOnly( bool state ) 159void ViewContainer::setReadOnly( bool state )
157{ 160{
158 if ( mCurrentLook ) 161 if ( mCurrentLook )
159 mCurrentLook->setReadOnly( state ); 162 mCurrentLook->setReadOnly( state );
160} 163}
161 164
162#ifndef KAB_EMBEDDED 165#ifndef KAB_EMBEDDED_
163#include "detailsviewcontainer.moc" 166#include "moc_detailsviewcontainer.cpp"
164#endif //KAB_EMBEDDED 167#endif //KAB_EMBEDDED
diff --git a/kaddressbook/details/detailsviewcontainer.h b/kaddressbook/details/detailsviewcontainer.h
index 9684736..f310a30 100644
--- a/kaddressbook/details/detailsviewcontainer.h
+++ b/kaddressbook/details/detailsviewcontainer.h
@@ -21,18 +21,18 @@
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef DETAILSVIEWCONTAINER_H 24#ifndef DETAILSVIEWCONTAINER_H
25#define DETAILSVIEWCONTAINER_H 25#define DETAILSVIEWCONTAINER_H
26 26
27#include <qptrlist.h> 27#include <q3ptrlist.h>
28 28
29#include "look_basic.h" 29#include "look_basic.h"
30 30
31class QComboBox; 31class QComboBox;
32class QWidgetStack; 32class Q3WidgetStack;
33 33
34class ViewContainer : public QWidget 34class ViewContainer : public QWidget
35{ 35{
36 Q_OBJECT 36 Q_OBJECT
37 37
38 public: 38 public:
@@ -91,13 +91,13 @@ class ViewContainer : public QWidget
91 */ 91 */
92 void registerLooks(); 92 void registerLooks();
93 93
94 private: 94 private:
95 KABC::Addressee mCurrentAddressee; 95 KABC::Addressee mCurrentAddressee;
96 KABBasicLook *mCurrentLook; 96 KABBasicLook *mCurrentLook;
97 QPtrList<KABLookFactory> mLookFactories; 97 Q3PtrList<KABLookFactory> mLookFactories;
98 98
99 QComboBox *mStyleCombo; 99 QComboBox *mStyleCombo;
100 QWidgetStack *mDetailsStack; 100 Q3WidgetStack *mDetailsStack;
101}; 101};
102 102
103#endif 103#endif
diff --git a/kaddressbook/details/look_basic.cpp b/kaddressbook/details/look_basic.cpp
index 0245686..48cc42a 100644
--- a/kaddressbook/details/look_basic.cpp
+++ b/kaddressbook/details/look_basic.cpp
@@ -23,13 +23,13 @@
23 23
24#include <kdebug.h> 24#include <kdebug.h>
25 25
26#include "look_basic.h" 26#include "look_basic.h"
27 27
28KABBasicLook::KABBasicLook( QWidget *parent, const char *name ) 28KABBasicLook::KABBasicLook( QWidget *parent, const char *name )
29 : QVBox( parent, name ), mReadOnly( false ) 29 : Q3VBox( parent, name ), mReadOnly( false )
30{ 30{
31} 31}
32 32
33void KABBasicLook::setReadOnly( bool state ) 33void KABBasicLook::setReadOnly( bool state )
34{ 34{
35 mReadOnly = state; 35 mReadOnly = state;
@@ -67,9 +67,9 @@ KABLookFactory::KABLookFactory( QWidget *parent, const char *name )
67{ 67{
68} 68}
69 69
70KABLookFactory::~KABLookFactory() 70KABLookFactory::~KABLookFactory()
71{ 71{
72} 72}
73#ifndef KAB_EMBEDDED 73#ifndef KAB_EMBEDDED_
74#include "look_basic.moc" 74#include "moc_look_basic.cpp"
75#endif //KAB_EMBEDDED 75#endif //KAB_EMBEDDED
diff --git a/kaddressbook/details/look_basic.h b/kaddressbook/details/look_basic.h
index a65c99c..a70e7f7 100644
--- a/kaddressbook/details/look_basic.h
+++ b/kaddressbook/details/look_basic.h
@@ -22,13 +22,13 @@
22*/ 22*/
23 23
24#ifndef LOOK_KABBASIC_H 24#ifndef LOOK_KABBASIC_H
25#define LOOK_KABBASIC_H 25#define LOOK_KABBASIC_H
26 26
27#include <kabc/addressbook.h> 27#include <kabc/addressbook.h>
28#include <qvbox.h> 28#include <q3vbox.h>
29 29
30class KConfig; 30class KConfig;
31 31
32/** 32/**
33 This is a pure virtual base class that defines the 33 This is a pure virtual base class that defines the
34 interface for how to display and change entries of 34 interface for how to display and change entries of
@@ -38,13 +38,13 @@ class KConfig;
38 Derive it and implement its look and how the user may edit the 38 Derive it and implement its look and how the user may edit the
39 entry. 39 entry.
40 40
41 The paintEvent() has to paint the whole widget, since repaint() 41 The paintEvent() has to paint the whole widget, since repaint()
42 calls will not delete the widgets background. 42 calls will not delete the widgets background.
43 */ 43 */
44class KABBasicLook : public QVBox 44class KABBasicLook : public Q3VBox
45{ 45{
46 Q_OBJECT 46 Q_OBJECT
47 47
48 public: 48 public:
49 /** 49 /**
50 The constructor. 50 The constructor.
diff --git a/kaddressbook/details/look_details.cpp b/kaddressbook/details/look_details.cpp
index 11d06e9..2c3a79d 100644
--- a/kaddressbook/details/look_details.cpp
+++ b/kaddressbook/details/look_details.cpp
@@ -186,16 +186,16 @@ void KABDetailedView::mouseMoveEvent( QMouseEvent *e )
186 setCursor(ArrowCursor); 186 setCursor(ArrowCursor);
187 } 187 }
188} 188}
189 189
190void KABDetailedView::mousePressEvent( QMouseEvent *e ) 190void KABDetailedView::mousePressEvent( QMouseEvent *e )
191{ 191{
192 QPopupMenu menu( this ); 192 Q3PopupMenu menu( this );
193 QPopupMenu *menuBG = new QPopupMenu( &menu ); 193 Q3PopupMenu *menuBG = new Q3PopupMenu( &menu );
194 mMenuBorderedBG = new QPopupMenu( &menu ); 194 mMenuBorderedBG = new Q3PopupMenu( &menu );
195 mMenuTiledBG = new QPopupMenu( &menu ); 195 mMenuTiledBG = new Q3PopupMenu( &menu );
196 196
197 menu.insertItem( i18n( "Select Background" ), menuBG ); 197 menu.insertItem( i18n( "Select Background" ), menuBG );
198 menuBG->insertItem( i18n( "Bordered Backgrounds" ), mMenuBorderedBG ); 198 menuBG->insertItem( i18n( "Bordered Backgrounds" ), mMenuBorderedBG );
199 menuBG->insertItem( i18n( "Tiled Backgrounds" ), mMenuTiledBG ); 199 menuBG->insertItem( i18n( "Tiled Backgrounds" ), mMenuTiledBG );
200 menu.insertSeparator(); 200 menu.insertSeparator();
201 201
@@ -411,9 +411,9 @@ void KABDetailedView::restoreSettings( KConfig *config )
411 mPainter->setHeadLineFont( QFont( gfont, gpointsize + 2, QFont::Bold, true ) ); 411 mPainter->setHeadLineFont( QFont( gfont, gpointsize + 2, QFont::Bold, true ) );
412 mPainter->setBodyFont( QFont( gfont, gpointsize, QFont::Normal, false ) ); 412 mPainter->setBodyFont( QFont( gfont, gpointsize, QFont::Normal, false ) );
413 mPainter->setFixedFont( QFont( ffont, fpointsize, QFont::Normal, false ) ); 413 mPainter->setFixedFont( QFont( ffont, fpointsize, QFont::Normal, false ) );
414 mPainter->setCommentFont( QFont( gfont, gpointsize, QFont::Normal, false ) ); 414 mPainter->setCommentFont( QFont( gfont, gpointsize, QFont::Normal, false ) );
415} 415}
416 416
417#ifndef KAB_EMBEDDED 417#ifndef KAB_EMBEDDED_
418#include "look_details.moc" 418#include "moc_look_details.cpp"
419#endif //KAB_EMBEDDED 419#endif //KAB_EMBEDDED
diff --git a/kaddressbook/details/look_details.h b/kaddressbook/details/look_details.h
index e8d50a9..b59d3a7 100644
--- a/kaddressbook/details/look_details.h
+++ b/kaddressbook/details/look_details.h
@@ -127,14 +127,14 @@ class KABDetailedView : public KABBasicLook
127 KToggleAction *mActionShowURLs; 127 KToggleAction *mActionShowURLs;
128 128
129 const int mGrid; 129 const int mGrid;
130 QStringList mBorders; 130 QStringList mBorders;
131 QStringList mTiles; 131 QStringList mTiles;
132 132
133 QPopupMenu *mMenuBorderedBG; 133 Q3PopupMenu *mMenuBorderedBG;
134 QPopupMenu *mMenuTiledBG; 134 Q3PopupMenu *mMenuTiledBG;
135 135
136 static const QString mBorderedBGDir; 136 static const QString mBorderedBGDir;
137 static const QString mTiledBGDir; 137 static const QString mTiledBGDir;
138}; 138};
139 139
140class KABDetailedViewFactory : public KABLookFactory 140class KABDetailedViewFactory : public KABLookFactory
diff --git a/kaddressbook/details/look_html.cpp b/kaddressbook/details/look_html.cpp
index bb30650..4ec1c7d 100644
--- a/kaddressbook/details/look_html.cpp
+++ b/kaddressbook/details/look_html.cpp
@@ -21,13 +21,13 @@
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <addresseeview.h> 24#include <addresseeview.h>
25 25
26#include "look_html.h" 26#include "look_html.h"
27#include <qscrollview.h> 27#include <q3scrollview.h>
28#include "kabprefs.h" 28#include "kabprefs.h"
29#include <kabc/addresseeview.h> 29#include <kabc/addresseeview.h>
30KABHtmlView::KABHtmlView( QWidget *parent, const char *name ) 30KABHtmlView::KABHtmlView( QWidget *parent, const char *name )
31 : KABBasicLook( parent, name ) 31 : KABBasicLook( parent, name )
32{ 32{
33 mView = new KABC::AddresseeView( this ); 33 mView = new KABC::AddresseeView( this );
@@ -48,9 +48,9 @@ void KABHtmlView::printMe()
48void KABHtmlView::setAddressee( const KABC::Addressee &addr ) 48void KABHtmlView::setAddressee( const KABC::Addressee &addr )
49{ 49{
50 mView->setFont( KABPrefs::instance()->mDetailsFont ); 50 mView->setFont( KABPrefs::instance()->mDetailsFont );
51 mView->setAddressee( addr ); 51 mView->setAddressee( addr );
52} 52}
53 53
54#ifndef KAB_EMBEDDED 54#ifndef KAB_EMBEDDED_
55#include "look_html.moc" 55#include "moc_look_html.cpp"
56#endif //KAB_EMBEDDED 56#endif //KAB_EMBEDDED
diff --git a/kaddressbook/emaileditwidget.cpp b/kaddressbook/emaileditwidget.cpp
index e72face..09df47f 100644
--- a/kaddressbook/emaileditwidget.cpp
+++ b/kaddressbook/emaileditwidget.cpp
@@ -25,13 +25,15 @@
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qpushbutton.h> 27#include <qpushbutton.h>
28#include <qstring.h> 28#include <qstring.h>
29#include <qtoolbutton.h> 29#include <qtoolbutton.h>
30#include <qtooltip.h> 30#include <qtooltip.h>
31#include <qlistbox.h> 31#include <q3listbox.h>
32//Added by qt3to4:
33#include <Q3GridLayout>
32 34
33#ifndef KAB_EMBEDDED 35#ifndef KAB_EMBEDDED
34#include <kaccelmanager.h> 36#include <kaccelmanager.h>
35#endif //KAB_EMBEDDED 37#endif //KAB_EMBEDDED
36#include <kconfig.h> 38#include <kconfig.h>
37#include <kcombobox.h> 39#include <kcombobox.h>
@@ -45,20 +47,20 @@
45 47
46#include "emaileditwidget.h" 48#include "emaileditwidget.h"
47 49
48EmailEditWidget::EmailEditWidget( QWidget *parent, const char *name ) 50EmailEditWidget::EmailEditWidget( QWidget *parent, const char *name )
49 : QWidget( parent, name ) 51 : QWidget( parent, name )
50{ 52{
51 QGridLayout *topLayout = new QGridLayout( this, 2, 2 ); 53 Q3GridLayout *topLayout = new Q3GridLayout( this, 2, 2 );
52 topLayout->setSpacing( KDialog::spacingHint() ); 54 topLayout->setSpacing( KDialog::spacingHint() );
53 QLabel* label = new QLabel( this ); 55 QLabel* label = new QLabel( this );
54 56
55 label->setPixmap( KGlobal::iconLoader()->loadIcon( "mail_send", KIcon::Desktop, 0) ); 57 label->setPixmap( KGlobal::iconLoader()->loadIcon( "mail_send", KIcon::Desktop, 0) );
56 58
57 topLayout->addWidget( label, 0, 0 ); 59 topLayout->addWidget( label, 0, 0 );
58 label->setAlignment( AlignCenter ); 60 label->setAlignment( Qt::AlignCenter );
59 QPushButton *editButton = new QPushButton( i18n( "Edit Email Addresses..." ), this); 61 QPushButton *editButton = new QPushButton( i18n( "Edit Email Addresses..." ), this);
60 topLayout->addWidget( editButton, 0, 1 ); 62 topLayout->addWidget( editButton, 0, 1 );
61 label = new QLabel( i18n( "Email:" ), this ); 63 label = new QLabel( i18n( "Email:" ), this );
62 topLayout->addWidget( label, 1, 0 ); 64 topLayout->addWidget( label, 1, 0 );
63 65
64 mEmailEdit = new KLineEdit( this ); 66 mEmailEdit = new KLineEdit( this );
@@ -134,13 +136,13 @@ EmailEditDialog::EmailEditDialog( const QStringList &list, QWidget *parent,
134 : KDialogBase( KDialogBase::Plain, i18n( "Edit Email Addresses" ), 136 : KDialogBase( KDialogBase::Plain, i18n( "Edit Email Addresses" ),
135 KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, 137 KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok,
136 parent, name, true ) 138 parent, name, true )
137{ 139{
138 QWidget *page = plainPage(); 140 QWidget *page = plainPage();
139 141
140 QGridLayout *topLayout = new QGridLayout( page, 4, 3 ); 142 Q3GridLayout *topLayout = new Q3GridLayout( page, 4, 3 );
141 143
142 QLabel *label = new QLabel( i18n( "Email address:" ), page ); 144 QLabel *label = new QLabel( i18n( "Email address:" ), page );
143 topLayout->addWidget( label, 0, 0 ); 145 topLayout->addWidget( label, 0, 0 );
144 146
145 mEmailEdit = new KLineEdit( page ); 147 mEmailEdit = new KLineEdit( page );
146 label->setBuddy( mEmailEdit ); 148 label->setBuddy( mEmailEdit );
@@ -151,13 +153,13 @@ EmailEditDialog::EmailEditDialog( const QStringList &list, QWidget *parent,
151 153
152 mAddButton = new QPushButton( i18n( "Add" ), page ); 154 mAddButton = new QPushButton( i18n( "Add" ), page );
153 mAddButton->setEnabled( false ); 155 mAddButton->setEnabled( false );
154 connect( mAddButton, SIGNAL( clicked() ), SLOT( add() ) ); 156 connect( mAddButton, SIGNAL( clicked() ), SLOT( add() ) );
155 topLayout->addWidget( mAddButton, 0, 2 ); 157 topLayout->addWidget( mAddButton, 0, 2 );
156 158
157 mEmailListBox = new QListBox( page ); 159 mEmailListBox = new Q3ListBox( page );
158 160
159 // Make sure there is room for the scrollbar 161 // Make sure there is room for the scrollbar
160 mEmailListBox->setMinimumHeight( mEmailListBox->sizeHint().height() + 30 ); 162 mEmailListBox->setMinimumHeight( mEmailListBox->sizeHint().height() + 30 );
161 connect( mEmailListBox, SIGNAL( highlighted( int ) ), 163 connect( mEmailListBox, SIGNAL( highlighted( int ) ),
162 SLOT( selectionChanged( int ) ) ); 164 SLOT( selectionChanged( int ) ) );
163 topLayout->addMultiCellWidget( mEmailListBox, 1, 3, 0, 1 ); 165 topLayout->addMultiCellWidget( mEmailListBox, 1, 3, 0, 1 );
@@ -269,9 +271,9 @@ void EmailEditDialog::selectionChanged( int index )
269 271
270void EmailEditDialog::emailChanged() 272void EmailEditDialog::emailChanged()
271{ 273{
272 mAddButton->setEnabled( !mEmailEdit->text().isEmpty() ); 274 mAddButton->setEnabled( !mEmailEdit->text().isEmpty() );
273} 275}
274 276
275#ifndef KAB_EMBEDDED 277#ifndef KAB_EMBEDDED_
276#include "emaileditwidget.moc" 278#include "moc_emaileditwidget.cpp"
277#endif //KAB_EMBEDDED 279#endif //KAB_EMBEDDED
diff --git a/kaddressbook/emaileditwidget.h b/kaddressbook/emaileditwidget.h
index acdecaf..618acee 100644
--- a/kaddressbook/emaileditwidget.h
+++ b/kaddressbook/emaileditwidget.h
@@ -26,17 +26,17 @@
26 26
27#include <kabc/addressee.h> 27#include <kabc/addressee.h>
28#include <kdialogbase.h> 28#include <kdialogbase.h>
29 29
30#include "addresseeconfig.h" 30#include "addresseeconfig.h"
31 31
32class QButtonGroup; 32class Q3ButtonGroup;
33class QCheckBox; 33class QCheckBox;
34class QListView; 34class Q3ListView;
35class QListBox; 35class Q3ListBox;
36class QTextEdit; 36class Q3TextEdit;
37class QToolButton; 37class QToolButton;
38 38
39class KComboBox; 39class KComboBox;
40class KLineEdit; 40class KLineEdit;
41class KListView; 41class KListView;
42 42
@@ -86,13 +86,13 @@ class EmailEditDialog : public KDialogBase
86 void standard(); 86 void standard();
87 void selectionChanged( int ); 87 void selectionChanged( int );
88 void emailChanged(); 88 void emailChanged();
89 89
90 private: 90 private:
91 KLineEdit *mEmailEdit; 91 KLineEdit *mEmailEdit;
92 QListBox *mEmailListBox; 92 Q3ListBox *mEmailListBox;
93 QPushButton *mAddButton; 93 QPushButton *mAddButton;
94 QPushButton *mRemoveButton; 94 QPushButton *mRemoveButton;
95 QPushButton *mEditButton; 95 QPushButton *mEditButton;
96 QPushButton *mStandardButton; 96 QPushButton *mStandardButton;
97 97
98 bool mChanged; 98 bool mChanged;
diff --git a/kaddressbook/extensionmanager.cpp b/kaddressbook/extensionmanager.cpp
index 46defa1..5356224 100644
--- a/kaddressbook/extensionmanager.cpp
+++ b/kaddressbook/extensionmanager.cpp
@@ -19,12 +19,14 @@
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#include <qlayout.h> 23#include <qlayout.h>
24#include <qapplication.h> 24#include <qapplication.h>
25//Added by qt3to4:
26#include <Q3HBoxLayout>
25#include <kactionclasses.h> 27#include <kactionclasses.h>
26#include <kconfig.h> 28#include <kconfig.h>
27#include <kdebug.h> 29#include <kdebug.h>
28#include <klocale.h> 30#include <klocale.h>
29 31
30#ifndef KAB_EMBEDDED 32#ifndef KAB_EMBEDDED
@@ -39,13 +41,13 @@
39#include "kabprefs.h" 41#include "kabprefs.h"
40 42
41#include "extensionmanager.h" 43#include "extensionmanager.h"
42 44
43ExtensionManager::ExtensionManager( KABCore *core, QWidget *parent, 45ExtensionManager::ExtensionManager( KABCore *core, QWidget *parent,
44 const char *name ) 46 const char *name )
45 : QScrollView( parent, name ), mCore( core ), mCurrentExtensionWidget( 0 ) 47 : Q3ScrollView( parent, name ), mCore( core ), mCurrentExtensionWidget( 0 )
46{ 48{
47#ifdef KAB_EMBEDDED 49#ifdef KAB_EMBEDDED
48//US QPopupMenu *settingsmenu = (QPopupMenu*)mCore->getSettingsMenu(); 50//US QPopupMenu *settingsmenu = (QPopupMenu*)mCore->getSettingsMenu();
49 QWidget *settingsmenu = (QWidget*)mCore->getViewMenu(); 51 QWidget *settingsmenu = (QWidget*)mCore->getViewMenu();
50#endif //KAB_EMBEDDED 52#endif //KAB_EMBEDDED
51 53
@@ -55,13 +57,13 @@ ExtensionManager::ExtensionManager( KABCore *core, QWidget *parent,
55 57
56 mActionExtensions->plug( settingsmenu ,0); 58 mActionExtensions->plug( settingsmenu ,0);
57 59
58 connect( mActionExtensions, SIGNAL( activated( int ) ), 60 connect( mActionExtensions, SIGNAL( activated( int ) ),
59 SLOT( setActiveExtension( int ) ) ); 61 SLOT( setActiveExtension( int ) ) );
60 mWidgetBox = new QWidget( viewport() ); 62 mWidgetBox = new QWidget( viewport() );
61 new QHBoxLayout (mWidgetBox ); 63 new Q3HBoxLayout (mWidgetBox );
62 addChild( mWidgetBox ); 64 addChild( mWidgetBox );
63 setResizePolicy(AutoOneFit); 65 setResizePolicy(AutoOneFit);
64 createExtensionWidgets(); 66 createExtensionWidgets();
65 hide(); 67 hide();
66} 68}
67 69
@@ -145,24 +147,24 @@ void ExtensionManager::setActiveExtension( int id )
145} 147}
146 148
147void ExtensionManager::createExtensionWidgets() 149void ExtensionManager::createExtensionWidgets()
148{ 150{
149 // clear extension widget list 151 // clear extension widget list
150 mExtensionWidgetList.setAutoDelete( true ); 152 mExtensionWidgetList.setAutoDelete( true );
151 QPtrListIterator<ExtensionWidget> wdgIt( mExtensionWidgetList ); 153 Q3PtrListIterator<ExtensionWidget> wdgIt( mExtensionWidgetList );
152 ExtensionWidget *wdg = 0; 154 ExtensionWidget *wdg = 0;
153 while ( ( wdg = wdgIt.current() ) != 0 ) 155 while ( ( wdg = wdgIt.current() ) != 0 )
154 mExtensionWidgetList.remove( wdg ); 156 mExtensionWidgetList.remove( wdg );
155 157
156 mExtensionWidgetList.setAutoDelete( false ); 158 mExtensionWidgetList.setAutoDelete( false );
157 159
158 QStringList extensionNames( i18n( "None" ) ); 160 QStringList extensionNames( i18n( "None" ) );
159 161
160 // add addressee editor as default 162 // add addressee editor as default
161 163
162 QHBoxLayout *hbl = (QHBoxLayout *) mWidgetBox->layout();; 164 Q3HBoxLayout *hbl = (Q3HBoxLayout *) mWidgetBox->layout();;
163 165
164 wdg = new AddresseeEditorWidget( mCore, true, mWidgetBox ); 166 wdg = new AddresseeEditorWidget( mCore, true, mWidgetBox );
165 hbl->addWidget( wdg ); 167 hbl->addWidget( wdg );
166 //wdg->hide(); 168 //wdg->hide();
167 connect( wdg, SIGNAL( modified( const KABC::Addressee::List& ) ), 169 connect( wdg, SIGNAL( modified( const KABC::Addressee::List& ) ),
168 SIGNAL( modified( const KABC::Addressee::List& ) ) ); 170 SIGNAL( modified( const KABC::Addressee::List& ) ) );
@@ -241,9 +243,9 @@ void ExtensionManager::createExtensionWidgets()
241 243
242 244
243 mActionExtensions->setItems( extensionNames ); 245 mActionExtensions->setItems( extensionNames );
244 mCurrentExtensionWidget = 0; 246 mCurrentExtensionWidget = 0;
245} 247}
246 248
247#ifndef KAB_EMBEDDED 249#ifndef KAB_EMBEDDED_
248#include "extensionmanager.moc" 250#include "moc_extensionmanager.cpp"
249#endif //KAB_EMBEDDED 251#endif //KAB_EMBEDDED
diff --git a/kaddressbook/extensionmanager.h b/kaddressbook/extensionmanager.h
index 611a037..84c948b 100644
--- a/kaddressbook/extensionmanager.h
+++ b/kaddressbook/extensionmanager.h
@@ -21,23 +21,23 @@
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef EXTENSIONMANAGER_H 24#ifndef EXTENSIONMANAGER_H
25#define EXTENSIONMANAGER_H 25#define EXTENSIONMANAGER_H
26 26
27#include <qhbox.h> 27#include <q3hbox.h>
28#include <qscrollview.h> 28#include <q3scrollview.h>
29#include <qptrlist.h> 29#include <q3ptrlist.h>
30 30
31#include <extensionwidget.h> 31#include <extensionwidget.h>
32 32
33class KABCore; 33class KABCore;
34class KSelectAction; 34class KSelectAction;
35 35
36 36
37class ExtensionManager : public QScrollView 37class ExtensionManager : public Q3ScrollView
38{ 38{
39 Q_OBJECT 39 Q_OBJECT
40 40
41 public: 41 public:
42 ExtensionManager( KABCore *core, QWidget *parent, const char *name = 0 ); 42 ExtensionManager( KABCore *core, QWidget *parent, const char *name = 0 );
43 ~ExtensionManager(); 43 ~ExtensionManager();
@@ -77,13 +77,13 @@ class ExtensionManager : public QScrollView
77 void createExtensionWidgets(); 77 void createExtensionWidgets();
78 78
79 KABCore *mCore; 79 KABCore *mCore;
80 QWidget *mWidgetBox; 80 QWidget *mWidgetBox;
81 81
82 ExtensionWidget *mCurrentExtensionWidget; 82 ExtensionWidget *mCurrentExtensionWidget;
83 QPtrList<ExtensionWidget> mExtensionWidgetList; 83 Q3PtrList<ExtensionWidget> mExtensionWidgetList;
84 84
85 KSelectAction *mActionExtensions; 85 KSelectAction *mActionExtensions;
86 86
87}; 87};
88 88
89#endif 89#endif
diff --git a/kaddressbook/extensionwidget.cpp b/kaddressbook/extensionwidget.cpp
index 69f4aa8..7c3b415 100644
--- a/kaddressbook/extensionwidget.cpp
+++ b/kaddressbook/extensionwidget.cpp
@@ -75,10 +75,9 @@ QString ExtensionWidget::identifier() const
75 75
76ConfigureWidget *ExtensionFactory::configureWidget( QWidget*, const char* ) 76ConfigureWidget *ExtensionFactory::configureWidget( QWidget*, const char* )
77{ 77{
78 return 0; 78 return 0;
79} 79}
80 80
81#ifndef KAB_EMBEDDED 81#ifndef KAB_EMBEDDED_
82#include "extensionwidget.moc" 82#include "moc_extensionwidget.cpp"
83#endif //KAB_EMBEDDED 83#endif //KAB_EMBEDDED
84
diff --git a/kaddressbook/extensionwidget.h b/kaddressbook/extensionwidget.h
index fc91f21..9fcfba9 100644
--- a/kaddressbook/extensionwidget.h
+++ b/kaddressbook/extensionwidget.h
@@ -83,15 +83,15 @@ class ExtensionWidget : public QWidget
83 83
84 class ExtensionWidgetPrivate; 84 class ExtensionWidgetPrivate;
85 ExtensionWidgetPrivate *d; 85 ExtensionWidgetPrivate *d;
86}; 86};
87 87
88#ifndef KAB_EMBEDDED 88#ifndef KAB_EMBEDDED
89//MOC_SKIP_BEGIN 89#ifndef Q_MOC_RUN
90class ExtensionFactory : public KLibFactory 90class ExtensionFactory : public KLibFactory
91//MOC_SKIP_END 91#endif
92#else //KAB_EMBEDDED 92#else //KAB_EMBEDDED
93class ExtensionFactory 93class ExtensionFactory
94#endif //KAB_EMBEDDED 94#endif //KAB_EMBEDDED
95{ 95{
96 public: 96 public:
97 virtual ExtensionWidget *extension( KABCore *core, QWidget *parent, 97 virtual ExtensionWidget *extension( KABCore *core, QWidget *parent,
diff --git a/kaddressbook/features/distributionlistwidget.cpp b/kaddressbook/features/distributionlistwidget.cpp
index bfcb121..996177b 100644
--- a/kaddressbook/features/distributionlistwidget.cpp
+++ b/kaddressbook/features/distributionlistwidget.cpp
@@ -18,19 +18,26 @@
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qbuttongroup.h> 24#include <q3buttongroup.h>
25#include <qcombobox.h> 25#include <qcombobox.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qlistview.h> 28#include <q3listview.h>
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30#include <qradiobutton.h> 30#include <qradiobutton.h>
31//Added by qt3to4:
32#include <QDragMoveEvent>
33#include <QDropEvent>
34#include <Q3GridLayout>
35#include <Q3Frame>
36#include <Q3VBoxLayout>
37#include <QDragEnterEvent>
31 38
32#ifndef KAB_EMBEDDED 39#ifndef KAB_EMBEDDED
33#include <kaccelmanager.h> 40#include <kaccelmanager.h>
34#endif //KAB_EMBEDDED 41#endif //KAB_EMBEDDED
35 42
36 43
@@ -74,18 +81,18 @@ extern "C" {
74 { 81 {
75 return ( new DistributionListFactory ); 82 return ( new DistributionListFactory );
76 } 83 }
77} 84}
78#endif //KAB_EMBEDDED 85#endif //KAB_EMBEDDED
79 86
80class ContactItem : public QListViewItem 87class ContactItem : public Q3ListViewItem
81{ 88{
82 public: 89 public:
83 ContactItem( DistributionListView *parent, const KABC::Addressee &addressee, 90 ContactItem( DistributionListView *parent, const KABC::Addressee &addressee,
84 const QString &email = QString::null ) : 91 const QString &email = QString::null ) :
85 QListViewItem( parent ), 92 Q3ListViewItem( parent ),
86 mAddressee( addressee ), 93 mAddressee( addressee ),
87 mEmail( email ) 94 mEmail( email )
88 { 95 {
89 setText( 0, addressee.realName() ); 96 setText( 0, addressee.realName() );
90 if( email.isEmpty() ) { 97 if( email.isEmpty() ) {
91 setText( 1, addressee.preferredEmail() ); 98 setText( 1, addressee.preferredEmail() );
@@ -118,13 +125,13 @@ class ContactItem : public QListViewItem
118}; 125};
119 126
120DistributionListWidget::DistributionListWidget( KABCore *core, QWidget *parent, 127DistributionListWidget::DistributionListWidget( KABCore *core, QWidget *parent,
121 const char *name ) 128 const char *name )
122 : ExtensionWidget( core, parent, name ), mManager( 0 ) 129 : ExtensionWidget( core, parent, name ), mManager( 0 )
123{ 130{
124 QGridLayout *topLayout = new QGridLayout( this, 3, 4, KDialog::marginHint(), 131 Q3GridLayout *topLayout = new Q3GridLayout( this, 3, 4, KDialog::marginHint(),
125 KDialog::spacingHint() ); 132 KDialog::spacingHint() );
126 133
127 if (KGlobal::getOrientation() == KGlobal::Portrait) 134 if (KGlobal::getOrientation() == KGlobal::Portrait)
128 { 135 {
129 mCreateListButton = new QPushButton( i18n( "New List" ), this ); 136 mCreateListButton = new QPushButton( i18n( "New List" ), this );
130 mEditListButton = new QPushButton( i18n( "Ren List" ), this ); 137 mEditListButton = new QPushButton( i18n( "Ren List" ), this );
@@ -163,14 +170,14 @@ DistributionListWidget::DistributionListWidget( KABCore *core, QWidget *parent,
163 mContactView->setAllColumnsShowFocus( true ); 170 mContactView->setAllColumnsShowFocus( true );
164 mContactView->setMinimumHeight( 30 ); 171 mContactView->setMinimumHeight( 30 );
165 172
166 topLayout->addMultiCellWidget( mContactView, 1, 1, 0, 3 ); 173 topLayout->addMultiCellWidget( mContactView, 1, 1, 0, 3 );
167 connect( mContactView, SIGNAL( selectionChanged() ), 174 connect( mContactView, SIGNAL( selectionChanged() ),
168 SLOT( selectionContactViewChanged() ) ); 175 SLOT( selectionContactViewChanged() ) );
169 connect( mContactView, SIGNAL( dropped( QDropEvent*, QListViewItem* ) ), 176 connect( mContactView, SIGNAL( dropped( QDropEvent*, Q3ListViewItem* ) ),
170 SLOT( dropped( QDropEvent*, QListViewItem* ) ) ); 177 SLOT( dropped( QDropEvent*, Q3ListViewItem* ) ) );
171 178
172 mAddContactButton->setEnabled( false ); 179 mAddContactButton->setEnabled( false );
173 topLayout->addWidget( mAddContactButton, 2, 0 ); 180 topLayout->addWidget( mAddContactButton, 2, 0 );
174 connect( mAddContactButton, SIGNAL( clicked() ), SLOT( addContact() ) ); 181 connect( mAddContactButton, SIGNAL( clicked() ), SLOT( addContact() ) );
175 182
176 topLayout->addWidget( mChangeEmailButton, 2, 2 ); 183 topLayout->addWidget( mChangeEmailButton, 2, 2 );
@@ -407,13 +414,13 @@ QString DistributionListWidget::title() const
407 414
408QString DistributionListWidget::identifier() const 415QString DistributionListWidget::identifier() const
409{ 416{
410 return "distribution_list_editor"; 417 return "distribution_list_editor";
411} 418}
412 419
413void DistributionListWidget::dropped( QDropEvent *e, QListViewItem* ) 420void DistributionListWidget::dropped( QDropEvent *e, Q3ListViewItem* )
414{ 421{
415 dropEvent( e ); 422 dropEvent( e );
416} 423}
417 424
418void DistributionListWidget::changed() 425void DistributionListWidget::changed()
419{ 426{
@@ -429,21 +436,21 @@ DistributionListView::DistributionListView( QWidget *parent, const char* name )
429 setAllColumnsShowFocus( true ); 436 setAllColumnsShowFocus( true );
430} 437}
431 438
432void DistributionListView::dragEnterEvent( QDragEnterEvent* e ) 439void DistributionListView::dragEnterEvent( QDragEnterEvent* e )
433{ 440{
434#ifndef KAB_EMBEDDED 441#ifndef KAB_EMBEDDED
435 bool canDecode = QTextDrag::canDecode( e ); 442 bool canDecode = Q3TextDrag::canDecode( e );
436 e->accept( canDecode ); 443 e->accept( canDecode );
437#endif //KAB_EMBEDDED 444#endif //KAB_EMBEDDED
438} 445}
439 446
440void DistributionListView::viewportDragMoveEvent( QDragMoveEvent *e ) 447void DistributionListView::viewportDragMoveEvent( QDragMoveEvent *e )
441{ 448{
442#ifndef KAB_EMBEDDED 449#ifndef KAB_EMBEDDED
443 bool canDecode = QTextDrag::canDecode( e ); 450 bool canDecode = Q3TextDrag::canDecode( e );
444 e->accept( canDecode ); 451 e->accept( canDecode );
445#endif //KAB_EMBEDDED 452#endif //KAB_EMBEDDED
446} 453}
447 454
448void DistributionListView::viewportDropEvent( QDropEvent *e ) 455void DistributionListView::viewportDropEvent( QDropEvent *e )
449{ 456{
@@ -458,16 +465,16 @@ void DistributionListView::dropEvent( QDropEvent *e )
458 465
459EmailSelector::EmailSelector( const QStringList &emails, 466EmailSelector::EmailSelector( const QStringList &emails,
460 const QString &current, QWidget *parent ) 467 const QString &current, QWidget *parent )
461 : KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok, 468 : KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok,
462 parent ) 469 parent )
463{ 470{
464 QFrame *topFrame = plainPage(); 471 Q3Frame *topFrame = plainPage();
465 QBoxLayout *topLayout = new QVBoxLayout( topFrame ); 472 Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame );
466 473
467 mButtonGroup = new QButtonGroup( 1, Horizontal, i18n("Email Addresses"), 474 mButtonGroup = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Email Addresses"),
468 topFrame ); 475 topFrame );
469 topLayout->addWidget( mButtonGroup ); 476 topLayout->addWidget( mButtonGroup );
470 477
471 QStringList::ConstIterator it; 478 QStringList::ConstIterator it;
472 for( it = emails.begin(); it != emails.end(); ++it ) { 479 for( it = emails.begin(); it != emails.end(); ++it ) {
473 QRadioButton *button = new QRadioButton( *it, mButtonGroup ); 480 QRadioButton *button = new QRadioButton( *it, mButtonGroup );
@@ -476,13 +483,13 @@ EmailSelector::EmailSelector( const QStringList &emails,
476 } 483 }
477 } 484 }
478} 485}
479 486
480QString EmailSelector::selected() 487QString EmailSelector::selected()
481{ 488{
482 QButton *button = mButtonGroup->selected(); 489 QAbstractButton *button = mButtonGroup->selected();
483 if ( button ) 490 if ( button )
484 return button->text(); 491 return button->text();
485 492
486 return QString::null; 493 return QString::null;
487} 494}
488 495
@@ -493,9 +500,9 @@ QString EmailSelector::getEmail( const QStringList &emails,
493 dlg.exec(); 500 dlg.exec();
494 501
495 return dlg.selected(); 502 return dlg.selected();
496} 503}
497 504
498 505
499#ifndef KAB_EMBEDDED 506#ifndef KAB_EMBEDDED_
500#include "distributionlistwidget.moc" 507#include "moc_distributionlistwidget.cpp"
501#endif //KAB_EMBEDDED 508#endif //KAB_EMBEDDED
diff --git a/kaddressbook/features/distributionlistwidget.h b/kaddressbook/features/distributionlistwidget.h
index 82bac3d..f619389 100644
--- a/kaddressbook/features/distributionlistwidget.h
+++ b/kaddressbook/features/distributionlistwidget.h
@@ -25,17 +25,22 @@
25#define DISTRIBUTIONLISTWIDGET_H 25#define DISTRIBUTIONLISTWIDGET_H
26 26
27#include <kdialogbase.h> 27#include <kdialogbase.h>
28#include <klistview.h> 28#include <klistview.h>
29 29
30#include "extensionwidget.h" 30#include "extensionwidget.h"
31//Added by qt3to4:
32#include <QDragEnterEvent>
33#include <QDropEvent>
34#include <QLabel>
35#include <QDragMoveEvent>
31 36
32class QButtonGroup; 37class Q3ButtonGroup;
33class QComboBox; 38class QComboBox;
34class QLabel; 39class QLabel;
35class QListView; 40class Q3ListView;
36 41
37class DistributionListView; 42class DistributionListView;
38class KABCore; 43class KABCore;
39 44
40namespace KABC { 45namespace KABC {
41class AddressBook; 46class AddressBook;
@@ -54,13 +59,13 @@ class DistributionListWidget : public ExtensionWidget
54 59
55 QString title() const; 60 QString title() const;
56 QString identifier() const; 61 QString identifier() const;
57 62
58 public slots: 63 public slots:
59 void save(); 64 void save();
60 void dropped( QDropEvent*, QListViewItem* ); 65 void dropped( QDropEvent*, Q3ListViewItem* );
61 66
62 private slots: 67 private slots:
63 void createList(); 68 void createList();
64 void editList(); 69 void editList();
65 void removeList(); 70 void removeList();
66 void addContact(); 71 void addContact();
@@ -117,13 +122,13 @@ class EmailSelector : public KDialogBase
117 QString selected(); 122 QString selected();
118 123
119 static QString getEmail( const QStringList &emails, const QString &current, 124 static QString getEmail( const QStringList &emails, const QString &current,
120 QWidget *parent ); 125 QWidget *parent );
121 126
122 private: 127 private:
123 QButtonGroup *mButtonGroup; 128 Q3ButtonGroup *mButtonGroup;
124}; 129};
125 130
126 131
127#ifdef KAB_EMBEDDED 132#ifdef KAB_EMBEDDED
128class DistributionListFactory : public ExtensionFactory 133class DistributionListFactory : public ExtensionFactory
129{ 134{
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
@@ -20,12 +20,14 @@
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qpushbutton.h> 25#include <qpushbutton.h>
26//Added by qt3to4:
27#include <Q3GridLayout>
26 28
27#ifndef KAB_EMBEDDED 29#ifndef KAB_EMBEDDED
28#include <kaccelmanager.h> 30#include <kaccelmanager.h>
29#endif //KAB_EMBEDDED 31#endif //KAB_EMBEDDED
30 32
31#include <kdebug.h> 33#include <kdebug.h>
@@ -60,17 +62,17 @@ extern "C" {
60 { 62 {
61 return ( new MergeFactory ); 63 return ( new MergeFactory );
62 } 64 }
63} 65}
64#endif //KAB_EMBEDDED 66#endif //KAB_EMBEDDED
65 67
66class ContactItem : public QListViewItem 68class ContactItem : public Q3ListViewItem
67{ 69{
68 public: 70 public:
69 ContactItem( KListView *parent, const KABC::Addressee &addressee ) 71 ContactItem( KListView *parent, const KABC::Addressee &addressee )
70 : QListViewItem( parent ), mAddressee( addressee ) 72 : Q3ListViewItem( parent ), mAddressee( addressee )
71 { 73 {
72 KABC::Field::List fieldList = KABC::Field::defaultFields(); 74 KABC::Field::List fieldList = KABC::Field::defaultFields();
73 KABC::Field::List::ConstIterator it; 75 KABC::Field::List::ConstIterator it;
74 76
75 int i = 0; 77 int i = 0;
76 for ( it = fieldList.begin(); it != fieldList.end(); ++it ) 78 for ( it = fieldList.begin(); it != fieldList.end(); ++it )
@@ -91,13 +93,13 @@ MergeWidget::MergeWidget( KABCore *core, QWidget *parent, const char *name )
91{ 93{
92#ifdef KAB_EMBEDDED 94#ifdef KAB_EMBEDDED
93 if (KGlobal::getOrientation() == KGlobal::Portrait) 95 if (KGlobal::getOrientation() == KGlobal::Portrait)
94 parent->setMaximumSize( KGlobal::getDesktopWidth() , 180); 96 parent->setMaximumSize( KGlobal::getDesktopWidth() , 180);
95#endif //KAB_EMBEDDED 97#endif //KAB_EMBEDDED
96 98
97 QGridLayout *topLayout = new QGridLayout( this, 3, 2, KDialog::marginHint(), 99 Q3GridLayout *topLayout = new Q3GridLayout( this, 3, 2, KDialog::marginHint(),
98 KDialog::spacingHint() ); 100 KDialog::spacingHint() );
99 101
100 mContactView = new KListView( this ); 102 mContactView = new KListView( this );
101 KABC::Field::List fieldList = KABC::Field::defaultFields(); 103 KABC::Field::List fieldList = KABC::Field::defaultFields();
102 KABC::Field::List::ConstIterator it; 104 KABC::Field::List::ConstIterator it;
103 105
@@ -211,13 +213,13 @@ void MergeWidget::mergeAndRemove()
211 213
212 KABC::Addressee::List retval; 214 KABC::Addressee::List retval;
213 retval << mMasterAddressee; 215 retval << mMasterAddressee;
214 emit modified( retval ); 216 emit modified( retval );
215 217
216 mBlockUpdate = true; 218 mBlockUpdate = true;
217 core()->deleteContacts( oldUID ); 219 core()->deleteContacts( QStringList(oldUID) );
218 core()->setContactSelected( mMasterAddressee.uid() ); 220 core()->setContactSelected( mMasterAddressee.uid() );
219 mBlockUpdate = false; 221 mBlockUpdate = false;
220 222
221 updateView(); 223 updateView();
222} 224}
223 225
@@ -366,9 +368,9 @@ void MergeWidget::doMerge( const KABC::Addressee &addr )
366 for ( it = customs.begin(); it != customs.end(); ++it ) 368 for ( it = customs.begin(); it != customs.end(); ++it )
367 if ( !masterCustoms.contains( *it ) ) 369 if ( !masterCustoms.contains( *it ) )
368 newCustoms.append( *it ); 370 newCustoms.append( *it );
369 mMasterAddressee.setCustoms( newCustoms ); 371 mMasterAddressee.setCustoms( newCustoms );
370} 372}
371 373
372#ifndef KAB_EMBEDDED 374#ifndef KAB_EMBEDDED_
373#include "mergewidget.moc" 375#include "moc_mergewidget.cpp"
374#endif //KAB_EMBEDDED 376#endif //KAB_EMBEDDED
diff --git a/kaddressbook/features/mergewidget.h b/kaddressbook/features/mergewidget.h
index 1063c80..bb16282 100644
--- a/kaddressbook/features/mergewidget.h
+++ b/kaddressbook/features/mergewidget.h
@@ -26,13 +26,13 @@
26 26
27#include <kdialogbase.h> 27#include <kdialogbase.h>
28#include <klistview.h> 28#include <klistview.h>
29 29
30#include "extensionwidget.h" 30#include "extensionwidget.h"
31 31
32class QListView; 32class Q3ListView;
33 33
34class KABCore; 34class KABCore;
35 35
36namespace KABC { 36namespace KABC {
37class AddressBook; 37class AddressBook;
38} 38}
diff --git a/kaddressbook/filter.cpp b/kaddressbook/filter.cpp
index 12ab1e3..6462310 100644
--- a/kaddressbook/filter.cpp
+++ b/kaddressbook/filter.cpp
@@ -215,13 +215,13 @@ Filter::List Filter::restore( KConfig *config, QString baseGroup )
215 QStringList cats = KABPrefs::instance()->mCustomCategories; 215 QStringList cats = KABPrefs::instance()->mCustomCategories;
216 for ( QStringList::Iterator it = cats.begin(); it != cats.end(); ++it ) { 216 for ( QStringList::Iterator it = cats.begin(); it != cats.end(); ++it ) {
217 Filter filter; 217 Filter filter;
218 filter.noName = false; 218 filter.noName = false;
219 filter.mName = *it; 219 filter.mName = *it;
220 filter.mEnabled = true; 220 filter.mEnabled = true;
221 filter.mCategoryList = *it; 221 filter.mCategoryList = QStringList(*it);
222 filter.mMatchRule = Matching; 222 filter.mMatchRule = Matching;
223 filter.mInternal = true; 223 filter.mInternal = true;
224 list.append( filter ); 224 list.append( filter );
225 } 225 }
226 } 226 }
227 return list; 227 return list;
diff --git a/kaddressbook/filter.h b/kaddressbook/filter.h
index f4ae123..508436d 100644
--- a/kaddressbook/filter.h
+++ b/kaddressbook/filter.h
@@ -23,13 +23,13 @@
23 23
24#ifndef FILTER_H 24#ifndef FILTER_H
25#define FILTER_H 25#define FILTER_H
26 26
27#include <qstring.h> 27#include <qstring.h>
28#include <qstringlist.h> 28#include <qstringlist.h>
29#include <qvaluelist.h> 29#include <q3valuelist.h>
30 30
31#include <kabc/addressee.h> 31#include <kabc/addressee.h>
32#include <kconfig.h> 32#include <kconfig.h>
33 33
34/** 34/**
35 Filter for AddressBook related objects (Addressees) 35 Filter for AddressBook related objects (Addressees)
@@ -39,13 +39,13 @@
39class Filter 39class Filter
40{ 40{
41 public: 41 public:
42 enum { ShowPublic = 1, ShowPrivate = 2, ShowConfidential = 4 }; 42 enum { ShowPublic = 1, ShowPrivate = 2, ShowConfidential = 4 };
43 void setCriteria(int c) { mCriteria = c ;} 43 void setCriteria(int c) { mCriteria = c ;}
44 int criteria() const { return mCriteria;} 44 int criteria() const { return mCriteria;}
45 typedef QValueList<Filter> List; 45 typedef Q3ValueList<Filter> List;
46 46
47 enum MatchRule { Matching = 0, NotMatching = 1 }; 47 enum MatchRule { Matching = 0, NotMatching = 1 };
48 48
49 Filter(); 49 Filter();
50 Filter( const QString& name ); 50 Filter( const QString& name );
51 ~Filter(); 51 ~Filter();
diff --git a/kaddressbook/filtereditdialog.cpp b/kaddressbook/filtereditdialog.cpp
index ef9b979..40698a7 100644
--- a/kaddressbook/filtereditdialog.cpp
+++ b/kaddressbook/filtereditdialog.cpp
@@ -25,24 +25,26 @@
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <qbuttongroup.h> 31#include <q3buttongroup.h>
32#include <qhbox.h> 32#include <q3hbox.h>
33#include <qlabel.h> 33#include <qlabel.h>
34#include <qlayout.h> 34#include <qlayout.h>
35#include <qpushbutton.h> 35#include <qpushbutton.h>
36#include <qradiobutton.h> 36#include <qradiobutton.h>
37#include <qcheckbox.h> 37#include <qcheckbox.h>
38#include <qregexp.h> 38#include <qregexp.h>
39#include <qstring.h> 39#include <qstring.h>
40#include <qtoolbutton.h> 40#include <qtoolbutton.h>
41#include <qtooltip.h> 41#include <qtooltip.h>
42#include <qwidget.h> 42#include <qwidget.h>
43//Added by qt3to4:
44#include <Q3GridLayout>
43 45
44#include <kapplication.h> 46#include <kapplication.h>
45#include <kbuttonbox.h> 47#include <kbuttonbox.h>
46#include <kdebug.h> 48#include <kdebug.h>
47#include <kiconloader.h> 49#include <kiconloader.h>
48#include <klineedit.h> 50#include <klineedit.h>
@@ -61,29 +63,29 @@ FilterEditDialog::FilterEditDialog( QWidget *parent, const char *name )
61 initGUI(); 63 initGUI();
62 64
63 QStringList cats = KABPrefs::instance()->mCustomCategories; 65 QStringList cats = KABPrefs::instance()->mCustomCategories;
64 66
65 QStringList::Iterator iter; 67 QStringList::Iterator iter;
66 for ( iter = cats.begin(); iter != cats.end(); ++iter ) 68 for ( iter = cats.begin(); iter != cats.end(); ++iter )
67 mCategoriesView->insertItem( new QCheckListItem( mCategoriesView, (*iter), QCheckListItem::CheckBox ) ); 69 mCategoriesView->insertItem( new Q3CheckListItem( mCategoriesView, (*iter), Q3CheckListItem::CheckBox ) );
68 filterNameTextChanged( mNameEdit->text() ); 70 filterNameTextChanged( mNameEdit->text() );
69} 71}
70 72
71FilterEditDialog::~FilterEditDialog() 73FilterEditDialog::~FilterEditDialog()
72{ 74{
73} 75}
74 76
75void FilterEditDialog::setFilter( const Filter &filter ) 77void FilterEditDialog::setFilter( const Filter &filter )
76{ 78{
77 mNameEdit->setText( filter.name() ); 79 mNameEdit->setText( filter.name() );
78 80
79 QStringList categories = filter.categories(); 81 QStringList categories = filter.categories();
80 QListViewItem *item = mCategoriesView->firstChild(); 82 Q3ListViewItem *item = mCategoriesView->firstChild();
81 while ( item != 0 ) { 83 while ( item != 0 ) {
82 if ( categories.contains( item->text( 0 ) ) ) { 84 if ( categories.contains( item->text( 0 ) ) ) {
83 QCheckListItem *checkItem = static_cast<QCheckListItem*>( item ); 85 Q3CheckListItem *checkItem = static_cast<Q3CheckListItem*>( item );
84 checkItem->setOn( true ); 86 checkItem->setOn( true );
85 } 87 }
86 88
87 item = item->nextSibling(); 89 item = item->nextSibling();
88 } 90 }
89 91
@@ -102,15 +104,15 @@ Filter FilterEditDialog::filter()
102{ 104{
103 Filter filter; 105 Filter filter;
104 106
105 filter.setName( mNameEdit->text() ); 107 filter.setName( mNameEdit->text() );
106 108
107 QStringList categories; 109 QStringList categories;
108 QListViewItem *item = mCategoriesView->firstChild(); 110 Q3ListViewItem *item = mCategoriesView->firstChild();
109 while ( item != 0 ) { 111 while ( item != 0 ) {
110 QCheckListItem *checkItem = static_cast<QCheckListItem*>( item ); 112 Q3CheckListItem *checkItem = static_cast<Q3CheckListItem*>( item );
111 if ( checkItem->isOn() ) 113 if ( checkItem->isOn() )
112 categories.append( item->text( 0 ) ); 114 categories.append( item->text( 0 ) );
113 115
114 item = item->nextSibling(); 116 item = item->nextSibling();
115 } 117 }
116 filter.setCategories( categories ); 118 filter.setCategories( categories );
@@ -138,13 +140,13 @@ void FilterEditDialog::initGUI()
138#endif //KAB_EMBEDDED 140#endif //KAB_EMBEDDED
139 141
140 142
141 QWidget *page = plainPage(); 143 QWidget *page = plainPage();
142 QLabel *label; 144 QLabel *label;
143 145
144 QGridLayout *topLayout = new QGridLayout( page, 3, 2, 0, spacingHint() ); 146 Q3GridLayout *topLayout = new Q3GridLayout( page, 3, 2, 0, spacingHint() );
145 147
146 label = new QLabel( i18n( "Name" ), page ); 148 label = new QLabel( i18n( "Name" ), page );
147 mNameEdit = new KLineEdit( page ); 149 mNameEdit = new KLineEdit( page );
148 mNameEdit->setFocus(); 150 mNameEdit->setFocus();
149 topLayout->addWidget( label, 0, 0 ); 151 topLayout->addWidget( label, 0, 0 );
150 topLayout->addWidget( mNameEdit, 0, 1 ); 152 topLayout->addWidget( mNameEdit, 0, 1 );
@@ -152,22 +154,22 @@ void FilterEditDialog::initGUI()
152 SLOT( filterNameTextChanged( const QString&) ) ); 154 SLOT( filterNameTextChanged( const QString&) ) );
153 155
154 mCategoriesView = new KListView( page ); 156 mCategoriesView = new KListView( page );
155 mCategoriesView->addColumn( i18n( "Categories" ) ); 157 mCategoriesView->addColumn( i18n( "Categories" ) );
156 topLayout->addMultiCellWidget( mCategoriesView, 1, 1, 0, 1 ); 158 topLayout->addMultiCellWidget( mCategoriesView, 1, 1, 0, 1 );
157 159
158 mMatchRuleGroup = new QHButtonGroup( i18n( "Category rule" ), page ); 160 mMatchRuleGroup = new Q3HButtonGroup( i18n( "Category rule" ), page );
159 mMatchRuleGroup->setExclusive( true ); 161 mMatchRuleGroup->setExclusive( true );
160 QRadioButton *radio = new QRadioButton( i18n( "Include categories" ), mMatchRuleGroup ); 162 QRadioButton *radio = new QRadioButton( i18n( "Include categories" ), mMatchRuleGroup );
161 //mMatchRuleGroup->insert( radio ); 163 //mMatchRuleGroup->insert( radio );
162 radio = new QRadioButton( i18n( "Exclude categories" ), mMatchRuleGroup ); 164 radio = new QRadioButton( i18n( "Exclude categories" ), mMatchRuleGroup );
163 radio->setChecked( true ); 165 radio->setChecked( true );
164 //mMatchRuleGroup->insert( radio ); 166 //mMatchRuleGroup->insert( radio );
165 topLayout->addMultiCellWidget( mMatchRuleGroup, 2, 2, 0, 1 ); 167 topLayout->addMultiCellWidget( mMatchRuleGroup, 2, 2, 0, 1 );
166 168
167 QHButtonGroup * mMatchPPCGroup = new QHButtonGroup(i18n( "Include contacts, that are:" ), page ); 169 Q3HButtonGroup * mMatchPPCGroup = new Q3HButtonGroup(i18n( "Include contacts, that are:" ), page );
168 mPublic = new QCheckBox( i18n( "public" ), mMatchPPCGroup ); 170 mPublic = new QCheckBox( i18n( "public" ), mMatchPPCGroup );
169 mPrivate = new QCheckBox( i18n( "private" ), mMatchPPCGroup ); 171 mPrivate = new QCheckBox( i18n( "private" ), mMatchPPCGroup );
170 mConfidential = new QCheckBox( i18n( "confidential" ), mMatchPPCGroup ); 172 mConfidential = new QCheckBox( i18n( "confidential" ), mMatchPPCGroup );
171 mPublic->setChecked( true ); 173 mPublic->setChecked( true );
172 mPrivate->setChecked( true ); 174 mPrivate->setChecked( true );
173 mConfidential->setChecked( true ); 175 mConfidential->setChecked( true );
@@ -269,13 +271,13 @@ void FilterDialog::refresh()
269 271
270 Filter::List::Iterator iter; 272 Filter::List::Iterator iter;
271 for ( iter = mFilterList.begin(); iter != mFilterList.end(); ++iter ) 273 for ( iter = mFilterList.begin(); iter != mFilterList.end(); ++iter )
272 mFilterListBox->insertItem( (*iter).name() ); 274 mFilterListBox->insertItem( (*iter).name() );
273} 275}
274 276
275void FilterDialog::selectionChanged( QListBoxItem *item ) 277void FilterDialog::selectionChanged( Q3ListBoxItem *item )
276{ 278{
277 bool state = ( item != 0 ); 279 bool state = ( item != 0 );
278 280
279 mEditButton->setEnabled( state ); 281 mEditButton->setEnabled( state );
280 mRemoveButton->setEnabled( state ); 282 mRemoveButton->setEnabled( state );
281} 283}
@@ -287,29 +289,29 @@ void FilterDialog::initGUI()
287#else //KAB_EMBEDDED 289#else //KAB_EMBEDDED
288 resize( KMIN(KGlobal::getDesktopWidth()-10, 330), KMIN(KGlobal::getDesktopHeight()-50, 200)); 290 resize( KMIN(KGlobal::getDesktopWidth()-10, 330), KMIN(KGlobal::getDesktopHeight()-50, 200));
289#endif //KAB_EMBEDDED 291#endif //KAB_EMBEDDED
290 292
291 QWidget *page = plainPage(); 293 QWidget *page = plainPage();
292 294
293 QGridLayout *topLayout = new QGridLayout( page, 1, 2, 0, spacingHint() ); 295 Q3GridLayout *topLayout = new Q3GridLayout( page, 1, 2, 0, spacingHint() );
294 296
295 mFilterListBox = new KListBox( page ); 297 mFilterListBox = new KListBox( page );
296 topLayout->addWidget( mFilterListBox, 0, 0 ); 298 topLayout->addWidget( mFilterListBox, 0, 0 );
297 connect( mFilterListBox, SIGNAL( selectionChanged( QListBoxItem * ) ), 299 connect( mFilterListBox, SIGNAL( selectionChanged( Q3ListBoxItem * ) ),
298 SLOT( selectionChanged( QListBoxItem * ) ) ); 300 SLOT( selectionChanged( Q3ListBoxItem * ) ) );
299 connect( mFilterListBox, SIGNAL( doubleClicked ( QListBoxItem * ) ), 301 connect( mFilterListBox, SIGNAL( doubleClicked ( Q3ListBoxItem * ) ),
300 SLOT( edit() ) ); 302 SLOT( edit() ) );
301 303
302 KButtonBox *buttonBox = new KButtonBox( page, Vertical ); 304 KButtonBox *buttonBox = new KButtonBox( page, Qt::Vertical );
303 buttonBox->addButton( i18n( "&Add..." ), this, SLOT( add() ) ); 305 buttonBox->addButton( i18n( "&Add..." ), this, SLOT( add() ) );
304 mEditButton = buttonBox->addButton( i18n( "&Edit..." ), this, SLOT( edit() ) ); 306 mEditButton = buttonBox->addButton( i18n( "&Edit..." ), this, SLOT( edit() ) );
305 mEditButton->setEnabled( false ); 307 mEditButton->setEnabled( false );
306 mRemoveButton = buttonBox->addButton( i18n( "&Remove" ), this, SLOT( remove() ) ); 308 mRemoveButton = buttonBox->addButton( i18n( "&Remove" ), this, SLOT( remove() ) );
307 mRemoveButton->setEnabled( false ); 309 mRemoveButton->setEnabled( false );
308 310
309 buttonBox->layout(); 311 buttonBox->layout();
310 topLayout->addWidget( buttonBox, 0, 1 ); 312 topLayout->addWidget( buttonBox, 0, 1 );
311} 313}
312 314
313#ifndef KAB_EMBEDDED 315#ifndef KAB_EMBEDDED_
314#include "filtereditdialog.moc" 316#include "moc_filtereditdialog.cpp"
315#endif //KAB_EMBEDDED 317#endif //KAB_EMBEDDED
diff --git a/kaddressbook/filtereditdialog.h b/kaddressbook/filtereditdialog.h
index 5a8bad1..64d2976 100644
--- a/kaddressbook/filtereditdialog.h
+++ b/kaddressbook/filtereditdialog.h
@@ -28,25 +28,24 @@ Copyright (c) 2004 Ulf Schenk
28$Id$ 28$Id$
29*/ 29*/
30 30
31#ifndef FILTEREDITDIALOG_H 31#ifndef FILTEREDITDIALOG_H
32#define FILTEREDITDIALOG_H 32#define FILTEREDITDIALOG_H
33 33
34class QButtonGroup; 34#include <Q3HButtonGroup>
35class QString; 35class QString;
36class QToolButton; 36class QToolButton;
37class QWidget; 37class QWidget;
38class QListBoxItem; 38class Q3ListBoxItem;
39class QCheckBox; 39class QCheckBox;
40 40
41class KLineEdit; 41class KLineEdit;
42class KListBox; 42class KListBox;
43class KListView; 43class KListView;
44 44
45#include <kdialogbase.h> 45#include <kdialogbase.h>
46#include <qhbuttongroup.h>
47 46
48#include "filter.h" 47#include "filter.h"
49 48
50class FilterDialog : public KDialogBase 49class FilterDialog : public KDialogBase
51{ 50{
52 Q_OBJECT 51 Q_OBJECT
@@ -59,13 +58,13 @@ class FilterDialog : public KDialogBase
59 Filter::List filters() const; 58 Filter::List filters() const;
60 59
61 protected slots: 60 protected slots:
62 void add(); 61 void add();
63 void edit(); 62 void edit();
64 void remove(); 63 void remove();
65 void selectionChanged( QListBoxItem* ); 64 void selectionChanged( Q3ListBoxItem* );
66 65
67 private: 66 private:
68 void initGUI(); 67 void initGUI();
69 void refresh(); 68 void refresh();
70 69
71 Filter::List mFilterList; 70 Filter::List mFilterList;
@@ -95,13 +94,13 @@ class FilterEditDialog : public KDialogBase
95 void initGUI(); 94 void initGUI();
96 95
97 Filter mFilter; 96 Filter mFilter;
98 97
99 KLineEdit *mNameEdit; 98 KLineEdit *mNameEdit;
100 KListView *mCategoriesView; 99 KListView *mCategoriesView;
101 QHButtonGroup *mMatchRuleGroup; 100 Q3HButtonGroup *mMatchRuleGroup;
102 QCheckBox *mPrivate; 101 QCheckBox *mPrivate;
103 QCheckBox *mPublic; 102 QCheckBox *mPublic;
104 QCheckBox *mConfidential; 103 QCheckBox *mConfidential;
105 QPushButton *mEditButton; 104 QPushButton *mEditButton;
106 QPushButton *mRemoveButton; 105 QPushButton *mRemoveButton;
107}; 106};
diff --git a/kaddressbook/geowidget.cpp b/kaddressbook/geowidget.cpp
index 13cd084..caff3b2 100644
--- a/kaddressbook/geowidget.cpp
+++ b/kaddressbook/geowidget.cpp
@@ -24,30 +24,37 @@
24#include <kabc/geo.h> 24#include <kabc/geo.h>
25 25
26#ifndef KAB_EMBEDDED 26#ifndef KAB_EMBEDDED
27#include <kaccelmanager.h> 27#include <kaccelmanager.h>
28#else //KAB_EMBEDDED 28#else //KAB_EMBEDDED
29 29
30#include <qtextstream.h> 30#include <q3textstream.h>
31//Added by qt3to4:
32#include <QPaintEvent>
33#include <Q3GridLayout>
34#include <Q3Frame>
35#include <QMouseEvent>
31#include <kglobal.h> 36#include <kglobal.h>
32#endif //KAB_EMBEDDED 37#endif //KAB_EMBEDDED
33 38
39#include <QDesktopWidget>
40
34#include <knuminput.h> 41#include <knuminput.h>
35#include <kcombobox.h> 42#include <kcombobox.h>
36#include <kdebug.h> 43#include <kdebug.h>
37#include <kiconloader.h> 44#include <kiconloader.h>
38#include <klocale.h> 45#include <klocale.h>
39#include <kstandarddirs.h> 46#include <kstandarddirs.h>
40 47
41#include <qcheckbox.h> 48#include <qcheckbox.h>
42#include <qfile.h> 49#include <qfile.h>
43#include <qapplication.h> 50#include <qapplication.h>
44#include <qgroupbox.h> 51#include <q3groupbox.h>
45#include <qlabel.h> 52#include <qlabel.h>
46#include <qlayout.h> 53#include <qlayout.h>
47#include <qlistbox.h> 54#include <q3listbox.h>
48#include <qpainter.h> 55#include <qpainter.h>
49#include <qpixmap.h> 56#include <qpixmap.h>
50#include <qpushbutton.h> 57#include <qpushbutton.h>
51#include <qregexp.h> 58#include <qregexp.h>
52#include <qstring.h> 59#include <qstring.h>
53#include <stdlib.h> 60#include <stdlib.h>
@@ -56,23 +63,23 @@
56 63
57GeoWidget::GeoWidget( QWidget *parent, const char *name ) 64GeoWidget::GeoWidget( QWidget *parent, const char *name )
58 : QWidget( parent, name ) 65 : QWidget( parent, name )
59{ 66{
60 QLabel *label = 0; 67 QLabel *label = 0;
61 68
62 QGridLayout *topLayout = new QGridLayout( this, 4, 3 ); 69 Q3GridLayout *topLayout = new Q3GridLayout( this, 4, 3 );
63 topLayout->setMargin( KDialog::marginHint() ); 70 topLayout->setMargin( KDialog::marginHint() );
64 topLayout->setSpacing( KDialog::spacingHint() ); 71 topLayout->setSpacing( KDialog::spacingHint() );
65 72
66 label = new QLabel( this ); 73 label = new QLabel( this );
67//US ambiguous call to loadIcon. Add an additional parameter 74//US ambiguous call to loadIcon. Add an additional parameter
68//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "package_network", KIcon::Desktop ) ); 75//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "package_network", KIcon::Desktop ) );
69 label->setPixmap( KGlobal::iconLoader()->loadIcon( "package_network", KIcon::Desktop, 0 ) ); 76 label->setPixmap( KGlobal::iconLoader()->loadIcon( "package_network", KIcon::Desktop, 0 ) );
70 label->setAlignment( Qt::AlignTop ); 77 label->setAlignment( Qt::AlignTop );
71 topLayout->addMultiCellWidget( label, 0, 3, 0, 0 ); 78 topLayout->addMultiCellWidget( label, 0, 3, 0, 0 );
72 label->setAlignment( AlignCenter ); 79 label->setAlignment( Qt::AlignCenter );
73 mGeoIsValid = new QCheckBox( i18n( "Use geo data" ), this ); 80 mGeoIsValid = new QCheckBox( i18n( "Use geo data" ), this );
74 topLayout->addMultiCellWidget( mGeoIsValid, 0, 0, 1, 2 ); 81 topLayout->addMultiCellWidget( mGeoIsValid, 0, 0, 1, 2 );
75 82
76 label = new QLabel( i18n( "Latitude:" ), this ); 83 label = new QLabel( i18n( "Latitude:" ), this );
77 topLayout->addWidget( label, 1, 1 ); 84 topLayout->addWidget( label, 1, 1 );
78 85
@@ -164,22 +171,22 @@ void GeoWidget::editGeoData()
164 171
165GeoDialog::GeoDialog( QWidget *parent, const char *name ) 172GeoDialog::GeoDialog( QWidget *parent, const char *name )
166 : KDialogBase( Plain, i18n( "Geo Data Input" ), Ok | Cancel, Ok, 173 : KDialogBase( Plain, i18n( "Geo Data Input" ), Ok | Cancel, Ok,
167 parent, name, true, true ), 174 parent, name, true, true ),
168 mUpdateSexagesimalInput( true ) 175 mUpdateSexagesimalInput( true )
169{ 176{
170 QFrame *page = plainPage(); 177 Q3Frame *page = plainPage();
171 178
172 QGridLayout *topLayout = new QGridLayout( page, 1, 1, marginHintSmall(), 179 Q3GridLayout *topLayout = new Q3GridLayout( page, 1, 1, marginHintSmall(),
173 spacingHint() ); 180 spacingHint() );
174 //topLayout->setRowStretch( 1, 1 ); 181 //topLayout->setRowStretch( 1, 1 );
175 182
176 mMapWidget = new GeoMapWidget( page ); 183 mMapWidget = new GeoMapWidget( page );
177 mCityCombo = new KComboBox( page ); 184 mCityCombo = new KComboBox( page );
178 QGroupBox *sexagesimalGroup = new QGroupBox( 0, Vertical, i18n( "Sexagesimal" ), page ); 185 Q3GroupBox *sexagesimalGroup = new Q3GroupBox( 0, Qt::Vertical, i18n( "Sexagesimal" ), page );
179 QGridLayout *sexagesimalLayout = new QGridLayout( sexagesimalGroup->layout(), 186 Q3GridLayout *sexagesimalLayout = new Q3GridLayout( sexagesimalGroup->layout(),
180 2, 5, spacingHint() ); 187 2, 5, spacingHint() );
181 QLabel *label; 188 QLabel *label;
182 if ( QApplication::desktop()->width() < 320 ) { 189 if ( QApplication::desktop()->width() < 320 ) {
183 label = new QLabel( i18n( "La." ), sexagesimalGroup ); 190 label = new QLabel( i18n( "La." ), sexagesimalGroup );
184 sexagesimalLayout->setSpacing ( spacingHintSmall() ); 191 sexagesimalLayout->setSpacing ( spacingHintSmall() );
185 sexagesimalLayout->setMargin ( marginHintSmall() ); 192 sexagesimalLayout->setMargin ( marginHintSmall() );
@@ -426,14 +433,14 @@ void GeoDialog::loadCityList()
426 fileName = getenv("QPEDIR"); 433 fileName = getenv("QPEDIR");
427 fileName += "/pics/kdepim/kaddressbook/zone.tab"; 434 fileName += "/pics/kdepim/kaddressbook/zone.tab";
428#endif 435#endif
429 436
430 QFile file( fileName); 437 QFile file( fileName);
431 438
432 if ( file.open( IO_ReadOnly ) ) { 439 if ( file.open( QIODevice::ReadOnly ) ) {
433 QTextStream s( &file ); 440 Q3TextStream s( &file );
434 441
435 QString line, country; 442 QString line, country;
436 QRegExp coord( "[+-]\\d+[+-]\\d+" ); 443 QRegExp coord( "[+-]\\d+[+-]\\d+" );
437 QRegExp name( "[^\\s]+/[^\\s]+" ); 444 QRegExp name( "[^\\s]+/[^\\s]+" );
438 int posc, posn, pos; 445 int posc, posn, pos;
439 446
@@ -549,13 +556,13 @@ int GeoDialog::nearestCity( double x, double y )
549} 556}
550 557
551 558
552GeoMapWidget::GeoMapWidget( QWidget *parent, const char *name ) 559GeoMapWidget::GeoMapWidget( QWidget *parent, const char *name )
553 : QWidget( parent, name ), mLatitude( 0 ), mLongitude( 0 ) 560 : QWidget( parent, name ), mLatitude( 0 ), mLongitude( 0 )
554{ 561{
555 setBackgroundMode( NoBackground ); 562 setBackgroundMode( Qt::NoBackground );
556 563
557 setFixedSize( 240, 120 ); 564 setFixedSize( 240, 120 );
558 565
559 update(); 566 update();
560} 567}
561 568
@@ -621,9 +628,9 @@ void GeoMapWidget::paintEvent( QPaintEvent* )
621 p.drawEllipse( x, y, 4, 4 ); 628 p.drawEllipse( x, y, 4, 4 );
622 629
623 p.end(); 630 p.end();
624 bitBlt( this, 0, 0, &world ); 631 bitBlt( this, 0, 0, &world );
625} 632}
626 633
627#ifndef KAB_EMBEDDED 634#ifndef KAB_EMBEDDED_
628#include "geowidget.moc" 635#include "moc_geowidget.cpp"
629#endif //KAB_EMBEDDED 636#endif //KAB_EMBEDDED
diff --git a/kaddressbook/geowidget.h b/kaddressbook/geowidget.h
index 3d39691..5b64370 100644
--- a/kaddressbook/geowidget.h
+++ b/kaddressbook/geowidget.h
@@ -24,12 +24,16 @@
24#ifndef GEOWIDGET_H 24#ifndef GEOWIDGET_H
25#define GEOWIDGET_H 25#define GEOWIDGET_H
26 26
27#include <qmap.h> 27#include <qmap.h>
28 28
29#include <qwidget.h> 29#include <qwidget.h>
30//Added by qt3to4:
31#include <QLabel>
32#include <QMouseEvent>
33#include <QPaintEvent>
30#include <kdialogbase.h> 34#include <kdialogbase.h>
31 35
32namespace KABC { 36namespace KABC {
33class Geo; 37class Geo;
34} 38}
35 39
diff --git a/kaddressbook/imagewidget.cpp b/kaddressbook/imagewidget.cpp
index eec5e08..6ecf66d 100644
--- a/kaddressbook/imagewidget.cpp
+++ b/kaddressbook/imagewidget.cpp
@@ -34,80 +34,84 @@
34#include <kiconloader.h> 34#include <kiconloader.h>
35#include <klocale.h> 35#include <klocale.h>
36#include <kurlrequester.h> 36#include <kurlrequester.h>
37#include <kurl.h> 37#include <kurl.h>
38 38
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qgroupbox.h> 40#include <q3groupbox.h>
41#include <qlabel.h> 41#include <qlabel.h>
42#include <qlayout.h> 42#include <qlayout.h>
43#include <qpixmap.h> 43#include <qpixmap.h>
44#include <qpushbutton.h> 44#include <qpushbutton.h>
45#include <qapplication.h> 45#include <qapplication.h>
46#include <QDesktopWidget>
47//Added by qt3to4:
48#include <Q3GridLayout>
49#include <Q3Frame>
46 50
47#include "imagewidget.h" 51#include "imagewidget.h"
48 52
49ImageWidget::ImageWidget( QWidget *parent, const char *name ) 53ImageWidget::ImageWidget( QWidget *parent, const char *name )
50 : QWidget( parent, name ) 54 : QWidget( parent, name )
51{ 55{
52 QGridLayout *topLayout = new QGridLayout( this, 2, 1, KDialog::marginHint(), 56 Q3GridLayout *topLayout = new Q3GridLayout( this, 2, 1, KDialog::marginHint(),
53 KDialog::spacingHint() ); 57 KDialog::spacingHint() );
54 58
55 QGroupBox *photoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Photo" ), this ); 59 Q3GroupBox *photoBox = new Q3GroupBox( 0, Qt::Vertical, i18n( "Photo" ), this );
56 QGridLayout *boxLayout = new QGridLayout( photoBox->layout(), 3, 2, 60 Q3GridLayout *boxLayout = new Q3GridLayout( photoBox->layout(), 3, 2,
57 KDialog::spacingHint() ); 61 KDialog::spacingHint() );
58 boxLayout->setRowStretch( 2, 1 ); 62 boxLayout->setRowStretch( 2, 1 );
59 63
60 mPhotoLabel = new QLabel( photoBox ); 64 mPhotoLabel = new QLabel( photoBox );
61 int fac = 9; 65 int fac = 9;
62 if ( QApplication::desktop()->width() > 320 ) 66 if ( QApplication::desktop()->width() > 320 )
63 fac = 6; 67 fac = 6;
64 mPhotoLabel->setFixedSize( 50*9/fac, 70*9/fac ); 68 mPhotoLabel->setFixedSize( 50*9/fac, 70*9/fac );
65 mPhotoLabel->setScaledContents( true ); 69 mPhotoLabel->setScaledContents( true );
66 mPhotoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 70 mPhotoLabel->setFrameStyle( Q3Frame::Panel | Q3Frame::Sunken );
67 boxLayout->addMultiCellWidget( mPhotoLabel, 0, 3, 0, 0 ); 71 boxLayout->addMultiCellWidget( mPhotoLabel, 0, 3, 0, 0 );
68 72
69 mPhotoUrl = new KURLRequester( photoBox ); 73 mPhotoUrl = new KURLRequester( photoBox );
70#ifndef KAB_EMBEDDED 74#ifndef KAB_EMBEDDED
71 mPhotoUrl->setFilter( KImageIO::pattern() ); 75 mPhotoUrl->setFilter( KImageIO::pattern() );
72#else //KAB_EMBEDDED 76#else //KAB_EMBEDDED
73//US qDebug("ImageWidget::ImageWidget KImageIO not defined. Does this harm ???"); 77//US qDebug("ImageWidget::ImageWidget KImageIO not defined. Does this harm ???");
74#endif //KAB_EMBEDDED 78#endif //KAB_EMBEDDED
75 79
76 80
77 boxLayout->addWidget( mPhotoUrl, 0, 1 ); 81 boxLayout->addWidget( mPhotoUrl, 0, 1 );
78 QHBox *hb1 = new QHBox ( photoBox ); 82 Q3HBox *hb1 = new Q3HBox ( photoBox );
79 mUsePhotoUrl = new QCheckBox( i18n( "Store as URL" ), hb1 ); 83 mUsePhotoUrl = new QCheckBox( i18n( "Store as URL" ), hb1 );
80 mUsePhotoUrl->setEnabled( false ); 84 mUsePhotoUrl->setEnabled( false );
81 boxLayout->addWidget( hb1, 1, 1 ); 85 boxLayout->addWidget( hb1, 1, 1 );
82 86
83 QPushButton * pb = new QPushButton( i18n( "Remove" ), hb1 ); 87 QPushButton * pb = new QPushButton( i18n( "Remove" ), hb1 );
84 connect( pb, SIGNAL( clicked() ),this, SLOT( removePhoto() ) ); 88 connect( pb, SIGNAL( clicked() ),this, SLOT( removePhoto() ) );
85 boxLayout->addWidget( new QLabel( photoBox ), 2, 1 ); 89 boxLayout->addWidget( new QLabel( photoBox ), 2, 1 );
86 90
87 topLayout->addWidget( photoBox, 0, 0 ); 91 topLayout->addWidget( photoBox, 0, 0 );
88 92
89 QGroupBox *logoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Logo" ), this ); 93 Q3GroupBox *logoBox = new Q3GroupBox( 0, Qt::Vertical, i18n( "Logo" ), this );
90 boxLayout = new QGridLayout( logoBox->layout(), 3, 2, KDialog::spacingHint() ); 94 boxLayout = new Q3GridLayout( logoBox->layout(), 3, 2, KDialog::spacingHint() );
91 boxLayout->setRowStretch( 2, 1 ); 95 boxLayout->setRowStretch( 2, 1 );
92 96
93 mLogoLabel = new QLabel( logoBox ); 97 mLogoLabel = new QLabel( logoBox );
94 mLogoLabel->setFixedSize( 50*9/fac, 70*9/fac ); 98 mLogoLabel->setFixedSize( 50*9/fac, 70*9/fac );
95 mLogoLabel->setScaledContents( true ); 99 mLogoLabel->setScaledContents( true );
96 mLogoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 100 mLogoLabel->setFrameStyle( Q3Frame::Panel | Q3Frame::Sunken );
97 boxLayout->addMultiCellWidget( mLogoLabel, 0, 3, 0, 0 ); 101 boxLayout->addMultiCellWidget( mLogoLabel, 0, 3, 0, 0 );
98 102
99 mLogoUrl = new KURLRequester( logoBox ); 103 mLogoUrl = new KURLRequester( logoBox );
100#ifndef KAB_EMBEDDED 104#ifndef KAB_EMBEDDED
101 mLogoUrl->setFilter( KImageIO::pattern() ); 105 mLogoUrl->setFilter( KImageIO::pattern() );
102#else //KAB_EMBEDDED 106#else //KAB_EMBEDDED
103//US qDebug("ImageWidget::ImageWidget KImageIO not defined 2"); 107//US qDebug("ImageWidget::ImageWidget KImageIO not defined 2");
104#endif //KAB_EMBEDDED 108#endif //KAB_EMBEDDED
105 boxLayout->addWidget( mLogoUrl, 0, 1 ); 109 boxLayout->addWidget( mLogoUrl, 0, 1 );
106 110
107 QHBox *hb2 = new QHBox ( logoBox ); 111 Q3HBox *hb2 = new Q3HBox ( logoBox );
108 mUseLogoUrl = new QCheckBox( i18n( "Store as URL" ), hb2 ); 112 mUseLogoUrl = new QCheckBox( i18n( "Store as URL" ), hb2 );
109 mUseLogoUrl->setEnabled( false ); 113 mUseLogoUrl->setEnabled( false );
110 boxLayout->addWidget( hb2, 1, 1 ); 114 boxLayout->addWidget( hb2, 1, 1 );
111 115
112 pb = new QPushButton( i18n( "Remove" ), hb2 ); 116 pb = new QPushButton( i18n( "Remove" ), hb2 );
113 connect( pb, SIGNAL( clicked() ),this, SLOT( removeLogo() ) ); 117 connect( pb, SIGNAL( clicked() ),this, SLOT( removeLogo() ) );
@@ -177,13 +181,13 @@ KABC::Picture ImageWidget::photo() const
177{ 181{
178 KABC::Picture photo; 182 KABC::Picture photo;
179 183
180 if ( mUsePhotoUrl->isChecked() ) 184 if ( mUsePhotoUrl->isChecked() )
181 photo.setUrl( mPhotoUrl->url() ); 185 photo.setUrl( mPhotoUrl->url() );
182 else { 186 else {
183 QPixmap *px = mPhotoLabel->pixmap(); 187 const QPixmap *px = mPhotoLabel->pixmap();
184 if ( px ) { 188 if ( px ) {
185#ifndef KAB_EMBEDDED 189#ifndef KAB_EMBEDDED
186 if ( px->height() > px->width() ) 190 if ( px->height() > px->width() )
187 photo.setData( px->convertToImage().scaleHeight( 140 ) ); 191 photo.setData( px->convertToImage().scaleHeight( 140 ) );
188 else 192 else
189 photo.setData( px->convertToImage().scaleWidth( 100 ) ); 193 photo.setData( px->convertToImage().scaleWidth( 100 ) );
@@ -229,13 +233,13 @@ KABC::Picture ImageWidget::logo() const
229{ 233{
230 KABC::Picture logo; 234 KABC::Picture logo;
231 235
232 if ( mUseLogoUrl->isChecked() ) 236 if ( mUseLogoUrl->isChecked() )
233 logo.setUrl( mLogoUrl->url() ); 237 logo.setUrl( mLogoUrl->url() );
234 else { 238 else {
235 QPixmap *px = mLogoLabel->pixmap(); 239 const QPixmap *px = mLogoLabel->pixmap();
236 if ( px ) { 240 if ( px ) {
237#ifndef KAB_EMBEDDED 241#ifndef KAB_EMBEDDED
238 if ( px->height() > px->width() ) 242 if ( px->height() > px->width() )
239 logo.setData( px->convertToImage().scaleHeight( 140 ) ); 243 logo.setData( px->convertToImage().scaleHeight( 140 ) );
240 else 244 else
241 logo.setData( px->convertToImage().scaleWidth( 100 ) ); 245 logo.setData( px->convertToImage().scaleWidth( 100 ) );
@@ -289,9 +293,9 @@ QPixmap ImageWidget::loadPixmap( const QString &url )
289 if ( url.isEmpty() ) 293 if ( url.isEmpty() )
290 return pixmap; 294 return pixmap;
291 pixmap.load( url ); 295 pixmap.load( url );
292 return pixmap; 296 return pixmap;
293} 297}
294 298
295#ifndef KAB_EMBEDDED 299#ifndef KAB_EMBEDDED_
296#include "imagewidget.moc" 300#include "moc_imagewidget.cpp"
297#endif //KAB_EMBEDDED 301#endif //KAB_EMBEDDED
diff --git a/kaddressbook/imagewidget.h b/kaddressbook/imagewidget.h
index bbfba58..9320a6b 100644
--- a/kaddressbook/imagewidget.h
+++ b/kaddressbook/imagewidget.h
@@ -22,12 +22,15 @@
22*/ 22*/
23 23
24#ifndef IMAGEWIDGET_H 24#ifndef IMAGEWIDGET_H
25#define IMAGEWIDGET_H 25#define IMAGEWIDGET_H
26 26
27#include <qwidget.h> 27#include <qwidget.h>
28//Added by qt3to4:
29#include <QPixmap>
30#include <QLabel>
28 31
29#include <kabc/picture.h> 32#include <kabc/picture.h>
30#include <kdialogbase.h> 33#include <kdialogbase.h>
31 34
32class KURL; 35class KURL;
33class KURLRequester; 36class KURLRequester;
diff --git a/kaddressbook/incsearchwidget.cpp b/kaddressbook/incsearchwidget.cpp
index 5f8b83d..a54d1cd 100644
--- a/kaddressbook/incsearchwidget.cpp
+++ b/kaddressbook/incsearchwidget.cpp
@@ -22,35 +22,39 @@
22*/ 22*/
23 23
24#include <qlabel.h> 24#include <qlabel.h>
25#include <qlayout.h> 25#include <qlayout.h>
26#include <qtooltip.h> 26#include <qtooltip.h>
27#include <qapplication.h> 27#include <qapplication.h>
28#include <QDesktopWidget>
28#include <qcombobox.h> 29#include <qcombobox.h>
30//Added by qt3to4:
31#include <Q3HBoxLayout>
29 32
30#include <kdialog.h> 33#include <kdialog.h>
31#include <klineedit.h> 34#include <klineedit.h>
32#include <klocale.h> 35#include <klocale.h>
33#include <kglobal.h> 36#include <kglobal.h>
34#include <kglobal.h> 37#include <kglobal.h>
35#include "kabprefs.h" 38#include "kabprefs.h"
36 39
37#include "incsearchwidget.h" 40#include "incsearchwidget.h"
38 41
39IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name ) 42IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name )
40 : QWidget( parent, name )
41{ 43{
44 setObjectName(name);
45 setParent(parent);
42#ifndef KAB_EMBEDDED 46#ifndef KAB_EMBEDDED
43//US setCaption( i18n( "Incremental Search" ) ); 47//US setCaption( i18n( "Incremental Search" ) );
44#endif //KAB_EMBEDDED 48#endif //KAB_EMBEDDED
45 49
46 QHBoxLayout *layout = new QHBoxLayout( this, 2, KDialog::spacingHint() ); 50 Q3HBoxLayout *layout = new Q3HBoxLayout( this, 2, KDialog::spacingHint() );
47 51
48#ifdef DESKTOP_VERSION 52#ifdef DESKTOP_VERSION
49 QLabel *label = new QLabel( i18n( "Search:" ), this ); 53 QLabel *label = new QLabel( i18n( "Search:" ), this );
50 label->setAlignment( QLabel::AlignVCenter | QLabel::AlignRight ); 54 label->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
51 layout->addWidget( label ); 55 layout->addWidget( label );
52#endif //KAB_EMBEDDED 56#endif //KAB_EMBEDDED
53 57
54 mSearchText = new KLineEdit( this ); 58 mSearchText = new KLineEdit( this );
55 layout->addWidget( mSearchText ); 59 layout->addWidget( mSearchText );
56// #ifdef KAB_EMBEDDED 60// #ifdef KAB_EMBEDDED
@@ -173,9 +177,9 @@ void IncSearchWidget::setCurrentItem( int pos )
173 177
174int IncSearchWidget::currentItem() const 178int IncSearchWidget::currentItem() const
175{ 179{
176 180
177 return mFieldCombo->currentItem(); 181 return mFieldCombo->currentItem();
178} 182}
179#ifndef KAB_EMBEDDED 183#ifndef KAB_EMBEDDED_
180#include "incsearchwidget.moc" 184#include "moc_incsearchwidget.cpp"
181#endif //KAB_EMBEDDED 185#endif //KAB_EMBEDDED
diff --git a/kaddressbook/jumpbuttonbar.cpp b/kaddressbook/jumpbuttonbar.cpp
index aebf8a6..740b7db 100644
--- a/kaddressbook/jumpbuttonbar.cpp
+++ b/kaddressbook/jumpbuttonbar.cpp
@@ -22,14 +22,17 @@
22*/ 22*/
23 23
24#include <qevent.h> 24#include <qevent.h>
25#include <qlayout.h> 25#include <qlayout.h>
26#include <qpushbutton.h> 26#include <qpushbutton.h>
27#include <qstring.h> 27#include <qstring.h>
28#include <qtl.h> 28#include <q3tl.h>
29#include <qapplication.h> 29#include <qapplication.h>
30#include <QDesktopWidget>
31//Added by qt3to4:
32#include <Q3GridLayout>
30 33
31#include <kabc/addressbook.h> 34#include <kabc/addressbook.h>
32#include <kabc/field.h> 35#include <kabc/field.h>
33#include <kdebug.h> 36#include <kdebug.h>
34#include <klocale.h> 37#include <klocale.h>
35 38
@@ -70,15 +73,15 @@ QString JumpButton::character() const
70 73
71JumpButtonBar::JumpButtonBar( KABCore *core, QWidget *parent, const char *name ) 74JumpButtonBar::JumpButtonBar( KABCore *core, QWidget *parent, const char *name )
72 : QWidget( parent, name ), mCore( core ) 75 : QWidget( parent, name ), mCore( core )
73{ 76{
74 if ( QApplication::desktop()->width() < 480 ) 77 if ( QApplication::desktop()->width() < 480 )
75 78
76 mButtonLayout = new QGridLayout( this, 1, 18 ); 79 mButtonLayout = new Q3GridLayout( this, 1, 18 );
77 else 80 else
78 mButtonLayout = new QGridLayout( this, 1, 20 ); 81 mButtonLayout = new Q3GridLayout( this, 1, 20 );
79 mButtonLayout->setAlignment( Qt::AlignTop ); 82 mButtonLayout->setAlignment( Qt::AlignTop );
80 83
81 recreateButtons(); 84 recreateButtons();
82} 85}
83 86
84JumpButtonBar::~JumpButtonBar() 87JumpButtonBar::~JumpButtonBar()
@@ -249,9 +252,9 @@ void JumpButtonBar::sortListLocaleAware( QStringList &list )
249 } 252 }
250 ++beginIt; 253 ++beginIt;
251 --walkBackIt; 254 --walkBackIt;
252 } 255 }
253} 256}
254 257
255#ifndef KAB_EMBEDDED 258#ifndef KAB_EMBEDDED_
256#include "jumpbuttonbar.moc" 259#include "moc_jumpbuttonbar.cpp"
257#endif //KAB_EMBEDDED 260#endif //KAB_EMBEDDED
diff --git a/kaddressbook/jumpbuttonbar.h b/kaddressbook/jumpbuttonbar.h
index d534f2b..0589812 100644
--- a/kaddressbook/jumpbuttonbar.h
+++ b/kaddressbook/jumpbuttonbar.h
@@ -23,17 +23,20 @@
23 23
24#ifndef JUMPBUTTONBAR_H 24#ifndef JUMPBUTTONBAR_H
25#define JUMPBUTTONBAR_H 25#define JUMPBUTTONBAR_H
26 26
27#include <qsizepolicy.h> 27#include <qsizepolicy.h>
28#include <qwidget.h> 28#include <qwidget.h>
29#include <qptrlist.h> 29#include <q3ptrlist.h>
30#include <qstringlist.h> 30#include <qstringlist.h>
31//Added by qt3to4:
32#include <QResizeEvent>
33#include <Q3GridLayout>
31 34
32class QChar; 35class QChar;
33class QGridLayout; 36class Q3GridLayout;
34class QResizeEvent; 37class QResizeEvent;
35class QPushButton; 38class QPushButton;
36class JumpButton; 39class JumpButton;
37 40
38namespace KABC { 41namespace KABC {
39class Field; 42class Field;
@@ -73,12 +76,12 @@ class JumpButtonBar : public QWidget
73 76
74 private: 77 private:
75 void sortListLocaleAware( QStringList &list ); 78 void sortListLocaleAware( QStringList &list );
76 79
77 KABCore *mCore; 80 KABCore *mCore;
78 81
79 QGridLayout *mButtonLayout; 82 Q3GridLayout *mButtonLayout;
80 QStringList mCharacters; 83 QStringList mCharacters;
81 QPtrList<JumpButton> mButtons; 84 Q3PtrList<JumpButton> mButtons;
82}; 85};
83 86
84#endif 87#endif
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index ab2824c..03b44d1 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -36,24 +36,34 @@ $Id$
36#include <qtimer.h> 36#include <qtimer.h>
37#include <qlabel.h> 37#include <qlabel.h>
38#include <qregexp.h> 38#include <qregexp.h>
39#include <qlineedit.h> 39#include <qlineedit.h>
40#include <qcheckbox.h> 40#include <qcheckbox.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qprogressbar.h> 42#include <q3progressbar.h>
43#include <QDesktopWidget>
44//Added by qt3to4:
45#include <QResizeEvent>
46#include <QPixmap>
47#include <Q3ValueList>
48#include <Q3HBoxLayout>
49#include <Q3VBoxLayout>
50#include <Q3CString>
51#include <Q3PopupMenu>
52#include <Q3PtrList>
43#include <libkdepim/phoneaccess.h> 53#include <libkdepim/phoneaccess.h>
44 54
45#ifndef KAB_EMBEDDED 55#ifndef KAB_EMBEDDED
46#include <qclipboard.h> 56#include <qclipboard.h>
47#include <qdir.h> 57#include <qdir.h>
48#include <qfile.h> 58#include <qfile.h>
49#include <qapplicaton.h> 59#include <qapplicaton.h>
50#include <qprogressbar.h> 60#include <q3progressbar.h>
51#include <qlayout.h> 61#include <qlayout.h>
52#include <qregexp.h> 62#include <qregexp.h>
53#include <qvbox.h> 63#include <q3vbox.h>
54#include <kabc/addresseelist.h> 64#include <kabc/addresseelist.h>
55#include <kabc/errorhandler.h> 65#include <kabc/errorhandler.h>
56#include <kabc/resource.h> 66#include <kabc/resource.h>
57#include <kabc/vcardconverter.h> 67#include <kabc/vcardconverter.h>
58#include <kapplication.h> 68#include <kapplication.h>
59#include <kactionclasses.h> 69#include <kactionclasses.h>
@@ -85,13 +95,13 @@ $Id$
85#include "kaddressbookmain.h" 95#include "kaddressbookmain.h"
86#include "kactioncollection.h" 96#include "kactioncollection.h"
87#include "addresseedialog.h" 97#include "addresseedialog.h"
88//US 98//US
89#include <addresseeview.h> 99#include <addresseeview.h>
90 100
91#include <qapp.h> 101#include <qapplication.h>
92#include <qmenubar.h> 102#include <qmenubar.h>
93//#include <qtoolbar.h> 103//#include <qtoolbar.h>
94#include <qmessagebox.h> 104#include <qmessagebox.h>
95#include <kdebug.h> 105#include <kdebug.h>
96#include <kiconloader.h> // needed for SmallIcon 106#include <kiconloader.h> // needed for SmallIcon
97#include <kresources/kcmkresources.h> 107#include <kresources/kcmkresources.h>
@@ -126,18 +136,18 @@ $Id$
126#include <resource.h> 136#include <resource.h>
127 137
128//US#include <qsplitter.h> 138//US#include <qsplitter.h>
129#include <qmap.h> 139#include <qmap.h>
130#include <qdir.h> 140#include <qdir.h>
131#include <qfile.h> 141#include <qfile.h>
132#include <qvbox.h> 142#include <q3vbox.h>
133#include <qlayout.h> 143#include <qlayout.h>
134#include <qclipboard.h> 144#include <qclipboard.h>
135#include <qtextstream.h> 145#include <q3textstream.h>
136#include <qradiobutton.h> 146#include <qradiobutton.h>
137#include <qbuttongroup.h> 147#include <q3buttongroup.h>
138 148
139#include <libkdepim/categoryselectdialog.h> 149#include <libkdepim/categoryselectdialog.h>
140#include <libkdepim/categoryeditdialog.h> 150#include <libkdepim/categoryeditdialog.h>
141#include <kabc/vcardconverter.h> 151#include <kabc/vcardconverter.h>
142 152
143 153
@@ -172,18 +182,18 @@ class KABCatPrefs : public QDialog
172{ 182{
173 public: 183 public:
174 KABCatPrefs( QWidget *parent=0, const char *name=0 ) : 184 KABCatPrefs( QWidget *parent=0, const char *name=0 ) :
175 QDialog( parent, name, true ) 185 QDialog( parent, name, true )
176 { 186 {
177 setCaption( i18n("Manage new Categories") ); 187 setCaption( i18n("Manage new Categories") );
178 QVBoxLayout* lay = new QVBoxLayout( this ); 188 Q3VBoxLayout* lay = new Q3VBoxLayout( this );
179 lay->setSpacing( 3 ); 189 lay->setSpacing( 3 );
180 lay->setMargin( 3 ); 190 lay->setMargin( 3 );
181 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); 191 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n "), this );
182 lay->addWidget( lab ); 192 lay->addWidget( lab );
183 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); 193 Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("New categories not in list:"), this );
184 lay->addWidget( format ); 194 lay->addWidget( format );
185 format->setExclusive ( true ) ; 195 format->setExclusive ( true ) ;
186 addCatBut = new QRadioButton(i18n("Add to category list"), format ); 196 addCatBut = new QRadioButton(i18n("Add to category list"), format );
187 new QRadioButton(i18n("Remove from addressees"), format ); 197 new QRadioButton(i18n("Remove from addressees"), format );
188 addCatBut->setChecked( true ); 198 addCatBut->setChecked( true );
189 QPushButton * ok = new QPushButton( i18n("OK"), this ); 199 QPushButton * ok = new QPushButton( i18n("OK"), this );
@@ -204,18 +214,18 @@ class KABFormatPrefs : public QDialog
204{ 214{
205 public: 215 public:
206 KABFormatPrefs( QWidget *parent=0, const char *name=0 ) : 216 KABFormatPrefs( QWidget *parent=0, const char *name=0 ) :
207 QDialog( parent, name, true ) 217 QDialog( parent, name, true )
208 { 218 {
209 setCaption( i18n("Set formatted name") ); 219 setCaption( i18n("Set formatted name") );
210 QVBoxLayout* lay = new QVBoxLayout( this ); 220 Q3VBoxLayout* lay = new Q3VBoxLayout( this );
211 lay->setSpacing( 3 ); 221 lay->setSpacing( 3 );
212 lay->setMargin( 3 ); 222 lay->setMargin( 3 );
213 QLabel * lab = new QLabel( i18n("You can set the formatted name\nfor a list of contacts in one go."), this ); 223 QLabel * lab = new QLabel( i18n("You can set the formatted name\nfor a list of contacts in one go."), this );
214 lay->addWidget( lab ); 224 lay->addWidget( lab );
215 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Set formatted name to:"), this ); 225 Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Set formatted name to:"), this );
216 lay->addWidget( format ); 226 lay->addWidget( format );
217 format->setExclusive ( true ) ; 227 format->setExclusive ( true ) ;
218 simple = new QRadioButton(i18n("Simple: James Bond"), format ); 228 simple = new QRadioButton(i18n("Simple: James Bond"), format );
219 full = new QRadioButton(i18n("Full: Mr. James 007 Bond I"), format ); 229 full = new QRadioButton(i18n("Full: Mr. James 007 Bond I"), format );
220 reverse = new QRadioButton(i18n("Reverse: Bond, James"), format ); 230 reverse = new QRadioButton(i18n("Reverse: Bond, James"), format );
221 company = new QRadioButton(i18n("Organization: MI6"), format ); 231 company = new QRadioButton(i18n("Organization: MI6"), format );
@@ -242,35 +252,35 @@ class KAex2phonePrefs : public QDialog
242{ 252{
243 public: 253 public:
244 KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) : 254 KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) :
245 QDialog( parent, name, true ) 255 QDialog( parent, name, true )
246 { 256 {
247 setCaption( i18n("Export to phone options") ); 257 setCaption( i18n("Export to phone options") );
248 QVBoxLayout* lay = new QVBoxLayout( this ); 258 Q3VBoxLayout* lay = new Q3VBoxLayout( this );
249 lay->setSpacing( 3 ); 259 lay->setSpacing( 3 );
250 lay->setMargin( 3 ); 260 lay->setMargin( 3 );
251 QLabel *lab; 261 QLabel *lab;
252 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); 262 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) );
253 lab->setAlignment (AlignHCenter ); 263 lab->setAlignment (Qt::AlignHCenter );
254 QHBox* temphb; 264 Q3HBox* temphb;
255 temphb = new QHBox( this ); 265 temphb = new Q3HBox( this );
256 new QLabel( i18n("I/O device: "), temphb ); 266 new QLabel( i18n("I/O device: "), temphb );
257 mPhoneDevice = new QLineEdit( temphb); 267 mPhoneDevice = new QLineEdit( temphb);
258 lay->addWidget( temphb ); 268 lay->addWidget( temphb );
259 temphb = new QHBox( this ); 269 temphb = new Q3HBox( this );
260 new QLabel( i18n("Connection: "), temphb ); 270 new QLabel( i18n("Connection: "), temphb );
261 mPhoneConnection = new QLineEdit( temphb); 271 mPhoneConnection = new QLineEdit( temphb);
262 lay->addWidget( temphb ); 272 lay->addWidget( temphb );
263 temphb = new QHBox( this ); 273 temphb = new Q3HBox( this );
264 new QLabel( i18n("Model(opt.): "), temphb ); 274 new QLabel( i18n("Model(opt.): "), temphb );
265 mPhoneModel = new QLineEdit( temphb); 275 mPhoneModel = new QLineEdit( temphb);
266 lay->addWidget( temphb ); 276 lay->addWidget( temphb );
267 // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this ); 277 // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this );
268 // lay->addWidget( mWriteToSim ); 278 // lay->addWidget( mWriteToSim );
269 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) ); 279 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) );
270 lab->setAlignment (AlignHCenter); 280 lab->setAlignment (Qt::AlignHCenter);
271 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); 281 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
272 lay->addWidget( ok ); 282 lay->addWidget( ok );
273 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 283 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
274 lay->addWidget( cancel ); 284 lay->addWidget( cancel );
275 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 285 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
276 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 286 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
@@ -404,13 +414,13 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
404 //toggleBeamReceive( ); 414 //toggleBeamReceive( );
405 mMainWindow->toolBar()->show(); 415 mMainWindow->toolBar()->show();
406 // we have a toolbar repainting error on the Zaurus when starting KA/Pi 416 // we have a toolbar repainting error on the Zaurus when starting KA/Pi
407 //QTimer::singleShot( 10, this , SLOT ( updateToolBar())); 417 //QTimer::singleShot( 10, this , SLOT ( updateToolBar()));
408 QTimer::singleShot( 100, this, SLOT ( loadDataAfterStart() )); 418 QTimer::singleShot( 100, this, SLOT ( loadDataAfterStart() ));
409} 419}
410void KABCore::receiveStart( const QCString& cmsg, const QByteArray& data ) 420void KABCore::receiveStart( const Q3CString& cmsg, const QByteArray& data )
411{ 421{
412 //qDebug("KO: QCOP start message received: %s ", cmsg.data() ); 422 //qDebug("KO: QCOP start message received: %s ", cmsg.data() );
413 mCStringMess = cmsg; 423 mCStringMess = cmsg;
414 mByteData = data; 424 mByteData = data;
415} 425}
416 426
@@ -418,15 +428,15 @@ void KABCore::loadDataAfterStart()
418{ 428{
419 //qDebug("KABCore::loadDataAfterStart() "); 429 //qDebug("KABCore::loadDataAfterStart() ");
420 ((StdAddressBook*)mAddressBook)->init( true ); 430 ((StdAddressBook*)mAddressBook)->init( true );
421 mViewManager->refreshView(); 431 mViewManager->refreshView();
422 432
423#ifndef DESKTOP_VERSION 433#ifndef DESKTOP_VERSION
424 disconnect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT (receiveStart ( const QCString &, const QByteArray & ))); 434 disconnect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), this, SLOT (receiveStart ( const Q3CString &, const QByteArray & )));
425 435
426 QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 436 QObject::connect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const Q3CString &, const QByteArray & )));
427 if ( !mCStringMess.isEmpty() ) 437 if ( !mCStringMess.isEmpty() )
428 ExternalAppHandler::instance()->appMessage( mCStringMess, mByteData ); 438 ExternalAppHandler::instance()->appMessage( mCStringMess, mByteData );
429#endif 439#endif
430 // QTimer::singleShot( 10, this , SLOT ( updateToolBar())); 440 // QTimer::singleShot( 10, this , SLOT ( updateToolBar()));
431 setCaptionBack(); 441 setCaptionBack();
432} 442}
@@ -450,17 +460,17 @@ KABCore::~KABCore()
450 delete syncManager; 460 delete syncManager;
451#ifndef DESKTOP_VERSION 461#ifndef DESKTOP_VERSION
452 if ( infrared ) 462 if ( infrared )
453 delete infrared; 463 delete infrared;
454#endif 464#endif
455} 465}
456void KABCore::receive( const QCString& cmsg, const QByteArray& data ) 466void KABCore::receive( const Q3CString& cmsg, const QByteArray& data )
457{ 467{
458 //qDebug("KA: QCOP message received: %s ", cmsg.data() ); 468 //qDebug("KA: QCOP message received: %s ", cmsg.data() );
459 if ( cmsg == "setDocument(QString)" ) { 469 if ( cmsg == "setDocument(QString)" ) {
460 QDataStream stream( data, IO_ReadOnly ); 470 QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly );
461 QString fileName; 471 QString fileName;
462 stream >> fileName; 472 stream >> fileName;
463 recieve( fileName ); 473 recieve( fileName );
464 return; 474 return;
465 } 475 }
466} 476}
@@ -477,13 +487,13 @@ void KABCore::toggleBeamReceive( )
477 return; 487 return;
478 } 488 }
479 qDebug("KA: AB enable BeamReceive "); 489 qDebug("KA: AB enable BeamReceive ");
480 mActionBR->setChecked(true); 490 mActionBR->setChecked(true);
481 491
482 infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; 492 infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ;
483 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); 493 QObject::connect( infrared, SIGNAL (received ( const Q3CString &, const QByteArray & )),this, SLOT(receive( const Q3CString&, const QByteArray& )));
484#endif 494#endif
485} 495}
486 496
487 497
488void KABCore::disableBR(bool b) 498void KABCore::disableBR(bool b)
489{ 499{
@@ -557,13 +567,13 @@ void KABCore::restoreSettings()
557 wid = 400; 567 wid = 400;
558#else 568#else
559 int wid = QApplication::desktop()->width(); 569 int wid = QApplication::desktop()->width();
560 if ( wid < 640 ) 570 if ( wid < 640 )
561 wid = QApplication::desktop()->height(); 571 wid = QApplication::desktop()->height();
562#endif 572#endif
563 QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; 573 Q3ValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter;
564 if ( true /*splitterSize.count() == 0*/ ) { 574 if ( true /*splitterSize.count() == 0*/ ) {
565 splitterSize.append( wid / 2 ); 575 splitterSize.append( wid / 2 );
566 splitterSize.append( wid / 2 ); 576 splitterSize.append( wid / 2 );
567 } 577 }
568 mMiniSplitter->setSizes( splitterSize ); 578 mMiniSplitter->setSizes( splitterSize );
569 if ( mExtensionBarSplitter ) { 579 if ( mExtensionBarSplitter ) {
@@ -647,16 +657,16 @@ QStringList KABCore::selectedUIDs() const
647{ 657{
648 return mViewManager->selectedUids(); 658 return mViewManager->selectedUids();
649} 659}
650 660
651KABC::Resource *KABCore::requestResource( QWidget *parent ) 661KABC::Resource *KABCore::requestResource( QWidget *parent )
652{ 662{
653 QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); 663 Q3PtrList<KABC::Resource> kabcResources = addressBook()->resources();
654 664
655 QPtrList<KRES::Resource> kresResources; 665 Q3PtrList<KRES::Resource> kresResources;
656 QPtrListIterator<KABC::Resource> resIt( kabcResources ); 666 Q3PtrListIterator<KABC::Resource> resIt( kabcResources );
657 KABC::Resource *resource; 667 KABC::Resource *resource;
658 while ( ( resource = resIt.current() ) != 0 ) { 668 while ( ( resource = resIt.current() ) != 0 ) {
659 ++resIt; 669 ++resIt;
660 if ( !resource->readOnly() ) { 670 if ( !resource->readOnly() ) {
661 KRES::Resource *res = static_cast<KRES::Resource*>( resource ); 671 KRES::Resource *res = static_cast<KRES::Resource*>( resource );
662 if ( res ) 672 if ( res )
@@ -792,20 +802,20 @@ void KABCore::mailVCard( const QStringList& uids )
792 QString name = a.givenName() + "_" + a.familyName() + ".vcf"; 802 QString name = a.givenName() + "_" + a.familyName() + ".vcf";
793 803
794 QString fileName = dirName + "/" + name; 804 QString fileName = dirName + "/" + name;
795 805
796 QFile outFile(fileName); 806 QFile outFile(fileName);
797 807
798 if ( outFile.open(IO_WriteOnly) ) { // file opened successfully 808 if ( outFile.open(QIODevice::WriteOnly) ) { // file opened successfully
799 KABC::VCardConverter converter; 809 KABC::VCardConverter converter;
800 QString vcard; 810 QString vcard;
801 811
802 converter.addresseeToVCard( a, vcard ); 812 converter.addresseeToVCard( a, vcard );
803 813
804 QTextStream t( &outFile ); // use a text stream 814 Q3TextStream t( &outFile ); // use a text stream
805 t.setEncoding( QTextStream::UnicodeUTF8 ); 815 t.setEncoding( Q3TextStream::UnicodeUTF8 );
806 t << vcard; 816 t << vcard;
807 817
808 outFile.close(); 818 outFile.close();
809 819
810 urls.append( fileName ); 820 urls.append( fileName );
811 } 821 }
@@ -1013,17 +1023,17 @@ void KABCore::beamVCard(const QStringList& uids)
1013 start = sep; 1023 start = sep;
1014 } 1024 }
1015 datastream += vcard.mid( start,vcard.length() ); 1025 datastream += vcard.mid( start,vcard.length() );
1016 } 1026 }
1017#ifndef DESKTOP_VERSION 1027#ifndef DESKTOP_VERSION
1018 QFile outFile(fileName); 1028 QFile outFile(fileName);
1019 if ( outFile.open(IO_WriteOnly) ) { 1029 if ( outFile.open(QIODevice::WriteOnly) ) {
1020 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); 1030 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" );
1021 QTextStream t( &outFile ); // use a text stream 1031 Q3TextStream t( &outFile ); // use a text stream
1022 //t.setEncoding( QTextStream::UnicodeUTF8 ); 1032 //t.setEncoding( QTextStream::UnicodeUTF8 );
1023 t.setEncoding( QTextStream::Latin1 ); 1033 t.setEncoding( Q3TextStream::Latin1 );
1024 t <<datastream.latin1(); 1034 t <<datastream.latin1();
1025 outFile.close(); 1035 outFile.close();
1026 Ir *ir = new Ir( this ); 1036 Ir *ir = new Ir( this );
1027 connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); 1037 connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) );
1028 ir->send( fileName, description, "text/x-vCard" ); 1038 ir->send( fileName, description, "text/x-vCard" );
1029 } else { 1039 } else {
@@ -1294,16 +1304,16 @@ void KABCore::addrModified( const KABC::Addressee &addr ,bool updateDetails )
1294} 1304}
1295 1305
1296void KABCore::newContact() 1306void KABCore::newContact()
1297{ 1307{
1298 1308
1299 1309
1300 QPtrList<KABC::Resource> kabcResources = mAddressBook->resources(); 1310 Q3PtrList<KABC::Resource> kabcResources = mAddressBook->resources();
1301 1311
1302 QPtrList<KRES::Resource> kresResources; 1312 Q3PtrList<KRES::Resource> kresResources;
1303 QPtrListIterator<KABC::Resource> it( kabcResources ); 1313 Q3PtrListIterator<KABC::Resource> it( kabcResources );
1304 KABC::Resource *resource; 1314 KABC::Resource *resource;
1305 while ( ( resource = it.current() ) != 0 ) { 1315 while ( ( resource = it.current() ) != 0 ) {
1306 ++it; 1316 ++it;
1307 if ( !resource->readOnly() ) { 1317 if ( !resource->readOnly() ) {
1308 KRES::Resource *res = static_cast<KRES::Resource*>( resource ); 1318 KRES::Resource *res = static_cast<KRES::Resource*>( resource );
1309 if ( res ) 1319 if ( res )
@@ -1853,21 +1863,21 @@ void KABCore::slotEditorDestroyed( const QString &uid )
1853 //mEditorDict.remove( uid ); 1863 //mEditorDict.remove( uid );
1854} 1864}
1855 1865
1856void KABCore::initGUI() 1866void KABCore::initGUI()
1857{ 1867{
1858#ifndef KAB_EMBEDDED 1868#ifndef KAB_EMBEDDED
1859 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1869 Q3HBoxLayout *topLayout = new Q3HBoxLayout( this );
1860 topLayout->setSpacing( KDialogBase::spacingHint() ); 1870 topLayout->setSpacing( KDialogBase::spacingHint() );
1861 1871
1862 mExtensionBarSplitter = new QSplitter( this ); 1872 mExtensionBarSplitter = new QSplitter( this );
1863 mExtensionBarSplitter->setOrientation( Qt::Vertical ); 1873 mExtensionBarSplitter->setOrientation( Qt::Vertical );
1864 1874
1865 mDetailsSplitter = new QSplitter( mExtensionBarSplitter ); 1875 mDetailsSplitter = new QSplitter( mExtensionBarSplitter );
1866 1876
1867 QVBox *viewSpace = new QVBox( mDetailsSplitter ); 1877 Q3VBox *viewSpace = new Q3VBox( mDetailsSplitter );
1868 mIncSearchWidget = new IncSearchWidget( viewSpace ); 1878 mIncSearchWidget = new IncSearchWidget( viewSpace );
1869 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1879 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1870 SLOT( incrementalSearch( const QString& ) ) ); 1880 SLOT( incrementalSearch( const QString& ) ) );
1871 1881
1872 mViewManager = new ViewManager( this, viewSpace ); 1882 mViewManager = new ViewManager( this, viewSpace );
1873 viewSpace->setStretchFactor( mViewManager, 1 ); 1883 viewSpace->setStretchFactor( mViewManager, 1 );
@@ -1885,34 +1895,34 @@ void KABCore::initGUI()
1885 1895
1886 mXXPortManager = new XXPortManager( this, this ); 1896 mXXPortManager = new XXPortManager( this, this );
1887 1897
1888#else //KAB_EMBEDDED 1898#else //KAB_EMBEDDED
1889 //US initialize viewMenu before settingup viewmanager. 1899 //US initialize viewMenu before settingup viewmanager.
1890 // Viewmanager needs this menu to plugin submenues. 1900 // Viewmanager needs this menu to plugin submenues.
1891 viewMenu = new QPopupMenu( this ); 1901 viewMenu = new Q3PopupMenu( this );
1892 settingsMenu = new QPopupMenu( this ); 1902 settingsMenu = new Q3PopupMenu( this );
1893 //filterMenu = new QPopupMenu( this ); 1903 //filterMenu = new QPopupMenu( this );
1894 ImportMenu = new QPopupMenu( this ); 1904 ImportMenu = new Q3PopupMenu( this );
1895 ExportMenu = new QPopupMenu( this ); 1905 ExportMenu = new Q3PopupMenu( this );
1896 syncMenu = new QPopupMenu( this ); 1906 syncMenu = new Q3PopupMenu( this );
1897 changeMenu= new QPopupMenu( this ); 1907 changeMenu= new Q3PopupMenu( this );
1898 beamMenu= new QPopupMenu( this ); 1908 beamMenu= new Q3PopupMenu( this );
1899 1909
1900//US since we have no splitter for the embedded system, setup 1910//US since we have no splitter for the embedded system, setup
1901// a layout with two frames. One left and one right. 1911// a layout with two frames. One left and one right.
1902 1912
1903 QBoxLayout *topLayout; 1913 Q3BoxLayout *topLayout;
1904 1914
1905 // = new QHBoxLayout( this ); 1915 // = new QHBoxLayout( this );
1906// QBoxLayout *topLayout = (QBoxLayout*)layout(); 1916// QBoxLayout *topLayout = (QBoxLayout*)layout();
1907 1917
1908// QWidget *mainBox = new QWidget( this ); 1918// QWidget *mainBox = new QWidget( this );
1909// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); 1919// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox);
1910 1920
1911#ifdef DESKTOP_VERSION 1921#ifdef DESKTOP_VERSION
1912 topLayout = new QHBoxLayout( this ); 1922 topLayout = new Q3HBoxLayout( this );
1913 1923
1914 1924
1915 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 1925 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
1916 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 1926 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
1917 1927
1918 topLayout->addWidget(mMiniSplitter ); 1928 topLayout->addWidget(mMiniSplitter );
@@ -1921,18 +1931,18 @@ void KABCore::initGUI()
1921 mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 1931 mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
1922 mViewManager = new ViewManager( this, mExtensionBarSplitter ); 1932 mViewManager = new ViewManager( this, mExtensionBarSplitter );
1923 mDetails = new ViewContainer( mMiniSplitter ); 1933 mDetails = new ViewContainer( mMiniSplitter );
1924 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); 1934 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter );
1925#else 1935#else
1926 if ( QApplication::desktop()->width() > 480 ) { 1936 if ( QApplication::desktop()->width() > 480 ) {
1927 topLayout = new QHBoxLayout( this ); 1937 topLayout = new Q3HBoxLayout( this );
1928 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 1938 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
1929 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 1939 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
1930 } else { 1940 } else {
1931 1941
1932 topLayout = new QHBoxLayout( this ); 1942 topLayout = new Q3HBoxLayout( this );
1933 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); 1943 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this);
1934 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 1944 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
1935 } 1945 }
1936 1946
1937 topLayout->addWidget(mMiniSplitter ); 1947 topLayout->addWidget(mMiniSplitter );
1938 mViewManager = new ViewManager( this, mMiniSplitter ); 1948 mViewManager = new ViewManager( this, mMiniSplitter );
@@ -2031,23 +2041,23 @@ void KABCore::initActions()
2031#endif //KAB_EMBEDDED 2041#endif //KAB_EMBEDDED
2032 2042
2033 // file menu 2043 // file menu
2034 2044
2035 mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); 2045 mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() );
2036 //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); 2046 //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() );
2037 mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", CTRL + Key_P, mViewManager, 2047 mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", Qt::CTRL + Qt::Key_P, mViewManager,
2038 SLOT( printView() ), actionCollection(), "kaddressbook_print" ); 2048 SLOT( printView() ), actionCollection(), "kaddressbook_print" );
2039 2049
2040 2050
2041 mActionPrintDetails = new KAction( i18n( "&Print Details" ), "fileprint", 0, mDetails, 2051 mActionPrintDetails = new KAction( i18n( "&Print Details" ), "fileprint", 0, mDetails,
2042 SLOT( printView() ), actionCollection(), "kaddressbook_print2" ); 2052 SLOT( printView() ), actionCollection(), "kaddressbook_print2" );
2043 2053
2044 mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, 2054 mActionSave = new KAction( i18n( "&Save" ), "filesave", Qt::CTRL+Qt::Key_S, this,
2045 SLOT( save() ), actionCollection(), "file_sync" ); 2055 SLOT( save() ), actionCollection(), "file_sync" );
2046 2056
2047 mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, 2057 mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", Qt::CTRL+Qt::Key_N, this,
2048 SLOT( newContact() ), actionCollection(), "file_new_contact" ); 2058 SLOT( newContact() ), actionCollection(), "file_new_contact" );
2049 2059
2050 mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, 2060 mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0,
2051 this, SLOT( mailVCard() ), 2061 this, SLOT( mailVCard() ),
2052 actionCollection(), "file_mail_vcard"); 2062 actionCollection(), "file_mail_vcard");
2053 2063
@@ -2080,41 +2090,41 @@ void KABCore::initActions()
2080 mMainWindow, SLOT( exit() ), 2090 mMainWindow, SLOT( exit() ),
2081 actionCollection(), "quit" ); 2091 actionCollection(), "quit" );
2082#endif //KAB_EMBEDDED 2092#endif //KAB_EMBEDDED
2083 2093
2084 // edit menu 2094 // edit menu
2085 if ( mIsPart ) { 2095 if ( mIsPart ) {
2086 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, 2096 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", Qt::CTRL + Qt::Key_C, this,
2087 SLOT( copyContacts() ), actionCollection(), 2097 SLOT( copyContacts() ), actionCollection(),
2088 "kaddressbook_copy" ); 2098 "kaddressbook_copy" );
2089 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, 2099 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", Qt::CTRL + Qt::Key_X, this,
2090 SLOT( cutContacts() ), actionCollection(), 2100 SLOT( cutContacts() ), actionCollection(),
2091 "kaddressbook_cut" ); 2101 "kaddressbook_cut" );
2092 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, 2102 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", Qt::CTRL + Qt::Key_V, this,
2093 SLOT( pasteContacts() ), actionCollection(), 2103 SLOT( pasteContacts() ), actionCollection(),
2094 "kaddressbook_paste" ); 2104 "kaddressbook_paste" );
2095 mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, 2105 mActionSelectAll = new KAction( i18n( "Select &All" ), Qt::CTRL + Qt::Key_A, this,
2096 SLOT( selectAllContacts() ), actionCollection(), 2106 SLOT( selectAllContacts() ), actionCollection(),
2097 "kaddressbook_select_all" ); 2107 "kaddressbook_select_all" );
2098 mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, 2108 mActionUndo = new KAction( i18n( "&Undo" ), "undo", Qt::CTRL + Qt::Key_Z, this,
2099 SLOT( undo() ), actionCollection(), 2109 SLOT( undo() ), actionCollection(),
2100 "kaddressbook_undo" ); 2110 "kaddressbook_undo" );
2101 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, 2111 mActionRedo = new KAction( i18n( "Re&do" ), "redo", Qt::CTRL + Qt::SHIFT + Qt::Key_Z,
2102 this, SLOT( redo() ), actionCollection(), 2112 this, SLOT( redo() ), actionCollection(),
2103 "kaddressbook_redo" ); 2113 "kaddressbook_redo" );
2104 } else { 2114 } else {
2105 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); 2115 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() );
2106 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); 2116 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() );
2107 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); 2117 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() );
2108 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); 2118 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() );
2109 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); 2119 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() );
2110 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); 2120 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() );
2111 } 2121 }
2112 2122
2113 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", 2123 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete",
2114 Key_Delete, this, SLOT( deleteContacts() ), 2124 Qt::Key_Delete, this, SLOT( deleteContacts() ),
2115 actionCollection(), "edit_delete" ); 2125 actionCollection(), "edit_delete" );
2116 2126
2117 mActionUndo->setEnabled( false ); 2127 mActionUndo->setEnabled( false );
2118 mActionRedo->setEnabled( false ); 2128 mActionRedo->setEnabled( false );
2119 2129
2120 // settings menu 2130 // settings menu
@@ -2243,15 +2253,15 @@ void KABCore::initActions()
2243// KDE uses a XML format to plug the actions, but we work her without this overhead. 2253// KDE uses a XML format to plug the actions, but we work her without this overhead.
2244void KABCore::addActionsManually() 2254void KABCore::addActionsManually()
2245{ 2255{
2246//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 2256//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
2247 2257
2248#ifdef KAB_EMBEDDED 2258#ifdef KAB_EMBEDDED
2249 QPopupMenu *fileMenu = new QPopupMenu( this ); 2259 Q3PopupMenu *fileMenu = new Q3PopupMenu( this );
2250 QPopupMenu *editMenu = new QPopupMenu( this ); 2260 Q3PopupMenu *editMenu = new Q3PopupMenu( this );
2251 QPopupMenu *helpMenu = new QPopupMenu( this ); 2261 Q3PopupMenu *helpMenu = new Q3PopupMenu( this );
2252 2262
2253 KToolBar* tb = mMainWindow->toolBar(); 2263 KToolBar* tb = mMainWindow->toolBar();
2254 mMainWindow->setToolBarsMovable (false ); 2264 mMainWindow->setToolBarsMovable (false );
2255#ifndef DESKTOP_VERSION 2265#ifndef DESKTOP_VERSION
2256 if ( KABPrefs::instance()->mFullMenuBarVisible ) { 2266 if ( KABPrefs::instance()->mFullMenuBarVisible ) {
2257#endif 2267#endif
@@ -2273,13 +2283,13 @@ void KABCore::addActionsManually()
2273 mIncSearchWidget = new IncSearchWidget( tb ); 2283 mIncSearchWidget = new IncSearchWidget( tb );
2274 // tb->insertWidget(-1, 0, mIncSearchWidget); 2284 // tb->insertWidget(-1, 0, mIncSearchWidget);
2275#ifndef DESKTOP_VERSION 2285#ifndef DESKTOP_VERSION
2276 } else { 2286 } else {
2277 //US setup toolbar 2287 //US setup toolbar
2278 QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); 2288 QPEMenuBar *menuBarTB = new QPEMenuBar( tb );
2279 QPopupMenu *popupBarTB = new QPopupMenu( this ); 2289 Q3PopupMenu *popupBarTB = new Q3PopupMenu( this );
2280 menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB); 2290 menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB);
2281 tb->insertWidget(-1, 0, menuBarTB); 2291 tb->insertWidget(-1, 0, menuBarTB);
2282 mIncSearchWidget = new IncSearchWidget( tb ); 2292 mIncSearchWidget = new IncSearchWidget( tb );
2283 tb->enableMoving(false); 2293 tb->enableMoving(false);
2284 popupBarTB->insertItem( i18n("&File"), fileMenu ); 2294 popupBarTB->insertItem( i18n("&File"), fileMenu );
2285 popupBarTB->insertItem( i18n("&Edit"), editMenu ); 2295 popupBarTB->insertItem( i18n("&Edit"), editMenu );
@@ -2628,13 +2638,13 @@ void KABCore::configureKeyBindings()
2628#endif //KAB_EMBEDDED 2638#endif //KAB_EMBEDDED
2629} 2639}
2630 2640
2631#ifdef KAB_EMBEDDED 2641#ifdef KAB_EMBEDDED
2632void KABCore::configureResources() 2642void KABCore::configureResources()
2633{ 2643{
2634 KRES::KCMKResources dlg( this, "" , 0 ); 2644 KRES::KCMKResources dlg( this, "" , QStringList() );
2635 2645
2636 if ( !dlg.exec() ) 2646 if ( !dlg.exec() )
2637 return; 2647 return;
2638 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); 2648 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") );
2639} 2649}
2640#endif //KAB_EMBEDDED 2650#endif //KAB_EMBEDDED
@@ -2724,13 +2734,13 @@ void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString
2724 KABC::AddressBook::Iterator it; 2734 KABC::AddressBook::Iterator it;
2725 2735
2726 int count = 0; 2736 int count = 0;
2727 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2737 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2728 ++count; 2738 ++count;
2729 } 2739 }
2730 QProgressBar bar(count,0 ); 2740 Q3ProgressBar bar(count,0 );
2731 int w = 300; 2741 int w = 300;
2732 if ( QApplication::desktop()->width() < 320 ) 2742 if ( QApplication::desktop()->width() < 320 )
2733 w = 220; 2743 w = 220;
2734 int h = bar.sizeHint().height() ; 2744 int h = bar.sizeHint().height() ;
2735 int dw = QApplication::desktop()->width(); 2745 int dw = QApplication::desktop()->width();
2736 int dh = QApplication::desktop()->height(); 2746 int dh = QApplication::desktop()->height();
@@ -2905,13 +2915,13 @@ KABC::Addressee KABCore::getLastSyncAddressee()
2905 lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); 2915 lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice );
2906 QString sum = ""; 2916 QString sum = "";
2907 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) 2917 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL )
2908 sum = "E: "; 2918 sum = "E: ";
2909 lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); 2919 lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event"));
2910 lse.setRevision( mLastAddressbookSync ); 2920 lse.setRevision( mLastAddressbookSync );
2911 lse.setCategories( i18n("SyncEvent") ); 2921 lse.setCategories( QStringList(i18n("SyncEvent")) );
2912 mAddressBook->insertAddressee( lse ); 2922 mAddressBook->insertAddressee( lse );
2913 } 2923 }
2914 return lse; 2924 return lse;
2915} 2925}
2916int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ) 2926int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full )
2917{ 2927{
@@ -3096,13 +3106,13 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
3096 fullDateRange = true; 3106 fullDateRange = true;
3097 Addressee newAdd; 3107 Addressee newAdd;
3098 addresseeRSync = newAdd; 3108 addresseeRSync = newAdd;
3099 addresseeRSync.setFamilyName(mCurrentSyncName + i18n(" - sync addressee")); 3109 addresseeRSync.setFamilyName(mCurrentSyncName + i18n(" - sync addressee"));
3100 addresseeRSync.setUid("last-syncAddressee-"+mCurrentSyncName ); 3110 addresseeRSync.setUid("last-syncAddressee-"+mCurrentSyncName );
3101 addresseeRSync.setRevision( mLastAddressbookSync ); 3111 addresseeRSync.setRevision( mLastAddressbookSync );
3102 addresseeRSync.setCategories( i18n("SyncAddressee") ); 3112 addresseeRSync.setCategories( QStringList(i18n("SyncAddressee")) );
3103 } 3113 }
3104 } 3114 }
3105 if ( addresseeLSync.revision() == mLastAddressbookSync ) { 3115 if ( addresseeLSync.revision() == mLastAddressbookSync ) {
3106 // qDebug("FULLDATE 2"); 3116 // qDebug("FULLDATE 2");
3107 fullDateRange = true; 3117 fullDateRange = true;
3108 } 3118 }
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index ec6a9ec..4351720 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -25,17 +25,21 @@
25#define KABCORE_H 25#define KABCORE_H
26 26
27#include <kabc/field.h> 27#include <kabc/field.h>
28 28
29#ifndef KAB_EMBEDDED 29#ifndef KAB_EMBEDDED
30#endif //KAB_EMBEDDED 30#endif //KAB_EMBEDDED
31#include <qdict.h> 31#include <q3dict.h>
32#include <qtimer.h> 32#include <qtimer.h>
33 33
34#include <qwidget.h> 34#include <qwidget.h>
35#include <qpopupmenu.h> 35#include <q3popupmenu.h>
36//Added by qt3to4:
37#include <Q3CString>
38#include <QPixmap>
39#include <QResizeEvent>
36#include <ksyncmanager.h> 40#include <ksyncmanager.h>
37#ifndef DESKTOP_VERSION 41#ifndef DESKTOP_VERSION
38#include <qcopchannel_qws.h> 42#include <qcopchannel_qws.h>
39#endif 43#endif
40 44
41namespace KABC { 45namespace KABC {
@@ -82,15 +86,15 @@ class KABCore : public QWidget, public KSyncInterface
82 86
83 ~KABCore(); 87 ~KABCore();
84 88
85 89
86#ifdef KAB_EMBEDDED 90#ifdef KAB_EMBEDDED
87 //US added functionality 91 //US added functionality
88 QPopupMenu* getViewMenu() {return viewMenu;} 92 Q3PopupMenu* getViewMenu() {return viewMenu;}
89 QPopupMenu* getFilterMenu() {return filterMenu;} 93 Q3PopupMenu* getFilterMenu() {return filterMenu;}
90 QPopupMenu* getSettingsMenu() {return settingsMenu;} 94 Q3PopupMenu* getSettingsMenu() {return settingsMenu;}
91 void addActionsManually(); 95 void addActionsManually();
92#endif //KAB_EMBEDDED 96#endif //KAB_EMBEDDED
93 /** 97 /**
94 Restores the global settings. 98 Restores the global settings.
95 */ 99 */
96 void restoreSettings(); 100 void restoreSettings();
@@ -132,14 +136,14 @@ class KABCore : public QWidget, public KSyncInterface
132 136
133#ifndef KAB_EMBEDDED 137#ifndef KAB_EMBEDDED
134 static KAboutData *createAboutData(); 138 static KAboutData *createAboutData();
135#endif //KAB_EMBEDDED 139#endif //KAB_EMBEDDED
136 140
137#ifdef KAB_EMBEDDED 141#ifdef KAB_EMBEDDED
138 inline QPopupMenu* getImportMenu() { return ImportMenu;} 142 inline Q3PopupMenu* getImportMenu() { return ImportMenu;}
139 inline QPopupMenu* getExportMenu() { return ExportMenu;} 143 inline Q3PopupMenu* getExportMenu() { return ExportMenu;}
140#endif //KAB_EMBEDDED 144#endif //KAB_EMBEDDED
141 145
142 public slots: 146 public slots:
143#ifdef KAB_EMBEDDED 147#ifdef KAB_EMBEDDED
144 void createAboutData(); 148 void createAboutData();
145#endif //KAB_EMBEDDED 149#endif //KAB_EMBEDDED
@@ -363,14 +367,14 @@ class KABCore : public QWidget, public KSyncInterface
363 367
364 void saveSettings(); 368 void saveSettings();
365 369
366 private slots: 370 private slots:
367 void updateToolBar(); 371 void updateToolBar();
368 void updateMainWindow(); 372 void updateMainWindow();
369 void receive( const QCString& cmsg, const QByteArray& data ); 373 void receive( const Q3CString& cmsg, const QByteArray& data );
370 void receiveStart( const QCString& cmsg, const QByteArray& data ); 374 void receiveStart( const Q3CString& cmsg, const QByteArray& data );
371 void toggleBeamReceive( ); 375 void toggleBeamReceive( );
372 void disableBR(bool); 376 void disableBR(bool);
373 void setJumpButtonBarVisible( bool visible ); 377 void setJumpButtonBarVisible( bool visible );
374 void setJumpButtonBar( bool visible ); 378 void setJumpButtonBar( bool visible );
375 void setCaptionBack(); 379 void setCaptionBack();
376 void resizeAndCallContactdialog(); 380 void resizeAndCallContactdialog();
@@ -391,13 +395,13 @@ class KABCore : public QWidget, public KSyncInterface
391 395
392 void slotEditorDestroyed( const QString &uid ); 396 void slotEditorDestroyed( const QString &uid );
393 void configurationChanged(); 397 void configurationChanged();
394 void addressBookChanged(); 398 void addressBookChanged();
395 399
396 private: 400 private:
397 QCString mCStringMess; 401 Q3CString mCStringMess;
398 QByteArray mByteData; 402 QByteArray mByteData;
399 QString mEmailSourceChannel; 403 QString mEmailSourceChannel;
400 QString mEmailSourceUID; 404 QString mEmailSourceUID;
401 void resizeEvent(QResizeEvent* e ); 405 void resizeEvent(QResizeEvent* e );
402 bool mBRdisabled; 406 bool mBRdisabled;
403#ifndef DESKTOP_VERSION 407#ifndef DESKTOP_VERSION
@@ -483,20 +487,20 @@ class KABCore : public QWidget, public KSyncInterface
483 KAction *mActionStorageHowto; 487 KAction *mActionStorageHowto;
484 KAction *mActionKdeSyncHowto; 488 KAction *mActionKdeSyncHowto;
485 KAction *mActionMultiSyncHowto; 489 KAction *mActionMultiSyncHowto;
486 490
487 KAction *mActionDeleteView; 491 KAction *mActionDeleteView;
488 492
489 QPopupMenu *viewMenu; 493 Q3PopupMenu *viewMenu;
490 QPopupMenu *filterMenu; 494 Q3PopupMenu *filterMenu;
491 QPopupMenu *settingsMenu; 495 Q3PopupMenu *settingsMenu;
492 QPopupMenu *changeMenu; 496 Q3PopupMenu *changeMenu;
493 QPopupMenu *beamMenu; 497 Q3PopupMenu *beamMenu;
494//US QAction *mActionSave; 498//US QAction *mActionSave;
495 QPopupMenu *ImportMenu; 499 Q3PopupMenu *ImportMenu;
496 QPopupMenu *ExportMenu; 500 Q3PopupMenu *ExportMenu;
497 //LR additional methods 501 //LR additional methods
498 KAction *mActionRemoveVoice; 502 KAction *mActionRemoveVoice;
499 KAction *mActionSetFormattedName; 503 KAction *mActionSetFormattedName;
500 KAction * mActionImportOL; 504 KAction * mActionImportOL;
501 505
502#ifndef KAB_EMBEDDED 506#ifndef KAB_EMBEDDED
@@ -521,13 +525,13 @@ class KABCore : public QWidget, public KSyncInterface
521 bool syncPhone(); 525 bool syncPhone();
522 void message( QString m , bool startTimer = true); 526 void message( QString m , bool startTimer = true);
523 527
524 // LR ******************************* 528 // LR *******************************
525 // sync stuff! 529 // sync stuff!
526 QString sentSyncFile(); 530 QString sentSyncFile();
527 QPopupMenu *syncMenu; 531 Q3PopupMenu *syncMenu;
528 KSyncManager* syncManager; 532 KSyncManager* syncManager;
529 int mGlobalSyncMode; 533 int mGlobalSyncMode;
530 bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode); 534 bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode);
531 KABC::Addressee getLastSyncAddressee(); 535 KABC::Addressee getLastSyncAddressee();
532 QDateTime mLastAddressbookSync; 536 QDateTime mLastAddressbookSync;
533 int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ); 537 int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full );
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp
index 42d541b..6f9c995 100644
--- a/kaddressbook/kabprefs.cpp
+++ b/kaddressbook/kabprefs.cpp
@@ -22,13 +22,13 @@
22*/ 22*/
23 23
24//US#ifdef KAB_EMBEDDED 24//US#ifdef KAB_EMBEDDED
25//#include <qstring.h> 25//#include <qstring.h>
26//#endif //KAB_EMBEDDED 26//#endif //KAB_EMBEDDED
27 27
28#include <qtextstream.h> 28#include <q3textstream.h>
29#include <qfile.h> 29#include <qfile.h>
30#include <qregexp.h> 30#include <qregexp.h>
31#include <stdlib.h> 31#include <stdlib.h>
32#include <libkdepim/kpimglobalprefs.h> 32#include <libkdepim/kpimglobalprefs.h>
33 33
34#include <kconfig.h> 34#include <kconfig.h>
@@ -88,13 +88,13 @@ KABPrefs::KABPrefs()
88 addItemInt( "CurrentExtension", &mCurrentExtension, 0 ); 88 addItemInt( "CurrentExtension", &mCurrentExtension, 0 );
89 addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions ); 89 addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions );
90 90
91 KPrefs::setCurrentGroup( "Views" ); 91 KPrefs::setCurrentGroup( "Views" );
92 QString defaultView = i18n( "Default Table View" ); 92 QString defaultView = i18n( "Default Table View" );
93 addItemString( "CurrentView", &mCurrentView, defaultView ); 93 addItemString( "CurrentView", &mCurrentView, defaultView );
94 addItemStringList( "ViewNames", &mViewNames, defaultView ); 94 addItemStringList( "ViewNames", &mViewNames, QStringList(defaultView) );
95 95
96 KPrefs::setCurrentGroup( "Filters" ); 96 KPrefs::setCurrentGroup( "Filters" );
97 addItemInt( "CurrentFilter", &mCurrentFilter, 0 ); 97 addItemInt( "CurrentFilter", &mCurrentFilter, 0 );
98 98
99} 99}
100 100
diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h
index ddbc0c0..aff725e 100644
--- a/kaddressbook/kabprefs.h
+++ b/kaddressbook/kabprefs.h
@@ -22,13 +22,15 @@
22*/ 22*/
23 23
24#ifndef KABPREFS_H 24#ifndef KABPREFS_H
25#define KABPREFS_H 25#define KABPREFS_H
26 26
27#include <qstringlist.h> 27#include <qstringlist.h>
28#include <qdict.h> 28#include <q3dict.h>
29//Added by qt3to4:
30#include <Q3ValueList>
29 31
30#include <libkdepim/kpimprefs.h> 32#include <libkdepim/kpimprefs.h>
31 33
32class KConfig; 34class KConfig;
33 35
34class KABPrefs : public KPimPrefs 36class KABPrefs : public KPimPrefs
@@ -70,14 +72,14 @@ class KABPrefs : public KPimPrefs
70 bool mDetailsPageVisible; 72 bool mDetailsPageVisible;
71 bool mMultipleViewsAtOnce; 73 bool mMultipleViewsAtOnce;
72 bool mSearchWithReturn; 74 bool mSearchWithReturn;
73 bool mAutoSearchWithWildcard; 75 bool mAutoSearchWithWildcard;
74 bool mHideSearchOnSwitch; 76 bool mHideSearchOnSwitch;
75 bool mAskForDelete; 77 bool mAskForDelete;
76 QValueList<int> mExtensionsSplitter; 78 Q3ValueList<int> mExtensionsSplitter;
77 QValueList<int> mDetailsSplitter; 79 Q3ValueList<int> mDetailsSplitter;
78 80
79 // Extensions stuff 81 // Extensions stuff
80 int mCurrentExtension; 82 int mCurrentExtension;
81 QStringList mActiveExtensions; 83 QStringList mActiveExtensions;
82 84
83 // Views stuff 85 // Views stuff
diff --git a/kaddressbook/kaddressbook.pro b/kaddressbook/kaddressbook.pro
index cd38e5f..4eb1f7f 100644
--- a/kaddressbook/kaddressbook.pro
+++ b/kaddressbook/kaddressbook.pro
@@ -10,46 +10,46 @@ INCLUDEPATH += . ./details ./features ./xxport ../libkdepim ../microkde ../mic
10DEFINES += KAB_EMBEDDED KAB_NOSPLITTER DESKTOP_VERSION 10DEFINES += KAB_EMBEDDED KAB_NOSPLITTER DESKTOP_VERSION
11 11
12unix : { 12unix : {
13 13
14staticlib: { 14staticlib: {
15 TARGET = kapi_linux 15 TARGET = kapi_linux
16LIBS += ../bin/libmicrokabc_qtopia.a 16LIBS += ../bin/libxmicrokabc_qtopia.a
17LIBS += ../bin/libmicrokabc_file.a 17LIBS += ../bin/libxmicrokabc_file.a
18LIBS += ../bin/libmicrokabc_dir.a 18LIBS += ../bin/libxmicrokabc_dir.a
19LIBS += ../bin/libmicrokdepim.a 19LIBS += ../bin/libxmicrokdepim.a
20LIBS += ../bin/libmicrokcal.a 20LIBS += ../bin/libxmicrokcal.a
21LIBS += ../bin/libmicrokabc.a 21LIBS += ../bin/libxmicrokabc.a
22LIBS += ../bin/libmicrokde.a 22LIBS += ../bin/libxmicrokde.a
23LIBS += ../bin/libmicrokabc_qtopia.a 23LIBS += ../bin/libxmicrokabc_qtopia.a
24LIBS += ../bin/libmicrokabc_file.a 24LIBS += ../bin/libxmicrokabc_file.a
25LIBS += ../bin/libmicrokabc_dir.a 25LIBS += ../bin/libxmicrokabc_dir.a
26LIBS += ../bin/libmicrokdepim.a 26LIBS += ../bin/libxmicrokdepim.a
27LIBS += ../bin/libmicrokcal.a 27LIBS += ../bin/libxmicrokcal.a
28LIBS += ../bin/libmicrokabc.a 28LIBS += ../bin/libxmicrokabc.a
29LIBS += ../bin/libmicrokde.a 29LIBS += ../bin/libxmicrokde.a
30LIBS += ../libical/lib/libical.a 30LIBS += ../libical/lib/libical.a
31LIBS += ../libical/lib/libicalss.a 31LIBS += ../libical/lib/libicalss.a
32 32
33} else { 33} else {
34LIBS += ../bin/libmicrokdepim.so 34LIBS += ../bin/libxmicrokdepim.so
35LIBS += ../bin/libmicrokde.so 35LIBS += ../bin/libxmicrokde.so
36LIBS += ../bin/libmicrokabc.so 36LIBS += ../bin/libxmicrokabc.so
37LIBS += ../bin/libmicrokcal.so 37LIBS += ../bin/libxmicrokcal.so
38#LIBS += -lldap 38#LIBS += -lldap
39} 39}
40OBJECTS_DIR = obj/unix 40OBJECTS_DIR = obj/unix
41MOC_DIR = moc/unix 41MOC_DIR = moc/unix
42} 42}
43win32: { 43win32: {
44RC_FILE = winicons.rc 44RC_FILE = winicons.rc
45DEFINES += _WIN32_ 45DEFINES += _WIN32_
46LIBS += ../bin/microkdepim.lib 46LIBS += ../bin/xmicrokdepim.lib
47LIBS += ../bin/microkcal.lib 47LIBS += ../bin/xmicrokcal.lib
48LIBS += ../bin/microkde.lib 48LIBS += ../bin/xmicrokde.lib
49LIBS += ../bin/microkabc.lib 49LIBS += ../bin/xmicrokabc.lib
50QMAKE_LINK += /NODEFAULTLIB:LIBC 50QMAKE_LINK += /NODEFAULTLIB:LIBC
51OBJECTS_DIR = obj/win 51OBJECTS_DIR = obj/win
52MOC_DIR = moc/win 52MOC_DIR = moc/win
53#olimport section 53#olimport section
54importol { 54importol {
55debug: { 55debug: {
@@ -201,6 +201,8 @@ xxport/qtopia_xxport.cpp \
201xxport/sharpdtm_xxport.cpp \ 201xxport/sharpdtm_xxport.cpp \
202#details/look_details.cpp \ 202#details/look_details.cpp \
203#mainwindow.cpp \ 203#mainwindow.cpp \
204# calendarview.cpp \ 204# calendarview.cpp \
205# timespanview.cpp 205# timespanview.cpp
206 206
207#The following line was inserted by qt3to4
208QT += xml qt3support
diff --git a/kaddressbook/kaddressbookE.pro b/kaddressbook/kaddressbookE.pro
index 64e3a4a..c4b2499 100644
--- a/kaddressbook/kaddressbookE.pro
+++ b/kaddressbook/kaddressbookE.pro
@@ -9,16 +9,16 @@ DESTDIR=$(QPEDIR)/bin
9 9
10INCLUDEPATH += . ./details ./features ./xxport ../libkdepim ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../qtcompat ../ interfaces $(QPEDIR)/include 10INCLUDEPATH += . ./details ./features ./xxport ../libkdepim ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../qtcompat ../ interfaces $(QPEDIR)/include
11DEFINES += KAB_EMBEDDED KAB_NOSPLITTER 11DEFINES += KAB_EMBEDDED KAB_NOSPLITTER
12#DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOKABC KORG_NOARCHIVE KORG_NOMAIL 12#DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOKABC KORG_NOARCHIVE KORG_NOMAIL
13#DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER 13#DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER
14#DEFINES += KORG_NOLVALTERNATION 14#DEFINES += KORG_NOLVALTERNATION
15LIBS += -lmicrokdepim 15LIBS += -lxmicrokdepim
16LIBS += -lmicrokde 16LIBS += -lxmicrokde
17LIBS += -lmicroqtcompat 17LIBS += -lmicroqtcompat
18LIBS += -lmicrokabc 18LIBS += -lxmicrokabc
19LIBS += -lqpe 19LIBS += -lqpe
20LIBS += -ljpeg 20LIBS += -ljpeg
21LIBS += $(QTOPIALIB) 21LIBS += $(QTOPIALIB)
22LIBS += -L$(QPEDIR)/lib 22LIBS += -L$(QPEDIR)/lib
23LIBS += -Wl,-export-dynamic 23LIBS += -Wl,-export-dynamic
24LIBS += $(GCC3EXTRALIB1) 24LIBS += $(GCC3EXTRALIB1)
diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp
index c417226..b317974 100644
--- a/kaddressbook/kaddressbookmain.cpp
+++ b/kaddressbook/kaddressbookmain.cpp
@@ -22,14 +22,17 @@
22*/ 22*/
23 23
24#ifdef KAB_EMBEDDED 24#ifdef KAB_EMBEDDED
25#include "kabprefs.h" 25#include "kabprefs.h"
26#include <kglobal.h> 26#include <kglobal.h>
27#include <qmessagebox.h> 27#include <qmessagebox.h>
28#include <qtoolbar.h> 28#include <q3toolbar.h>
29#include <qapplication.h> 29#include <qapplication.h>
30//Added by qt3to4:
31#include <Q3CString>
32#include <QCloseEvent>
30#else //KAB_EMBEDDED 33#else //KAB_EMBEDDED
31#include <kedittoolbar.h> 34#include <kedittoolbar.h>
32#include <kkeydialog.h> 35#include <kkeydialog.h>
33#include <kmessagebox.h> 36#include <kmessagebox.h>
34#include <kstatusbar.h> 37#include <kstatusbar.h>
35#endif //KAB_EMBEDDED 38#endif //KAB_EMBEDDED
@@ -39,24 +42,24 @@
39#include "kaddressbookmain.h" 42#include "kaddressbookmain.h"
40#include "kactioncollection.h" 43#include "kactioncollection.h"
41 44
42#ifdef KAB_EMBEDDED 45#ifdef KAB_EMBEDDED
43KAddressBookMain::KAddressBookMain() : KMainWindow( 0, "abmain" ) 46KAddressBookMain::KAddressBookMain() : KMainWindow( 0, "abmain" )
44#else //KAB_EMBEDDED 47#else //KAB_EMBEDDED
45//MOC_SKIP_BEGIN 48#ifndef Q_MOC_RUN
46KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainWindow( 0 ) 49KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainWindow( 0 )
47//MOC_SKIP_END 50#endif
48#endif //KAB_EMBEDDED 51#endif //KAB_EMBEDDED
49{ 52{
50 setIcon(SmallIcon( "ka24" ) ); 53 setIcon(SmallIcon( "ka24" ) );
51#if 0 54#if 0
52 //US for embedded systems, create the toolbar before we initiate KABCore. 55 //US for embedded systems, create the toolbar before we initiate KABCore.
53 // KABCore will fill the toolbar with menues and icons 56 // KABCore will fill the toolbar with menues and icons
54 QMainWindow::ToolBarDock tbd; 57 Qt::ToolBarDock tbd;
55 tbd = Top; 58 tbd = Qt::DockTop;
56 iconToolBar = new QToolBar( this ); 59 iconToolBar = new Q3ToolBar( this );
57 addToolBar (iconToolBar , tbd ); 60 addToolBar (iconToolBar , tbd );
58 iconToolBar->setHorizontalStretchable(true); 61 iconToolBar->setHorizontalStretchable(true);
59//US iconToolBar->setWidth(300); 62//US iconToolBar->setWidth(300);
60#endif // 0 63#endif // 0
61 64
62 mCore = new KABCore( this, true, this ); 65 mCore = new KABCore( this, true, this );
@@ -82,13 +85,13 @@ KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainW
82 85
83 86
84#endif //KAB_EMBEDDED 87#endif //KAB_EMBEDDED
85 setAutoSaveSettings(); 88 setAutoSaveSettings();
86 mCore->restoreSettings(); 89 mCore->restoreSettings();
87#ifndef DESKTOP_VERSION 90#ifndef DESKTOP_VERSION
88 QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), mCore, SLOT (receiveStart ( const QCString &, const QByteArray & ))); 91 QObject::connect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), mCore, SLOT (receiveStart ( const Q3CString &, const QByteArray & )));
89#endif 92#endif
90} 93}
91 94
92KAddressBookMain::~KAddressBookMain() 95KAddressBookMain::~KAddressBookMain()
93{ 96{
94 // mCore->saveSettings(); 97 // mCore->saveSettings();
@@ -232,10 +235,9 @@ void KAddressBookMain::closeEvent( QCloseEvent* ce )
232 //KABPrefs::instance()->writeConfig(); 235 //KABPrefs::instance()->writeConfig();
233 } 236 }
234 237
235 ce->accept(); 238 ce->accept();
236} 239}
237 240
238#ifndef KAB_EMBEDDED 241#ifndef KAB_EMBEDDED_
239#include "kaddressbookmain.moc" 242#include "moc_kaddressbookmain.cpp"
240#endif //KAB_EMBEDDED 243#endif //KAB_EMBEDDED
241
diff --git a/kaddressbook/kaddressbookmain.h b/kaddressbook/kaddressbookmain.h
index b6d9b4b..d3f5cc7 100644
--- a/kaddressbook/kaddressbookmain.h
+++ b/kaddressbook/kaddressbookmain.h
@@ -21,16 +21,18 @@
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef KADDRESSBOOKMAIN_H 24#ifndef KADDRESSBOOKMAIN_H
25#define KADDRESSBOOKMAIN_H 25#define KADDRESSBOOKMAIN_H
26 26
27#include <qptrlist.h> 27#include <q3ptrlist.h>
28//Added by qt3to4:
29#include <QCloseEvent>
28 30
29#ifdef KAB_EMBEDDED 31#ifdef KAB_EMBEDDED
30class QToolBar; 32class Q3ToolBar;
31#include <qaction.h> 33#include <qaction.h>
32//#include <qmainwindow.h> 34//#include <qmainwindow.h>
33#include <kmainwindow.h> 35#include <kmainwindow.h>
34#else //KAB_EMBEDDED 36#else //KAB_EMBEDDED
35#include <kaction.h> 37#include <kaction.h>
36#include <kapplication.h> 38#include <kapplication.h>
@@ -49,15 +51,15 @@ class KConfig;
49 @author Don Sanders <dsanders@kde.org> 51 @author Don Sanders <dsanders@kde.org>
50 @version 0.1 52 @version 0.1
51 */ 53 */
52#ifdef KAB_EMBEDDED 54#ifdef KAB_EMBEDDED
53class KAddressBookMain : public KMainWindow 55class KAddressBookMain : public KMainWindow
54#else //KAB_EMBEDDED 56#else //KAB_EMBEDDED
55//MOC_SKIP_BEGIN 57#ifndef Q_MOC_RUN
56class KAddressBookMain : public KMainWindow, virtual public KAddressBookIface 58class KAddressBookMain : public KMainWindow, virtual public KAddressBookIface
57//MOC_SKIP_END 59#endif
58#endif //KAB_EMBEDDED 60#endif //KAB_EMBEDDED
59{ 61{
60 Q_OBJECT 62 Q_OBJECT
61 63
62 public: 64 public:
63 KAddressBookMain(); 65 KAddressBookMain();
@@ -70,15 +72,15 @@ class KAddressBookMain : public KMainWindow, virtual public KAddressBookIface
70 72
71 73
72 public slots: 74 public slots:
73 void showMinimized () ; 75 void showMinimized () ;
74 virtual void addEmail( QString addr ); 76 virtual void addEmail( QString addr );
75#ifndef KAB_EMBEDDED 77#ifndef KAB_EMBEDDED
76//MOC_SKIP_BEGIN 78#ifndef Q_MOC_RUN
77 virtual ASYNC showContactEditor( QString uid ); 79 virtual ASYNC showContactEditor( QString uid );
78//MOC_SKIP_END 80#endif
79#endif //KAB_EMBEDDED 81#endif //KAB_EMBEDDED
80 virtual void newContact(); 82 virtual void newContact();
81 virtual QString getNameByPhone( QString phone ); 83 virtual QString getNameByPhone( QString phone );
82 virtual void save(); 84 virtual void save();
83 virtual void exit(); 85 virtual void exit();
84 protected: 86 protected:
diff --git a/kaddressbook/kaddressbookview.cpp b/kaddressbook/kaddressbookview.cpp
index 86898e2..4823b37 100644
--- a/kaddressbook/kaddressbookview.cpp
+++ b/kaddressbook/kaddressbookview.cpp
@@ -29,12 +29,14 @@
29#include <klocale.h> 29#include <klocale.h>
30 30
31#include "viewmanager.h" 31#include "viewmanager.h"
32 32
33#endif //KAB_EMBEDDED 33#endif //KAB_EMBEDDED
34#include <qlayout.h> 34#include <qlayout.h>
35//Added by qt3to4:
36#include <Q3VBoxLayout>
35 37
36#include <kabc/distributionlistdialog.h> 38#include <kabc/distributionlistdialog.h>
37#include <kabc/addressbook.h> 39#include <kabc/addressbook.h>
38#include <kdebug.h> 40#include <kdebug.h>
39 41
40#include "kaddressbookview.h" 42#include "kaddressbookview.h"
@@ -130,13 +132,13 @@ KABC::Addressee::List KAddressBookView::addressees()
130 return addresseeList; 132 return addresseeList;
131} 133}
132 134
133void KAddressBookView::initGUI() 135void KAddressBookView::initGUI()
134{ 136{
135 // Create the layout 137 // Create the layout
136 QVBoxLayout *layout = new QVBoxLayout( this ); 138 Q3VBoxLayout *layout = new Q3VBoxLayout( this );
137 139
138 // Add the view widget 140 // Add the view widget
139 mViewWidget = new QWidget( this ); 141 mViewWidget = new QWidget( this );
140 layout->addWidget( mViewWidget ); 142 layout->addWidget( mViewWidget );
141} 143}
142 144
@@ -180,9 +182,9 @@ ViewConfigureWidget *ViewFactory::configureWidget( KABC::AddressBook *ab,
180{ 182{
181 return new ViewConfigureWidget( ab, parent, name ); 183 return new ViewConfigureWidget( ab, parent, name );
182} 184}
183 185
184 186
185 187
186#ifndef KAB_EMBEDDED 188#ifndef KAB_EMBEDDED_
187#include "kaddressbookview.moc" 189#include "moc_kaddressbookview.cpp"
188#endif //KAB_EMBEDDED 190#endif //KAB_EMBEDDED
diff --git a/kaddressbook/kaddressbookview.h b/kaddressbook/kaddressbookview.h
index 3a3f71a..e423cd7 100644
--- a/kaddressbook/kaddressbookview.h
+++ b/kaddressbook/kaddressbookview.h
@@ -1,6 +1,8 @@
1//Added by qt3to4:
2#include <QDropEvent>
1/* 3/*
2 This file is part of KAddressBook. 4 This file is part of KAddressBook.
3 Copyright (c) 2002 Mike Pilone <mpilone@slac.com> 5 Copyright (c) 2002 Mike Pilone <mpilone@slac.com>
4 6
5 This program is free software; you can redistribute it and/or modify 7 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
@@ -37,13 +39,13 @@ class QDropEvent;
37#include <qregexp.h> 39#include <qregexp.h>
38 40
39#include "viewconfigurewidget.h" 41#include "viewconfigurewidget.h"
40#include "filter.h" 42#include "filter.h"
41 43
42#ifdef DESKTOP_VERSION 44#ifdef DESKTOP_VERSION
43#include <qpaintdevicemetrics.h> 45#include <q3paintdevicemetrics.h>
44#include <qprinter.h> 46#include <qprinter.h>
45#include <qpainter.h> 47#include <qpainter.h>
46#endif 48#endif
47 49
48namespace KABC { class AddressBook; } 50namespace KABC { class AddressBook; }
49 51
@@ -172,15 +174,15 @@ class KAddressBookView : public QWidget
172 /** 174 /**
173 This method must be overloaded in subclasses. Select (highlight) 175 This method must be overloaded in subclasses. Select (highlight)
174 the addressee matching <i>uid</i>. If uid 176 the addressee matching <i>uid</i>. If uid
175 is equal to QString::null, then all addressees should be selected. 177 is equal to QString::null, then all addressees should be selected.
176 */ 178 */
177#ifndef KAB_EMBEDDED 179#ifndef KAB_EMBEDDED
178//MOC_SKIP_BEGIN 180#ifndef Q_MOC_RUN
179 virtual void setSelected( QString uid = QString::null, bool selected = true ) = 0; 181 virtual void setSelected( QString uid = QString::null, bool selected = true ) = 0;
180//MOC_SKIP_END 182#endif
181#else //KAB_EMBEDDED 183#else //KAB_EMBEDDED
182 //US my moc can not handle the default parameters. Is this a problem ??? 184 //US my moc can not handle the default parameters. Is this a problem ???
183 virtual void setSelected( QString uid, bool selected) = 0; 185 virtual void setSelected( QString uid, bool selected) = 0;
184#endif //KAB_EMBEDDED 186#endif //KAB_EMBEDDED
185 187
186 signals: 188 signals:
@@ -259,15 +261,15 @@ class KAddressBookView : public QWidget
259 KABC::Field::List mFieldList; 261 KABC::Field::List mFieldList;
260 262
261 QWidget *mViewWidget; 263 QWidget *mViewWidget;
262}; 264};
263 265
264#ifndef KAB_EMBEDDED 266#ifndef KAB_EMBEDDED
265//MOC_SKIP_BEGIN 267#ifndef Q_MOC_RUN
266class ViewFactory : public KLibFactory 268class ViewFactory : public KLibFactory
267//MOC_SKIP_END 269#endif
268#else //KAB_EMBEDDED 270#else //KAB_EMBEDDED
269class ViewFactory 271class ViewFactory
270#endif //KAB_EMBEDDED 272#endif //KAB_EMBEDDED
271{ 273{
272 274
273 public: 275 public:
diff --git a/kaddressbook/kcmconfigs/addresseewidget.cpp b/kaddressbook/kcmconfigs/addresseewidget.cpp
index 168d39e..8055085 100644
--- a/kaddressbook/kcmconfigs/addresseewidget.cpp
+++ b/kaddressbook/kcmconfigs/addresseewidget.cpp
@@ -18,18 +18,22 @@
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qgroupbox.h> 24#include <q3groupbox.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qlistbox.h> 27#include <q3listbox.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qapplication.h> 29#include <qapplication.h>
30#include <QDesktopWidget>
31//Added by qt3to4:
32#include <Q3GridLayout>
33#include <Q3HBoxLayout>
30 34
31#include <kbuttonbox.h> 35#include <kbuttonbox.h>
32#include <kcombobox.h> 36#include <kcombobox.h>
33#include <kconfig.h> 37#include <kconfig.h>
34#include <kdialog.h> 38#include <kdialog.h>
35#include <klocale.h> 39#include <klocale.h>
@@ -42,19 +46,19 @@
42NamePartWidget::NamePartWidget( const QString &title, QWidget *parent, 46NamePartWidget::NamePartWidget( const QString &title, QWidget *parent,
43 const char *name ) 47 const char *name )
44 : QWidget( parent, name ) 48 : QWidget( parent, name )
45{ 49{
46 if (KGlobal::getOrientation() == KGlobal::Portrait) 50 if (KGlobal::getOrientation() == KGlobal::Portrait)
47 { 51 {
48 QGridLayout* layout = new QGridLayout( this, 1, 1, KDialog::marginHintSmall(), 52 Q3GridLayout* layout = new Q3GridLayout( this, 1, 1, KDialog::marginHintSmall(),
49 KDialog::spacingHintSmall() ); 53 KDialog::spacingHintSmall() );
50 54
51 QLabel *label = new QLabel( i18n( title ), this ); 55 QLabel *label = new QLabel( i18n( title ), this );
52 layout->addWidget( label, 0, 1 ); 56 layout->addWidget( label, 0, 1 );
53 57
54 mBox = new QListBox( this ); 58 mBox = new Q3ListBox( this );
55 mBox->setMaximumSize(70, 70); 59 mBox->setMaximumSize(70, 70);
56 layout->addMultiCellWidget( mBox, 0, 1, 0, 0 ); 60 layout->addMultiCellWidget( mBox, 0, 1, 0, 0 );
57 61
58 KButtonBox *bbox = new KButtonBox( this, Qt::Vertical ); 62 KButtonBox *bbox = new KButtonBox( this, Qt::Vertical );
59 mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) ); 63 mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) );
60 mRemoveButton = bbox->addButton( i18n( "Rem" ), this, SLOT( remove() ) ); 64 mRemoveButton = bbox->addButton( i18n( "Rem" ), this, SLOT( remove() ) );
@@ -67,19 +71,19 @@ NamePartWidget::NamePartWidget( const QString &title, QWidget *parent,
67 71
68// layout->addWidget( group ); 72// layout->addWidget( group );
69 73
70 } 74 }
71 else 75 else
72 { 76 {
73 QHBoxLayout *layout = new QHBoxLayout( this ); 77 Q3HBoxLayout *layout = new Q3HBoxLayout( this );
74 78
75 QGroupBox *group = new QGroupBox( 0, Qt::Vertical, title, this ); 79 Q3GroupBox *group = new Q3GroupBox( 0, Qt::Vertical, title, this );
76 QGridLayout *groupLayout = new QGridLayout( group->layout(), 2, 2, 80 Q3GridLayout *groupLayout = new Q3GridLayout( group->layout(), 2, 2,
77 KDialog::spacingHint() ); 81 KDialog::spacingHint() );
78 82
79 mBox = new QListBox( group ); 83 mBox = new Q3ListBox( group );
80 84
81 groupLayout->addWidget( mBox, 0, 0 ); 85 groupLayout->addWidget( mBox, 0, 0 );
82 86
83 KButtonBox *bbox = new KButtonBox( group, Qt::Vertical ); 87 KButtonBox *bbox = new KButtonBox( group, Qt::Vertical );
84 mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) ); 88 mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) );
85 mRemoveButton = bbox->addButton( i18n( "Remove" ), this, SLOT( remove() ) ); 89 mRemoveButton = bbox->addButton( i18n( "Remove" ), this, SLOT( remove() ) );
@@ -94,14 +98,14 @@ NamePartWidget::NamePartWidget( const QString &title, QWidget *parent,
94 } 98 }
95 99
96 mAddButton->setEnabled( false ); 100 mAddButton->setEnabled( false );
97 mRemoveButton->setEnabled( false ); 101 mRemoveButton->setEnabled( false );
98 102
99 103
100 connect( mBox, SIGNAL( selectionChanged( QListBoxItem* ) ), 104 connect( mBox, SIGNAL( selectionChanged( Q3ListBoxItem* ) ),
101 SLOT( selectionChanged( QListBoxItem* ) ) ); 105 SLOT( selectionChanged( Q3ListBoxItem* ) ) );
102 connect( mEdit, SIGNAL( textChanged( const QString& ) ), 106 connect( mEdit, SIGNAL( textChanged( const QString& ) ),
103 SLOT( textChanged( const QString& ) ) ); 107 SLOT( textChanged( const QString& ) ) );
104 connect( mEdit, SIGNAL( returnPressed() ), SLOT( add() ) ); 108 connect( mEdit, SIGNAL( returnPressed() ), SLOT( add() ) );
105 109
106} 110}
107 111
@@ -140,13 +144,13 @@ void NamePartWidget::remove()
140 if ( mBox->count() == 0 ) 144 if ( mBox->count() == 0 )
141 selectionChanged( 0 ); 145 selectionChanged( 0 );
142 146
143 emit modified(); 147 emit modified();
144} 148}
145 149
146void NamePartWidget::selectionChanged( QListBoxItem *item ) 150void NamePartWidget::selectionChanged( Q3ListBoxItem *item )
147{ 151{
148 mRemoveButton->setEnabled( item != 0 ); 152 mRemoveButton->setEnabled( item != 0 );
149} 153}
150 154
151void NamePartWidget::textChanged( const QString& text ) 155void NamePartWidget::textChanged( const QString& text )
152{ 156{
@@ -154,13 +158,13 @@ void NamePartWidget::textChanged( const QString& text )
154} 158}
155 159
156 160
157AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name ) 161AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name )
158 : QWidget( parent, name ) 162 : QWidget( parent, name )
159{ 163{
160 QGridLayout *layout; 164 Q3GridLayout *layout;
161 165
162 mPrefix = new NamePartWidget( i18n( "Prefixes" ), this ); 166 mPrefix = new NamePartWidget( i18n( "Prefixes" ), this );
163 mInclusion = new NamePartWidget( i18n( "Inclusions" ), this ); 167 mInclusion = new NamePartWidget( i18n( "Inclusions" ), this );
164 mSuffix = new NamePartWidget( i18n( "Suffixes" ), this ); 168 mSuffix = new NamePartWidget( i18n( "Suffixes" ), this );
165 QString dfn; 169 QString dfn;
166 if (QApplication::desktop()->width() > 320 ) 170 if (QApplication::desktop()->width() > 320 )
@@ -175,25 +179,25 @@ AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name )
175 mFormattedNameCombo->insertItem( i18n( "Simple Name" ) ); 179 mFormattedNameCombo->insertItem( i18n( "Simple Name" ) );
176 mFormattedNameCombo->insertItem( i18n( "Full Name" ) ); 180 mFormattedNameCombo->insertItem( i18n( "Full Name" ) );
177 mFormattedNameCombo->insertItem( i18n( "Reverse Name" ) ); 181 mFormattedNameCombo->insertItem( i18n( "Reverse Name" ) );
178 182
179 if (KGlobal::getOrientation() == KGlobal::Portrait) 183 if (KGlobal::getOrientation() == KGlobal::Portrait)
180 { 184 {
181 layout = new QGridLayout( this, 4, 2, KDialog::marginHintSmall(), 185 layout = new Q3GridLayout( this, 4, 2, KDialog::marginHintSmall(),
182 KDialog::spacingHintSmall() ); 186 KDialog::spacingHintSmall() );
183 187
184 layout->addMultiCellWidget( mPrefix, 0, 0, 0, 1 ); 188 layout->addMultiCellWidget( mPrefix, 0, 0, 0, 1 );
185 layout->addMultiCellWidget( mInclusion, 1, 1, 0, 1 ); 189 layout->addMultiCellWidget( mInclusion, 1, 1, 0, 1 );
186 layout->addMultiCellWidget( mSuffix, 2, 2, 0, 1 ); 190 layout->addMultiCellWidget( mSuffix, 2, 2, 0, 1 );
187 layout->addWidget( label, 3, 0 ); 191 layout->addWidget( label, 3, 0 );
188 layout->addWidget( mFormattedNameCombo, 3, 1 ); 192 layout->addWidget( mFormattedNameCombo, 3, 1 );
189 193
190 } 194 }
191 else 195 else
192 { 196 {
193 layout = new QGridLayout( this, 2, 3, KDialog::marginHint(), 197 layout = new Q3GridLayout( this, 2, 3, KDialog::marginHint(),
194 KDialog::spacingHint() ); 198 KDialog::spacingHint() );
195 199
196 layout->addWidget( mPrefix, 0, 0 ); 200 layout->addWidget( mPrefix, 0, 0 );
197 layout->addWidget( mInclusion, 0, 1 ); 201 layout->addWidget( mInclusion, 0, 1 );
198 layout->addWidget( mSuffix, 0, 2 ); 202 layout->addWidget( mSuffix, 0, 2 );
199 layout->addWidget( label, 1, 0 ); 203 layout->addWidget( label, 1, 0 );
@@ -230,9 +234,9 @@ void AddresseeWidget::saveSettings()
230 config.writeEntry( "Prefixes", mPrefix->nameParts() ); 234 config.writeEntry( "Prefixes", mPrefix->nameParts() );
231 config.writeEntry( "Inclusions", mInclusion->nameParts() ); 235 config.writeEntry( "Inclusions", mInclusion->nameParts() );
232 config.writeEntry( "Suffixes", mSuffix->nameParts() ); 236 config.writeEntry( "Suffixes", mSuffix->nameParts() );
233 config.writeEntry( "FormattedNameType", mFormattedNameCombo->currentItem() ); 237 config.writeEntry( "FormattedNameType", mFormattedNameCombo->currentItem() );
234} 238}
235 239
236#ifndef KAB_EMBEDDED 240#ifndef KAB_EMBEDDED_
237#include "addresseewidget.moc" 241#include "moc_addresseewidget.cpp"
238#endif //KAB_EMBEDDED 242#endif //KAB_EMBEDDED
diff --git a/kaddressbook/kcmconfigs/addresseewidget.h b/kaddressbook/kcmconfigs/addresseewidget.h
index 09330c8..f2a95a8 100644
--- a/kaddressbook/kcmconfigs/addresseewidget.h
+++ b/kaddressbook/kcmconfigs/addresseewidget.h
@@ -26,14 +26,14 @@
26 26
27#include <qwidget.h> 27#include <qwidget.h>
28 28
29class KComboBox; 29class KComboBox;
30class KLineEdit; 30class KLineEdit;
31 31
32class QListBox; 32class Q3ListBox;
33class QListBoxItem; 33class Q3ListBoxItem;
34class QPushButton; 34class QPushButton;
35 35
36class NamePartWidget : public QWidget 36class NamePartWidget : public QWidget
37{ 37{
38 Q_OBJECT 38 Q_OBJECT
39 39
@@ -49,19 +49,19 @@ class NamePartWidget : public QWidget
49 void modified(); 49 void modified();
50 50
51 private slots: 51 private slots:
52 void add(); 52 void add();
53 void remove(); 53 void remove();
54 54
55 void selectionChanged( QListBoxItem* ); 55 void selectionChanged( Q3ListBoxItem* );
56 void textChanged( const QString& ); 56 void textChanged( const QString& );
57 57
58 private: 58 private:
59 KLineEdit *mEdit; 59 KLineEdit *mEdit;
60 60
61 QListBox *mBox; 61 Q3ListBox *mBox;
62 QPushButton *mAddButton; 62 QPushButton *mAddButton;
63 QPushButton *mRemoveButton; 63 QPushButton *mRemoveButton;
64}; 64};
65 65
66class AddresseeWidget : public QWidget 66class AddresseeWidget : public QWidget
67{ 67{
diff --git a/kaddressbook/kcmconfigs/extensionconfigdialog.cpp b/kaddressbook/kcmconfigs/extensionconfigdialog.cpp
index e87b000..33b66ad 100644
--- a/kaddressbook/kcmconfigs/extensionconfigdialog.cpp
+++ b/kaddressbook/kcmconfigs/extensionconfigdialog.cpp
@@ -19,26 +19,29 @@
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25//Added by qt3to4:
26#include <Q3GridLayout>
27#include <Q3Frame>
25 28
26#include <klocale.h> 29#include <klocale.h>
27 30
28#include "configurewidget.h" 31#include "configurewidget.h"
29 32
30#include "extensionconfigdialog.h" 33#include "extensionconfigdialog.h"
31 34
32ExtensionConfigDialog::ExtensionConfigDialog( ExtensionFactory *factory, KConfig *config, 35ExtensionConfigDialog::ExtensionConfigDialog( ExtensionFactory *factory, KConfig *config,
33 QWidget *parent, const char *name ) 36 QWidget *parent, const char *name )
34 : KDialogBase( Plain, i18n( "Extension Settings" ), Ok | Cancel, Ok, parent, 37 : KDialogBase( Plain, i18n( "Extension Settings" ), Ok | Cancel, Ok, parent,
35 name, true, true ), mWidget( 0 ), mConfig( config ) 38 name, true, true ), mWidget( 0 ), mConfig( config )
36{ 39{
37 QFrame *page = plainPage(); 40 Q3Frame *page = plainPage();
38 QGridLayout *layout = new QGridLayout( page, 1, 1, marginHint(), spacingHint() ); 41 Q3GridLayout *layout = new Q3GridLayout( page, 1, 1, marginHint(), spacingHint() );
39 42
40 mWidget = factory->configureWidget( page, "ExtensionConfigWidget" ); 43 mWidget = factory->configureWidget( page, "ExtensionConfigWidget" );
41 layout->addWidget( mWidget, 0, 0 ); 44 layout->addWidget( mWidget, 0, 0 );
42 45
43 mWidget->restoreSettings( mConfig ); 46 mWidget->restoreSettings( mConfig );
44} 47}
@@ -51,9 +54,9 @@ void ExtensionConfigDialog::slotOk()
51{ 54{
52 mWidget->saveSettings( mConfig ); 55 mWidget->saveSettings( mConfig );
53 56
54 KDialogBase::slotOk(); 57 KDialogBase::slotOk();
55} 58}
56 59
57#ifndef KAB_EMBEDDED 60#ifndef KAB_EMBEDDED_
58#include "extensionconfigdialog.moc" 61#include "moc_extensionconfigdialog.cpp"
59#endif //KAB_EMBEDDED 62#endif //KAB_EMBEDDED
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
index 9e4db74..d2b7ef1 100644
--- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp
+++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
@@ -19,22 +19,26 @@
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qcheckbox.h> 24#include <qcheckbox.h>
25#include <qframe.h> 25#include <q3frame.h>
26#include <qgroupbox.h> 26#include <q3groupbox.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qtabwidget.h> 29#include <qtabwidget.h>
30#include <qcombobox.h> 30#include <qcombobox.h>
31#include <qlineedit.h> 31#include <qlineedit.h>
32#include <qlabel.h> 32#include <qlabel.h>
33#include <qfile.h> 33#include <qfile.h>
34#include <qvbox.h> 34#include <q3vbox.h>
35//Added by qt3to4:
36#include <Q3HBoxLayout>
37#include <Q3PtrList>
38#include <Q3VBoxLayout>
35 39
36#include <kconfig.h> 40#include <kconfig.h>
37#include <kdebug.h> 41#include <kdebug.h>
38#include <kdialog.h> 42#include <kdialog.h>
39#include <klistview.h> 43#include <klistview.h>
40#include <klocale.h> 44#include <klocale.h>
@@ -54,21 +58,21 @@
54#include "extensionwidget.h" 58#include "extensionwidget.h"
55#include "kabprefs.h" 59#include "kabprefs.h"
56 60
57#include "kabconfigwidget.h" 61#include "kabconfigwidget.h"
58#include <kglobalsettings.h> 62#include <kglobalsettings.h>
59 63
60class ExtensionItem : public QCheckListItem 64class ExtensionItem : public Q3CheckListItem
61{ 65{
62 public: 66 public:
63 67
64#ifndef KAB_EMBEDDED 68#ifndef KAB_EMBEDDED
65 ExtensionItem( QListView *parent, const QString &text ); 69 ExtensionItem( Q3ListView *parent, const QString &text );
66 void setService( const KService::Ptr &ptr ); 70 void setService( const KService::Ptr &ptr );
67#else //KAB_EMBEDDED 71#else //KAB_EMBEDDED
68 ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment ); 72 ExtensionItem( Q3ListView *parent, const QString &text, const QString &name, const QString &comment );
69 void setFactory( ExtensionFactory* fac ); 73 void setFactory( ExtensionFactory* fac );
70#endif //KAB_EMBEDDED 74#endif //KAB_EMBEDDED
71 75
72 bool configWidgetAvailable() const; 76 bool configWidgetAvailable() const;
73 ExtensionFactory *factory() const; 77 ExtensionFactory *factory() const;
74 78
@@ -87,26 +91,26 @@ class ExtensionItem : public QCheckListItem
87}; 91};
88 92
89KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *name ) 93KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *name )
90 : KPrefsWidget( prefs, parent, name ) 94 : KPrefsWidget( prefs, parent, name )
91{ 95{
92 96
93 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 97 Q3VBoxLayout *topLayout = new Q3VBoxLayout( this, 0,
94 KDialog::spacingHintSmall() ); 98 KDialog::spacingHintSmall() );
95 99
96 QTabWidget *tabWidget = new QTabWidget( this ); 100 QTabWidget *tabWidget = new QTabWidget( this );
97 topLayout->addWidget( tabWidget ); 101 topLayout->addWidget( tabWidget );
98 102
99 // General page 103 // General page
100 QWidget *generalPage = new QWidget( this ); 104 QWidget *generalPage = new QWidget( this );
101 QVBoxLayout *layout = new QVBoxLayout( generalPage, KDialog::marginHintSmall(), 105 Q3VBoxLayout *layout = new Q3VBoxLayout( generalPage, KDialog::marginHintSmall(),
102 KDialog::spacingHintSmall() ); 106 KDialog::spacingHintSmall() );
103 107
104 108
105 QWidget *hBox = new QWidget( generalPage, "qhbox" ); 109 QWidget *hBox = new QWidget( generalPage, "qhbox" );
106 QHBoxLayout *hboxLayout = new QHBoxLayout( hBox); 110 Q3HBoxLayout *hboxLayout = new Q3HBoxLayout( hBox);
107 KPrefsWidFont *detailsFont = 111 KPrefsWidFont *detailsFont =
108 addWidFont(i18n("phone:123"),i18n("Details view font"), 112 addWidFont(i18n("phone:123"),i18n("Details view font"),
109 &(KABPrefs::instance()->mDetailsFont),hBox); 113 &(KABPrefs::instance()->mDetailsFont),hBox);
110 hboxLayout->addWidget(detailsFont->label()); 114 hboxLayout->addWidget(detailsFont->label());
111 hboxLayout->addWidget(detailsFont->preview()); 115 hboxLayout->addWidget(detailsFont->preview());
112 hboxLayout->addWidget(detailsFont->button()); 116 hboxLayout->addWidget(detailsFont->button());
@@ -114,13 +118,13 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *
114 hboxLayout->setSpacing(KDialog::spacingHintSmall()); 118 hboxLayout->setSpacing(KDialog::spacingHintSmall());
115 //hBox->setBackgroundColor( black); 119 //hBox->setBackgroundColor( black);
116 layout->addWidget( hBox ); 120 layout->addWidget( hBox );
117 121
118 //general groupbox 122 //general groupbox
119 QWidget *vBox = new QWidget( generalPage, "qvbox" ); 123 QWidget *vBox = new QWidget( generalPage, "qvbox" );
120 QVBoxLayout *boxLayout = new QVBoxLayout( vBox ); 124 Q3VBoxLayout *boxLayout = new Q3VBoxLayout( vBox );
121 boxLayout->setAlignment( Qt::AlignTop ); 125 boxLayout->setAlignment( Qt::AlignTop );
122 boxLayout->setMargin(KDialog::marginHintSmall() ); 126 boxLayout->setMargin(KDialog::marginHintSmall() );
123 boxLayout->setSpacing( KDialog::spacingHintSmall() ); 127 boxLayout->setSpacing( KDialog::spacingHintSmall() );
124 mMenuBarBox = new QCheckBox( i18n( "Full Menu bar (restart)" ), vBox, "mremenuturn" ); 128 mMenuBarBox = new QCheckBox( i18n( "Full Menu bar (restart)" ), vBox, "mremenuturn" );
125 boxLayout->addWidget( mMenuBarBox ); 129 boxLayout->addWidget( mMenuBarBox );
126 mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" ); 130 mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" );
@@ -151,19 +155,19 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *
151 layout->addWidget( vBox ); 155 layout->addWidget( vBox );
152 156
153 tabWidget->addTab( generalPage, i18n( "General" ) ); 157 tabWidget->addTab( generalPage, i18n( "General" ) );
154 158
155 // Extension page 159 // Extension page
156 QWidget *extensionPage = new QWidget( this ); 160 QWidget *extensionPage = new QWidget( this );
157 QVBoxLayout *extensionLayout = new QVBoxLayout( extensionPage, KDialog::marginHintSmall(), 161 Q3VBoxLayout *extensionLayout = new Q3VBoxLayout( extensionPage, KDialog::marginHintSmall(),
158 KDialog::spacingHintSmall() ); 162 KDialog::spacingHintSmall() );
159 163
160 //extensions groupbox 164 //extensions groupbox
161 165
162 QGroupBox* groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Extensions (restart)" ), extensionPage ); 166 Q3GroupBox* groupBox = new Q3GroupBox( 0, Qt::Vertical, i18n( "Extensions (restart)" ), extensionPage );
163 boxLayout = new QVBoxLayout( groupBox->layout() ); 167 boxLayout = new Q3VBoxLayout( groupBox->layout() );
164 boxLayout->setAlignment( Qt::AlignTop ); 168 boxLayout->setAlignment( Qt::AlignTop );
165 boxLayout->setMargin(KDialog::marginHintSmall()); 169 boxLayout->setMargin(KDialog::marginHintSmall());
166 boxLayout->setSpacing(KDialog::spacingHintSmall()); 170 boxLayout->setSpacing(KDialog::spacingHintSmall());
167 groupBox->layout()->setMargin(1) ; 171 groupBox->layout()->setMargin(1) ;
168 groupBox->layout()->setSpacing(0); 172 groupBox->layout()->setSpacing(0);
169 mExtensionView = new KListView( groupBox ); 173 mExtensionView = new KListView( groupBox );
@@ -186,16 +190,16 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *
186 connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 190 connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
187 connect( mAutoSearchWithWildcardBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 191 connect( mAutoSearchWithWildcardBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
188 connect( mHideSearchOnSwitchBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 192 connect( mHideSearchOnSwitchBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
189 connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 193 connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
190 connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 194 connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
191 connect( mAskForDelete, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 195 connect( mAskForDelete, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
192 connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ), 196 connect( mExtensionView, SIGNAL( selectionChanged( Q3ListViewItem* ) ),
193 SLOT( selectionChanged( QListViewItem* ) ) ); 197 SLOT( selectionChanged( Q3ListViewItem* ) ) );
194 connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ), 198 connect( mExtensionView, SIGNAL( clicked( Q3ListViewItem* ) ),
195 SLOT( itemClicked( QListViewItem* ) ) ); 199 SLOT( itemClicked( Q3ListViewItem* ) ) );
196 connect( mConfigureButton, SIGNAL( clicked() ), 200 connect( mConfigureButton, SIGNAL( clicked() ),
197 SLOT( configureExtension() ) ); 201 SLOT( configureExtension() ) );
198 202
199 tabWidget->addTab( extensionPage, i18n( "Extensions" ) ); 203 tabWidget->addTab( extensionPage, i18n( "Extensions" ) );
200 204
201 // Addressee page 205 // Addressee page
@@ -292,14 +296,14 @@ void KABConfigWidget::restoreExtensionSettings()
292} 296}
293 297
294void KABConfigWidget::saveExtensionSettings() 298void KABConfigWidget::saveExtensionSettings()
295{ 299{
296 QStringList activeExtensions; 300 QStringList activeExtensions;
297 301
298 QPtrList<QListViewItem> list; 302 Q3PtrList<Q3ListViewItem> list;
299 QListViewItemIterator it( mExtensionView ); 303 Q3ListViewItemIterator it( mExtensionView );
300 while ( it.current() ) { 304 while ( it.current() ) {
301 ExtensionItem *item = static_cast<ExtensionItem*>( it.current() ); 305 ExtensionItem *item = static_cast<ExtensionItem*>( it.current() );
302 if ( item ) { 306 if ( item ) {
303 if ( item->isOn() ) 307 if ( item->isOn() )
304 activeExtensions.append( item->factory()->identifier() ); 308 activeExtensions.append( item->factory()->identifier() );
305 } 309 }
@@ -325,40 +329,40 @@ void KABConfigWidget::configureExtension()
325 ExtensionConfigDialog dlg( item->factory(), &config, this ); 329 ExtensionConfigDialog dlg( item->factory(), &config, this );
326 dlg.exec(); 330 dlg.exec();
327 331
328 config.sync(); 332 config.sync();
329} 333}
330 334
331void KABConfigWidget::selectionChanged( QListViewItem *i ) 335void KABConfigWidget::selectionChanged( Q3ListViewItem *i )
332{ 336{
333 ExtensionItem *item = static_cast<ExtensionItem*>( i ); 337 ExtensionItem *item = static_cast<ExtensionItem*>( i );
334 if ( !item ) 338 if ( !item )
335 return; 339 return;
336 340
337 mConfigureButton->setEnabled( item->configWidgetAvailable() ); 341 mConfigureButton->setEnabled( item->configWidgetAvailable() );
338} 342}
339 343
340void KABConfigWidget::itemClicked( QListViewItem *item ) 344void KABConfigWidget::itemClicked( Q3ListViewItem *item )
341{ 345{
342 if ( item != 0 ) 346 if ( item != 0 )
343 modified(); 347 modified();
344} 348}
345 349
346#ifndef KAB_EMBEDDED 350#ifndef KAB_EMBEDDED
347ExtensionItem::ExtensionItem( QListView *parent, const QString &text ) 351ExtensionItem::ExtensionItem( Q3ListView *parent, const QString &text )
348 : QCheckListItem( parent, text, CheckBox ) 352 : Q3CheckListItem( parent, text, CheckBox )
349{ 353{
350} 354}
351 355
352void ExtensionItem::setService( const KService::Ptr &ptr ) 356void ExtensionItem::setService( const KService::Ptr &ptr )
353{ 357{
354 mPtr = ptr; 358 mPtr = ptr;
355} 359}
356#else //KAB_EMBEDDED 360#else //KAB_EMBEDDED
357ExtensionItem::ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment ) 361ExtensionItem::ExtensionItem( Q3ListView *parent, const QString &text, const QString &name, const QString &comment )
358 : QCheckListItem( parent, text, CheckBox ) 362 : Q3CheckListItem( parent, text, CheckBox )
359{ 363{
360 mName = name; 364 mName = name;
361 mComment = comment; 365 mComment = comment;
362} 366}
363 367
364 368
@@ -415,10 +419,9 @@ QString ExtensionItem::text( int column ) const
415 return mComment; 419 return mComment;
416 else 420 else
417 return QString::null; 421 return QString::null;
418#endif //KAB_EMBEDDED 422#endif //KAB_EMBEDDED
419} 423}
420 424
421#ifndef KAB_EMBEDDED 425#ifndef KAB_EMBEDDED_
422#include "kabconfigwidget.moc" 426#include "moc_kabconfigwidget.cpp"
423#endif //KAB_EMBEDDED 427#endif //KAB_EMBEDDED
424
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.h b/kaddressbook/kcmconfigs/kabconfigwidget.h
index f2a6b1b..4b6e58c 100644
--- a/kaddressbook/kcmconfigs/kabconfigwidget.h
+++ b/kaddressbook/kcmconfigs/kabconfigwidget.h
@@ -24,13 +24,13 @@
24#ifndef KABCONFIGWIDGET_H 24#ifndef KABCONFIGWIDGET_H
25#define KABCONFIGWIDGET_H 25#define KABCONFIGWIDGET_H
26 26
27#include <kprefswidget.h> 27#include <kprefswidget.h>
28 28
29class QCheckBox; 29class QCheckBox;
30class QListViewItem; 30class Q3ListViewItem;
31class QPushButton; 31class QPushButton;
32class QComboBox; 32class QComboBox;
33class QLineEdit; 33class QLineEdit;
34class KListView; 34class KListView;
35class KABPrefs; 35class KABPrefs;
36 36
@@ -50,14 +50,14 @@ class KABConfigWidget : public KPrefsWidget
50 virtual void usrWriteConfig(); 50 virtual void usrWriteConfig();
51 51
52 52
53 53
54 private slots: 54 private slots:
55 void configureExtension(); 55 void configureExtension();
56 void selectionChanged( QListViewItem* ); 56 void selectionChanged( Q3ListViewItem* );
57 void itemClicked( QListViewItem* ); 57 void itemClicked( Q3ListViewItem* );
58 58
59 private: 59 private:
60 void restoreExtensionSettings(); 60 void restoreExtensionSettings();
61 void saveExtensionSettings(); 61 void saveExtensionSettings();
62 62
63 KListView *mExtensionView; 63 KListView *mExtensionView;
diff --git a/kaddressbook/kcmconfigs/kcmkabconfig.cpp b/kaddressbook/kcmconfigs/kcmkabconfig.cpp
index cbfedbd..55ffcd8 100644
--- a/kaddressbook/kcmconfigs/kcmkabconfig.cpp
+++ b/kaddressbook/kcmconfigs/kcmkabconfig.cpp
@@ -19,12 +19,14 @@
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25//Added by qt3to4:
26#include <Q3VBoxLayout>
25 27
26#ifndef KAB_EMBEDDED 28#ifndef KAB_EMBEDDED
27#include <kaboutdata.h> 29#include <kaboutdata.h>
28#endif //KAB_EMBEDDED 30#endif //KAB_EMBEDDED
29#include <kdebug.h> 31#include <kdebug.h>
30//#include <klocale.h> 32//#include <klocale.h>
@@ -45,13 +47,13 @@ extern "C"
45} 47}
46 48
47KCMKabConfig::KCMKabConfig( QWidget *parent, const char *name ) 49KCMKabConfig::KCMKabConfig( QWidget *parent, const char *name )
48 : KCModule( KABPrefs::instance(), parent, name ) 50 : KCModule( KABPrefs::instance(), parent, name )
49{ 51{
50 //abort(); 52 //abort();
51 QVBoxLayout *layout = new QVBoxLayout( this ); 53 Q3VBoxLayout *layout = new Q3VBoxLayout( this );
52 mConfigWidget = new KABConfigWidget( (KABPrefs*)getPreferences(), this, "KABConfigWidget" ); 54 mConfigWidget = new KABConfigWidget( (KABPrefs*)getPreferences(), this, "KABConfigWidget" );
53 layout->addWidget( mConfigWidget ); 55 layout->addWidget( mConfigWidget );
54 layout->setSpacing( 0 ); 56 layout->setSpacing( 0 );
55 layout->setMargin( 0 ); 57 layout->setMargin( 0 );
56 58
57 connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) ); 59 connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) );
@@ -84,9 +86,9 @@ const KAboutData* KCMKabConfig::aboutData() const
84 86
85 return about; 87 return about;
86 88
87} 89}
88#endif //KAB_EMBEDDED 90#endif //KAB_EMBEDDED
89 91
90#ifndef KAB_EMBEDDED 92#ifndef KAB_EMBEDDED_
91#include "kcmkabconfig.moc" 93#include "moc_kcmkabconfig.cpp"
92#endif //KAB_EMBEDDED 94#endif //KAB_EMBEDDED
diff --git a/kaddressbook/keywidget.cpp b/kaddressbook/keywidget.cpp
index c117d34..8ebee19 100644
--- a/kaddressbook/keywidget.cpp
+++ b/kaddressbook/keywidget.cpp
@@ -25,21 +25,23 @@
25 25
26#include <qinputdialog.h> 26#include <qinputdialog.h>
27 27
28#include <qlabel.h> 28#include <qlabel.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qpushbutton.h> 30#include <qpushbutton.h>
31//Added by qt3to4:
32#include <Q3GridLayout>
31 33
32#ifndef KAB_EMBEDDED 34#ifndef KAB_EMBEDDED
33#include <kaccelmanager.h> 35#include <kaccelmanager.h>
34#include <kio/netaccess.h> 36#include <kio/netaccess.h>
35#include <kmessagebox.h> 37#include <kmessagebox.h>
36#else //KAB_EMBEDDED 38#else //KAB_EMBEDDED
37#include <qmap.h> 39#include <qmap.h>
38#include <qmessagebox.h> 40#include <qmessagebox.h>
39#include <qtextstream.h> 41#include <q3textstream.h>
40#include <kurl.h> 42#include <kurl.h>
41#endif //KAB_EMBEDDED 43#endif //KAB_EMBEDDED
42 44
43#include <kapplication.h> 45#include <kapplication.h>
44#include <kcombobox.h> 46#include <kcombobox.h>
45#include <kdialog.h> 47#include <kdialog.h>
@@ -49,13 +51,13 @@
49 51
50#include "keywidget.h" 52#include "keywidget.h"
51 53
52KeyWidget::KeyWidget( QWidget *parent, const char *name ) 54KeyWidget::KeyWidget( QWidget *parent, const char *name )
53 : QWidget( parent, name ) 55 : QWidget( parent, name )
54{ 56{
55 QGridLayout *layout = new QGridLayout( this, 2, 2, KDialog::marginHint(), 57 Q3GridLayout *layout = new Q3GridLayout( this, 2, 2, KDialog::marginHint(),
56 KDialog::spacingHint() ); 58 KDialog::spacingHint() );
57 59
58 QLabel *label = new QLabel( i18n( "Keys:" ), this ); 60 QLabel *label = new QLabel( i18n( "Keys:" ), this );
59 layout->addWidget( label, 0, 0 ); 61 layout->addWidget( label, 0, 0 );
60 62
61 mKeyCombo = new KComboBox( this ); 63 mKeyCombo = new KComboBox( this );
@@ -133,13 +135,13 @@ void KeyWidget::addKey()
133 if ( url.isEmpty() ) 135 if ( url.isEmpty() )
134 return; 136 return;
135 137
136 QString tmpFile; 138 QString tmpFile;
137 if ( KIO::NetAccess::download( url, tmpFile ) ) { 139 if ( KIO::NetAccess::download( url, tmpFile ) ) {
138 QFile file( tmpFile ); 140 QFile file( tmpFile );
139 if ( !file.open( IO_ReadOnly ) ) { 141 if ( !file.open( QIODevice::ReadOnly ) ) {
140 QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) ); 142 QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) );
141 KMessageBox::error( this, text.arg( url.url() ) ); 143 KMessageBox::error( this, text.arg( url.url() ) );
142 return; 144 return;
143 } 145 }
144 146
145 147
@@ -149,27 +151,27 @@ void KeyWidget::addKey()
149 151
150 if ( keyfile.isEmpty() ) 152 if ( keyfile.isEmpty() )
151 return; 153 return;
152 154
153 { 155 {
154 QFile file( keyfile ); 156 QFile file( keyfile );
155 if ( !file.open( IO_ReadOnly ) ) { 157 if ( !file.open( QIODevice::ReadOnly ) ) {
156 QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) ); 158 QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) );
157 QString caption( i18n( "Error" ) ); 159 QString caption( i18n( "Error" ) );
158 QMessageBox::critical( this, caption, text.arg( keyfile ) ); 160 QMessageBox::critical( this, caption, text.arg( keyfile ) );
159 return; 161 return;
160 } 162 }
161 163
162#endif //KAB_EMBEDDED 164#endif //KAB_EMBEDDED
163 165
164 166
165 167
166 QTextStream s( &file ); 168 Q3TextStream s( &file );
167 QString data; 169 QString data;
168 170
169 s.setEncoding( QTextStream::UnicodeUTF8 ); 171 s.setEncoding( Q3TextStream::UnicodeUTF8 );
170 s >> data; 172 s >> data;
171 file.close(); 173 file.close();
172 174
173 KABC::Key key( data, type ); 175 KABC::Key key( data, type );
174 if ( type == KABC::Key::Custom ) 176 if ( type == KABC::Key::Custom )
175 key.setCustomTypeString( name ); 177 key.setCustomTypeString( name );
@@ -218,35 +220,35 @@ void KeyWidget::exportKey()
218 KABC::Key key = (*mKeyList.at( mKeyCombo->currentItem() ) ); 220 KABC::Key key = (*mKeyList.at( mKeyCombo->currentItem() ) );
219 221
220#ifndef KAB_EMBEDDED 222#ifndef KAB_EMBEDDED
221 KURL url = KFileDialog::getSaveURL(); 223 KURL url = KFileDialog::getSaveURL();
222 224
223 KTempFile tempFile; 225 KTempFile tempFile;
224 QTextStream *s = tempFile.textStream(); 226 Q3TextStream *s = tempFile.textStream();
225 s->setEncoding( QTextStream::UnicodeUTF8 ); 227 s->setEncoding( Q3TextStream::UnicodeUTF8 );
226 (*s) << key.textData(); 228 (*s) << key.textData();
227 tempFile.close(); 229 tempFile.close();
228 230
229 KIO::NetAccess::upload( tempFile.name(), url, kapp->mainWidget() ); 231 KIO::NetAccess::upload( tempFile.name(), url, kapp->mainWidget() );
230#else //KAB_EMBEDDED 232#else //KAB_EMBEDDED
231 QString keyfile = KFileDialog::getSaveFileName( "huhu", 233 QString keyfile = KFileDialog::getSaveFileName( "huhu",
232 "Save Key", this ); 234 "Save Key", this );
233 235
234 if ( keyfile.isEmpty() ) 236 if ( keyfile.isEmpty() )
235 return; 237 return;
236 238
237 QFile file( keyfile ); 239 QFile file( keyfile );
238 if ( !file.open( IO_ReadWrite ) ) { 240 if ( !file.open( QIODevice::ReadWrite ) ) {
239 QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) ); 241 QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) );
240 QString caption( i18n( "Error" ) ); 242 QString caption( i18n( "Error" ) );
241 QMessageBox::critical( this, caption, text.arg( keyfile ) ); 243 QMessageBox::critical( this, caption, text.arg( keyfile ) );
242 return; 244 return;
243 } 245 }
244 246
245 QTextStream s( &file ); 247 Q3TextStream s( &file );
246 s.setEncoding( QTextStream::UnicodeUTF8 ); 248 s.setEncoding( Q3TextStream::UnicodeUTF8 );
247 s << key.textData(); 249 s << key.textData();
248 file.close(); 250 file.close();
249 251
250 252
251#endif //KAB_EMBEDDED 253#endif //KAB_EMBEDDED
252 254
@@ -269,9 +271,9 @@ void KeyWidget::updateKeyCombo()
269 271
270 bool state = ( mKeyList.count() != 0 ); 272 bool state = ( mKeyList.count() != 0 );
271 mRemoveButton->setEnabled( state ); 273 mRemoveButton->setEnabled( state );
272 mExportButton->setEnabled( state ); 274 mExportButton->setEnabled( state );
273} 275}
274 276
275#ifndef KAB_EMBEDDED 277#ifndef KAB_EMBEDDED_
276#include "keywidget.moc" 278#include "moc_keywidget.cpp"
277#endif //KAB_EMBEDDED 279#endif //KAB_EMBEDDED
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index 2f3531d..e373105 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -2,14 +2,13 @@
2#include <qpe/qpeapplication.h> 2#include <qpe/qpeapplication.h>
3#include <qcopchannel_qws.h> 3#include <qcopchannel_qws.h>
4#include <stdlib.h> 4#include <stdlib.h>
5#else 5#else
6#include <qapplication.h> 6#include <qapplication.h>
7#include <qwindowsstyle.h> 7#include <qwindowsstyle.h>
8#include <qplatinumstyle.h> 8#include <q3mainwindow.h>
9#include <qmainwindow.h>
10#include <qmessagebox.h> 9#include <qmessagebox.h>
11#include <stdlib.h> 10#include <stdlib.h>
12#endif 11#endif
13 12
14#include <qtextcodec.h> 13#include <qtextcodec.h>
15#include <kstandarddirs.h> 14#include <kstandarddirs.h>
@@ -21,18 +20,18 @@
21#include "kaddressbookmain.h" 20#include "kaddressbookmain.h"
22#include "externalapphandler.h" 21#include "externalapphandler.h"
23#include <libkdepim/kpimglobalprefs.h> 22#include <libkdepim/kpimglobalprefs.h>
24void dumpMissing(); 23void dumpMissing();
25int main( int argc, char **argv ) 24int main( int argc, char **argv )
26{ 25{
26 if(!getenv("QPEDIR")) putenv("QPEDIR=/usr/lib/kdepimpi");
27#ifndef DESKTOP_VERSION 27#ifndef DESKTOP_VERSION
28 QPEApplication a( argc, argv ); 28 QPEApplication a( argc, argv );
29 a.setKeepRunning (); 29 a.setKeepRunning ();
30#else 30#else
31 QApplication a( argc, argv ); 31 QApplication a( argc, argv );
32 QApplication::setStyle( new QPlatinumStyle ());
33#ifdef _WIN32_ 32#ifdef _WIN32_
34 QString hdir ( getenv( "HOME") ); 33 QString hdir ( getenv( "HOME") );
35 if ( hdir.isEmpty() ) { 34 if ( hdir.isEmpty() ) {
36 QString hd ("C:/" ); 35 QString hd ("C:/" );
37 //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); 36 //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd );
38 if ( QDir::homeDirPath().lower() == hd.lower() ) { 37 if ( QDir::homeDirPath().lower() == hd.lower() ) {
diff --git a/kaddressbook/nameeditdialog.cpp b/kaddressbook/nameeditdialog.cpp
index 199f3d6..96822d8 100644
--- a/kaddressbook/nameeditdialog.cpp
+++ b/kaddressbook/nameeditdialog.cpp
@@ -20,18 +20,20 @@
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qlistbox.h> 26#include <q3listbox.h>
27#include <qlistview.h> 27#include <q3listview.h>
28#include <qtooltip.h> 28#include <qtooltip.h>
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30#include <qcheckbox.h> 30#include <qcheckbox.h>
31#include <qstring.h> 31#include <qstring.h>
32//Added by qt3to4:
33#include <Q3GridLayout>
32 34
33#ifndef KAB_EMBEDDED 35#ifndef KAB_EMBEDDED
34#include <kaccelmanager.h> 36#include <kaccelmanager.h>
35#else //KAB_EMBEDDED 37#else //KAB_EMBEDDED
36#include <kstandarddirs.h> 38#include <kstandarddirs.h>
37#endif //KAB_EMBEDDED 39#endif //KAB_EMBEDDED
@@ -54,13 +56,13 @@ NameEditDialog::NameEditDialog( const KABC::Addressee &addr, int type,
54 QWidget *parent, const char *name ) 56 QWidget *parent, const char *name )
55 : KDialogBase( Plain, i18n( "Edit Contact Name" ), Help | Ok | Cancel, 57 : KDialogBase( Plain, i18n( "Edit Contact Name" ), Help | Ok | Cancel,
56 Ok, parent, name, true ) 58 Ok, parent, name, true )
57{ 59{
58 60
59 QWidget *page = plainPage(); 61 QWidget *page = plainPage();
60 QGridLayout *layout = new QGridLayout( page, 5, 3 ); 62 Q3GridLayout *layout = new Q3GridLayout( page, 5, 3 );
61 layout->setSpacing( spacingHint() ); 63 layout->setSpacing( spacingHint() );
62 layout->addColSpacing( 2, 100 ); 64 layout->addColSpacing( 2, 100 );
63 QLabel *label; 65 QLabel *label;
64 66
65 label = new QLabel( i18n( "Honorific prefixes:" ), page ); 67 label = new QLabel( i18n( "Honorific prefixes:" ), page );
66 layout->addWidget( label, 0, 0 ); 68 layout->addWidget( label, 0, 0 );
@@ -292,9 +294,9 @@ void NameEditDialog::slotHelp()
292 kapp->invokeHelp( "managing-contacts-automatic-nameparsing" ); 294 kapp->invokeHelp( "managing-contacts-automatic-nameparsing" );
293#else //KAB_EMBEDDED 295#else //KAB_EMBEDDED
294qDebug("NameEditDialog::slotHelp Help is not supported yet"); 296qDebug("NameEditDialog::slotHelp Help is not supported yet");
295#endif //KAB_EMBEDDED 297#endif //KAB_EMBEDDED
296} 298}
297 299
298#ifndef KAB_EMBEDDED 300#ifndef KAB_EMBEDDED_
299#include "nameeditdialog.moc" 301#include "moc_nameeditdialog.cpp"
300#endif //KAB_EMBEDDED 302#endif //KAB_EMBEDDED
diff --git a/kaddressbook/old_mainwindow.cpp b/kaddressbook/old_mainwindow.cpp
index 0e886d9..7a445c7 100644
--- a/kaddressbook/old_mainwindow.cpp
+++ b/kaddressbook/old_mainwindow.cpp
@@ -313,19 +313,19 @@ QPixmap MainWindow::loadPixmap( QString name )
313 313
314void MainWindow::initActions() 314void MainWindow::initActions()
315{ 315{
316 iconToolBar->clear(); 316 iconToolBar->clear();
317 KABPrefs *p = KABPrefs::instance(); 317 KABPrefs *p = KABPrefs::instance();
318 QPEMenuBar *menuBar1 = new QPEMenuBar( iconToolBar ); 318 QPEMenuBar *menuBar1 = new QPEMenuBar( iconToolBar );
319 QPopupMenu *menuBar = new QPopupMenu( this ); 319 Q3PopupMenu *menuBar = new Q3PopupMenu( this );
320 menuBar1->insertItem( "ME", menuBar); 320 menuBar1->insertItem( "ME", menuBar);
321 QPopupMenu *fileMenu = new QPopupMenu( this ); 321 Q3PopupMenu *fileMenu = new Q3PopupMenu( this );
322 QPopupMenu *editMenu = new QPopupMenu( this ); 322 Q3PopupMenu *editMenu = new Q3PopupMenu( this );
323 QPopupMenu *viewMenu = new QPopupMenu( this ); 323 Q3PopupMenu *viewMenu = new Q3PopupMenu( this );
324 QPopupMenu *settingsMenu = new QPopupMenu( this ); 324 Q3PopupMenu *settingsMenu = new Q3PopupMenu( this );
325 QPopupMenu *importMenu = new QPopupMenu( this ); 325 Q3PopupMenu *importMenu = new Q3PopupMenu( this );
326 326
327 menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 327 menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
328 328
329 QIconSet icon; 329 QIconSet icon;
330 330
331 331
diff --git a/kaddressbook/phoneeditwidget.cpp b/kaddressbook/phoneeditwidget.cpp
index df3b551..3661677 100644
--- a/kaddressbook/phoneeditwidget.cpp
+++ b/kaddressbook/phoneeditwidget.cpp
@@ -24,19 +24,25 @@
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qtooltip.h> 26#include <qtooltip.h>
27#include <qpushbutton.h> 27#include <qpushbutton.h>
28#include <qcheckbox.h> 28#include <qcheckbox.h>
29#include <qstring.h> 29#include <qstring.h>
30#include <qlistbox.h> 30#include <q3listbox.h>
31#include <qlistview.h> 31#include <q3listview.h>
32#include <qbuttongroup.h> 32#include <q3buttongroup.h>
33#include <qhbox.h> 33#include <q3hbox.h>
34#include <qcursor.h> 34#include <qcursor.h>
35#include <qtimer.h> 35#include <qtimer.h>
36#include <qapplication.h> 36#include <qapplication.h>
37//Added by qt3to4:
38#include <Q3ValueList>
39#include <Q3GridLayout>
40#include <Q3Frame>
41#include <Q3PopupMenu>
42#include <Q3VBoxLayout>
37 43
38#include <kbuttonbox.h> 44#include <kbuttonbox.h>
39#include <klistview.h> 45#include <klistview.h>
40#include <kapplication.h> 46#include <kapplication.h>
41#include <qapplication.h> 47#include <qapplication.h>
42#include <kconfig.h> 48#include <kconfig.h>
@@ -54,30 +60,30 @@
54 60
55#include "phoneeditwidget.h" 61#include "phoneeditwidget.h"
56 62
57PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) 63PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name )
58 : QWidget(parent,name) 64 : QWidget(parent,name)
59{ 65{
60 QGridLayout* gridLayout = new QGridLayout ( this, 2,2 ); 66 Q3GridLayout* gridLayout = new Q3GridLayout ( this, 2,2 );
61 67
62 QLabel *temp = new QLabel( "", this ); 68 QLabel *temp = new QLabel( "", this );
63 temp->setAlignment( Qt::AlignCenter ); 69 temp->setAlignment( Qt::AlignCenter );
64 temp->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); 70 temp->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) );
65 QPushButton *addBut = new QPushButton ( "add", this ); 71 QPushButton *addBut = new QPushButton ( "add", this );
66 addBut->setPixmap ( SmallIcon("plus")); 72 addBut->setPixmap ( SmallIcon("plus"));
67 addBut->setMaximumSize( addBut->sizeHint().height(),addBut->sizeHint().height() ); 73 addBut->setMaximumSize( addBut->sizeHint().height(),addBut->sizeHint().height() );
68 connect(addBut,SIGNAL(clicked ()),SLOT(addNumber())); 74 connect(addBut,SIGNAL(clicked ()),SLOT(addNumber()));
69 75
70 sv = new QScrollView( this ); 76 sv = new Q3ScrollView( this );
71 sv->setFrameStyle ( QFrame::Plain ); 77 sv->setFrameStyle ( Q3Frame::Plain );
72 sv->setLineWidth ( 0 ); 78 sv->setLineWidth ( 0 );
73 sv->setMidLineWidth ( 0 ); 79 sv->setMidLineWidth ( 0 );
74 mw = new QWidget ( sv->viewport() ); 80 mw = new QWidget ( sv->viewport() );
75 sv->addChild(mw); 81 sv->addChild(mw);
76 sv->setResizePolicy( QScrollView::AutoOneFit ); 82 sv->setResizePolicy( Q3ScrollView::AutoOneFit );
77 mainLayout = new QVBoxLayout ( mw ); 83 mainLayout = new Q3VBoxLayout ( mw );
78 mainLayout->setMargin( 0 ); 84 mainLayout->setMargin( 0 );
79 mainLayout->setSpacing( 0 ); 85 mainLayout->setSpacing( 0 );
80 gridLayout->setMargin( 2 ); 86 gridLayout->setMargin( 2 );
81 gridLayout->setSpacing( 4 ); 87 gridLayout->setSpacing( 4 );
82 if ( QApplication::desktop()->width() == 240 || QApplication::desktop()->width() == 480 ) { 88 if ( QApplication::desktop()->width() == 240 || QApplication::desktop()->width() == 480 ) {
83 gridLayout->addWidget( addBut, 0, 0 ); 89 gridLayout->addWidget( addBut, 0, 0 );
@@ -87,13 +93,13 @@ PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name )
87 gridLayout->addWidget( temp, 1, 0 ); 93 gridLayout->addWidget( temp, 1, 0 );
88 gridLayout->addWidget( addBut, 0, 0 ); 94 gridLayout->addWidget( addBut, 0, 0 );
89 gridLayout->addMultiCellWidget( sv, 0, 1, 1,1 ); 95 gridLayout->addMultiCellWidget( sv, 0, 1, 1,1 );
90 } 96 }
91 setDefaults(); 97 setDefaults();
92 mTypeNumberEditList.setAutoDelete( true ); 98 mTypeNumberEditList.setAutoDelete( true );
93 mPopup = new QPopupMenu( this ); 99 mPopup = new Q3PopupMenu( this );
94 QStringList list = PhoneNumber::supportedTypeListNames(); 100 QStringList list = PhoneNumber::supportedTypeListNames();
95 mPopupCount = list.count(); 101 mPopupCount = list.count();
96 int i = 0; 102 int i = 0;
97 while ( i < mPopupCount ) { 103 while ( i < mPopupCount ) {
98 mPopup->insertItem( list[ i ], i ); 104 mPopup->insertItem( list[ i ], i );
99 ++i; 105 ++i;
@@ -223,23 +229,23 @@ KABC::PhoneNumber::List PhoneEditWidget::phoneNumbers()
223} 229}
224 230
225#if 0 231#if 0
226PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) 232PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name )
227 : QWidget( parent, name ) 233 : QWidget( parent, name )
228{ 234{
229 QGridLayout *layout = new QGridLayout( this, 4, 1 ); 235 Q3GridLayout *layout = new Q3GridLayout( this, 4, 1 );
230//US layout->setSpacing( KDialog::spacingHint() ); 236//US layout->setSpacing( KDialog::spacingHint() );
231 layout->setSpacing( KDialogBase::spacingHintSmall() ); 237 layout->setSpacing( KDialogBase::spacingHintSmall() );
232 238
233 239
234 240
235 QLabel* label = new QLabel( this ); 241 QLabel* label = new QLabel( this );
236//US loadIcon call is ambiguous. Add one more parameter 242//US loadIcon call is ambiguous. Add one more parameter
237//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) ); 243//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) );
238 label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); 244 label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) );
239 label->setAlignment( AlignCenter ); 245 label->setAlignment( Qt::AlignCenter );
240//US layout->addMultiCellWidget( label, 0, 1, 3, 3 ); 246//US layout->addMultiCellWidget( label, 0, 1, 3, 3 );
241 layout->addWidget( label, 0, 0 ); 247 layout->addWidget( label, 0, 0 );
242 248
243 QPushButton *editButton = new QPushButton( i18n( "Edit Phone Numbers..." ), 249 QPushButton *editButton = new QPushButton( i18n( "Edit Phone Numbers..." ),
244 this ); 250 this );
245 if ( QApplication::desktop()->width() < 640 ) 251 if ( QApplication::desktop()->width() < 640 )
@@ -324,23 +330,23 @@ void PhoneEditWidget::setPhoneNumbers( const KABC::PhoneNumber::List &list )
324{ 330{
325 mPhoneList.clear(); 331 mPhoneList.clear();
326 332
327 // Insert types for existing numbers. 333 // Insert types for existing numbers.
328 mPrefCombo->insertTypeList( list ); 334 mPrefCombo->insertTypeList( list );
329 335
330 QValueList<int> defaultTypes; 336 Q3ValueList<int> defaultTypes;
331 defaultTypes << KABC::PhoneNumber::Home; 337 defaultTypes << KABC::PhoneNumber::Home;
332 defaultTypes << KABC::PhoneNumber::Work; 338 defaultTypes << KABC::PhoneNumber::Work;
333 defaultTypes << KABC::PhoneNumber::Cell; 339 defaultTypes << KABC::PhoneNumber::Cell;
334 defaultTypes << ( KABC::PhoneNumber::Work | KABC::PhoneNumber::Fax ); 340 defaultTypes << ( KABC::PhoneNumber::Work | KABC::PhoneNumber::Fax );
335 defaultTypes << ( KABC::PhoneNumber::Home | KABC::PhoneNumber::Fax ); 341 defaultTypes << ( KABC::PhoneNumber::Home | KABC::PhoneNumber::Fax );
336 342
337 // Insert default types. 343 // Insert default types.
338 // Doing this for mPrefCombo is enough because the list is shared by all 344 // Doing this for mPrefCombo is enough because the list is shared by all
339 // combos. 345 // combos.
340 QValueList<int>::ConstIterator it; 346 Q3ValueList<int>::ConstIterator it;
341 for( it = defaultTypes.begin(); it != defaultTypes.end(); ++it ) { 347 for( it = defaultTypes.begin(); it != defaultTypes.end(); ++it ) {
342 if ( !mPrefCombo->hasType( *it ) ) 348 if ( !mPrefCombo->hasType( *it ) )
343 mPrefCombo->insertType( list, *it, PhoneNumber( "", *it ) ); 349 mPrefCombo->insertType( list, *it, PhoneNumber( "", *it ) );
344 } 350 }
345 351
346 updateCombos(); 352 updateCombos();
@@ -484,16 +490,16 @@ void PhoneEditWidget::updateOtherEdit( PhoneTypeCombo *combo, PhoneTypeCombo *ot
484 } 490 }
485} 491}
486 492
487/////////////////////////////////////////// 493///////////////////////////////////////////
488// PhoneEditDialog 494// PhoneEditDialog
489 495
490class PhoneViewItem : public QListViewItem 496class PhoneViewItem : public Q3ListViewItem
491{ 497{
492public: 498public:
493 PhoneViewItem( QListView *parent, const KABC::PhoneNumber &number ); 499 PhoneViewItem( Q3ListView *parent, const KABC::PhoneNumber &number );
494 500
495 void setPhoneNumber( const KABC::PhoneNumber &number ) 501 void setPhoneNumber( const KABC::PhoneNumber &number )
496 { 502 {
497 mPhoneNumber = number; 503 mPhoneNumber = number;
498 makeText(); 504 makeText();
499 } 505 }
@@ -508,14 +514,14 @@ public:
508private: 514private:
509 void makeText(); 515 void makeText();
510 516
511 KABC::PhoneNumber mPhoneNumber; 517 KABC::PhoneNumber mPhoneNumber;
512}; 518};
513 519
514PhoneViewItem::PhoneViewItem( QListView *parent, const KABC::PhoneNumber &number ) 520PhoneViewItem::PhoneViewItem( Q3ListView *parent, const KABC::PhoneNumber &number )
515 : QListViewItem( parent ), mPhoneNumber( number ) 521 : Q3ListViewItem( parent ), mPhoneNumber( number )
516{ 522{
517#ifdef DESKTOP_VERSION 523#ifdef DESKTOP_VERSION
518 setRenameEnabled ( 0, true ); 524 setRenameEnabled ( 0, true );
519#endif 525#endif
520 makeText(); 526 makeText();
521} 527}
@@ -541,34 +547,34 @@ PhoneEditDialog::PhoneEditDialog( const KABC::PhoneNumber::List &list, QWidget *
541 parent, name, true) 547 parent, name, true)
542{ 548{
543 mPhoneNumberList = list; 549 mPhoneNumberList = list;
544 550
545 QWidget *page = plainPage(); 551 QWidget *page = plainPage();
546 552
547 QGridLayout *layout = new QGridLayout( page, 1, 2 ); 553 Q3GridLayout *layout = new Q3GridLayout( page, 1, 2 );
548 layout->setSpacing( spacingHint() ); 554 layout->setSpacing( spacingHint() );
549 555
550 mListView = new KListView( page ); 556 mListView = new KListView( page );
551 mListView->setAllColumnsShowFocus( true ); 557 mListView->setAllColumnsShowFocus( true );
552 mListView->addColumn( i18n( "Number" ) ); 558 mListView->addColumn( i18n( "Number" ) );
553 mListView->addColumn( i18n( "Type" ) ); 559 mListView->addColumn( i18n( "Type" ) );
554 560
555 KButtonBox *buttonBox = new KButtonBox( page, Vertical ); 561 KButtonBox *buttonBox = new KButtonBox( page, Qt::Vertical );
556 562
557 buttonBox->addButton( i18n( "&Add..." ), this, SLOT( slotAddPhoneNumber() ) ); 563 buttonBox->addButton( i18n( "&Add..." ), this, SLOT( slotAddPhoneNumber() ) );
558 mEditButton = buttonBox->addButton( i18n( "&Edit..." ), this, SLOT( slotEditPhoneNumber() ) ); 564 mEditButton = buttonBox->addButton( i18n( "&Edit..." ), this, SLOT( slotEditPhoneNumber() ) );
559 mEditButton->setEnabled( false ); 565 mEditButton->setEnabled( false );
560 mRemoveButton = buttonBox->addButton( i18n( "&Remove" ), this, SLOT( slotRemovePhoneNumber() ) ); 566 mRemoveButton = buttonBox->addButton( i18n( "&Remove" ), this, SLOT( slotRemovePhoneNumber() ) );
561 mRemoveButton->setEnabled( false ); 567 mRemoveButton->setEnabled( false );
562 buttonBox->layout(); 568 buttonBox->layout();
563 569
564 layout->addWidget( mListView, 0, 0 ); 570 layout->addWidget( mListView, 0, 0 );
565 layout->addWidget( buttonBox, 0, 1 ); 571 layout->addWidget( buttonBox, 0, 1 );
566 572
567 connect( mListView, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()) ); 573 connect( mListView, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()) );
568 connect( mListView, SIGNAL(doubleClicked( QListViewItem *, const QPoint &, int )), this, SLOT( slotEditPhoneNumber())); 574 connect( mListView, SIGNAL(doubleClicked( Q3ListViewItem *, const QPoint &, int )), this, SLOT( slotEditPhoneNumber()));
569 575
570 KABC::PhoneNumber::List::Iterator it; 576 KABC::PhoneNumber::List::Iterator it;
571 for ( it = mPhoneNumberList.begin(); it != mPhoneNumberList.end(); ++it ) 577 for ( it = mPhoneNumberList.begin(); it != mPhoneNumberList.end(); ++it )
572 new PhoneViewItem( mListView, *it ); 578 new PhoneViewItem( mListView, *it );
573 if (QApplication::desktop()->width() < 480 ) 579 if (QApplication::desktop()->width() < 480 )
574 showMaximized(); 580 showMaximized();
@@ -585,13 +591,13 @@ PhoneEditDialog::~PhoneEditDialog()
585void PhoneEditDialog::slotAddPhoneNumber() 591void PhoneEditDialog::slotAddPhoneNumber()
586{ 592{
587 KABC::PhoneNumber tmp( "", 0 ); 593 KABC::PhoneNumber tmp( "", 0 );
588 PhoneTypeDialog dlg( tmp, this ); 594 PhoneTypeDialog dlg( tmp, this );
589 595
590 if ( dlg.exec() ) { 596 if ( dlg.exec() ) {
591 QListViewItem* i = mListView->firstChild(); 597 Q3ListViewItem* i = mListView->firstChild();
592 KABC::PhoneNumber phoneNumber = dlg.phoneNumber(); 598 KABC::PhoneNumber phoneNumber = dlg.phoneNumber();
593 bool insert = true; 599 bool insert = true;
594 while ( i ) { 600 while ( i ) {
595 PhoneViewItem* p = ( PhoneViewItem* ) i; 601 PhoneViewItem* p = ( PhoneViewItem* ) i;
596 KABC::PhoneNumber pn = p->phoneNumber(); 602 KABC::PhoneNumber pn = p->phoneNumber();
597 if ( (pn.type() | KABC::PhoneNumber::Pref) == (phoneNumber.type() | KABC::PhoneNumber::Pref) ) { 603 if ( (pn.type() | KABC::PhoneNumber::Pref) == (phoneNumber.type() | KABC::PhoneNumber::Pref) ) {
@@ -617,13 +623,13 @@ void PhoneEditDialog::slotRemovePhoneNumber()
617{ 623{
618 PhoneViewItem *item = static_cast<PhoneViewItem*>( mListView->currentItem() ); 624 PhoneViewItem *item = static_cast<PhoneViewItem*>( mListView->currentItem() );
619 if ( !item ) 625 if ( !item )
620 return; 626 return;
621 627
622 mPhoneNumberList.remove( item->phoneNumber() ); 628 mPhoneNumberList.remove( item->phoneNumber() );
623 QListViewItem *currItem = mListView->currentItem(); 629 Q3ListViewItem *currItem = mListView->currentItem();
624 mListView->takeItem( currItem ); 630 mListView->takeItem( currItem );
625 delete currItem; 631 delete currItem;
626 632
627 mChanged = true; 633 mChanged = true;
628} 634}
629 635
@@ -670,23 +676,23 @@ PhoneTypeDialog::PhoneTypeDialog( const KABC::PhoneNumber &phoneNumber,
670 : KDialogBase( KDialogBase::Plain, i18n( "Edit Phone Number" ), 676 : KDialogBase( KDialogBase::Plain, i18n( "Edit Phone Number" ),
671 KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, 677 KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok,
672 parent, name, true), mPhoneNumber( phoneNumber ) 678 parent, name, true), mPhoneNumber( phoneNumber )
673{ 679{
674 QWidget *page = plainPage(); 680 QWidget *page = plainPage();
675 QLabel *label = 0; 681 QLabel *label = 0;
676 QGridLayout *layout = new QGridLayout( page, 3, 2, marginHint(), spacingHint() ); 682 Q3GridLayout *layout = new Q3GridLayout( page, 3, 2, marginHint(), spacingHint() );
677 683
678 label = new QLabel( i18n( "Number:" ), page ); 684 label = new QLabel( i18n( "Number:" ), page );
679 layout->addWidget( label, 0, 0 ); 685 layout->addWidget( label, 0, 0 );
680 mNumber = new KLineEdit( page ); 686 mNumber = new KLineEdit( page );
681 layout->addWidget( mNumber, 0, 1 ); 687 layout->addWidget( mNumber, 0, 1 );
682 688
683 mPreferredBox = new QCheckBox( i18n( "This is the preferred phone number" ), page ); 689 mPreferredBox = new QCheckBox( i18n( "This is the preferred phone number" ), page );
684 layout->addMultiCellWidget( mPreferredBox, 1, 1, 0, 1 ); 690 layout->addMultiCellWidget( mPreferredBox, 1, 1, 0, 1 );
685 691
686 mGroup = new QButtonGroup( 2, Horizontal, i18n( "Types" ), page ); 692 mGroup = new Q3ButtonGroup( 2, Qt::Horizontal, i18n( "Types" ), page );
687 layout->addMultiCellWidget( mGroup, 2, 2, 0, 1 ); 693 layout->addMultiCellWidget( mGroup, 2, 2, 0, 1 );
688 694
689 // fill widgets 695 // fill widgets
690 mNumber->setText( mPhoneNumber.number() ); 696 mNumber->setText( mPhoneNumber.number() );
691 697
692 mTypeList = KABC::PhoneNumber::typeList(); 698 mTypeList = KABC::PhoneNumber::typeList();
@@ -723,9 +729,9 @@ KABC::PhoneNumber PhoneTypeDialog::phoneNumber()
723 else 729 else
724 mPhoneNumber.setType( type & ~KABC::PhoneNumber::Pref ); 730 mPhoneNumber.setType( type & ~KABC::PhoneNumber::Pref );
725 731
726 return mPhoneNumber; 732 return mPhoneNumber;
727} 733}
728#endif 734#endif
729#ifndef KAB_EMBEDDED 735#ifndef KAB_EMBEDDED_
730#include "phoneeditwidget.moc" 736#include "moc_phoneeditwidget.cpp"
731#endif //KAB_EMBEDDED 737#endif //KAB_EMBEDDED
diff --git a/kaddressbook/phoneeditwidget.h b/kaddressbook/phoneeditwidget.h
index 5bb4226..2be3e2b 100644
--- a/kaddressbook/phoneeditwidget.h
+++ b/kaddressbook/phoneeditwidget.h
@@ -24,22 +24,26 @@
24*/ 24*/
25 25
26#include <kdialogbase.h> 26#include <kdialogbase.h>
27#include <kiconloader.h> 27#include <kiconloader.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qpopupmenu.h> 30#include <q3popupmenu.h>
31#include <qapplication.h> 31#include <qapplication.h>
32#include <QDesktopWidget>
32 33
33#include <qptrlist.h> 34#include <q3ptrlist.h>
34#include <qscrollview.h> 35#include <q3scrollview.h>
36//Added by qt3to4:
37#include <Q3HBoxLayout>
38#include <Q3VBoxLayout>
35 39
36#include "addresseeconfig.h" 40#include "addresseeconfig.h"
37#include "typecombo.h" 41#include "typecombo.h"
38 42
39class QButtonGroup; 43class Q3ButtonGroup;
40class QCheckBox; 44class QCheckBox;
41class PhoneTypeNumberEdit; 45class PhoneTypeNumberEdit;
42 46
43#include <klineedit.h> 47#include <klineedit.h>
44#include <kcombobox.h> 48#include <kcombobox.h>
45#include <kabc/phonenumber.h> 49#include <kabc/phonenumber.h>
@@ -73,39 +77,39 @@ class PhoneEditWidget : public QWidget
73 void deleteEdit( PhoneTypeNumberEdit* ew ); 77 void deleteEdit( PhoneTypeNumberEdit* ew );
74 void addNumber(); 78 void addNumber();
75 void pendingDelete(); 79 void pendingDelete();
76 protected: 80 protected:
77 81
78 private: 82 private:
79 QScrollView* sv; 83 Q3ScrollView* sv;
80 QPopupMenu *mPopup; 84 Q3PopupMenu *mPopup;
81 int mPopupCount; 85 int mPopupCount;
82 PhoneTypeNumberEdit* mPendingDelete; 86 PhoneTypeNumberEdit* mPendingDelete;
83 void setDefaults(); 87 void setDefaults();
84 PhoneTypeNumberEdit* appendEditCombo(); 88 PhoneTypeNumberEdit* appendEditCombo();
85 QWidget* mw; 89 QWidget* mw;
86 QVBoxLayout* mainLayout; 90 Q3VBoxLayout* mainLayout;
87 QPtrList <PhoneTypeNumberEdit> mTypeNumberEditList; 91 Q3PtrList <PhoneTypeNumberEdit> mTypeNumberEditList;
88 92
89}; 93};
90 94
91 95
92class PhoneTypeNumberEdit : public QWidget 96class PhoneTypeNumberEdit : public QWidget
93{ 97{
94 Q_OBJECT 98 Q_OBJECT
95public: 99public:
96 PhoneTypeNumberEdit( QWidget *parent, const char *name = 0 ) :QWidget( parent ) 100 PhoneTypeNumberEdit( QWidget *parent, const char *name = 0 ) :QWidget( parent )
97 { 101 {
98 QHBoxLayout * lay = new QHBoxLayout( this ); 102 Q3HBoxLayout * lay = new Q3HBoxLayout( this );
99 lay->setSpacing( 2 ); 103 lay->setSpacing( 2 );
100 lay->setMargin( 0 ); 104 lay->setMargin( 0 );
101 mMinusButton = new QPushButton ( this ); 105 mMinusButton = new QPushButton ( this );
102 mMinusButton->setPixmap ( SmallIcon("minus")); 106 mMinusButton->setPixmap ( SmallIcon("minus"));
103 mCombo = new KComboBox( this ); 107 mCombo = new KComboBox( this );
104 if ( QApplication::desktop()->width() <= 640 ) 108 if ( QApplication::desktop()->width() <= 640 )
105 mCombo->setSizeLimit ( 6 ); 109 mCombo->setMaxVisibleItems ( 6 );
106 mNumber = new KLineEdit( this ); 110 mNumber = new KLineEdit( this );
107 mMinusButton->setMaximumHeight( mNumber->sizeHint().height() + 6); 111 mMinusButton->setMaximumHeight( mNumber->sizeHint().height() + 6);
108 lay->addWidget( mMinusButton ); 112 lay->addWidget( mMinusButton );
109 lay->addWidget( mCombo ); 113 lay->addWidget( mCombo );
110 lay->addWidget( mNumber ); 114 lay->addWidget( mNumber );
111 connect( mMinusButton , SIGNAL ( clicked() ), this, SLOT ( deleteNumber() ) ); 115 connect( mMinusButton , SIGNAL ( clicked() ), this, SLOT ( deleteNumber() ) );
diff --git a/kaddressbook/secrecywidget.cpp b/kaddressbook/secrecywidget.cpp
index 4a2acc8..1c237c0 100644
--- a/kaddressbook/secrecywidget.cpp
+++ b/kaddressbook/secrecywidget.cpp
@@ -19,23 +19,25 @@
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25//Added by qt3to4:
26#include <Q3VBoxLayout>
25 27
26#include <kabc/secrecy.h> 28#include <kabc/secrecy.h>
27#include <kcombobox.h> 29#include <kcombobox.h>
28#include <kdialog.h> 30#include <kdialog.h>
29 31
30#include "secrecywidget.h" 32#include "secrecywidget.h"
31 33
32SecrecyWidget::SecrecyWidget( QWidget *parent, const char *name ) 34SecrecyWidget::SecrecyWidget( QWidget *parent, const char *name )
33 : QWidget( parent, name ) 35 : QWidget( parent, name )
34{ 36{
35 QVBoxLayout *layout = new QVBoxLayout( this, KDialog::marginHint(), 37 Q3VBoxLayout *layout = new Q3VBoxLayout( this, KDialog::marginHint(),
36 KDialog::spacingHint() ); 38 KDialog::spacingHint() );
37 mSecrecyCombo = new KComboBox( this ); 39 mSecrecyCombo = new KComboBox( this );
38 layout->addWidget( mSecrecyCombo ); 40 layout->addWidget( mSecrecyCombo );
39 41
40 KABC::Secrecy::TypeList list = KABC::Secrecy::typeList(); 42 KABC::Secrecy::TypeList list = KABC::Secrecy::typeList();
41 KABC::Secrecy::TypeList::Iterator it; 43 KABC::Secrecy::TypeList::Iterator it;
@@ -62,9 +64,9 @@ KABC::Secrecy SecrecyWidget::secrecy() const
62 KABC::Secrecy secrecy; 64 KABC::Secrecy secrecy;
63 secrecy.setType( mSecrecyCombo->currentItem() ); 65 secrecy.setType( mSecrecyCombo->currentItem() );
64 66
65 return secrecy; 67 return secrecy;
66} 68}
67 69
68#ifndef KAB_EMBEDDED 70#ifndef KAB_EMBEDDED_
69#include "secrecywidget.moc" 71#include "moc_secrecywidget.cpp"
70#endif //KAB_EMBEDDED 72#endif //KAB_EMBEDDED
diff --git a/kaddressbook/undo.cpp b/kaddressbook/undo.cpp
index 4442087..a6c1580 100644
--- a/kaddressbook/undo.cpp
+++ b/kaddressbook/undo.cpp
@@ -111,9 +111,9 @@ void RedoStack::redo()
111 111
112 command = pop(); 112 command = pop();
113 command->redo(); 113 command->redo();
114 UndoStack::instance()->push( command ); 114 UndoStack::instance()->push( command );
115} 115}
116 116
117#ifndef KAB_EMBEDDED 117#ifndef KAB_EMBEDDED_
118#include "undo.moc" 118#include "moc_undo.cpp"
119#endif //KAB_EMBEDDED 119#endif //KAB_EMBEDDED
diff --git a/kaddressbook/undo.h b/kaddressbook/undo.h
index 843bc26..a8ba2ee 100644
--- a/kaddressbook/undo.h
+++ b/kaddressbook/undo.h
@@ -22,13 +22,13 @@
22*/ 22*/
23 23
24#ifndef UNDO_H 24#ifndef UNDO_H
25#define UNDO_H 25#define UNDO_H
26 26
27#include <qobject.h> 27#include <qobject.h>
28#include <qptrstack.h> 28#include <q3ptrstack.h>
29#include <qstring.h> 29#include <qstring.h>
30 30
31class Command 31class Command
32{ 32{
33public: 33public:
34 Command() {} 34 Command() {}
@@ -64,13 +64,13 @@ class StackBase : public QObject
64 protected: 64 protected:
65 /** Protect the pop method so users must call undo/redo to properly 65 /** Protect the pop method so users must call undo/redo to properly
66 * use the stack, however the subclasses need it to modify the stack. 66 * use the stack, however the subclasses need it to modify the stack.
67 */ 67 */
68 Command *pop(); 68 Command *pop();
69 69
70 QPtrStack<Command> mCommandStack; 70 Q3PtrStack<Command> mCommandStack;
71}; 71};
72 72
73class UndoStack : public StackBase 73class UndoStack : public StackBase
74{ 74{
75public: 75public:
76 static UndoStack *instance(); 76 static UndoStack *instance();
diff --git a/kaddressbook/undocmds.cpp b/kaddressbook/undocmds.cpp
index 5807dc0..e900b00 100644
--- a/kaddressbook/undocmds.cpp
+++ b/kaddressbook/undocmds.cpp
@@ -18,13 +18,13 @@
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qtextstream.h> 24#include <q3textstream.h>
25 25
26#include <qapplication.h> 26#include <qapplication.h>
27#include <qclipboard.h> 27#include <qclipboard.h>
28 28
29#include <klocale.h> 29#include <klocale.h>
30#include <kdebug.h> 30#include <kdebug.h>
diff --git a/kaddressbook/viewconfigurefieldspage.cpp b/kaddressbook/viewconfigurefieldspage.cpp
index 5daae1a..7366a0b 100644
--- a/kaddressbook/viewconfigurefieldspage.cpp
+++ b/kaddressbook/viewconfigurefieldspage.cpp
@@ -33,26 +33,30 @@
33#include <kiconloader.h> 33#include <kiconloader.h>
34#include <kdialog.h> 34#include <kdialog.h>
35#include <klocale.h> 35#include <klocale.h>
36 36
37#include <qtoolbutton.h> 37#include <qtoolbutton.h>
38#include <qapplication.h> 38#include <qapplication.h>
39#include <QDesktopWidget>
39#include <qlabel.h> 40#include <qlabel.h>
40#include <qlistbox.h> 41#include <q3listbox.h>
41#include <qlayout.h> 42#include <qlayout.h>
43//Added by qt3to4:
44#include <Q3GridLayout>
45#include <Q3BoxLayout>
42 46
43#include "viewconfigurefieldspage.h" 47#include "viewconfigurefieldspage.h"
44 48
45class FieldItem : public QListBoxText 49class FieldItem : public Q3ListBoxText
46{ 50{
47 public: 51 public:
48 FieldItem( QListBox *parent, KABC::Field *field ) 52 FieldItem( Q3ListBox *parent, KABC::Field *field )
49 : QListBoxText( parent, field->label() ), mField( field ) {} 53 : Q3ListBoxText( parent, field->label() ), mField( field ) {}
50 54
51 FieldItem( QListBox *parent, KABC::Field *field, int index ) 55 FieldItem( Q3ListBox *parent, KABC::Field *field, int index )
52 : QListBoxText( parent, field->label(), parent->item( index ) ), 56 : Q3ListBoxText( parent, field->label(), parent->item( index ) ),
53 mField( field ) {} 57 mField( field ) {}
54 58
55 KABC::Field *field() { return mField; } 59 KABC::Field *field() { return mField; }
56 60
57 private: 61 private:
58 KABC::Field *mField; 62 KABC::Field *mField;
@@ -103,13 +107,13 @@ void ViewConfigureFieldsPage::slotShowFields( int index )
103 else category = 1 << ( index - 1 ); 107 else category = 1 << ( index - 1 );
104 108
105 KABC::Field::List allFields = mAddressBook->fields( category ); 109 KABC::Field::List allFields = mAddressBook->fields( category );
106 110
107 KABC::Field::List::ConstIterator it; 111 KABC::Field::List::ConstIterator it;
108 for ( it = allFields.begin(); it != allFields.end(); ++it ) { 112 for ( it = allFields.begin(); it != allFields.end(); ++it ) {
109 QListBoxItem *item = mSelectedBox->firstItem(); 113 Q3ListBoxItem *item = mSelectedBox->firstItem();
110 while( item ) { 114 while( item ) {
111 FieldItem *fieldItem = static_cast<FieldItem *>( item ); 115 FieldItem *fieldItem = static_cast<FieldItem *>( item );
112 if ( (*it)->equals( fieldItem->field() ) ) 116 if ( (*it)->equals( fieldItem->field() ) )
113 break; 117 break;
114 item = item->next(); 118 item = item->next();
115 } 119 }
@@ -186,25 +190,25 @@ void ViewConfigureFieldsPage::slotButtonsEnabled()
186} 190}
187 191
188void ViewConfigureFieldsPage::slotMoveUp() 192void ViewConfigureFieldsPage::slotMoveUp()
189{ 193{
190 int i = mSelectedBox->currentItem(); 194 int i = mSelectedBox->currentItem();
191 if ( i > 0 ) { 195 if ( i > 0 ) {
192 QListBoxItem *item = mSelectedBox->item( i ); 196 Q3ListBoxItem *item = mSelectedBox->item( i );
193 mSelectedBox->takeItem( item ); 197 mSelectedBox->takeItem( item );
194 mSelectedBox->insertItem( item, i - 1 ); 198 mSelectedBox->insertItem( item, i - 1 );
195 mSelectedBox->setCurrentItem( item ); 199 mSelectedBox->setCurrentItem( item );
196 mSelectedBox->setSelected( i - 1, true ); 200 mSelectedBox->setSelected( i - 1, true );
197 } 201 }
198} 202}
199 203
200void ViewConfigureFieldsPage::slotMoveDown() 204void ViewConfigureFieldsPage::slotMoveDown()
201{ 205{
202 int i = mSelectedBox->currentItem(); 206 int i = mSelectedBox->currentItem();
203 if ( i > -1 && i < (int)mSelectedBox->count() - 1 ) { 207 if ( i > -1 && i < (int)mSelectedBox->count() - 1 ) {
204 QListBoxItem *item = mSelectedBox->item( i ); 208 Q3ListBoxItem *item = mSelectedBox->item( i );
205 mSelectedBox->takeItem( item ); 209 mSelectedBox->takeItem( item );
206 mSelectedBox->insertItem( item, i + 1 ); 210 mSelectedBox->insertItem( item, i + 1 );
207 mSelectedBox->setCurrentItem( item ); 211 mSelectedBox->setCurrentItem( item );
208 mSelectedBox->setSelected( i + 1, true ); 212 mSelectedBox->setSelected( i + 1, true );
209 } 213 }
210} 214}
@@ -216,17 +220,17 @@ void ViewConfigureFieldsPage::initGUI()
216 // 0 = 640x480 ; 1 = 240x320 220 // 0 = 640x480 ; 1 = 240x320
217 bool orientation = 1; 221 bool orientation = 1;
218 222
219 223
220 setCaption( i18n("Select Fields to Display") ); 224 setCaption( i18n("Select Fields to Display") );
221 225
222 QGridLayout *gl = 0; 226 Q3GridLayout *gl = 0;
223 if (orientation == 0) 227 if (orientation == 0)
224 gl = new QGridLayout( this , 6, 4, 0, KDialog::spacingHint() ); 228 gl = new Q3GridLayout( this , 6, 4, 0, KDialog::spacingHint() );
225 else 229 else
226 gl = new QGridLayout( this , 4, 6, 0, KDialog::spacingHint() ); 230 gl = new Q3GridLayout( this , 4, 6, 0, KDialog::spacingHint() );
227 231
228 #ifndef KAB_EMBEDDED 232 #ifndef KAB_EMBEDDED
229 mCategoryCombo = new KComboBox( false, this ); 233 mCategoryCombo = new KComboBox( false, this );
230 #else //KAB_EMBEDDED 234 #else //KAB_EMBEDDED
231 mCategoryCombo = new QComboBox( false, this ); 235 mCategoryCombo = new QComboBox( false, this );
232 #endif //KAB_EMBEDDED 236 #endif //KAB_EMBEDDED
@@ -246,38 +250,38 @@ void ViewConfigureFieldsPage::initGUI()
246 if (orientation == 0) 250 if (orientation == 0)
247 gl->addWidget( label, 0, 2 ); 251 gl->addWidget( label, 0, 2 );
248 else 252 else
249 gl->addWidget( label, 2, 0 ); 253 gl->addWidget( label, 2, 0 );
250 254
251 255
252 mUnSelectedBox = new QListBox( this ); 256 mUnSelectedBox = new Q3ListBox( this );
253 mUnSelectedBox->setSelectionMode( QListBox::Extended ); 257 mUnSelectedBox->setSelectionMode( Q3ListBox::Extended );
254 mUnSelectedBox->setMinimumHeight( 80 ); 258 mUnSelectedBox->setMinimumHeight( 80 );
255 if (orientation == 0) 259 if (orientation == 0)
256 gl->addWidget( mUnSelectedBox, 1, 0 ); 260 gl->addWidget( mUnSelectedBox, 1, 0 );
257 else 261 else
258 gl->addWidget( mUnSelectedBox, 0, 1 ); 262 gl->addWidget( mUnSelectedBox, 0, 1 );
259 263
260 mSelectedBox = new QListBox( this ); 264 mSelectedBox = new Q3ListBox( this );
261 //if ( QApplication::desktop()->width() < 320 ) { 265 //if ( QApplication::desktop()->width() < 320 ) {
262 // mUnSelectedBox->setMaximumWidth( 134 ); 266 // mUnSelectedBox->setMaximumWidth( 134 );
263 // mSelectedBox->setMaximumWidth( 134 ); 267 // mSelectedBox->setMaximumWidth( 134 );
264 //} 268 //}
265 mSelectedBox->setSelectionMode( QListBox::Extended ); 269 mSelectedBox->setSelectionMode( Q3ListBox::Extended );
266 mSelectedBox->setMinimumHeight( 80 ); 270 mSelectedBox->setMinimumHeight( 80 );
267 label->setBuddy( mSelectedBox ); 271 label->setBuddy( mSelectedBox );
268 if (orientation == 0) 272 if (orientation == 0)
269 gl->addWidget( mSelectedBox, 1, 2 ); 273 gl->addWidget( mSelectedBox, 1, 2 );
270 else 274 else
271 gl->addWidget( mSelectedBox, 2, 1 ); 275 gl->addWidget( mSelectedBox, 2, 1 );
272 276
273 QBoxLayout *vb1 = 0; 277 Q3BoxLayout *vb1 = 0;
274 if (orientation == 0) 278 if (orientation == 0)
275 vb1 = new QBoxLayout( QBoxLayout::TopToBottom, KDialog::spacingHint() ); 279 vb1 = new Q3BoxLayout( Q3BoxLayout::TopToBottom, KDialog::spacingHint() );
276 else 280 else
277 vb1 = new QBoxLayout( QBoxLayout::LeftToRight, KDialog::spacingHint() ); 281 vb1 = new Q3BoxLayout( Q3BoxLayout::LeftToRight, KDialog::spacingHint() );
278 282
279 vb1->addStretch(); 283 vb1->addStretch();
280 284
281 mAddButton = new QToolButton( this ); 285 mAddButton = new QToolButton( this );
282 if (orientation == 0) 286 if (orientation == 0)
283 mAddButton->setIconSet( SmallIconSet( "1rightarrow" ) ); 287 mAddButton->setIconSet( SmallIconSet( "1rightarrow" ) );
@@ -298,17 +302,17 @@ void ViewConfigureFieldsPage::initGUI()
298 vb1->addStretch(); 302 vb1->addStretch();
299 if (orientation == 0) 303 if (orientation == 0)
300 gl->addLayout( vb1, 1, 1 ); 304 gl->addLayout( vb1, 1, 1 );
301 else 305 else
302 gl->addLayout( vb1, 1, 1 ); 306 gl->addLayout( vb1, 1, 1 );
303 307
304 QBoxLayout *vb2 = 0; 308 Q3BoxLayout *vb2 = 0;
305 if (orientation == 0) 309 if (orientation == 0)
306 vb2 = new QBoxLayout( QBoxLayout::TopToBottom, KDialog::spacingHint() ); 310 vb2 = new Q3BoxLayout( Q3BoxLayout::TopToBottom, KDialog::spacingHint() );
307 else 311 else
308 vb2 = new QBoxLayout( QBoxLayout::LeftToRight, KDialog::spacingHint() ); 312 vb2 = new Q3BoxLayout( Q3BoxLayout::LeftToRight, KDialog::spacingHint() );
309 313
310 vb2->addStretch(); 314 vb2->addStretch();
311 315
312 mUpButton = new QToolButton( this ); 316 mUpButton = new QToolButton( this );
313 mUpButton->setIconSet( SmallIconSet( "1uparrow" ) ); 317 mUpButton->setIconSet( SmallIconSet( "1uparrow" ) );
314 connect( mUpButton, SIGNAL( clicked() ), SLOT( slotMoveUp() ) ); 318 connect( mUpButton, SIGNAL( clicked() ), SLOT( slotMoveUp() ) );
@@ -337,15 +341,15 @@ void ViewConfigureFieldsPage::initGUI()
337 //mSelectedBox->setMinimumSize( sizeHint ); 341 //mSelectedBox->setMinimumSize( sizeHint );
338 342
339 gl->activate(); 343 gl->activate();
340 344
341 connect( mUnSelectedBox, SIGNAL( selectionChanged() ), SLOT( slotButtonsEnabled() ) ); 345 connect( mUnSelectedBox, SIGNAL( selectionChanged() ), SLOT( slotButtonsEnabled() ) );
342 connect( mSelectedBox, SIGNAL( selectionChanged() ), SLOT( slotButtonsEnabled() ) ); 346 connect( mSelectedBox, SIGNAL( selectionChanged() ), SLOT( slotButtonsEnabled() ) );
343 connect( mSelectedBox, SIGNAL( currentChanged( QListBoxItem * ) ), SLOT( slotButtonsEnabled() ) ); 347 connect( mSelectedBox, SIGNAL( currentChanged( Q3ListBoxItem * ) ), SLOT( slotButtonsEnabled() ) );
344 348
345 slotButtonsEnabled(); 349 slotButtonsEnabled();
346} 350}
347 351
348 352
349#ifndef KAB_EMBEDDED 353#ifndef KAB_EMBEDDED_
350#include "viewconfigurefieldspage.moc" 354#include "moc_viewconfigurefieldspage.cpp"
351#endif //KAB_EMBEDDED 355#endif //KAB_EMBEDDED
diff --git a/kaddressbook/viewconfigurefieldspage.h b/kaddressbook/viewconfigurefieldspage.h
index b27668c..42d132f 100644
--- a/kaddressbook/viewconfigurefieldspage.h
+++ b/kaddressbook/viewconfigurefieldspage.h
@@ -32,14 +32,14 @@
32#ifndef KAB_EMBEDDED 32#ifndef KAB_EMBEDDED
33class KComboBox; 33class KComboBox;
34#else //KAB_EMBEDDED 34#else //KAB_EMBEDDED
35class QComboBox; 35class QComboBox;
36#endif //KAB_EMBEDDED 36#endif //KAB_EMBEDDED
37 37
38class QListBox; 38class Q3ListBox;
39class QListBoxItem; 39class Q3ListBoxItem;
40class QPushButton; 40class QPushButton;
41class QToolButton; 41class QToolButton;
42 42
43class ViewConfigureFieldsPage : public QWidget 43class ViewConfigureFieldsPage : public QWidget
44{ 44{
45 Q_OBJECT 45 Q_OBJECT
@@ -65,14 +65,14 @@ class ViewConfigureFieldsPage : public QWidget
65 65
66#ifndef KAB_EMBEDDED 66#ifndef KAB_EMBEDDED
67 KComboBox *mCategoryCombo; 67 KComboBox *mCategoryCombo;
68#else //KAB_EMBEDDED 68#else //KAB_EMBEDDED
69 QComboBox *mCategoryCombo; 69 QComboBox *mCategoryCombo;
70#endif //KAB_EMBEDDED 70#endif //KAB_EMBEDDED
71 QListBox *mSelectedBox; 71 Q3ListBox *mSelectedBox;
72 QListBox *mUnSelectedBox; 72 Q3ListBox *mUnSelectedBox;
73 QToolButton *mAddButton; 73 QToolButton *mAddButton;
74 QToolButton *mRemoveButton; 74 QToolButton *mRemoveButton;
75 QToolButton *mUpButton; 75 QToolButton *mUpButton;
76 QToolButton *mDownButton; 76 QToolButton *mDownButton;
77 77
78 KABC::AddressBook *mAddressBook; 78 KABC::AddressBook *mAddressBook;
diff --git a/kaddressbook/viewconfigurefilterpage.cpp b/kaddressbook/viewconfigurefilterpage.cpp
index b085a5e..cdb778b 100644
--- a/kaddressbook/viewconfigurefilterpage.cpp
+++ b/kaddressbook/viewconfigurefilterpage.cpp
@@ -24,16 +24,19 @@
24#ifndef KAB_EMBEDDED 24#ifndef KAB_EMBEDDED
25#include <kcombobox.h> 25#include <kcombobox.h>
26#else //KAB_EMBEDDED 26#else //KAB_EMBEDDED
27#include <qcombobox.h> 27#include <qcombobox.h>
28#endif //KAB_EMBEDDED 28#endif //KAB_EMBEDDED
29 29
30#include <qbuttongroup.h> 30#include <q3buttongroup.h>
31#include <qlabel.h> 31#include <qlabel.h>
32#include <qlayout.h> 32#include <qlayout.h>
33#include <qradiobutton.h> 33#include <qradiobutton.h>
34//Added by qt3to4:
35#include <Q3HBoxLayout>
36#include <Q3VBoxLayout>
34 37
35#include <kconfig.h> 38#include <kconfig.h>
36#include <kdialog.h> 39#include <kdialog.h>
37#include <klocale.h> 40#include <klocale.h>
38 41
39#include "filter.h" 42#include "filter.h"
@@ -41,15 +44,15 @@
41#include "viewconfigurefilterpage.h" 44#include "viewconfigurefilterpage.h"
42 45
43ViewConfigureFilterPage::ViewConfigureFilterPage( QWidget *parent, 46ViewConfigureFilterPage::ViewConfigureFilterPage( QWidget *parent,
44 const char *name ) 47 const char *name )
45 : QWidget( parent, name ) 48 : QWidget( parent, name )
46{ 49{
47 QBoxLayout *topLayout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); 50 Q3BoxLayout *topLayout = new Q3VBoxLayout( this, 0, KDialog::spacingHint() );
48 51
49 mFilterGroup = new QButtonGroup(); 52 mFilterGroup = new Q3ButtonGroup();
50 connect( mFilterGroup, SIGNAL( clicked( int ) ), SLOT( buttonClicked( int ) ) ); 53 connect( mFilterGroup, SIGNAL( clicked( int ) ), SLOT( buttonClicked( int ) ) );
51 54
52 QLabel *label = new QLabel( i18n( "The default filter will be activated whenever" 55 QLabel *label = new QLabel( i18n( "The default filter will be activated whenever"
53 " this view is displayed. This feature allows you to configure views that only" 56 " this view is displayed. This feature allows you to configure views that only"
54 " interact with certain types of information based on the filter. Once the view" 57 " interact with certain types of information based on the filter. Once the view"
55 " is activated, the filter can be changed at anytime." ), this ); 58 " is activated, the filter can be changed at anytime." ), this );
@@ -65,13 +68,13 @@ ViewConfigureFilterPage::ViewConfigureFilterPage( QWidget *parent,
65 topLayout->addWidget( button ); 68 topLayout->addWidget( button );
66 69
67 button = new QRadioButton( i18n( "Use last active filter" ), this ); 70 button = new QRadioButton( i18n( "Use last active filter" ), this );
68 mFilterGroup->insert( button ); 71 mFilterGroup->insert( button );
69 topLayout->addWidget( button ); 72 topLayout->addWidget( button );
70 73
71 QBoxLayout *comboLayout = new QHBoxLayout(); 74 Q3BoxLayout *comboLayout = new Q3HBoxLayout();
72 topLayout->addLayout( comboLayout ); 75 topLayout->addLayout( comboLayout );
73 button = new QRadioButton( i18n( "Use filter:" ), this ); 76 button = new QRadioButton( i18n( "Use filter:" ), this );
74 mFilterGroup->insert( button ); 77 mFilterGroup->insert( button );
75 comboLayout->addWidget( button ); 78 comboLayout->addWidget( button );
76 79
77#ifndef KAB_EMBEDDED 80#ifndef KAB_EMBEDDED
@@ -129,9 +132,9 @@ void ViewConfigureFilterPage::saveSettings( KConfig *config )
129 132
130void ViewConfigureFilterPage::buttonClicked( int id ) 133void ViewConfigureFilterPage::buttonClicked( int id )
131{ 134{
132 mFilterCombo->setEnabled( id == 2 ); 135 mFilterCombo->setEnabled( id == 2 );
133} 136}
134 137
135#ifndef KAB_EMBEDDED 138#ifndef KAB_EMBEDDED_
136#include "viewconfigurefilterpage.moc" 139#include "moc_viewconfigurefilterpage.cpp"
137#endif //KAB_EMBEDDED 140#endif //KAB_EMBEDDED
diff --git a/kaddressbook/viewconfigurefilterpage.h b/kaddressbook/viewconfigurefilterpage.h
index 3be9564..fb39a61 100644
--- a/kaddressbook/viewconfigurefilterpage.h
+++ b/kaddressbook/viewconfigurefilterpage.h
@@ -23,13 +23,13 @@
23 23
24#ifndef VIEWCONFIGUREFILTERPAGE 24#ifndef VIEWCONFIGUREFILTERPAGE
25#define VIEWCONFIGUREFILTERPAGE 25#define VIEWCONFIGUREFILTERPAGE
26 26
27#include <qwidget.h> 27#include <qwidget.h>
28 28
29class QButtonGroup; 29class Q3ButtonGroup;
30 30
31#ifndef KAB_EMBEDDED 31#ifndef KAB_EMBEDDED
32class KComboBox; 32class KComboBox;
33#else //KAB_EMBEDDED 33#else //KAB_EMBEDDED
34class QComboBox; 34class QComboBox;
35#endif //KAB_EMBEDDED 35#endif //KAB_EMBEDDED
@@ -54,10 +54,10 @@ class ViewConfigureFilterPage : public QWidget
54#ifndef KAB_EMBEDDED 54#ifndef KAB_EMBEDDED
55 KComboBox *mFilterCombo; 55 KComboBox *mFilterCombo;
56#else //KAB_EMBEDDED 56#else //KAB_EMBEDDED
57 QComboBox *mFilterCombo; 57 QComboBox *mFilterCombo;
58#endif //KAB_EMBEDDED 58#endif //KAB_EMBEDDED
59 59
60 QButtonGroup *mFilterGroup; 60 Q3ButtonGroup *mFilterGroup;
61}; 61};
62 62
63#endif 63#endif
diff --git a/kaddressbook/viewconfigurewidget.cpp b/kaddressbook/viewconfigurewidget.cpp
index 666e188..047df8c 100644
--- a/kaddressbook/viewconfigurewidget.cpp
+++ b/kaddressbook/viewconfigurewidget.cpp
@@ -21,25 +21,28 @@
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24 24
25#ifndef KAB_EMBEDDED 25#ifndef KAB_EMBEDDED
26 26
27#include <qvbox.h> 27#include <q3vbox.h>
28 28
29#include <kapplication.h> 29#include <kapplication.h>
30#include <kconfig.h> 30#include <kconfig.h>
31#include <kdebug.h> 31#include <kdebug.h>
32#include <kiconloader.h> 32#include <kiconloader.h>
33 33
34#include "viewmanager.h" 34#include "viewmanager.h"
35 35
36#endif //KAB_EMBEDDED 36#endif //KAB_EMBEDDED
37 37
38 38
39#include <qlayout.h> 39#include <qlayout.h>
40//Added by qt3to4:
41#include <Q3VBoxLayout>
42#include <QPixmap>
40 43
41#include <kjanuswidget.h> 44#include <kjanuswidget.h>
42#include <kglobal.h> 45#include <kglobal.h>
43#include <klocale.h> 46#include <klocale.h>
44 47
45#include "viewconfigurewidget.h" 48#include "viewconfigurewidget.h"
@@ -47,20 +50,20 @@
47#include "viewconfigurefilterpage.h" 50#include "viewconfigurefilterpage.h"
48 51
49ViewConfigureWidget::ViewConfigureWidget( KABC::AddressBook *ab, QWidget *parent, 52ViewConfigureWidget::ViewConfigureWidget( KABC::AddressBook *ab, QWidget *parent,
50 const char *name ) 53 const char *name )
51 : ConfigureWidget( ab, parent, name ) 54 : ConfigureWidget( ab, parent, name )
52{ 55{
53 QVBoxLayout *topLayout = new QVBoxLayout( this ); 56 Q3VBoxLayout *topLayout = new Q3VBoxLayout( this );
54 57
55 mMainWidget = new KJanusWidget( this, "JanusWidget", KJanusWidget::Tabbed ); 58 mMainWidget = new KJanusWidget( this, "JanusWidget", KJanusWidget::Tabbed );
56 59
57 topLayout->addWidget( mMainWidget ); 60 topLayout->addWidget( mMainWidget );
58 61
59 // Add the first page, the attributes 62 // Add the first page, the attributes
60 QVBox *page = addPage( i18n( "Fields" ), QString::null, 63 Q3VBox *page = addPage( i18n( "Fields" ), QString::null,
61 KGlobal::iconLoader()->loadIcon( "view_detailed", 64 KGlobal::iconLoader()->loadIcon( "view_detailed",
62 KIcon::Panel, 16 ) ); 65 KIcon::Panel, 16 ) );
63 66
64 67
65 // Add the select fields page 68 // Add the select fields page
66 mFieldsPage = new ViewConfigureFieldsPage( addressBook(), (QWidget*)page ); 69 mFieldsPage = new ViewConfigureFieldsPage( addressBook(), (QWidget*)page );
@@ -90,19 +93,19 @@ void ViewConfigureWidget::restoreSettings( KConfig *config )
90void ViewConfigureWidget::saveSettings( KConfig *config ) 93void ViewConfigureWidget::saveSettings( KConfig *config )
91{ 94{
92 mFieldsPage->saveSettings( config ); 95 mFieldsPage->saveSettings( config );
93 mFilterPage->saveSettings( config ); 96 mFilterPage->saveSettings( config );
94} 97}
95 98
96QVBox *ViewConfigureWidget::addPage( const QString &item, const QString &header, 99Q3VBox *ViewConfigureWidget::addPage( const QString &item, const QString &header,
97 const QPixmap &pixmap ) 100 const QPixmap &pixmap )
98{ 101{
99 return mMainWidget->addVBoxPage( item, header, pixmap ); 102 return mMainWidget->addVBoxPage( item, header, pixmap );
100} 103}
101 104
102#include <qframe.h> 105#include <q3frame.h>
103#include <qlabel.h> 106#include <qlabel.h>
104#include <qlayout.h> 107#include <qlayout.h>
105#include <stdlib.h> 108#include <stdlib.h>
106 109
107ViewConfigureDialog::ViewConfigureDialog( ViewConfigureWidget *wdg, const QString &viewName, 110ViewConfigureDialog::ViewConfigureDialog( ViewConfigureWidget *wdg, const QString &viewName,
108 QWidget *parent, const char *name ) 111 QWidget *parent, const char *name )
@@ -149,11 +152,9 @@ void ViewConfigureDialog::slotHelp()
149 kapp->invokeHelp( "using-views" ); 152 kapp->invokeHelp( "using-views" );
150#else //KAB_EMBEDDED 153#else //KAB_EMBEDDED
151 qDebug("ViewConfigureDialog::slotHelp not yet implemented"); 154 qDebug("ViewConfigureDialog::slotHelp not yet implemented");
152#endif //KAB_EMBEDDED 155#endif //KAB_EMBEDDED
153} 156}
154 157
155#ifndef KAB_EMBEDDED 158#ifndef KAB_EMBEDDED_
156#include "viewconfigurewidget.moc" 159#include "moc_viewconfigurewidget.cpp"
157#endif //KAB_EMBEDDED 160#endif //KAB_EMBEDDED
158
159
diff --git a/kaddressbook/viewconfigurewidget.h b/kaddressbook/viewconfigurewidget.h
index 0c2b77c..e3b9b12 100644
--- a/kaddressbook/viewconfigurewidget.h
+++ b/kaddressbook/viewconfigurewidget.h
@@ -25,13 +25,13 @@
25#define VIEWCONFIGUREWIDGET_H 25#define VIEWCONFIGUREWIDGET_H
26 26
27 27
28 28
29#include "configurewidget.h" 29#include "configurewidget.h"
30 30
31class QVBox; 31class Q3VBox;
32 32
33#include <kdialogbase.h> 33#include <kdialogbase.h>
34#include <qpixmap.h> 34#include <qpixmap.h>
35 35
36class KJanusWidget; 36class KJanusWidget;
37class QString; 37class QString;
@@ -71,13 +71,13 @@ class ViewConfigureWidget : public ConfigureWidget
71 virtual void saveSettings( KConfig *config ); 71 virtual void saveSettings( KConfig *config );
72 72
73 73
74 /** 74 /**
75 Use this method to add new pages to the widget. 75 Use this method to add new pages to the widget.
76 */ 76 */
77 QVBox *addPage( const QString &item, const QString &header = QString::null, 77 Q3VBox *addPage( const QString &item, const QString &header = QString::null,
78 const QPixmap &pixmap = QPixmap() ); 78 const QPixmap &pixmap = QPixmap() );
79 79
80 private: 80 private:
81 KJanusWidget *mMainWidget; 81 KJanusWidget *mMainWidget;
82 82
83 ViewConfigureFieldsPage *mFieldsPage; 83 ViewConfigureFieldsPage *mFieldsPage;
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index b5d9419..5cfe3ad 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -47,24 +47,28 @@ $Id$
47#include "views/kaddressbooktableview.h" 47#include "views/kaddressbooktableview.h"
48#include "views/kaddressbookcardview.h" 48#include "views/kaddressbookcardview.h"
49#include "kaddressbookview.h" 49#include "kaddressbookview.h"
50 50
51#include <qaction.h> 51#include <qaction.h>
52#include <qmessagebox.h> 52#include <qmessagebox.h>
53#include <qpopupmenu.h> 53#include <q3popupmenu.h>
54//Added by qt3to4:
55#include <Q3HBoxLayout>
56#include <QDropEvent>
54#include <kconfigbase.h> 57#include <kconfigbase.h>
55 58
56#endif //KAB_EMBEDDED 59#endif //KAB_EMBEDDED
57 60
58 61
59#include <kdebug.h> 62#include <kdebug.h>
60#include <kactionclasses.h> 63#include <kactionclasses.h>
61 64
62#include <qlayout.h> 65#include <qlayout.h>
63#include <qapplication.h> 66#include <qapplication.h>
64#include <qwidgetstack.h> 67#include <QDesktopWidget>
68#include <q3widgetstack.h>
65 69
66#include <kabc/addressbook.h> 70#include <kabc/addressbook.h>
67#include "filtereditdialog.h" 71#include "filtereditdialog.h"
68#include "addviewdialog.h" 72#include "addviewdialog.h"
69#include "kabcore.h" 73#include "kabcore.h"
70#include "kabprefs.h" 74#include "kabprefs.h"
@@ -114,13 +118,13 @@ void ViewManager::restoreSettings()
114 cw = 0; 118 cw = 0;
115 mActionSelectFilter->setComboWidth( cw ); 119 mActionSelectFilter->setComboWidth( cw );
116 // Tell the views to reread their config, since they may have 120 // Tell the views to reread their config, since they may have
117 // been modified by global settings 121 // been modified by global settings
118 QString _oldgroup = mCore->config()->group(); 122 QString _oldgroup = mCore->config()->group();
119 123
120 QDictIterator<KAddressBookView> it( mViewDict ); 124 Q3DictIterator<KAddressBookView> it( mViewDict );
121 for ( it.toFirst(); it.current(); ++it ) { 125 for ( it.toFirst(); it.current(); ++it ) {
122 KConfigGroupSaver saver( mCore->config(), it.currentKey() ); 126 KConfigGroupSaver saver( mCore->config(), it.currentKey() );
123 it.current()->readConfig( mCore->config() ); 127 it.current()->readConfig( mCore->config() );
124 } 128 }
125 setActiveView( activeViewName ); 129 setActiveView( activeViewName );
126 130
@@ -128,13 +132,13 @@ void ViewManager::restoreSettings()
128} 132}
129 133
130void ViewManager::saveSettings() 134void ViewManager::saveSettings()
131{ 135{
132 QString _oldgroup = mCore->config()->group(); 136 QString _oldgroup = mCore->config()->group();
133 137
134 QDictIterator<KAddressBookView> it( mViewDict ); 138 Q3DictIterator<KAddressBookView> it( mViewDict );
135 for ( it.toFirst(); it.current(); ++it ) { 139 for ( it.toFirst(); it.current(); ++it ) {
136 KConfigGroupSaver saver( mCore->config(), it.currentKey() ); 140 KConfigGroupSaver saver( mCore->config(), it.currentKey() );
137#ifdef DESKTOP_VERSION 141#ifdef DESKTOP_VERSION
138 (*it)->writeConfig( mCore->config() ); 142 (*it)->writeConfig( mCore->config() );
139#else 143#else
140 (*it).writeConfig( mCore->config() ); 144 (*it).writeConfig( mCore->config() );
@@ -158,13 +162,13 @@ QStringList ViewManager::selectedUids() const
158 return QStringList(); 162 return QStringList();
159} 163}
160 164
161QStringList ViewManager::selectedEmails() const 165QStringList ViewManager::selectedEmails() const
162{ 166{
163 if ( mActiveView ) 167 if ( mActiveView )
164 return mActiveView->selectedEmails(); 168 return QStringList(mActiveView->selectedEmails());
165 else 169 else
166 return QStringList(); 170 return QStringList();
167} 171}
168 172
169KABC::Addressee::List ViewManager::selectedAddressees() const 173KABC::Addressee::List ViewManager::selectedAddressees() const
170{ 174{
@@ -553,13 +557,13 @@ void ViewManager::startDrag()
553 QStringList uidList = selectedUids(); 557 QStringList uidList = selectedUids();
554 QStringList::Iterator iter; 558 QStringList::Iterator iter;
555 for ( iter = uidList.begin(); iter != uidList.end(); ++iter ) 559 for ( iter = uidList.begin(); iter != uidList.end(); ++iter )
556 addrList.append( mCore->addressBook()->findByUid( *iter ) ); 560 addrList.append( mCore->addressBook()->findByUid( *iter ) );
557 561
558 KMultipleDrag *drag = new KMultipleDrag( this ); 562 KMultipleDrag *drag = new KMultipleDrag( this );
559 drag->addDragObject( new QTextDrag( AddresseeUtil::addresseesToClipboard(addrList), this ) ); 563 drag->addDragObject( new Q3TextDrag( AddresseeUtil::addresseesToClipboard(addrList), this ) );
560 KABC::Addressee::List::Iterator it; 564 KABC::Addressee::List::Iterator it;
561 QStringList vcards; 565 QStringList vcards;
562 for ( it = addrList.begin(); it != addrList.end(); ++it ) { 566 for ( it = addrList.begin(); it != addrList.end(); ++it ) {
563 QString vcard = QString::null; 567 QString vcard = QString::null;
564 KABC::VCardConverter converter; 568 KABC::VCardConverter converter;
565 if ( converter.addresseeToVCard( *it, vcard ) ) 569 if ( converter.addresseeToVCard( *it, vcard ) )
@@ -656,15 +660,15 @@ int ViewManager::filterPosition( const QString &name ) const
656void ViewManager::initActions() 660void ViewManager::initActions()
657{ 661{
658//US <ActionList name="view_loadedviews"/> 662//US <ActionList name="view_loadedviews"/>
659//US <Separator/> 663//US <Separator/>
660 664
661#ifdef KAB_EMBEDDED 665#ifdef KAB_EMBEDDED
662 QPopupMenu *viewmenu = (QPopupMenu*)mCore->getViewMenu(); 666 Q3PopupMenu *viewmenu = (Q3PopupMenu*)mCore->getViewMenu();
663 QPopupMenu *settingsmenu = (QPopupMenu*)mCore->getSettingsMenu(); 667 Q3PopupMenu *settingsmenu = (Q3PopupMenu*)mCore->getSettingsMenu();
664 QPopupMenu *filtermenu = (QPopupMenu*)mCore->getFilterMenu(); 668 Q3PopupMenu *filtermenu = (Q3PopupMenu*)mCore->getFilterMenu();
665#endif //KAB_EMBEDDED 669#endif //KAB_EMBEDDED
666 670
667 mActionSelectView = new KSelectAction( i18n( "Select View" ), 0, mCore->actionCollection(), "select_view" ); 671 mActionSelectView = new KSelectAction( i18n( "Select View" ), 0, mCore->actionCollection(), "select_view" );
668#if KDE_VERSION >= 309 672#if KDE_VERSION >= 309
669 mActionSelectView->setMenuAccelsEnabled( false ); 673 mActionSelectView->setMenuAccelsEnabled( false );
670#endif 674#endif
@@ -735,14 +739,14 @@ void ViewManager::initActions()
735#endif //KAB_EMBEDDED 739#endif //KAB_EMBEDDED
736 740
737} 741}
738 742
739void ViewManager::initGUI() 743void ViewManager::initGUI()
740{ 744{
741 QHBoxLayout *layout = new QHBoxLayout( this, 0, 0 ); 745 Q3HBoxLayout *layout = new Q3HBoxLayout( this, 0, 0 );
742 mViewWidgetStack = new QWidgetStack( this ); 746 mViewWidgetStack = new Q3WidgetStack( this );
743 layout->addWidget( mViewWidgetStack ); 747 layout->addWidget( mViewWidgetStack );
744} 748}
745 749
746#ifndef KAB_EMBEDDED 750#ifndef KAB_EMBEDDED_
747#include "viewmanager.moc" 751#include "moc_viewmanager.cpp"
748#endif //KAB_EMBEDDED 752#endif //KAB_EMBEDDED
diff --git a/kaddressbook/viewmanager.h b/kaddressbook/viewmanager.h
index ab5d372..4bbdbc7 100644
--- a/kaddressbook/viewmanager.h
+++ b/kaddressbook/viewmanager.h
@@ -23,21 +23,23 @@
23 23
24#ifndef VIEWMANAGER_H 24#ifndef VIEWMANAGER_H
25#define VIEWMANAGER_H 25#define VIEWMANAGER_H
26 26
27#include <qwidget.h> 27#include <qwidget.h>
28#include <qstringlist.h> 28#include <qstringlist.h>
29//Added by qt3to4:
30#include <QDropEvent>
29#include <kaddressbookview.h> 31#include <kaddressbookview.h>
30#include <qdict.h> 32#include <q3dict.h>
31#include "filter.h" 33#include "filter.h"
32 34
33class KAction; 35class KAction;
34class KSelectAction; 36class KSelectAction;
35 37
36class KABCore; 38class KABCore;
37class QWidgetStack; 39class Q3WidgetStack;
38class QDropEvent; 40class QDropEvent;
39 41
40namespace KABC { class AddressBook; } 42namespace KABC { class AddressBook; }
41 43
42/** 44/**
43 The view manager manages the views and everything related to them. The 45 The view manager manages the views and everything related to them. The
@@ -142,17 +144,17 @@ class ViewManager : public QWidget
142 144
143 KABCore *mCore; 145 KABCore *mCore;
144 146
145 Filter mCurrentFilter; 147 Filter mCurrentFilter;
146 Filter::List mFilterList; 148 Filter::List mFilterList;
147 149
148 QDict<KAddressBookView> mViewDict; 150 Q3Dict<KAddressBookView> mViewDict;
149 QDict<ViewFactory> mViewFactoryDict; 151 Q3Dict<ViewFactory> mViewFactoryDict;
150 QStringList mViewNameList; 152 QStringList mViewNameList;
151 153
152 QWidgetStack *mViewWidgetStack; 154 Q3WidgetStack *mViewWidgetStack;
153 KAddressBookView *mActiveView; 155 KAddressBookView *mActiveView;
154 156
155 KAction *mActionDeleteView; 157 KAction *mActionDeleteView;
156 KSelectAction *mActionSelectFilter; 158 KSelectAction *mActionSelectFilter;
157 KSelectAction *mActionSelectView; 159 KSelectAction *mActionSelectView;
158 160
diff --git a/kaddressbook/views/cardview.cpp b/kaddressbook/views/cardview.cpp
index b6e053f..1a29f41 100644
--- a/kaddressbook/views/cardview.cpp
+++ b/kaddressbook/views/cardview.cpp
@@ -31,12 +31,20 @@
31#include <qdatetime.h> 31#include <qdatetime.h>
32#include <qlabel.h> 32#include <qlabel.h>
33#include <qstyle.h> 33#include <qstyle.h>
34#include <qcursor.h> 34#include <qcursor.h>
35#include <qtooltip.h> 35#include <qtooltip.h>
36#include <qapplication.h> 36#include <qapplication.h>
37//Added by qt3to4:
38#include <QKeyEvent>
39#include <Q3PtrList>
40#include <QResizeEvent>
41#include <QFocusEvent>
42#include <QMouseEvent>
43#include <QEvent>
44#include <QWheelEvent>
37 45
38#include "kabprefs.h" 46#include "kabprefs.h"
39#include <kdebug.h> 47#include <kdebug.h>
40#include <kglobalsettings.h> 48#include <kglobalsettings.h>
41//END includes 49//END includes
42 50
@@ -68,17 +76,17 @@ class CardViewTip : public QLabel {
68 76
69 77
70// 78//
71// Warning: make sure you use findRef() instead of find() to find an 79// Warning: make sure you use findRef() instead of find() to find an
72// item! Only the pointer value is unique in the list. 80// item! Only the pointer value is unique in the list.
73// 81//
74class CardViewItemList : public QPtrList<CardViewItem> 82class CardViewItemList : public Q3PtrList<CardViewItem>
75{ 83{
76 protected: 84 protected:
77 virtual int compareItems(QPtrCollection::Item item1, 85 virtual int compareItems(Q3PtrCollection::Item item1,
78 QPtrCollection::Item item2) 86 Q3PtrCollection::Item item2)
79 { 87 {
80 CardViewItem *cItem1 = (CardViewItem*)item1; 88 CardViewItem *cItem1 = (CardViewItem*)item1;
81 CardViewItem *cItem2 = (CardViewItem*)item2; 89 CardViewItem *cItem2 = (CardViewItem*)item2;
82 90
83 if ( cItem1 == cItem2 ) 91 if ( cItem1 == cItem2 )
84 return 0; 92 return 0;
@@ -158,13 +166,13 @@ class CardViewPrivate
158 mResizeAnchor(0), 166 mResizeAnchor(0),
159 mRubberBandAnchor( 0 ), 167 mRubberBandAnchor( 0 ),
160 mCompText( QString::null ) 168 mCompText( QString::null )
161 {}; 169 {};
162 170
163 CardViewItemList mItemList; 171 CardViewItemList mItemList;
164 QPtrList<CardViewSeparator> mSeparatorList; 172 Q3PtrList<CardViewSeparator> mSeparatorList;
165 QFontMetrics *mFm; 173 QFontMetrics *mFm;
166 QFontMetrics *mBFm; // bold font 174 QFontMetrics *mBFm; // bold font
167 QFont mHeaderFont; // custom header font 175 QFont mHeaderFont; // custom header font
168 CardView::SelectionMode mSelectionMode; 176 CardView::SelectionMode mSelectionMode;
169 bool mDrawCardBorder; 177 bool mDrawCardBorder;
170 bool mDrawFieldLabels; 178 bool mDrawFieldLabels;
@@ -205,13 +213,13 @@ class CardViewItemPrivate
205 mSelected( false ), 213 mSelected( false ),
206 x( 0 ), 214 x( 0 ),
207 y( 0 ){}; 215 y( 0 ){};
208 216
209 217
210 QString mCaption; 218 QString mCaption;
211 QPtrList< CardViewItem::Field > mFieldList; 219 Q3PtrList< CardViewItem::Field > mFieldList;
212 bool mSelected; 220 bool mSelected;
213 int x; // horizontal position, set by the view 221 int x; // horizontal position, set by the view
214 int y; // vertical position, set by the view 222 int y; // vertical position, set by the view
215 int maxLabelWidth; // the width of the widest label, according to the view font. 223 int maxLabelWidth; // the width of the widest label, according to the view font.
216 int hcache; // height cache 224 int hcache; // height cache
217}; 225};
@@ -310,13 +318,13 @@ void CardViewItem::paintCard(QPainter *p, QColorGroup &cg)
310 else 318 else
311 p->setPen(cg.buttonText()); 319 p->setPen(cg.buttonText());
312 p->drawText(2+mg, 2+mg + bFm.ascent()/*bFm.height()*//*-bFm.descent()*//*-bFm.leading()*/, trimString(d->mCaption, w-4, bFm)); 320 p->drawText(2+mg, 2+mg + bFm.ascent()/*bFm.height()*//*-bFm.descent()*//*-bFm.leading()*/, trimString(d->mCaption, w-4, bFm));
313 p->restore(); 321 p->restore();
314 322
315 // Go through the fields and draw them 323 // Go through the fields and draw them
316 QPtrListIterator< CardViewItem::Field > iter(d->mFieldList); 324 Q3PtrListIterator< CardViewItem::Field > iter(d->mFieldList);
317 QString label, value; 325 QString label, value;
318 int yPos = mg + 4 + bFm.height()/* + 1*/ + fm.height(); // why the + 1 ??? (anders) 326 int yPos = mg + 4 + bFm.height()/* + 1*/ + fm.height(); // why the + 1 ??? (anders)
319 p->setPen(cg.text()); 327 p->setPen(cg.text());
320 328
321 int fh = fm.height(); 329 int fh = fm.height();
322 int cln( 0 ); 330 int cln( 0 );
@@ -405,18 +413,18 @@ int CardViewItem::height( bool allowCache ) const
405 bool sef = mView->showEmptyFields(); 413 bool sef = mView->showEmptyFields();
406 int fh = mView->d->mFm->height();//lineSpacing(); // font height 414 int fh = mView->d->mFm->height();//lineSpacing(); // font height
407 //int sp = QMAX( 0, 2- mView->d->mFm->leading() ); // field spacing NOTE make a property 415 //int sp = QMAX( 0, 2- mView->d->mFm->leading() ); // field spacing NOTE make a property
408 int fieldHeight = 0; 416 int fieldHeight = 0;
409 int lines; 417 int lines;
410 int maxLines( mView->maxFieldLines() ); 418 int maxLines( mView->maxFieldLines() );
411 QPtrListIterator< CardViewItem::Field > iter(d->mFieldList); 419 Q3PtrListIterator< CardViewItem::Field > iter(d->mFieldList);
412 for (iter.toFirst(); iter.current(); ++iter) 420 for (iter.toFirst(); iter.current(); ++iter)
413 { 421 {
414 if ( !sef && (*iter)->second.isEmpty() ) 422 if ( !sef && (*iter)->second.isEmpty() )
415 continue; 423 continue;
416 lines = QMIN( (*iter)->second.contains('\n') + 1, maxLines ); 424 lines = QMIN( (*iter)->second.count('\n') + 1, maxLines );
417 fieldHeight += ( lines * fh ) + 2;//sp; 425 fieldHeight += ( lines * fh ) + 2;//sp;
418 } 426 }
419 427
420 // height of caption font (bold) 428 // height of caption font (bold)
421 fieldHeight += mView->d->mBFm->height(); 429 fieldHeight += mView->d->mBFm->height();
422 d->hcache = baseHeight + fieldHeight; 430 d->hcache = baseHeight + fieldHeight;
@@ -447,13 +455,13 @@ void CardViewItem::insertField(const QString &label, const QString &value)
447} 455}
448 456
449void CardViewItem::removeField(const QString &label) 457void CardViewItem::removeField(const QString &label)
450{ 458{
451 CardViewItem::Field *f; 459 CardViewItem::Field *f;
452 460
453 QPtrListIterator< CardViewItem::Field > iter(d->mFieldList); 461 Q3PtrListIterator< CardViewItem::Field > iter(d->mFieldList);
454 for (iter.toFirst(); iter.current(); ++iter) 462 for (iter.toFirst(); iter.current(); ++iter)
455 { 463 {
456 f = *iter; 464 f = *iter;
457 if (f->first == label) 465 if (f->first == label)
458 break; 466 break;
459 } 467 }
@@ -520,13 +528,13 @@ void CardViewItem::setCaption(const QString &caption)
520 d->mCaption = caption; 528 d->mCaption = caption;
521 repaintCard(); 529 repaintCard();
522} 530}
523 531
524QString CardViewItem::fieldValue(const QString &label) 532QString CardViewItem::fieldValue(const QString &label)
525{ 533{
526 QPtrListIterator< CardViewItem::Field > iter(d->mFieldList); 534 Q3PtrListIterator< CardViewItem::Field > iter(d->mFieldList);
527 for (iter.toFirst(); iter.current(); ++iter) 535 for (iter.toFirst(); iter.current(); ++iter)
528 if ((*iter)->first == label) 536 if ((*iter)->first == label)
529 return (*iter)->second; 537 return (*iter)->second;
530 538
531 return QString(); 539 return QString();
532} 540}
@@ -566,13 +574,13 @@ void CardViewItem::showFullString( const QPoint &itempos, CardViewTip *tip )
566 bool se = mView->showEmptyFields(); 574 bool se = mView->showEmptyFields();
567 int fh = mView->d->mFm->height(); 575 int fh = mView->d->mFm->height();
568// { 576// {
569 Field *_f; 577 Field *_f;
570 for (_f = d->mFieldList.first(); _f != f; _f = d->mFieldList.next()) 578 for (_f = d->mFieldList.first(); _f != f; _f = d->mFieldList.next())
571 if ( se || ! _f->second.isEmpty() ) 579 if ( se || ! _f->second.isEmpty() )
572 y += ( QMIN(_f->second.contains('\n')+1, maxLines) * fh ) + 2; 580 y += ( QMIN(_f->second.count('\n')+1, maxLines) * fh ) + 2;
573// } 581// }
574 if ( isLabel && itempos.y() > y + fh ) 582 if ( isLabel && itempos.y() > y + fh )
575 return; 583 return;
576 // label or data? 584 // label or data?
577 s = isLabel ? f->first : f->second; 585 s = isLabel ? f->first : f->second;
578 // trimmed? 586 // trimmed?
@@ -583,13 +591,13 @@ void CardViewItem::showFullString( const QPoint &itempos, CardViewTip *tip )
583 int mw = isLabel ? lw - colonWidth : w - lw - (mrg*2); // max width for string 591 int mw = isLabel ? lw - colonWidth : w - lw - (mrg*2); // max width for string
584 if ( isLabel ) 592 if ( isLabel )
585 { 593 {
586 trimmed = mView->d->mFm->width( s ) > mw - colonWidth; 594 trimmed = mView->d->mFm->width( s ) > mw - colonWidth;
587 } else { 595 } else {
588 QRect r( mView->d->mFm->boundingRect( 0, 0, INT_MAX, INT_MAX, Qt::AlignTop|Qt::AlignLeft, s ) ); 596 QRect r( mView->d->mFm->boundingRect( 0, 0, INT_MAX, INT_MAX, Qt::AlignTop|Qt::AlignLeft, s ) );
589 trimmed = r.width() > mw || r.height()/fh > QMIN(s.contains('\n') + 1, maxLines); 597 trimmed = r.width() > mw || r.height()/fh > QMIN(s.count('\n') + 1, maxLines);
590 } 598 }
591 } 599 }
592 if ( trimmed ) 600 if ( trimmed )
593 { 601 {
594 tip->setFont( (isLabel && !lw) ? mView->headerFont() : mView->font() ); // if condition is true, a header 602 tip->setFont( (isLabel && !lw) ? mView->headerFont() : mView->font() ); // if condition is true, a header
595 tip->setText( s ); 603 tip->setText( s );
@@ -623,24 +631,24 @@ CardViewItem::Field *CardViewItem::fieldAt( const QPoint & itempos ) const
623 int fh = mView->d->mFm->height(); 631 int fh = mView->d->mFm->height();
624 int maxLines = mView->maxFieldLines(); 632 int maxLines = mView->maxFieldLines();
625 Field *f; 633 Field *f;
626 for ( f = d->mFieldList.first(); f; f = d->mFieldList.next() ) 634 for ( f = d->mFieldList.first(); f; f = d->mFieldList.next() )
627 { 635 {
628 if ( showEmpty || !f->second.isEmpty() ) 636 if ( showEmpty || !f->second.isEmpty() )
629 ypos += ( QMIN( f->second.contains('\n')+1, maxLines ) *fh)+2; 637 ypos += ( QMIN( f->second.count('\n')+1, maxLines ) *fh)+2;
630 if ( iy <= ypos ) 638 if ( iy <= ypos )
631 break; 639 break;
632 } 640 }
633 return f ? f : 0; 641 return f ? f : 0;
634} 642}
635//END CardViewItem 643//END CardViewItem
636 644
637//BEGIN CardView 645//BEGIN CardView
638 646
639CardView::CardView(QWidget *parent, const char *name) 647CardView::CardView(QWidget *parent, const char *name)
640 : QScrollView(parent, name), 648 : Q3ScrollView(parent, name),
641 d(new CardViewPrivate()) 649 d(new CardViewPrivate())
642{ 650{
643 mFlagKeyPressed = false; 651 mFlagKeyPressed = false;
644 mFlagBlockKeyPressed = false; 652 mFlagBlockKeyPressed = false;
645 d->mItemList.setAutoDelete(true); 653 d->mItemList.setAutoDelete(true);
646 d->mSeparatorList.setAutoDelete(true); 654 d->mSeparatorList.setAutoDelete(true);
@@ -653,19 +661,19 @@ CardView::CardView(QWidget *parent, const char *name)
653 d->mTip = ( new CardViewTip( viewport() ) ), 661 d->mTip = ( new CardViewTip( viewport() ) ),
654 d->mTip->hide(); 662 d->mTip->hide();
655 d->mTimer = ( new QTimer(this, "mouseTimer") ), 663 d->mTimer = ( new QTimer(this, "mouseTimer") ),
656 664
657 viewport()->setMouseTracking( true ); 665 viewport()->setMouseTracking( true );
658 viewport()->setFocusProxy(this); 666 viewport()->setFocusProxy(this);
659 viewport()->setFocusPolicy(WheelFocus); 667 viewport()->setFocusPolicy(Qt::WheelFocus);
660 viewport()->setBackgroundMode(PaletteBase); 668 viewport()->setBackgroundMode(Qt::PaletteBase);
661 669
662 connect( d->mTimer, SIGNAL(timeout()), this, SLOT(tryShowFullText()) ); 670 connect( d->mTimer, SIGNAL(timeout()), this, SLOT(tryShowFullText()) );
663 671
664//US setBackgroundMode(PaletteBackground, PaletteBase); 672//US setBackgroundMode(PaletteBackground, PaletteBase);
665 setBackgroundMode(PaletteBackground); 673 setBackgroundMode(Qt::PaletteBackground);
666 674
667 // no reason for a vertical scrollbar 675 // no reason for a vertical scrollbar
668 setVScrollBarMode(AlwaysOff); 676 setVScrollBarMode(AlwaysOff);
669} 677}
670 678
671CardView::~CardView() 679CardView::~CardView()
@@ -736,13 +744,13 @@ void CardView::setCurrentItem( CardViewItem *item )
736 emit currentChanged( item ); 744 emit currentChanged( item );
737} 745}
738 746
739CardViewItem *CardView::itemAt(const QPoint &viewPos) 747CardViewItem *CardView::itemAt(const QPoint &viewPos)
740{ 748{
741 CardViewItem *item = 0; 749 CardViewItem *item = 0;
742 QPtrListIterator<CardViewItem> iter(d->mItemList); 750 Q3PtrListIterator<CardViewItem> iter(d->mItemList);
743 bool found = false; 751 bool found = false;
744 for (iter.toFirst(); iter.current() && !found; ++iter) 752 for (iter.toFirst(); iter.current() && !found; ++iter)
745 { 753 {
746 item = *iter; 754 item = *iter;
747 //if (item->d->mRect.contains(viewPos)) 755 //if (item->d->mRect.contains(viewPos))
748 if (QRect(item->d->x, item->d->y, d->mItemWidth, item->height()).contains(viewPos)) 756 if (QRect(item->d->x, item->d->y, d->mItemWidth, item->height()).contains(viewPos))
@@ -784,13 +792,13 @@ CardView::SelectionMode CardView::selectionMode() const
784{ 792{
785 return d->mSelectionMode; 793 return d->mSelectionMode;
786} 794}
787 795
788void CardView::selectAll(bool state) 796void CardView::selectAll(bool state)
789{ 797{
790 QPtrListIterator<CardViewItem> iter(d->mItemList); 798 Q3PtrListIterator<CardViewItem> iter(d->mItemList);
791 if (!state) 799 if (!state)
792 { 800 {
793 for (iter.toFirst(); iter.current(); ++iter) 801 for (iter.toFirst(); iter.current(); ++iter)
794 { 802 {
795 if ((*iter)->isSelected()) 803 if ((*iter)->isSelected())
796 { 804 {
@@ -875,13 +883,13 @@ bool CardView::isSelected(CardViewItem *item) const
875 return (item && item->isSelected()); 883 return (item && item->isSelected());
876} 884}
877 885
878CardViewItem *CardView::selectedItem() const 886CardViewItem *CardView::selectedItem() const
879{ 887{
880 // find the first selected item 888 // find the first selected item
881 QPtrListIterator<CardViewItem> iter(d->mItemList); 889 Q3PtrListIterator<CardViewItem> iter(d->mItemList);
882 for (iter.toFirst(); iter.current(); ++iter) 890 for (iter.toFirst(); iter.current(); ++iter)
883 { 891 {
884 if ((*iter)->isSelected()) 892 if ((*iter)->isSelected())
885 return *iter; 893 return *iter;
886 } 894 }
887 895
@@ -952,13 +960,13 @@ void CardView::drawContents(QPainter *p, int clipx, int clipy,
952 CardViewItem *item; 960 CardViewItem *item;
953 CardViewSeparator *sep; 961 CardViewSeparator *sep;
954 // make sure the viewport is a pure background 962 // make sure the viewport is a pure background
955 viewport()->erase( QRect ( cX, cY , clipw, cliph ) ); 963 viewport()->erase( QRect ( cX, cY , clipw, cliph ) );
956 964
957 // Now tell the cards to draw, if they are in the clip region 965 // Now tell the cards to draw, if they are in the clip region
958 QPtrListIterator<CardViewItem> iter(d->mItemList); 966 Q3PtrListIterator<CardViewItem> iter(d->mItemList);
959 for (iter.toFirst(); iter.current(); ++iter) 967 for (iter.toFirst(); iter.current(); ++iter)
960 { 968 {
961 item = *iter; 969 item = *iter;
962 cardRect.setRect( item->d->x, item->d->y, d->mItemWidth, item->height() ); 970 cardRect.setRect( item->d->x, item->d->y, d->mItemWidth, item->height() );
963 971
964 if (clipRect.intersects(cardRect) || clipRect.contains(cardRect)) 972 if (clipRect.intersects(cardRect) || clipRect.contains(cardRect))
@@ -972,13 +980,13 @@ void CardView::drawContents(QPainter *p, int clipx, int clipy,
972 item->paintCard(p, cg); 980 item->paintCard(p, cg);
973 p->restore(); 981 p->restore();
974 } 982 }
975 } 983 }
976 984
977 // Followed by the separators if they are in the clip region 985 // Followed by the separators if they are in the clip region
978 QPtrListIterator<CardViewSeparator> sepIter(d->mSeparatorList); 986 Q3PtrListIterator<CardViewSeparator> sepIter(d->mSeparatorList);
979 for (sepIter.toFirst(); sepIter.current(); ++sepIter) 987 for (sepIter.toFirst(); sepIter.current(); ++sepIter)
980 { 988 {
981 sep = *sepIter; 989 sep = *sepIter;
982 sepRect = sep->mRect; 990 sepRect = sep->mRect;
983 991
984 if (clipRect.intersects(sepRect) || clipRect.contains(sepRect)) 992 if (clipRect.intersects(sepRect) || clipRect.contains(sepRect))
@@ -990,13 +998,13 @@ void CardView::drawContents(QPainter *p, int clipx, int clipy,
990 } 998 }
991 } 999 }
992} 1000}
993 1001
994void CardView::resizeEvent(QResizeEvent *e) 1002void CardView::resizeEvent(QResizeEvent *e)
995{ 1003{
996 QScrollView::resizeEvent(e); 1004 Q3ScrollView::resizeEvent(e);
997 1005
998 setLayoutDirty(true); 1006 setLayoutDirty(true);
999} 1007}
1000 1008
1001void CardView::calcLayout() 1009void CardView::calcLayout()
1002{ 1010{
@@ -1010,13 +1018,13 @@ void CardView::calcLayout()
1010 int yPos = 0; 1018 int yPos = 0;
1011 int cardSpacing = d->mItemSpacing; 1019 int cardSpacing = d->mItemSpacing;
1012 1020
1013 // delete the old separators 1021 // delete the old separators
1014 d->mSeparatorList.clear(); 1022 d->mSeparatorList.clear();
1015 1023
1016 QPtrListIterator<CardViewItem> iter(d->mItemList); 1024 Q3PtrListIterator<CardViewItem> iter(d->mItemList);
1017 CardViewItem *item = 0; 1025 CardViewItem *item = 0;
1018 CardViewSeparator *sep = 0; 1026 CardViewSeparator *sep = 0;
1019 xPos += cardSpacing; 1027 xPos += cardSpacing;
1020 1028
1021 for (iter.toFirst(); iter.current(); ++iter) 1029 for (iter.toFirst(); iter.current(); ++iter)
1022 { 1030 {
@@ -1053,13 +1061,13 @@ void CardView::calcLayout()
1053 1061
1054 xPos += maxWidth; 1062 xPos += maxWidth;
1055 resizeContents( xPos + cardSpacing, maxHeight ); 1063 resizeContents( xPos + cardSpacing, maxHeight );
1056 1064
1057 // Update the height of all the separators now that we know the 1065 // Update the height of all the separators now that we know the
1058 // max height of a column 1066 // max height of a column
1059 QPtrListIterator<CardViewSeparator> sepIter(d->mSeparatorList); 1067 Q3PtrListIterator<CardViewSeparator> sepIter(d->mSeparatorList);
1060 for (sepIter.toFirst(); sepIter.current(); ++sepIter) 1068 for (sepIter.toFirst(); sepIter.current(); ++sepIter)
1061 { 1069 {
1062 (*sepIter)->mRect.setHeight(maxHeight - 2*cardSpacing - 2*d->mItemMargin); 1070 (*sepIter)->mRect.setHeight(maxHeight - 2*cardSpacing - 2*d->mItemMargin);
1063 } 1071 }
1064 1072
1065 d->mLayoutDirty = false; 1073 d->mLayoutDirty = false;
@@ -1098,13 +1106,13 @@ void CardView::setItemSpacing( uint spacing )
1098 d->mItemSpacing = spacing; 1106 d->mItemSpacing = spacing;
1099 setLayoutDirty( true ); 1107 setLayoutDirty( true );
1100} 1108}
1101 1109
1102void CardView::contentsMousePressEvent(QMouseEvent *e) 1110void CardView::contentsMousePressEvent(QMouseEvent *e)
1103{ 1111{
1104 QScrollView::contentsMousePressEvent(e); 1112 Q3ScrollView::contentsMousePressEvent(e);
1105 1113
1106 QPoint pos = e->pos(); 1114 QPoint pos = e->pos();
1107 d->mLastClickPos = pos; 1115 d->mLastClickPos = pos;
1108 1116
1109 CardViewItem *item = itemAt(pos); 1117 CardViewItem *item = itemAt(pos);
1110 1118
@@ -1168,13 +1176,13 @@ void CardView::contentsMousePressEvent(QMouseEvent *e)
1168 (e->state() & Qt::ShiftButton)) 1176 (e->state() & Qt::ShiftButton))
1169 { 1177 {
1170 if ( item == other ) return; 1178 if ( item == other ) return;
1171 1179
1172 bool s = ! item->isSelected(); 1180 bool s = ! item->isSelected();
1173 1181
1174 if ( s && ! (e->state() & ControlButton) ) 1182 if ( s && ! (e->state() & Qt::ControlButton) )
1175 { 1183 {
1176 bool b = signalsBlocked(); 1184 bool b = signalsBlocked();
1177 blockSignals(true); 1185 blockSignals(true);
1178 selectAll(false); 1186 selectAll(false);
1179 blockSignals(b); 1187 blockSignals(b);
1180 } 1188 }
@@ -1216,13 +1224,13 @@ void CardView::contentsMousePressEvent(QMouseEvent *e)
1216 } 1224 }
1217 1225
1218} 1226}
1219 1227
1220void CardView::contentsMouseReleaseEvent(QMouseEvent *e) 1228void CardView::contentsMouseReleaseEvent(QMouseEvent *e)
1221{ 1229{
1222 QScrollView::contentsMouseReleaseEvent(e); 1230 Q3ScrollView::contentsMouseReleaseEvent(e);
1223 1231
1224 if ( d->mResizeAnchor ) 1232 if ( d->mResizeAnchor )
1225 { 1233 {
1226 // finish the resizing: 1234 // finish the resizing:
1227 unsetCursor(); 1235 unsetCursor();
1228 // hide rubber bands 1236 // hide rubber bands
@@ -1254,13 +1262,13 @@ void CardView::contentsMouseReleaseEvent(QMouseEvent *e)
1254 emit executed(item); 1262 emit executed(item);
1255 } 1263 }
1256} 1264}
1257 1265
1258void CardView::contentsMouseDoubleClickEvent(QMouseEvent *e) 1266void CardView::contentsMouseDoubleClickEvent(QMouseEvent *e)
1259{ 1267{
1260 QScrollView::contentsMouseDoubleClickEvent(e); 1268 Q3ScrollView::contentsMouseDoubleClickEvent(e);
1261 1269
1262 CardViewItem *item = itemAt(e->pos()); 1270 CardViewItem *item = itemAt(e->pos());
1263 1271
1264 if (item) 1272 if (item)
1265 { 1273 {
1266 d->mCurrentItem = item; 1274 d->mCurrentItem = item;
@@ -1299,18 +1307,18 @@ void CardView::contentsMouseMoveEvent( QMouseEvent *e )
1299 { 1307 {
1300 int colcontentw = d->mItemWidth + (2*d->mItemSpacing); 1308 int colcontentw = d->mItemWidth + (2*d->mItemSpacing);
1301 int colw = colcontentw + d->mSepWidth; 1309 int colw = colcontentw + d->mSepWidth;
1302 int m = e->x()%colw; 1310 int m = e->x()%colw;
1303 if ( m >= colcontentw && m > 0 ) 1311 if ( m >= colcontentw && m > 0 )
1304 { 1312 {
1305 setCursor( SplitVCursor ); // Why does this fail sometimes? 1313 setCursor( Qt::SplitVCursor ); // Why does this fail sometimes?
1306 d->mOnSeparator = true; 1314 d->mOnSeparator = true;
1307 } 1315 }
1308 else 1316 else
1309 { 1317 {
1310 setCursor( ArrowCursor ); 1318 setCursor( Qt::ArrowCursor );
1311 d->mOnSeparator = false; 1319 d->mOnSeparator = false;
1312 } 1320 }
1313 } 1321 }
1314} 1322}
1315 1323
1316void CardView::enterEvent( QEvent * ) 1324void CardView::enterEvent( QEvent * )
@@ -1321,13 +1329,13 @@ void CardView::enterEvent( QEvent * )
1321void CardView::leaveEvent( QEvent * ) 1329void CardView::leaveEvent( QEvent * )
1322{ 1330{
1323 d->mTimer->stop(); 1331 d->mTimer->stop();
1324 if (d->mOnSeparator) 1332 if (d->mOnSeparator)
1325 { 1333 {
1326 d->mOnSeparator = false; 1334 d->mOnSeparator = false;
1327 setCursor( ArrowCursor ); 1335 setCursor( Qt::ArrowCursor );
1328 } 1336 }
1329} 1337}
1330 1338
1331void CardView::focusInEvent( QFocusEvent * ) 1339void CardView::focusInEvent( QFocusEvent * )
1332{ 1340{
1333 if (!d->mCurrentItem && d->mItemList.count() ) 1341 if (!d->mCurrentItem && d->mItemList.count() )
@@ -1365,27 +1373,27 @@ void CardView::keyPressEvent( QKeyEvent *e )
1365 uint pos = d->mItemList.findRef( d->mCurrentItem ); 1373 uint pos = d->mItemList.findRef( d->mCurrentItem );
1366 CardViewItem *aItem = 0L; // item that gets the focus 1374 CardViewItem *aItem = 0L; // item that gets the focus
1367 CardViewItem *old = d->mCurrentItem; 1375 CardViewItem *old = d->mCurrentItem;
1368 1376
1369 switch ( e->key() ) 1377 switch ( e->key() )
1370 { 1378 {
1371 case Key_Up: 1379 case Qt::Key_Up:
1372 if ( pos > 0 ) 1380 if ( pos > 0 )
1373 { 1381 {
1374 aItem = d->mItemList.at( pos - 1 ); 1382 aItem = d->mItemList.at( pos - 1 );
1375 setCurrentItem( aItem ); 1383 setCurrentItem( aItem );
1376 } 1384 }
1377 break; 1385 break;
1378 case Key_Down: 1386 case Qt::Key_Down:
1379 if ( pos < d->mItemList.count() - 1 ) 1387 if ( pos < d->mItemList.count() - 1 )
1380 { 1388 {
1381 aItem = d->mItemList.at( pos + 1 ); 1389 aItem = d->mItemList.at( pos + 1 );
1382 setCurrentItem( aItem ); 1390 setCurrentItem( aItem );
1383 } 1391 }
1384 break; 1392 break;
1385 case Key_Left: 1393 case Qt::Key_Left:
1386 { 1394 {
1387 // look for an item in the previous/next column, starting from 1395 // look for an item in the previous/next column, starting from
1388 // the vertical middle of the current item. 1396 // the vertical middle of the current item.
1389 // FIXME use nice calculatd measures!!! 1397 // FIXME use nice calculatd measures!!!
1390 QPoint aPoint( d->mCurrentItem->d->x, d->mCurrentItem->d->y ); 1398 QPoint aPoint( d->mCurrentItem->d->x, d->mCurrentItem->d->y );
1391 aPoint -= QPoint( 30,-(d->mCurrentItem->height()/2) ); 1399 aPoint -= QPoint( 30,-(d->mCurrentItem->height()/2) );
@@ -1397,13 +1405,13 @@ void CardView::keyPressEvent( QKeyEvent *e )
1397 aItem = itemAt( aPoint ); 1405 aItem = itemAt( aPoint );
1398 } 1406 }
1399 if ( aItem ) 1407 if ( aItem )
1400 setCurrentItem( aItem ); 1408 setCurrentItem( aItem );
1401 } 1409 }
1402 break; 1410 break;
1403 case Key_Right: 1411 case Qt::Key_Right:
1404 { 1412 {
1405 // FIXME use nice calculated measures!!! 1413 // FIXME use nice calculated measures!!!
1406 QPoint aPoint( d->mCurrentItem->d->x + d->mItemWidth, d->mCurrentItem->d->y ); 1414 QPoint aPoint( d->mCurrentItem->d->x + d->mItemWidth, d->mCurrentItem->d->y );
1407 aPoint += QPoint( 30,(d->mCurrentItem->height()/2) ); 1415 aPoint += QPoint( 30,(d->mCurrentItem->height()/2) );
1408 aItem = itemAt( aPoint ); 1416 aItem = itemAt( aPoint );
1409 while ( !aItem && aPoint.y() > 27 ) 1417 while ( !aItem && aPoint.y() > 27 )
@@ -1412,34 +1420,34 @@ void CardView::keyPressEvent( QKeyEvent *e )
1412 aItem = itemAt( aPoint ); 1420 aItem = itemAt( aPoint );
1413 } 1421 }
1414 if ( aItem ) 1422 if ( aItem )
1415 setCurrentItem( aItem ); 1423 setCurrentItem( aItem );
1416 } 1424 }
1417 break; 1425 break;
1418 case Key_Home: 1426 case Qt::Key_Home:
1419 aItem = d->mItemList.first(); 1427 aItem = d->mItemList.first();
1420 setCurrentItem( aItem ); 1428 setCurrentItem( aItem );
1421 break; 1429 break;
1422 case Key_End: 1430 case Qt::Key_End:
1423 aItem = d->mItemList.last(); 1431 aItem = d->mItemList.last();
1424 setCurrentItem( aItem ); 1432 setCurrentItem( aItem );
1425 break; 1433 break;
1426 case Key_Prior: // PageUp 1434 case Qt::Key_Prior: // PageUp
1427 { 1435 {
1428 // QListView: "Make the item above the top visible and current" 1436 // QListView: "Make the item above the top visible and current"
1429 // TODO if contentsY(), pick the top item of the leftmost visible column 1437 // TODO if contentsY(), pick the top item of the leftmost visible column
1430 if ( contentsX() <= 0 ) 1438 if ( contentsX() <= 0 )
1431 return; 1439 return;
1432 int cw = columnWidth(); 1440 int cw = columnWidth();
1433 int theCol = ( QMAX( 0, ( contentsX()/cw) * cw ) ) + d->mItemSpacing; 1441 int theCol = ( QMAX( 0, ( contentsX()/cw) * cw ) ) + d->mItemSpacing;
1434 aItem = itemAt( QPoint( theCol + 1, d->mItemSpacing + 1 ) ); 1442 aItem = itemAt( QPoint( theCol + 1, d->mItemSpacing + 1 ) );
1435 if ( aItem ) 1443 if ( aItem )
1436 setCurrentItem( aItem ); 1444 setCurrentItem( aItem );
1437 } 1445 }
1438 break; 1446 break;
1439 case Key_Next: // PageDown 1447 case Qt::Key_Next: // PageDown
1440 { 1448 {
1441 // QListView: "Make the item below the bottom visible and current" 1449 // QListView: "Make the item below the bottom visible and current"
1442 // find the first not fully visible column. 1450 // find the first not fully visible column.
1443 // TODO: consider if a partly visible (or even hidden) item at the 1451 // TODO: consider if a partly visible (or even hidden) item at the
1444 // bottom of the rightmost column exists 1452 // bottom of the rightmost column exists
1445 int cw = columnWidth(); 1453 int cw = columnWidth();
@@ -1455,25 +1463,25 @@ void CardView::keyPressEvent( QKeyEvent *e )
1455 aItem = itemAt( QPoint( theCol, d->mItemSpacing + 1 ) ); 1463 aItem = itemAt( QPoint( theCol, d->mItemSpacing + 1 ) );
1456 1464
1457 if ( aItem ) 1465 if ( aItem )
1458 setCurrentItem( aItem ); 1466 setCurrentItem( aItem );
1459 } 1467 }
1460 break; 1468 break;
1461 case Key_Space: 1469 case Qt::Key_Space:
1462 setSelected( d->mCurrentItem, !d->mCurrentItem->isSelected() ); 1470 setSelected( d->mCurrentItem, !d->mCurrentItem->isSelected() );
1463 emit selectionChanged(); 1471 emit selectionChanged();
1464 break; 1472 break;
1465 case Key_Return: 1473 case Qt::Key_Return:
1466 case Key_Enter: 1474 case Qt::Key_Enter:
1467 { 1475 {
1468 emit returnPressed( d->mCurrentItem ); 1476 emit returnPressed( d->mCurrentItem );
1469 emit executed( d->mCurrentItem ); 1477 emit executed( d->mCurrentItem );
1470 } 1478 }
1471 break; 1479 break;
1472 default: 1480 default:
1473 if ( (e->state() & ControlButton) && e->key() == Key_A ) 1481 if ( (e->state() & Qt::ControlButton) && e->key() == Qt::Key_A )
1474 { 1482 {
1475 // select all 1483 // select all
1476 selectAll( true ); 1484 selectAll( true );
1477 break; 1485 break;
1478 } 1486 }
1479 // if we have a string, do autosearch 1487 // if we have a string, do autosearch
@@ -1485,13 +1493,13 @@ void CardView::keyPressEvent( QKeyEvent *e )
1485 } 1493 }
1486 // handle selection 1494 // handle selection
1487 if ( aItem ) 1495 if ( aItem )
1488 { 1496 {
1489 if ( d->mSelectionMode == CardView::Extended ) 1497 if ( d->mSelectionMode == CardView::Extended )
1490 { 1498 {
1491 if ( (e->state() & ShiftButton) ) 1499 if ( (e->state() & Qt::ShiftButton) )
1492 { 1500 {
1493 // shift button: toggle range 1501 // shift button: toggle range
1494 // if control button is pressed, leave all items 1502 // if control button is pressed, leave all items
1495 // and toggle selection current->old current 1503 // and toggle selection current->old current
1496 // otherwise, ?????? 1504 // otherwise, ??????
1497 bool s = ! aItem->isSelected(); 1505 bool s = ! aItem->isSelected();
@@ -1516,13 +1524,13 @@ void CardView::keyPressEvent( QKeyEvent *e )
1516 item = d->mItemList.at( from ); 1524 item = d->mItemList.at( from );
1517 item->setSelected( s ); 1525 item->setSelected( s );
1518 repaintItem( item ); 1526 repaintItem( item );
1519 } 1527 }
1520 emit selectionChanged(); 1528 emit selectionChanged();
1521 } 1529 }
1522 else if ( (e->state() & ControlButton) ) 1530 else if ( (e->state() & Qt::ControlButton) )
1523 { 1531 {
1524 // control button: do nothing 1532 // control button: do nothing
1525 } 1533 }
1526 else 1534 else
1527 { 1535 {
1528 // no button: move selection to this item 1536 // no button: move selection to this item
@@ -1635,15 +1643,15 @@ void CardView::drawRubberBands( int pos )
1635 1643
1636 int tmpcw = (d->mRubberBandAnchor-d->firstX)/d->span; 1644 int tmpcw = (d->mRubberBandAnchor-d->firstX)/d->span;
1637 int x = d->firstX + tmpcw - d->mSepWidth - contentsX(); 1645 int x = d->firstX + tmpcw - d->mSepWidth - contentsX();
1638 int h = visibleHeight(); 1646 int h = visibleHeight();
1639 1647
1640 QPainter p( viewport() ); 1648 QPainter p( viewport() );
1641 p.setRasterOp( XorROP ); 1649 p.setCompositionMode( QPainter::CompositionMode_Xor );
1642 p.setPen( gray ); 1650 p.setPen( Qt::gray );
1643 p.setBrush( gray ); 1651 p.setBrush( Qt::gray );
1644 uint n = d->first; 1652 uint n = d->first;
1645 // erase 1653 // erase
1646 if ( d->mRubberBandAnchor ) 1654 if ( d->mRubberBandAnchor )
1647 do { 1655 do {
1648 p.drawRect( x, 0, 2, h ); 1656 p.drawRect( x, 0, 2, h );
1649 x += tmpcw; 1657 x += tmpcw;
@@ -1696,13 +1704,13 @@ QFont CardView::headerFont() const
1696{ 1704{
1697 return d->mHeaderFont; 1705 return d->mHeaderFont;
1698} 1706}
1699 1707
1700void CardView::setFont( const QFont &fnt ) 1708void CardView::setFont( const QFont &fnt )
1701{ 1709{
1702 QScrollView::setFont( fnt ); 1710 Q3ScrollView::setFont( fnt );
1703 delete d->mFm; 1711 delete d->mFm;
1704 d->mFm = new QFontMetrics( fnt ); 1712 d->mFm = new QFontMetrics( fnt );
1705} 1713}
1706 1714
1707int CardView::separatorWidth() 1715int CardView::separatorWidth()
1708{ 1716{
@@ -1733,18 +1741,18 @@ void CardView::keyReleaseEvent ( QKeyEvent * e )
1733 if ( !e->isAutoRepeat() ) { 1741 if ( !e->isAutoRepeat() ) {
1734 mFlagBlockKeyPressed = true; 1742 mFlagBlockKeyPressed = true;
1735 qApp->processEvents(); 1743 qApp->processEvents();
1736 mFlagBlockKeyPressed = false; 1744 mFlagBlockKeyPressed = false;
1737 mFlagKeyPressed = false; 1745 mFlagKeyPressed = false;
1738 } 1746 }
1739 QScrollView::keyReleaseEvent ( e ); 1747 Q3ScrollView::keyReleaseEvent ( e );
1740} 1748}
1741 1749
1742 1750
1743 1751
1744 1752
1745 1753
1746//END Cardview 1754//END Cardview
1747 1755
1748#ifndef KAB_EMBEDDED 1756#ifndef KAB_EMBEDDED_
1749#include "cardview.moc" 1757#include "moc_cardview.cpp"
1750#endif //KAB_EMBEDDED 1758#endif //KAB_EMBEDDED
diff --git a/kaddressbook/views/cardview.h b/kaddressbook/views/cardview.h
index 2ea3771..9c245ea 100644
--- a/kaddressbook/views/cardview.h
+++ b/kaddressbook/views/cardview.h
@@ -1,15 +1,23 @@
1#ifndef CARDVIEW_H 1#ifndef CARDVIEW_H
2#define CARDVIEW_H 2#define CARDVIEW_H
3 3
4#include <qscrollview.h> 4#include <q3scrollview.h>
5#include <qptrlist.h> 5#include <q3ptrlist.h>
6#include <qstring.h> 6#include <qstring.h>
7#include <qrect.h> 7#include <qrect.h>
8#include <qpair.h> 8#include <qpair.h>
9#include <qpoint.h> 9#include <qpoint.h>
10//Added by qt3to4:
11#include <QWheelEvent>
12#include <QResizeEvent>
13#include <QFocusEvent>
14#include <QLabel>
15#include <QMouseEvent>
16#include <QKeyEvent>
17#include <QEvent>
10 18
11class QLabel; 19class QLabel;
12class QPainter; 20class QPainter;
13class QResizeEvent; 21class QResizeEvent;
14class QMouseEvent; 22class QMouseEvent;
15class CardView; 23class CardView;
@@ -145,13 +153,13 @@ class CardViewItem
145* 153*
146* The CardView class is designed to mirror the API of the QListView or 154* The CardView class is designed to mirror the API of the QListView or
147* QIconView. The CardView is also completely independant of KAddressBook and 155* QIconView. The CardView is also completely independant of KAddressBook and
148* can be used elsewhere. With the exception of a few simple config checks, 156* can be used elsewhere. With the exception of a few simple config checks,
149* the CardView is also 100% independant of KDE. 157* the CardView is also 100% independant of KDE.
150*/ 158*/
151class CardView : public QScrollView 159class CardView : public Q3ScrollView
152{ 160{
153 friend class CardViewItem; 161 friend class CardViewItem;
154 162
155 Q_OBJECT 163 Q_OBJECT
156 164
157 public: 165 public:
diff --git a/kaddressbook/views/colorlistbox.cpp b/kaddressbook/views/colorlistbox.cpp
index 2bddca6..46a59a1 100644
--- a/kaddressbook/views/colorlistbox.cpp
+++ b/kaddressbook/views/colorlistbox.cpp
@@ -16,41 +16,46 @@
16 * along with this program; if not, write to the Free Software 16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 * 18 *
19 */ 19 */
20 20
21#include <qpainter.h> 21#include <qpainter.h>
22//Added by qt3to4:
23#include <QDragEnterEvent>
24#include <QDropEvent>
25#include <QDragMoveEvent>
26#include <QDragLeaveEvent>
22 27
23#include <kcolordialog.h> 28#include <kcolordialog.h>
24 29
25#ifndef KAB_EMBEDDED 30#ifndef KAB_EMBEDDED
26#include <kcolordrag.h> 31#include <kcolordrag.h>
27#endif //KAB_EMBEDDED 32#endif //KAB_EMBEDDED
28 33
29#include "colorlistbox.h" 34#include "colorlistbox.h"
30#ifdef DESKTOP_VERSION 35#ifdef DESKTOP_VERSION
31#include <qcolordialog.h> 36#include <qcolordialog.h>
32#endif 37#endif
33 38
34ColorListBox::ColorListBox( QWidget *parent, const char *name, WFlags f ) 39ColorListBox::ColorListBox( QWidget *parent, const char *name, Qt::WFlags f )
35 :KListBox( parent, name, f ), mCurrentOnDragEnter(-1) 40 :KListBox( parent, name, f ), mCurrentOnDragEnter(-1)
36{ 41{
37 connect( this, SIGNAL(selected(int)), this, SLOT(newColor(int)) ); 42 connect( this, SIGNAL(selected(int)), this, SLOT(newColor(int)) );
38 connect( this, SIGNAL(clicked(QListBoxItem *)), this, SLOT(slotNewColor(QListBoxItem *)) ); 43 connect( this, SIGNAL(clicked(Q3ListBoxItem *)), this, SLOT(slotNewColor(Q3ListBoxItem *)) );
39 setAcceptDrops( true); 44 setAcceptDrops( true);
40} 45}
41 46
42 47
43void ColorListBox::setEnabled( bool state ) 48void ColorListBox::setEnabled( bool state )
44{ 49{
45 if( state == isEnabled() ) 50 if( state == isEnabled() )
46 { 51 {
47 return; 52 return;
48 } 53 }
49 54
50 QListBox::setEnabled( state ); 55 Q3ListBox::setEnabled( state );
51 for( uint i=0; i<count(); i++ ) 56 for( uint i=0; i<count(); i++ )
52 { 57 {
53 updateItem( i ); 58 updateItem( i );
54 } 59 }
55} 60}
56 61
@@ -72,16 +77,16 @@ QColor ColorListBox::color( uint index ) const
72 { 77 {
73 ColorListItem *colorItem = (ColorListItem*)item(index); 78 ColorListItem *colorItem = (ColorListItem*)item(index);
74 return( colorItem->color() ); 79 return( colorItem->color() );
75 } 80 }
76 else 81 else
77 { 82 {
78 return( black ); 83 return( Qt::black );
79 } 84 }
80} 85}
81void ColorListBox::slotNewColor(QListBoxItem * i) 86void ColorListBox::slotNewColor(Q3ListBoxItem * i)
82{ 87{
83 if ( i ) 88 if ( i )
84 newColor( index( i ) ); 89 newColor( index( i ) );
85} 90}
86 91
87void ColorListBox::newColor( int index ) 92void ColorListBox::newColor( int index )
@@ -195,13 +200,13 @@ qDebug("ColorListBox::dropEvent drag&drop currently not supported");
195 200
196} 201}
197 202
198 203
199 204
200ColorListItem::ColorListItem( const QString &text, const QColor &color ) 205ColorListItem::ColorListItem( const QString &text, const QColor &color )
201 : QListBoxItem(), mColor( color ), mBoxWidth( 30 ) 206 : Q3ListBoxItem(), mColor( color ), mBoxWidth( 30 )
202{ 207{
203 setText( text ); 208 setText( text );
204} 209}
205 210
206 211
207const QColor &ColorListItem::color( void ) 212const QColor &ColorListItem::color( void )
@@ -226,20 +231,20 @@ void ColorListItem::paint( QPainter *p )
226 p->setPen( Qt::black ); 231 p->setPen( Qt::black );
227 p->drawRect( 3, 1, mBoxWidth, h-1 ); 232 p->drawRect( 3, 1, mBoxWidth, h-1 );
228 p->fillRect( 4, 2, mBoxWidth-2, h-3, mColor ); 233 p->fillRect( 4, 2, mBoxWidth-2, h-3, mColor );
229} 234}
230 235
231 236
232int ColorListItem::height(const QListBox *lb ) const 237int ColorListItem::height(const Q3ListBox *lb ) const
233{ 238{
234 return( lb->fontMetrics().lineSpacing()+1 ); 239 return( lb->fontMetrics().lineSpacing()+1 );
235} 240}
236 241
237 242
238int ColorListItem::width(const QListBox *lb ) const 243int ColorListItem::width(const Q3ListBox *lb ) const
239{ 244{
240 return( mBoxWidth + lb->fontMetrics().width( text() ) + 6 ); 245 return( mBoxWidth + lb->fontMetrics().width( text() ) + 6 );
241} 246}
242 247
243#ifndef KAB_EMBEDDED 248#ifndef KAB_EMBEDDED_
244#include "colorlistbox.moc" 249#include "moc_colorlistbox.cpp"
245#endif //KAB_EMBEDDED 250#endif //KAB_EMBEDDED
diff --git a/kaddressbook/views/colorlistbox.h b/kaddressbook/views/colorlistbox.h
index bb91484..31a8085 100644
--- a/kaddressbook/views/colorlistbox.h
+++ b/kaddressbook/views/colorlistbox.h
@@ -19,24 +19,29 @@
19 */ 19 */
20 20
21#ifndef _COLOR_LISTBOX_H_ 21#ifndef _COLOR_LISTBOX_H_
22#define _COLOR_LISTBOX_H_ 22#define _COLOR_LISTBOX_H_
23 23
24#include <klistbox.h> 24#include <klistbox.h>
25//Added by qt3to4:
26#include <QDragMoveEvent>
27#include <QDragLeaveEvent>
28#include <QDropEvent>
29#include <QDragEnterEvent>
25 30
26class QDragEnterEvent; 31class QDragEnterEvent;
27class QDragLeaveEvent; 32class QDragLeaveEvent;
28class QDragMoveEvent; 33class QDragMoveEvent;
29class QDropEvent; 34class QDropEvent;
30 35
31class ColorListBox : public KListBox 36class ColorListBox : public KListBox
32{ 37{
33 Q_OBJECT 38 Q_OBJECT
34 39
35 public: 40 public:
36 ColorListBox( QWidget *parent=0, const char * name=0, WFlags f=0 ); 41 ColorListBox( QWidget *parent=0, const char * name=0, Qt::WFlags f=0 );
37 void setColor( uint index, const QColor &color ); 42 void setColor( uint index, const QColor &color );
38 QColor color( uint index ) const; 43 QColor color( uint index ) const;
39 44
40 public slots: 45 public slots:
41 virtual void setEnabled( bool state ); 46 virtual void setEnabled( bool state );
42 47
@@ -45,31 +50,31 @@ class ColorListBox : public KListBox
45 void dragLeaveEvent( QDragLeaveEvent *e ); 50 void dragLeaveEvent( QDragLeaveEvent *e );
46 void dragMoveEvent( QDragMoveEvent *e ); 51 void dragMoveEvent( QDragMoveEvent *e );
47 void dropEvent( QDropEvent *e ); 52 void dropEvent( QDropEvent *e );
48 53
49 private slots: 54 private slots:
50 void newColor( int index ); 55 void newColor( int index );
51 void slotNewColor(QListBoxItem * i); 56 void slotNewColor(Q3ListBoxItem * i);
52 57
53 private: 58 private:
54 int mCurrentOnDragEnter; 59 int mCurrentOnDragEnter;
55 60
56}; 61};
57 62
58 63
59class ColorListItem : public QListBoxItem 64class ColorListItem : public Q3ListBoxItem
60{ 65{
61 public: 66 public:
62 ColorListItem( const QString &text, const QColor &color=Qt::black ); 67 ColorListItem( const QString &text, const QColor &color=Qt::black );
63 const QColor &color( void ); 68 const QColor &color( void );
64 void setColor( const QColor &color ); 69 void setColor( const QColor &color );
65 70
66 protected: 71 protected:
67 virtual void paint( QPainter * ); 72 virtual void paint( QPainter * );
68 virtual int height( const QListBox * ) const; 73 virtual int height( const Q3ListBox * ) const;
69 virtual int width( const QListBox * ) const; 74 virtual int width( const Q3ListBox * ) const;
70 75
71 private: 76 private:
72 QColor mColor; 77 QColor mColor;
73 int mBoxWidth; 78 int mBoxWidth;
74}; 79};
75 80
diff --git a/kaddressbook/views/configurecardviewdialog.cpp b/kaddressbook/views/configurecardviewdialog.cpp
index e0fbd21..b6327fe 100644
--- a/kaddressbook/views/configurecardviewdialog.cpp
+++ b/kaddressbook/views/configurecardviewdialog.cpp
@@ -22,17 +22,20 @@
22*/ 22*/
23 23
24#include <qstring.h> 24#include <qstring.h>
25#include <qlayout.h> 25#include <qlayout.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qcheckbox.h> 27#include <qcheckbox.h>
28#include <qvbox.h> 28#include <q3vbox.h>
29#include <qgroupbox.h> 29#include <q3groupbox.h>
30#include <qspinbox.h> 30#include <qspinbox.h>
31#include <qtabwidget.h> 31#include <qtabwidget.h>
32#include <qwhatsthis.h> 32#include <q3whatsthis.h>
33//Added by qt3to4:
34#include <Q3GridLayout>
35#include <Q3Frame>
33 36
34#include <kdebug.h> 37#include <kdebug.h>
35#include <kglobal.h> 38#include <kglobal.h>
36#include <kglobalsettings.h> 39#include <kglobalsettings.h>
37#include <klocale.h> 40#include <klocale.h>
38#include <kiconloader.h> 41#include <kiconloader.h>
@@ -86,13 +89,13 @@ void ConfigureCardViewWidget::saveSettings( KConfig *config )
86 mAdvancedPage->saveSettings( config ); 89 mAdvancedPage->saveSettings( config );
87} 90}
88 91
89//////////////////////// 92////////////////////////
90// CardViewLookNFeelPage 93// CardViewLookNFeelPage
91CardViewLookNFeelPage::CardViewLookNFeelPage( QWidget *parent, const char *name ) 94CardViewLookNFeelPage::CardViewLookNFeelPage( QWidget *parent, const char *name )
92 : QVBox( parent, name ) 95 : Q3VBox( parent, name )
93{ 96{
94 initGUI(); 97 initGUI();
95} 98}
96 99
97CardViewLookNFeelPage::~CardViewLookNFeelPage() 100CardViewLookNFeelPage::~CardViewLookNFeelPage()
98{ 101{
@@ -231,124 +234,124 @@ void CardViewLookNFeelPage::initGUI()
231 int spacing = KDialog::spacingHint(); 234 int spacing = KDialog::spacingHint();
232 int margin = KDialog::marginHint(); 235 int margin = KDialog::marginHint();
233 236
234 QTabWidget *tabs = new QTabWidget( this ); 237 QTabWidget *tabs = new QTabWidget( this );
235 238
236 // Layout 239 // Layout
237 QVBox *loTab = new QVBox( this, "layouttab" ); 240 Q3VBox *loTab = new Q3VBox( this, "layouttab" );
238 241
239 loTab->setSpacing( spacing ); 242 loTab->setSpacing( spacing );
240 loTab->setMargin( margin ); 243 loTab->setMargin( margin );
241 244
242 QGroupBox *gbGeneral = new QGroupBox( 1, Qt::Horizontal, i18n("General"), loTab ); 245 Q3GroupBox *gbGeneral = new Q3GroupBox( 1, Qt::Horizontal, i18n("General"), loTab );
243 246
244 cbDrawSeps = new QCheckBox( i18n("Draw &separators"), gbGeneral ); 247 cbDrawSeps = new QCheckBox( i18n("Draw &separators"), gbGeneral );
245 248
246 QHBox *hbSW = new QHBox( gbGeneral ); 249 Q3HBox *hbSW = new Q3HBox( gbGeneral );
247 QLabel *lSW = new QLabel( i18n("Separator &width:"), hbSW ); 250 QLabel *lSW = new QLabel( i18n("Separator &width:"), hbSW );
248 sbSepWidth = new QSpinBox( 1, 50, 1, hbSW ); 251 sbSepWidth = new QSpinBox( 1, 50, 1, hbSW );
249 lSW->setBuddy( sbSepWidth); 252 lSW->setBuddy( sbSepWidth);
250 253
251 QHBox *hbPadding = new QHBox( gbGeneral ); 254 Q3HBox *hbPadding = new Q3HBox( gbGeneral );
252 QLabel *lSpacing = new QLabel( i18n("&Padding:"), hbPadding ); 255 QLabel *lSpacing = new QLabel( i18n("&Padding:"), hbPadding );
253 sbSpacing = new QSpinBox( 0, 100, 1, hbPadding ); 256 sbSpacing = new QSpinBox( 0, 100, 1, hbPadding );
254 lSpacing->setBuddy( sbSpacing ); 257 lSpacing->setBuddy( sbSpacing );
255 258
256 QGroupBox *gbCards = new QGroupBox( 1, Qt::Horizontal, i18n("Cards"), loTab ); 259 Q3GroupBox *gbCards = new Q3GroupBox( 1, Qt::Horizontal, i18n("Cards"), loTab );
257 260
258 QHBox *hbMargin = new QHBox( gbCards ); 261 Q3HBox *hbMargin = new Q3HBox( gbCards );
259 QLabel *lMargin = new QLabel( i18n("&Margin:"), hbMargin ); 262 QLabel *lMargin = new QLabel( i18n("&Margin:"), hbMargin );
260 sbMargin = new QSpinBox( 0, 100, 1, hbMargin ); 263 sbMargin = new QSpinBox( 0, 100, 1, hbMargin );
261 lMargin->setBuddy( sbMargin ); 264 lMargin->setBuddy( sbMargin );
262 265
263 cbDrawBorders = new QCheckBox( i18n("Draw &borders"), gbCards ); 266 cbDrawBorders = new QCheckBox( i18n("Draw &borders"), gbCards );
264 267
265 loTab->setStretchFactor( new QWidget( loTab ), 1 ); 268 loTab->setStretchFactor( new QWidget( loTab ), 1 );
266 269
267 QWhatsThis::add( sbMargin, i18n( 270 Q3WhatsThis::add( sbMargin, i18n(
268 "The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, " 271 "The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, "
269 "incrementing the item margin will add space between the focus rectangle and the item data." 272 "incrementing the item margin will add space between the focus rectangle and the item data."
270 ) ); 273 ) );
271 QWhatsThis::add( lMargin, QWhatsThis::textFor( sbMargin ) ); 274 /* TODO:hacker: Q3WhatsThis::add( lMargin, Q3WhatsThis::textFor( sbMargin ) ); */
272 QWhatsThis::add( sbSpacing, i18n( 275 Q3WhatsThis::add( sbSpacing, i18n(
273 "The Item Spacing decides the distance (in pixels) between the items and anything else: the view " 276 "The Item Spacing decides the distance (in pixels) between the items and anything else: the view "
274 "borders, other items or column separators." 277 "borders, other items or column separators."
275 ) ); 278 ) );
276 QWhatsThis::add( lSpacing, QWhatsThis::textFor( sbSpacing ) ); 279 /* TODO:hacker: Q3WhatsThis::add( lSpacing, Q3WhatsThis::textFor( sbSpacing ) ); */
277 QWhatsThis::add( sbSepWidth, i18n("Sets the width of column separators") ); 280 Q3WhatsThis::add( sbSepWidth, i18n("Sets the width of column separators") );
278 QWhatsThis::add( lSW, QWhatsThis::textFor( sbSepWidth ) ); 281 /* TODO:hacker: Q3WhatsThis::add( lSW, Q3WhatsThis::textFor( sbSepWidth ) ); */
279 282
280 tabs->addTab( loTab, i18n("&Layout") ); 283 tabs->addTab( loTab, i18n("&Layout") );
281 284
282 // Colors 285 // Colors
283 QVBox *colorTab = new QVBox( this, "colortab" ); 286 Q3VBox *colorTab = new Q3VBox( this, "colortab" );
284 colorTab->setSpacing( spacing ); 287 colorTab->setSpacing( spacing );
285 colorTab->setMargin( spacing ); 288 colorTab->setMargin( spacing );
286 cbEnableCustomColors = new QCheckBox( i18n("&Enable custom Colors"), colorTab ); 289 cbEnableCustomColors = new QCheckBox( i18n("&Enable custom Colors"), colorTab );
287 connect( cbEnableCustomColors, SIGNAL(clicked()), this, SLOT(enableColors()) ); 290 connect( cbEnableCustomColors, SIGNAL(clicked()), this, SLOT(enableColors()) );
288 lbColors = new ColorListBox( colorTab ); 291 lbColors = new ColorListBox( colorTab );
289 tabs->addTab( colorTab, i18n("&Colors") ); 292 tabs->addTab( colorTab, i18n("&Colors") );
290 293
291 QWhatsThis::add( cbEnableCustomColors, i18n( 294 Q3WhatsThis::add( cbEnableCustomColors, i18n(
292 "If custom colors are enabled, you may choose the colors for the view below. " 295 "If custom colors are enabled, you may choose the colors for the view below. "
293 "Otherwise colors from your current KDE color scheme are used." 296 "Otherwise colors from your current KDE color scheme are used."
294 ) ); 297 ) );
295 QWhatsThis::add( lbColors, i18n( 298 Q3WhatsThis::add( lbColors, i18n(
296 "Double click or press RETURN on a item to select a color for the related strings in the view." 299 "Double click or press RETURN on a item to select a color for the related strings in the view."
297 ) ); 300 ) );
298 301
299 // Fonts 302 // Fonts
300 QVBox *fntTab = new QVBox( this, "fonttab" ); 303 Q3VBox *fntTab = new Q3VBox( this, "fonttab" );
301 304
302 fntTab->setSpacing( spacing ); 305 fntTab->setSpacing( spacing );
303 fntTab->setMargin( spacing ); 306 fntTab->setMargin( spacing );
304 307
305 cbEnableCustomFonts = new QCheckBox( i18n("&Enable custom fonts"), fntTab ); 308 cbEnableCustomFonts = new QCheckBox( i18n("&Enable custom fonts"), fntTab );
306 connect( cbEnableCustomFonts, SIGNAL(clicked()), this, SLOT(enableFonts()) ); 309 connect( cbEnableCustomFonts, SIGNAL(clicked()), this, SLOT(enableFonts()) );
307 310
308 vbFonts = new QWidget( fntTab ); 311 vbFonts = new QWidget( fntTab );
309 QGridLayout *gFnts = new QGridLayout( vbFonts, 2, 3 ); 312 Q3GridLayout *gFnts = new Q3GridLayout( vbFonts, 2, 3 );
310 gFnts->setSpacing( spacing ); 313 gFnts->setSpacing( spacing );
311 gFnts->setAutoAdd( true ); 314 gFnts->setAutoAdd( true );
312 gFnts->setColStretch( 1, 1 ); 315 gFnts->setColStretch( 1, 1 );
313 QLabel *lTFnt = new QLabel( i18n("&Text font:"), vbFonts ); 316 QLabel *lTFnt = new QLabel( i18n("&Text font:"), vbFonts );
314 lTextFont = new QLabel( vbFonts ); 317 lTextFont = new QLabel( vbFonts );
315 lTextFont->setFrameStyle( QFrame::Panel|QFrame::Sunken ); 318 lTextFont->setFrameStyle( Q3Frame::Panel|Q3Frame::Sunken );
316#ifndef KAB_EMBEDDED 319#ifndef KAB_EMBEDDED
317 btnFont = new KPushButton( i18n("Choose..."), vbFonts ); 320 btnFont = new KPushButton( i18n("Choose..."), vbFonts );
318#else //KAB_EMBEDDED 321#else //KAB_EMBEDDED
319 btnFont = new QPushButton( i18n("Choose..."), vbFonts ); 322 btnFont = new QPushButton( i18n("Choose..."), vbFonts );
320#endif //KAB_EMBEDDED 323#endif //KAB_EMBEDDED
321 324
322 lTFnt->setBuddy( btnFont ); 325 lTFnt->setBuddy( btnFont );
323 326
324 connect( btnFont, SIGNAL(clicked()), this, SLOT(setTextFont()) ); 327 connect( btnFont, SIGNAL(clicked()), this, SLOT(setTextFont()) );
325 328
326 QLabel *lHFnt = new QLabel( i18n("&Header font:"), vbFonts ); 329 QLabel *lHFnt = new QLabel( i18n("&Header font:"), vbFonts );
327 lHeaderFont = new QLabel( vbFonts ); 330 lHeaderFont = new QLabel( vbFonts );
328 lHeaderFont->setFrameStyle( QFrame::Panel|QFrame::Sunken ); 331 lHeaderFont->setFrameStyle( Q3Frame::Panel|Q3Frame::Sunken );
329#ifndef KAB_EMBEDDED 332#ifndef KAB_EMBEDDED
330 btnHeaderFont = new KPushButton( i18n("Choose..."), vbFonts ); 333 btnHeaderFont = new KPushButton( i18n("Choose..."), vbFonts );
331#else //KAB_EMBEDDED 334#else //KAB_EMBEDDED
332 btnHeaderFont = new QPushButton( i18n("Choose..."), vbFonts ); 335 btnHeaderFont = new QPushButton( i18n("Choose..."), vbFonts );
333#endif //KAB_EMBEDDED 336#endif //KAB_EMBEDDED
334 lHFnt->setBuddy( btnHeaderFont ); 337 lHFnt->setBuddy( btnHeaderFont );
335 connect( btnHeaderFont, SIGNAL(clicked()), this, SLOT(setHeaderFont()) ); 338 connect( btnHeaderFont, SIGNAL(clicked()), this, SLOT(setHeaderFont()) );
336 339
337 fntTab->setStretchFactor( new QWidget( fntTab ), 1 ); 340 fntTab->setStretchFactor( new QWidget( fntTab ), 1 );
338 341
339 QWhatsThis::add( cbEnableCustomFonts, i18n( 342 Q3WhatsThis::add( cbEnableCustomFonts, i18n(
340 "If custom fonts are enabled, you may choose which fonts to use for this view below. " 343 "If custom fonts are enabled, you may choose which fonts to use for this view below. "
341 "Otherwise the default KDE font will be used, in bold style for the header and " 344 "Otherwise the default KDE font will be used, in bold style for the header and "
342 "normal style for the data." 345 "normal style for the data."
343 ) ); 346 ) );
344 347
345 tabs->addTab( fntTab, i18n("&Fonts") ); 348 tabs->addTab( fntTab, i18n("&Fonts") );
346 349
347 // Behaviour 350 // Behaviour
348 QVBox *behaviourTab = new QVBox( this ); 351 Q3VBox *behaviourTab = new Q3VBox( this );
349 behaviourTab->setMargin( margin ); 352 behaviourTab->setMargin( margin );
350 behaviourTab->setSpacing( spacing ); 353 behaviourTab->setSpacing( spacing );
351 354
352 cbShowEmptyFields = new QCheckBox( i18n("Show &empty fields"), behaviourTab ); 355 cbShowEmptyFields = new QCheckBox( i18n("Show &empty fields"), behaviourTab );
353 cbShowFieldLabels = new QCheckBox( i18n("Show field &labels"), behaviourTab ); 356 cbShowFieldLabels = new QCheckBox( i18n("Show field &labels"), behaviourTab );
354 357
@@ -361,9 +364,9 @@ void CardViewLookNFeelPage::initGUI()
361void CardViewLookNFeelPage::updateFontLabel( QFont fnt, QLabel *l ) 364void CardViewLookNFeelPage::updateFontLabel( QFont fnt, QLabel *l )
362{ 365{
363 l->setFont( fnt ); 366 l->setFont( fnt );
364 l->setText( QString( fnt.family() + " %1" ).arg( fnt.pointSize() ) ); 367 l->setText( QString( fnt.family() + " %1" ).arg( fnt.pointSize() ) );
365} 368}
366 369
367#ifndef KAB_EMBEDDED 370#ifndef KAB_EMBEDDED_
368#include "configurecardviewdialog.moc" 371#include "moc_configurecardviewdialog.cpp"
369#endif //KAB_EMBEDDED 372#endif //KAB_EMBEDDED
diff --git a/kaddressbook/views/configurecardviewdialog.h b/kaddressbook/views/configurecardviewdialog.h
index 7a62226..4af475d 100644
--- a/kaddressbook/views/configurecardviewdialog.h
+++ b/kaddressbook/views/configurecardviewdialog.h
@@ -23,15 +23,17 @@
23 23
24#ifndef CONFIGURECARDVIEWDIALOG_H 24#ifndef CONFIGURECARDVIEWDIALOG_H
25#define CONFIGURECARDVIEWDIALOG_H 25#define CONFIGURECARDVIEWDIALOG_H
26 26
27#include "viewconfigurewidget.h" 27#include "viewconfigurewidget.h"
28 28
29#include <qvbox.h> 29#include <q3vbox.h>
30#include <qwidget.h> 30#include <qwidget.h>
31#include <qfont.h> 31#include <qfont.h>
32//Added by qt3to4:
33#include <QLabel>
32 34
33class QString; 35class QString;
34class QWidget; 36class QWidget;
35class QCheckBox; 37class QCheckBox;
36class QLabel; 38class QLabel;
37class KConfig; 39class KConfig;
@@ -74,13 +76,13 @@ class ConfigureCardViewWidget : public ViewConfigureWidget
74 76
75 Layout 77 Layout
76 * item margin 78 * item margin
77 * item spacing 79 * item spacing
78*/ 80*/
79 81
80class CardViewLookNFeelPage : public QVBox { 82class CardViewLookNFeelPage : public Q3VBox {
81 83
82 Q_OBJECT 84 Q_OBJECT
83 85
84 public: 86 public:
85 CardViewLookNFeelPage( QWidget *parent=0, const char *name=0 ); 87 CardViewLookNFeelPage( QWidget *parent=0, const char *name=0 );
86 ~CardViewLookNFeelPage(); 88 ~CardViewLookNFeelPage();
diff --git a/kaddressbook/views/configuretableviewdialog.cpp b/kaddressbook/views/configuretableviewdialog.cpp
index c329cd9..7ed897a 100644
--- a/kaddressbook/views/configuretableviewdialog.cpp
+++ b/kaddressbook/views/configuretableviewdialog.cpp
@@ -24,17 +24,20 @@
24#include <qstring.h> 24#include <qstring.h>
25#include <qwidget.h> 25#include <qwidget.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qlabel.h> 27#include <qlabel.h>
28#include <qradiobutton.h> 28#include <qradiobutton.h>
29#include <qcheckbox.h> 29#include <qcheckbox.h>
30#include <qvbox.h> 30#include <q3vbox.h>
31#include <qbuttongroup.h> 31#include <q3buttongroup.h>
32#include <qtabwidget.h> 32#include <qtabwidget.h>
33#include <qwhatsthis.h> 33#include <q3whatsthis.h>
34#include <qpushbutton.h> 34#include <qpushbutton.h>
35//Added by qt3to4:
36#include <Q3GridLayout>
37#include <Q3Frame>
35 38
36#include <kglobal.h> 39#include <kglobal.h>
37#include <klocale.h> 40#include <klocale.h>
38#include <klineedit.h> 41#include <klineedit.h>
39#include <kurlrequester.h> 42#include <kurlrequester.h>
40#include <kiconloader.h> 43#include <kiconloader.h>
@@ -81,13 +84,13 @@ void ConfigureTableViewWidget::saveSettings( KConfig *config )
81 mPage->saveSettings( config ); 84 mPage->saveSettings( config );
82} 85}
83 86
84 87
85 88
86LookAndFeelPage::LookAndFeelPage(QWidget *parent, const char *name) 89LookAndFeelPage::LookAndFeelPage(QWidget *parent, const char *name)
87 : QVBox(parent, name) 90 : Q3VBox(parent, name)
88{ 91{
89 initGUI(); 92 initGUI();
90 93
91 // Set initial state 94 // Set initial state
92 enableBackgroundToggled(mBackgroundBox->isChecked()); 95 enableBackgroundToggled(mBackgroundBox->isChecked());
93} 96}
@@ -226,18 +229,18 @@ void LookAndFeelPage::initGUI()
226 int spacing = KDialog::spacingHint(); 229 int spacing = KDialog::spacingHint();
227 int margin = KDialog::marginHint(); 230 int margin = KDialog::marginHint();
228 231
229 QTabWidget *tabs = new QTabWidget( this ); 232 QTabWidget *tabs = new QTabWidget( this );
230 233
231 // General 234 // General
232 QVBox *generalTab = new QVBox( this, "generaltab" ); 235 Q3VBox *generalTab = new Q3VBox( this, "generaltab" );
233 236
234 generalTab->setSpacing( spacing ); 237 generalTab->setSpacing( spacing );
235 generalTab->setMargin( margin ); 238 generalTab->setMargin( margin );
236 239
237 QButtonGroup *group = new QButtonGroup(1, Qt::Horizontal, 240 Q3ButtonGroup *group = new Q3ButtonGroup(1, Qt::Horizontal,
238 i18n("Row Separator"), generalTab); 241 i18n("Row Separator"), generalTab);
239 242
240 mAlternateButton = new QRadioButton(i18n("Alternating backgrounds"), 243 mAlternateButton = new QRadioButton(i18n("Alternating backgrounds"),
241 group, "mAlternateButton"); 244 group, "mAlternateButton");
242 mLineButton = new QRadioButton(i18n("Single line"), group, "mLineButton"); 245 mLineButton = new QRadioButton(i18n("Single line"), group, "mLineButton");
243 mNoneButton = new QRadioButton(i18n("None"), group, "mNoneButton"); 246 mNoneButton = new QRadioButton(i18n("None"), group, "mNoneButton");
@@ -259,69 +262,69 @@ void LookAndFeelPage::initGUI()
259 mToolTipBox = new QCheckBox(i18n("Enable contact tooltips"), generalTab, 262 mToolTipBox = new QCheckBox(i18n("Enable contact tooltips"), generalTab,
260 "mToolTipBox"); 263 "mToolTipBox");
261 264
262 tabs->addTab( generalTab, i18n("&General") ); 265 tabs->addTab( generalTab, i18n("&General") );
263 266
264 // Colors 267 // Colors
265 QVBox *colorTab = new QVBox( this, "colortab" ); 268 Q3VBox *colorTab = new Q3VBox( this, "colortab" );
266 colorTab->setSpacing( spacing ); 269 colorTab->setSpacing( spacing );
267 colorTab->setMargin( spacing ); 270 colorTab->setMargin( spacing );
268 cbEnableCustomColors = new QCheckBox( i18n("&Enable custom Colors"), colorTab ); 271 cbEnableCustomColors = new QCheckBox( i18n("&Enable custom Colors"), colorTab );
269 connect( cbEnableCustomColors, SIGNAL(clicked()), this, SLOT(enableColors()) ); 272 connect( cbEnableCustomColors, SIGNAL(clicked()), this, SLOT(enableColors()) );
270 lbColors = new ColorListBox( colorTab ); 273 lbColors = new ColorListBox( colorTab );
271 tabs->addTab( colorTab, i18n("&Colors") ); 274 tabs->addTab( colorTab, i18n("&Colors") );
272 275
273 QWhatsThis::add( cbEnableCustomColors, i18n( 276 Q3WhatsThis::add( cbEnableCustomColors, i18n(
274 "If custom colors are enabled, you may choose the colors for the view below. " 277 "If custom colors are enabled, you may choose the colors for the view below. "
275 "Otherwise colors from your current KDE color scheme are used." 278 "Otherwise colors from your current KDE color scheme are used."
276 ) ); 279 ) );
277 QWhatsThis::add( lbColors, i18n( 280 Q3WhatsThis::add( lbColors, i18n(
278 "Double click or press RETURN on a item to select a color for the related strings in the view." 281 "Double click or press RETURN on a item to select a color for the related strings in the view."
279 ) ); 282 ) );
280 283
281 // Fonts 284 // Fonts
282 QVBox *fntTab = new QVBox( this, "fonttab" ); 285 Q3VBox *fntTab = new Q3VBox( this, "fonttab" );
283 286
284 fntTab->setSpacing( spacing ); 287 fntTab->setSpacing( spacing );
285 fntTab->setMargin( spacing ); 288 fntTab->setMargin( spacing );
286 289
287 cbEnableCustomFonts = new QCheckBox( i18n("&Enable custom fonts"), fntTab ); 290 cbEnableCustomFonts = new QCheckBox( i18n("&Enable custom fonts"), fntTab );
288 connect( cbEnableCustomFonts, SIGNAL(clicked()), this, SLOT(enableFonts()) ); 291 connect( cbEnableCustomFonts, SIGNAL(clicked()), this, SLOT(enableFonts()) );
289 292
290 vbFonts = new QWidget( fntTab ); 293 vbFonts = new QWidget( fntTab );
291 QGridLayout *gFnts = new QGridLayout( vbFonts, 2, 3 ); 294 Q3GridLayout *gFnts = new Q3GridLayout( vbFonts, 2, 3 );
292 gFnts->setSpacing( spacing ); 295 gFnts->setSpacing( spacing );
293 gFnts->setAutoAdd( true ); 296 gFnts->setAutoAdd( true );
294 gFnts->setColStretch( 1, 1 ); 297 gFnts->setColStretch( 1, 1 );
295 QLabel *lTFnt = new QLabel( i18n("&Text font:"), vbFonts ); 298 QLabel *lTFnt = new QLabel( i18n("&Text font:"), vbFonts );
296 lTextFont = new QLabel( vbFonts ); 299 lTextFont = new QLabel( vbFonts );
297 lTextFont->setFrameStyle( QFrame::Panel|QFrame::Sunken ); 300 lTextFont->setFrameStyle( Q3Frame::Panel|Q3Frame::Sunken );
298#ifndef KAB_EMBEDDED 301#ifndef KAB_EMBEDDED
299 btnFont = new KPushButton( i18n("Choose..."), vbFonts ); 302 btnFont = new KPushButton( i18n("Choose..."), vbFonts );
300#else //KAB_EMBEDDED 303#else //KAB_EMBEDDED
301 btnFont = new QPushButton( i18n("Choose..."), vbFonts ); 304 btnFont = new QPushButton( i18n("Choose..."), vbFonts );
302#endif //KAB_EMBEDDED 305#endif //KAB_EMBEDDED
303 306
304 lTFnt->setBuddy( btnFont ); 307 lTFnt->setBuddy( btnFont );
305 308
306 connect( btnFont, SIGNAL(clicked()), this, SLOT(setTextFont()) ); 309 connect( btnFont, SIGNAL(clicked()), this, SLOT(setTextFont()) );
307 310
308 QLabel *lHFnt = new QLabel( i18n("&Header font:"), vbFonts ); 311 QLabel *lHFnt = new QLabel( i18n("&Header font:"), vbFonts );
309 lHeaderFont = new QLabel( vbFonts ); 312 lHeaderFont = new QLabel( vbFonts );
310 lHeaderFont->setFrameStyle( QFrame::Panel|QFrame::Sunken ); 313 lHeaderFont->setFrameStyle( Q3Frame::Panel|Q3Frame::Sunken );
311#ifndef KAB_EMBEDDED 314#ifndef KAB_EMBEDDED
312 btnHeaderFont = new KPushButton( i18n("Choose..."), vbFonts ); 315 btnHeaderFont = new KPushButton( i18n("Choose..."), vbFonts );
313#else //KAB_EMBEDDED 316#else //KAB_EMBEDDED
314 btnHeaderFont = new QPushButton( i18n("Choose..."), vbFonts ); 317 btnHeaderFont = new QPushButton( i18n("Choose..."), vbFonts );
315#endif //KAB_EMBEDDED 318#endif //KAB_EMBEDDED
316 lHFnt->setBuddy( btnHeaderFont ); 319 lHFnt->setBuddy( btnHeaderFont );
317 connect( btnHeaderFont, SIGNAL(clicked()), this, SLOT(setHeaderFont()) ); 320 connect( btnHeaderFont, SIGNAL(clicked()), this, SLOT(setHeaderFont()) );
318 321
319 fntTab->setStretchFactor( new QWidget( fntTab ), 1 ); 322 fntTab->setStretchFactor( new QWidget( fntTab ), 1 );
320 323
321 QWhatsThis::add( cbEnableCustomFonts, i18n( 324 Q3WhatsThis::add( cbEnableCustomFonts, i18n(
322 "If custom fonts are enabled, you may choose which fonts to use for this view below. " 325 "If custom fonts are enabled, you may choose which fonts to use for this view below. "
323 "Otherwise the default KDE font will be used, in bold style for the header and " 326 "Otherwise the default KDE font will be used, in bold style for the header and "
324 "normal style for the data." 327 "normal style for the data."
325 ) ); 328 ) );
326 329
327 tabs->addTab( fntTab, i18n("&Fonts") ); 330 tabs->addTab( fntTab, i18n("&Fonts") );
@@ -337,9 +340,9 @@ void LookAndFeelPage::enableBackgroundToggled(bool enabled)
337void LookAndFeelPage::updateFontLabel( QFont fnt, QLabel *l ) 340void LookAndFeelPage::updateFontLabel( QFont fnt, QLabel *l )
338{ 341{
339 l->setFont( fnt ); 342 l->setFont( fnt );
340 l->setText( QString( fnt.family() + " %1" ).arg( fnt.pointSize() ) ); 343 l->setText( QString( fnt.family() + " %1" ).arg( fnt.pointSize() ) );
341} 344}
342 345
343#ifndef KAB_EMBEDDED 346#ifndef KAB_EMBEDDED_
344#include "configuretableviewdialog.moc" 347#include "moc_configuretableviewdialog.cpp"
345#endif //KAB_EMBEDDED 348#endif //KAB_EMBEDDED
diff --git a/kaddressbook/views/configuretableviewdialog.h b/kaddressbook/views/configuretableviewdialog.h
index 003ccf8..8125fc9 100644
--- a/kaddressbook/views/configuretableviewdialog.h
+++ b/kaddressbook/views/configuretableviewdialog.h
@@ -23,13 +23,15 @@
23 23
24#ifndef CONFIGURETABLEVIEWDIALOG_H 24#ifndef CONFIGURETABLEVIEWDIALOG_H
25#define CONFIGURETABLEVIEWDIALOG_H 25#define CONFIGURETABLEVIEWDIALOG_H
26 26
27#include "viewconfigurewidget.h" 27#include "viewconfigurewidget.h"
28 28
29#include <qvbox.h> 29#include <q3vbox.h>
30//Added by qt3to4:
31#include <QLabel>
30 32
31class QString; 33class QString;
32class QWidget; 34class QWidget;
33class QRadioButton; 35class QRadioButton;
34class QCheckBox; 36class QCheckBox;
35class KURLRequester; 37class KURLRequester;
@@ -60,13 +62,13 @@ class ConfigureTableViewWidget : public ViewConfigureWidget
60 LookAndFeelPage *mPage; 62 LookAndFeelPage *mPage;
61}; 63};
62 64
63/** 65/**
64 Internal class. It is only defined here for moc 66 Internal class. It is only defined here for moc
65*/ 67*/
66class LookAndFeelPage : public QVBox 68class LookAndFeelPage : public Q3VBox
67{ 69{
68 Q_OBJECT 70 Q_OBJECT
69 71
70 public: 72 public:
71 LookAndFeelPage( QWidget *parent, const char *name = 0 ); 73 LookAndFeelPage( QWidget *parent, const char *name = 0 );
72 ~LookAndFeelPage() {} 74 ~LookAndFeelPage() {}
diff --git a/kaddressbook/views/contactlistview.cpp b/kaddressbook/views/contactlistview.cpp
index 9accf78..227645d 100644
--- a/kaddressbook/views/contactlistview.cpp
+++ b/kaddressbook/views/contactlistview.cpp
@@ -18,21 +18,26 @@
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qheader.h> 24#include <q3header.h>
25#include <qiconset.h> 25#include <qicon.h>
26#include <qimage.h> 26#include <qimage.h>
27#include <qdragobject.h> 27#include <q3dragobject.h>
28#include <qcombobox.h> 28#include <qcombobox.h>
29#include <qpainter.h> 29#include <qpainter.h>
30#include <qbrush.h> 30#include <qbrush.h>
31#include <qevent.h> 31#include <qevent.h>
32#include <qapplication.h> 32#include <qapplication.h>
33//Added by qt3to4:
34#include <QDropEvent>
35#include <QPixmap>
36#include <QMouseEvent>
37#include <QKeyEvent>
33 38
34#include <klocale.h> 39#include <klocale.h>
35#include <kglobalsettings.h> 40#include <kglobalsettings.h>
36#include <kiconloader.h> 41#include <kiconloader.h>
37#include <kdebug.h> 42#include <kdebug.h>
38#include <kconfig.h> 43#include <kconfig.h>
@@ -44,29 +49,30 @@
44#include "contactlistview.h" 49#include "contactlistview.h"
45 50
46///////////////////////////////// 51/////////////////////////////////
47// DynamicTip Methods 52// DynamicTip Methods
48 53
49DynamicTip::DynamicTip( ContactListView *parent) 54DynamicTip::DynamicTip( ContactListView *parent)
50 : QToolTip( parent ) 55 /* TODO:hacker:: QToolTip( parent ) */
51{ 56{
52} 57}
53 58
54void DynamicTip::maybeTip( const QPoint &pos ) 59void DynamicTip::maybeTip( const QPoint &pos )
55{ 60{
61 /* TODO:hacker:
56 static bool ishidden = true; 62 static bool ishidden = true;
57 if (!parentWidget()->inherits( "ContactListView" )) 63 if (!parentWidget()->inherits( "ContactListView" ))
58 return; 64 return;
59 65
60 ContactListView *plv = (ContactListView*)parentWidget(); 66 ContactListView *plv = (ContactListView*)parentWidget();
61 if (!plv->tooltips()) 67 if (!plv->tooltips())
62 return; 68 return;
63 69
64 QPoint posVp = plv->viewport()->pos(); 70 QPoint posVp = plv->viewport()->pos();
65 71
66 QListViewItem *lvi = plv->itemAt( pos - posVp ); 72 Q3ListViewItem *lvi = plv->itemAt( pos - posVp );
67 if (!lvi) 73 if (!lvi)
68 return; 74 return;
69 75
70#ifndef KAB_EMBEDDED 76#ifndef KAB_EMBEDDED
71 ContactListViewItem *plvi = dynamic_cast< ContactListViewItem* >(lvi); 77 ContactListViewItem *plvi = dynamic_cast< ContactListViewItem* >(lvi);
72#else //KAB_EMBEDDED 78#else //KAB_EMBEDDED
@@ -148,13 +154,13 @@ void DynamicTip::maybeTip( const QPoint &pos )
148 154
149 tip( r, s ); 155 tip( r, s );
150 } 156 }
151 else 157 else
152 hide(); 158 hide();
153 ishidden = !ishidden; 159 ishidden = !ishidden;
154 160 */
155} 161}
156 162
157/////////////////////////// 163///////////////////////////
158// ContactListViewItem Methods 164// ContactListViewItem Methods
159 165
160ContactListViewItem::ContactListViewItem(const KABC::Addressee &a, 166ContactListViewItem::ContactListViewItem(const KABC::Addressee &a,
@@ -170,13 +176,13 @@ ContactListViewItem::ContactListViewItem(const KABC::Addressee &a,
170QString ContactListViewItem::key(int column, bool ascending) const 176QString ContactListViewItem::key(int column, bool ascending) const
171{ 177{
172#ifndef DESKTOP_VERSION 178#ifndef DESKTOP_VERSION
173 int lan = KGlobal::locale()->language(); 179 int lan = KGlobal::locale()->language();
174 //qDebug("language %d ", lan); 180 //qDebug("language %d ", lan);
175 if ( lan == 1 ) { //GERMAN 181 if ( lan == 1 ) { //GERMAN
176 QString ret = QListViewItem::key(column, ascending).lower().utf8(); 182 QString ret = Q3ListViewItem::key(column, ascending).lower().utf8();
177 int start = -1; 183 int start = -1;
178 while ( (start = ret.find( 'ä', start+1)) > 0 ) { 184 while ( (start = ret.find( 'ä', start+1)) > 0 ) {
179 ret.at(start-1) = 'a'; 185 ret.at(start-1) = 'a';
180 } 186 }
181 start = -1; 187 start = -1;
182 while ( (start = ret.find( 'ö', start+1)) > 0 ) { 188 while ( (start = ret.find( 'ö', start+1)) > 0 ) {
@@ -194,13 +200,13 @@ QString ContactListViewItem::key(int column, bool ascending) const
194 200
195 return ret; 201 return ret;
196 202
197 } 203 }
198 else 204 else
199#endif 205#endif
200 return QListViewItem::key(column, ascending).lower(); 206 return Q3ListViewItem::key(column, ascending).lower();
201} 207}
202 208
203void ContactListViewItem::paintCell(QPainter * p, 209void ContactListViewItem::paintCell(QPainter * p,
204 const QColorGroup & cg, 210 const QColorGroup & cg,
205 int column, 211 int column,
206 int width, 212 int width,
@@ -285,13 +291,13 @@ void ContactListView::printMe()
285#ifdef DESKTOP_VERSION 291#ifdef DESKTOP_VERSION
286 QPrinter printer; 292 QPrinter printer;
287 if (!printer.setup() ) 293 if (!printer.setup() )
288 return; 294 return;
289 QPainter p; 295 QPainter p;
290 p.begin ( &printer ); 296 p.begin ( &printer );
291 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); 297 Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer );
292 float dx, dy; 298 float dx, dy;
293 int wid = (m.width() * 9)/10; 299 int wid = (m.width() * 9)/10;
294 dx = (float) wid/(float)contentsWidth (); 300 dx = (float) wid/(float)contentsWidth ();
295 dy = (float)(m.height()) / (float)contentsHeight (); 301 dy = (float)(m.height()) / (float)contentsHeight ();
296 float scale; 302 float scale;
297 // scale to fit the width or height of the paper 303 // scale to fit the width or height of the paper
@@ -340,23 +346,23 @@ void ContactListView::contentsMousePressEvent(QMouseEvent* e)
340} 346}
341 347
342 348
343// To initiate a drag operation 349// To initiate a drag operation
344void ContactListView::contentsMouseMoveEvent( QMouseEvent *e ) 350void ContactListView::contentsMouseMoveEvent( QMouseEvent *e )
345{ 351{
346 if ((e->state() & LeftButton) && (e->pos() - presspos).manhattanLength() > 4 ) { 352 if ((e->state() & Qt::LeftButton) && (e->pos() - presspos).manhattanLength() > 4 ) {
347 emit startAddresseeDrag(); 353 emit startAddresseeDrag();
348 } 354 }
349 else 355 else
350 KListView::contentsMouseMoveEvent( e ); 356 KListView::contentsMouseMoveEvent( e );
351} 357}
352 358
353bool ContactListView::acceptDrag(QDropEvent *e) const 359bool ContactListView::acceptDrag(QDropEvent *e) const
354{ 360{
355#ifndef KAB_EMBEDDED 361#ifndef KAB_EMBEDDED
356 return QTextDrag::canDecode(e); 362 return Q3TextDrag::canDecode(e);
357#else //KAB_EMBEDDED 363#else //KAB_EMBEDDED
358qDebug("ContactListView::acceptDrag has to be fixed"); 364qDebug("ContactListView::acceptDrag has to be fixed");
359 return false; 365 return false;
360#endif //KAB_EMBEDDED 366#endif //KAB_EMBEDDED
361} 367}
362 368
@@ -421,9 +427,9 @@ void ContactListView::keyReleaseEvent ( QKeyEvent * e )
421 qApp->processEvents(); 427 qApp->processEvents();
422 mFlagBlockKeyPressed = false; 428 mFlagBlockKeyPressed = false;
423 mFlagKeyPressed = false; 429 mFlagKeyPressed = false;
424 } 430 }
425 KListView::keyReleaseEvent ( e ); 431 KListView::keyReleaseEvent ( e );
426} 432}
427#ifndef KAB_EMBEDDED 433#ifndef KAB_EMBEDDED_
428#include "contactlistview.moc" 434#include "moc_contactlistview.cpp"
429#endif //KAB_EMBEDDED 435#endif //KAB_EMBEDDED
diff --git a/kaddressbook/views/contactlistview.h b/kaddressbook/views/contactlistview.h
index 46477e1..c92b002 100644
--- a/kaddressbook/views/contactlistview.h
+++ b/kaddressbook/views/contactlistview.h
@@ -2,12 +2,16 @@
2#define CONTACTLISTVIEW_H 2#define CONTACTLISTVIEW_H
3 3
4#include <qcolor.h> 4#include <qcolor.h>
5#include <qpixmap.h> 5#include <qpixmap.h>
6#include <qtooltip.h> 6#include <qtooltip.h>
7#include <qstring.h> 7#include <qstring.h>
8//Added by qt3to4:
9#include <QDropEvent>
10#include <QMouseEvent>
11#include <QKeyEvent>
8 12
9#include <klistview.h> 13#include <klistview.h>
10 14
11#include <kabc/field.h> 15#include <kabc/field.h>
12#include <kabc/addressee.h> 16#include <kabc/addressee.h>
13#include <kabc/addressbook.h> 17#include <kabc/addressbook.h>
@@ -17,13 +21,13 @@ class QDropEvent;
17class KAddressBookTableView; 21class KAddressBookTableView;
18class ContactListView; 22class ContactListView;
19 23
20/** The whole tooltip design needs a lot of work. Currently it is 24/** The whole tooltip design needs a lot of work. Currently it is
21* hacked together to function. 25* hacked together to function.
22*/ 26*/
23class DynamicTip : public QToolTip 27class DynamicTip /* TODO:hacker: : public QToolTip */
24{ 28{
25 public: 29 public:
26 DynamicTip( ContactListView * parent ); 30 DynamicTip( ContactListView * parent );
27 31
28 protected: 32 protected:
29 void maybeTip( const QPoint & ); 33 void maybeTip( const QPoint & );
diff --git a/kaddressbook/views/kaddressbookcardview.cpp b/kaddressbook/views/kaddressbookcardview.cpp
index b503652..1e5a556 100644
--- a/kaddressbook/views/kaddressbookcardview.cpp
+++ b/kaddressbook/views/kaddressbookcardview.cpp
@@ -18,19 +18,24 @@
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qdragobject.h> 24#include <q3dragobject.h>
25#include <qevent.h> 25#include <qevent.h>
26#include <qiconview.h> 26#include <q3iconview.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qstringlist.h> 28#include <qstringlist.h>
29#include <qregexp.h> 29#include <qregexp.h>
30#include <qapplication.h> 30#include <qapplication.h>
31//Added by qt3to4:
32#include <QDropEvent>
33#include <QKeyEvent>
34#include <Q3VBoxLayout>
35#include <QDragEnterEvent>
31 36
32#include <kabc/addressbook.h> 37#include <kabc/addressbook.h>
33#include <kabc/addressee.h> 38#include <kabc/addressee.h>
34#include <kconfig.h> 39#include <kconfig.h>
35#include <kdebug.h> 40#include <kdebug.h>
36#include <klocale.h> 41#include <klocale.h>
@@ -122,13 +127,13 @@ void AddresseeCardView::printMe()
122#ifdef DESKTOP_VERSION 127#ifdef DESKTOP_VERSION
123 QPrinter printer; 128 QPrinter printer;
124 if (!printer.setup() ) 129 if (!printer.setup() )
125 return; 130 return;
126 QPainter p; 131 QPainter p;
127 p.begin ( &printer ); 132 p.begin ( &printer );
128 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); 133 Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer );
129 float dx, dy; 134 float dx, dy;
130 int wid = (m.width() * 9)/10; 135 int wid = (m.width() * 9)/10;
131 dx = (float) wid/(float)contentsWidth (); 136 dx = (float) wid/(float)contentsWidth ();
132 dy = (float)(m.height()) / (float)contentsHeight (); 137 dy = (float)(m.height()) / (float)contentsHeight ();
133 float scale; 138 float scale;
134 // scale to fit the width or height of the paper 139 // scale to fit the width or height of the paper
@@ -145,13 +150,13 @@ void AddresseeCardView::printMe()
145} 150}
146 151
147 152
148void AddresseeCardView::dragEnterEvent(QDragEnterEvent *e) 153void AddresseeCardView::dragEnterEvent(QDragEnterEvent *e)
149{ 154{
150#ifndef KAB_EMBEDDED 155#ifndef KAB_EMBEDDED
151 if (QTextDrag::canDecode(e)) 156 if (Q3TextDrag::canDecode(e))
152 e->accept(); 157 e->accept();
153#else //KAB_EMBEDDED 158#else //KAB_EMBEDDED
154qDebug("AddresseeCardView::dragEnterEvent drag&drop is not implemented"); 159qDebug("AddresseeCardView::dragEnterEvent drag&drop is not implemented");
155#endif //KAB_EMBEDDED 160#endif //KAB_EMBEDDED
156} 161}
157 162
@@ -173,13 +178,13 @@ KAddressBookCardView::KAddressBookCardView( KABC::AddressBook *ab,
173 QWidget *parent, const char *name ) 178 QWidget *parent, const char *name )
174 : KAddressBookView( ab, parent, name ) 179 : KAddressBookView( ab, parent, name )
175{ 180{
176 mShowEmptyFields = false; 181 mShowEmptyFields = false;
177 182
178 // Init the GUI 183 // Init the GUI
179 QVBoxLayout *layout = new QVBoxLayout(viewWidget()); 184 Q3VBoxLayout *layout = new Q3VBoxLayout(viewWidget());
180 185
181 mCardView = new AddresseeCardView(viewWidget(), "mCardView"); 186 mCardView = new AddresseeCardView(viewWidget(), "mCardView");
182 mCardView->setSelectionMode(CardView::Extended); 187 mCardView->setSelectionMode(CardView::Extended);
183 layout->addWidget(mCardView); 188 layout->addWidget(mCardView);
184 189
185 // Connect up the signals 190 // Connect up the signals
@@ -517,9 +522,9 @@ void KAddressBookCardView::addresseeSelected()
517 } 522 }
518 523
519 if (!found) 524 if (!found)
520 emit selected(QString::null); 525 emit selected(QString::null);
521 526
522} 527}
523#ifndef KAB_EMBEDDED 528#ifndef KAB_EMBEDDED_
524#include "kaddressbookcardview.moc" 529#include "moc_kaddressbookcardview.cpp"
525#endif //KAB_EMBEDDED 530#endif //KAB_EMBEDDED
diff --git a/kaddressbook/views/kaddressbookcardview.h b/kaddressbook/views/kaddressbookcardview.h
index 2a71f7e..8f8e48b 100644
--- a/kaddressbook/views/kaddressbookcardview.h
+++ b/kaddressbook/views/kaddressbookcardview.h
@@ -22,12 +22,15 @@
22 As a special exception, permission is given to link this program 22 As a special exception, permission is given to link this program
23 with any edition of Qt, and distribute the resulting executable, 23 with any edition of Qt, and distribute the resulting executable,
24 without including the source code for Qt in the source distribution. 24 without including the source code for Qt in the source distribution.
25*/ 25*/
26 26
27#include <qstring.h> 27#include <qstring.h>
28//Added by qt3to4:
29#include <QDragEnterEvent>
30#include <QDropEvent>
28#ifndef KAB_EMBEDDED 31#ifndef KAB_EMBEDDED
29#include <kiconview.h> 32#include <kiconview.h>
30#else //KAB_EMBEDDED 33#else //KAB_EMBEDDED
31#include <klocale.h> 34#include <klocale.h>
32#endif //KAB_EMBEDDED 35#endif //KAB_EMBEDDED
33 36
diff --git a/kaddressbook/views/kaddressbookiconview.cpp b/kaddressbook/views/kaddressbookiconview.cpp
index d6ddec3..3a41a4b 100644
--- a/kaddressbook/views/kaddressbookiconview.cpp
+++ b/kaddressbook/views/kaddressbookiconview.cpp
@@ -19,25 +19,33 @@
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef KAB_EMBEDDED 24#ifndef KAB_EMBEDDED
25#include <qiconview.h> 25#include <q3iconview.h>
26#include <qstringlist.h> 26#include <qstringlist.h>
27 27
28#include <kabc/addressee.h> 28#include <kabc/addressee.h>
29#include <kconfig.h> 29#include <kconfig.h>
30#include <kdebug.h> 30#include <kdebug.h>
31#include <kglobal.h> 31#include <kglobal.h>
32#include <kiconloader.h> 32#include <kiconloader.h>
33#include <klocale.h> 33#include <klocale.h>
34 34
35#else //KAB_EMBEDDED 35#else //KAB_EMBEDDED
36#endif //KAB_EMBEDDED 36#endif //KAB_EMBEDDED
37 37
38//Added by qt3to4:
39#include <QDropEvent>
40#include <Q3ValueList>
41#include <QPixmap>
42#include <QKeyEvent>
43#include <QEvent>
44#include <Q3VBoxLayout>
45
38#include <kabc/addressbook.h> 46#include <kabc/addressbook.h>
39#include "kabprefs.h" 47#include "kabprefs.h"
40#include "viewmanager.h" 48#include "viewmanager.h"
41#include "kaddressbookiconview.h" 49#include "kaddressbookiconview.h"
42#include <qlayout.h> 50#include <qlayout.h>
43#include <qregexp.h> 51#include <qregexp.h>
@@ -70,70 +78,70 @@ extern "C" {
70// AddresseeIconView (internal class) 78// AddresseeIconView (internal class)
71#ifndef KAB_EMBEDDED 79#ifndef KAB_EMBEDDED
72AddresseeIconView::AddresseeIconView(QWidget *parent, const char *name) 80AddresseeIconView::AddresseeIconView(QWidget *parent, const char *name)
73 : KIconView(parent, name) 81 : KIconView(parent, name)
74#else //KAB_EMBEDDED 82#else //KAB_EMBEDDED
75AddresseeIconView::AddresseeIconView(QWidget *parent, const char *name) 83AddresseeIconView::AddresseeIconView(QWidget *parent, const char *name)
76 : QIconView(parent, name) 84 : Q3IconView(parent, name)
77#endif //KAB_EMBEDDED 85#endif //KAB_EMBEDDED
78 86
79{ 87{
80 setSelectionMode( QIconView::Extended ); 88 setSelectionMode( Q3IconView::Extended );
81 setResizeMode( QIconView::Adjust ); 89 setResizeMode( Q3IconView::Adjust );
82 setWordWrapIconText( true ); 90 setWordWrapIconText( true );
83 setGridX( 100 ); 91 setGridX( 100 );
84 setItemsMovable(false); 92 setItemsMovable(false);
85 setSorting(true, true); 93 setSorting(true, true);
86 94
87 95
88//US ??? setMode( KIconView::Select ); 96//US ??? setMode( KIconView::Select );
89 97
90#ifndef KAB_EMBEDDED 98#ifndef KAB_EMBEDDED
91 99
92 connect(this, SIGNAL(dropped(QDropEvent*, const QValueList<QIconDragItem>&)), 100 connect(this, SIGNAL(dropped(QDropEvent*, const Q3ValueList<Q3IconDragItem>&)),
93 this, SLOT(itemDropped(QDropEvent*, const QValueList<QIconDragItem>&))); 101 this, SLOT(itemDropped(QDropEvent*, const Q3ValueList<Q3IconDragItem>&)));
94#endif //KAB_EMBEDDED 102#endif //KAB_EMBEDDED
95} 103}
96 104
97AddresseeIconView::~AddresseeIconView() 105AddresseeIconView::~AddresseeIconView()
98{ 106{
99} 107}
100 108
101 109
102void AddresseeIconView::itemDropped(QDropEvent *e, 110void AddresseeIconView::itemDropped(QDropEvent *e,
103 const QValueList<QIconDragItem> &) 111 const Q3ValueList<Q3IconDragItem> &)
104{ 112{
105 emit addresseeDropped(e); 113 emit addresseeDropped(e);
106} 114}
107 115
108QDragObject *AddresseeIconView::dragObject() 116Q3DragObject *AddresseeIconView::dragObject()
109{ 117{
110 emit startAddresseeDrag(); 118 emit startAddresseeDrag();
111 119
112 // We never want IconView to start the drag 120 // We never want IconView to start the drag
113 return 0; 121 return 0;
114} 122}
115//////////////////////////////// 123////////////////////////////////
116// AddresseeIconViewItem (internal class) 124// AddresseeIconViewItem (internal class)
117#ifndef KAB_EMBEDDED 125#ifndef KAB_EMBEDDED
118class AddresseeIconViewItem : public KIconViewItem 126class AddresseeIconViewItem : public KIconViewItem
119#else //KAB_EMBEDDED 127#else //KAB_EMBEDDED
120class AddresseeIconViewItem : public QIconViewItem 128class AddresseeIconViewItem : public Q3IconViewItem
121#endif //KAB_EMBEDDED 129#endif //KAB_EMBEDDED
122{ 130{
123 public: 131 public:
124#ifndef KAB_EMBEDDED 132#ifndef KAB_EMBEDDED
125 AddresseeIconViewItem(const KABC::Field::List &fields, 133 AddresseeIconViewItem(const KABC::Field::List &fields,
126 KABC::AddressBook *doc, const KABC::Addressee &a, 134 KABC::AddressBook *doc, const KABC::Addressee &a,
127 QIconView *parent) 135 Q3IconView *parent)
128 : KIconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a) 136 : KIconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a)
129#else //KAB_EMBEDDED 137#else //KAB_EMBEDDED
130 AddresseeIconViewItem(const KABC::Field::List &fields, 138 AddresseeIconViewItem(const KABC::Field::List &fields,
131 KABC::AddressBook *doc, const KABC::Addressee &a, 139 KABC::AddressBook *doc, const KABC::Addressee &a,
132 QIconView *parent) 140 Q3IconView *parent)
133 : QIconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a) 141 : Q3IconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a)
134#endif //KAB_EMBEDDED 142#endif //KAB_EMBEDDED
135 { 143 {
136 if ( mFields.isEmpty() ) { 144 if ( mFields.isEmpty() ) {
137 mFields = KABC::Field::defaultFields(); 145 mFields = KABC::Field::defaultFields();
138 } 146 }
139 refresh(); 147 refresh();
@@ -197,24 +205,24 @@ class AddresseeIconViewItem : public QIconViewItem
197 205
198KAddressBookIconView::KAddressBookIconView( KABC::AddressBook *ab, 206KAddressBookIconView::KAddressBookIconView( KABC::AddressBook *ab,
199 QWidget *parent, const char *name) 207 QWidget *parent, const char *name)
200 : KAddressBookView( ab, parent, name ) 208 : KAddressBookView( ab, parent, name )
201{ 209{
202 // Init the GUI 210 // Init the GUI
203 QVBoxLayout *layout = new QVBoxLayout(viewWidget()); 211 Q3VBoxLayout *layout = new Q3VBoxLayout(viewWidget());
204 212
205 mIconView = new AddresseeIconView(viewWidget(), "mIconView"); 213 mIconView = new AddresseeIconView(viewWidget(), "mIconView");
206 layout->addWidget(mIconView); 214 layout->addWidget(mIconView);
207 215
208 // Connect up the signals 216 // Connect up the signals
209 217
210//US method executed is part of KIconView 218//US method executed is part of KIconView
211//US connect(mIconView, SIGNAL(executed(QIconViewItem *)), 219//US connect(mIconView, SIGNAL(executed(QIconViewItem *)),
212//US this, SLOT(addresseeExecuted(QIconViewItem *))); 220//US this, SLOT(addresseeExecuted(QIconViewItem *)));
213 connect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), 221 connect(mIconView, SIGNAL(selectionChanged(Q3IconViewItem *)),
214 this, SLOT(addresseeExecuted(QIconViewItem *))); 222 this, SLOT(addresseeExecuted(Q3IconViewItem *)));
215 223
216 connect(mIconView, SIGNAL(selectionChanged()), 224 connect(mIconView, SIGNAL(selectionChanged()),
217 this, SLOT(addresseeSelected())); 225 this, SLOT(addresseeSelected()));
218 connect(mIconView, SIGNAL(addresseeDropped(QDropEvent*)), 226 connect(mIconView, SIGNAL(addresseeDropped(QDropEvent*)),
219 this, SIGNAL(dropped(QDropEvent*))); 227 this, SIGNAL(dropped(QDropEvent*)));
220 connect(mIconView, SIGNAL(startAddresseeDrag()), 228 connect(mIconView, SIGNAL(startAddresseeDrag()),
@@ -245,26 +253,26 @@ void KAddressBookIconView::readConfig(KConfig *config)
245{ 253{
246 KAddressBookView::readConfig(config); 254 KAddressBookView::readConfig(config);
247 255
248//US method executed is part of KIconView 256//US method executed is part of KIconView
249//US disconnect(mIconView, SIGNAL(executed(QIconViewItem *)), 257//US disconnect(mIconView, SIGNAL(executed(QIconViewItem *)),
250//US this, SLOT(addresseeExecuted(QIconViewItem *))); 258//US this, SLOT(addresseeExecuted(QIconViewItem *)));
251 disconnect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), 259 disconnect(mIconView, SIGNAL(selectionChanged(Q3IconViewItem *)),
252 this, SLOT(addresseeExecuted(QIconViewItem *))); 260 this, SLOT(addresseeExecuted(Q3IconViewItem *)));
253 261
254//US method executed is part of KIconView. Use selectionChanged instead 262//US method executed is part of KIconView. Use selectionChanged instead
255/*US 263/*US
256 if (KABPrefs::instance()->mHonorSingleClick) 264 if (KABPrefs::instance()->mHonorSingleClick)
257 connect(mIconView, SIGNAL(executed(QIconViewItem *)), 265 connect(mIconView, SIGNAL(executed(QIconViewItem *)),
258 this, SLOT(addresseeExecuted(QIconViewItem *))); 266 this, SLOT(addresseeExecuted(QIconViewItem *)));
259 else 267 else
260 connect(mIconView, SIGNAL(doubleClicked(QIconViewItem *)), 268 connect(mIconView, SIGNAL(doubleClicked(QIconViewItem *)),
261 this, SLOT(addresseeExecuted(QIconViewItem *))); 269 this, SLOT(addresseeExecuted(QIconViewItem *)));
262*/ 270*/
263 connect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), 271 connect(mIconView, SIGNAL(selectionChanged(Q3IconViewItem *)),
264 this, SLOT(addresseeExecuted(QIconViewItem *))); 272 this, SLOT(addresseeExecuted(Q3IconViewItem *)));
265 273
266} 274}
267void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field ) 275void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field )
268{ 276{
269 mIconView->clear(); 277 mIconView->clear();
270 mIconList.clear(); 278 mIconList.clear();
@@ -333,13 +341,13 @@ void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field )
333 else 341 else
334 emit selected(QString::null); 342 emit selected(QString::null);
335} 343}
336QStringList KAddressBookIconView::selectedUids() 344QStringList KAddressBookIconView::selectedUids()
337{ 345{
338 QStringList uidList; 346 QStringList uidList;
339 QIconViewItem *item; 347 Q3IconViewItem *item;
340 AddresseeIconViewItem *aItem; 348 AddresseeIconViewItem *aItem;
341 349
342 for (item = mIconView->firstItem(); item; item = item->nextItem()) 350 for (item = mIconView->firstItem(); item; item = item->nextItem())
343 { 351 {
344 if (item->isSelected()) 352 if (item->isSelected())
345 { 353 {
@@ -355,13 +363,13 @@ QStringList KAddressBookIconView::selectedUids()
355 363
356 return uidList; 364 return uidList;
357} 365}
358 366
359void KAddressBookIconView::refresh(QString uid) 367void KAddressBookIconView::refresh(QString uid)
360{ 368{
361 QIconViewItem *item; 369 Q3IconViewItem *item;
362 AddresseeIconViewItem *aItem; 370 AddresseeIconViewItem *aItem;
363 371
364 if ( uid.isNull() ) { 372 if ( uid.isNull() ) {
365 // Rebuild the view 373 // Rebuild the view
366 mIconView->clear(); 374 mIconView->clear();
367 mIconList.clear(); 375 mIconList.clear();
@@ -403,13 +411,13 @@ void KAddressBookIconView::refresh(QString uid)
403 refresh( QString::null ); 411 refresh( QString::null );
404 } 412 }
405} 413}
406 414
407void KAddressBookIconView::setSelected(QString uid, bool selected) 415void KAddressBookIconView::setSelected(QString uid, bool selected)
408{ 416{
409 QIconViewItem *item; 417 Q3IconViewItem *item;
410 AddresseeIconViewItem *aItem; 418 AddresseeIconViewItem *aItem;
411 419
412 if (uid.isNull()) 420 if (uid.isNull())
413 { 421 {
414 mIconView->selectAll(selected); 422 mIconView->selectAll(selected);
415 } 423 }
@@ -432,13 +440,13 @@ void KAddressBookIconView::setSelected(QString uid, bool selected)
432 found = true; 440 found = true;
433 } 441 }
434 } 442 }
435 } 443 }
436} 444}
437 445
438void KAddressBookIconView::addresseeExecuted(QIconViewItem *item) 446void KAddressBookIconView::addresseeExecuted(Q3IconViewItem *item)
439{ 447{
440#ifndef KAB_EMBEDDED 448#ifndef KAB_EMBEDDED
441 AddresseeIconViewItem *aItem = dynamic_cast<AddresseeIconViewItem*>(item); 449 AddresseeIconViewItem *aItem = dynamic_cast<AddresseeIconViewItem*>(item);
442#else //KAB_EMBEDDED 450#else //KAB_EMBEDDED
443 AddresseeIconViewItem *aItem = (AddresseeIconViewItem*)(item); 451 AddresseeIconViewItem *aItem = (AddresseeIconViewItem*)(item);
444#endif //KAB_EMBEDDED 452#endif //KAB_EMBEDDED
@@ -447,13 +455,13 @@ void KAddressBookIconView::addresseeExecuted(QIconViewItem *item)
447 emit executed(aItem->addressee().uid()); 455 emit executed(aItem->addressee().uid());
448 } 456 }
449} 457}
450 458
451void KAddressBookIconView::addresseeSelected() 459void KAddressBookIconView::addresseeSelected()
452{ 460{
453 QIconViewItem *item; 461 Q3IconViewItem *item;
454 AddresseeIconViewItem *aItem; 462 AddresseeIconViewItem *aItem;
455 463
456 bool found = false; 464 bool found = false;
457 for (item = mIconView->firstItem(); item && !found; 465 for (item = mIconView->firstItem(); item && !found;
458 item = item->nextItem()) 466 item = item->nextItem())
459 { 467 {
@@ -473,9 +481,9 @@ void KAddressBookIconView::addresseeSelected()
473 } 481 }
474 482
475 if (!found) 483 if (!found)
476 emit selected(QString::null); 484 emit selected(QString::null);
477} 485}
478 486
479#ifndef KAB_EMBEDDED 487#ifndef KAB_EMBEDDED_
480#include "kaddressbookiconview.moc" 488#include "moc_kaddressbookiconview.cpp"
481#endif //KAB_EMBEDDED 489#endif //KAB_EMBEDDED
diff --git a/kaddressbook/views/kaddressbookiconview.h b/kaddressbook/views/kaddressbookiconview.h
index b0b9fea..6fad4c6 100644
--- a/kaddressbook/views/kaddressbookiconview.h
+++ b/kaddressbook/views/kaddressbookiconview.h
@@ -22,26 +22,29 @@
22*/ 22*/
23 23
24#ifndef KADDRESSBOOKICONVIEW_H 24#ifndef KADDRESSBOOKICONVIEW_H
25#define KADDRESSBOOKICONVIEW_H 25#define KADDRESSBOOKICONVIEW_H
26 26
27#include <qstring.h> 27#include <qstring.h>
28//Added by qt3to4:
29#include <Q3ValueList>
30#include <QDropEvent>
28#ifndef KAB_EMBEDDED 31#ifndef KAB_EMBEDDED
29#include <kiconview.h> 32#include <kiconview.h>
30#else //KAB_EMBEDDED 33#else //KAB_EMBEDDED
31#include <qiconview.h> 34#include <q3iconview.h>
32#include <qptrlist.h> 35#include <q3ptrlist.h>
33#include <klocale.h> 36#include <klocale.h>
34#endif //KAB_EMBEDDED 37#endif //KAB_EMBEDDED
35#include "kaddressbookview.h" 38#include "kaddressbookview.h"
36 39
37class QIconViewItem; 40class Q3IconViewItem;
38class KConfig; 41class KConfig;
39class AddresseeIconView; 42class AddresseeIconView;
40class AddresseeIconViewItem; 43class AddresseeIconViewItem;
41class QIconDragItem; 44class Q3IconDragItem;
42class KAddressBookIconView; 45class KAddressBookIconView;
43 46
44namespace KABC { class AddressBook; } 47namespace KABC { class AddressBook; }
45 48
46/** This is an example kaddressbook view that is implemented using 49/** This is an example kaddressbook view that is implemented using
47* KIconView. This view is not the most useful view, but it displays 50* KIconView. This view is not the most useful view, but it displays
@@ -65,36 +68,36 @@ class KAddressBookIconView : public KAddressBookView
65 virtual void scrollDOWN(); 68 virtual void scrollDOWN();
66 virtual void setFocusAV(); 69 virtual void setFocusAV();
67 70
68 public slots: 71 public slots:
69 void refresh(QString uid = QString::null); 72 void refresh(QString uid = QString::null);
70#ifndef KAB_EMBEDDED 73#ifndef KAB_EMBEDDED
71//MOC_SKIP_BEGIN 74#ifndef Q_MOC_RUN
72 void setSelected(QString uid = QString::null, bool selected = true); 75 void setSelected(QString uid = QString::null, bool selected = true);
73//MOC_SKIP_END 76#endif
74#else //KAB_EMBEDDED 77#else //KAB_EMBEDDED
75//US my MOC do not like default parameters ??? 78//US my MOC do not like default parameters ???
76 void setSelected(QString uid, bool selected); 79 void setSelected(QString uid, bool selected);
77#endif //KAB_EMBEDDED 80#endif //KAB_EMBEDDED
78 81
79 protected slots: 82 protected slots:
80 void addresseeExecuted(QIconViewItem *item); 83 void addresseeExecuted(Q3IconViewItem *item);
81 void addresseeSelected(); 84 void addresseeSelected();
82 85
83 private: 86 private:
84 AddresseeIconView *mIconView; 87 AddresseeIconView *mIconView;
85 QPtrList<AddresseeIconViewItem> mIconList; 88 Q3PtrList<AddresseeIconViewItem> mIconList;
86}; 89};
87 90
88 91
89#ifndef KAB_EMBEDDED 92#ifndef KAB_EMBEDDED
90//MOC_SKIP_BEGIN 93#ifndef Q_MOC_RUN
91class AddresseeIconView : public KIconView 94class AddresseeIconView : public KIconView
92//MOC_SKIP_END 95#endif
93#else //KAB_EMBEDDED 96#else //KAB_EMBEDDED
94class AddresseeIconView : public QIconView 97class AddresseeIconView : public Q3IconView
95#endif //KAB_EMBEDDED 98#endif //KAB_EMBEDDED
96{ 99{
97 Q_OBJECT 100 Q_OBJECT
98 101
99 public: 102 public:
100 AddresseeIconView(QWidget *parent, const char *name); 103 AddresseeIconView(QWidget *parent, const char *name);
@@ -102,16 +105,16 @@ class AddresseeIconView : public QIconView
102 105
103 signals: 106 signals:
104 void addresseeDropped(QDropEvent *); 107 void addresseeDropped(QDropEvent *);
105 void startAddresseeDrag(); 108 void startAddresseeDrag();
106 109
107 protected: 110 protected:
108 virtual QDragObject *dragObject(); 111 virtual Q3DragObject *dragObject();
109 112
110 protected slots: 113 protected slots:
111 void itemDropped(QDropEvent *, const QValueList<QIconDragItem> &); 114 void itemDropped(QDropEvent *, const Q3ValueList<Q3IconDragItem> &);
112}; 115};
113 116
114class IconViewFactory : public ViewFactory 117class IconViewFactory : public ViewFactory
115{ 118{
116 public: 119 public:
117 KAddressBookView *view( KABC::AddressBook *ab, QWidget *parent, const char *name ) 120 KAddressBookView *view( KABC::AddressBook *ab, QWidget *parent, const char *name )
diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp
index 272f2eb..7efaaa9 100644
--- a/kaddressbook/views/kaddressbooktableview.cpp
+++ b/kaddressbook/views/kaddressbooktableview.cpp
@@ -1,19 +1,23 @@
1// $Id$ 1// $Id$
2 2
3#include <qvbox.h> 3#include <q3vbox.h>
4#include <qlistbox.h> 4#include <q3listbox.h>
5#include <qwidget.h> 5#include <qwidget.h>
6#include <qfile.h> 6#include <qfile.h>
7#include <qimage.h> 7#include <qimage.h>
8#include <qcombobox.h> 8#include <qcombobox.h>
9#include <qapplication.h> 9#include <qapplication.h>
10#include <qdragobject.h> 10#include <q3dragobject.h>
11#include <qevent.h> 11#include <qevent.h>
12#include <qurl.h> 12#include <q3url.h>
13#include <qpixmap.h> 13#include <qpixmap.h>
14//Added by qt3to4:
15#include <QDropEvent>
16#include <QKeyEvent>
17#include <Q3VBoxLayout>
14 18
15#include <kabc/addressbook.h> 19#include <kabc/addressbook.h>
16#include <kapplication.h> 20#include <kapplication.h>
17#include <kconfig.h> 21#include <kconfig.h>
18#include <kcolorbutton.h> 22#include <kcolorbutton.h>
19#include <kdebug.h> 23#include <kdebug.h>
@@ -29,23 +33,23 @@
29#include "contactlistview.h" 33#include "contactlistview.h"
30#include "kabprefs.h" 34#include "kabprefs.h"
31#include "undocmds.h" 35#include "undocmds.h"
32#include "viewmanager.h" 36#include "viewmanager.h"
33 37
34#include <qlayout.h> 38#include <qlayout.h>
35#include <qheader.h> 39#include <q3header.h>
36#include <qregexp.h> 40#include <qregexp.h>
37 41
38#include "kaddressbooktableview.h" 42#include "kaddressbooktableview.h"
39 43
40 44
41KAddressBookTableView::KAddressBookTableView( KABC::AddressBook *ab, 45KAddressBookTableView::KAddressBookTableView( KABC::AddressBook *ab,
42 QWidget *parent, const char *name ) 46 QWidget *parent, const char *name )
43 : KAddressBookView( ab, parent, name ) 47 : KAddressBookView( ab, parent, name )
44{ 48{
45 mainLayout = new QVBoxLayout( viewWidget(), 2 ); 49 mainLayout = new Q3VBoxLayout( viewWidget(), 2 );
46 50
47 // The list view will be created when the config is read. 51 // The list view will be created when the config is read.
48 mListView = 0; 52 mListView = 0;
49} 53}
50 54
51KAddressBookTableView::~KAddressBookTableView() 55KAddressBookTableView::~KAddressBookTableView()
@@ -74,20 +78,20 @@ void KAddressBookTableView::scrollDOWN()
74void KAddressBookTableView::reconstructListView() 78void KAddressBookTableView::reconstructListView()
75{ 79{
76 if (mListView) 80 if (mListView)
77 { 81 {
78 disconnect(mListView, SIGNAL(selectionChanged()), 82 disconnect(mListView, SIGNAL(selectionChanged()),
79 this, SLOT(addresseeSelected())); 83 this, SLOT(addresseeSelected()));
80 disconnect(mListView, SIGNAL(executed(QListViewItem*)), 84 disconnect(mListView, SIGNAL(executed(Q3ListViewItem*)),
81 this, SLOT(addresseeExecuted(QListViewItem*))); 85 this, SLOT(addresseeExecuted(Q3ListViewItem*)));
82 disconnect(mListView, SIGNAL(doubleClicked(QListViewItem*)), 86 disconnect(mListView, SIGNAL(doubleClicked(Q3ListViewItem*)),
83 this, SLOT(addresseeExecuted(QListViewItem*))); 87 this, SLOT(addresseeExecuted(Q3ListViewItem*)));
84 disconnect(mListView, SIGNAL(startAddresseeDrag()), this, 88 disconnect(mListView, SIGNAL(startAddresseeDrag()), this,
85 SIGNAL(startDrag())); 89 SIGNAL(startDrag()));
86 disconnect(mListView, SIGNAL(returnPressed(QListViewItem*)), 90 disconnect(mListView, SIGNAL(returnPressed(Q3ListViewItem*)),
87 this, SLOT(addresseeExecuted(QListViewItem*))); 91 this, SLOT(addresseeExecuted(Q3ListViewItem*)));
88 92
89 disconnect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this, 93 disconnect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this,
90 SIGNAL(dropped(QDropEvent*))); 94 SIGNAL(dropped(QDropEvent*)));
91 delete mListView; 95 delete mListView;
92 } 96 }
93 97
@@ -102,13 +106,13 @@ void KAddressBookTableView::reconstructListView()
102 KABC::Field::List fieldList = fields(); 106 KABC::Field::List fieldList = fields();
103 KABC::Field::List::ConstIterator it; 107 KABC::Field::List::ConstIterator it;
104 108
105 int c = 0; 109 int c = 0;
106 for( it = fieldList.begin(); it != fieldList.end(); ++it ) { 110 for( it = fieldList.begin(); it != fieldList.end(); ++it ) {
107 mListView->addColumn( (*it)->label() ); 111 mListView->addColumn( (*it)->label() );
108 mListView->setColumnWidthMode(c++, QListView::Manual); 112 mListView->setColumnWidthMode(c++, Q3ListView::Manual);
109//US 113//US
110 // qDebug("KAddressBookTableView::reconstructListView: field %s", (*it)->label().latin1()); 114 // qDebug("KAddressBookTableView::reconstructListView: field %s", (*it)->label().latin1());
111 } 115 }
112 116
113 connect(mListView, SIGNAL(selectionChanged()), 117 connect(mListView, SIGNAL(selectionChanged()),
114 this, SLOT(addresseeSelected())); 118 this, SLOT(addresseeSelected()));
@@ -116,21 +120,21 @@ void KAddressBookTableView::reconstructListView()
116 SIGNAL(startDrag())); 120 SIGNAL(startDrag()));
117 connect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this, 121 connect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this,
118 SIGNAL(dropped(QDropEvent*))); 122 SIGNAL(dropped(QDropEvent*)));
119 123
120 if (KABPrefs::instance()->mHonorSingleClick) { 124 if (KABPrefs::instance()->mHonorSingleClick) {
121 // qDebug("KAddressBookTableView::reconstructListView single"); 125 // qDebug("KAddressBookTableView::reconstructListView single");
122 connect(mListView, SIGNAL(executed(QListViewItem*)), 126 connect(mListView, SIGNAL(executed(Q3ListViewItem*)),
123 this, SLOT(addresseeExecuted(QListViewItem*))); 127 this, SLOT(addresseeExecuted(Q3ListViewItem*)));
124 } else { 128 } else {
125 // qDebug("KAddressBookTableView::reconstructListView double"); 129 // qDebug("KAddressBookTableView::reconstructListView double");
126 connect(mListView, SIGNAL(doubleClicked(QListViewItem*)), 130 connect(mListView, SIGNAL(doubleClicked(Q3ListViewItem*)),
127 this, SLOT(addresseeExecuted(QListViewItem*))); 131 this, SLOT(addresseeExecuted(Q3ListViewItem*)));
128 } 132 }
129 connect(mListView, SIGNAL(returnPressed(QListViewItem*)), 133 connect(mListView, SIGNAL(returnPressed(Q3ListViewItem*)),
130 this, SLOT(addresseeExecuted(QListViewItem*))); 134 this, SLOT(addresseeExecuted(Q3ListViewItem*)));
131 connect(mListView, SIGNAL(signalDelete()), 135 connect(mListView, SIGNAL(signalDelete()),
132 this, SLOT(addresseeDeleted())); 136 this, SLOT(addresseeDeleted()));
133 137
134//US performceimprovement. Refresh is done from the outside 138//US performceimprovement. Refresh is done from the outside
135//US refresh(); 139//US refresh();
136 140
@@ -341,13 +345,13 @@ void KAddressBookTableView::refresh(QString uid)
341 mListView->ensureItemVisible( currentItem ); 345 mListView->ensureItemVisible( currentItem );
342 mListView->setSelected( currentItem, true ); 346 mListView->setSelected( currentItem, true );
343 } 347 }
344 } else { 348 } else {
345 // Only need to update on entry. Iterate through and try to find it 349 // Only need to update on entry. Iterate through and try to find it
346 ContactListViewItem *ceItem; 350 ContactListViewItem *ceItem;
347 QListViewItemIterator it( mListView ); 351 Q3ListViewItemIterator it( mListView );
348 while ( it.current() ) { 352 while ( it.current() ) {
349#ifndef KAB_EMBEDDED 353#ifndef KAB_EMBEDDED
350 ceItem = dynamic_cast<ContactListViewItem*>( it.current() ); 354 ceItem = dynamic_cast<ContactListViewItem*>( it.current() );
351#else //KAB_EMBEDDED 355#else //KAB_EMBEDDED
352 ceItem = (ContactListViewItem*)( it.current() ); 356 ceItem = (ContactListViewItem*)( it.current() );
353#endif //KAB_EMBEDDED 357#endif //KAB_EMBEDDED
@@ -363,13 +367,13 @@ void KAddressBookTableView::refresh(QString uid)
363 } 367 }
364} 368}
365 369
366QStringList KAddressBookTableView::selectedUids() 370QStringList KAddressBookTableView::selectedUids()
367{ 371{
368 QStringList uidList; 372 QStringList uidList;
369 QListViewItem *item; 373 Q3ListViewItem *item;
370 ContactListViewItem *ceItem; 374 ContactListViewItem *ceItem;
371 375
372 for(item = mListView->firstChild(); item; item = item->itemBelow()) 376 for(item = mListView->firstChild(); item; item = item->itemBelow())
373 { 377 {
374 if (mListView->isSelected( item )) 378 if (mListView->isSelected( item ))
375 { 379 {
@@ -391,13 +395,13 @@ QStringList KAddressBookTableView::selectedUids()
391 395
392 return uidList; 396 return uidList;
393} 397}
394 398
395void KAddressBookTableView::setSelected(QString uid, bool selected) 399void KAddressBookTableView::setSelected(QString uid, bool selected)
396{ 400{
397 QListViewItem *item; 401 Q3ListViewItem *item;
398 ContactListViewItem *ceItem; 402 ContactListViewItem *ceItem;
399 403
400 if (uid.isNull()) 404 if (uid.isNull())
401 { 405 {
402 mListView->selectAll(selected); 406 mListView->selectAll(selected);
403 } 407 }
@@ -426,13 +430,13 @@ void KAddressBookTableView::setSelected(QString uid, bool selected)
426void KAddressBookTableView::addresseeSelected() 430void KAddressBookTableView::addresseeSelected()
427{ 431{
428 // We need to try to find the first selected item. This might not be the 432 // We need to try to find the first selected item. This might not be the
429 // last selected item, but when QListView is in multiselection mode, 433 // last selected item, but when QListView is in multiselection mode,
430 // there is no way to figure out which one was 434 // there is no way to figure out which one was
431 // selected last. 435 // selected last.
432 QListViewItem *item; 436 Q3ListViewItem *item;
433 bool found =false; 437 bool found =false;
434 for (item = mListView->firstChild(); item && !found; 438 for (item = mListView->firstChild(); item && !found;
435 item = item->nextSibling()) 439 item = item->nextSibling())
436 { 440 {
437 if (item->isSelected()) 441 if (item->isSelected())
438 { 442 {
@@ -450,13 +454,13 @@ void KAddressBookTableView::addresseeSelected()
450 } 454 }
451 455
452 if (!found) 456 if (!found)
453 emit selected(QString::null); 457 emit selected(QString::null);
454} 458}
455 459
456void KAddressBookTableView::addresseeExecuted(QListViewItem *item) 460void KAddressBookTableView::addresseeExecuted(Q3ListViewItem *item)
457{ 461{
458 if (item) 462 if (item)
459 { 463 {
460#ifndef KAB_EMBEDDED 464#ifndef KAB_EMBEDDED
461 ContactListViewItem *ceItem 465 ContactListViewItem *ceItem
462 = dynamic_cast<ContactListViewItem*>(item); 466 = dynamic_cast<ContactListViewItem*>(item);
@@ -484,9 +488,9 @@ void KAddressBookTableView::addresseeDeleted()
484} 488}
485 489
486 490
487 491
488 492
489 493
490#ifndef KAB_EMBEDDED 494#ifndef KAB_EMBEDDED_
491#include "kaddressbooktableview.moc" 495#include "moc_kaddressbooktableview.cpp"
492#endif //KAB_EMBEDDED 496#endif //KAB_EMBEDDED
diff --git a/kaddressbook/views/kaddressbooktableview.h b/kaddressbook/views/kaddressbooktableview.h
index 38db7b4..c3cb038 100644
--- a/kaddressbook/views/kaddressbooktableview.h
+++ b/kaddressbook/views/kaddressbooktableview.h
@@ -7,31 +7,33 @@
7 7
8#ifdef HAVE_CONFIG_H 8#ifdef HAVE_CONFIG_H
9#include <config.h> 9#include <config.h>
10#endif 10#endif
11 11
12#include <qwidget.h> 12#include <qwidget.h>
13#include <qlistview.h> 13#include <q3listview.h>
14#include <qstring.h> 14#include <qstring.h>
15#include <qdialog.h> 15#include <qdialog.h>
16#include <qtabdialog.h> 16#include <q3tabdialog.h>
17#include <qstringlist.h> 17#include <qstringlist.h>
18#include <qvaluelist.h> 18#include <q3valuelist.h>
19 19
20#include "undo.h" 20#include "undo.h"
21 21
22#else //KAB_EMBEDDED 22#else //KAB_EMBEDDED
23#include "views/configuretableviewdialog.h" 23#include "views/configuretableviewdialog.h"
24#endif //KAB_EMBEDDED 24#endif //KAB_EMBEDDED
25 25
26#include "klocale.h" 26#include "klocale.h"
27#include "kaddressbookview.h" 27#include "kaddressbookview.h"
28//Added by qt3to4:
29#include <Q3VBoxLayout>
28 30
29class QListViewItem; 31class Q3ListViewItem;
30class QListBox; 32class Q3ListBox;
31class QVBoxLayout; 33class Q3VBoxLayout;
32class KConfig; 34class KConfig;
33 35
34class ContactListViewItem; 36class ContactListViewItem;
35class ContactListView; 37class ContactListView;
36 38
37 39
@@ -76,16 +78,16 @@ friend class ContactListView;
76 void addresseeSelected(); 78 void addresseeSelected();
77 void addresseeDeleted(); 79 void addresseeDeleted();
78 80
79 /** Called whenever the user executes an addressee. In terms of the 81 /** Called whenever the user executes an addressee. In terms of the
80 * list view, this is probably a double click 82 * list view, this is probably a double click
81 */ 83 */
82 void addresseeExecuted(QListViewItem*); 84 void addresseeExecuted(Q3ListViewItem*);
83 85
84 private: 86 private:
85 QVBoxLayout *mainLayout; 87 Q3VBoxLayout *mainLayout;
86 ContactListView *mListView; 88 ContactListView *mListView;
87}; 89};
88 90
89 91
90class TableViewFactory : public ViewFactory 92class TableViewFactory : public ViewFactory
91{ 93{
diff --git a/kaddressbook/xxport/csv_xxport.cpp b/kaddressbook/xxport/csv_xxport.cpp
index 7281003..ed5807f 100644
--- a/kaddressbook/xxport/csv_xxport.cpp
+++ b/kaddressbook/xxport/csv_xxport.cpp
@@ -27,13 +27,13 @@ Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <qfile.h> 31#include <qfile.h>
32#include <qregexp.h> 32#include <qregexp.h>
33#include <qtextstream.h> 33#include <q3textstream.h>
34#include <qtextcodec.h> 34#include <qtextcodec.h>
35 35
36#include <kfiledialog.h> 36#include <kfiledialog.h>
37#ifndef KAB_EMBEDDED 37#ifndef KAB_EMBEDDED
38#include <kio/netaccess.h> 38#include <kio/netaccess.h>
39#endif //KAB_EMBEDDED 39#endif //KAB_EMBEDDED
@@ -101,13 +101,13 @@ bool CSVXXPort::exportContacts( const KABC::AddresseeList &list, const QString&
101 doExport( tmpFile.file(), list ); 101 doExport( tmpFile.file(), list );
102 tmpFile.close(); 102 tmpFile.close();
103 103
104 return KIO::NetAccess::upload( tmpFile.name(), url, parentWidget() ); 104 return KIO::NetAccess::upload( tmpFile.name(), url, parentWidget() );
105 } else { 105 } else {
106 QFile file( url.path() ); 106 QFile file( url.path() );
107 if ( !file.open( IO_WriteOnly ) ) { 107 if ( !file.open( QIODevice::WriteOnly ) ) {
108 QString txt = i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ); 108 QString txt = i18n( "<qt>Unable to open file <b>%1</b>.</qt>" );
109 KMessageBox::error( parentWidget(), txt.arg( url.path() ) ); 109 KMessageBox::error( parentWidget(), txt.arg( url.path() ) );
110 return false; 110 return false;
111 } 111 }
112 112
113 doExport( &file, list ); 113 doExport( &file, list );
@@ -121,13 +121,13 @@ bool CSVXXPort::exportContacts( const KABC::AddresseeList &list, const QString&
121 QString fileName = KFileDialog::getSaveFileName( "addressbook.csv", i18n("Save file"), parentWidget() ); 121 QString fileName = KFileDialog::getSaveFileName( "addressbook.csv", i18n("Save file"), parentWidget() );
122 122
123 if ( fileName.isEmpty() ) 123 if ( fileName.isEmpty() )
124 return false; 124 return false;
125 125
126 QFile file( fileName ); 126 QFile file( fileName );
127 if ( !file.open( IO_WriteOnly ) ) { 127 if ( !file.open( QIODevice::WriteOnly ) ) {
128 QString txt = i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ); 128 QString txt = i18n( "<qt>Unable to open file <b>%1</b>.</qt>" );
129 KMessageBox::error( parentWidget(), txt.arg( fileName ) ); 129 KMessageBox::error( parentWidget(), txt.arg( fileName ) );
130 return false; 130 return false;
131 } 131 }
132 132
133 doExport( &file, list ); 133 doExport( &file, list );
@@ -148,13 +148,13 @@ KABC::AddresseeList CSVXXPort::importContacts( const QString& ) const
148 else 148 else
149 return KABC::AddresseeList(); 149 return KABC::AddresseeList();
150} 150}
151 151
152void CSVXXPort::doExport( QFile *fp, const KABC::AddresseeList &list ) 152void CSVXXPort::doExport( QFile *fp, const KABC::AddresseeList &list )
153{ 153{
154 QTextStream t( fp ); 154 Q3TextStream t( fp );
155 t.setCodec( QTextCodec::codecForName("utf8") ); 155 t.setCodec( QTextCodec::codecForName("utf8") );
156 156
157 KABC::AddresseeList::ConstIterator iter; 157 KABC::AddresseeList::ConstIterator iter;
158 KABC::Field::List fields = addressBook()->fields(); 158 KABC::Field::List fields = addressBook()->fields();
159 KABC::Field::List::Iterator fieldIter; 159 KABC::Field::List::Iterator fieldIter;
160 bool first = true; 160 bool first = true;
@@ -184,11 +184,9 @@ void CSVXXPort::doExport( QFile *fp, const KABC::AddresseeList &list )
184 } 184 }
185 185
186 t << "\n"; 186 t << "\n";
187 } 187 }
188} 188}
189 189
190#ifndef KAB_EMBEDDED 190#ifndef KAB_EMBEDDED_
191#include "csv_xxport.moc" 191#include "moc_csv_xxport.cpp"
192#endif //KAB_EMBEDDED 192#endif //KAB_EMBEDDED
193
194
diff --git a/kaddressbook/xxport/csvimportdialog.cpp b/kaddressbook/xxport/csvimportdialog.cpp
index 862241e..7959cac 100644
--- a/kaddressbook/xxport/csvimportdialog.cpp
+++ b/kaddressbook/xxport/csvimportdialog.cpp
@@ -24,28 +24,32 @@ Enhanced Version of the file for platform independent KDE tools.
24Copyright (c) 2004 Ulf Schenk 24Copyright (c) 2004 Ulf Schenk
25 25
26$Id$ 26$Id$
27*/ 27*/
28 28
29 29
30#include <qbuttongroup.h> 30#include <q3buttongroup.h>
31#include <qcheckbox.h> 31#include <qcheckbox.h>
32#include <qcombobox.h> 32#include <qcombobox.h>
33#ifdef DESKTOP_VERSION 33#ifdef DESKTOP_VERSION
34#include <qinputdialog.h> 34#include <qinputdialog.h>
35#else 35#else
36#include <qtcompat/qinputdialog.h> 36#include <qtcompat/qinputdialog.h>
37#endif 37#endif
38#include <qlabel.h> 38#include <qlabel.h>
39#include <qlineedit.h> 39#include <qlineedit.h>
40#include <qpushbutton.h> 40#include <qpushbutton.h>
41#include <qradiobutton.h> 41#include <qradiobutton.h>
42#include <qtable.h> 42#include <q3table.h>
43#include <qlayout.h> 43#include <qlayout.h>
44#include <qtextstream.h> 44#include <q3textstream.h>
45#include <qfile.h> 45#include <qfile.h>
46//Added by qt3to4:
47#include <Q3HBoxLayout>
48#include <Q3ValueList>
49#include <Q3GridLayout>
46 50
47#include <kapplication.h> 51#include <kapplication.h>
48#include <kdebug.h> 52#include <kdebug.h>
49#include <kdialogbase.h> 53#include <kdialogbase.h>
50#include <kfiledialog.h> 54#include <kfiledialog.h>
51#include <klineedit.h> 55#include <klineedit.h>
@@ -53,13 +57,13 @@ $Id$
53#include <kglobal.h> 57#include <kglobal.h>
54#include <kmessagebox.h> 58#include <kmessagebox.h>
55#include <kstandarddirs.h> 59#include <kstandarddirs.h>
56#include <kurlrequester.h> 60#include <kurlrequester.h>
57 61
58#ifdef DESKTOP_VERSION 62#ifdef DESKTOP_VERSION
59#include "qtable.h" 63#include "q3table.h"
60#else 64#else
61#include "qcombotableitem.h" 65#include "qcombotableitem.h"
62#endif 66#endif
63#include "csvimportdialog.h" 67#include "csvimportdialog.h"
64 68
65CSVImportDialog::CSVImportDialog( KABC::AddressBook *ab, QWidget *parent, 69CSVImportDialog::CSVImportDialog( KABC::AddressBook *ab, QWidget *parent,
@@ -158,13 +162,13 @@ CSVImportDialog::CSVImportDialog( KABC::AddressBook *ab, QWidget *parent,
158 this, SLOT( applyTemplate() ) ); 162 this, SLOT( applyTemplate() ) );
159 163
160 connect( this, SIGNAL( user2Clicked() ), 164 connect( this, SIGNAL( user2Clicked() ),
161 this, SLOT( saveTemplate() ) ); 165 this, SLOT( saveTemplate() ) );
162 166
163 // if ( QApplication::desktop()->width() < 321 ) 167 // if ( QApplication::desktop()->width() < 321 )
164 QIconSet icon = SmallIcon("filesave"); 168 QIcon icon = SmallIcon("filesave");
165 169
166 findButton( User2 )->setIconSet (icon ) ; 170 findButton( User2 )->setIconSet (icon ) ;
167 icon = SmallIcon("fileopen"); 171 icon = SmallIcon("fileopen");
168 findButton( User1 )->setIconSet (icon ) ; 172 findButton( User1 )->setIconSet (icon ) ;
169 int wid = findButton( User2 )->sizeHint().height(); 173 int wid = findButton( User2 )->sizeHint().height();
170 findButton( User2 )->setMaximumWidth( wid+4 ); 174 findButton( User2 )->setMaximumWidth( wid+4 );
@@ -183,13 +187,13 @@ KABC::AddresseeList CSVImportDialog::contacts() const
183 KABC::Addressee a; 187 KABC::Addressee a;
184 bool emptyRow = true; 188 bool emptyRow = true;
185 KABC::Address addrHome( KABC::Address::Home ); 189 KABC::Address addrHome( KABC::Address::Home );
186 KABC::Address addrWork( KABC::Address::Work ); 190 KABC::Address addrWork( KABC::Address::Work );
187 for ( int col = 0; col < mTable->numCols(); ++col ) { 191 for ( int col = 0; col < mTable->numCols(); ++col ) {
188 192
189 QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, col ) ); 193 Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0, col ) );
190 194
191 if ( !item ) { 195 if ( !item ) {
192 qDebug( "ERROR: item cast failed" ); 196 qDebug( "ERROR: item cast failed" );
193 continue; 197 continue;
194 } 198 }
195 199
@@ -226,13 +230,13 @@ KABC::AddresseeList CSVImportDialog::contacts() const
226 case Birthday: 230 case Birthday:
227//US 231//US
228//the generated code had the following format: a.setBirthday( QDate::fromString( value, Qt::ISODate ) ); 232//the generated code had the following format: a.setBirthday( QDate::fromString( value, Qt::ISODate ) );
229// But Qt::IsoDate and QDate::fromString was not specified. Do I have the wrong QT version ? 233// But Qt::IsoDate and QDate::fromString was not specified. Do I have the wrong QT version ?
230 { 234 {
231 QDate dt = KGlobal::locale()->readDate( value, "%Y-%m-%d"); // = Qt::ISODate 235 QDate dt = KGlobal::locale()->readDate( value, "%Y-%m-%d"); // = Qt::ISODate
232 a.setBirthday(dt); 236 a.setBirthday(QDateTime(dt));
233 } 237 }
234 break; 238 break;
235 case Email: 239 case Email:
236 if ( !value.isEmpty() ) 240 if ( !value.isEmpty() )
237 a.insertEmail( value, true ); 241 a.insertEmail( value, true );
238 break; 242 break;
@@ -379,32 +383,32 @@ KABC::AddresseeList CSVImportDialog::contacts() const
379} 383}
380 384
381void CSVImportDialog::initGUI() 385void CSVImportDialog::initGUI()
382{ 386{
383 QWidget* page = plainPage(); 387 QWidget* page = plainPage();
384 388
385 QGridLayout *layout = new QGridLayout( page, 1, 1, marginHintSmall(), 389 Q3GridLayout *layout = new Q3GridLayout( page, 1, 1, marginHintSmall(),
386 spacingHintSmall() ); 390 spacingHintSmall() );
387 QHBoxLayout *hbox = new QHBoxLayout(); 391 Q3HBoxLayout *hbox = new Q3HBoxLayout();
388 hbox->setSpacing( spacingHint() ); 392 hbox->setSpacing( spacingHint() );
389 393
390 QLabel *label = new QLabel( i18n( "File to import:" ), page ); 394 QLabel *label = new QLabel( i18n( "File to import:" ), page );
391 hbox->addWidget( label ); 395 hbox->addWidget( label );
392 396
393 mUrlRequester = new KURLRequester( page ); 397 mUrlRequester = new KURLRequester( page );
394 mUrlRequester->setFilter( "*.csv" ); 398 mUrlRequester->setFilter( "*.csv" );
395 hbox->addWidget( mUrlRequester ); 399 hbox->addWidget( mUrlRequester );
396 400
397 layout->addMultiCellLayout( hbox, 0, 0, 0, 2 ); 401 layout->addMultiCellLayout( hbox, 0, 0, 0, 2 );
398 402
399 // Delimiter: comma, semicolon, tab, space, other 403 // Delimiter: comma, semicolon, tab, space, other
400 mDelimiterBox = new QButtonGroup( i18n( "Delimiter" ), page ); 404 mDelimiterBox = new Q3ButtonGroup( i18n( "Delimiter" ), page );
401 mDelimiterBox->setColumnLayout( 0, Qt::Vertical ); 405 mDelimiterBox->setColumnLayout( 0, Qt::Vertical );
402 mDelimiterBox->layout()->setSpacing( spacingHint() ); 406 mDelimiterBox->layout()->setSpacing( spacingHint() );
403 mDelimiterBox->layout()->setMargin( marginHint() ); 407 mDelimiterBox->layout()->setMargin( marginHint() );
404 QGridLayout *delimiterLayout = new QGridLayout( mDelimiterBox->layout() ); 408 Q3GridLayout *delimiterLayout = new Q3GridLayout( mDelimiterBox->layout() );
405 delimiterLayout->setAlignment( Qt::AlignTop ); 409 delimiterLayout->setAlignment( Qt::AlignTop );
406 layout->addMultiCellWidget( mDelimiterBox, 1, 1, 0, 2 ); 410 layout->addMultiCellWidget( mDelimiterBox, 1, 1, 0, 2 );
407 411
408 mRadioComma = new QRadioButton( i18n( "Comma" ), mDelimiterBox ); 412 mRadioComma = new QRadioButton( i18n( "Comma" ), mDelimiterBox );
409 mRadioComma->setChecked( true ); 413 mRadioComma->setChecked( true );
410 delimiterLayout->addWidget( mRadioComma, 0, 0 ); 414 delimiterLayout->addWidget( mRadioComma, 0, 0 );
@@ -447,14 +451,14 @@ void CSVImportDialog::initGUI()
447 layout->addWidget( label, 2, 2 ); 451 layout->addWidget( label, 2, 2 );
448 452
449 mIgnoreDuplicates = new QCheckBox( page ); 453 mIgnoreDuplicates = new QCheckBox( page );
450 mIgnoreDuplicates->setText( i18n( "Ignore duplicate delimiters" ) ); 454 mIgnoreDuplicates->setText( i18n( "Ignore duplicate delimiters" ) );
451 layout->addMultiCellWidget( mIgnoreDuplicates, 4, 4, 0, 2 ); 455 layout->addMultiCellWidget( mIgnoreDuplicates, 4, 4, 0, 2 );
452 456
453 mTable = new QTable( 0, 0, page ); 457 mTable = new Q3Table( 0, 0, page );
454 mTable->setSelectionMode( QTable::NoSelection ); 458 mTable->setSelectionMode( Q3Table::NoSelection );
455 //mTable->horizontalHeader()->hide(); 459 //mTable->horizontalHeader()->hide();
456 layout->addMultiCellWidget( mTable, 5, 5, 0, 2 ); 460 layout->addMultiCellWidget( mTable, 5, 5, 0, 2 );
457/*US 461/*US
458 setButtonText( User1, i18n( "Apply Template" ) ); 462 setButtonText( User1, i18n( "Apply Template" ) );
459 setButtonText( User2, i18n( "Save Template" ) ); 463 setButtonText( User2, i18n( "Save Template" ) );
460*/ 464*/
@@ -480,17 +484,17 @@ void CSVImportDialog::fillTable()
480 S_MAYBE_NORMAL_FIELD, S_NORMAL_FIELD } state = S_START; 484 S_MAYBE_NORMAL_FIELD, S_NORMAL_FIELD } state = S_START;
481 485
482 QChar x; 486 QChar x;
483 QString field = ""; 487 QString field = "";
484 488
485 // store previous assignment 489 // store previous assignment
486 QValueList<int> mTypeOld = mTypeStore; 490 Q3ValueList<int> mTypeOld = mTypeStore;
487 491
488 mTypeStore.clear(); 492 mTypeStore.clear();
489 for ( column = 0; column < mTable->numCols(); ++column ) { 493 for ( column = 0; column < mTable->numCols(); ++column ) {
490 QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, column ) ); 494 Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0, column ) );
491 495
492 if ( !item || mClearTypeStore ) 496 if ( !item || mClearTypeStore )
493 mTypeStore.append( typeToPos( Undefined ) ); 497 mTypeStore.append( typeToPos( Undefined ) );
494 else if ( item ) 498 else if ( item )
495 mTypeStore.append( item->currentItem() ); 499 mTypeStore.append( item->currentItem() );
496 } 500 }
@@ -503,33 +507,33 @@ void CSVImportDialog::fillTable()
503 } else if ( mComboCodec->currentItem () == 1 ) { 507 } else if ( mComboCodec->currentItem () == 1 ) {
504 mData = QString::fromLatin1( mFileArray.data() ); 508 mData = QString::fromLatin1( mFileArray.data() );
505 } else { 509 } else {
506 mData = QString::fromLocal8Bit( mFileArray.data() ); 510 mData = QString::fromLocal8Bit( mFileArray.data() );
507 } 511 }
508 512
509 QTextStream inputStream( mData, IO_ReadOnly ); 513 Q3TextStream inputStream( mData, QIODevice::ReadOnly );
510 514
511 if ( mComboCodec->currentItem () == 0 ) { 515 if ( mComboCodec->currentItem () == 0 ) {
512 inputStream.setEncoding( QTextStream::UnicodeUTF8 ); 516 inputStream.setEncoding( Q3TextStream::UnicodeUTF8 );
513 } else if ( mComboCodec->currentItem () == 1 ) { 517 } else if ( mComboCodec->currentItem () == 1 ) {
514 inputStream.setEncoding( QTextStream::Latin1 ); 518 inputStream.setEncoding( Q3TextStream::Latin1 );
515 } else { 519 } else {
516 inputStream.setEncoding( QTextStream::Locale ); 520 inputStream.setEncoding( Q3TextStream::Locale );
517 } 521 }
518 522
519 int maxColumn = 0; 523 int maxColumn = 0;
520 while ( !inputStream.atEnd() ) { 524 while ( !inputStream.atEnd() ) {
521 inputStream >> x; // read one char 525 inputStream >> x; // read one char
522 526
523 if ( x == '\r' ) inputStream >> x; // eat '\r', to handle DOS/LOSEDOWS files correctly 527 if ( x == '\r' ) inputStream >> x; // eat '\r', to handle DOS/LOSEDOWS files correctly
524 528
525 switch ( state ) { 529 switch ( state ) {
526 case S_START : 530 case S_START :
527 if ( x == mTextQuote ) { 531 if ( x == mTextQuote ) {
528 state = S_QUOTED_FIELD; 532 state = S_QUOTED_FIELD;
529 } else if ( x == mDelimiter ) { 533 } else if ( QString(x) == mDelimiter ) {
530 if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) 534 if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) )
531 ++column; 535 ++column;
532 lastCharDelimiter = true; 536 lastCharDelimiter = true;
533 } else if ( x == '\n' ) { 537 } else if ( x == '\n' ) {
534 ++row; 538 ++row;
535 column = 1; 539 column = 1;
@@ -558,13 +562,13 @@ void CSVImportDialog::fillTable()
558 } 562 }
559 break; 563 break;
560 case S_MAYBE_END_OF_QUOTED_FIELD : 564 case S_MAYBE_END_OF_QUOTED_FIELD :
561 if ( x == mTextQuote ) { 565 if ( x == mTextQuote ) {
562 field += x; 566 field += x;
563 state = S_QUOTED_FIELD; 567 state = S_QUOTED_FIELD;
564 } else if ( x == mDelimiter || x == '\n' ) { 568 } else if ( QString(x) == mDelimiter || x == '\n' ) {
565 setText( row - mStartLine + 1, column, field ); 569 setText( row - mStartLine + 1, column, field );
566 field = ""; 570 field = "";
567 if ( x == '\n' ) { 571 if ( x == '\n' ) {
568 ++row; 572 ++row;
569 column = 1; 573 column = 1;
570 } else { 574 } else {
@@ -575,13 +579,13 @@ void CSVImportDialog::fillTable()
575 state = S_START; 579 state = S_START;
576 } else { 580 } else {
577 state = S_END_OF_QUOTED_FIELD; 581 state = S_END_OF_QUOTED_FIELD;
578 } 582 }
579 break; 583 break;
580 case S_END_OF_QUOTED_FIELD : 584 case S_END_OF_QUOTED_FIELD :
581 if ( x == mDelimiter || x == '\n' ) { 585 if ( QString(x) == mDelimiter || x == '\n' ) {
582 setText( row - mStartLine + 1, column, field ); 586 setText( row - mStartLine + 1, column, field );
583 field = ""; 587 field = "";
584 if ( x == '\n' ) { 588 if ( x == '\n' ) {
585 ++row; 589 ++row;
586 column = 1; 590 column = 1;
587 } else { 591 } else {
@@ -598,13 +602,13 @@ void CSVImportDialog::fillTable()
598 if ( x == mTextQuote ) { 602 if ( x == mTextQuote ) {
599 field = ""; 603 field = "";
600 state = S_QUOTED_FIELD; 604 state = S_QUOTED_FIELD;
601 break; 605 break;
602 } 606 }
603 case S_NORMAL_FIELD : 607 case S_NORMAL_FIELD :
604 if ( x == mDelimiter || x == '\n' ) { 608 if ( QString(x) == mDelimiter || x == '\n' ) {
605 setText( row - mStartLine + 1, column, field ); 609 setText( row - mStartLine + 1, column, field );
606 field = ""; 610 field = "";
607 if ( x == '\n' ) { 611 if ( x == '\n' ) {
608 ++row; 612 ++row;
609 column = 1; 613 column = 1;
610 } else { 614 } else {
@@ -614,13 +618,13 @@ void CSVImportDialog::fillTable()
614 } 618 }
615 state = S_START; 619 state = S_START;
616 } else { 620 } else {
617 field += x; 621 field += x;
618 } 622 }
619 } 623 }
620 if ( x != mDelimiter ) 624 if ( QString(x) != mDelimiter )
621 lastCharDelimiter = false; 625 lastCharDelimiter = false;
622 626
623 if ( column > maxColumn ) 627 if ( column > maxColumn )
624 maxColumn = column; 628 maxColumn = column;
625 } 629 }
626 630
@@ -646,13 +650,13 @@ void CSVImportDialog::fillTable()
646 keys[( it.data() )] = it.key(); 650 keys[( it.data() )] = it.key();
647//US end 651//US end
648 652
649 for ( column = 0; column < mTable->numCols(); ++column ) { 653 for ( column = 0; column < mTable->numCols(); ++column ) {
650 654
651//US QComboTableItem *item = new QComboTableItem( mTable, mTypeMap.keys() ); 655//US QComboTableItem *item = new QComboTableItem( mTable, mTypeMap.keys() );
652 QComboTableItem *item = new QComboTableItem( mTable, keys ); 656 Q3ComboTableItem *item = new Q3ComboTableItem( mTable, keys );
653 mTable->setItem( 0, column, item ); 657 mTable->setItem( 0, column, item );
654 if ( column < mTypeStore.count() ) 658 if ( column < mTypeStore.count() )
655 item->setCurrentItem( mTypeStore[ column ] ); 659 item->setCurrentItem( mTypeStore[ column ] );
656 else 660 else
657 item->setCurrentItem( typeToPos( Undefined ) ); 661 item->setCurrentItem( typeToPos( Undefined ) );
658 662
@@ -761,13 +765,13 @@ void CSVImportDialog::lineSelected( const QString& line )
761 765
762void CSVImportDialog::slotOk() 766void CSVImportDialog::slotOk()
763{ 767{
764 bool assigned = false; 768 bool assigned = false;
765 769
766 for ( int column = 0; column < mTable->numCols(); ++column ) { 770 for ( int column = 0; column < mTable->numCols(); ++column ) {
767 QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, 771 Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0,
768 column ) ); 772 column ) );
769 if ( item && posToType( item->currentItem() ) != Undefined ) 773 if ( item && posToType( item->currentItem() ) != Undefined )
770 assigned = true; 774 assigned = true;
771 } 775 }
772 776
773 if ( assigned ) 777 if ( assigned )
@@ -833,13 +837,13 @@ void CSVImportDialog::applyTemplate()
833 columnMap.insert( i, col ); 837 columnMap.insert( i, col );
834 } 838 }
835 839
836 // apply the column map 840 // apply the column map
837 for ( uint column = 0; column < columnMap.count(); ++column ) { 841 for ( uint column = 0; column < columnMap.count(); ++column ) {
838 int type = columnMap[ column ]; 842 int type = columnMap[ column ];
839 QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, 843 Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0,
840 column ) ); 844 column ) );
841 if ( item ) 845 if ( item )
842 item->setCurrentItem( typeToPos( type ) ); 846 item->setCurrentItem( typeToPos( type ) );
843 } 847 }
844} 848}
845 849
@@ -875,13 +879,13 @@ void CSVImportDialog::saveTemplate()
875 config.setGroup( "Misc" ); 879 config.setGroup( "Misc" );
876 config.writeEntry( "Name", name ); 880 config.writeEntry( "Name", name );
877 881
878 config.setGroup( "csv column map" ); 882 config.setGroup( "csv column map" );
879 883
880 for ( uint column = 0; column < mTable->numCols(); ++column ) { 884 for ( uint column = 0; column < mTable->numCols(); ++column ) {
881 QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, 885 Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0,
882 column ) ); 886 column ) );
883 if ( item ) 887 if ( item )
884 config.writeEntry( QString::number( column ), posToType( 888 config.writeEntry( QString::number( column ), posToType(
885 item->currentItem() ) ); 889 item->currentItem() ) );
886 else 890 else
887 config.writeEntry( QString::number( column ), 0 ); 891 config.writeEntry( QString::number( column ), 0 );
@@ -931,13 +935,13 @@ void CSVImportDialog::ignoreDuplicatesChanged( int )
931void CSVImportDialog::setFile( const QString &fileName ) 935void CSVImportDialog::setFile( const QString &fileName )
932{ 936{
933 if ( fileName.isEmpty() ) 937 if ( fileName.isEmpty() )
934 return; 938 return;
935 939
936 QFile file( fileName ); 940 QFile file( fileName );
937 if ( !file.open( IO_ReadOnly ) ) { 941 if ( !file.open( QIODevice::ReadOnly ) ) {
938 KMessageBox::sorry( this, i18n( "Cannot open input file!" ) ); 942 KMessageBox::sorry( this, i18n( "Cannot open input file!" ) );
939 file.close(); 943 file.close();
940 return; 944 return;
941 } 945 }
942 946
943 mFileArray = file.readAll(); 947 mFileArray = file.readAll();
@@ -961,9 +965,9 @@ void CSVImportDialog::urlChanged( const QString &file )
961 965
962 findButton( User1 )->setEnabled( state ); 966 findButton( User1 )->setEnabled( state );
963 findButton( User2 )->setEnabled( state ); 967 findButton( User2 )->setEnabled( state );
964 968
965} 969}
966 970
967#ifndef KAB_EMBEDDED 971#ifndef KAB_EMBEDDED_
968#include <csvimportdialog.moc> 972#include <moc_csvimportdialog.cpp>
969#endif //KAB_EMBEDDED 973#endif //KAB_EMBEDDED
diff --git a/kaddressbook/xxport/csvimportdialog.h b/kaddressbook/xxport/csvimportdialog.h
index 2661420..520f3fa 100644
--- a/kaddressbook/xxport/csvimportdialog.h
+++ b/kaddressbook/xxport/csvimportdialog.h
@@ -30,23 +30,23 @@ $Id$
30#define CSV_IMPORT_DLG_H 30#define CSV_IMPORT_DLG_H
31 31
32#include <kabc/addressbook.h> 32#include <kabc/addressbook.h>
33#include <kabc/addresseelist.h> 33#include <kabc/addresseelist.h>
34#include <kdialogbase.h> 34#include <kdialogbase.h>
35 35
36#include <qvaluelist.h> 36#include <q3valuelist.h>
37 37
38class KURLRequester; 38class KURLRequester;
39 39
40class QButtonGroup; 40class Q3ButtonGroup;
41class QComboBox; 41class QComboBox;
42class QCheckBox; 42class QCheckBox;
43class QLineEdit; 43class QLineEdit;
44class QPushButton; 44class QPushButton;
45class QRadioButton; 45class QRadioButton;
46class QTable; 46class Q3Table;
47 47
48class CSVImportDialog : public KDialogBase 48class CSVImportDialog : public KDialogBase
49{ 49{
50 Q_OBJECT 50 Q_OBJECT
51 51
52 public: 52 public:
@@ -82,14 +82,14 @@ class CSVImportDialog : public KDialogBase
82 BusinessAddressPostalCode, BusinessAddressCountry, 82 BusinessAddressPostalCode, BusinessAddressCountry,
83 BusinessAddressLabel, 83 BusinessAddressLabel,
84 HomePhone, BusinessPhone, MobilePhone, HomeFax, BusinessFax, MobileWorkPhone, 84 HomePhone, BusinessPhone, MobilePhone, HomeFax, BusinessFax, MobileWorkPhone,
85 Isdn, Pager, Email, Mailer, Title, Role, Organization, Note, URL, Categories 85 Isdn, Pager, Email, Mailer, Title, Role, Organization, Note, URL, Categories
86 }; 86 };
87 87
88 QTable* mTable; 88 Q3Table* mTable;
89 QButtonGroup* mDelimiterBox; 89 Q3ButtonGroup* mDelimiterBox;
90 QRadioButton* mRadioComma; 90 QRadioButton* mRadioComma;
91 QRadioButton* mRadioSemicolon; 91 QRadioButton* mRadioSemicolon;
92 QRadioButton* mRadioTab; 92 QRadioButton* mRadioTab;
93 QRadioButton* mRadioSpace; 93 QRadioButton* mRadioSpace;
94 QRadioButton* mRadioOther; 94 QRadioButton* mRadioOther;
95 QLineEdit* mDelimiterEdit; 95 QLineEdit* mDelimiterEdit;
@@ -116,11 +116,11 @@ class CSVImportDialog : public KDialogBase
116 QString mData; 116 QString mData;
117 QByteArray mFileArray; 117 QByteArray mFileArray;
118 QMap<QString, uint> mTypeMap; 118 QMap<QString, uint> mTypeMap;
119 KABC::AddressBook *mAddressBook; 119 KABC::AddressBook *mAddressBook;
120 int mCustomCounter; 120 int mCustomCounter;
121 bool mClearTypeStore; 121 bool mClearTypeStore;
122 QValueList<int> mTypeStore; 122 Q3ValueList<int> mTypeStore;
123 123
124}; 124};
125 125
126#endif 126#endif
diff --git a/kaddressbook/xxport/kde2_xxport.cpp b/kaddressbook/xxport/kde2_xxport.cpp
index 03efc1b..72d3fc2 100644
--- a/kaddressbook/xxport/kde2_xxport.cpp
+++ b/kaddressbook/xxport/kde2_xxport.cpp
@@ -113,9 +113,9 @@ KABC::AddresseeList KDE2XXPort::importContacts( const QString& ) const
113 113
114 addressBook()->load(); 114 addressBook()->load();
115 115
116 return KABC::AddresseeList(); 116 return KABC::AddresseeList();
117} 117}
118 118
119#ifndef KAB_EMBEDDED 119#ifndef KAB_EMBEDDED_
120#include "kde2_xxport.moc" 120#include "moc_kde2_xxport.cpp"
121#endif //KAB_EMBEDDED 121#endif //KAB_EMBEDDED
diff --git a/kaddressbook/xxport/vcard_xxport.cpp b/kaddressbook/xxport/vcard_xxport.cpp
index 9a8fa68..64b9071 100644
--- a/kaddressbook/xxport/vcard_xxport.cpp
+++ b/kaddressbook/xxport/vcard_xxport.cpp
@@ -26,14 +26,16 @@
26 Copyright (c) 2004 Ulf Schenk 26 Copyright (c) 2004 Ulf Schenk
27 27
28 $Id$ 28 $Id$
29*/ 29*/
30 30
31#include <qfile.h> 31#include <qfile.h>
32#include <qtextstream.h> 32#include <q3textstream.h>
33#include <qfileinfo.h> 33#include <qfileinfo.h>
34//Added by qt3to4:
35#include <Q3CString>
34 36
35#include <kabc/vcardconverter.h> 37#include <kabc/vcardconverter.h>
36#include <kabc/vcardparser/vcardtool.h> 38#include <kabc/vcardparser/vcardtool.h>
37#include <kfiledialog.h> 39#include <kfiledialog.h>
38#ifndef KAB_EMBEDDED 40#ifndef KAB_EMBEDDED
39#include <kio/netaccess.h> 41#include <kio/netaccess.h>
@@ -99,20 +101,20 @@ bool VCardXXPort::exportContacts( const KABC::AddresseeList &list, const QString
99#endif //KAB_EMBEDDED 101#endif //KAB_EMBEDDED
100 102
101 if ( fileName.isEmpty() ) 103 if ( fileName.isEmpty() )
102 return false; 104 return false;
103 105
104 QFile outFile( fileName ); 106 QFile outFile( fileName );
105 if ( !outFile.open( IO_WriteOnly ) ) { 107 if ( !outFile.open( QIODevice::WriteOnly ) ) {
106 QString text = i18n( "<qt>Unable to open file <b>%1</b> for export.</qt>" ); 108 QString text = i18n( "<qt>Unable to open file <b>%1</b> for export.</qt>" );
107 KMessageBox::error( parentWidget(), text.arg( fileName ) ); 109 KMessageBox::error( parentWidget(), text.arg( fileName ) );
108 return false; 110 return false;
109 } 111 }
110 112
111 QTextStream t( &outFile ); 113 Q3TextStream t( &outFile );
112 t.setEncoding( QTextStream::UnicodeUTF8 ); 114 t.setEncoding( Q3TextStream::UnicodeUTF8 );
113 115
114 KABC::Addressee::List::ConstIterator it; 116 KABC::Addressee::List::ConstIterator it;
115 for ( it = list.begin(); it != list.end(); ++it ) { 117 for ( it = list.begin(); it != list.end(); ++it ) {
116 KABC::VCardConverter converter; 118 KABC::VCardConverter converter;
117 QString vcard; 119 QString vcard;
118 120
@@ -150,13 +152,13 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const
150 if ( url.isEmpty() ) 152 if ( url.isEmpty() )
151 return addrList; 153 return addrList;
152 QString caption( i18n( "vCard Import Failed" ) ); 154 QString caption( i18n( "vCard Import Failed" ) );
153 if ( KIO::NetAccess::download( url, fileName ) ) { 155 if ( KIO::NetAccess::download( url, fileName ) ) {
154 QFile file( fileName ); 156 QFile file( fileName );
155 157
156 file.open( IO_ReadOnly ); 158 file.open( QIODevice::ReadOnly );
157 QByteArray rawData = file.readAll(); 159 QByteArray rawData = file.readAll();
158 file.close(); 160 file.close();
159 161
160 QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 ); 162 QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 );
161 addrList = parseVCard( data ); 163 addrList = parseVCard( data );
162 164
@@ -193,14 +195,14 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const
193 qDebug("VCardXXPort::importContacts Urls at the moment not supported"); 195 qDebug("VCardXXPort::importContacts Urls at the moment not supported");
194 if ( url.isEmpty() ) 196 if ( url.isEmpty() )
195 return addrList; 197 return addrList;
196 198
197 } 199 }
198 QFile file( fileName ); 200 QFile file( fileName );
199 if ( file.open( IO_ReadOnly ) ) { 201 if ( file.open( QIODevice::ReadOnly ) ) {
200 QCString rawData ( file.readAll().data(),file.size()+1); 202 Q3CString rawData ( file.readAll().data(),file.size()+1);
201 file.close(); 203 file.close();
202 int start = 0; 204 int start = 0;
203#ifndef DESKTOP_VERSION 205#ifndef DESKTOP_VERSION
204 while ( start < rawData.size()-2 ) { 206 while ( start < rawData.size()-2 ) {
205 if ( rawData.at( start ) == '\r' ) 207 if ( rawData.at( start ) == '\r' )
206 if ( rawData.at( start+1 ) == '\n' ) 208 if ( rawData.at( start+1 ) == '\n' )
@@ -264,9 +266,9 @@ KABC::AddresseeList VCardXXPort::parseVCard( const QString &data ) const
264 KMessageBox::sorry( parentWidget(), text ); 266 KMessageBox::sorry( parentWidget(), text );
265 } 267 }
266 return addrList; 268 return addrList;
267} 269}
268 270
269 271
270#ifndef KAB_EMBEDDED 272#ifndef KAB_EMBEDDED_
271#include "vcard_xxport.moc" 273#include "moc_vcard_xxport.cpp"
272#endif //KAB_EMBEDDED 274#endif //KAB_EMBEDDED
diff --git a/kaddressbook/xxportmanager.cpp b/kaddressbook/xxportmanager.cpp
index 405f7ec..95b240d 100644
--- a/kaddressbook/xxportmanager.cpp
+++ b/kaddressbook/xxportmanager.cpp
@@ -27,12 +27,14 @@ Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <qlayout.h> 31#include <qlayout.h>
32#include <qlist.h> 32#include <qlist.h>
33//Added by qt3to4:
34#include <Q3VBoxLayout>
33 35
34#include <kabc/addressbook.h> 36#include <kabc/addressbook.h>
35#include <kabc/resource.h> 37#include <kabc/resource.h>
36#include <kdebug.h> 38#include <kdebug.h>
37#include <kdialogbase.h> 39#include <kdialogbase.h>
38#include <klocale.h> 40#include <klocale.h>
@@ -214,24 +216,22 @@ void XXPortManager::loadPlugins()
214 if ( !xxportFactory ) { 216 if ( !xxportFactory ) {
215 kdDebug(5720) << "XXPortManager::loadExtensions(): Cast failed" << endl; 217 kdDebug(5720) << "XXPortManager::loadExtensions(): Cast failed" << endl;
216 continue; 218 continue;
217 } 219 }
218 220
219#else //KAB_EMBEDDED 221#else //KAB_EMBEDDED
220 QList<XXPortFactory> factorylist; 222 QList<XXPortFactory*> factorylist;
221 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_csv_xxport())); 223 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_csv_xxport()));
222 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_kde2_xxport())); 224 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_kde2_xxport()));
223 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_vcard_xxport())); 225 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_vcard_xxport()));
224 //US factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_opie_xxport())); 226 //US factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_opie_xxport()));
225 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_qtopia_xxport())); 227 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_qtopia_xxport()));
226 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_sharpdtm_xxport())); 228 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_sharpdtm_xxport()));
227 229
228 QListIterator<XXPortFactory> it(factorylist); 230 for(QList<XXPortFactory*>::iterator it=factorylist.begin();it!=factorylist.end();++it) {
229 for ( ; it.current(); ++it ) 231 XXPortFactory *xxportFactory = *it;
230 {
231 XXPortFactory *xxportFactory = it.current();
232#endif //KAB_EMBEDDED 232#endif //KAB_EMBEDDED
233 233
234 XXPortObject *obj = xxportFactory->xxportObject( mCore->addressBook(), mCore ); 234 XXPortObject *obj = xxportFactory->xxportObject( mCore->addressBook(), mCore );
235 if ( obj ) { 235 if ( obj ) {
236 mCore->addGUIClient( obj ); 236 mCore->addGUIClient( obj );
237 mXXPortObjects.insert( obj->identifier(), obj ); 237 mXXPortObjects.insert( obj->identifier(), obj );
@@ -247,13 +247,13 @@ void XXPortManager::loadPlugins()
247PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent, 247PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent,
248 const char *name ) 248 const char *name )
249 : KDialogBase( Plain, i18n( "Import this contact?" ), Ok | User1| User2, Ok, parent, 249 : KDialogBase( Plain, i18n( "Import this contact?" ), Ok | User1| User2, Ok, parent,
250 name, true, true ,i18n( "Import all!" ),i18n( "No" ) ) 250 name, true, true ,i18n( "Import all!" ),i18n( "No" ) )
251{ 251{
252 QWidget *page = plainPage(); 252 QWidget *page = plainPage();
253 QVBoxLayout *layout = new QVBoxLayout( page, marginHint(), spacingHint() ); 253 Q3VBoxLayout *layout = new Q3VBoxLayout( page, marginHint(), spacingHint() );
254 connect( this, SIGNAL( user1Clicked() ), this, SLOT ( slotClose() ) ); 254 connect( this, SIGNAL( user1Clicked() ), this, SLOT ( slotClose() ) );
255 connect( this, SIGNAL( user2Clicked() ), this, SLOT ( slotCancel() ) ); 255 connect( this, SIGNAL( user2Clicked() ), this, SLOT ( slotCancel() ) );
256 256
257 KABC::AddresseeView *view = new KABC::AddresseeView( page ); 257 KABC::AddresseeView *view = new KABC::AddresseeView( page );
258 view->setAddressee( addr ); 258 view->setAddressee( addr );
259 layout->addWidget( view ); 259 layout->addWidget( view );
@@ -261,10 +261,9 @@ PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent,
261 resize( 640, 480 ); 261 resize( 640, 480 );
262#else 262#else
263 showMaximized(); 263 showMaximized();
264#endif 264#endif
265} 265}
266 266
267#ifndef KAB_EMBEDDED 267#ifndef KAB_EMBEDDED_
268#include "xxportmanager.moc" 268#include "moc_xxportmanager.cpp"
269#endif //KAB_EMBEDDED 269#endif //KAB_EMBEDDED
270
diff --git a/kaddressbook/xxportmanager.h b/kaddressbook/xxportmanager.h
index e801d9b..0528922 100644
--- a/kaddressbook/xxportmanager.h
+++ b/kaddressbook/xxportmanager.h
@@ -29,13 +29,13 @@ $Id$
29*/ 29*/
30 30
31 31
32#ifndef XXPORTMANAGER_H 32#ifndef XXPORTMANAGER_H
33#define XXPORTMANAGER_H 33#define XXPORTMANAGER_H
34 34
35#include <qdict.h> 35#include <q3dict.h>
36#include <qobject.h> 36#include <qobject.h>
37 37
38#include <kurl.h> 38#include <kurl.h>
39 39
40#include "xxportobject.h" 40#include "xxportobject.h"
41 41
@@ -68,13 +68,13 @@ class XXPortManager : public QObject
68 void slotImport( const QString&, const QString& ); 68 void slotImport( const QString&, const QString& );
69 void slotExport( const QString&, const QString& ); 69 void slotExport( const QString&, const QString& );
70 70
71 private: 71 private:
72 void loadPlugins(); 72 void loadPlugins();
73 73
74 QDict<XXPortObject> mXXPortObjects; 74 Q3Dict<XXPortObject> mXXPortObjects;
75 75
76 KABCore *mCore; 76 KABCore *mCore;
77 bool mShowPreview; 77 bool mShowPreview;
78}; 78};
79 79
80#endif 80#endif
diff --git a/kaddressbook/xxportobject.cpp b/kaddressbook/xxportobject.cpp
index bd9d986..2d8d0ff 100644
--- a/kaddressbook/xxportobject.cpp
+++ b/kaddressbook/xxportobject.cpp
@@ -268,9 +268,9 @@ KABC::AddresseeList XXPortResourceObject::_importContacts( const QString& identi
268 268
269 return adrlst; 269 return adrlst;
270} 270}
271 271
272 272
273 273
274#ifndef KAB_EMBEDDED 274#ifndef KAB_EMBEDDED_
275#include "xxportobject.moc" 275#include "moc_xxportobject.cpp"
276#endif //KAB_EMBEDDED 276#endif //KAB_EMBEDDED
diff --git a/kaddressbook/xxportselectdialog.cpp b/kaddressbook/xxportselectdialog.cpp
index 278cab0..088bffa 100644
--- a/kaddressbook/xxportselectdialog.cpp
+++ b/kaddressbook/xxportselectdialog.cpp
@@ -33,22 +33,27 @@ $Id$
33#include <kapplication.h> 33#include <kapplication.h>
34#include <kcombobox.h> 34#include <kcombobox.h>
35#include <klocale.h> 35#include <klocale.h>
36#include <kglobal.h> 36#include <kglobal.h>
37 37
38#include <qapplication.h> 38#include <qapplication.h>
39#include <qbuttongroup.h> 39#include <QDesktopWidget>
40#include <q3buttongroup.h>
40#include <qcombobox.h> 41#include <qcombobox.h>
41#include <qheader.h> 42#include <q3header.h>
42#include <qlabel.h> 43#include <qlabel.h>
43#include <qlayout.h> 44#include <qlayout.h>
44#include <qlistview.h> 45#include <q3listview.h>
45#include <qpushbutton.h> 46#include <qpushbutton.h>
46#include <qradiobutton.h> 47#include <qradiobutton.h>
47#include <qstringlist.h> 48#include <qstringlist.h>
48#include <qwhatsthis.h> 49#include <q3whatsthis.h>
50//Added by qt3to4:
51#include <Q3GridLayout>
52#include <Q3Frame>
53#include <Q3VBoxLayout>
49 54
50#include "kabcore.h" 55#include "kabcore.h"
51#include "kabprefs.h" 56#include "kabprefs.h"
52 57
53#include "xxportselectdialog.h" 58#include "xxportselectdialog.h"
54 59
@@ -59,14 +64,14 @@ XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort,
59 mUseSorting( sort ) 64 mUseSorting( sort )
60{ 65{
61 initGUI(); 66 initGUI();
62 67
63 connect( mFiltersCombo, SIGNAL( activated( int ) ), 68 connect( mFiltersCombo, SIGNAL( activated( int ) ),
64 SLOT( filterChanged( int ) ) ); 69 SLOT( filterChanged( int ) ) );
65 connect( mCategoriesView, SIGNAL( clicked( QListViewItem* ) ), 70 connect( mCategoriesView, SIGNAL( clicked( Q3ListViewItem* ) ),
66 SLOT( categoryClicked( QListViewItem* ) ) ); 71 SLOT( categoryClicked( Q3ListViewItem* ) ) );
67 72
68 // setup filters 73 // setup filters
69#ifndef KAB_EMBEDDED 74#ifndef KAB_EMBEDDED
70 mFilters = Filter::restore( kapp->config(), "Filter" ); 75 mFilters = Filter::restore( kapp->config(), "Filter" );
71 Filter::List::iterator filterIt; 76 Filter::List::iterator filterIt;
72#else //KAB_EMBEDDED 77#else //KAB_EMBEDDED
@@ -81,13 +86,13 @@ XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort,
81 mUseFilters->setEnabled( filters.count() > 0 ); 86 mUseFilters->setEnabled( filters.count() > 0 );
82 87
83 // setup categories 88 // setup categories
84 QStringList categories = KABPrefs::instance()->mCustomCategories; 89 QStringList categories = KABPrefs::instance()->mCustomCategories;
85 QStringList::Iterator it; 90 QStringList::Iterator it;
86 for ( it = categories.begin(); it != categories.end(); ++it ) 91 for ( it = categories.begin(); it != categories.end(); ++it )
87 new QCheckListItem( mCategoriesView, *it, QCheckListItem::CheckBox ); 92 new Q3CheckListItem( mCategoriesView, *it, Q3CheckListItem::CheckBox );
88 mUseCategories->setEnabled( categories.count() > 0 ); 93 mUseCategories->setEnabled( categories.count() > 0 );
89 94
90 int count = mCore->selectedUIDs().count(); 95 int count = mCore->selectedUIDs().count();
91 mUseSelection->setEnabled( count != 0 ); 96 mUseSelection->setEnabled( count != 0 );
92 mUseSelection->setChecked( count > 1 ); 97 mUseSelection->setChecked( count > 1 );
93 98
@@ -207,30 +212,30 @@ KABC::AddresseeList XXPortSelectDialog::contacts()
207} 212}
208 213
209QStringList XXPortSelectDialog::categories() const 214QStringList XXPortSelectDialog::categories() const
210{ 215{
211 QStringList list; 216 QStringList list;
212 217
213 QListViewItemIterator it( mCategoriesView ); 218 Q3ListViewItemIterator it( mCategoriesView );
214 for ( ; it.current(); ++it ) { 219 for ( ; it.current(); ++it ) {
215 QCheckListItem* qcli = static_cast<QCheckListItem*>(it.current()); 220 Q3CheckListItem* qcli = static_cast<Q3CheckListItem*>(it.current());
216 if ( qcli->isOn() ) 221 if ( qcli->isOn() )
217 list.append( it.current()->text( 0 ) ); 222 list.append( it.current()->text( 0 ) );
218 } 223 }
219 224
220 return list; 225 return list;
221} 226}
222 227
223void XXPortSelectDialog::filterChanged( int ) 228void XXPortSelectDialog::filterChanged( int )
224{ 229{
225 mUseFilters->setChecked( true ); 230 mUseFilters->setChecked( true );
226} 231}
227 232
228void XXPortSelectDialog::categoryClicked( QListViewItem *i ) 233void XXPortSelectDialog::categoryClicked( Q3ListViewItem *i )
229{ 234{
230 QCheckListItem *qcli = static_cast<QCheckListItem*>( i ); 235 Q3CheckListItem *qcli = static_cast<Q3CheckListItem*>( i );
231 if ( qcli->isOn() ) 236 if ( qcli->isOn() )
232 mUseCategories->setChecked( true ); 237 mUseCategories->setChecked( true );
233} 238}
234 239
235void XXPortSelectDialog::slotHelp() 240void XXPortSelectDialog::slotHelp()
236{ 241{
@@ -241,66 +246,66 @@ void XXPortSelectDialog::slotHelp()
241#endif //KAB_EMBEDDED 246#endif //KAB_EMBEDDED
242 247
243} 248}
244 249
245void XXPortSelectDialog::initGUI() 250void XXPortSelectDialog::initGUI()
246{ 251{
247 QFrame *page = plainPage(); 252 Q3Frame *page = plainPage();
248 253
249 QVBoxLayout *topLayout = new QVBoxLayout( page, KDialog::marginHintSmall(), 254 Q3VBoxLayout *topLayout = new Q3VBoxLayout( page, KDialog::marginHintSmall(),
250 KDialog::spacingHintSmall() ); 255 KDialog::spacingHintSmall() );
251 256
252 QLabel *label = new QLabel( i18n( "Which contacts do you want to select?" ), page ); 257 QLabel *label = new QLabel( i18n( "Which contacts do you want to select?" ), page );
253 topLayout->addWidget( label ); 258 topLayout->addWidget( label );
254 259
255 mButtonGroup = new QButtonGroup( i18n( "Contact Selection" ), page ); 260 mButtonGroup = new Q3ButtonGroup( i18n( "Contact Selection" ), page );
256 mButtonGroup->setColumnLayout( 0, Qt::Vertical ); 261 mButtonGroup->setColumnLayout( 0, Qt::Vertical );
257 mButtonGroup->layout()->setSpacing( KDialog::spacingHint() ); 262 mButtonGroup->layout()->setSpacing( KDialog::spacingHint() );
258 mButtonGroup->layout()->setMargin( KDialog::marginHint() ); 263 mButtonGroup->layout()->setMargin( KDialog::marginHint() );
259 264
260 QGridLayout *groupLayout = new QGridLayout( mButtonGroup->layout() ); 265 Q3GridLayout *groupLayout = new Q3GridLayout( mButtonGroup->layout() );
261 groupLayout->setAlignment( Qt::AlignTop ); 266 groupLayout->setAlignment( Qt::AlignTop );
262 267
263 mUseWholeBook = new QRadioButton( i18n( "&All" ), mButtonGroup ); 268 mUseWholeBook = new QRadioButton( i18n( "&All" ), mButtonGroup );
264 mUseWholeBook->setChecked( true ); 269 mUseWholeBook->setChecked( true );
265 QWhatsThis::add( mUseWholeBook, i18n( "Select the entire address book" ) ); 270 Q3WhatsThis::add( mUseWholeBook, i18n( "Select the entire address book" ) );
266 groupLayout->addWidget( mUseWholeBook, 0, 0 ); 271 groupLayout->addWidget( mUseWholeBook, 0, 0 );
267 272
268 mUseSelection = new QRadioButton( i18n( "&Selected" ), mButtonGroup ); 273 mUseSelection = new QRadioButton( i18n( "&Selected" ), mButtonGroup );
269 QWhatsThis::add( mUseSelection, i18n( "Only contacts selected in KAddressBook.\n" 274 Q3WhatsThis::add( mUseSelection, i18n( "Only contacts selected in KAddressBook.\n"
270 "This option is disabled if no contacts are selected." ) ); 275 "This option is disabled if no contacts are selected." ) );
271 groupLayout->addWidget( mUseSelection, 1, 0 ); 276 groupLayout->addWidget( mUseSelection, 1, 0 );
272 277
273 mUseFilters = new QRadioButton( i18n( "By matching &filter" ), mButtonGroup ); 278 mUseFilters = new QRadioButton( i18n( "By matching &filter" ), mButtonGroup );
274 QWhatsThis::add( mUseFilters, i18n( "Only contacts matching the selected filter.\n" 279 Q3WhatsThis::add( mUseFilters, i18n( "Only contacts matching the selected filter.\n"
275 "This option is disabled if you haven't defined any filters" ) ); 280 "This option is disabled if you haven't defined any filters" ) );
276 groupLayout->addWidget( mUseFilters, 2, 0 ); 281 groupLayout->addWidget( mUseFilters, 2, 0 );
277 282
278 mUseCategories = new QRadioButton( i18n( "By Cate&gories" ), mButtonGroup ); 283 mUseCategories = new QRadioButton( i18n( "By Cate&gories" ), mButtonGroup );
279 QWhatsThis::add( mUseCategories, i18n( "Only contacts who are members of a category that is checked on the list to the left.\n" 284 Q3WhatsThis::add( mUseCategories, i18n( "Only contacts who are members of a category that is checked on the list to the left.\n"
280 "This option is disabled if you have no categories." ) ); 285 "This option is disabled if you have no categories." ) );
281 groupLayout->addWidget( mUseCategories, 3, 0 ); 286 groupLayout->addWidget( mUseCategories, 3, 0 );
282 287
283 mFiltersCombo = new QComboBox( false, mButtonGroup ); 288 mFiltersCombo = new QComboBox( false, mButtonGroup );
284 mFiltersCombo->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); 289 mFiltersCombo->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
285 QWhatsThis::add( mFiltersCombo, i18n( "Select a filter to decide which contacts to select." ) ); 290 Q3WhatsThis::add( mFiltersCombo, i18n( "Select a filter to decide which contacts to select." ) );
286 groupLayout->addWidget( mFiltersCombo, 2, 1 ); 291 groupLayout->addWidget( mFiltersCombo, 2, 1 );
287 292
288 mCategoriesView = new QListView( mButtonGroup ); 293 mCategoriesView = new Q3ListView( mButtonGroup );
289 mCategoriesView->addColumn( "" ); 294 mCategoriesView->addColumn( "" );
290 mCategoriesView->header()->hide(); 295 mCategoriesView->header()->hide();
291 QWhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to select." ) ); 296 Q3WhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to select." ) );
292 groupLayout->addWidget( mCategoriesView, 3, 1 ); 297 groupLayout->addWidget( mCategoriesView, 3, 1 );
293 mCategoriesView->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); 298 mCategoriesView->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
294 //if (QApplication::desktop()->height() == 480 ) 299 //if (QApplication::desktop()->height() == 480 )
295 // mCategoriesView->setMaximumHeight( 240 ); 300 // mCategoriesView->setMaximumHeight( 240 );
296 topLayout->addWidget( mButtonGroup ); 301 topLayout->addWidget( mButtonGroup );
297 302
298 QButtonGroup *sortingGroup = new QButtonGroup( i18n( "Sorting" ), page ); 303 Q3ButtonGroup *sortingGroup = new Q3ButtonGroup( i18n( "Sorting" ), page );
299 sortingGroup->setColumnLayout( 0, Qt::Vertical ); 304 sortingGroup->setColumnLayout( 0, Qt::Vertical );
300 QGridLayout *sortLayout = new QGridLayout( sortingGroup->layout(), 2, 2, 305 Q3GridLayout *sortLayout = new Q3GridLayout( sortingGroup->layout(), 2, 2,
301 KDialog::spacingHint() ); 306 KDialog::spacingHint() );
302 sortLayout->setAlignment( Qt::AlignTop ); 307 sortLayout->setAlignment( Qt::AlignTop );
303 308
304 label = new QLabel( i18n( "Criterion:" ), sortingGroup ); 309 label = new QLabel( i18n( "Criterion:" ), sortingGroup );
305 sortLayout->addWidget( label, 0, 0 ); 310 sortLayout->addWidget( label, 0, 0 );
306 311
@@ -332,11 +337,9 @@ void XXPortSelectDialog::initGUI()
332#ifndef DESKTOP_VERSION 337#ifndef DESKTOP_VERSION
333 hideButtons(); 338 hideButtons();
334#endif 339#endif
335 } 340 }
336} 341}
337 342
338#ifndef KAB_EMBEDDED 343#ifndef KAB_EMBEDDED_
339#include "xxportselectdialog.moc" 344#include "moc_xxportselectdialog.cpp"
340#endif //KAB_EMBEDDED 345#endif //KAB_EMBEDDED
341
342
diff --git a/kaddressbook/xxportselectdialog.h b/kaddressbook/xxportselectdialog.h
index 28b1fef..208f4f9 100644
--- a/kaddressbook/xxportselectdialog.h
+++ b/kaddressbook/xxportselectdialog.h
@@ -27,16 +27,16 @@
27#include <kabc/addresseelist.h> 27#include <kabc/addresseelist.h>
28#include <kabc/field.h> 28#include <kabc/field.h>
29#include <kdialogbase.h> 29#include <kdialogbase.h>
30 30
31#include "filter.h" 31#include "filter.h"
32 32
33class QButtonGroup; 33class Q3ButtonGroup;
34class QComboBox; 34class QComboBox;
35class QListView; 35class Q3ListView;
36class QListViewItem; 36class Q3ListViewItem;
37class QRadioButton; 37class QRadioButton;
38 38
39class KABCore; 39class KABCore;
40class KComboBox; 40class KComboBox;
41 41
42class XXPortSelectDialog : public KDialogBase 42class XXPortSelectDialog : public KDialogBase
@@ -50,28 +50,28 @@ class XXPortSelectDialog : public KDialogBase
50 KABC::AddresseeList contacts(); 50 KABC::AddresseeList contacts();
51 void tagSelected(); 51 void tagSelected();
52 QStringList uids(); 52 QStringList uids();
53 53
54 private slots: 54 private slots:
55 void filterChanged( int ); 55 void filterChanged( int );
56 void categoryClicked( QListViewItem * i ); 56 void categoryClicked( Q3ListViewItem * i );
57 57
58 protected slots: 58 protected slots:
59 void slotHelp(); 59 void slotHelp();
60 60
61 private: 61 private:
62 void initGUI(); 62 void initGUI();
63 QStringList categories() const; 63 QStringList categories() const;
64 64
65 QButtonGroup* mButtonGroup; 65 Q3ButtonGroup* mButtonGroup;
66 QRadioButton* mUseCategories; 66 QRadioButton* mUseCategories;
67 QRadioButton* mUseFilters; 67 QRadioButton* mUseFilters;
68 QRadioButton* mUseWholeBook; 68 QRadioButton* mUseWholeBook;
69 QRadioButton* mUseSelection; 69 QRadioButton* mUseSelection;
70 QComboBox* mFiltersCombo; 70 QComboBox* mFiltersCombo;
71 QListView* mCategoriesView; 71 Q3ListView* mCategoriesView;
72 72
73 KComboBox *mFieldCombo; 73 KComboBox *mFieldCombo;
74 KComboBox *mSortTypeCombo; 74 KComboBox *mSortTypeCombo;
75 75
76 KABCore *mCore; 76 KABCore *mCore;
77 KABC::AddresseeList mAddresseeList; 77 KABC::AddresseeList mAddresseeList;