summaryrefslogtreecommitdiffstats
path: root/tdeui/tdelistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdeui/tdelistview.cpp')
-rw-r--r--tdeui/tdelistview.cpp126
1 files changed, 59 insertions, 67 deletions
diff --git a/tdeui/tdelistview.cpp b/tdeui/tdelistview.cpp
index ace1ea075..0d46f49be 100644
--- a/tdeui/tdelistview.cpp
+++ b/tdeui/tdelistview.cpp
@@ -109,9 +109,9 @@ public:
initialFileManagerItem(0)
{
renameable.append(0);
- connect(editor, TQT_SIGNAL(done(TQListViewItem*,int)), listview, TQT_SLOT(doneEditing(TQListViewItem*,int)));
- connect(editor, TQT_SIGNAL(renameNext(TQListViewItem*,int)), listview, TQT_SLOT(renameNextProxy(TQListViewItem*,int)));
- connect(editor, TQT_SIGNAL(renamePrev(TQListViewItem*,int)), listview, TQT_SLOT(renamePrevProxy(TQListViewItem*,int)));
+ connect(editor, TQ_SIGNAL(done(TQListViewItem*,int)), listview, TQ_SLOT(doneEditing(TQListViewItem*,int)));
+ connect(editor, TQ_SIGNAL(renameNext(TQListViewItem*,int)), listview, TQ_SLOT(renameNextProxy(TQListViewItem*,int)));
+ connect(editor, TQ_SIGNAL(renamePrev(TQListViewItem*,int)), listview, TQ_SLOT(renamePrevProxy(TQListViewItem*,int)));
}
~TDEListViewPrivate ()
@@ -189,9 +189,9 @@ TDEListViewLineEdit::TDEListViewLineEdit(TDEListView *parent)
{
setFrame( false );
hide();
- connect( parent, TQT_SIGNAL( selectionChanged() ), TQT_SLOT( slotSelectionChanged() ));
- connect( parent, TQT_SIGNAL( itemRemoved( TQListViewItem * ) ),
- TQT_SLOT( slotItemRemoved( TQListViewItem * ) ));
+ connect( parent, TQ_SIGNAL( selectionChanged() ), TQ_SLOT( slotSelectionChanged() ));
+ connect( parent, TQ_SIGNAL( itemRemoved( TQListViewItem * ) ),
+ TQ_SLOT( slotItemRemoved( TQListViewItem * ) ));
}
TDEListViewLineEdit::~TDEListViewLineEdit()
@@ -344,7 +344,7 @@ bool TDEListViewLineEdit::event(TQEvent *pe)
keyPressEvent(k);
return true;
}
- else if ((k->key() == Qt::Key_Backtab || k->key() == Qt::Key_Tab) &&
+ else if ((k->key() == TQt::Key_Backtab || k->key() == TQt::Key_Tab) &&
p->tabOrderedRenaming() && p->itemsRenameable() &&
!(k->state() & ControlButton || k->state() & AltButton))
{
@@ -374,11 +374,11 @@ void TDEListViewLineEdit::keyPressEvent(TQKeyEvent *e)
emit renamePrev(i,c);
}
}
- else if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter)
+ else if (e->key() == TQt::Key_Return || e->key() == TQt::Key_Enter)
terminate(true);
- else if(e->key() == Qt::Key_Escape)
+ else if(e->key() == TQt::Key_Escape)
terminate(false);
- else if (e->key() == Qt::Key_Down || e->key() == Qt::Key_Up)
+ else if (e->key() == TQt::Key_Down || e->key() == TQt::Key_Up)
{
terminate(true);
KLineEdit::keyPressEvent(e);
@@ -459,42 +459,42 @@ TDEListView::TDEListView( TQWidget *parent, const char *name )
{
setDragAutoScroll(true);
- connect( this, TQT_SIGNAL( onViewport() ),
- this, TQT_SLOT( slotOnViewport() ) );
- connect( this, TQT_SIGNAL( onItem( TQListViewItem * ) ),
- this, TQT_SLOT( slotOnItem( TQListViewItem * ) ) );
+ connect( this, TQ_SIGNAL( onViewport() ),
+ this, TQ_SLOT( slotOnViewport() ) );
+ connect( this, TQ_SIGNAL( onItem( TQListViewItem * ) ),
+ this, TQ_SLOT( slotOnItem( TQListViewItem * ) ) );
- connect (this, TQT_SIGNAL(contentsMoving(int,int)),
- this, TQT_SLOT(cleanDropVisualizer()));
- connect (this, TQT_SIGNAL(contentsMoving(int,int)),
- this, TQT_SLOT(cleanItemHighlighter()));
+ connect (this, TQ_SIGNAL(contentsMoving(int,int)),
+ this, TQ_SLOT(cleanDropVisualizer()));
+ connect (this, TQ_SIGNAL(contentsMoving(int,int)),
+ this, TQ_SLOT(cleanItemHighlighter()));
slotSettingsChanged(TDEApplication::SETTINGS_MOUSE);
- if (kapp)
+ if (tdeApp)
{
- connect( kapp, TQT_SIGNAL( settingsChanged(int) ), TQT_SLOT( slotSettingsChanged(int) ) );
- kapp->addKipcEventMask( KIPC::SettingsChanged );
+ connect( tdeApp, TQ_SIGNAL( settingsChanged(int) ), TQ_SLOT( slotSettingsChanged(int) ) );
+ tdeApp->addKipcEventMask( KIPC::SettingsChanged );
}
- connect(&d->autoSelect, TQT_SIGNAL( timeout() ),
- this, TQT_SLOT( slotAutoSelect() ) );
- connect(&d->dragExpand, TQT_SIGNAL( timeout() ),
- this, TQT_SLOT( slotDragExpand() ) );
+ connect(&d->autoSelect, TQ_SIGNAL( timeout() ),
+ this, TQ_SLOT( slotAutoSelect() ) );
+ connect(&d->dragExpand, TQ_SIGNAL( timeout() ),
+ this, TQ_SLOT( slotDragExpand() ) );
// context menu handling
if (d->showContextMenusOnPress)
{
- connect (this, TQT_SIGNAL (rightButtonPressed (TQListViewItem*, const TQPoint&, int)),
- this, TQT_SLOT (emitContextMenu (TQListViewItem*, const TQPoint&, int)));
+ connect (this, TQ_SIGNAL (rightButtonPressed (TQListViewItem*, const TQPoint&, int)),
+ this, TQ_SLOT (emitContextMenu (TQListViewItem*, const TQPoint&, int)));
}
else
{
- connect (this, TQT_SIGNAL (rightButtonClicked (TQListViewItem*, const TQPoint&, int)),
- this, TQT_SLOT (emitContextMenu (TQListViewItem*, const TQPoint&, int)));
+ connect (this, TQ_SIGNAL (rightButtonClicked (TQListViewItem*, const TQPoint&, int)),
+ this, TQ_SLOT (emitContextMenu (TQListViewItem*, const TQPoint&, int)));
}
- connect (this, TQT_SIGNAL (menuShortCutPressed (TDEListView*, TQListViewItem*)),
- this, TQT_SLOT (emitContextMenu (TDEListView*, TQListViewItem*)));
+ connect (this, TQ_SIGNAL (menuShortCutPressed (TDEListView*, TQListViewItem*)),
+ this, TQ_SLOT (emitContextMenu (TDEListView*, TQListViewItem*)));
d->alternateBackground = TDEGlobalSettings::alternateBackgroundColor();
}
@@ -585,12 +585,12 @@ void TDEListView::slotSettingsChanged(int category)
d->dragDelay = TDEGlobalSettings::dndEventDelay();
d->bUseSingle = TDEGlobalSettings::singleClick();
- disconnect(this, TQT_SIGNAL (mouseButtonClicked (int, TQListViewItem*, const TQPoint &, int)),
- this, TQT_SLOT (slotMouseButtonClicked (int, TQListViewItem*, const TQPoint &, int)));
+ disconnect(this, TQ_SIGNAL (mouseButtonClicked (int, TQListViewItem*, const TQPoint &, int)),
+ this, TQ_SLOT (slotMouseButtonClicked (int, TQListViewItem*, const TQPoint &, int)));
if( d->bUseSingle )
- connect (this, TQT_SIGNAL (mouseButtonClicked (int, TQListViewItem*, const TQPoint &, int)),
- this, TQT_SLOT (slotMouseButtonClicked( int, TQListViewItem*, const TQPoint &, int)));
+ connect (this, TQ_SIGNAL (mouseButtonClicked (int, TQListViewItem*, const TQPoint &, int)),
+ this, TQ_SLOT (slotMouseButtonClicked( int, TQListViewItem*, const TQPoint &, int)));
d->bChangeCursorOverItem = TDEGlobalSettings::changeCursorOverIcon();
if ( !d->disableAutoSelection )
@@ -607,17 +607,17 @@ void TDEListView::slotSettingsChanged(int category)
if (d->showContextMenusOnPress)
{
- disconnect (0L, 0L, this, TQT_SLOT (emitContextMenu (TQListViewItem*, const TQPoint&, int)));
+ disconnect (0L, 0L, this, TQ_SLOT (emitContextMenu (TQListViewItem*, const TQPoint&, int)));
- connect(this, TQT_SIGNAL (rightButtonPressed (TQListViewItem*, const TQPoint&, int)),
- this, TQT_SLOT (emitContextMenu (TQListViewItem*, const TQPoint&, int)));
+ connect(this, TQ_SIGNAL (rightButtonPressed (TQListViewItem*, const TQPoint&, int)),
+ this, TQ_SLOT (emitContextMenu (TQListViewItem*, const TQPoint&, int)));
}
else
{
- disconnect (0L, 0L, this, TQT_SLOT (emitContextMenu (TQListViewItem*, const TQPoint&, int)));
+ disconnect (0L, 0L, this, TQ_SLOT (emitContextMenu (TQListViewItem*, const TQPoint&, int)));
- connect(this, TQT_SIGNAL (rightButtonClicked (TQListViewItem*, const TQPoint&, int)),
- this, TQT_SLOT (emitContextMenu (TQListViewItem*, const TQPoint&, int)));
+ connect(this, TQ_SIGNAL (rightButtonClicked (TQListViewItem*, const TQPoint&, int)),
+ this, TQ_SLOT (emitContextMenu (TQListViewItem*, const TQPoint&, int)));
}
break;
@@ -828,7 +828,7 @@ void TDEListView::contentsMousePressEvent( TQMouseEvent *e )
treeStepSize() * ( at->depth() + ( rootIsDecorated() ? 1 : 0) ) + itemMargin() )
&& ( p.x() >= header()->cellPos( header()->mapToActual( 0 ) ) );
- if (e->button() == Qt::LeftButton && !rootDecoClicked)
+ if (e->button() == TQt::LeftButton && !rootDecoClicked)
{
//Start a drag
d->startDragPos = e->pos();
@@ -885,7 +885,7 @@ void TDEListView::contentsMouseMoveEvent( TQMouseEvent *e )
void TDEListView::contentsMouseReleaseEvent( TQMouseEvent *e )
{
- if (e->button() == Qt::LeftButton)
+ if (e->button() == TQt::LeftButton)
{
// If the row was already selected, maybe we want to start an in-place editing
if ( d->pressedOnSelected && itemsRenameable() )
@@ -921,7 +921,7 @@ void TDEListView::contentsMouseDoubleClickEvent ( TQMouseEvent *e )
// We don't want to call the parent method because it does setOpen,
// whereas we don't do it in single click mode... (David)
//TQListView::contentsMouseDoubleClickEvent( e );
- if ( !e || e->button() != Qt::LeftButton ) {
+ if ( !e || e->button() != TQt::LeftButton ) {
return;
}
@@ -934,7 +934,7 @@ void TDEListView::contentsMouseDoubleClickEvent ( TQMouseEvent *e )
if( item ) {
emit doubleClicked( item, e->globalPos(), col );
- if( (e->button() == Qt::LeftButton) && !d->bUseSingle ) {
+ if( (e->button() == TQt::LeftButton) && !d->bUseSingle ) {
emitExecute( item, e->globalPos(), col );
}
}
@@ -942,7 +942,7 @@ void TDEListView::contentsMouseDoubleClickEvent ( TQMouseEvent *e )
void TDEListView::slotMouseButtonClicked( int btn, TQListViewItem *item, const TQPoint &pos, int c )
{
- if( (btn == Qt::LeftButton) && item ) {
+ if( (btn == TQt::LeftButton) && item ) {
emitExecute(item, pos, c);
}
}
@@ -1399,7 +1399,7 @@ TQRect TDEListView::drawItemHighlighter(TQPainter *painter, TQListViewItem *item
r = itemRect(item);
r.setLeft(r.left()+(item->depth()+(rootIsDecorated() ? 1 : 0))*treeStepSize());
if (painter)
- style().tqdrawPrimitive(TQStyle::PE_FocusRect, painter, r, colorGroup(),
+ style().drawPrimitive(TQStyle::PE_FocusRect, painter, r, colorGroup(),
TQStyle::Style_FocusAtBorder, colorGroup().highlight());
}
@@ -1601,7 +1601,7 @@ void TDEListView::fileManagerKeyPressEvent (TQKeyEvent* e)
}
if (((!selectedItems) || ((selectedItems==1) && (d->selectedUsingMouse)))
- && (e_state==Qt::NoButton)
+ && (e_state==TQt::NoButton)
&& ((e->key()==Key_Down)
|| (e->key()==Key_Up)
|| (e->key()==Key_Next)
@@ -2152,7 +2152,7 @@ void TDEListView::viewportPaintEvent(TQPaintEvent *e)
TQPainter painter(viewport());
// This is where we actually draw the drop-highlighter
- style().tqdrawPrimitive(TQStyle::PE_FocusRect, &painter, d->mOldDropHighlighter, colorGroup(),
+ style().drawPrimitive(TQStyle::PE_FocusRect, &painter, d->mOldDropHighlighter, colorGroup(),
TQStyle::Style_FocusAtBorder);
}
d->painting = false;
@@ -2456,7 +2456,7 @@ TQColor TDEListViewItem::backgroundColor(int column)
// calculate a different color if the current column is sorted (only if more than 1 column)
if ( (view->columns() > 1) && view->shadeSortColumn() && (column == view->columnSorted()) )
{
- if ( color == Qt::black )
+ if ( color == TQt::black )
color = TQColor(55, 55, 55); // dark gray
else
{
@@ -2569,7 +2569,7 @@ void TDEListViewItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column
}
/*!
- If \a select is TRUE, all the items get selected; otherwise all
+ If \a select is true, all the items get selected; otherwise all
the items get unselected. This only works in the selection modes \c
Multi and \c Extended. In \c Single and \c NoSelection mode the
selection of the current item is just set to \a select.
@@ -2579,25 +2579,19 @@ void TDEListView::selectAll( bool select )
{
if ( ((SelectionModeExt)selectionMode() == Multi) || ((SelectionModeExt)selectionMode() == Extended) ) {
bool b = signalsBlocked();
- blockSignals( TRUE );
- bool anything = FALSE;
+ blockSignals( true );
+ bool anything = false;
TQListViewItemIterator it( this );
while ( it.current() ) {
TQListViewItem *i = it.current();
- if ( select == TRUE ) {
- if ( (bool)i->isVisible() == TRUE ) {
- i->setSelected( TRUE );
- anything = TRUE;
- }
- if ( (bool)i->isVisible() == FALSE ) {
- i->setSelected( FALSE );
- anything = TRUE;
- }
+ if ( select ) {
+ i->setSelected( i->isVisible() );
+ anything = true;
}
else {
- if ( (bool)i->isSelected() != select ) {
+ if ( i->isSelected() != select ) {
i->setSelected( select );
- anything = TRUE;
+ anything = true;
}
}
++it;
@@ -2605,7 +2599,7 @@ void TDEListView::selectAll( bool select )
blockSignals( b );
if ( anything ) {
emit selectionChanged();
-// d->useDoubleBuffer = TRUE;
+// d->useDoubleBuffer = true;
triggerUpdate();
}
} else if ( currentItem() ) {
@@ -2634,5 +2628,3 @@ void TDEListView::virtual_hook( int, void* )
#include "tdelistview.moc"
#include "tdelistviewlineedit.moc"
-
-// vim: noet