summaryrefslogtreecommitdiffstats
path: root/kresources/lib/folderlistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kresources/lib/folderlistview.cpp')
-rw-r--r--kresources/lib/folderlistview.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/kresources/lib/folderlistview.cpp b/kresources/lib/folderlistview.cpp
index 1ab59355..b29e61c9 100644
--- a/kresources/lib/folderlistview.cpp
+++ b/kresources/lib/folderlistview.cpp
@@ -30,26 +30,26 @@
#include <kpopupmenu.h>
#include <kdebug.h>
-#include <qlistview.h>
-#include <qheader.h>
-#include <qpainter.h>
+#include <tqlistview.h>
+#include <tqheader.h>
+#include <tqpainter.h>
static const int BoxSize = 16;
//BEGIN FolderListView
-FolderListView::FolderListView( QWidget *parent, const QValueList<Property> &types )
+FolderListView::FolderListView( TQWidget *parent, const TQValueList<Property> &types )
: KListView( parent )
{
setEnabledTypes( types );
- connect( this, SIGNAL(mouseButtonPressed(int, QListViewItem*, const QPoint&, int)),
- this, SLOT(slotMousePressed(int, QListViewItem*, const QPoint&, int)) );
- connect( this, SIGNAL(spacePressed(QListViewItem*)),
- this, SLOT(showPopupMenu(QListViewItem*)) );
+ connect( this, TQT_SIGNAL(mouseButtonPressed(int, TQListViewItem*, const TQPoint&, int)),
+ this, TQT_SLOT(slotMousePressed(int, TQListViewItem*, const TQPoint&, int)) );
+ connect( this, TQT_SIGNAL(spacePressed(TQListViewItem*)),
+ this, TQT_SLOT(showPopupMenu(TQListViewItem*)) );
}
-void FolderListView::setEnabledTypes( const QValueList<Property> &types )
+void FolderListView::setEnabledTypes( const TQValueList<Property> &types )
{
kdDebug() << "FolderListView::setEnabledTypes" << endl;
for ( int i = 0; i< columns(); ++i ) removeColumn( i );
@@ -90,7 +90,7 @@ kdDebug() << "FolderListView::setEnabledTypes" << endl;
} else mColumnMap[Unknown] = -1;
}
-void FolderListView::showPopupMenu( FolderListItem *i, const QPoint &globalPos )
+void FolderListView::showPopupMenu( FolderListItem *i, const TQPoint &globalPos )
{
if ( !i ) return;
KPIM::FolderLister::Entry folder( i->folder() );
@@ -99,39 +99,39 @@ void FolderListView::showPopupMenu( FolderListItem *i, const QPoint &globalPos )
int id;
m.insertTitle( folder.name, 9999 );
- id = m.insertItem( i18n("&Enabled"), this, SLOT(slotPopupHandler(int)), 0, FolderName );
+ id = m.insertItem( i18n("&Enabled"), this, TQT_SLOT(slotPopupHandler(int)), 0, FolderName );
m.setItemChecked( id, i->isOn() );
m.insertSeparator();
if ( ( folder.type & KPIM::FolderLister::Event ) && (mTypes.contains( Event ) ) ) {
- id = m.insertItem( i18n("Default for New &Events"), this, SLOT(slotPopupHandler(int)), 0, Event );
+ id = m.insertItem( i18n("Default for New &Events"), this, TQT_SLOT(slotPopupHandler(int)), 0, Event );
m.setItemChecked( id, i->isDefault( Event ) );
}
if ( ( folder.type & KPIM::FolderLister::Todo ) && (mTypes.contains( Todo ) ) ) {
- id = m.insertItem( i18n("Default for New &Todos"), this, SLOT(slotPopupHandler(int)), 0, Todo );
+ id = m.insertItem( i18n("Default for New &Todos"), this, TQT_SLOT(slotPopupHandler(int)), 0, Todo );
m.setItemChecked( id, i->isDefault( Todo ) );
}
if ( ( folder.type & KPIM::FolderLister::Journal ) && (mTypes.contains( Journal ) ) ) {
- id = m.insertItem( i18n("Default for New &Journals"), this, SLOT(slotPopupHandler(int)), 0, Journal );
+ id = m.insertItem( i18n("Default for New &Journals"), this, TQT_SLOT(slotPopupHandler(int)), 0, Journal );
m.setItemChecked( id, i->isDefault( Journal ) );
}
if ( ( folder.type & KPIM::FolderLister::Contact ) && (mTypes.contains( Contact ) ) ) {
- id = m.insertItem( i18n("Default for New &Contacts"), this, SLOT(slotPopupHandler(int)), 0, Contact );
+ id = m.insertItem( i18n("Default for New &Contacts"), this, TQT_SLOT(slotPopupHandler(int)), 0, Contact );
m.setItemChecked( id, i->isDefault( Contact ) );
}
if ( ( folder.type == KPIM::FolderLister::All ) && (mTypes.contains( All ) ) ) {
- id = m.insertItem( i18n("Default for All New &Items"), this, SLOT(slotPopupHandler(int)), 0, All );
+ id = m.insertItem( i18n("Default for All New &Items"), this, TQT_SLOT(slotPopupHandler(int)), 0, All );
m.setItemChecked( id, i->isDefault( All ) );
}
if ( ( folder.type == KPIM::FolderLister::Unknown ) && (mTypes.contains( Unknown ) ) ) {
- id = m.insertItem( i18n("Default for &Unknown New Items"), this, SLOT(slotPopupHandler(int)), 0, Unknown );
+ id = m.insertItem( i18n("Default for &Unknown New Items"), this, TQT_SLOT(slotPopupHandler(int)), 0, Unknown );
m.setItemChecked( id, i->isDefault( Unknown ) );
}
m.exec( globalPos );
}
-void FolderListView::showPopupMenu( QListViewItem *i )
+void FolderListView::showPopupMenu( TQListViewItem *i )
{
if ( dynamic_cast<FolderListItem*>(i) )
showPopupMenu( (FolderListItem*)i, viewport()->mapToGlobal(itemRect(i).topLeft()) );
@@ -142,9 +142,9 @@ void FolderListView::slotPopupHandler( int z )
((FolderListItem*)currentItem())->changeProperty( (Property)z );
}
-// Because QListViewItem::activatePos() is going to become deprecated,
+// Because TQListViewItem::activatePos() is going to become deprecated,
// and also because this attempt offers more control, I connect mousePressed to this.
-void FolderListView::slotMousePressed(int btn, QListViewItem* i, const QPoint& pos, int c)
+void FolderListView::slotMousePressed(int btn, TQListViewItem* i, const TQPoint& pos, int c)
{
if ( dynamic_cast<FolderListItem*>(i) ) {
if ( btn == Qt::RightButton ) {
@@ -152,7 +152,7 @@ void FolderListView::slotMousePressed(int btn, QListViewItem* i, const QPoint& p
}
else if ( btn == Qt::LeftButton && c > 0 ) {
// map pos to item/column and call FolderListItem::activate(col, pos)
- ((FolderListItem*)i)->activate( c, viewport()->mapFromGlobal( pos ) - QPoint( 0, itemRect(i).top() ) );
+ ((FolderListItem*)i)->activate( c, viewport()->mapFromGlobal( pos ) - TQPoint( 0, itemRect(i).top() ) );
// } else {
// KListView::slotMousePressed( btn, i, pos, c );
}
@@ -163,10 +163,10 @@ void FolderListView::slotMousePressed(int btn, QListViewItem* i, const QPoint& p
//BEGIN FolderListItem
-void FolderListItem::activate( int column, const QPoint &localPos )
+void FolderListItem::activate( int column, const TQPoint &localPos )
{
if ( !mFolderListView ) return;
- QListView *lv = listView();
+ TQListView *lv = listView();
int x = 0;
for( int c = 0; c < column-1; c++ )
x += lv->columnWidth( c );
@@ -184,7 +184,7 @@ void FolderListItem::activate( int column, const QPoint &localPos )
default:
return;
}
- if ( !QRect( x, 0, w, BoxSize ).contains( localPos ) )
+ if ( !TQRect( x, 0, w, BoxSize ).contains( localPos ) )
changeProperty( prop );
}
@@ -195,7 +195,7 @@ kdDebug() << "FolderListItem::changeProperty( " << p << ")" << endl;
kdDebug() << "it's folderName" << endl;
setOn( !isOn() );
} else if ( typeSupported( p ) ) {
- QListViewItemIterator it( listView() );
+ TQListViewItemIterator it( listView() );
while ( it.current() ) {
FolderListItem *item = dynamic_cast<FolderListItem*>( it.current() );
if ( item ) {
@@ -233,16 +233,16 @@ void FolderListItem::setDefault( FolderListView::Property prop, bool def )
}
-void FolderListItem::paintCell( QPainter *p, const QColorGroup &cg, int col, int width, int align )
+void FolderListItem::paintCell( TQPainter *p, const TQColorGroup &cg, int col, int width, int align )
{
if ( !p ) return;
- QListView *lv = listView();
+ TQListView *lv = listView();
Q_ASSERT( lv ); //###
if ( !lv ) return;
// use a private color group and set the text/highlighted text colors
-// QColorGroup mcg = lv->viewport()->colorGroup();
+// TQColorGroup mcg = lv->viewport()->colorGroup();
FolderListView::Property prop( mFolderListView->typeForColumn(col) );
if ( prop == FolderListView::FolderName ) {
@@ -250,11 +250,11 @@ void FolderListItem::paintCell( QPainter *p, const QColorGroup &cg, int col, int
super::paintCell( p, cg, col, width, align );
return;
} else {
- p->fillRect( 0, 0, width, height(), QBrush( cg.base() ) );
+ p->fillRect( 0, 0, width, height(), TQBrush( cg.base() ) );
}
int marg = lv->itemMargin();
- QColor c;
+ TQColor c;
switch ( prop )
{
@@ -271,9 +271,9 @@ void FolderListItem::paintCell( QPainter *p, const QColorGroup &cg, int col, int
int y = (height() - BoxSize) / 2;
if ( isEnabled() )
- p->setPen( QPen( cg.text(), 1 ) );
+ p->setPen( TQPen( cg.text(), 1 ) );
else
- p->setPen( QPen( lv->palette().color( QPalette::Disabled, QColorGroup::Text ), 1 ) );
+ p->setPen( TQPen( lv->palette().color( TQPalette::Disabled, TQColorGroup::Text ), 1 ) );
p->drawEllipse( x+marg, y+2, BoxSize-4, BoxSize-4 );
@@ -281,7 +281,7 @@ void FolderListItem::paintCell( QPainter *p, const QColorGroup &cg, int col, int
if ( isEnabled() )
p->setBrush( cg.text() );
else
- p->setBrush( lv->palette().color( QPalette::Disabled, QColorGroup::Text ) );
+ p->setBrush( lv->palette().color( TQPalette::Disabled, TQColorGroup::Text ) );
p->drawEllipse( x + marg + 3, y + 5, BoxSize-10, BoxSize-10 );
}
break;