diff options
Diffstat (limited to 'amarok/src/statusbar/statusBarBase.cpp')
-rw-r--r-- | amarok/src/statusbar/statusBarBase.cpp | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/amarok/src/statusbar/statusBarBase.cpp b/amarok/src/statusbar/statusBarBase.cpp index 9e10d6db..616a90fb 100644 --- a/amarok/src/statusbar/statusBarBase.cpp +++ b/amarok/src/statusbar/statusBarBase.cpp @@ -70,9 +70,9 @@ namespace SingleShotPool timer->start( timeout, true ); } - static inline bool isActive( TQObject *parent, const char *slot ) + static inline bool isActive( TQObject *tqparent, const char *slot ) { - TQTimer *timer = static_cast<TQTimer*>( parent->child( slot ) ); + TQTimer *timer = static_cast<TQTimer*>( tqparent->child( slot ) ); return timer && timer->isA( TQTIMER_OBJECT_NAME_STRING ) && timer->isActive(); } @@ -82,14 +82,14 @@ namespace SingleShotPool //TODO allow for uncertain progress periods -StatusBar::StatusBar( TQWidget *parent, const char *name ) - : TQWidget( parent, name ) +StatusBar::StatusBar( TQWidget *tqparent, const char *name ) + : TQWidget( tqparent, name ) , m_logCounter( -1 ) { - TQBoxLayout *mainlayout = new TQHBoxLayout( this, 2, /*spacing*/5 ); + TQBoxLayout *maintqlayout = new TQHBoxLayout( this, 2, /*spacing*/5 ); //we need extra spacing due to the way we paint the surrounding boxes - TQBoxLayout *layout = new TQHBoxLayout( mainlayout, /*spacing*/5 ); + TQBoxLayout *tqlayout = new TQHBoxLayout( maintqlayout, /*spacing*/5 ); TQHBox *statusBarTextBox = new TQHBox( this, "statusBarTextBox" ); m_mainTextLabel = new KDE::SqueezedTextLabel( statusBarTextBox, "mainTextLabel" ); @@ -103,15 +103,15 @@ StatusBar::StatusBar( TQWidget *parent, const char *name ) mainProgressBarBox->setSpacing( 2 ); mainProgressBarBox->hide(); - layout->add( statusBarTextBox ); - layout->add( mainProgressBarBox ); - layout->setStretchFactor( statusBarTextBox, 3 ); - layout->setStretchFactor( mainProgressBarBox, 1 ); + tqlayout->add( statusBarTextBox ); + tqlayout->add( mainProgressBarBox ); + tqlayout->setStretchFactor( statusBarTextBox, 3 ); + tqlayout->setStretchFactor( mainProgressBarBox, 1 ); - m_otherWidgetLayout = new TQHBoxLayout( mainlayout, /*spacing*/5 ); + m_otherWidgetLayout = new TQHBoxLayout( maintqlayout, /*spacing*/5 ); - mainlayout->setStretchFactor( layout, 6 ); - mainlayout->setStretchFactor( m_otherWidgetLayout, 4 ); + maintqlayout->setStretchFactor( tqlayout, 6 ); + maintqlayout->setStretchFactor( m_otherWidgetLayout, 4 ); shortLongButton->setIconSet( SmallIconSet( "edit_add" ) ); TQToolTip::add( shortLongButton, i18n( "Show details" ) ); @@ -129,7 +129,7 @@ StatusBar::StatusBar( TQWidget *parent, const char *name ) m_popupProgress->setMargin( 1 ); m_popupProgress->setFrameStyle( TQFrame::Panel | TQFrame::Raised ); m_popupProgress->setFrameShape( TQFrame::StyledPanel ); - m_popupProgress->setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum ); + m_popupProgress->tqsetSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum ); (new TQGridLayout( m_popupProgress, 1 /*rows*/, 3 /*cols*/, 6, 3 ))->setAutoAdd( true ); } @@ -151,20 +151,20 @@ StatusBar::polish() TQObjectList *list = queryList( TQWIDGET_OBJECT_NAME_STRING, 0, false, false ); for( TQObject * o = list->first(); o; o = list->next() ) { - int _h = static_cast<TQWidget*>( o ) ->minimumSizeHint().height(); + int _h = TQT_TQWIDGET( o ) ->tqminimumSizeHint().height(); if ( _h > h ) h = _h; -// debug() << o->className() << ", " << o->name() << ": " << _h << ": " << static_cast<TQWidget*>(o)->minimumHeight() << endl; +// debug() << o->className() << ", " << o->name() << ": " << _h << ": " << TQT_TQWIDGET(o)->minimumHeight() << endl; if ( o->inherits( TQLABEL_OBJECT_NAME_STRING ) ) - static_cast<TQLabel*>(o)->setIndent( 4 ); + static_cast<TQLabel*>(TQT_TQWIDGET(o))->setIndent( 4 ); } h -= 4; // it's too big usually for ( TQObject * o = list->first(); o; o = list->next() ) - static_cast<TQWidget*>(o)->setFixedHeight( h ); + TQT_TQWIDGET(o)->setFixedHeight( h ); delete list; } @@ -176,16 +176,16 @@ StatusBar::paintEvent( TQPaintEvent* ) TQPainter p( this ); for( TQObject * o = list->first(); o; o = list->next() ) { - TQWidget *w = static_cast<TQWidget*>( o ); + TQWidget *w = TQT_TQWIDGET( o ); if ( !w->isVisible() ) continue; - style().drawPrimitive( + tqstyle().tqdrawPrimitive( TQStyle::PE_StatusBarSection, &p, TQRect( w->x() - 1, w->y() - 1, w->width() + 2, w->height() + 2 ), - colorGroup(), + tqcolorGroup(), TQStyle::Style_Default, TQStyleOption( w ) ); } @@ -224,7 +224,7 @@ StatusBar::shortMessage( const TQString &text, bool longShort ) m_mainTextLabel->setText( text ); m_mainTextLabel->setPalette( TQToolTip::palette() ); - SingleShotPool::startTimer( longShort ? 8000 : 5000, this, TQT_SLOT(resetMainText()) ); + SingleShotPool::startTimer( longShort ? 8000 : 5000, TQT_TQOBJECT(this), TQT_SLOT(resetMainText()) ); writeLogFile( text ); } @@ -236,7 +236,7 @@ StatusBar::resetMainText() // debug() << sender()->name() << endl; // don't reset if we are showing a shortMessage - if( SingleShotPool::isActive( this, TQT_SLOT(resetMainText()) ) ) + if( SingleShotPool::isActive( TQT_TQOBJECT(this), TQT_SLOT(resetMainText()) ) ) return; m_mainTextLabel->unsetPalette(); @@ -330,7 +330,7 @@ StatusBar::longMessage( const TQString &text, int type ) void StatusBar::popupDeleted( TQObject *obj ) { - m_messageQueue.remove( static_cast<TQWidget*>( obj ) ); + m_messageQueue.remove( TQT_TQWIDGET( obj ) ); } void @@ -371,7 +371,7 @@ StatusBar::newProgressOperation( TQObject *owner ) { SHOULD_BE_GUI - if ( m_progressMap.contains( owner ) ) + if ( m_progressMap.tqcontains( owner ) ) return *m_progressMap[owner]; if( allDone() ) @@ -389,7 +389,7 @@ StatusBar::newProgressOperation( TQObject *owner ) // so we can show the correct progress information // after the ProgressBar is setup - SingleShotPool::startTimer( 0, this, TQT_SLOT(updateProgressAppearance()) ); + SingleShotPool::startTimer( 0, TQT_TQOBJECT(this), TQT_SLOT(updateProgressAppearance()) ); progressBox()->show(); cancelButton()->setEnabled( true ); @@ -417,14 +417,14 @@ StatusBar::newProgressOperation( KIO::Job *job ) void StatusBar::endProgressOperation() { - TQObject *owner = const_cast<TQObject*>( sender() ); //HACK deconsting it + TQObject *owner = TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>( sender() )); //HACK deconsting it KIO::Job *job = dynamic_cast<KIO::Job*>( owner ); //FIXME doesn't seem to work for KIO::DeleteJob, it has it's own error handler and returns no error too // if you try to delete http urls for instance <- KDE SUCKS! if( job && job->error() ) - shortLongMessage( TQString::null, job->errorString(), Error ); + shortLongMessage( TQString(), job->errorString(), Error ); endProgressOperation( owner ); } @@ -437,9 +437,9 @@ StatusBar::endProgressOperation( TQObject *owner ) //NOTE we don't delete it yet, as this upsets some //things, we just call setDone(). - if ( !m_progressMap.contains( owner ) ) + if ( !m_progressMap.tqcontains( owner ) ) { - SingleShotPool::startTimer( 2000, this, TQT_SLOT(hideMainProgressBar()) ); + SingleShotPool::startTimer( 2000, TQT_TQOBJECT(this), TQT_SLOT(hideMainProgressBar()) ); return ; } @@ -447,7 +447,7 @@ StatusBar::endProgressOperation( TQObject *owner ) if( allDone() && !m_popupProgress->isShown() ) { cancelButton()->setEnabled( false ); - SingleShotPool::startTimer( 2000, this, TQT_SLOT(hideMainProgressBar()) ); + SingleShotPool::startTimer( 2000, TQT_TQOBJECT(this), TQT_SLOT(hideMainProgressBar()) ); } updateTotalProgress(); @@ -471,7 +471,7 @@ StatusBar::toggleProgressWindow( bool show ) //slot m_popupProgress->setShown( show ); if( !show ) - SingleShotPool::startTimer( 2000, this, TQT_SLOT(hideMainProgressBar()) ); + SingleShotPool::startTimer( 2000, TQT_TQOBJECT(this), TQT_SLOT(hideMainProgressBar()) ); } void @@ -481,7 +481,7 @@ StatusBar::showShortLongDetails() longMessage( m_shortLongText, m_shortLongType ); m_shortLongType = Information; - m_shortLongText = TQString::null; + m_shortLongText = TQString(); shortLongButton()->hide(); } @@ -509,7 +509,7 @@ StatusBar::hideMainProgressBar() void StatusBar::setProgress( int steps ) { - setProgress( sender(), steps ); + setProgress( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender())), steps ); } void @@ -521,7 +521,7 @@ StatusBar::setProgress( KIO::Job *job, unsigned long percent ) void StatusBar::setProgress( const TQObject *owner, int steps ) { - if ( !m_progressMap.contains( owner ) ) + if ( !m_progressMap.tqcontains( owner ) ) return ; m_progressMap[ owner ] ->setProgress( steps ); @@ -532,7 +532,7 @@ StatusBar::setProgress( const TQObject *owner, int steps ) void StatusBar::incrementProgressTotalSteps( const TQObject *owner, int inc ) { - if ( !m_progressMap.contains( owner ) ) + if ( !m_progressMap.tqcontains( owner ) ) return ; m_progressMap[ owner ] ->setTotalSteps( m_progressMap[ owner ] ->totalSteps() + inc ); @@ -541,23 +541,23 @@ StatusBar::incrementProgressTotalSteps( const TQObject *owner, int inc ) } void -StatusBar::setProgressStatus( const TQObject *owner, const TQString &text ) +StatusBar::setProgresstqStatus( const TQObject *owner, const TQString &text ) { - if ( !m_progressMap.contains( owner ) ) + if ( !m_progressMap.tqcontains( owner ) ) return ; - m_progressMap[owner]->setStatus( text ); + m_progressMap[owner]->settqStatus( text ); } void StatusBar::incrementProgress() { - incrementProgress( sender() ); + incrementProgress( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()) )); } void StatusBar::incrementProgress( const TQObject *owner ) { - if ( !m_progressMap.contains( owner ) ) + if ( !m_progressMap.tqcontains( owner ) ) return; m_progressMap[owner]->setProgress( m_progressMap[ owner ] ->progress() + 1 ); @@ -669,7 +669,7 @@ StatusBar::writeLogFile( const TQString &text ) TQTextStream stream( &file ); stream.setEncoding( TQTextStream::UnicodeUTF8 ); - stream << "[" << KGlobal::locale()->formatDateTime( TQDateTime::currentDateTime() ) << "] " << text << endl; + stream << "[" << KGlobal::locale()->formatDateTime( TQDateTime::tqcurrentDateTime() ) << "] " << text << endl; } } //namespace KDE |