summaryrefslogtreecommitdiffabout
path: root/kaddressbook/views/kaddressbooktableview.cpp
Unidiff
Diffstat (limited to 'kaddressbook/views/kaddressbooktableview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/views/kaddressbooktableview.cpp56
1 files changed, 30 insertions, 26 deletions
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,16 +1,20 @@
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>
@@ -32,7 +36,7 @@
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"
@@ -42,7 +46,7 @@ KAddressBookTableView::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;
@@ -77,14 +81,14 @@ void KAddressBookTableView::reconstructListView()
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*)));
@@ -105,7 +109,7 @@ void KAddressBookTableView::reconstructListView()
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 }
@@ -119,15 +123,15 @@ void KAddressBookTableView::reconstructListView()
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
@@ -344,7 +348,7 @@ void KAddressBookTableView::refresh(QString uid)
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() );
@@ -366,7 +370,7 @@ void KAddressBookTableView::refresh(QString uid)
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())
@@ -394,7 +398,7 @@ QStringList KAddressBookTableView::selectedUids()
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())
@@ -429,7 +433,7 @@ void KAddressBookTableView::addresseeSelected()
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())
@@ -453,7 +457,7 @@ void KAddressBookTableView::addresseeSelected()
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 {
@@ -487,6 +491,6 @@ void KAddressBookTableView::addresseeDeleted()
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