summaryrefslogtreecommitdiffabout
path: root/kabc/addresseedialog.cpp
Unidiff
Diffstat (limited to 'kabc/addresseedialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kabc/addresseedialog.cpp51
1 files changed, 27 insertions, 24 deletions
diff --git a/kabc/addresseedialog.cpp b/kabc/addresseedialog.cpp
index 671787e..bda1b9e 100644
--- a/kabc/addresseedialog.cpp
+++ b/kabc/addresseedialog.cpp
@@ -21,9 +21,12 @@
21#include <qlayout.h> 21#include <qlayout.h>
22#include <qpushbutton.h> 22#include <qpushbutton.h>
23#include <qgroupbox.h> 23#include <q3groupbox.h>
24#include <qapplication.h> 24#include <qapplication.h>
25#include <qregexp.h> 25#include <qregexp.h>
26#include <qvbox.h> 26#include <q3vbox.h>
27#include <qlabel.h> 27#include <qlabel.h>
28//Added by qt3to4:
29#include <Q3ValueList>
30#include <Q3VBoxLayout>
28 31
29#include <klocale.h> 32#include <klocale.h>
@@ -39,6 +42,6 @@
39using namespace KABC; 42using namespace KABC;
40 43
41AddresseeItem::AddresseeItem( QListView *parent, const Addressee &addressee ) : 44AddresseeItem::AddresseeItem( Q3ListView *parent, const Addressee &addressee ) :
42 QListViewItem( parent ), 45 Q3ListViewItem( parent ),
43 mAddressee( addressee ) 46 mAddressee( addressee )
44{ 47{
@@ -72,5 +75,5 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) :
72 QWidget *listWidget = new QWidget( mMiniSplitter ); 75 QWidget *listWidget = new QWidget( mMiniSplitter );
73 76
74 QVBoxLayout *listLayout = new QVBoxLayout (listWidget) ; 77 Q3VBoxLayout *listLayout = new Q3VBoxLayout (listWidget) ;
75 //topLayout->addLayout( listLayout ); 78 //topLayout->addLayout( listLayout );
76 79
@@ -82,8 +85,8 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) :
82 mAddresseeList->setFullWidth( true ); 85 mAddresseeList->setFullWidth( true );
83 listLayout->addWidget( mAddresseeList ); 86 listLayout->addWidget( mAddresseeList );
84 connect( mAddresseeList, SIGNAL( doubleClicked( QListViewItem * ) ), 87 connect( mAddresseeList, SIGNAL( doubleClicked( Q3ListViewItem * ) ),
85 SLOT( slotOk() ) ); 88 SLOT( slotOk() ) );
86 //QHBox* searchBox = new QHBox ( listWidget ); 89 //QHBox* searchBox = new QHBox ( listWidget );
87 QHBox * hb = new QHBox ( listWidget ); 90 Q3HBox * hb = new Q3HBox ( listWidget );
88 listLayout->addWidget ( hb ); 91 listLayout->addWidget ( hb );
89 mAddresseeEdit = new QLineEdit( hb ); 92 mAddresseeEdit = new QLineEdit( hb );
@@ -102,7 +105,7 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) :
102 //connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ), 105 //connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ),
103 // SLOT( removeSelected() ) ); 106 // SLOT( removeSelected() ) );
104 connect( mSelectedList, SIGNAL( clicked( QListViewItem * ) ), 107 connect( mSelectedList, SIGNAL( clicked( Q3ListViewItem * ) ),
105 SLOT( removeSelected() ) ); 108 SLOT( removeSelected() ) );
106 connect( mSelectedList, SIGNAL( returnPressed( QListViewItem *) ), 109 connect( mSelectedList, SIGNAL( returnPressed( Q3ListViewItem *) ),
107 SLOT( removeSelected() ) ); 110 SLOT( removeSelected() ) );
108 111
@@ -112,8 +115,8 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) :
112 115
113#endif 116#endif
114 connect( mAddresseeList, SIGNAL( clicked( QListViewItem * ) ), 117 connect( mAddresseeList, SIGNAL( clicked( Q3ListViewItem * ) ),
115 SLOT( addSelected( QListViewItem * ) ) ); 118 SLOT( addSelected( Q3ListViewItem * ) ) );
116 connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ), 119 connect( mAddresseeList, SIGNAL( returnPressed( Q3ListViewItem * ) ),
117 SLOT( selectNextItem( QListViewItem * ) ) ); 120 SLOT( selectNextItem( Q3ListViewItem * ) ) );
118 121
119 } 122 }
@@ -127,5 +130,5 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) :
127#endif 130#endif
128 loadAddressBook(); 131 loadAddressBook();
129 QValueList<int> splitterSize; 132 Q3ValueList<int> splitterSize;
130 splitterSize.append( ( width() / 5 ) * 3 ); 133 splitterSize.append( ( width() / 5 ) * 3 );
131 splitterSize.append( ( width() / 5 ) *2 ); 134 splitterSize.append( ( width() / 5 ) *2 );
@@ -173,5 +176,5 @@ void AddresseeDialog::loadAddressBook()
173} 176}
174 177
175void AddresseeDialog::addCompletionItem( const QString &str, QListViewItem *item ) 178void AddresseeDialog::addCompletionItem( const QString &str, Q3ListViewItem *item )
176{ 179{
177 if ( str.isEmpty() ) return; 180 if ( str.isEmpty() ) return;
@@ -185,5 +188,5 @@ void AddresseeDialog::selectItem( const QString &str )
185 if ( str.isEmpty() ) return; 188 if ( str.isEmpty() ) return;
186 189
187 QListViewItem *item = mItemDict.find( str ); 190 Q3ListViewItem *item = mItemDict.find( str );
188 if ( item ) { 191 if ( item ) {
189 mAddresseeList->blockSignals( true ); 192 mAddresseeList->blockSignals( true );
@@ -194,5 +197,5 @@ void AddresseeDialog::selectItem( const QString &str )
194} 197}
195 198
196void AddresseeDialog::updateEdit( QListViewItem *item ) 199void AddresseeDialog::updateEdit( Q3ListViewItem *item )
197{ 200{
198 mAddresseeEdit->setText( item->text( 0 ) ); 201 mAddresseeEdit->setText( item->text( 0 ) );
@@ -200,8 +203,8 @@ void AddresseeDialog::updateEdit( QListViewItem *item )
200} 203}
201 204
202void AddresseeDialog::selectNextItem( QListViewItem *item ) 205void AddresseeDialog::selectNextItem( Q3ListViewItem *item )
203{ 206{
204 addSelected( item ); 207 addSelected( item );
205 QListViewItem *next = item->nextSibling(); 208 Q3ListViewItem *next = item->nextSibling();
206 if ( next ) { 209 if ( next ) {
207 next->setSelected( true ); 210 next->setSelected( true );
@@ -210,5 +213,5 @@ void AddresseeDialog::selectNextItem( QListViewItem *item )
210 } 213 }
211} 214}
212void AddresseeDialog::addSelected( QListViewItem *item ) 215void AddresseeDialog::addSelected( Q3ListViewItem *item )
213{ 216{
214 AddresseeItem *addrItem = (AddresseeItem *)( item ); 217 AddresseeItem *addrItem = (AddresseeItem *)( item );
@@ -217,5 +220,5 @@ void AddresseeDialog::addSelected( QListViewItem *item )
217 Addressee a = addrItem->addressee(); 220 Addressee a = addrItem->addressee();
218 221
219 QListViewItem *selectedItem = mSelectedDict.find( a.uid() ); 222 Q3ListViewItem *selectedItem = mSelectedDict.find( a.uid() );
220 if ( !selectedItem ) { 223 if ( !selectedItem ) {
221 selectedItem = new AddresseeItem( mSelectedList, a ); 224 selectedItem = new AddresseeItem( mSelectedList, a );
@@ -227,8 +230,8 @@ void AddresseeDialog::addSelected( QListViewItem *item )
227void AddresseeDialog::removeSelected() 230void AddresseeDialog::removeSelected()
228{ 231{
229 QListViewItem *item = mSelectedList->selectedItem(); 232 Q3ListViewItem *item = mSelectedList->selectedItem();
230 AddresseeItem *addrItem = (AddresseeItem *)( item ); 233 AddresseeItem *addrItem = (AddresseeItem *)( item );
231 if ( !addrItem ) return; 234 if ( !addrItem ) return;
232 QListViewItem *next = item->nextSibling(); 235 Q3ListViewItem *next = item->nextSibling();
233 mSelectedDict.remove( addrItem->addressee().uid() ); 236 mSelectedDict.remove( addrItem->addressee().uid() );
234 delete addrItem; 237 delete addrItem;
@@ -256,5 +259,5 @@ Addressee::List AddresseeDialog::addressees()
256 259
257 if ( mMultiple ) { 260 if ( mMultiple ) {
258 QListViewItem *item = mSelectedList->firstChild(); 261 Q3ListViewItem *item = mSelectedList->firstChild();
259 while( item ) { 262 while( item ) {
260 aItem = (AddresseeItem *)( item ); 263 aItem = (AddresseeItem *)( item );