summaryrefslogtreecommitdiffstats
path: root/kaddressbook/views/kaddressbooktableview.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /kaddressbook/views/kaddressbooktableview.cpp
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz
tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kaddressbook/views/kaddressbooktableview.cpp')
-rw-r--r--kaddressbook/views/kaddressbooktableview.cpp140
1 files changed, 70 insertions, 70 deletions
diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp
index e0ac61093..7f822ae4d 100644
--- a/kaddressbook/views/kaddressbooktableview.cpp
+++ b/kaddressbook/views/kaddressbooktableview.cpp
@@ -21,20 +21,20 @@
without including the source code for Qt in the source distribution.
*/
-#include <qapplication.h>
-#include <qlayout.h>
-#include <qheader.h>
-#include <qvbox.h>
-#include <qlistbox.h>
-#include <qwidget.h>
-#include <qfile.h>
-#include <qimage.h>
-#include <qcombobox.h>
-#include <qapplication.h>
-#include <qdragobject.h>
-#include <qevent.h>
-#include <qurl.h>
-#include <qpixmap.h>
+#include <tqapplication.h>
+#include <tqlayout.h>
+#include <tqheader.h>
+#include <tqvbox.h>
+#include <tqlistbox.h>
+#include <tqwidget.h>
+#include <tqfile.h>
+#include <tqimage.h>
+#include <tqcombobox.h>
+#include <tqapplication.h>
+#include <tqdragobject.h>
+#include <tqevent.h>
+#include <tqurl.h>
+#include <tqpixmap.h>
#include <kabc/addressbook.h>
#include <kapplication.h>
@@ -61,17 +61,17 @@
class TableViewFactory : public ViewFactory
{
public:
- KAddressBookView *view( KAB::Core *core, QWidget *parent, const char *name )
+ KAddressBookView *view( KAB::Core *core, TQWidget *parent, const char *name )
{
return new KAddressBookTableView( core, parent, name );
}
- QString type() const { return I18N_NOOP( "Table" ); }
+ TQString type() const { return I18N_NOOP( "Table" ); }
- QString description() const { return i18n( "A listing of contacts in a table. Each cell of "
+ TQString description() const { return i18n( "A listing of contacts in a table. Each cell of "
"the table holds a field of the contact." ); }
- ViewConfigureWidget *configureWidget( KABC::AddressBook *ab, QWidget *parent,
+ ViewConfigureWidget *configureWidget( KABC::AddressBook *ab, TQWidget *parent,
const char *name = 0 )
{
return new ConfigureTableViewWidget( ab, parent, name );
@@ -86,10 +86,10 @@ extern "C" {
}
KAddressBookTableView::KAddressBookTableView( KAB::Core *core,
- QWidget *parent, const char *name )
+ TQWidget *parent, const char *name )
: KAddressBookView( core, parent, name )
{
- mMainLayout = new QVBoxLayout( viewWidget(), 2 );
+ mMainLayout = new TQVBoxLayout( viewWidget(), 2 );
// The list view will be created when the config is read.
mListView = 0;
@@ -103,16 +103,16 @@ KAddressBookTableView::~KAddressBookTableView()
void KAddressBookTableView::reconstructListView()
{
if ( mListView ) {
- disconnect( mListView, SIGNAL( selectionChanged() ),
- this, SLOT( addresseeSelected() ) );
- disconnect( mListView, SIGNAL( executed( QListViewItem* ) ),
- this, SLOT( addresseeExecuted( QListViewItem* ) ) );
- disconnect( mListView, SIGNAL( doubleClicked( QListViewItem* ) ),
- this, SLOT( addresseeExecuted( QListViewItem* ) ) );
- disconnect( mListView, SIGNAL( startAddresseeDrag() ),
- this, SIGNAL( startDrag() ) );
- disconnect( mListView, SIGNAL( addresseeDropped( QDropEvent* ) ),
- this, SIGNAL( dropped( QDropEvent* ) ) );
+ disconnect( mListView, TQT_SIGNAL( selectionChanged() ),
+ this, TQT_SLOT( addresseeSelected() ) );
+ disconnect( mListView, TQT_SIGNAL( executed( TQListViewItem* ) ),
+ this, TQT_SLOT( addresseeExecuted( TQListViewItem* ) ) );
+ disconnect( mListView, TQT_SIGNAL( doubleClicked( TQListViewItem* ) ),
+ this, TQT_SLOT( addresseeExecuted( TQListViewItem* ) ) );
+ disconnect( mListView, TQT_SIGNAL( startAddresseeDrag() ),
+ this, TQT_SIGNAL( startDrag() ) );
+ disconnect( mListView, TQT_SIGNAL( addresseeDropped( TQDropEvent* ) ),
+ this, TQT_SIGNAL( dropped( TQDropEvent* ) ) );
delete mListView;
}
@@ -127,7 +127,7 @@ void KAddressBookTableView::reconstructListView()
int c = 0;
for ( it = fieldList.begin(); it != fieldList.end(); ++it ) {
mListView->addColumn( (*it)->label() );
- mListView->setColumnWidthMode( c++, QListView::Manual );
+ mListView->setColumnWidthMode( c++, TQListView::Manual );
}
if ( mListView->showIM() ) {
@@ -141,23 +141,23 @@ void KAddressBookTableView::reconstructListView()
mListView->setFullWidth( true );
- connect( mListView, SIGNAL( selectionChanged() ),
- this, SLOT( addresseeSelected() ) );
- connect( mListView, SIGNAL( startAddresseeDrag() ),
- this, SIGNAL( startDrag() ) );
- connect( mListView, SIGNAL( addresseeDropped( QDropEvent* ) ),
- this, SIGNAL( dropped( QDropEvent* ) ) );
- connect( mListView, SIGNAL( contextMenu( KListView*, QListViewItem*, const QPoint& ) ),
- this, SLOT( rmbClicked( KListView*, QListViewItem*, const QPoint& ) ) );
- connect( mListView->header(), SIGNAL( clicked( int ) ),
- this, SIGNAL( sortFieldChanged() ) );
+ connect( mListView, TQT_SIGNAL( selectionChanged() ),
+ this, TQT_SLOT( addresseeSelected() ) );
+ connect( mListView, TQT_SIGNAL( startAddresseeDrag() ),
+ this, TQT_SIGNAL( startDrag() ) );
+ connect( mListView, TQT_SIGNAL( addresseeDropped( TQDropEvent* ) ),
+ this, TQT_SIGNAL( dropped( TQDropEvent* ) ) );
+ connect( mListView, TQT_SIGNAL( contextMenu( KListView*, TQListViewItem*, const TQPoint& ) ),
+ this, TQT_SLOT( rmbClicked( KListView*, TQListViewItem*, const TQPoint& ) ) );
+ connect( mListView->header(), TQT_SIGNAL( clicked( int ) ),
+ this, TQT_SIGNAL( sortFieldChanged() ) );
if ( KABPrefs::instance()->honorSingleClick() )
- connect( mListView, SIGNAL( executed( QListViewItem* ) ),
- this, SLOT( addresseeExecuted( QListViewItem* ) ) );
+ connect( mListView, TQT_SIGNAL( executed( TQListViewItem* ) ),
+ this, TQT_SLOT( addresseeExecuted( TQListViewItem* ) ) );
else
- connect( mListView, SIGNAL( doubleClicked( QListViewItem* ) ),
- this, SLOT( addresseeExecuted( QListViewItem* ) ) );
+ connect( mListView, TQT_SIGNAL( doubleClicked( TQListViewItem* ) ),
+ this, TQT_SLOT( addresseeExecuted( TQListViewItem* ) ) );
refresh();
@@ -187,13 +187,13 @@ void KAddressBookTableView::readConfig( KConfig *config )
if ( config->readBoolEntry( "InstantMessagingPresence", false ) ) {
if ( !mIMProxy ) {
mIMProxy = KIMProxy::instance( kapp->dcopClient() );
- connect( mIMProxy, SIGNAL( sigContactPresenceChanged( const QString& ) ),
- this, SLOT( updatePresence( const QString& ) ) );
+ connect( mIMProxy, TQT_SIGNAL( sigContactPresenceChanged( const TQString& ) ),
+ this, TQT_SLOT( updatePresence( const TQString& ) ) );
}
} else {
if ( mIMProxy ) {
- disconnect( mIMProxy, SIGNAL( sigContactPresenceChanged( const QString& ) ),
- this, SLOT( updatePresence( const QString& ) ) );
+ disconnect( mIMProxy, TQT_SIGNAL( sigContactPresenceChanged( const TQString& ) ),
+ this, TQT_SLOT( updatePresence( const TQString& ) ) );
mIMProxy = 0;
}
}
@@ -214,11 +214,11 @@ void KAddressBookTableView::readConfig( KConfig *config )
mListView->restoreLayout( config, config->group() );
}
-void KAddressBookTableView::refresh( const QString &uid )
+void KAddressBookTableView::refresh( const TQString &uid )
{
if ( uid.isEmpty() ) {
// Clear the list view
- QString currentUID, nextUID;
+ TQString currentUID, nextUID;
ContactListViewItem *currentItem = dynamic_cast<ContactListViewItem*>( mListView->currentItem() );
if ( currentItem ) {
ContactListViewItem *nextItem = dynamic_cast<ContactListViewItem*>( currentItem->itemBelow() );
@@ -253,8 +253,8 @@ void KAddressBookTableView::refresh( const QString &uid )
} else {
// Only need to update on entry. Iterate through and try to find it
ContactListViewItem *ceItem;
- QPtrList<QListViewItem> selectedItems( mListView->selectedItems() );
- QListViewItem *it;
+ TQPtrList<TQListViewItem> selectedItems( mListView->selectedItems() );
+ TQListViewItem *it;
for ( it = selectedItems.first(); it; it = selectedItems.next() ) {
ceItem = dynamic_cast<ContactListViewItem*>( it );
if ( ceItem && ceItem->addressee().uid() == uid ) {
@@ -262,16 +262,16 @@ void KAddressBookTableView::refresh( const QString &uid )
return;
}
}
- refresh( QString::null );
+ refresh( TQString::null );
}
}
-QStringList KAddressBookTableView::selectedUids()
+TQStringList KAddressBookTableView::selectedUids()
{
- QStringList uidList;
+ TQStringList uidList;
ContactListViewItem *item;
- QListViewItemIterator it( mListView, QListViewItemIterator::Selected );
+ TQListViewItemIterator it( mListView, TQListViewItemIterator::Selected );
while ( it.current() ) {
item = dynamic_cast<ContactListViewItem*>( it.current() );
if ( item )
@@ -283,12 +283,12 @@ QStringList KAddressBookTableView::selectedUids()
return uidList;
}
-void KAddressBookTableView::setSelected( const QString &uid, bool selected )
+void KAddressBookTableView::setSelected( const TQString &uid, bool selected )
{
if ( uid.isEmpty() )
mListView->selectAll( selected );
else {
- QListViewItemIterator it( mListView );
+ TQListViewItemIterator it( mListView );
while ( it.current() ) {
ContactListViewItem *item = dynamic_cast<ContactListViewItem*>( it.current() );
if ( item && (item->addressee().uid() == uid) ) {
@@ -314,12 +314,12 @@ void KAddressBookTableView::setFirstSelected( bool selected )
void KAddressBookTableView::addresseeSelected()
{
// We need to try to find the first selected item. This might not be the
- // last selected item, but when QListView is in multiselection mode,
+ // last selected item, but when TQListView is in multiselection mode,
// there is no way to figure out which one was
// selected last.
bool found =false;
- QListViewItemIterator it( mListView, QListViewItemIterator::Selected );
+ TQListViewItemIterator it( mListView, TQListViewItemIterator::Selected );
while ( it.current() && !found ) {
found = true;
ContactListViewItem *item = dynamic_cast<ContactListViewItem*>( it.current() );
@@ -330,10 +330,10 @@ void KAddressBookTableView::addresseeSelected()
}
if ( !found )
- emit selected( QString::null );
+ emit selected( TQString::null );
}
-void KAddressBookTableView::addresseeExecuted( QListViewItem *item )
+void KAddressBookTableView::addresseeExecuted( TQListViewItem *item )
{
if ( item ) {
ContactListViewItem *ceItem = dynamic_cast<ContactListViewItem*>( item );
@@ -341,21 +341,21 @@ void KAddressBookTableView::addresseeExecuted( QListViewItem *item )
if ( ceItem )
emit executed( ceItem->addressee().uid() );
else
- emit executed( QString::null );
+ emit executed( TQString::null );
} else {
- emit executed( QString::null );
+ emit executed( TQString::null );
}
}
-void KAddressBookTableView::rmbClicked( KListView*, QListViewItem*, const QPoint &point )
+void KAddressBookTableView::rmbClicked( KListView*, TQListViewItem*, const TQPoint &point )
{
popup( point );
}
-void KAddressBookTableView::updatePresence( const QString &uid )
+void KAddressBookTableView::updatePresence( const TQString &uid )
{
// find the LVI to update and refresh() it
- QListViewItem *item;
+ TQListViewItem *item;
ContactListViewItem *ceItem;
for ( item = mListView->firstChild(); item; item = item->itemBelow() ) {
ceItem = dynamic_cast<ContactListViewItem*>( item );
@@ -372,12 +372,12 @@ void KAddressBookTableView::updatePresence( const QString &uid )
void KAddressBookTableView::scrollUp()
{
- QApplication::postEvent( mListView, new QKeyEvent( QEvent::KeyPress, Qt::Key_Up, 0, 0 ) );
+ TQApplication::postEvent( mListView, new TQKeyEvent( TQEvent::KeyPress, Qt::Key_Up, 0, 0 ) );
}
void KAddressBookTableView::scrollDown()
{
- QApplication::postEvent( mListView, new QKeyEvent( QEvent::KeyPress, Qt::Key_Down, 0, 0 ) );
+ TQApplication::postEvent( mListView, new TQKeyEvent( TQEvent::KeyPress, Qt::Key_Down, 0, 0 ) );
}