diff --git a/amarok/src/Options1.ui.h b/amarok/src/Options1.ui.h index 62b322ed..ec21b172 100644 --- a/amarok/src/Options1.ui.h +++ b/amarok/src/Options1.ui.h @@ -26,22 +26,22 @@ void Options1::init() //kcfg_CustomRatingsColors->setChecked( AmarokConfig::customRatingsColors() ); //slotUpdateRatingsFrame(); - QStringList browsers; + TQStringList browsers; browsers << "konqueror" << "firefox" << "opera" << "galeon" << "epiphany" << "safari" << "mozilla"; // Remove browsers which are not actually installed - for( QStringList::Iterator it = browsers.begin(), end = browsers.end(); it != end; ) { + for( TQStringList::Iterator it = browsers.begin(), end = browsers.end(); it != end; ) { if( KStandardDirs::findExe( *it ).isEmpty() ) it = browsers.erase( it ); else ++it; } #ifdef Q_WS_MAC - if ( KStandardDirs::findExe( "open" ) != QString::null ) + if ( KStandardDirs::findExe( "open" ) != TQString::null ) browsers.prepend( i18n( "Default Browser" ) ); #else - if ( KStandardDirs::findExe( "kfmclient" ) != QString::null ) + if ( KStandardDirs::findExe( "kfmclient" ) != TQString::null ) browsers.prepend( i18n( "Default KDE Browser" ) ); #endif @@ -146,7 +146,7 @@ void Options1::slotFixedHalfStarColor() void Options1::slotPickColorHalf() { - QColor halfStar; + TQColor halfStar; int result = KColorDialog::getColor( halfStar ); if( result == KColorDialog::Accepted ) { @@ -158,7 +158,7 @@ void Options1::slotPickColorHalf() void Options1::slotPickColorOne() { - QColor oneStar; + TQColor oneStar; int result = KColorDialog::getColor( oneStar ); if( result == KColorDialog::Accepted ) { @@ -170,7 +170,7 @@ void Options1::slotPickColorOne() void Options1::slotPickColorTwo() { - QColor twoStar; + TQColor twoStar; int result = KColorDialog::getColor( twoStar ); if( result == KColorDialog::Accepted ) { @@ -182,7 +182,7 @@ void Options1::slotPickColorTwo() void Options1::slotPickColorThree() { - QColor threeStar; + TQColor threeStar; int result = KColorDialog::getColor( threeStar ); if( result == KColorDialog::Accepted ) { @@ -194,7 +194,7 @@ void Options1::slotPickColorThree() void Options1::slotPickColorFour() { - QColor fourStar; + TQColor fourStar; int result = KColorDialog::getColor( fourStar ); if( result == KColorDialog::Accepted ) { @@ -206,7 +206,7 @@ void Options1::slotPickColorFour() void Options1::slotPickColorFive() { - QColor fiveStar; + TQColor fiveStar; int result = KColorDialog::getColor( fiveStar ); if( result == KColorDialog::Accepted ) { diff --git a/amarok/src/Options2.ui.h b/amarok/src/Options2.ui.h index e3f0a54f..5601daff 100644 --- a/amarok/src/Options2.ui.h +++ b/amarok/src/Options2.ui.h @@ -26,9 +26,9 @@ #include #include -#include -#include -#include +#include +#include +#include //////////////////////////////////////////////////////////////////////////////// @@ -41,11 +41,11 @@ class AmarokThemeNewStuff : public KNewStuff { public: - AmarokThemeNewStuff(const QString &type, QWidget *parentWidget=0) + AmarokThemeNewStuff(const TQString &type, TQWidget *parentWidget=0) : KNewStuff( type, parentWidget ) {} - bool install( const QString& fileName ) + bool install( const TQString& fileName ) { KTar archive( fileName ); @@ -54,7 +54,7 @@ class AmarokThemeNewStuff : public KNewStuff return false; } - const QString destination = Amarok::saveLocation( "themes/" ); + const TQString destination = Amarok::saveLocation( "themes/" ); debug() << "copying to " << destination << endl; const KArchiveDirectory* archiveDir = archive.directory(); archiveDir->copyTo( destination, true ); @@ -62,7 +62,7 @@ class AmarokThemeNewStuff : public KNewStuff return true; } - virtual bool createUploadFile( const QString& ) { return false; } + virtual bool createUploadFile( const TQString& ) { return false; } }; @@ -80,7 +80,7 @@ void Options2::init() // This method is basically lifted from ScriptManager::slotInstallScript() void Options2::installPushButton_clicked() { - KFileDialog dia( QString::null, "*.tar *.tar.bz2 *.tar.gz|" + i18n( "Style Packages (*.tar, *.tar.bz2, *.tar.gz)" ), 0, 0, true ); + KFileDialog dia( TQString::null, "*.tar *.tar.bz2 *.tar.gz|" + i18n( "Style Packages (*.tar, *.tar.bz2, *.tar.gz)" ), 0, 0, true ); kapp->setTopWidget( &dia ); dia.setCaption( kapp->makeStdCaption( i18n( "Select Style Package" ) ) ); dia.setMode( KFile::File | KFile::ExistingOnly ); @@ -93,7 +93,7 @@ void Options2::installPushButton_clicked() return; } - const QString destination = Amarok::saveLocation( "themes/" ); + const TQString destination = Amarok::saveLocation( "themes/" ); debug() << "copying to " << destination << endl; const KArchiveDirectory* archiveDir = archive.directory(); archiveDir->copyTo( destination, true ); @@ -117,21 +117,21 @@ void Options2::retrievePushButton_clicked() d->setType( "amarok/theme" ); // you have to do this by hand when providing your own Engine KNS::ProviderLoader *p = new KNS::ProviderLoader( this ); - connect( p, SIGNAL( providersLoaded(Provider::List*) ), d, SLOT( slotProviders(Provider::List *) ) ); + connect( p, TQT_SIGNAL( providersLoaded(Provider::List*) ), d, TQT_SLOT( slotProviders(Provider::List *) ) ); p->load( "amarok/theme", "http://amarok.kde.org/knewstuff/amarokthemes-providers.xml" ); - connect( d, SIGNAL( finished() ), d, SLOT( delayedDestruct() ) ); - connect( d, SIGNAL( finished() ), this, SLOT( updateStyleComboBox() ) ); + connect( d, TQT_SIGNAL( finished() ), d, TQT_SLOT( delayedDestruct() ) ); + connect( d, TQT_SIGNAL( finished() ), this, TQT_SLOT( updateStyleComboBox() ) ); // Due to kdelibs idiocy, KNS::DownloadDialog is /always/ non-modal. So we have to // ensure that closing the settings dialog before the DownloadDialog doesn't crash. - QTimer::singleShot( 0, d, SLOT( exec() ) ); + TQTimer::singleShot( 0, d, TQT_SLOT( exec() ) ); } void Options2::uninstallPushButton_clicked() { - const QString name = styleComboBox->currentText(); + const TQString name = styleComboBox->currentText(); if ( name == "Default" ) return; @@ -160,10 +160,10 @@ void Options2::uninstallPushButton_clicked() } -void Options2::styleComboBox_activated(const QString& s) +void Options2::styleComboBox_activated(const TQString& s) { bool disable = false; - QDir dir( Amarok::saveLocation( "themes/" ) + s ); + TQDir dir( Amarok::saveLocation( "themes/" ) + s ); if( !dir.exists() ) disable = true; @@ -177,9 +177,9 @@ void Options2::updateStyleComboBox() styleComboBox->clear(); - const QStringList styleList = kapp->dirs()->findAllResources("data","amarok/themes/*/stylesheet.css", false); - QStringList sortedList; - foreach (styleList) sortedList.append(QFileInfo( *it ).dir().dirName()); + const TQStringList styleList = kapp->dirs()->findAllResources("data","amarok/themes/*/stylesheet.css", false); + TQStringList sortedList; + foreach (styleList) sortedList.append(TQFileInfo( *it ).dir().dirName()); sortedList.append( "Default" ); sortedList.sort(); foreach(sortedList) styleComboBox->insertItem(*it); diff --git a/amarok/src/Options5.ui.h b/amarok/src/Options5.ui.h index 00ad3023..22e0a04e 100644 --- a/amarok/src/Options5.ui.h +++ b/amarok/src/Options5.ui.h @@ -26,7 +26,7 @@ email : fh@ez.no #include "amarokconfig.h" #include #include "qstringx.h" -#include +#include void Options5::init() @@ -35,26 +35,26 @@ void Options5::init() m_pOSDPreview->setAlignment( static_cast( AmarokConfig::osdAlignment() ) ); m_pOSDPreview->setOffset( AmarokConfig::osdYOffset() ); - connect( m_pOSDPreview, SIGNAL( positionChanged() ), SLOT( slotPositionChanged() ) ); + connect( m_pOSDPreview, TQT_SIGNAL( positionChanged() ), TQT_SLOT( slotPositionChanged() ) ); - const int numScreens = QApplication::desktop()->numScreens(); + const int numScreens = TQApplication::desktop()->numScreens(); for( int i = 0; i < numScreens; i++ ) - kcfg_OsdScreen->insertItem( QString::number( i ) ); - - connect( kcfg_OsdDrawShadow, SIGNAL( toggled(bool) ), - m_pOSDPreview, SLOT( setDrawShadow(bool) ) ); - connect( kcfg_OsdTextColor, SIGNAL( changed(const QColor&) ), - m_pOSDPreview, SLOT( setTextColor(const QColor&) ) ); - connect( kcfg_OsdUseCustomColors, SIGNAL( toggled(bool) ), - this, SLOT( useCustomColorsToggled(bool) ) ); - connect( kcfg_OsdBackgroundColor, SIGNAL( changed(const QColor&) ), - m_pOSDPreview, SLOT( setBackgroundColor(const QColor&) ) ); - connect( kcfg_OsdFont, SIGNAL( fontSelected(const QFont&) ), - m_pOSDPreview, SLOT( setFont(const QFont&) ) ); - connect( kcfg_OsdScreen, SIGNAL( activated(int) ), - m_pOSDPreview, SLOT( setScreen(int) ) ); - connect( kcfg_OsdEnabled, SIGNAL( toggled(bool) ), - m_pOSDPreview, SLOT( setShown(bool) ) ); + kcfg_OsdScreen->insertItem( TQString::number( i ) ); + + connect( kcfg_OsdDrawShadow, TQT_SIGNAL( toggled(bool) ), + m_pOSDPreview, TQT_SLOT( setDrawShadow(bool) ) ); + connect( kcfg_OsdTextColor, TQT_SIGNAL( changed(const TQColor&) ), + m_pOSDPreview, TQT_SLOT( setTextColor(const TQColor&) ) ); + connect( kcfg_OsdUseCustomColors, TQT_SIGNAL( toggled(bool) ), + this, TQT_SLOT( useCustomColorsToggled(bool) ) ); + connect( kcfg_OsdBackgroundColor, TQT_SIGNAL( changed(const TQColor&) ), + m_pOSDPreview, TQT_SLOT( setBackgroundColor(const TQColor&) ) ); + connect( kcfg_OsdFont, TQT_SIGNAL( fontSelected(const TQFont&) ), + m_pOSDPreview, TQT_SLOT( setFont(const TQFont&) ) ); + connect( kcfg_OsdScreen, TQT_SIGNAL( activated(int) ), + m_pOSDPreview, TQT_SLOT( setScreen(int) ) ); + connect( kcfg_OsdEnabled, TQT_SIGNAL( toggled(bool) ), + m_pOSDPreview, TQT_SLOT( setShown(bool) ) ); Amarok::QStringx text = i18n( "

Tags Displayed in OSD

" @@ -83,7 +83,7 @@ void Options5::init() "
%19
" "Will not show Score: %score if the track has no score." ); - QToolTip::add( kcfg_OsdText, text.args( QStringList() + TQToolTip::add( kcfg_OsdText, text.args( TQStringList() // we don't translate these, it is not sensible to do so << "%title" << "%album" << "%artist" << "%genre" << "%bitrate" << "%year " << "%length" << "%track" << "%filename" << "%directory" @@ -104,13 +104,13 @@ Options5::slotPositionChanged() } void -Options5::hideEvent( QHideEvent* ) +Options5::hideEvent( TQHideEvent* ) { m_pOSDPreview->hide(); } void -Options5::showEvent( QShowEvent* ) +Options5::showEvent( TQShowEvent* ) { useCustomColorsToggled( kcfg_OsdUseCustomColors->isChecked() ); diff --git a/amarok/src/Options8.ui.h b/amarok/src/Options8.ui.h index d6341f6f..4e23949e 100644 --- a/amarok/src/Options8.ui.h +++ b/amarok/src/Options8.ui.h @@ -12,7 +12,7 @@ ** destructor. *****************************************************************************/ -void Options8::updateServices( const QString &s ) +void Options8::updateServices( const TQString &s ) { bool empty = s.isEmpty(); groupBox2->setEnabled( !empty ); diff --git a/amarok/src/actionclasses.cpp b/amarok/src/actionclasses.cpp index d2330e61..79ec38a1 100644 --- a/amarok/src/actionclasses.cpp +++ b/amarok/src/actionclasses.cpp @@ -18,8 +18,8 @@ #include "socketserver.h" //Vis::Selector::showInstance() #include "threadmanager.h" -#include -#include +#include +#include #include #include @@ -51,7 +51,7 @@ using namespace Amarok; KHelpMenu *Menu::s_helpMenu = 0; static void -safePlug( KActionCollection *ac, const char *name, QWidget *w ) +safePlug( KActionCollection *ac, const char *name, TQWidget *w ) { if( ac ) { @@ -69,11 +69,11 @@ safePlug( KActionCollection *ac, const char *name, QWidget *w ) MenuAction::MenuAction( KActionCollection *ac ) : KAction( i18n( "Amarok Menu" ), 0, ac, "amarok_menu" ) { - setShortcutConfigurable ( false ); //FIXME disabled as it doesn't work, should use QCursor::pos() + setShortcutConfigurable ( false ); //FIXME disabled as it doesn't work, should use TQCursor::pos() } int -MenuAction::plug( QWidget *w, int index ) +MenuAction::plug( TQWidget *w, int index ) { KToolBar *bar = dynamic_cast(w); @@ -82,12 +82,12 @@ MenuAction::plug( QWidget *w, int index ) const int id = KAction::getToolButtonID(); addContainer( bar, id ); - connect( bar, SIGNAL( destroyed() ), SLOT( slotDestroyed() ) ); + connect( bar, TQT_SIGNAL( destroyed() ), TQT_SLOT( slotDestroyed() ) ); //TODO create menu on demand //TODO create menu above and aligned within window //TODO make the arrow point upwards! - bar->insertButton( QString::null, id, true, i18n( "Menu" ), index ); + bar->insertButton( TQString::null, id, true, i18n( "Menu" ), index ); bar->alignItemRight( id ); KToolBarButton* button = bar->getButton( id ); @@ -120,7 +120,7 @@ Menu::Menu() insertItem( SmallIconSet( Amarok::icon( "covermanager" ) ), i18n( "C&over Manager" ), ID_SHOW_COVER_MANAGER ); safePlug( ac, "queue_manager", this ); insertItem( SmallIconSet( Amarok::icon( "visualizations" ) ), i18n( "&Visualizations" ), ID_SHOW_VIS_SELECTOR ); - insertItem( SmallIconSet( Amarok::icon( "equalizer" ) ), i18n( "E&qualizer" ), kapp, SLOT( slotConfigEqualizer() ), 0, ID_CONFIGURE_EQUALIZER ); + insertItem( SmallIconSet( Amarok::icon( "equalizer" ) ), i18n( "E&qualizer" ), kapp, TQT_SLOT( slotConfigEqualizer() ), 0, ID_CONFIGURE_EQUALIZER ); safePlug( ac, "script_manager", this ); safePlug( ac, "statistics", this ); @@ -152,8 +152,8 @@ Menu::Menu() safePlug( ac, KStdAction::name(KStdAction::Quit), this ); - connect( this, SIGNAL( aboutToShow() ), SLOT( slotAboutToShow() ) ); - connect( this, SIGNAL( activated(int) ), SLOT( slotActivated(int) ) ); + connect( this, TQT_SIGNAL( aboutToShow() ), TQT_SLOT( slotAboutToShow() ) ); + connect( this, TQT_SIGNAL( activated(int) ), TQT_SLOT( slotActivated(int) ) ); setItemEnabled( ID_SHOW_VIS_SELECTOR, false ); #ifdef HAVE_LIBVISUAL @@ -169,7 +169,7 @@ Menu::instance() } KPopupMenu* -Menu::helpMenu( QWidget *parent ) //STATIC +Menu::helpMenu( TQWidget *parent ) //STATIC { extern KAboutData aboutData; @@ -213,13 +213,13 @@ PlayPauseAction::PlayPauseAction( KActionCollection *ac ) { engineStateChanged( EngineController::engine()->state() ); - connect( this, SIGNAL(activated()), EngineController::instance(), SLOT(playPause()) ); + connect( this, TQT_SIGNAL(activated()), EngineController::instance(), TQT_SLOT(playPause()) ); } void PlayPauseAction::engineStateChanged( Engine::State state, Engine::State /*oldState*/ ) { - QString text; + TQString text; switch( state ) { case Engine::Playing: @@ -243,9 +243,9 @@ PlayPauseAction::engineStateChanged( Engine::State state, Engine::State /*oldSt //update menu texts for this special action for( int x = 0; x < containerCount(); ++x ) { - QWidget *w = container( x ); - if( w->inherits( "QPopupMenu" ) ) - static_cast(w)->changeItem( itemId( x ), text ); + TQWidget *w = container( x ); + if( w->inherits( "TQPopupMenu" ) ) + static_cast(w)->changeItem( itemId( x ), text ); //TODO KToolBar sucks so much // else if( w->inherits( "KToolBar" ) ) // static_cast(w)->getButton( itemId( x ) )->setText( text ); @@ -264,7 +264,7 @@ AnalyzerAction::AnalyzerAction( KActionCollection *ac ) } int -AnalyzerAction::plug( QWidget *w, int index ) +AnalyzerAction::plug( TQWidget *w, int index ) { //NOTE the analyzer will be deleted when the toolbar is deleted or cleared() //we are not designed for unplugging() yet so there would be a leak if that happens @@ -277,8 +277,8 @@ AnalyzerAction::plug( QWidget *w, int index ) const int id = KAction::getToolButtonID(); addContainer( w, id ); - connect( w, SIGNAL( destroyed() ), SLOT( slotDestroyed() ) ); - QWidget *container = new AnalyzerContainer( w ); + connect( w, TQT_SIGNAL( destroyed() ), TQT_SLOT( slotDestroyed() ) ); + TQWidget *container = new AnalyzerContainer( w ); bar->insertWidget( id, 0, container, index ); bar->setItemAutoSized( id, true ); @@ -288,16 +288,16 @@ AnalyzerAction::plug( QWidget *w, int index ) } -AnalyzerContainer::AnalyzerContainer( QWidget *parent ) - : QWidget( parent, "AnalyzerContainer" ) +AnalyzerContainer::AnalyzerContainer( TQWidget *parent ) + : TQWidget( parent, "AnalyzerContainer" ) , m_child( 0 ) { - QToolTip::add( this, i18n( "Click for more analyzers" ) ); + TQToolTip::add( this, i18n( "Click for more analyzers" ) ); changeAnalyzer(); } void -AnalyzerContainer::resizeEvent( QResizeEvent *) +AnalyzerContainer::resizeEvent( TQResizeEvent *) { m_child->resize( size() ); } @@ -312,7 +312,7 @@ void AnalyzerContainer::changeAnalyzer() } void -AnalyzerContainer::mousePressEvent( QMouseEvent *e) +AnalyzerContainer::mousePressEvent( TQMouseEvent *e) { if( e->button() == Qt::LeftButton ) { AmarokConfig::setCurrentPlaylistAnalyzer( AmarokConfig::currentPlaylistAnalyzer() + 1 ); @@ -321,7 +321,7 @@ AnalyzerContainer::mousePressEvent( QMouseEvent *e) } void -AnalyzerContainer::contextMenuEvent( QContextMenuEvent *e) +AnalyzerContainer::contextMenuEvent( TQContextMenuEvent *e) { #if defined HAVE_LIBVISUAL KPopupMenu menu; @@ -338,7 +338,7 @@ AnalyzerContainer::contextMenuEvent( QContextMenuEvent *e) // ToggleAction ////////////////////////////////////////////////////////////////////////////////////////// -ToggleAction::ToggleAction( const QString &text, void ( *f ) ( bool ), KActionCollection* const ac, const char *name ) +ToggleAction::ToggleAction( const TQString &text, void ( *f ) ( bool ), KActionCollection* const ac, const char *name ) : KToggleAction( text, 0, ac, name ) , m_function( f ) {} @@ -368,7 +368,7 @@ void ToggleAction::setEnabled( bool b ) // SelectAction ////////////////////////////////////////////////////////////////////////////////////////// -SelectAction::SelectAction( const QString &text, void ( *f ) ( int ), KActionCollection* const ac, const char *name ) +SelectAction::SelectAction( const TQString &text, void ( *f ) ( int ), KActionCollection* const ac, const char *name ) : KSelectAction( text, 0, ac, name ) , m_function( f ) { } @@ -394,23 +394,23 @@ void SelectAction::setEnabled( bool b ) if( announce ) emit enabled( b ); } -void SelectAction::setIcons( QStringList icons ) +void SelectAction::setIcons( TQStringList icons ) { m_icons = icons; for( int i = 0, n = items().count(); i < n; ++i ) popupMenu()->changeItem( i, kapp->iconLoader()->loadIconSet( *icons.at( i ), KIcon::Small ), popupMenu()->text( i ) ); } -QStringList SelectAction::icons() const { return m_icons; } +TQStringList SelectAction::icons() const { return m_icons; } -QString SelectAction::currentIcon() const +TQString SelectAction::currentIcon() const { if( m_icons.count() ) return *m_icons.at( currentItem() ); - return QString(); + return TQString(); } -QString SelectAction::currentText() const { +TQString SelectAction::currentText() const { return KSelectAction::currentText() + "

" + i18n("Click to change"); } @@ -425,7 +425,7 @@ VolumeAction::VolumeAction( KActionCollection *ac ) {} int -VolumeAction::plug( QWidget *w, int index ) +VolumeAction::plug( TQWidget *w, int index ) { //NOTE we only support one plugging currently @@ -434,13 +434,13 @@ VolumeAction::plug( QWidget *w, int index ) m_slider = new Amarok::VolumeSlider( w, Amarok::VOLUME_MAX ); m_slider->setName( "ToolBarVolume" ); m_slider->setValue( AmarokConfig::masterVolume() ); - m_slider->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Ignored ); + m_slider->setSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Ignored ); - QToolTip::add( m_slider, i18n( "Volume control" ) ); + TQToolTip::add( m_slider, i18n( "Volume control" ) ); EngineController* const ec = EngineController::instance(); - connect( m_slider, SIGNAL(sliderMoved( int )), ec, SLOT(setVolume( int )) ); - connect( m_slider, SIGNAL(sliderReleased( int )), ec, SLOT(setVolume( int )) ); + connect( m_slider, TQT_SIGNAL(sliderMoved( int )), ec, TQT_SLOT(setVolume( int )) ); + connect( m_slider, TQT_SIGNAL(sliderReleased( int )), ec, TQT_SLOT(setVolume( int )) ); static_cast(w)->insertWidget( KAction::getToolButtonID(), 0, m_slider, index ); @@ -461,9 +461,9 @@ VolumeAction::engineVolumeChanged( int value ) RandomAction::RandomAction( KActionCollection *ac ) : SelectAction( i18n( "Ra&ndom" ), &AmarokConfig::setRandomMode, ac, "random_mode" ) { - setItems( QStringList() << i18n( "&Off" ) << i18n( "&Tracks" ) << i18n( "&Albums" ) ); + setItems( TQStringList() << i18n( "&Off" ) << i18n( "&Tracks" ) << i18n( "&Albums" ) ); setCurrentItem( AmarokConfig::randomMode() ); - setIcons( QStringList() << Amarok::icon( "random_no" ) << Amarok::icon( "random_track" ) << Amarok::icon( "random_album" ) ); + setIcons( TQStringList() << Amarok::icon( "random_no" ) << Amarok::icon( "random_track" ) << Amarok::icon( "random_album" ) ); } void @@ -481,7 +481,7 @@ RandomAction::setCurrentItem( int n ) FavorAction::FavorAction( KActionCollection *ac ) : SelectAction( i18n( "&Favor" ), &AmarokConfig::setFavorTracks, ac, "favor_tracks" ) { - setItems( QStringList() << i18n( "Off" ) + setItems( TQStringList() << i18n( "Off" ) << i18n( "Higher &Scores" ) << i18n( "Higher &Ratings" ) << i18n( "Not Recently &Played" ) ); @@ -496,9 +496,9 @@ FavorAction::FavorAction( KActionCollection *ac ) : RepeatAction::RepeatAction( KActionCollection *ac ) : SelectAction( i18n( "&Repeat" ), &AmarokConfig::setRepeat, ac, "repeat" ) { - setItems( QStringList() << i18n( "&Off" ) << i18n( "&Track" ) + setItems( TQStringList() << i18n( "&Off" ) << i18n( "&Track" ) << i18n( "&Album" ) << i18n( "&Playlist" ) ); - setIcons( QStringList() << Amarok::icon( "repeat_no" ) << Amarok::icon( "repeat_track" ) << Amarok::icon( "repeat_album" ) << Amarok::icon( "repeat_playlist" ) ); + setIcons( TQStringList() << Amarok::icon( "repeat_no" ) << Amarok::icon( "repeat_track" ) << Amarok::icon( "repeat_album" ) << Amarok::icon( "repeat_playlist" ) ); setCurrentItem( AmarokConfig::repeat() ); } @@ -510,7 +510,7 @@ BurnMenuAction::BurnMenuAction( KActionCollection *ac ) {} int -BurnMenuAction::plug( QWidget *w, int index ) +BurnMenuAction::plug( TQWidget *w, int index ) { KToolBar *bar = dynamic_cast(w); @@ -519,9 +519,9 @@ BurnMenuAction::plug( QWidget *w, int index ) const int id = KAction::getToolButtonID(); addContainer( bar, id ); - connect( bar, SIGNAL( destroyed() ), SLOT( slotDestroyed() ) ); + connect( bar, TQT_SIGNAL( destroyed() ), TQT_SLOT( slotDestroyed() ) ); - bar->insertButton( QString::null, id, true, i18n( "Burn" ), index ); + bar->insertButton( TQString::null, id, true, i18n( "Burn" ), index ); KToolBarButton* button = bar->getButton( id ); button->setPopup( Amarok::BurnMenu::instance() ); @@ -539,8 +539,8 @@ BurnMenu::BurnMenu() insertItem( i18n("Selected Tracks"), SELECTED_TRACKS ); //TODO add "album" and "all tracks by artist" - connect( this, SIGNAL( aboutToShow() ), SLOT( slotAboutToShow() ) ); - connect( this, SIGNAL( activated(int) ), SLOT( slotActivated(int) ) ); + connect( this, TQT_SIGNAL( aboutToShow() ), TQT_SLOT( slotAboutToShow() ) ); + connect( this, TQT_SIGNAL( activated(int) ), TQT_SLOT( slotActivated(int) ) ); } KPopupMenu* @@ -574,11 +574,11 @@ BurnMenu::slotActivated( int index ) ////////////////////////////////////////////////////////////////////////////////////////// StopAction::StopAction( KActionCollection *ac ) - : KAction( i18n( "Stop" ), Amarok::icon( "stop" ), 0, EngineController::instance(), SLOT( stop() ), ac, "stop" ) + : KAction( i18n( "Stop" ), Amarok::icon( "stop" ), 0, EngineController::instance(), TQT_SLOT( stop() ), ac, "stop" ) {} int -StopAction::plug( QWidget *w, int index ) +StopAction::plug( TQWidget *w, int index ) { KToolBar *bar = dynamic_cast(w); @@ -587,9 +587,9 @@ StopAction::plug( QWidget *w, int index ) const int id = KAction::getToolButtonID(); addContainer( bar, id ); - connect( bar, SIGNAL( destroyed() ), SLOT( slotDestroyed() ) ); + connect( bar, TQT_SIGNAL( destroyed() ), TQT_SLOT( slotDestroyed() ) ); - bar->insertButton( QString::null, id, SIGNAL( clicked() ), EngineController::instance(), SLOT( stop() ), + bar->insertButton( TQString::null, id, TQT_SIGNAL( clicked() ), EngineController::instance(), TQT_SLOT( stop() ), true, i18n( "Stop" ), index ); KToolBarButton* button = bar->getButton( id ); @@ -610,8 +610,8 @@ StopMenu::StopMenu() insertItem( i18n("After Current Track"), AFTER_TRACK ); insertItem( i18n("After Queue"), AFTER_QUEUE ); - connect( this, SIGNAL( aboutToShow() ), SLOT( slotAboutToShow() ) ); - connect( this, SIGNAL( activated(int) ), SLOT( slotActivated(int) ) ); + connect( this, TQT_SIGNAL( aboutToShow() ), TQT_SLOT( slotAboutToShow() ) ); + connect( this, TQT_SIGNAL( activated(int) ), TQT_SLOT( slotActivated(int) ) ); } KPopupMenu* diff --git a/amarok/src/actionclasses.h b/amarok/src/actionclasses.h index 4d51534a..2abff936 100644 --- a/amarok/src/actionclasses.h +++ b/amarok/src/actionclasses.h @@ -13,7 +13,7 @@ #include #include -#include +#include class KActionCollection; class KHelpMenu; @@ -26,7 +26,7 @@ namespace Amarok Q_OBJECT public: static Menu *instance(); - static KPopupMenu *helpMenu( QWidget *parent = 0 ); + static KPopupMenu *helpMenu( TQWidget *parent = 0 ); enum MenuIds { ID_CONF_DECODER, @@ -53,7 +53,7 @@ namespace Amarok { public: MenuAction( KActionCollection* ); - virtual int plug( QWidget*, int index = -1 ); + virtual int plug( TQWidget*, int index = -1 ); }; @@ -67,21 +67,21 @@ namespace Amarok class AnalyzerContainer : public QWidget { public: - AnalyzerContainer( QWidget *parent ); + AnalyzerContainer( TQWidget *parent ); protected: - virtual void resizeEvent( QResizeEvent* ); - virtual void mousePressEvent( QMouseEvent* ); - virtual void contextMenuEvent( QContextMenuEvent* ); + virtual void resizeEvent( TQResizeEvent* ); + virtual void mousePressEvent( TQMouseEvent* ); + virtual void contextMenuEvent( TQContextMenuEvent* ); private: void changeAnalyzer(); - QWidget *m_child; + TQWidget *m_child; }; class AnalyzerAction : public KAction { public: AnalyzerAction( KActionCollection* ); - virtual int plug( QWidget *, int index = -1 ); + virtual int plug( TQWidget *, int index = -1 ); }; @@ -89,17 +89,17 @@ namespace Amarok { public: VolumeAction( KActionCollection* ); - virtual int plug( QWidget *, int index = -1 ); + virtual int plug( TQWidget *, int index = -1 ); private: void engineVolumeChanged( int value ); - QGuardedPtr m_slider; + TQGuardedPtr m_slider; }; class ToggleAction : public KToggleAction { public: - ToggleAction( const QString &text, void ( *f ) ( bool ), KActionCollection* const ac, const char *name ); + ToggleAction( const TQString &text, void ( *f ) ( bool ), KActionCollection* const ac, const char *name ); virtual void setChecked( bool b ); @@ -112,23 +112,23 @@ namespace Amarok class SelectAction : public KSelectAction { public: - SelectAction( const QString &text, void ( *f ) ( int ), KActionCollection* const ac, const char *name ); + SelectAction( const TQString &text, void ( *f ) ( int ), KActionCollection* const ac, const char *name ); virtual void setCurrentItem( int n ); virtual void setEnabled( bool b ); - virtual void setIcons( QStringList icons ); + virtual void setIcons( TQStringList icons ); - virtual QString currentText() const; + virtual TQString currentText() const; - QStringList icons() const; + TQStringList icons() const; - QString currentIcon() const; + TQString currentIcon() const; private: void ( *m_function ) ( int ); - QStringList m_icons; + TQStringList m_icons; }; @@ -176,7 +176,7 @@ namespace Amarok { public: BurnMenuAction( KActionCollection* ); - virtual int plug( QWidget*, int index = -1 ); + virtual int plug( TQWidget*, int index = -1 ); }; class StopMenu : public KPopupMenu @@ -205,7 +205,7 @@ namespace Amarok { public: StopAction( KActionCollection* ); - virtual int plug( QWidget*, int index = -1 ); + virtual int plug( TQWidget*, int index = -1 ); }; } /* namespace Amarok */ diff --git a/amarok/src/amarok.h b/amarok/src/amarok.h index 3be1ae26..dd70b3ef 100644 --- a/amarok/src/amarok.h +++ b/amarok/src/amarok.h @@ -3,8 +3,8 @@ #ifndef AMAROK_H #define AMAROK_H -#include -#include +#include +#include #include // recursiveUrlExpand #include //Amarok::ProcIO @@ -15,15 +15,15 @@ class KActionCollection; class KConfig; -class QColor; -class QDateTime; -class QEvent; -class QMutex; -class QPixmap; -class QWidget; +class TQColor; +class TQDateTime; +class TQEvent; +class TQMutex; +class TQPixmap; +class TQWidget; class DynamicMode; -class QListView; -class QListViewItem; +class TQListView; +class TQListViewItem; namespace KIO { class Job; } namespace Amarok @@ -34,24 +34,24 @@ namespace Amarok const int VOLUME_SENSITIVITY = 30; //for mouse wheels const int GUI_THREAD_ID = 0; - extern QMutex globalDirsMutex; // defined in app.cpp + extern TQMutex globalDirsMutex; // defined in app.cpp namespace ColorScheme { ///eg. base of the Amarok Player-window - extern QColor Base; //Amarok::blue + extern TQColor Base; //Amarok::blue ///eg. text in the Amarok Player-window - extern QColor Text; //Qt::white + extern TQColor Text; //Qt::white ///eg. background colour for Amarok::PrettySliders - extern QColor Background; //brighter blue + extern TQColor Background; //brighter blue ///eg. outline of slider widgets in Player-window - extern QColor Foreground; //lighter blue + extern TQColor Foreground; //lighter blue ///eg. KListView alternative row color - extern QColor AltBase; //grey toned base + extern TQColor AltBase; //grey toned base } /** The version of the playlist XML format. Increase whenever it changes backwards-incompatibly. */ - inline QString xmlVersion() { return "2.4"; } + inline TQString xmlVersion() { return "2.4"; } /** * Convenience function to return the KApplication instance KConfig object @@ -60,7 +60,7 @@ namespace Amarok */ /* FIXME: This function can lead to very bizarre and hard to figure bugs. While we don`t fix it properly, use it like this: amarok::config( Group )->readNumEntry( ... ) */ - KConfig *config( const QString &group = "General" ); //defined in app.cpp + KConfig *config( const TQString &group = "General" ); //defined in app.cpp /** * @return the KActionCollection used by Amarok @@ -80,30 +80,30 @@ namespace Amarok * @param e The event you want handled in a generic fashion. * @return true if the event was handled. */ - bool genericEventHandler( QWidget *recipient, QEvent *e ); //defined in app.cpp + bool genericEventHandler( TQWidget *recipient, TQEvent *e ); //defined in app.cpp /** * Invoke the external web browser set in Amarok's configuration. * @param url The URL to be opened in the browser. * @return True if the browser could be started. */ - bool invokeBrowser( const QString& url ); //defined in app.cpp + bool invokeBrowser( const TQString& url ); //defined in app.cpp /** * Obtain an Amarok PNG image as a QPixmap */ - QPixmap getPNG( const QString& /*fileName*/ ); //defined in app.cpp + TQPixmap getPNG( const TQString& /*fileName*/ ); //defined in app.cpp /** * Obtain an Amarok JPG image as a QPixmap */ - QPixmap getJPG( const QString& /*fileName*/ ); //defined in app.cpp + TQPixmap getJPG( const TQString& /*fileName*/ ); //defined in app.cpp /** * The mainWindow is the playlistWindow or the playerWindow depending on * the configuration of Amarok */ - QWidget *mainWindow(); //defined in app.cpp + TQWidget *mainWindow(); //defined in app.cpp /** * Allocate one on the stack, and it'll set the busy cursor for you until it @@ -120,7 +120,7 @@ namespace Amarok * @param directory will be created if not existing, you MUST end the string * with '/' */ - LIBAMAROK_EXPORT QString saveLocation( const QString &directory = QString::null ); //defined in collectionreader.cpp + LIBAMAROK_EXPORT TQString saveLocation( const TQString &directory = TQString::null ); //defined in collectionreader.cpp KIO::Job *trashFiles( const KURL::List &files ); //defined in app.cpp @@ -131,20 +131,20 @@ namespace Amarok LIBAMAROK_EXPORT KURL::List recursiveUrlExpand( const KURL &url, int maxURLs = -1 ); //defined in playlistloader.cpp LIBAMAROK_EXPORT KURL::List recursiveUrlExpand( const KURL::List &urls, int maxURLs = -1 ); //defined in playlistloader.cpp - QString verboseTimeSince( const QDateTime &datetime ); //defined in contextbrowser.cpp + TQString verboseTimeSince( const TQDateTime &datetime ); //defined in contextbrowser.cpp - QString verboseTimeSince( uint time_t ); //defined in contextbrowser.cpp + TQString verboseTimeSince( uint time_t ); //defined in contextbrowser.cpp /** * Function that must be used when separating contextBrowser escaped urls */ // defined in contextbrowser.cpp - void albumArtistTrackFromUrl( QString url, QString &artist, QString &album, QString &detail ); + void albumArtistTrackFromUrl( TQString url, TQString &artist, TQString &album, TQString &detail ); /** * @return the LOWERCASE file extension without the preceding '.', or "" if there is none */ - inline QString extension( const QString &fileName ) + inline TQString extension( const TQString &fileName ) { return fileName.contains( '.' ) ? fileName.mid( fileName.findRev( '.' ) + 1 ).lower() : ""; } @@ -162,7 +162,7 @@ namespace Amarok /** * @return the last directory in @param fileName */ - inline QString directory( const QString &fileName ) + inline TQString directory( const TQString &fileName ) { return fileName.section( '/', 0, -2 ); } @@ -178,7 +178,7 @@ namespace Amarok * Returns internal code for database type, DbConnection::sqlite, DbConnection::mysql, or DbConnection::postgresql * @param type either "SQLite", "MySQL", or "Postgresql". */ - int databaseTypeCode( const QString type ); //defined in configdialog.cpp + int databaseTypeCode( const TQString type ); //defined in configdialog.cpp void setUseScores( bool use ); //defined in app.cpp void setUseRatings( bool use ); @@ -199,8 +199,8 @@ namespace Amarok const DynamicMode *dynamicMode(); //defined in playlist.cpp - QListViewItem* findItemByPath( QListView *view, QString path ); //defined in playlistbrowser.cpp - QStringList splitPath( QString path ); //defined in playlistbrowser.cpp + TQListViewItem* findItemByPath( TQListView *view, TQString path ); //defined in playlistbrowser.cpp + TQStringList splitPath( TQString path ); //defined in playlistbrowser.cpp /** * Creates a copy of of the KURL instance, that doesn't have any QStrings sharing memory. @@ -210,28 +210,28 @@ namespace Amarok /** * Maps the icon name to a system icon or custom Amarok icon, depending on the settings. */ - LIBAMAROK_EXPORT QString icon( const QString& name ); //defined in iconloader.cpp + LIBAMAROK_EXPORT TQString icon( const TQString& name ); //defined in iconloader.cpp /** * Removes accents from the string * @param path The original path. * @return The cleaned up path. */ - LIBAMAROK_EXPORT QString cleanPath( const QString &path ); //defined in app.cpp + LIBAMAROK_EXPORT TQString cleanPath( const TQString &path ); //defined in app.cpp /** * Replaces all non-ASCII characters with '_'. * @param path The original path. * @return The ASCIIfied path. */ - LIBAMAROK_EXPORT QString asciiPath( const QString &path ); //defined in app.cpp + LIBAMAROK_EXPORT TQString asciiPath( const TQString &path ); //defined in app.cpp /** * Transform path into one valid on VFAT file systems * @param path The original path. * @return The cleaned up path. */ - LIBAMAROK_EXPORT QString vfatPath( const QString &path ); //defined in app.cpp + LIBAMAROK_EXPORT TQString vfatPath( const TQString &path ); //defined in app.cpp /** * Compare both strings from left to right and remove the common part from input @@ -239,15 +239,15 @@ namespace Amarok * @param ref a reference to compare input with. * @return The cleaned up string. */ - LIBAMAROK_EXPORT QString decapitateString( const QString &input, const QString &ref ); + LIBAMAROK_EXPORT TQString decapitateString( const TQString &input, const TQString &ref ); /* * Transform to be usable within HTML/HTML attributes * defined in contextbrowser.cpp */ - LIBAMAROK_EXPORT QString escapeHTML( const QString &s ); - LIBAMAROK_EXPORT QString escapeHTMLAttr( const QString &s ); - LIBAMAROK_EXPORT QString unescapeHTMLAttr( const QString &s ); + LIBAMAROK_EXPORT TQString escapeHTML( const TQString &s ); + LIBAMAROK_EXPORT TQString escapeHTMLAttr( const TQString &s ); + LIBAMAROK_EXPORT TQString unescapeHTMLAttr( const TQString &s ); /* defined in scriptmanager.cpp */ /** @@ -255,14 +255,14 @@ namespace Amarok * @param url the url. * @return The url of the proxy, or a empty string if no proxy should be used. */ - QString proxyForUrl(const QString& url); + TQString proxyForUrl(const TQString& url); /** * Returns the proxy that should be used for a given protocol. * @param protocol the protocol. * @return The url of the proxy, or a empty string if no proxy should be used. */ - QString proxyForProtocol(const QString& protocol); + TQString proxyForProtocol(const TQString& protocol); //////////////////////////////////////////////////////////////////////////////// // class Amarok::ProcIO @@ -293,7 +293,7 @@ namespace Amarok */ class LIBAMAROK_EXPORT Process : public KProcess { public: - Process( QObject *parent = 0 ) : KProcess( parent ) {} + Process( TQObject *parent = 0 ) : KProcess( parent ) {} virtual int commSetupDoneC() { const int i = KProcess::commSetupDoneC(); Amarok::closeOpenFiles(KProcess::out[0],KProcess::in[0], KProcess::err[0]); @@ -309,12 +309,12 @@ namespace Amarok * Use this to const-iterate over QStringLists, if you like. * Watch out for the definition of last in the scope of your for. * - * QStringList strings; + * TQStringList strings; * foreach( strings ) * debug() << *it << endl; */ #define foreach( x ) \ - for( QStringList::ConstIterator it = x.begin(), end = x.end(); it != end; ++it ) + for( TQStringList::ConstIterator it = x.begin(), end = x.end(); it != end; ++it ) /** * You can use this for lists that aren't QStringLists. diff --git a/amarok/src/amarokcore/amarokdcophandler.cpp b/amarok/src/amarokcore/amarokdcophandler.cpp index 740f9d6f..584935a1 100644 --- a/amarok/src/amarokcore/amarokdcophandler.cpp +++ b/amarok/src/amarokcore/amarokdcophandler.cpp @@ -43,7 +43,7 @@ #include "statusbar.h" #include "lastfm.h" -#include +#include #include #include @@ -58,7 +58,7 @@ namespace Amarok DcopPlayerHandler::DcopPlayerHandler() : DCOPObject( "player" ) - , QObject( kapp ) + , TQObject( kapp ) { // Register with DCOP if ( !kapp->dcopClient()->isRegistered() ) { @@ -67,7 +67,7 @@ namespace Amarok } } - QString DcopPlayerHandler::version() + TQString DcopPlayerHandler::version() { return APP_VERSION; } @@ -172,124 +172,124 @@ namespace Amarok return EngineController::instance()->bundle().length(); } - QStringList DcopPlayerHandler::labels() + TQStringList DcopPlayerHandler::labels() { const MetaBundle &bundle = EngineController::instance()->bundle(); return CollectionDB::instance()->getLabels( bundle.url().path(), CollectionDB::typeUser ); } - QString DcopPlayerHandler::album() + TQString DcopPlayerHandler::album() { return EngineController::instance()->bundle().album(); } - QString DcopPlayerHandler::artist() + TQString DcopPlayerHandler::artist() { return EngineController::instance()->bundle().artist(); } - QString DcopPlayerHandler::bitrate() + TQString DcopPlayerHandler::bitrate() { return EngineController::instance()->bundle().prettyBitrate(); } - QString DcopPlayerHandler::comment() + TQString DcopPlayerHandler::comment() { return EngineController::instance()->bundle().comment(); } - QString DcopPlayerHandler::coverImage() + TQString DcopPlayerHandler::coverImage() { const MetaBundle &bundle = EngineController::instance()->bundle(); - QString image = CollectionDB::instance()->albumImage( bundle, 0 ); + TQString image = CollectionDB::instance()->albumImage( bundle, 0 ); return image; } - QString DcopPlayerHandler::currentTime() + TQString DcopPlayerHandler::currentTime() { return MetaBundle::prettyLength( EngineController::instance()->trackPosition() / 1000 ,true ); } - QString DcopPlayerHandler::encodedURL() + TQString DcopPlayerHandler::encodedURL() { return EngineController::instance()->bundle().url().url(); } - QString DcopPlayerHandler::engine() + TQString DcopPlayerHandler::engine() { return AmarokConfig::soundSystem(); } - QString DcopPlayerHandler::genre() + TQString DcopPlayerHandler::genre() { return EngineController::instance()->bundle().genre(); } - QString DcopPlayerHandler::lyrics() + TQString DcopPlayerHandler::lyrics() { return CollectionDB::instance()->getLyrics( EngineController::instance()->bundle().url().path() ); } - QString DcopPlayerHandler::lyricsByPath( QString path ) + TQString DcopPlayerHandler::lyricsByPath( TQString path ) { return CollectionDB::instance()->getLyrics( path ); } - QString DcopPlayerHandler::lastfmStation() + TQString DcopPlayerHandler::lastfmStation() { - return LastFm::Controller::stationDescription(); //return QString::null if not playing + return LastFm::Controller::stationDescription(); //return TQString::null if not playing } - QString DcopPlayerHandler::nowPlaying() + TQString DcopPlayerHandler::nowPlaying() { return EngineController::instance()->bundle().prettyTitle(); } - QString DcopPlayerHandler::path() + TQString DcopPlayerHandler::path() { return EngineController::instance()->bundle().url().path(); } - QString DcopPlayerHandler::setContextStyle(const QString& msg) + TQString DcopPlayerHandler::setContextStyle(const TQString& msg) { AmarokConfig::setContextBrowserStyleSheet( msg ); ContextBrowser::instance()->reloadStyleSheet(); - if ( QFile::exists( Amarok::saveLocation( "themes/" + msg + '/' ) + "stylesheet.css" ) ) + if ( TQFile::exists( Amarok::saveLocation( "themes/" + msg + '/' ) + "stylesheet.css" ) ) return "Context browser theme '"+msg+"' applied."; else return "No such theme '"+msg+"' exists, default theme applied."; } - QString DcopPlayerHandler::title() + TQString DcopPlayerHandler::title() { return EngineController::instance()->bundle().title(); } - QString DcopPlayerHandler::totalTime() + TQString DcopPlayerHandler::totalTime() { return EngineController::instance()->bundle().prettyLength(); } - QString DcopPlayerHandler::track() + TQString DcopPlayerHandler::track() { if ( EngineController::instance()->bundle().track() != 0 ) - return QString::number( EngineController::instance()->bundle().track() ); + return TQString::number( EngineController::instance()->bundle().track() ); else - return QString(); + return TQString(); } - QString DcopPlayerHandler::type() + TQString DcopPlayerHandler::type() { if (EngineController::instance()->bundle().url().protocol() == "lastfm") - return QString("LastFm Stream"); + return TQString("LastFm Stream"); else return EngineController::instance()->bundle().type(); } - QString DcopPlayerHandler::year() + TQString DcopPlayerHandler::year() { - return QString::number( EngineController::instance()->bundle().year() ); + return TQString::number( EngineController::instance()->bundle().year() ); } void DcopPlayerHandler::configEqualizer() @@ -389,7 +389,7 @@ namespace Amarok bool instantiated = EqualizerSetup::isInstantiated(); EqualizerSetup* eq = EqualizerSetup::instance(); - QValueList gains; + TQValueList gains; gains << band60 << band170 << band310 << band600 << band1k << band3k << band6k << band12k << band14k << band16k; @@ -408,7 +408,7 @@ namespace Amarok EqualizerSetup::instance()->setActive( active ); } - void DcopPlayerHandler::setEqualizerPreset( QString name ) + void DcopPlayerHandler::setEqualizerPreset( TQString name ) { if( EngineController::hasEngineProperty( "HasEqualizer" ) ) { bool instantiated = EqualizerSetup::isInstantiated(); @@ -419,18 +419,18 @@ namespace Amarok } } - void DcopPlayerHandler::setLyricsByPath( const QString& url, const QString& lyrics ) + void DcopPlayerHandler::setLyricsByPath( const TQString& url, const TQString& lyrics ) { CollectionDB::instance()->setLyrics( url, lyrics ); } void DcopPlayerHandler::setScore( float score ) { - const QString &url = EngineController::instance()->bundle().url().path(); + const TQString &url = EngineController::instance()->bundle().url().path(); CollectionDB::instance()->setSongPercentage(url, score); } - void DcopPlayerHandler::setScoreByPath( const QString &url, float score ) + void DcopPlayerHandler::setScoreByPath( const TQString &url, float score ) { CollectionDB::instance()->setSongPercentage(url, score); } @@ -443,7 +443,7 @@ namespace Amarok CollectionDB::instance()->updateTags( bundle.url().path(), bundle, true ); } - void DcopPlayerHandler::setBpmByPath( const QString &url, float bpm ) + void DcopPlayerHandler::setBpmByPath( const TQString &url, float bpm ) { MetaBundle bundle( url ); bundle.setBpm(bpm); @@ -453,11 +453,11 @@ namespace Amarok void DcopPlayerHandler::setRating( int rating ) { - const QString &url = EngineController::instance()->bundle().url().path(); + const TQString &url = EngineController::instance()->bundle().url().path(); CollectionDB::instance()->setSongRating(url, rating); } - void DcopPlayerHandler::setRatingByPath( const QString &url, int rating ) + void DcopPlayerHandler::setRatingByPath( const TQString &url, int rating ) { CollectionDB::instance()->setSongRating(url, rating); } @@ -472,7 +472,7 @@ namespace Amarok EngineController::instance()->increaseVolume(ticks); } - void DcopPlayerHandler::showBrowser( QString browser ) + void DcopPlayerHandler::showBrowser( TQString browser ) { if ( browser == "context" ) PlaylistWindow::self()->showBrowser( "ContextBrowser" ); @@ -512,7 +512,7 @@ namespace Amarok EngineController::instance()->increaseVolume(); } - void DcopPlayerHandler::transferCliArgs( QStringList args ) + void DcopPlayerHandler::transferCliArgs( TQStringList args ) { DEBUG_BLOCK @@ -530,7 +530,7 @@ namespace Amarok const int argc = args.count() + 1; char **argv = new char*[argc]; - QStringList::ConstIterator it = args.constBegin(); + TQStringList::ConstIterator it = args.constBegin(); for( int i = 1; i < argc; ++i, ++it ) { argv[i] = qstrdup( (*it).local8Bit() ); debug() << "Extracted: " << argv[i] << endl; @@ -556,7 +556,7 @@ namespace Amarok DcopPlaylistHandler::DcopPlaylistHandler() : DCOPObject( "playlist" ) - , QObject( kapp ) + , TQObject( kapp ) {} int DcopPlaylistHandler::getActiveIndex() @@ -569,7 +569,7 @@ namespace Amarok return Playlist::instance()->totalTrackCount(); } - QString DcopPlaylistHandler::saveCurrentPlaylist() + TQString DcopPlaylistHandler::saveCurrentPlaylist() { Playlist::instance()->saveXML( Playlist::defaultPlaylistPath() ); return Playlist::defaultPlaylistPath(); @@ -605,7 +605,7 @@ namespace Amarok Playlist::instance()->insertMedia( url, Playlist::DirectPlay | Playlist::Unique); } - void DcopPlaylistHandler::popupMessage( const QString& msg ) + void DcopPlaylistHandler::popupMessage( const TQString& msg ) { StatusBar::instance()->longMessageThreadSafe( msg ); } @@ -640,7 +640,7 @@ namespace Amarok Playlist::instance()->repopulate(); } - void DcopPlaylistHandler::saveM3u( const QString& path, bool relativePaths ) + void DcopPlaylistHandler::saveM3u( const TQString& path, bool relativePaths ) { Playlist::instance()->saveM3U( path, relativePaths ); } @@ -650,7 +650,7 @@ namespace Amarok Playlist::instance()->setStopAfterCurrent( on ); } - void DcopPlaylistHandler::shortStatusMessage(const QString& msg) + void DcopPlaylistHandler::shortStatusMessage(const TQString& msg) { StatusBar::instance()->shortMessage( msg ); } @@ -665,10 +665,10 @@ namespace Amarok PlaylistWindow::self()->showHide(); } - QStringList DcopPlaylistHandler::filenames() + TQStringList DcopPlaylistHandler::filenames() { Playlist *p_inst = Playlist::instance(); - QStringList songlist; + TQStringList songlist; if (!p_inst) return songlist; @@ -684,11 +684,11 @@ namespace Amarok return songlist; } - QString DcopPlaylistHandler::currentTrackUniqueId() + TQString DcopPlaylistHandler::currentTrackUniqueId() { if( Playlist::instance()->currentItem() ) return Playlist::instance()->currentItem()->uniqueId(); - return QString(); + return TQString(); } ///////////////////////////////////////////////////////////////////////////////////// @@ -697,10 +697,10 @@ namespace Amarok DcopPlaylistBrowserHandler::DcopPlaylistBrowserHandler() : DCOPObject( "playlistbrowser" ) - , QObject( kapp ) + , TQObject( kapp ) {} - void DcopPlaylistBrowserHandler::addPodcast( const QString &url ) + void DcopPlaylistBrowserHandler::addPodcast( const TQString &url ) { PlaylistBrowser::instance()->addPodcast( url ); } @@ -710,12 +710,12 @@ namespace Amarok PlaylistBrowser::instance()->scanPodcasts(); } - void DcopPlaylistBrowserHandler::addPlaylist( const QString &url ) + void DcopPlaylistBrowserHandler::addPlaylist( const TQString &url ) { PlaylistBrowser::instance()->addPlaylist( url ); } - int DcopPlaylistBrowserHandler::loadPlaylist( const QString &playlist ) + int DcopPlaylistBrowserHandler::loadPlaylist( const TQString &playlist ) { return PlaylistBrowser::instance()->loadPlaylist( playlist ); } @@ -726,7 +726,7 @@ namespace Amarok DcopContextBrowserHandler::DcopContextBrowserHandler() : DCOPObject( "contextbrowser" ) - , QObject( kapp ) + , TQObject( kapp ) {} void DcopContextBrowserHandler::showCurrentTrack() @@ -744,7 +744,7 @@ namespace Amarok ContextBrowser::instance()->showWikipedia(); } - void DcopContextBrowserHandler::showLyrics( const QCString& lyrics ) + void DcopContextBrowserHandler::showLyrics( const TQCString& lyrics ) { ContextBrowser::instance()->lyricsResult( lyrics ); } @@ -755,73 +755,73 @@ namespace Amarok DcopCollectionHandler::DcopCollectionHandler() : DCOPObject( "collection" ) - , QObject( kapp ) + , TQObject( kapp ) {} int DcopCollectionHandler::totalAlbums() { - QStringList albums = CollectionDB::instance()->query( "SELECT COUNT( id ) FROM album;" ); - QString total = albums[0]; + TQStringList albums = CollectionDB::instance()->query( "SELECT COUNT( id ) FROM album;" ); + TQString total = albums[0]; return total.toInt(); } int DcopCollectionHandler::totalArtists() { - QStringList artists = CollectionDB::instance()->query( "SELECT COUNT( id ) FROM artist;" ); - QString total = artists[0]; + TQStringList artists = CollectionDB::instance()->query( "SELECT COUNT( id ) FROM artist;" ); + TQString total = artists[0]; return total.toInt(); } int DcopCollectionHandler::totalComposers() { - QStringList composers = CollectionDB::instance()->query( "SELECT COUNT( id ) FROM composer;" ); - QString total = composers[0]; + TQStringList composers = CollectionDB::instance()->query( "SELECT COUNT( id ) FROM composer;" ); + TQString total = composers[0]; return total.toInt(); } int DcopCollectionHandler::totalCompilations() { - QStringList comps = CollectionDB::instance()->query( "SELECT COUNT( DISTINCT album ) FROM tags WHERE sampler = 1;" ); - QString total = comps[0]; + TQStringList comps = CollectionDB::instance()->query( "SELECT COUNT( DISTINCT album ) FROM tags WHERE sampler = 1;" ); + TQString total = comps[0]; return total.toInt(); } int DcopCollectionHandler::totalGenres() { - QStringList genres = CollectionDB::instance()->query( "SELECT COUNT( id ) FROM genre;" ); - QString total = genres[0]; + TQStringList genres = CollectionDB::instance()->query( "SELECT COUNT( id ) FROM genre;" ); + TQString total = genres[0]; return total.toInt(); } int DcopCollectionHandler::totalTracks() { - QStringList tracks = CollectionDB::instance()->query( "SELECT COUNT( url ) FROM tags;" ); - QString total = tracks[0]; + TQStringList tracks = CollectionDB::instance()->query( "SELECT COUNT( url ) FROM tags;" ); + TQString total = tracks[0]; int final = total.toInt(); return final; } - bool DcopCollectionHandler::isDirInCollection( const QString& path ) + bool DcopCollectionHandler::isDirInCollection( const TQString& path ) { return CollectionDB::instance()->isDirInCollection( path ); } - bool DcopCollectionHandler::moveFile( const QString &oldURL, const QString &newURL, bool overwrite ) + bool DcopCollectionHandler::moveFile( const TQString &oldURL, const TQString &newURL, bool overwrite ) { return CollectionDB::instance()->moveFile( oldURL, newURL, overwrite ); } - QStringList DcopCollectionHandler::query( const QString& sql ) + TQStringList DcopCollectionHandler::query( const TQString& sql ) { return CollectionDB::instance()->query( sql ); } - QStringList DcopCollectionHandler::similarArtists( int artists ) + TQStringList DcopCollectionHandler::similarArtists( int artists ) { return CollectionDB::instance()->similarArtists( EngineController::instance()->bundle().artist(), artists ); } - void DcopCollectionHandler::migrateFile( const QString &oldURL, const QString &newURL ) + void DcopCollectionHandler::migrateFile( const TQString &oldURL, const TQString &newURL ) { CollectionDB::instance()->migrateFile( oldURL, newURL ); } @@ -861,10 +861,10 @@ namespace Amarok debug() << "No ScanController instance available" << endl; } - int DcopCollectionHandler::addLabels( const QString &url, const QStringList &labels ) + int DcopCollectionHandler::addLabels( const TQString &url, const TQStringList &labels ) { CollectionDB *db = CollectionDB::instance(); - QString uid = db->getUniqueId( url ); + TQString uid = db->getUniqueId( url ); int count = 0; foreach( labels ) { @@ -874,7 +874,7 @@ namespace Amarok return count; } - void DcopCollectionHandler::removeLabels( const QString &url, const QStringList &oldLabels ) + void DcopCollectionHandler::removeLabels( const TQString &url, const TQStringList &oldLabels ) { CollectionDB::instance()->removeLabels( url, oldLabels, CollectionDB::typeUser ); } @@ -884,18 +884,18 @@ namespace Amarok CollectionDB::instance()->disableAutoScoring( disable ); } - int DcopCollectionHandler::deviceId( const QString &url ) + int DcopCollectionHandler::deviceId( const TQString &url ) { return MountPointManager::instance()->getIdForUrl( url ); } - QString DcopCollectionHandler::relativePath( const QString &url ) + TQString DcopCollectionHandler::relativePath( const TQString &url ) { int deviceid = deviceId( url ); return MountPointManager::instance()->getRelativePath( deviceid, url ); } - QString DcopCollectionHandler::absolutePath( int deviceid, const QString &relativePath ) + TQString DcopCollectionHandler::absolutePath( int deviceid, const TQString &relativePath ) { return MountPointManager::instance()->getAbsolutePath( deviceid, relativePath ); } @@ -906,53 +906,53 @@ namespace Amarok DcopScriptHandler::DcopScriptHandler() : DCOPObject( "script" ) - , QObject( kapp ) + , TQObject( kapp ) {} - bool DcopScriptHandler::runScript(const QString& name) + bool DcopScriptHandler::runScript(const TQString& name) { return ScriptManager::instance()->runScript(name); } - bool DcopScriptHandler::stopScript(const QString& name) + bool DcopScriptHandler::stopScript(const TQString& name) { return ScriptManager::instance()->stopScript(name); } - QStringList DcopScriptHandler::listRunningScripts() + TQStringList DcopScriptHandler::listRunningScripts() { return ScriptManager::instance()->listRunningScripts(); } - void DcopScriptHandler::addCustomMenuItem(QString submenu, QString itemTitle ) + void DcopScriptHandler::addCustomMenuItem(TQString submenu, TQString itemTitle ) { Playlist::instance()->addCustomMenuItem( submenu, itemTitle ); } - void DcopScriptHandler::removeCustomMenuItem(QString submenu, QString itemTitle ) + void DcopScriptHandler::removeCustomMenuItem(TQString submenu, TQString itemTitle ) { Playlist::instance()->removeCustomMenuItem( submenu, itemTitle ); } - QString DcopScriptHandler::readConfig(const QString& key) + TQString DcopScriptHandler::readConfig(const TQString& key) { - QString cleanKey = key; + TQString cleanKey = key; KConfigSkeletonItem* configItem = AmarokConfig::self()->findItem(cleanKey.remove(' ')); if (configItem) return configItem->property().toString(); else - return QString(); + return TQString(); } - QStringList DcopScriptHandler::readListConfig(const QString& key) + TQStringList DcopScriptHandler::readListConfig(const TQString& key) { - QString cleanKey = key; + TQString cleanKey = key; KConfigSkeletonItem* configItem = AmarokConfig::self()->findItem(cleanKey.remove(' ')); - QStringList stringList; + TQStringList stringList; if(configItem) { - QValueList variantList = configItem->property().toList(); - QValueList::Iterator it = variantList.begin(); + TQValueList variantList = configItem->property().toList(); + TQValueList::Iterator it = variantList.begin(); while(it != variantList.end()) { stringList << (*it).toString(); @@ -962,12 +962,12 @@ namespace Amarok return stringList; } - QString DcopScriptHandler::proxyForUrl(const QString& url) + TQString DcopScriptHandler::proxyForUrl(const TQString& url) { return Amarok::proxyForUrl( url ); } - QString DcopScriptHandler::proxyForProtocol(const QString& protocol) + TQString DcopScriptHandler::proxyForProtocol(const TQString& protocol) { return Amarok::proxyForProtocol( protocol ); } @@ -978,25 +978,25 @@ namespace Amarok DcopDevicesHandler::DcopDevicesHandler() : DCOPObject( "devices" ) - , QObject( kapp ) + , TQObject( kapp ) {} - void DcopDevicesHandler::mediumAdded(QString name) + void DcopDevicesHandler::mediumAdded(TQString name) { DeviceManager::instance()->mediumAdded(name); } - void DcopDevicesHandler::mediumRemoved(QString name) + void DcopDevicesHandler::mediumRemoved(TQString name) { DeviceManager::instance()->mediumRemoved(name); } - void DcopDevicesHandler::mediumChanged(QString name) + void DcopDevicesHandler::mediumChanged(TQString name) { DeviceManager::instance()->mediumChanged(name); } - QStringList DcopDevicesHandler::showDeviceList() + TQStringList DcopDevicesHandler::showDeviceList() { return DeviceManager::instance()->getDeviceStringList(); } @@ -1007,7 +1007,7 @@ namespace Amarok DcopMediaBrowserHandler::DcopMediaBrowserHandler() : DCOPObject( "mediabrowser" ) - , QObject( kapp ) + , TQObject( kapp ) {} void DcopMediaBrowserHandler::deviceConnect() @@ -1022,12 +1022,12 @@ namespace Amarok MediaBrowser::instance()->currentDevice()->disconnectDevice(); } - QStringList DcopMediaBrowserHandler::deviceList() + TQStringList DcopMediaBrowserHandler::deviceList() { return MediaBrowser::instance()->deviceNames(); } - void DcopMediaBrowserHandler::deviceSwitch( QString name ) + void DcopMediaBrowserHandler::deviceSwitch( TQString name ) { MediaBrowser::instance()->deviceSwitch( name ); } @@ -1049,7 +1049,7 @@ namespace Amarok MediaBrowser::instance()->currentDevice()->transferFiles(); } - void DcopMediaBrowserHandler::transcodingFinished( QString src, QString dest ) + void DcopMediaBrowserHandler::transcodingFinished( TQString src, TQString dest ) { MediaBrowser::instance()->transcodingFinished( src, dest ); } diff --git a/amarok/src/amarokcore/amarokdcophandler.h b/amarok/src/amarokcore/amarokdcophandler.h index 98117b5f..33d5d711 100644 --- a/amarok/src/amarokcore/amarokdcophandler.h +++ b/amarok/src/amarokcore/amarokdcophandler.h @@ -20,14 +20,14 @@ #ifndef AMAROK_DCOP_HANDLER_H #define AMAROK_DCOP_HANDLER_H -#include +#include #include "amarokdcopiface.h" class AmarokConfig; namespace Amarok { -class DcopPlayerHandler : public QObject, virtual public AmarokPlayerInterface +class DcopPlayerHandler : public TQObject, virtual public AmarokPlayerInterface { Q_OBJECT @@ -35,7 +35,7 @@ class DcopPlayerHandler : public QObject, virtual public AmarokPlayerInterface DcopPlayerHandler(); public: - virtual QString version(); + virtual TQString version(); virtual bool dynamicModeStatus(); virtual bool equalizerEnabled(); virtual bool osdEnabled(); @@ -52,27 +52,27 @@ class DcopPlayerHandler : public QObject, virtual public AmarokPlayerInterface virtual int trackCurrentTimeMs(); virtual int trackPlayCounter(); virtual int trackTotalTime(); - virtual QStringList labels(); - virtual QString album(); - virtual QString artist(); - virtual QString bitrate(); - virtual QString comment(); - virtual QString coverImage(); - virtual QString currentTime(); - virtual QString encodedURL(); - virtual QString engine(); - virtual QString genre(); - virtual QString lyrics(); - virtual QString lyricsByPath( QString path ); - virtual QString lastfmStation(); - virtual QString nowPlaying(); - virtual QString path(); - virtual QString setContextStyle(const QString&); - virtual QString title(); - virtual QString totalTime(); - virtual QString track(); - virtual QString type(); - virtual QString year(); + virtual TQStringList labels(); + virtual TQString album(); + virtual TQString artist(); + virtual TQString bitrate(); + virtual TQString comment(); + virtual TQString coverImage(); + virtual TQString currentTime(); + virtual TQString encodedURL(); + virtual TQString engine(); + virtual TQString genre(); + virtual TQString lyrics(); + virtual TQString lyricsByPath( TQString path ); + virtual TQString lastfmStation(); + virtual TQString nowPlaying(); + virtual TQString path(); + virtual TQString setContextStyle(const TQString&); + virtual TQString title(); + virtual TQString totalTime(); + virtual TQString track(); + virtual TQString type(); + virtual TQString year(); virtual void configEqualizer(); virtual void enableOSD( bool enable ); virtual void enableRandomMode( bool enable ); @@ -91,17 +91,17 @@ class DcopPlayerHandler : public QObject, virtual public AmarokPlayerInterface virtual void seekRelative( int s ); virtual void setEqualizer(int preamp, int band60, int band170, int band310, int band600, int band1k, int band3k, int band6k, int band12k, int band14k, int band16k); virtual void setEqualizerEnabled( bool active ); - virtual void setEqualizerPreset( QString name ); - virtual void setLyricsByPath( const QString& url, const QString& lyrics ); + virtual void setEqualizerPreset( TQString name ); + virtual void setLyricsByPath( const TQString& url, const TQString& lyrics ); virtual void setScore( float score ); - virtual void setScoreByPath( const QString &url, float score ); + virtual void setScoreByPath( const TQString &url, float score ); virtual void setBpm( float bpm ); - virtual void setBpmByPath( const QString &url, float bpm ); + virtual void setBpmByPath( const TQString &url, float bpm ); virtual void setRating( int rating ); - virtual void setRatingByPath( const QString &url, int rating ); + virtual void setRatingByPath( const TQString &url, int rating ); virtual void setVolume( int ); virtual void setVolumeRelative( int ); - virtual void showBrowser( QString browser ); + virtual void showBrowser( TQString browser ); virtual void showOSD(); virtual void stop(); virtual void volumeDown(); @@ -109,11 +109,11 @@ class DcopPlayerHandler : public QObject, virtual public AmarokPlayerInterface virtual void transferDeviceFiles(); private: - virtual void transferCliArgs( QStringList args ); + virtual void transferCliArgs( TQStringList args ); }; -class DcopPlaylistHandler : public QObject, virtual public AmarokPlaylistInterface +class DcopPlaylistHandler : public TQObject, virtual public AmarokPlaylistInterface { Q_OBJECT @@ -123,27 +123,27 @@ class DcopPlaylistHandler : public QObject, virtual public AmarokPlaylistInterfa public: virtual int getActiveIndex(); virtual int getTotalTrackCount(); - virtual QString saveCurrentPlaylist(); + virtual TQString saveCurrentPlaylist(); virtual void addMedia(const KURL &); virtual void queueMedia(const KURL &); virtual void addMediaList(const KURL::List &); virtual void clearPlaylist(); - virtual QString currentTrackUniqueId(); + virtual TQString currentTrackUniqueId(); virtual void playByIndex(int); virtual void playMedia(const KURL &); - virtual void popupMessage(const QString&); + virtual void popupMessage(const TQString&); virtual void removeCurrentTrack(); virtual void removeByIndex(int); virtual void repopulate(); - virtual void saveM3u(const QString& path, bool relativePaths); + virtual void saveM3u(const TQString& path, bool relativePaths); virtual void setStopAfterCurrent(bool); - virtual void shortStatusMessage(const QString&); + virtual void shortStatusMessage(const TQString&); virtual void shufflePlaylist(); virtual void togglePlaylist(); - virtual QStringList filenames(); + virtual TQStringList filenames(); }; -class DcopPlaylistBrowserHandler : public QObject, virtual public AmarokPlaylistBrowserInterface +class DcopPlaylistBrowserHandler : public TQObject, virtual public AmarokPlaylistBrowserInterface { Q_OBJECT @@ -151,13 +151,13 @@ class DcopPlaylistBrowserHandler : public QObject, virtual public AmarokPlaylist DcopPlaylistBrowserHandler(); public: - virtual void addPodcast( const QString &url ); + virtual void addPodcast( const TQString &url ); virtual void scanPodcasts(); - virtual void addPlaylist( const QString &url ); - virtual int loadPlaylist( const QString &playlist ); + virtual void addPlaylist( const TQString &url ); + virtual int loadPlaylist( const TQString &playlist ); }; -class DcopContextBrowserHandler : public QObject, virtual public AmarokContextBrowserInterface +class DcopContextBrowserHandler : public TQObject, virtual public AmarokContextBrowserInterface { Q_OBJECT @@ -168,11 +168,11 @@ class DcopContextBrowserHandler : public QObject, virtual public AmarokContextBr virtual void showCurrentTrack(); virtual void showLyrics(); virtual void showWiki(); - virtual void showLyrics( const QCString& lyrics ); + virtual void showLyrics( const TQCString& lyrics ); }; -class DcopCollectionHandler : public QObject, virtual public AmarokCollectionInterface +class DcopCollectionHandler : public TQObject, virtual public AmarokCollectionInterface { Q_OBJECT @@ -186,26 +186,26 @@ class DcopCollectionHandler : public QObject, virtual public AmarokCollectionInt virtual int totalCompilations(); virtual int totalGenres(); virtual int totalTracks(); - virtual bool isDirInCollection( const QString &path ); - virtual bool moveFile( const QString &oldURL, const QString &newURL, bool overwrite ); - virtual QStringList query(const QString& sql); - virtual QStringList similarArtists( int artists ); - virtual void migrateFile( const QString &oldURL, const QString &newURL ); + virtual bool isDirInCollection( const TQString &path ); + virtual bool moveFile( const TQString &oldURL, const TQString &newURL, bool overwrite ); + virtual TQStringList query(const TQString& sql); + virtual TQStringList similarArtists( int artists ); + virtual void migrateFile( const TQString &oldURL, const TQString &newURL ); virtual void scanCollection(); virtual void scanCollectionChanges(); virtual void disableAutoScoring( bool disable ); virtual void scanUnpause(); virtual void scanPause(); virtual void scannerAcknowledged(); - virtual int addLabels( const QString &url, const QStringList &labels ); - virtual void removeLabels( const QString &url, const QStringList &oldLabels ); - virtual int deviceId( const QString &url ); - virtual QString relativePath( const QString &url ); - virtual QString absolutePath( int deviceid, const QString &relativePath ); + virtual int addLabels( const TQString &url, const TQStringList &labels ); + virtual void removeLabels( const TQString &url, const TQStringList &oldLabels ); + virtual int deviceId( const TQString &url ); + virtual TQString relativePath( const TQString &url ); + virtual TQString absolutePath( int deviceid, const TQString &relativePath ); }; -class DcopScriptHandler : public QObject, virtual public AmarokScriptInterface +class DcopScriptHandler : public TQObject, virtual public AmarokScriptInterface { Q_OBJECT @@ -213,18 +213,18 @@ class DcopScriptHandler : public QObject, virtual public AmarokScriptInterface DcopScriptHandler(); public /* DCOP */ slots: - virtual bool runScript(const QString&); - virtual bool stopScript(const QString&); - virtual QStringList listRunningScripts(); - virtual void addCustomMenuItem(QString submenu, QString itemTitle ); - virtual void removeCustomMenuItem(QString submenu, QString itemTitle ); - virtual QString readConfig(const QString& key); - virtual QStringList readListConfig(const QString& key); - virtual QString proxyForUrl(const QString& url); - virtual QString proxyForProtocol(const QString& protocol); + virtual bool runScript(const TQString&); + virtual bool stopScript(const TQString&); + virtual TQStringList listRunningScripts(); + virtual void addCustomMenuItem(TQString submenu, TQString itemTitle ); + virtual void removeCustomMenuItem(TQString submenu, TQString itemTitle ); + virtual TQString readConfig(const TQString& key); + virtual TQStringList readListConfig(const TQString& key); + virtual TQString proxyForUrl(const TQString& url); + virtual TQString proxyForProtocol(const TQString& protocol); }; -class DcopDevicesHandler : public QObject, virtual public AmarokDevicesInterface +class DcopDevicesHandler : public TQObject, virtual public AmarokDevicesInterface { Q_OBJECT @@ -232,13 +232,13 @@ class DcopDevicesHandler : public QObject, virtual public AmarokDevicesInterface DcopDevicesHandler(); public /* DCOP */ slots: - virtual void mediumAdded(QString name); - virtual void mediumRemoved(QString name); - virtual void mediumChanged(QString name); - virtual QStringList showDeviceList(); + virtual void mediumAdded(TQString name); + virtual void mediumRemoved(TQString name); + virtual void mediumChanged(TQString name); + virtual TQStringList showDeviceList(); }; -class DcopMediaBrowserHandler : public QObject, virtual public AmarokMediaBrowserInterface +class DcopMediaBrowserHandler : public TQObject, virtual public AmarokMediaBrowserInterface { Q_OBJECT @@ -248,12 +248,12 @@ class DcopMediaBrowserHandler : public QObject, virtual public AmarokMediaBrowse public /* DCOP */ slots: virtual void deviceConnect(); virtual void deviceDisconnect(); - virtual QStringList deviceList(); - virtual void deviceSwitch( QString name ); + virtual TQStringList deviceList(); + virtual void deviceSwitch( TQString name ); virtual void queue( KURL url ); virtual void queueList( KURL::List urls ); virtual void transfer(); - virtual void transcodingFinished( QString src, QString dest ); + virtual void transcodingFinished( TQString src, TQString dest ); }; } // namespace Amarok diff --git a/amarok/src/amarokcore/amarokdcopiface.h b/amarok/src/amarokcore/amarokdcopiface.h index 2e37fa00..32b330a7 100644 --- a/amarok/src/amarokcore/amarokdcopiface.h +++ b/amarok/src/amarokcore/amarokdcopiface.h @@ -22,7 +22,7 @@ #include #include -#include +#include /////////////////////////////////////////////////////////////////////// // WARNING! Please ask on #amarok before modifying the DCOP interface! @@ -34,7 +34,7 @@ class AmarokPlayerInterface : virtual public DCOPObject K_DCOP k_dcop: - virtual QString version() = 0; ///< returns amarok version string + virtual TQString version() = 0; ///< returns amarok version string virtual bool dynamicModeStatus() = 0; ///< Return dynamic mode status. virtual bool equalizerEnabled() = 0; ///< Return the equalizer status. @@ -52,32 +52,32 @@ k_dcop: virtual int trackCurrentTimeMs() = 0; ///< Return current play position in milliseconds. virtual int trackPlayCounter() = 0; ///< Return play counter for current song. virtual int trackTotalTime() = 0; ///< Return track length in seconds. - virtual QStringList labels() = 0; ///< Return the labels of the currently playing track + virtual TQStringList labels() = 0; ///< Return the labels of the currently playing track /* New player API */ - virtual QString album() = 0; ///< Return the album of the currently playing track. - virtual QString artist() = 0; ///< Return the artist of the currently playing track. - virtual QString bitrate() = 0; ///< Return the bitrate of the currently playing track (XX kbps). - virtual QString comment() = 0; ///< Return the comment of the currently playing track. - virtual QString coverImage() = 0; ///< Return the encoded URL of the current track's cover image - virtual QString currentTime() = 0; ///< Return the position of the currently playing track ([h:]mm:ss format). - virtual QString encodedURL() = 0; ///< Return the encoded URL of the currently playing track. - virtual QString engine() = 0; /// #include -#include -#include -#include -#include //qVersion() +#include +#include +#include +#include //qVersion() #include //popen, fread #include @@ -48,7 +48,7 @@ namespace Amarok #endif static QString - runCommand( const QCString &command ) + runCommand( const TQCString &command ) { static const uint SIZE = 40960; //40 KiB static char stdoutBuf[ SIZE ] = {0}; @@ -61,7 +61,7 @@ namespace Amarok stdoutBuf[ std::fread( static_cast( stdoutBuf ), sizeof(char), SIZE-1, process ) ] = '\0'; ::pclose( process ); } - return QString::fromLocal8Bit( stdoutBuf ); + return TQString::fromLocal8Bit( stdoutBuf ); } void @@ -82,8 +82,8 @@ namespace Amarok // we are the child process (the result of the fork) std::cout << "Amarok is crashing...\n"; - QString subject = APP_VERSION " "; - QString body = i18n( + TQString subject = APP_VERSION " "; + TQString body = i18n( "Amarok has crashed! We are terribly sorry about this :(\n\n" "But, all is not lost! You could potentially help us fix the crash. " "Information describing the crash is below, so just click send, " @@ -104,11 +104,11 @@ namespace Amarok "TagLib: %3.%4.%5\n" "CPU count: %6\n"; - QString cpucount = "unknown"; + TQString cpucount = "unknown"; #ifdef __linux__ - QString line; + TQString line; uint cpuCount = 0; - QFile cpuinfo( "/proc/cpuinfo" ); + TQFile cpuinfo( "/proc/cpuinfo" ); if ( cpuinfo.open( IO_ReadOnly ) ) { while ( cpuinfo.readLine( line, 20000 ) != -1 ) { if ( line.startsWith( "processor" ) ) { @@ -116,7 +116,7 @@ namespace Amarok } } } - cpucount = QString::number( cpuCount ); + cpucount = TQString::number( cpuCount ); #endif @@ -139,13 +139,13 @@ namespace Amarok const int handle = temp.handle(); -// QCString gdb_command_string = +// TQCString gdb_command_string = // "file amarokapp\n" -// "attach " + QCString().setNum( ::getppid() ) + "\n" +// "attach " + TQCString().setNum( ::getppid() ) + "\n" // "bt\n" "echo \\n\n" // "thread apply all bt\n"; - const QCString gdb_batch = + const TQCString gdb_batch = "bt\n" "echo \\n\\n\n" "bt full\n" @@ -160,23 +160,23 @@ namespace Amarok ::dup2( fileno( stdout ), fileno( stderr ) ); - QCString gdb; + TQCString gdb; gdb = "gdb --nw -n --batch -x "; gdb += temp.name().latin1(); gdb += " amarokapp "; - gdb += QCString().setNum( ::getppid() ); + gdb += TQCString().setNum( ::getppid() ); - QString bt = runCommand( gdb ); + TQString bt = runCommand( gdb ); /// clean up bt.remove( "(no debugging symbols found)..." ); bt.remove( "(no debugging symbols found)\n" ); - bt.replace( QRegExp("\n{2,}"), "\n" ); //clean up multiple \n characters + bt.replace( TQRegExp("\n{2,}"), "\n" ); //clean up multiple \n characters bt.stripWhiteSpace(); /// analyze usefulness bool useful = true; - const QString fileCommandOutput = runCommand( "file `which amarokapp`" ); + const TQString fileCommandOutput = runCommand( "file `which amarokapp`" ); if( fileCommandOutput.find( "not stripped", false ) == -1 ) subject += "[___stripped]"; //same length as below @@ -184,24 +184,24 @@ namespace Amarok subject += "[NOTstripped]"; if( !bt.isEmpty() ) { - const int invalidFrames = bt.contains( QRegExp("\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in \\?\\?") ); - const int validFrames = bt.contains( QRegExp("\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in [^?]") ); + const int invalidFrames = bt.contains( TQRegExp("\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in \\?\\?") ); + const int validFrames = bt.contains( TQRegExp("\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in [^?]") ); const int totalFrames = invalidFrames + validFrames; if( totalFrames > 0 ) { const double validity = double(validFrames) / totalFrames; - subject += QString("[validity: %1]").arg( validity, 0, 'f', 2 ); + subject += TQString("[validity: %1]").arg( validity, 0, 'f', 2 ); if( validity <= 0.5 ) useful = false; } - subject += QString("[frames: %1]").arg( totalFrames, 3 /*padding*/ ); + subject += TQString("[frames: %1]").arg( totalFrames, 3 /*padding*/ ); - if( bt.find( QRegExp(" at \\w*\\.cpp:\\d+\n") ) >= 0 ) + if( bt.find( TQRegExp(" at \\w*\\.cpp:\\d+\n") ) >= 0 ) subject += "[line numbers]"; } else useful = false; - subject += QString("[%1]").arg( AmarokConfig::soundSystem().remove( QRegExp("-?engine") ) ); + subject += TQString("[%1]").arg( AmarokConfig::soundSystem().remove( TQRegExp("-?engine") ) ); std::cout << subject.latin1() << std::endl; @@ -221,12 +221,12 @@ namespace Amarok //TODO startup notification kapp->invokeMailer( /*to*/ "amarok-backtraces@lists.sf.net", - /*cc*/ QString(), - /*bcc*/ QString(), + /*cc*/ TQString(), + /*bcc*/ TQString(), /*subject*/ subject, /*body*/ body, - /*messageFile*/ QString(), - /*attachURLs*/ QStringList(), + /*messageFile*/ TQString(), + /*attachURLs*/ TQStringList(), /*startup_id*/ "" ); } else { @@ -255,9 +255,9 @@ namespace Amarok #if 0 -#include -#include -#include +#include +#include +#include #include #include #include @@ -265,20 +265,20 @@ namespace Amarok Amarok::CrashHandlerWidget::CrashHandlerWidget() { - QBoxLayout *layout = new QHBoxLayout( this, 18, 12 ); + TQBoxLayout *layout = new TQHBoxLayout( this, 18, 12 ); { - QBoxLayout *lay = new QVBoxLayout( layout ); - QLabel *label = new QLabel( this ); + TQBoxLayout *lay = new TQVBoxLayout( layout ); + TQLabel *label = new TQLabel( this ); label->setPixmap( locate( "data", "drkonqi/pics/konqi.png" ) ); - label->setFrameStyle( QFrame::Plain | QFrame::Box ); + label->setFrameStyle( TQFrame::Plain | TQFrame::Box ); lay->add( label ); - lay->addItem( new QSpacerItem( 3, 3, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); + lay->addItem( new TQSpacerItem( 3, 3, TQSizePolicy::Minimum, TQSizePolicy::Expanding ) ); } - layout = new QVBoxLayout( layout, 6 ); + layout = new TQVBoxLayout( layout, 6 ); - layout->add( new QLabel( /*i18n*/( + layout->add( new TQLabel( /*i18n*/( "

" "Amarok has crashed! We are terribly sorry about this :(" "

" "However you now have an opportunity to help us fix this crash so that it doesn't " "happen again! Click Send Email and Amarok will prepare an email that you " @@ -286,16 +286,16 @@ Amarok::CrashHandlerWidget::CrashHandlerWidget() "as soon as possible." "

" "Thanks for choosing Amarok.
" ), this ) ); - layout = new QHBoxLayout( layout, 6 ); + layout = new TQHBoxLayout( layout, 6 ); - layout->addItem( new QSpacerItem( 6, 6, QSizePolicy::Expanding ) ); + layout->addItem( new TQSpacerItem( 6, 6, TQSizePolicy::Expanding ) ); layout->add( new KPushButton( KGuiItem( i18n("Send Email"), "mail_send" ), this, "email" ) ); layout->add( new KPushButton( KStdGuiItem::close(), this, "close" ) ); - static_cast(child("email"))->setDefault( true ); + static_cast(child("email"))->setDefault( true ); - connect( child( "email" ), SIGNAL(clicked()), SLOT(accept()) ); - connect( child( "close" ), SIGNAL(clicked()), SLOT(reject()) ); + connect( child( "email" ), TQT_SIGNAL(clicked()), TQT_SLOT(accept()) ); + connect( child( "close" ), TQT_SIGNAL(clicked()), TQT_SLOT(reject()) ); setCaption( i18n("Crash Handler") ); setFixedSize( sizeHint() ); diff --git a/amarok/src/analyzers/analyzerbase.cpp b/amarok/src/analyzers/analyzerbase.cpp index 04e19e26..27fb7abc 100644 --- a/amarok/src/analyzers/analyzerbase.cpp +++ b/amarok/src/analyzers/analyzerbase.cpp @@ -18,7 +18,7 @@ #include "analyzerbase.h" #include //interpolate() #include "enginecontroller.h" -#include //event() +#include //event() // INSTRUCTIONS Base2D @@ -26,7 +26,7 @@ // 2. otherwise you can use the constructor to initialise things // 3. reimplement analyze(), and paint to canvas(), Base2D will update the widget when you return control to it // 4. if you want to manipulate the scope, reimplement transform() -// 5. for convenience are pre-included +// 5. for convenience are pre-included // TODO make an INSTRUCTIONS file //can't mod scope in analyze you have to use transform @@ -35,30 +35,30 @@ // make the linker happy only for gcc < 4.0 #if !( __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 0 ) ) -template class Analyzer::Base; +template class Analyzer::Base; #endif template -Analyzer::Base::Base( QWidget *parent, uint timeout, uint scopeSize ) +Analyzer::Base::Base( TQWidget *parent, uint timeout, uint scopeSize ) : W( parent ) , m_timeout( timeout ) , m_fht( new FHT(scopeSize) ) {} template bool -Analyzer::Base::event( QEvent *e ) +Analyzer::Base::event( TQEvent *e ) { switch( e->type() ) { -/* case QEvent::Paint: +/* case TQEvent::Paint: if( !canvas()->isNull() ) bitBlt( this, 0, 0, canvas() ); return true; //no propagate event*/ - case QEvent::Hide: + case TQEvent::Hide: m_timer.stop(); break; - case QEvent::Show: + case TQEvent::Show: m_timer.start( timeout() ); break; @@ -66,7 +66,7 @@ Analyzer::Base::event( QEvent *e ) break; } - return QWidget::event( e ); + return TQWidget::event( e ); } template void @@ -188,12 +188,12 @@ Analyzer::Base::demo() //virtual -Analyzer::Base2D::Base2D( QWidget *parent, uint timeout, uint scopeSize ) - : Base( parent, timeout, scopeSize ) +Analyzer::Base2D::Base2D( TQWidget *parent, uint timeout, uint scopeSize ) + : Base( parent, timeout, scopeSize ) { setWFlags( Qt::WNoAutoErase ); //no flicker - connect( &m_timer, SIGNAL( timeout() ), SLOT( draw() ) ); + connect( &m_timer, TQT_SIGNAL( timeout() ), TQT_SLOT( draw() ) ); } void @@ -203,24 +203,24 @@ Analyzer::Base2D::polish() //we use polish for initialzing (instead of ctor) //because we need to know the widget's final size - QWidget::polish(); + TQWidget::polish(); init(); //virtual } void -Analyzer::Base2D::resizeEvent( QResizeEvent *e ) +Analyzer::Base2D::resizeEvent( TQResizeEvent *e ) { m_background.resize( size() ); m_canvas.resize( size() ); m_background.fill( backgroundColor() ); eraseCanvas(); //this is necessary - QWidget::resizeEvent( e ); + TQWidget::resizeEvent( e ); } void -Analyzer::Base2D::paletteChange( const QPalette& ) +Analyzer::Base2D::paletteChange( const TQPalette& ) { m_background.fill( backgroundColor() ); eraseCanvas(); @@ -229,10 +229,10 @@ Analyzer::Base2D::paletteChange( const QPalette& ) #ifdef HAVE_QGLWIDGET -Analyzer::Base3D::Base3D( QWidget *parent, uint timeout, uint scopeSize ) - : Base( parent, timeout, scopeSize ) +Analyzer::Base3D::Base3D( TQWidget *parent, uint timeout, uint scopeSize ) + : Base( parent, timeout, scopeSize ) { - connect( &m_timer, SIGNAL( timeout() ), SLOT( draw() ) ); + connect( &m_timer, TQT_SIGNAL( timeout() ), TQT_SLOT( draw() ) ); } #endif diff --git a/amarok/src/analyzers/analyzerbase.h b/amarok/src/analyzers/analyzerbase.h index ba3ecb30..d8270026 100644 --- a/amarok/src/analyzers/analyzerbase.h +++ b/amarok/src/analyzers/analyzerbase.h @@ -12,13 +12,13 @@ #endif #include "fht.h" //stack allocated and convenience -#include //stack allocated and convenience -#include //stack allocated -#include //baseclass +#include //stack allocated and convenience +#include //stack allocated +#include //baseclass #include //included for convenience #ifdef HAVE_QGLWIDGET -#include //baseclass +#include //baseclass #ifdef Q_WS_MACX #include //included for convenience #include //included for convenience @@ -28,12 +28,12 @@ #endif #else //this is a workaround for compile problems due to moc -#define QGLWidget QWidget +#define TQGLWidget QWidget #endif -class QEvent; -class QPaintEvent; -class QResizeEvent; +class TQEvent; +class TQPaintEvent; +class TQResizeEvent; namespace Analyzer { @@ -46,7 +46,7 @@ public: uint timeout() const { return m_timeout; } protected: - Base( QWidget*, uint, uint = 7 ); + Base( TQWidget*, uint, uint = 7 ); ~Base() { delete m_fht; } void drawFrame(); @@ -64,43 +64,43 @@ protected: } private: - bool event( QEvent* ); + bool event( TQEvent* ); protected: - QTimer m_timer; + TQTimer m_timer; uint m_timeout; FHT *m_fht; }; -class Base2D : public Base +class Base2D : public Base { Q_OBJECT public: - const QPixmap *background() const { return &m_background; } - const QPixmap *canvas() const { return &m_canvas; } + const TQPixmap *background() const { return &m_background; } + const TQPixmap *canvas() const { return &m_canvas; } private slots: void draw() { drawFrame(); bitBlt( this, 0, 0, canvas() ); } protected: - Base2D( QWidget*, uint timeout, uint scopeSize = 7 ); + Base2D( TQWidget*, uint timeout, uint scopeSize = 7 ); virtual void init() {} - QPixmap *background() { return &m_background; } - QPixmap *canvas() { return &m_canvas; } + TQPixmap *background() { return &m_background; } + TQPixmap *canvas() { return &m_canvas; } void eraseCanvas() { bitBlt( canvas(), 0, 0, background() ); } - void paintEvent( QPaintEvent* ) { if( !m_canvas.isNull() ) bitBlt( this, 0, 0, canvas() ); } - void resizeEvent( QResizeEvent* ); - void paletteChange( const class QPalette& ); + void paintEvent( TQPaintEvent* ) { if( !m_canvas.isNull() ) bitBlt( this, 0, 0, canvas() ); } + void resizeEvent( TQResizeEvent* ); + void paletteChange( const class TQPalette& ); void polish(); private: - QPixmap m_background; - QPixmap m_canvas; + TQPixmap m_background; + TQPixmap m_canvas; }; @@ -111,17 +111,17 @@ private: //3. we have to declare a ctor (to satisfy the inheritance) //4. the slot must also by visible (!) //TODO find out how to stop moc generating a metaobject for this class -class Base3D : public Base +class Base3D : public Base { Q_OBJECT #ifdef HAVE_QGLWIDGET protected: - Base3D( QWidget*, uint, uint = 7 ); + Base3D( TQWidget*, uint, uint = 7 ); private slots: void draw() { drawFrame(); } #else protected: - Base3D( QWidget *w, uint i1, uint i2 ) : Base( w, i1, i2 ) {} + Base3D( TQWidget *w, uint i1, uint i2 ) : Base( w, i1, i2 ) {} private slots: void draw() {} #endif @@ -138,8 +138,8 @@ class Factory //but I can't be arsed, nor can I see much reason to do so //yet! public: - static QWidget* createAnalyzer( QWidget* ); - static QWidget* createPlaylistAnalyzer( QWidget *); + static TQWidget* createAnalyzer( TQWidget* ); + static TQWidget* createPlaylistAnalyzer( TQWidget *); }; diff --git a/amarok/src/analyzers/analyzerfactory.cpp b/amarok/src/analyzers/analyzerfactory.cpp index 91c28b01..16b10acd 100644 --- a/amarok/src/analyzers/analyzerfactory.cpp +++ b/amarok/src/analyzers/analyzerfactory.cpp @@ -32,17 +32,17 @@ #include "glanalyzer3.h" #endif -#include +#include #include //separate from analyzerbase.cpp to save compile time -QWidget *Analyzer::Factory::createAnalyzer( QWidget *parent ) +TQWidget *Analyzer::Factory::createAnalyzer( TQWidget *parent ) { //new XmmsWrapper(); //toplevel - QWidget *analyzer = 0; + TQWidget *analyzer = 0; switch( AmarokConfig::currentAnalyzer() ) { @@ -72,8 +72,8 @@ QWidget *Analyzer::Factory::createAnalyzer( QWidget *parent ) #else case 5: #endif - analyzer = new QLabel( i18n( "Click for Analyzers" ), parent ); //blank analyzer to satisfy Grue - static_cast(analyzer)->setAlignment( Qt::AlignCenter ); + analyzer = new TQLabel( i18n( "Click for Analyzers" ), parent ); //blank analyzer to satisfy Grue + static_cast(analyzer)->setAlignment( Qt::AlignCenter ); break; default: @@ -85,9 +85,9 @@ QWidget *Analyzer::Factory::createAnalyzer( QWidget *parent ) return analyzer; } -QWidget *Analyzer::Factory::createPlaylistAnalyzer( QWidget *parent) +TQWidget *Analyzer::Factory::createPlaylistAnalyzer( TQWidget *parent) { - QWidget *analyzer = 0; + TQWidget *analyzer = 0; switch( AmarokConfig::currentPlaylistAnalyzer() ) { case 1: @@ -113,8 +113,8 @@ QWidget *Analyzer::Factory::createPlaylistAnalyzer( QWidget *parent) #else case 4: #endif - analyzer = new QLabel( i18n( "Click for Analyzers" ), parent ); //blank analyzer to satisfy Grue - static_cast(analyzer)->setAlignment( Qt::AlignCenter ); + analyzer = new TQLabel( i18n( "Click for Analyzers" ), parent ); //blank analyzer to satisfy Grue + static_cast(analyzer)->setAlignment( Qt::AlignCenter ); break; default: diff --git a/amarok/src/analyzers/baranalyzer.cpp b/amarok/src/analyzers/baranalyzer.cpp index 61af801b..24a24c9c 100644 --- a/amarok/src/analyzers/baranalyzer.cpp +++ b/amarok/src/analyzers/baranalyzer.cpp @@ -14,10 +14,10 @@ #include "baranalyzer.h" #include //log10(), etc. #include "debug.h" -#include +#include -BarAnalyzer::BarAnalyzer( QWidget *parent ) +BarAnalyzer::BarAnalyzer( TQWidget *parent ) : Analyzer::Base2D( parent, 12, 8 ) //, m_bands( BAND_COUNT ) //, barVector( BAND_COUNT, 0 ) @@ -27,7 +27,7 @@ BarAnalyzer::BarAnalyzer( QWidget *parent ) //roof pixmaps don't depend on size() so we do in the ctor m_bg = parent->paletteBackgroundColor(); - QColor fg( 0xff, 0x50, 0x70 ); + TQColor fg( 0xff, 0x50, 0x70 ); #define m_bg backgroundColor() double dr = double(m_bg.red() - fg.red()) / (NUM_ROOFS-1); //-1 because we start loop below at 0 @@ -37,13 +37,13 @@ BarAnalyzer::BarAnalyzer( QWidget *parent ) for ( uint i = 0; i < NUM_ROOFS; ++i ) { m_pixRoof[i].resize( COLUMN_WIDTH, 1 ); - m_pixRoof[i].fill( QColor( fg.red()+int(dr*i), fg.green()+int(dg*i), fg.blue()+int(db*i) ) ); + m_pixRoof[i].fill( TQColor( fg.red()+int(dr*i), fg.green()+int(dg*i), fg.blue()+int(db*i) ) ); } #undef m_bg } -void BarAnalyzer::resizeEvent( QResizeEvent * e ) +void BarAnalyzer::resizeEvent( TQResizeEvent * e ) { debug() << "Baranalyzer Resized(" << width() << "x" << height() << ")" << endl; Analyzer::Base2D::resizeEvent( e ); @@ -80,7 +80,7 @@ void BarAnalyzer::init() m_pixBarGradient.resize( height()*COLUMN_WIDTH, height() ); m_pixCompose.resize( size() ); - QPainter p( &m_pixBarGradient ); + TQPainter p( &m_pixBarGradient ); for ( int x=0, r=0x40, g=0x30, b=0xff, r2=255-r; x < height(); ++x ) { @@ -88,14 +88,14 @@ void BarAnalyzer::init() { const double fraction = (double)y / height(); -// p.setPen( QColor( r + (int)(r2 * fraction), g, b - (int)(255 * fraction) ) ); - p.setPen( QColor( r + (int)(r2 * fraction), g, b ) ); +// p.setPen( TQColor( r + (int)(r2 * fraction), g, b - (int)(255 * fraction) ) ); + p.setPen( TQColor( r + (int)(r2 * fraction), g, b ) ); p.drawLine( x*COLUMN_WIDTH, height() - y, (x+1)*COLUMN_WIDTH, height() - y ); } } - setMinimumSize( QSize( BAND_COUNT * COLUMN_WIDTH, 10 ) ); + setMinimumSize( TQSize( BAND_COUNT * COLUMN_WIDTH, 10 ) ); } diff --git a/amarok/src/analyzers/baranalyzer.h b/amarok/src/analyzers/baranalyzer.h index f8869d5d..6eb470c8 100644 --- a/amarok/src/analyzers/baranalyzer.h +++ b/amarok/src/analyzers/baranalyzer.h @@ -14,7 +14,7 @@ typedef std::vector aroofMemVec; class BarAnalyzer : public Analyzer::Base2D { public: - BarAnalyzer( QWidget* ); + BarAnalyzer( TQWidget* ); void init(); virtual void analyze( const Scope& ); @@ -24,7 +24,7 @@ class BarAnalyzer : public Analyzer::Base2D * Resizes the widget to a new geometry according to @p e * @param e The resize-event */ - void resizeEvent( QResizeEvent * e); + void resizeEvent( TQResizeEvent * e); uint BAND_COUNT; int MAX_DOWN; @@ -35,7 +35,7 @@ class BarAnalyzer : public Analyzer::Base2D static const uint COLUMN_WIDTH = 4; protected: - QPixmap m_pixRoof[NUM_ROOFS]; + TQPixmap m_pixRoof[NUM_ROOFS]; //vector m_roofMem[BAND_COUNT]; //Scope m_bands; //copy of the Scope to prevent creating/destroying a Scope every iteration @@ -45,13 +45,13 @@ class BarAnalyzer : public Analyzer::Base2D std::vector roofVector; //positions of roofs std::vector roofVelocityVector; //speed that roofs falls - const QPixmap *gradient() const { return &m_pixBarGradient; } + const TQPixmap *gradient() const { return &m_pixBarGradient; } private: - QPixmap m_pixBarGradient; - QPixmap m_pixCompose; + TQPixmap m_pixBarGradient; + TQPixmap m_pixCompose; Scope m_scope; //so we don't create a vector every frame - QColor m_bg; + TQColor m_bg; }; #endif diff --git a/amarok/src/analyzers/blockanalyzer.cpp b/amarok/src/analyzers/blockanalyzer.cpp index f58bc832..886243d8 100644 --- a/amarok/src/analyzers/blockanalyzer.cpp +++ b/amarok/src/analyzers/blockanalyzer.cpp @@ -19,17 +19,17 @@ #include //mousePressEvent #include //mousePressEvent -#include //mousePressEvent -#include //paletteChange() +#include //mousePressEvent +#include //paletteChange() #include static inline uint myMax( uint v1, uint v2 ) { return v1 > v2 ? v1 : v2; } -namespace Amarok { extern KConfig *config( const QString& ); } +namespace Amarok { extern KConfig *config( const TQString& ); } -BlockAnalyzer::BlockAnalyzer( QWidget *parent ) +BlockAnalyzer::BlockAnalyzer( TQWidget *parent ) : Analyzer::Base2D( parent, 20, 9 ) , m_columns( 0 ) //uint , m_rows( 0 ) //uint @@ -38,7 +38,7 @@ BlockAnalyzer::BlockAnalyzer( QWidget *parent ) , m_topBarPixmap( WIDTH, HEIGHT ) , m_scope( MIN_COLUMNS ) //Scope , m_store( 1 << 8, 0 ) //vector - , m_fade_bars( FADE_SIZE ) //vector + , m_fade_bars( FADE_SIZE ) //vector , m_fade_pos( 1 << 8, 50 ) //vector , m_fade_intensity( 1 << 8, 32 ) //vector { @@ -58,9 +58,9 @@ BlockAnalyzer::~BlockAnalyzer() } void -BlockAnalyzer::resizeEvent( QResizeEvent *e ) +BlockAnalyzer::resizeEvent( TQResizeEvent *e ) { - QWidget::resizeEvent( e ); + TQWidget::resizeEvent( e ); canvas()->resize( size() ); background()->resize( size() ); @@ -223,21 +223,21 @@ adjustToLimits( int &b, int &f, uint &amount ) * @return the adjusted form of fg */ QColor -ensureContrast( const QColor &bg, const QColor &fg, uint _amount = 150 ) +ensureContrast( const TQColor &bg, const TQColor &fg, uint _amount = 150 ) { class OutputOnExit { public: - OutputOnExit( const QColor &color ) : c( color ) {} + OutputOnExit( const TQColor &color ) : c( color ) {} ~OutputOnExit() { int h,s,v; c.getHsv( &h, &s, &v ); } private: - const QColor &c; + const TQColor &c; }; // hack so I don't have to cast everywhere #define amount static_cast(_amount) -// #define STAMP debug() << (QValueList() << fh << fs << fv) << endl; -// #define STAMP1( string ) debug() << string << ": " << (QValueList() << fh << fs << fv) << endl; -// #define STAMP2( string, value ) debug() << string << "=" << value << ": " << (QValueList() << fh << fs << fv) << endl; +// #define STAMP debug() << (TQValueList() << fh << fs << fv) << endl; +// #define STAMP1( string ) debug() << string << ": " << (TQValueList() << fh << fs << fv) << endl; +// #define STAMP2( string, value ) debug() << string << "=" << value << ": " << (TQValueList() << fh << fs << fv) << endl; OutputOnExit allocateOnTheStack( fg ); @@ -319,28 +319,28 @@ ensureContrast( const QColor &bg, const QColor &fg, uint _amount = 150 ) // STAMP - return QColor( fh, fs, fv, QColor::Hsv ); + return TQColor( fh, fs, fv, TQColor::Hsv ); } // STAMP if( fv > bv && bv > amount ) - return QColor( fh, fs, bv - amount, QColor::Hsv ); + return TQColor( fh, fs, bv - amount, TQColor::Hsv ); // STAMP if( fv < bv && fv > amount ) - return QColor( fh, fs, fv - amount, QColor::Hsv ); + return TQColor( fh, fs, fv - amount, TQColor::Hsv ); // STAMP if( fv > bv && (255 - fv > amount) ) - return QColor( fh, fs, fv + amount, QColor::Hsv ); + return TQColor( fh, fs, fv + amount, TQColor::Hsv ); // STAMP if( fv < bv && (255 - bv > amount ) ) - return QColor( fh, fs, bv + amount, QColor::Hsv ); + return TQColor( fh, fs, bv + amount, TQColor::Hsv ); // STAMP // debug() << "Something went wrong!\n"; @@ -352,10 +352,10 @@ ensureContrast( const QColor &bg, const QColor &fg, uint _amount = 150 ) } void -BlockAnalyzer::paletteChange( const QPalette& ) //virtual +BlockAnalyzer::paletteChange( const TQPalette& ) //virtual { - const QColor bg = palette().active().background(); - const QColor fg = ensureContrast( bg, KGlobalSettings::activeTitleColor() ); + const TQColor bg = palette().active().background(); + const TQColor fg = ensureContrast( bg, KGlobalSettings::activeTitleColor() ); m_topBarPixmap.fill( fg ); @@ -366,18 +366,18 @@ BlockAnalyzer::paletteChange( const QPalette& ) //virtual bar()->fill( bg ); - QPainter p( bar() ); + TQPainter p( bar() ); for( int y = 0; (uint)y < m_rows; ++y ) //graduate the fg color - p.fillRect( 0, y*(HEIGHT+1), WIDTH, HEIGHT, QColor( r+int(dr*y), g+int(dg*y), b+int(db*y) ) ); + p.fillRect( 0, y*(HEIGHT+1), WIDTH, HEIGHT, TQColor( r+int(dr*y), g+int(dg*y), b+int(db*y) ) ); { - const QColor bg = palette().active().background().dark( 112 ); + const TQColor bg = palette().active().background().dark( 112 ); //make a complimentary fadebar colour //TODO dark is not always correct, dumbo! int h,s,v; palette().active().background().dark( 150 ).getHsv( &h, &s, &v ); - const QColor fg( h + 120, s, v, QColor::Hsv ); + const TQColor fg( h + 120, s, v, TQColor::Hsv ); const double dr = fg.red() - bg.red(); const double dg = fg.green() - bg.green(); @@ -387,10 +387,10 @@ BlockAnalyzer::paletteChange( const QPalette& ) //virtual // Precalculate all fade-bar pixmaps for( uint y = 0; y < FADE_SIZE; ++y ) { m_fade_bars[y].fill( palette().active().background() ); - QPainter f( &m_fade_bars[y] ); + TQPainter f( &m_fade_bars[y] ); for( int z = 0; (uint)z < m_rows; ++z ) { const double Y = 1.0 - (log10( FADE_SIZE - y ) / log10( FADE_SIZE )); - f.fillRect( 0, z*(HEIGHT+1), WIDTH, HEIGHT, QColor( r+int(dr*Y), g+int(dg*Y), b+int(db*Y) ) ); + f.fillRect( 0, z*(HEIGHT+1), WIDTH, HEIGHT, TQColor( r+int(dr*Y), g+int(dg*Y), b+int(db*Y) ) ); } } } @@ -401,12 +401,12 @@ BlockAnalyzer::paletteChange( const QPalette& ) //virtual void BlockAnalyzer::drawBackground() { - const QColor bg = palette().active().background(); - const QColor bgdark = bg.dark( 112 ); + const TQColor bg = palette().active().background(); + const TQColor bgdark = bg.dark( 112 ); background()->fill( bg ); - QPainter p( background() ); + TQPainter p( background() ); for( int x = 0; (uint)x < m_columns; ++x ) for( int y = 0; (uint)y < m_rows; ++y ) p.fillRect( x*(WIDTH+1), y*(HEIGHT+1) + m_y, WIDTH, HEIGHT, bgdark ); @@ -415,7 +415,7 @@ BlockAnalyzer::drawBackground() } void -BlockAnalyzer::contextMenuEvent( QContextMenuEvent *e ) +BlockAnalyzer::contextMenuEvent( TQContextMenuEvent *e ) { //this is hard to read in order to be compact, apologies.. //the id of each menu item is the value of the attribute it represents, diff --git a/amarok/src/analyzers/blockanalyzer.h b/amarok/src/analyzers/blockanalyzer.h index a03c99e0..68aaedd9 100644 --- a/amarok/src/analyzers/blockanalyzer.h +++ b/amarok/src/analyzers/blockanalyzer.h @@ -6,11 +6,11 @@ #define BLOCKANALYZER_H #include "analyzerbase.h" -#include +#include -class QResizeEvent; -class QMouseEvent; -class QPalette; +class TQResizeEvent; +class TQMouseEvent; +class TQPalette; /** @@ -20,7 +20,7 @@ class QPalette; class BlockAnalyzer : public Analyzer::Base2D { public: - BlockAnalyzer( QWidget* ); + BlockAnalyzer( TQWidget* ); ~BlockAnalyzer(); static const uint HEIGHT = 2; @@ -33,26 +33,26 @@ public: protected: virtual void transform( Scope& ); virtual void analyze( const Scope& ); - virtual void resizeEvent( QResizeEvent* ); - virtual void contextMenuEvent( QContextMenuEvent* ); - virtual void paletteChange( const QPalette& ); + virtual void resizeEvent( TQResizeEvent* ); + virtual void contextMenuEvent( TQContextMenuEvent* ); + virtual void paletteChange( const TQPalette& ); void drawBackground(); void determineStep(); private: - QPixmap* const bar() { return &m_barPixmap; } + TQPixmap* const bar() { return &m_barPixmap; } uint m_columns, m_rows; //number of rows and columns of blocks uint m_y; //y-offset from top of widget - QPixmap m_barPixmap; - QPixmap m_topBarPixmap; + TQPixmap m_barPixmap; + TQPixmap m_topBarPixmap; Scope m_scope; //so we don't create a vector every frame std::vector m_store; //current bar heights std::vector m_yscale; //FIXME why can't I namespace these? c++ issue? - std::vector m_fade_bars; + std::vector m_fade_bars; std::vector m_fade_pos; std::vector m_fade_intensity; diff --git a/amarok/src/analyzers/boomanalyzer.cpp b/amarok/src/analyzers/boomanalyzer.cpp index 1f9d8c71..3505c82c 100644 --- a/amarok/src/analyzers/boomanalyzer.cpp +++ b/amarok/src/analyzers/boomanalyzer.cpp @@ -4,13 +4,13 @@ #include "amarok.h" #include "boomanalyzer.h" #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -BoomAnalyzer::BoomAnalyzer( QWidget *parent ) +BoomAnalyzer::BoomAnalyzer( TQWidget *parent ) : Analyzer::Base2D( parent, 10, 9 ) , K_barHeight( 1.271 )//1.471 , F_peakSpeed( 1.103 )//1.122 @@ -20,25 +20,25 @@ BoomAnalyzer::BoomAnalyzer( QWidget *parent ) , peak_speed( BAND_COUNT, 0.01 ) , barPixmap( COLUMN_WIDTH, 50 ) { - QWidget *o, *box = new QWidget( this, 0, WType_TopLevel ); - QSpinBox *m; + TQWidget *o, *box = new TQWidget( this, 0, WType_TopLevel ); + TQSpinBox *m; int v; - (new QGridLayout( box, 2, 3 ))->setAutoAdd( true ); + (new TQGridLayout( box, 2, 3 ))->setAutoAdd( true ); v = int(K_barHeight*1000); - new QLabel( "Bar fall-rate:", box ); - o = new QSlider( 100, 2000, 100, v, Qt::Horizontal, box ); - (m = new QSpinBox( 100, 2000, 1, box ))->setValue( v ); - connect( o, SIGNAL(valueChanged(int)), SLOT(changeK_barHeight( int )) ); - connect( o, SIGNAL(valueChanged(int)), m, SLOT(setValue( int )) ); + new TQLabel( "Bar fall-rate:", box ); + o = new TQSlider( 100, 2000, 100, v, Qt::Horizontal, box ); + (m = new TQSpinBox( 100, 2000, 1, box ))->setValue( v ); + connect( o, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changeK_barHeight( int )) ); + connect( o, TQT_SIGNAL(valueChanged(int)), m, TQT_SLOT(setValue( int )) ); v = int(F_peakSpeed*1000); - new QLabel( "Peak acceleration: ", box ); - o = new QSlider( 1000, 1300, 50, v, Qt::Horizontal, box ); - (m = new QSpinBox( 1000, 1300, 1, box ))->setValue( v ); - connect( o, SIGNAL(valueChanged(int)), SLOT(changeF_peakSpeed( int )) ); - connect( o, SIGNAL(valueChanged(int)), m, SLOT(setValue( int )) ); + new TQLabel( "Peak acceleration: ", box ); + o = new TQSlider( 1000, 1300, 50, v, Qt::Horizontal, box ); + (m = new TQSpinBox( 1000, 1300, 1, box ))->setValue( v ); + connect( o, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changeF_peakSpeed( int )) ); + connect( o, TQT_SIGNAL(valueChanged(int)), m, TQT_SLOT(setValue( int )) ); //box->show(); } @@ -66,12 +66,12 @@ BoomAnalyzer::init() barPixmap.resize( COLUMN_WIDTH-2, HEIGHT ); - QPainter p( &barPixmap ); + TQPainter p( &barPixmap ); for( uint y = 0; y < HEIGHT; ++y ) { const double F = (double)y * h; - p.setPen( QColor( 255 - int(229.0 * F), 255 - int(229.0 * F), 255 - int(191.0 * F) ) ); + p.setPen( TQColor( 255 - int(229.0 * F), 255 - int(229.0 * F), 255 - int(191.0 * F) ) ); p.drawLine( 0, y, COLUMN_WIDTH-2, y ); } } @@ -101,7 +101,7 @@ BoomAnalyzer::analyze( const Scope &scope ) { eraseCanvas(); - QPainter p( canvas() ); + TQPainter p( canvas() ); float h; const uint MAX_HEIGHT = height() - 1; diff --git a/amarok/src/analyzers/boomanalyzer.h b/amarok/src/analyzers/boomanalyzer.h index 55c5ec3a..37007649 100644 --- a/amarok/src/analyzers/boomanalyzer.h +++ b/amarok/src/analyzers/boomanalyzer.h @@ -15,7 +15,7 @@ class BoomAnalyzer : public Analyzer::Base2D { Q_OBJECT public: - BoomAnalyzer( QWidget* ); + BoomAnalyzer( TQWidget* ); virtual void init(); virtual void transform( Scope &s ); @@ -35,17 +35,17 @@ protected: std::vector peak_height; std::vector peak_speed; - QPixmap barPixmap; + TQPixmap barPixmap; }; namespace Amarok { namespace ColorScheme { - extern QColor Base; - extern QColor Text; - extern QColor Background; - extern QColor Foreground; + extern TQColor Base; + extern TQColor Text; + extern TQColor Background; + extern TQColor Foreground; } } diff --git a/amarok/src/analyzers/glanalyzer.cpp b/amarok/src/analyzers/glanalyzer.cpp index ec8a6bc4..21382efe 100644 --- a/amarok/src/analyzers/glanalyzer.cpp +++ b/amarok/src/analyzers/glanalyzer.cpp @@ -24,7 +24,7 @@ #include -GLAnalyzer::GLAnalyzer( QWidget *parent ) +GLAnalyzer::GLAnalyzer( TQWidget *parent ) : Analyzer::Base3D(parent, 15) , m_oldy(32, -10.0f) , m_peaks(32) diff --git a/amarok/src/analyzers/glanalyzer.h b/amarok/src/analyzers/glanalyzer.h index 394c4638..d25583f5 100644 --- a/amarok/src/analyzers/glanalyzer.h +++ b/amarok/src/analyzers/glanalyzer.h @@ -48,7 +48,7 @@ private: GLfloat x, y; public: - GLAnalyzer(QWidget *); + GLAnalyzer(TQWidget *); ~GLAnalyzer(); void analyze( const Scope & ); diff --git a/amarok/src/analyzers/glanalyzer2.cpp b/amarok/src/analyzers/glanalyzer2.cpp index 6f3d1c83..bee9b816 100644 --- a/amarok/src/analyzers/glanalyzer2.cpp +++ b/amarok/src/analyzers/glanalyzer2.cpp @@ -24,11 +24,11 @@ #include "glanalyzer2.h" #include #include -#include +#include #include -GLAnalyzer2::GLAnalyzer2( QWidget *parent ): +GLAnalyzer2::GLAnalyzer2( TQWidget *parent ): Analyzer::Base3D(parent, 15) { //initialize openGL context before managing GL calls @@ -297,18 +297,18 @@ void GLAnalyzer2::setTextureMatrix( float rot, float scale ) glMatrixMode( GL_MODELVIEW ); } -bool GLAnalyzer2::loadTexture( QString fileName, GLuint& textureID ) +bool GLAnalyzer2::loadTexture( TQString fileName, GLuint& textureID ) { //reset texture ID to the default EMPTY value textureID = 0; //load image - QImage tmp; + TQImage tmp; if ( !tmp.load( fileName ) ) return false; //convert it to suitable format (flipped RGBA) - QImage texture = QGLWidget::convertToGLFormat( tmp ); + TQImage texture = TQGLWidget::convertToGLFormat( tmp ); if ( texture.isNull() ) return false; diff --git a/amarok/src/analyzers/glanalyzer2.h b/amarok/src/analyzers/glanalyzer2.h index 3aeb98ae..77ef9c9d 100644 --- a/amarok/src/analyzers/glanalyzer2.h +++ b/amarok/src/analyzers/glanalyzer2.h @@ -22,14 +22,14 @@ #ifdef HAVE_QGLWIDGET #include "analyzerbase.h" -#include -#include +#include +#include class GLAnalyzer2 : public Analyzer::Base3D { public: - GLAnalyzer2(QWidget *); + GLAnalyzer2(TQWidget *); ~GLAnalyzer2(); void analyze( const Scope & ); void paused(); @@ -65,7 +65,7 @@ private: void drawFullDot( float r, float g, float b, float a ); void setTextureMatrix( float rot, float scale ); - bool loadTexture(QString file, GLuint& textureID); + bool loadTexture(TQString file, GLuint& textureID); void freeTexture(GLuint& textureID); }; diff --git a/amarok/src/analyzers/glanalyzer3.cpp b/amarok/src/analyzers/glanalyzer3.cpp index cc7ce4c7..7a69301a 100644 --- a/amarok/src/analyzers/glanalyzer3.cpp +++ b/amarok/src/analyzers/glanalyzer3.cpp @@ -24,7 +24,7 @@ #include "glanalyzer3.h" #include #include -#include +#include #include #ifndef HAVE_FABSF @@ -121,7 +121,7 @@ class Paddle }; -GLAnalyzer3::GLAnalyzer3( QWidget *parent ): +GLAnalyzer3::GLAnalyzer3( TQWidget *parent ): Analyzer::Base3D(parent, 15) { //initialize openGL context before managing GL calls @@ -445,18 +445,18 @@ void GLAnalyzer3::drawScrollGrid( float scroll, float color[4] ) glMatrixMode( GL_MODELVIEW ); } -bool GLAnalyzer3::loadTexture( QString fileName, GLuint& textureID ) +bool GLAnalyzer3::loadTexture( TQString fileName, GLuint& textureID ) { //reset texture ID to the default EMPTY value textureID = 0; //load image - QImage tmp; + TQImage tmp; if ( !tmp.load( fileName ) ) return false; //convert it to suitable format (flipped RGBA) - QImage texture = QGLWidget::convertToGLFormat( tmp ); + TQImage texture = TQGLWidget::convertToGLFormat( tmp ); if ( texture.isNull() ) return false; diff --git a/amarok/src/analyzers/glanalyzer3.h b/amarok/src/analyzers/glanalyzer3.h index 7abd7614..e33009c5 100644 --- a/amarok/src/analyzers/glanalyzer3.h +++ b/amarok/src/analyzers/glanalyzer3.h @@ -22,17 +22,17 @@ #define GLBOUNCER_H #include "analyzerbase.h" -#include -#include +#include +#include -class QWidget; +class TQWidget; class Ball; class Paddle; class GLAnalyzer3 : public Analyzer::Base3D { public: - GLAnalyzer3(QWidget *); + GLAnalyzer3(TQWidget *); ~GLAnalyzer3(); void analyze( const Scope & ); void paused(); @@ -62,7 +62,7 @@ private: static const int NUMBER_OF_BALLS = 16; - QPtrList balls; + TQPtrList balls; Paddle * leftPaddle, * rightPaddle; float unitX, unitY; GLuint ballTexture; @@ -72,7 +72,7 @@ private: void drawHFace( float y ); void drawScrollGrid( float scroll, float color[4] ); - bool loadTexture(QString file, GLuint& textureID); + bool loadTexture(TQString file, GLuint& textureID); void freeTexture(GLuint& textureID); }; diff --git a/amarok/src/analyzers/sonogram.cpp b/amarok/src/analyzers/sonogram.cpp index b29563db..60e7749c 100644 --- a/amarok/src/analyzers/sonogram.cpp +++ b/amarok/src/analyzers/sonogram.cpp @@ -11,10 +11,10 @@ // // -#include +#include #include "sonogram.h" -Sonogram::Sonogram(QWidget *parent) : +Sonogram::Sonogram(TQWidget *parent) : Analyzer::Base2D(parent, 16, 9) { } @@ -31,9 +31,9 @@ void Sonogram::init() } -void Sonogram::resizeEvent(QResizeEvent *e) +void Sonogram::resizeEvent(TQResizeEvent *e) { - QWidget::resizeEvent(e); + TQWidget::resizeEvent(e); canvas()->resize(size()); background()->resize(size()); @@ -51,8 +51,8 @@ void Sonogram::resizeEvent(QResizeEvent *e) void Sonogram::analyze(const Scope &s) { int x = width() - 1; - QColor c; - QPainter p(canvas()); + TQColor c; + TQPainter p(canvas()); bitBlt(canvas(), 0, 0, canvas(), 1, 0, x, height()); Scope::const_iterator it = s.begin(), end = s.end(); diff --git a/amarok/src/analyzers/sonogram.h b/amarok/src/analyzers/sonogram.h index 609c9b2c..09075a6e 100644 --- a/amarok/src/analyzers/sonogram.h +++ b/amarok/src/analyzers/sonogram.h @@ -23,7 +23,7 @@ class Sonogram : public Analyzer::Base2D { public: - Sonogram(QWidget*); + Sonogram(TQWidget*); ~Sonogram(); protected: @@ -31,7 +31,7 @@ protected: void analyze(const Scope&); void transform(Scope&); void demo(); - void resizeEvent(QResizeEvent*); + void resizeEvent(TQResizeEvent*); }; #endif diff --git a/amarok/src/analyzers/turbine.cpp b/amarok/src/analyzers/turbine.cpp index d2e75640..43b013c4 100644 --- a/amarok/src/analyzers/turbine.cpp +++ b/amarok/src/analyzers/turbine.cpp @@ -8,7 +8,7 @@ // #include -#include +#include #include "amarok.h" #include "turbine.h" @@ -17,7 +17,7 @@ void TurbineAnalyzer::analyze( const Scope &scope ) { eraseCanvas(); - QPainter p( canvas() ); + TQPainter p( canvas() ); float h; const uint hd2 = height() / 2; const uint MAX_HEIGHT = hd2 - 1; diff --git a/amarok/src/analyzers/turbine.h b/amarok/src/analyzers/turbine.h index d75c6053..6ad34fbc 100644 --- a/amarok/src/analyzers/turbine.h +++ b/amarok/src/analyzers/turbine.h @@ -14,7 +14,7 @@ class TurbineAnalyzer : public BoomAnalyzer { public: - TurbineAnalyzer( QWidget *parent ) : BoomAnalyzer( parent ) {} + TurbineAnalyzer( TQWidget *parent ) : BoomAnalyzer( parent ) {} void analyze( const Scope& ); }; diff --git a/amarok/src/app.cpp b/amarok/src/app.cpp index 8a8ebaa8..4cd964d8 100644 --- a/amarok/src/app.cpp +++ b/amarok/src/app.cpp @@ -68,15 +68,15 @@ email : markey@web.de #include #include -#include //genericEventHandler() -#include //applySettings() -#include -#include //applyColorScheme() -#include //applyColorScheme() -#include //QPixmap::setDefaultOptimization() -#include //genericEventHandler -#include //showHyperThreadingWarning() -#include //default tooltip for trayicon +#include //genericEventHandler() +#include //applySettings() +#include +#include //applyColorScheme() +#include //applyColorScheme() +#include //TQPixmap::setDefaultOptimization() +#include //genericEventHandler +#include //showHyperThreadingWarning() +#include //default tooltip for trayicon // For the HyperThreading fix #ifdef __linux__ @@ -86,8 +86,8 @@ email : markey@web.de #endif //SCHEDAFFINITY_SUPPORT #endif //__linux__ -QMutex Debug::mutex; -QMutex Amarok::globalDirsMutex; +TQMutex Debug::mutex; +TQMutex Amarok::globalDirsMutex; int App::mainThreadId = 0; @@ -153,12 +153,12 @@ App::App() char bundlePath[1024]; if( CFURLGetFileSystemRepresentation( urlRef, true, (UInt8 *)bundlePath, sizeof(bundlePath) ) ) { - QCString bp( bundlePath ); + TQCString bp( bundlePath ); size_t len = bp.length(); if( len > 4 && bp.right( 4 ) == ".app" ) { bp.append( "/Contents/MacOS" ); - QCString path = getenv( "PATH" ); + TQCString path = getenv( "PATH" ); if( path.length() > 0 ) { path.prepend( ":" ); @@ -174,7 +174,7 @@ App::App() } #endif - QPixmap::setDefaultOptimization( QPixmap::MemoryOptim ); + TQPixmap::setDefaultOptimization( TQPixmap::MemoryOptim ); //needs to be created before the wizard new Amarok::DcopPlayerHandler(); // Must be created first @@ -197,7 +197,7 @@ App::App() AEInstallEventHandler(kCoreEventClass, kAEReopenApplication, appleEventProcessorUPP, (long)this, true); #endif - QTimer::singleShot( 0, this, SLOT( continueInit() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( continueInit() ) ); } App::~App() @@ -214,7 +214,7 @@ App::~App() AmarokConfig::setResumeTrack( EngineController::instance()->playingURL().prettyURL() ); AmarokConfig::setResumeTime( engine->position() ); } - else AmarokConfig::setResumeTrack( QString::null ); //otherwise it'll play previous resume next time! + else AmarokConfig::setResumeTrack( TQString::null ); //otherwise it'll play previous resume next time! } EngineController::instance()->endSession(); //records final statistics @@ -231,7 +231,7 @@ App::~App() ThreadManager::deleteInstance(); //waits for jobs to finish // this must be deleted before the connection to the Xserver is - // severed, or we risk a crash when the QApplication is exited, + // severed, or we risk a crash when the TQApplication is exited, // I asked Trolltech! *smug* delete Amarok::OSD::instance(); @@ -244,24 +244,24 @@ App::~App() #include -#include +#include namespace { // grabbed from KsCD source, kompatctdisk.cpp - QString urlToDevice(const QString& device) + TQString urlToDevice(const TQString& device) { KURL deviceUrl(device); if (deviceUrl.protocol() == "media" || deviceUrl.protocol() == "system") { DCOPRef mediamanager( "kded", "mediamanager" ); - DCOPReply reply = mediamanager.call( "properties(QString)", deviceUrl.fileName() ); - QStringList properties = reply; + DCOPReply reply = mediamanager.call( "properties(TQString)", deviceUrl.fileName() ); + TQStringList properties = reply; if (!reply.isValid() || properties.count() < 6) { debug() << "Invalid reply from mediamanager" << endl; - return QString(); + return TQString(); } else { @@ -355,7 +355,7 @@ void App::handleCliArgs() //static else if (args->isSet("cdplay")) { haveArgs = true; - QString device = args->getOption("cdplay"); + TQString device = args->getOption("cdplay"); device = DeviceManager::instance()->convertMediaUrlToDevice( device ); KURL::List urls; if (EngineController::engine()->getAudioCDContents(device, urls)) { @@ -434,48 +434,48 @@ void App::initGlobalShortcuts() EngineController* const ec = EngineController::instance(); m_pGlobalAccel->insert( "play", i18n( "Play" ), 0, KKey("WIN+x"), 0, - ec, SLOT( play() ), true, true ); + ec, TQT_SLOT( play() ), true, true ); m_pGlobalAccel->insert( "pause", i18n( "Pause" ), 0, 0, 0, - ec, SLOT( pause() ), true, true ); + ec, TQT_SLOT( pause() ), true, true ); m_pGlobalAccel->insert( "play_pause", i18n( "Play/Pause" ), 0, KKey("WIN+c"), 0, - ec, SLOT( playPause() ), true, true ); + ec, TQT_SLOT( playPause() ), true, true ); m_pGlobalAccel->insert( "stop", i18n( "Stop" ), 0, KKey("WIN+v"), 0, - ec, SLOT( stop() ), true, true ); + ec, TQT_SLOT( stop() ), true, true ); m_pGlobalAccel->insert( "stop_after_global", i18n( "Stop Playing After Current Track" ), 0, KKey("WIN+CTRL+v"), 0, - Playlist::instance()->qscrollview(), SLOT( toggleStopAfterCurrentTrack() ), true, true ); + Playlist::instance()->qscrollview(), TQT_SLOT( toggleStopAfterCurrentTrack() ), true, true ); m_pGlobalAccel->insert( "next", i18n( "Next Track" ), 0, KKey("WIN+b"), 0, - ec, SLOT( next() ), true, true ); + ec, TQT_SLOT( next() ), true, true ); m_pGlobalAccel->insert( "prev", i18n( "Previous Track" ), 0, KKey("WIN+z"), 0, - ec, SLOT( previous() ), true, true ); + ec, TQT_SLOT( previous() ), true, true ); m_pGlobalAccel->insert( "volup", i18n( "Increase Volume" ), 0, KKey("WIN+KP_Add"), 0, - ec, SLOT( increaseVolume() ), true, true ); + ec, TQT_SLOT( increaseVolume() ), true, true ); m_pGlobalAccel->insert( "voldn", i18n( "Decrease Volume" ), 0, KKey("WIN+KP_Subtract"), 0, - ec, SLOT( decreaseVolume() ), true, true ); + ec, TQT_SLOT( decreaseVolume() ), true, true ); m_pGlobalAccel->insert( "seekforward", i18n( "Seek Forward" ), 0, KKey("WIN+Shift+KP_Add"), 0, - ec, SLOT( seekForward() ), true, true ); + ec, TQT_SLOT( seekForward() ), true, true ); m_pGlobalAccel->insert( "seekbackward", i18n( "Seek Backward" ), 0, KKey("WIN+Shift+KP_Subtract"), 0, - ec, SLOT( seekBackward() ), true, true ); + ec, TQT_SLOT( seekBackward() ), true, true ); m_pGlobalAccel->insert( "playlist_add", i18n( "Add Media..." ), 0, KKey("WIN+a"), 0, - m_pPlaylistWindow, SLOT( slotAddLocation() ), true, true ); + m_pPlaylistWindow, TQT_SLOT( slotAddLocation() ), true, true ); m_pGlobalAccel->insert( "show", i18n( "Toggle Playlist Window" ), 0, KKey("WIN+p"), 0, - m_pPlaylistWindow, SLOT( showHide() ), true, true ); + m_pPlaylistWindow, TQT_SLOT( showHide() ), true, true ); #ifdef Q_WS_X11 m_pGlobalAccel->insert( "osd", i18n( "Show OSD" ), 0, KKey("WIN+o"), 0, - Amarok::OSD::instance(), SLOT( forceToggleOSD() ), true, true ); + Amarok::OSD::instance(), TQT_SLOT( forceToggleOSD() ), true, true ); #endif m_pGlobalAccel->insert( "mute", i18n( "Mute Volume" ), 0, KKey("WIN+m"), 0, - ec, SLOT( mute() ), true, true ); + ec, TQT_SLOT( mute() ), true, true ); m_pGlobalAccel->insert( "rating1", i18n( "Rate Current Track: 1" ), 0, KKey("WIN+1"), 0, - this, SLOT( setRating1() ), true, true ); + this, TQT_SLOT( setRating1() ), true, true ); m_pGlobalAccel->insert( "rating2", i18n( "Rate Current Track: 2" ), 0, KKey("WIN+2"), 0, - this, SLOT( setRating2() ), true, true ); + this, TQT_SLOT( setRating2() ), true, true ); m_pGlobalAccel->insert( "rating3", i18n( "Rate Current Track: 3" ), 0, KKey("WIN+3"), 0, - this, SLOT( setRating3() ), true, true ); + this, TQT_SLOT( setRating3() ), true, true ); m_pGlobalAccel->insert( "rating4", i18n( "Rate Current Track: 4" ), 0, KKey("WIN+4"), 0, - this, SLOT( setRating4() ), true, true ); + this, TQT_SLOT( setRating4() ), true, true ); m_pGlobalAccel->insert( "rating5", i18n( "Rate Current Track: 5" ), 0, KKey("WIN+5"), 0, - this, SLOT( setRating5() ), true, true ); + this, TQT_SLOT( setRating5() ), true, true ); m_pGlobalAccel->setConfigGroup( "Shortcuts" ); m_pGlobalAccel->readSettings( kapp->config() ); @@ -515,9 +515,9 @@ void App::fixHyperThreading() DEBUG_BLOCK #ifdef __linux__ - QString line; + TQString line; uint cpuCount = 0; - QFile cpuinfo( "/proc/cpuinfo" ); + TQFile cpuinfo( "/proc/cpuinfo" ); if ( cpuinfo.open( IO_ReadOnly ) ) { while ( cpuinfo.readLine( line, 20000 ) != -1 ) { if ( line.startsWith( "flags" ) ) @@ -540,12 +540,12 @@ void App::fixHyperThreading() #endif //SCHEDAFFINITY_3PARAMS { warning() << "sched_setaffinity() call failed with error code: " << errno << endl; - QTimer::singleShot( 0, this, SLOT( showHyperThreadingWarning() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( showHyperThreadingWarning() ) ); return; } #else //SCHEDAFFINITY_SUPPORT warning()<<"glibc failed checks for sched_setaffinity" << endl; - QTimer::singleShot( 0, this, SLOT( showHyperThreadingWarning() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( showHyperThreadingWarning() ) ); #endif //SCHEDAFFINITY_SUPPORT } else { debug() << "Workaround not enabled" << endl; } @@ -557,7 +557,7 @@ void App::fixHyperThreading() void App::showHyperThreadingWarning() // SLOT { - const QString text = + const TQString text = i18n( "

You are using a system with multiple CPUs. " "Please note that Amarok may be unstable with this " "configuration.

" @@ -576,14 +576,14 @@ void App::showHyperThreadingWarning() // SLOT #include #include -#include +#include //this class is only used in this module, so I figured I may as well define it //here and save creating another header/source file combination class ID3v1StringHandler : public TagLib::ID3v1::StringHandler { - QTextCodec *m_codec; + TQTextCodec *m_codec; virtual TagLib::String parse( const TagLib::ByteVector &data ) const { @@ -592,19 +592,19 @@ class ID3v1StringHandler : public TagLib::ID3v1::StringHandler virtual TagLib::ByteVector render( const TagLib::String &ts ) const { - const QCString qcs = m_codec->fromUnicode( TStringToQString(ts) ); + const TQCString qcs = m_codec->fromUnicode( TStringToQString(ts) ); return TagLib::ByteVector( qcs, qcs.length() ); } public: ID3v1StringHandler( int codecIndex ) - : m_codec( QTextCodec::codecForIndex( codecIndex ) ) + : m_codec( TQTextCodec::codecForIndex( codecIndex ) ) { debug() << "codec: " << m_codec << endl; debug() << "codec-name: " << m_codec->name() << endl; } - ID3v1StringHandler( QTextCodec *codec ) + ID3v1StringHandler( TQTextCodec *codec ) : m_codec( codec ) { debug() << "codec: " << m_codec << endl; @@ -642,7 +642,7 @@ void App::applySettings( bool firstTime ) if( !firstTime ) m_pPlayerWindow->show(); - connect( m_pPlayerWindow, SIGNAL(playlistToggled( bool )), m_pPlaylistWindow, SLOT(showHide()) ); + connect( m_pPlayerWindow, TQT_SIGNAL(playlistToggled( bool )), m_pPlaylistWindow, TQT_SLOT(showHide()) ); #ifdef Q_WS_X11 //TODO get this to work! @@ -699,7 +699,7 @@ void App::applySettings( bool firstTime ) //on startup we need to show the window, but only if it wasn't hidden on exit //and always if the trayicon isn't showing - QWidget* main_window = mainWindow(); + TQWidget* main_window = mainWindow(); #ifdef Q_WS_X11 if( ( main_window && firstTime && !Amarok::config()->readBoolEntry( "HiddenOnExit", false ) ) || ( main_window && !AmarokConfig::showTrayIcon() ) ) #endif @@ -707,7 +707,7 @@ void App::applySettings( bool firstTime ) main_window->show(); //takes longer but feels shorter. Crazy eh? :) - kapp->eventLoop()->processEvents( QEventLoop::ExcludeUserInput ); + kapp->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput ); } @@ -739,12 +739,12 @@ void App::applySettings( bool firstTime ) } // { // delete unneeded cover images from cache - const QString size = QString::number( AmarokConfig::coverPreviewSize() ) + '@'; - const QDir cacheDir = Amarok::saveLocation( "albumcovers/cache/" ); - const QStringList obsoleteCovers = cacheDir.entryList( "*" ); + const TQString size = TQString::number( AmarokConfig::coverPreviewSize() ) + '@'; + const TQDir cacheDir = Amarok::saveLocation( "albumcovers/cache/" ); + const TQStringList obsoleteCovers = cacheDir.entryList( "*" ); foreach( obsoleteCovers ) if ( !(*it).startsWith( size ) && !(*it).startsWith( "50@" ) ) - QFile( cacheDir.filePath( *it ) ).remove(); + TQFile( cacheDir.filePath( *it ) ).remove(); } //if ( !firstTime ) @@ -767,7 +767,7 @@ App::continueInit() MoodServer::instance(); // Remember old folder setup, so we can detect changes after the wizard was used - //const QStringList oldCollectionFolders = MountPointManager::instance()->collectionFolders(); + //const TQStringList oldCollectionFolders = MountPointManager::instance()->collectionFolders(); if ( Amarok::config()->readBoolEntry( "First Run", true ) || args->isSet( "wizard" ) ) { @@ -787,7 +787,7 @@ App::continueInit() #endif m_pPlaylistWindow->init(); //creates the playlist, browsers, etc. //init playlist window as soon as the database is guaranteed to be usable - //connect( CollectionDB::instance(), SIGNAL( databaseUpdateDone() ), m_pPlaylistWindow, SLOT( init() ) ); + //connect( CollectionDB::instance(), TQT_SIGNAL( databaseUpdateDone() ), m_pPlaylistWindow, TQT_SLOT( init() ) ); initGlobalShortcuts(); //load previous playlist in separate thread if ( restoreSession && AmarokConfig::savePlaylist() ) @@ -798,7 +798,7 @@ App::continueInit() } if( args->isSet( "engine" ) ) { // we correct some common errors (case issues, missing -engine off the end) - QString engine = args->getOption( "engine" ).lower(); + TQString engine = args->getOption( "engine" ).lower(); if( engine.startsWith( "gstreamer" ) ) engine = "gst-engine"; if( !engine.endsWith( "engine" ) ) engine += "-engine"; @@ -815,7 +815,7 @@ App::continueInit() std::cout << "STARTUP\n" << std::flush; //after this point only analyzer and temporary pixmaps will be created - QPixmap::setDefaultOptimization( QPixmap::BestOptim ); + TQPixmap::setDefaultOptimization( TQPixmap::BestOptim ); //do after applySettings(), or the OSD will flicker and other wierdness! //do before restoreSession()! @@ -838,11 +838,11 @@ App::continueInit() // (e.g. deleted collection.db) if ( CollectionDB::instance()->isEmpty() ) { - //connect( collDB, SIGNAL( databaseUpdateDone() ), collDB, SLOT( startScan() ) ); + //connect( collDB, TQT_SIGNAL( databaseUpdateDone() ), collDB, TQT_SLOT( startScan() ) ); collDB->startScan(); } else if ( AmarokConfig::monitorChanges() ) - //connect( collDB, SIGNAL( databaseUpdateDone() ), collDB, SLOT( scanModifiedDirs() ) ); + //connect( collDB, TQT_SIGNAL( databaseUpdateDone() ), collDB, TQT_SLOT( scanModifiedDirs() ) ); collDB->scanModifiedDirs(); @@ -852,11 +852,11 @@ App::continueInit() void App::applyColorScheme() { - QColorGroup group; + TQColorGroup group; using Amarok::ColorScheme::AltBase; int h, s, v; - QWidget* const browserBar = static_cast( playlistWindow()->child( "BrowserBar" ) ); - QWidget* const contextBrowser = static_cast( ContextBrowser::instance() ); + TQWidget* const browserBar = static_cast( playlistWindow()->child( "BrowserBar" ) ); + TQWidget* const contextBrowser = static_cast( ContextBrowser::instance() ); if( AmarokConfig::schemeKDE() ) { @@ -871,31 +871,31 @@ App::applyColorScheme() else if( AmarokConfig::schemeAmarok() ) { - group = QApplication::palette().active(); - const QColor bg( Amarok::blue ); + group = TQApplication::palette().active(); + const TQColor bg( Amarok::blue ); AltBase.setRgb( 57, 64, 98 ); - group.setColor( QColorGroup::Text, Qt::white ); - group.setColor( QColorGroup::Link, 0xCCCCCC ); - group.setColor( QColorGroup::Base, bg ); - group.setColor( QColorGroup::Foreground, 0xd7d7ef ); - group.setColor( QColorGroup::Background, AltBase ); + group.setColor( TQColorGroup::Text, Qt::white ); + group.setColor( TQColorGroup::Link, 0xCCCCCC ); + group.setColor( TQColorGroup::Base, bg ); + group.setColor( TQColorGroup::Foreground, 0xd7d7ef ); + group.setColor( TQColorGroup::Background, AltBase ); - group.setColor( QColorGroup::Button, AltBase ); - group.setColor( QColorGroup::ButtonText, 0xd7d7ef ); + group.setColor( TQColorGroup::Button, AltBase ); + group.setColor( TQColorGroup::ButtonText, 0xd7d7ef ); -// group.setColor( QColorGroup::Light, Qt::cyan /*lighter than Button color*/ ); -// group.setColor( QColorGroup::Midlight, Qt::blue /*between Button and Light*/ ); -// group.setColor( QColorGroup::Dark, Qt::green /*darker than Button*/ ); -// group.setColor( QColorGroup::Mid, Qt::red /*between Button and Dark*/ ); -// group.setColor( QColorGroup::Shadow, Qt::yellow /*a very dark color. By default, the shadow color is Qt::black*/ ); +// group.setColor( TQColorGroup::Light, Qt::cyan /*lighter than Button color*/ ); +// group.setColor( TQColorGroup::Midlight, Qt::blue /*between Button and Light*/ ); +// group.setColor( TQColorGroup::Dark, Qt::green /*darker than Button*/ ); +// group.setColor( TQColorGroup::Mid, Qt::red /*between Button and Dark*/ ); +// group.setColor( TQColorGroup::Shadow, Qt::yellow /*a very dark color. By default, the shadow color is Qt::black*/ ); - group.setColor( QColorGroup::Highlight, Qt::white ); - group.setColor( QColorGroup::HighlightedText, bg ); - //group.setColor( QColorGroup::BrightText, QColor( 0xff, 0x40, 0x40 ) ); //GlowColor + group.setColor( TQColorGroup::Highlight, Qt::white ); + group.setColor( TQColorGroup::HighlightedText, bg ); + //group.setColor( TQColorGroup::BrightText, TQColor( 0xff, 0x40, 0x40 ) ); //GlowColor AltBase.getHsv( &h, &s, &v ); - group.setColor( QColorGroup::Midlight, QColor( h, s/3, (int)(v * 1.2), QColor::Hsv ) ); //column separator in playlist + group.setColor( TQColorGroup::Midlight, TQColor( h, s/3, (int)(v * 1.2), TQColor::Hsv ) ); //column separator in playlist //TODO set all colours, even button colours, that way we can change the dark, //light, etc. colours and Amarok scheme will look much better @@ -907,18 +907,18 @@ App::applyColorScheme() Foreground = 0x80A0FF; //all children() derive their palette from this - playlistWindow()->setPalette( QPalette( group, group, group ) ); + playlistWindow()->setPalette( TQPalette( group, group, group ) ); browserBar->unsetPalette(); - contextBrowser->setPalette( QPalette( group, group, group ) ); + contextBrowser->setPalette( TQPalette( group, group, group ) ); } else if( AmarokConfig::schemeCustom() ) { // we try to be smart: this code figures out contrasting colors for // selection and alternate background rows - group = QApplication::palette().active(); - const QColor fg( AmarokConfig::playlistWindowFgColor() ); - const QColor bg( AmarokConfig::playlistWindowBgColor() ); + group = TQApplication::palette().active(); + const TQColor fg( AmarokConfig::playlistWindowFgColor() ); + const TQColor bg( AmarokConfig::playlistWindowBgColor() ); //TODO use the ensureContrast function you devised in BlockAnalyzer @@ -930,34 +930,34 @@ App::applyColorScheme() fg.hsv( &h, &s, &v ); v += (v < 128) ? +150 : -150; v &= 255; //ensures 0 <= v < 256 - QColor highlight( h, s, v, QColor::Hsv ); + TQColor highlight( h, s, v, TQColor::Hsv ); - group.setColor( QColorGroup::Base, bg ); - group.setColor( QColorGroup::Background, bg.dark( 115 ) ); - group.setColor( QColorGroup::Text, fg ); - group.setColor( QColorGroup::Link, fg.light( 120 ) ); - group.setColor( QColorGroup::Highlight, highlight ); - group.setColor( QColorGroup::HighlightedText, Qt::white ); - group.setColor( QColorGroup::Dark, Qt::darkGray ); + group.setColor( TQColorGroup::Base, bg ); + group.setColor( TQColorGroup::Background, bg.dark( 115 ) ); + group.setColor( TQColorGroup::Text, fg ); + group.setColor( TQColorGroup::Link, fg.light( 120 ) ); + group.setColor( TQColorGroup::Highlight, highlight ); + group.setColor( TQColorGroup::HighlightedText, Qt::white ); + group.setColor( TQColorGroup::Dark, Qt::darkGray ); PlayerWidget::determineAmarokColors(); // we only colour the middle section since we only // allow the user to choose two colours - browserBar->setPalette( QPalette( group, group, group ) ); - contextBrowser->setPalette( QPalette( group, group, group ) ); + browserBar->setPalette( TQPalette( group, group, group ) ); + contextBrowser->setPalette( TQPalette( group, group, group ) ); playlistWindow()->unsetPalette(); } // set the KListView alternate colours - QObjectList* const list = playlistWindow()->queryList( "KListView" ); - for( QObject *o = list->first(); o; o = list->next() ) + TQObjectList* const list = playlistWindow()->queryList( "KListView" ); + for( TQObject *o = list->first(); o; o = list->next() ) static_cast(o)->setAlternateBackground( AltBase ); delete list; //heap allocated! } -bool Amarok::genericEventHandler( QWidget *recipient, QEvent *e ) +bool Amarok::genericEventHandler( TQWidget *recipient, TQEvent *e ) { //this is used as a generic event handler for widgets that want to handle //typical events in an Amarok fashion @@ -971,15 +971,15 @@ bool Amarok::genericEventHandler( QWidget *recipient, QEvent *e ) switch( e->type() ) { - case QEvent::DragEnter: - #define e static_cast(e) + case TQEvent::DragEnter: + #define e static_cast(e) e->accept( KURLDrag::canDecode( e ) ); break; - case QEvent::Drop: + case TQEvent::Drop: if( KURLDrag::canDecode( e ) ) { - QPopupMenu popup; + TQPopupMenu popup; //FIXME this isn't a good way to determine if there is a currentTrack, need playlist() function const bool b = EngineController::engine()->loaded(); @@ -1007,9 +1007,9 @@ bool Amarok::genericEventHandler( QWidget *recipient, QEvent *e ) //this like every entry in the generic event handler is used by more than one widget //please don't remove! - case QEvent::Wheel: + case TQEvent::Wheel: { - #define e static_cast(e) + #define e static_cast(e) //this behaviour happens for the systray and the player window //to override one, override it in that class @@ -1041,12 +1041,12 @@ bool Amarok::genericEventHandler( QWidget *recipient, QEvent *e ) break; } - case QEvent::Close: + case TQEvent::Close: //KDE policy states we should hide to tray and not quit() when the //close window button is pushed for the main widget - static_cast(e)->accept(); //if we don't do this the info box appears on quit()! + static_cast(e)->accept(); //if we don't do this the info box appears on quit()! if( AmarokConfig::showTrayIcon() && !e->spontaneous() && !kapp->sessionSaving() ) { @@ -1128,7 +1128,7 @@ void App::slotConfigEqualizer() //SLOT } -void App::slotConfigAmarok( const QCString& page ) +void App::slotConfigAmarok( const TQCString& page ) { DEBUG_THREAD_FUNC_INFO @@ -1139,7 +1139,7 @@ void App::slotConfigAmarok( const QCString& page ) //KConfigDialog didn't find an instance of this dialog, so lets create it : dialog = new AmarokConfigDialog( m_pPlaylistWindow, "settings", AmarokConfig::self() ); - connect( dialog, SIGNAL(settingsChanged()), SLOT(applySettings()) ); + connect( dialog, TQT_SIGNAL(settingsChanged()), TQT_SLOT(applySettings()) ); } //FIXME it seems that if the dialog is on a different desktop it gets lost @@ -1188,17 +1188,17 @@ void App::firstRunWizard() setTopWidget( &wizard ); KConfigDialogManager* config = new KConfigDialogManager(&wizard, AmarokConfig::self(), "wizardconfig"); config->updateWidgets(); - // connect(config, SIGNAL(settingsChanged()), SLOT(updateSettings())); + // connect(config, TQT_SIGNAL(settingsChanged()), TQT_SLOT(updateSettings())); wizard.setCaption( makeStdCaption( i18n( "First-Run Wizard" ) ) ); - if( wizard.exec() != QDialog::Rejected ) + if( wizard.exec() != TQDialog::Rejected ) { //make sure that the DB config is stored in amarokrc before calling CollectionDB's ctor AmarokConfig::setDatabaseEngine( - QString::number( Amarok::databaseTypeCode( wizard.dbSetup7->databaseEngine->currentText() ) ) ); + TQString::number( Amarok::databaseTypeCode( wizard.dbSetup7->databaseEngine->currentText() ) ) ); config->updateSettings(); - const QStringList oldCollectionFolders = MountPointManager::instance()->collectionFolders(); + const TQStringList oldCollectionFolders = MountPointManager::instance()->collectionFolders(); wizard.writeCollectionConfig(); // If wizard is invoked at runtime, rescan collection if folder setup has changed @@ -1235,7 +1235,7 @@ KIO::Job *App::trashFiles( const KURL::List &files ) #if KDE_IS_VERSION( 3, 3, 91 ) KIO::Job *job = KIO::trash( files, true /*show progress*/ ); Amarok::StatusBar::instance()->newProgressOperation( job ).setDescription( i18n("Moving files to trash") ); - connect( job, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotTrashResult( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), this, TQT_SLOT( slotTrashResult( KIO::Job* ) ) ); return job; #else KIO::Job* job = KIO::move( files, KGlobalSettings::trashPath() ); @@ -1252,7 +1252,7 @@ void App::setRating( int n ) const Engine::State s = EngineController::instance()->engine()->state(); if( s == Engine::Playing || s == Engine::Paused || s == Engine::Idle ) { - const QString path = EngineController::instance()->playingURL().path(); + const TQString path = EngineController::instance()->playingURL().path(); CollectionDB::instance()->setSongRating( path, n, true ); const int rating = CollectionDB::instance()->getSongRating( path ); EngineController::instance()->updateBundleRating( rating ); @@ -1270,10 +1270,10 @@ void App::slotTrashResult( KIO::Job *job ) job->showErrorDialog( PlaylistWindow::self() ); } -QWidget *App::mainWindow() const +TQWidget *App::mainWindow() const { - return AmarokConfig::showPlayerWindow() ? static_cast( m_pPlayerWindow ) - : static_cast( m_pPlaylistWindow ); + return AmarokConfig::showPlayerWindow() ? static_cast( m_pPlayerWindow ) + : static_cast( m_pPlaylistWindow ); } void App::quit() @@ -1282,7 +1282,7 @@ void App::quit() if( MediaBrowser::instance()->blockQuit() ) { // don't quit yet, as some media devices still have to finish transferring data - QTimer::singleShot( 100, this, SLOT( quit() ) ); + TQTimer::singleShot( 100, this, TQT_SLOT( quit() ) ); return; } KApplication::quit(); @@ -1292,7 +1292,7 @@ namespace Amarok { /// @see amarok.h - QWidget *mainWindow() + TQWidget *mainWindow() { return pApp->playlistWindow(); } @@ -1302,90 +1302,90 @@ namespace Amarok return pApp->playlistWindow()->actionCollection(); } - KConfig *config( const QString &group ) + KConfig *config( const TQString &group ) { //Slightly more useful config() that allows setting the group simultaneously kapp->config()->setGroup( group ); return kapp->config(); } - bool invokeBrowser( const QString& url ) + bool invokeBrowser( const TQString& url ) { //URL can be in whatever forms KURL::fromPathOrURL understands - ie most. - const QString cmd = "%1 \"%2\""; + const TQString cmd = "%1 \"%2\""; return KRun::runCommand( cmd.arg( AmarokConfig::externalBrowser(), KURL::fromPathOrURL( url ).url() ) ) > 0; } namespace ColorScheme { - QColor Base; - QColor Text; - QColor Background; - QColor Foreground; - QColor AltBase; + TQColor Base; + TQColor Text; + TQColor Background; + TQColor Foreground; + TQColor AltBase; } OverrideCursor::OverrideCursor( Qt::CursorShape cursor ) { - QApplication::setOverrideCursor( cursor == Qt::WaitCursor ? KCursor::waitCursor() : KCursor::workingCursor() ); + TQApplication::setOverrideCursor( cursor == Qt::WaitCursor ? KCursor::waitCursor() : KCursor::workingCursor() ); } OverrideCursor::~OverrideCursor() { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } - QString saveLocation( const QString &directory ) + TQString saveLocation( const TQString &directory ) { globalDirsMutex.lock(); - QString result = KGlobal::dirs()->saveLocation( "data", QString("amarok/") + directory, true ); + TQString result = KGlobal::dirs()->saveLocation( "data", TQString("amarok/") + directory, true ); globalDirsMutex.unlock(); return result; } - QString cleanPath( const QString &path ) + TQString cleanPath( const TQString &path ) { - QString result = path; + TQString result = path; // german umlauts - result.replace( QChar(0x00e4), "ae" ).replace( QChar(0x00c4), "Ae" ); - result.replace( QChar(0x00f6), "oe" ).replace( QChar(0x00d6), "Oe" ); - result.replace( QChar(0x00fc), "ue" ).replace( QChar(0x00dc), "Ue" ); - result.replace( QChar(0x00df), "ss" ); + result.replace( TQChar(0x00e4), "ae" ).replace( TQChar(0x00c4), "Ae" ); + result.replace( TQChar(0x00f6), "oe" ).replace( TQChar(0x00d6), "Oe" ); + result.replace( TQChar(0x00fc), "ue" ).replace( TQChar(0x00dc), "Ue" ); + result.replace( TQChar(0x00df), "ss" ); // some strange accents - result.replace( QChar(0x00e7), "c" ).replace( QChar(0x00c7), "C" ); - result.replace( QChar(0x00fd), "y" ).replace( QChar(0x00dd), "Y" ); - result.replace( QChar(0x00f1), "n" ).replace( QChar(0x00d1), "N" ); + result.replace( TQChar(0x00e7), "c" ).replace( TQChar(0x00c7), "C" ); + result.replace( TQChar(0x00fd), "y" ).replace( TQChar(0x00dd), "Y" ); + result.replace( TQChar(0x00f1), "n" ).replace( TQChar(0x00d1), "N" ); // czech letters with carons - result.replace( QChar(0x0161), "s" ).replace( QChar(0x0160), "S" ); - result.replace( QChar(0x010d), "c" ).replace( QChar(0x010c), "C" ); - result.replace( QChar(0x0159), "r" ).replace( QChar(0x0158), "R" ); - result.replace( QChar(0x017e), "z" ).replace( QChar(0x017d), "Z" ); - result.replace( QChar(0x0165), "t" ).replace( QChar(0x0164), "T" ); - result.replace( QChar(0x0148), "n" ).replace( QChar(0x0147), "N" ); - result.replace( QChar(0x010f), "d" ).replace( QChar(0x010e), "D" ); + result.replace( TQChar(0x0161), "s" ).replace( TQChar(0x0160), "S" ); + result.replace( TQChar(0x010d), "c" ).replace( TQChar(0x010c), "C" ); + result.replace( TQChar(0x0159), "r" ).replace( TQChar(0x0158), "R" ); + result.replace( TQChar(0x017e), "z" ).replace( TQChar(0x017d), "Z" ); + result.replace( TQChar(0x0165), "t" ).replace( TQChar(0x0164), "T" ); + result.replace( TQChar(0x0148), "n" ).replace( TQChar(0x0147), "N" ); + result.replace( TQChar(0x010f), "d" ).replace( TQChar(0x010e), "D" ); // accented vowels - QChar a[] = { 'a', 0xe0,0xe1,0xe2,0xe3,0xe5, 0 }; - QChar A[] = { 'A', 0xc0,0xc1,0xc2,0xc3,0xc5, 0 }; - QChar e[] = { 'e', 0xe8,0xe9,0xea,0xeb,0x11b, 0 }; - QChar E[] = { 'E', 0xc8,0xc9,0xca,0xcb,0x11a, 0 }; - QChar i[] = { 'i', 0xec,0xed,0xee,0xef, 0 }; - QChar I[] = { 'I', 0xcc,0xcd,0xce,0xcf, 0 }; - QChar o[] = { 'o', 0xf2,0xf3,0xf4,0xf5,0xf8, 0 }; - QChar O[] = { 'O', 0xd2,0xd3,0xd4,0xd5,0xd8, 0 }; - QChar u[] = { 'u', 0xf9,0xfa,0xfb,0x16f, 0 }; - QChar U[] = { 'U', 0xd9,0xda,0xdb,0x16e, 0 }; - QChar nul[] = { 0 }; - QChar *replacements[] = { a, A, e, E, i, I, o, O, u, U, nul }; + TQChar a[] = { 'a', 0xe0,0xe1,0xe2,0xe3,0xe5, 0 }; + TQChar A[] = { 'A', 0xc0,0xc1,0xc2,0xc3,0xc5, 0 }; + TQChar e[] = { 'e', 0xe8,0xe9,0xea,0xeb,0x11b, 0 }; + TQChar E[] = { 'E', 0xc8,0xc9,0xca,0xcb,0x11a, 0 }; + TQChar i[] = { 'i', 0xec,0xed,0xee,0xef, 0 }; + TQChar I[] = { 'I', 0xcc,0xcd,0xce,0xcf, 0 }; + TQChar o[] = { 'o', 0xf2,0xf3,0xf4,0xf5,0xf8, 0 }; + TQChar O[] = { 'O', 0xd2,0xd3,0xd4,0xd5,0xd8, 0 }; + TQChar u[] = { 'u', 0xf9,0xfa,0xfb,0x16f, 0 }; + TQChar U[] = { 'U', 0xd9,0xda,0xdb,0x16e, 0 }; + TQChar nul[] = { 0 }; + TQChar *replacements[] = { a, A, e, E, i, I, o, O, u, U, nul }; for( uint i = 0; i < result.length(); i++ ) { - QChar c = result.ref( i ); - for( uint n = 0; replacements[n][0] != QChar(0); n++ ) + TQChar c = result.ref( i ); + for( uint n = 0; replacements[n][0] != TQChar(0); n++ ) { - for( uint k=0; replacements[n][k] != QChar(0); k++ ) + for( uint k=0; replacements[n][k] != TQChar(0); k++ ) { if( replacements[n][k] == c ) { @@ -1398,13 +1398,13 @@ namespace Amarok return result; } - QString asciiPath( const QString &path ) + TQString asciiPath( const TQString &path ) { - QString result = path; + TQString result = path; for( uint i = 0; i < result.length(); i++ ) { - QChar c = result.ref( i ); - if( c > QChar(0x7f) || c == QChar(0) ) + TQChar c = result.ref( i ); + if( c > TQChar(0x7f) || c == TQChar(0) ) { c = '_'; } @@ -1413,14 +1413,14 @@ namespace Amarok return result; } - QString vfatPath( const QString &path ) + TQString vfatPath( const TQString &path ) { - QString s = path; + TQString s = path; for( uint i = 0; i < s.length(); i++ ) { - QChar c = s.ref( i ); - if( c < QChar(0x20) + TQChar c = s.ref( i ); + if( c < TQChar(0x20) || c=='*' || c=='?' || c=='<' || c=='>' || c=='|' || c=='"' || c==':' || c=='/' || c=='\\' ) @@ -1431,14 +1431,14 @@ namespace Amarok uint len = s.length(); if( len == 3 || (len > 3 && s[3] == '.') ) { - QString l = s.left(3).lower(); + TQString l = s.left(3).lower(); if( l=="aux" || l=="con" || l=="nul" || l=="prn" ) s = '_' + s; } else if( len == 4 || (len > 4 && s[4] == '.') ) { - QString l = s.left(3).lower(); - QString d = s.mid(3,1); + TQString l = s.left(3).lower(); + TQString d = s.mid(3,1); if( (l=="com" || l=="lpt") && (d=="0" || d=="1" || d=="2" || d=="3" || d=="4" || d=="5" || d=="6" || d=="7" || d=="8" || d=="9") ) @@ -1459,9 +1459,9 @@ namespace Amarok return s; } - QString decapitateString( const QString &input, const QString &ref ) + TQString decapitateString( const TQString &input, const TQString &ref ) { - QString t = ref.upper(); + TQString t = ref.upper(); int length = t.length(); int commonLength = 0; while( length > 0 ) @@ -1478,7 +1478,7 @@ namespace Amarok length = length/2; } } - QString clean = input; + TQString clean = input; if( t.endsWith( " " ) || !ref.at( t.length() ).isLetterOrNumber() ) // common part ends with a space or complete word clean = input.right( input.length() - commonLength ).stripWhiteSpace(); return clean; diff --git a/amarok/src/app.h b/amarok/src/app.h index 0ed7df27..fcbb3316 100644 --- a/amarok/src/app.h +++ b/amarok/src/app.h @@ -82,7 +82,7 @@ class LIBAMAROK_EXPORT App : public KApplication, public EngineObserver public slots: void applySettings( bool firstTime = false ); - void slotConfigAmarok( const QCString& page = QCString() ); + void slotConfigAmarok( const TQCString& page = TQCString() ); void slotConfigShortcuts(); void slotConfigGlobalShortcuts(); void slotConfigToolBars(); @@ -105,7 +105,7 @@ class LIBAMAROK_EXPORT App : public KApplication, public EngineObserver void firstRunWizard(); /** returns the leading window, either playerWindow or playlistWindow */ - QWidget *mainWindow() const; + TQWidget *mainWindow() const; void setRating( int n ); diff --git a/amarok/src/atomicstring.cpp b/amarok/src/atomicstring.cpp index 90fb3f92..2de299af 100644 --- a/amarok/src/atomicstring.cpp +++ b/amarok/src/atomicstring.cpp @@ -21,8 +21,8 @@ #ifdef HAVE_STDINT_H #include #endif -#include -#include +#include +#include #include #include "atomicstring.h" @@ -32,7 +32,7 @@ class AtomicString::Data: public QString public: uint refcount; Data(): refcount( 0 ) { } - Data( const QString &s ): QString( s ), refcount( 0 ) { } + Data( const TQString &s ): TQString( s ), refcount( 0 ) { } }; AtomicString::AtomicString(): m_string( 0 ) { } @@ -45,7 +45,7 @@ AtomicString::AtomicString( const AtomicString &other ) s_storeMutex.unlock(); } -AtomicString::AtomicString( const QString &string ): m_string( 0 ) +AtomicString::AtomicString( const TQString &string ): m_string( 0 ) { if( string.isEmpty() ) return; @@ -58,7 +58,7 @@ AtomicString::AtomicString( const QString &string ): m_string( 0 ) if( rc && !isMainThread()) { // Inserted, and we are not in the main thread -- we need to make s a deep copy, // as this copy may be refcounted by the main thread outside our locks - (QString &) (*s) = QDeepCopy( string ); + (TQString &) (*s) = TQDeepCopy( string ); } s_storeMutex.unlock(); if ( !rc ) delete( s ); // already present @@ -71,19 +71,19 @@ AtomicString::~AtomicString() s_storeMutex.unlock(); } -QString AtomicString::string() const +TQString AtomicString::string() const { - if ( !m_string ) return QString(); + if ( !m_string ) return TQString(); // References to the stored string are only allowed to circulate in the main thread if ( isMainThread() ) return *m_string; else return deepCopy(); } -QString AtomicString::deepCopy() const +TQString AtomicString::deepCopy() const { if (m_string) - return QString( m_string->unicode(), m_string->length() ); - return QString(); + return TQString( m_string->unicode(), m_string->length() ); + return TQString(); } bool AtomicString::isEmpty() const @@ -91,11 +91,11 @@ bool AtomicString::isEmpty() const return !m_string; } -const QString *AtomicString::ptr() const +const TQString *AtomicString::ptr() const { if( m_string ) return m_string; - return &QString::null; + return &TQString::null; } uint AtomicString::refcount() const @@ -149,7 +149,7 @@ inline void AtomicString::ref( Data *s ) // It is not necessary to hold the store mutex here. bool AtomicString::isMainThread() { - // For isMainThread(), we could use QThread::currentThread(), except the + // For isMainThread(), we could use TQThread::currentThread(), except the // docs say it's unreliable. And in general QThreads don't like to be called from // app destructors. Good old pthreads will serve us well. As for Windows, these // two calls surely have equivalents; better yet we'll have QT4 and thread safe @@ -171,5 +171,5 @@ inline void AtomicString::checkLazyDeletes() } AtomicString::set_type AtomicString::s_store; -QPtrList AtomicString::s_lazyDeletes; -QMutex AtomicString::s_storeMutex; +TQPtrList AtomicString::s_lazyDeletes; +TQMutex AtomicString::s_storeMutex; diff --git a/amarok/src/atomicstring.h b/amarok/src/atomicstring.h index e81ae238..11790ce9 100644 --- a/amarok/src/atomicstring.h +++ b/amarok/src/atomicstring.h @@ -18,14 +18,14 @@ */ /** - * A thin wrapper over QString which ensures only a single copy of string data + * A thin wrapper over TQString which ensures only a single copy of string data * is stored for equivalent strings. As a side benefit, testing for equality - * is reduced to a pointer comparison. Construction is slower than a QString, + * is reduced to a pointer comparison. Construction is slower than a TQString, * as it must be checked for equality with existing strings. (A hash set is * used for this purpose. According to benchmarks, Paul Hsieh's SuperFastHash * (which is currently used -- see http://www.azillionmonkeys.com/qed/hash.html) * can hash 5 million 256 byte strings in 1.34s on a 1.62GHz Athlon XP.) For - * other use, the overhead compared to a plain QString should be minimal. + * other use, the overhead compared to a plain TQString should be minimal. * * Added note: due to QString's thread unsafe refcounting, special precautions have to be * taken to avoid memory corruption, while still maintaining some level of efficiency. @@ -48,9 +48,9 @@ #include #include "amarok_export.h" -#include -#include -#include +#include +#include +#include class LIBAMAROK_EXPORT AtomicString { @@ -72,7 +72,7 @@ public: * Constructs a copy of \p string. * @param string the string to copy */ - AtomicString( const QString &string ); + AtomicString( const TQString &string ); /** * Destroys the string. @@ -102,19 +102,19 @@ public: * * @return the string. */ - QString string() const; + TQString string() const; /** - * Implicitly casts to a QString. + * Implicitly casts to a TQString. * @return the string */ - inline operator QString() const { return string(); } + inline operator TQString() const { return string(); } /** * Useful for threading. * @return a deep copy of the string */ - QString deepCopy() const; + TQString deepCopy() const; /** * For convenience. Equivalent to isNull(). @@ -136,18 +136,18 @@ public: * different ones. This can be useful for certain kinds of hacks, but * shouldn't normally be used. * - * Note: DO NOT COPY this pointer with QString() or QString=. It is not - * thread safe to do it (QString internal refcount) + * Note: DO NOT COPY this pointer with TQString() or QString=. It is not + * thread safe to do it (TQString internal refcount) * @return the internal pointer to the string */ - const QString *ptr() const; + const TQString *ptr() const; /** * For convenience, so you can do atomicstring->QStringfunction(), * instead of atomicstring.string().QStringfunction(). The same warning * applies as for the above ptr() function. */ - inline const QString *operator->() const { return ptr(); } + inline const TQString *operator->() const { return ptr(); } /** * For debugging purposes. @@ -166,10 +166,10 @@ public: private: struct less { - bool operator()( const QString *a, const QString *b ) const + bool operator()( const TQString *a, const TQString *b ) const { return *a < *b; } }; - typedef std::set set_type; + typedef std::set set_type; class Data; friend class Data; @@ -183,9 +183,9 @@ private: // static data static set_type s_store; // main string store - static QPtrList s_lazyDeletes; // strings scheduled for deletion + static TQPtrList s_lazyDeletes; // strings scheduled for deletion // by main thread - static QMutex s_storeMutex; // protects the static data above + static TQMutex s_storeMutex; // protects the static data above }; #endif diff --git a/amarok/src/atomicstring_unittest.cpp b/amarok/src/atomicstring_unittest.cpp index 1f5d93e3..2dca3b9c 100644 --- a/amarok/src/atomicstring_unittest.cpp +++ b/amarok/src/atomicstring_unittest.cpp @@ -11,7 +11,7 @@ void * Worker(void *num) { srand( reinterpret_cast( num ) ); - QString base = "str"; + TQString base = "str"; // create 5 strings, destroy them, copy them around const int kNumStrings = 5; AtomicString *atStrings[kNumStrings * 2]; @@ -25,13 +25,13 @@ Worker(void *num) { if( k >= kNumStrings && atStrings[k % kNumStrings] != NULL ) { atStrings[k] = new AtomicString( *atStrings[k % kNumStrings] ); } else { - atStrings[k] = new AtomicString( base + QString::number( k ) ); + atStrings[k] = new AtomicString( base + TQString::number( k ) ); } } else { // check the string; could be either upper or lower - QString str = atStrings[k]->string(); - if( str != base + QString::number( k ) - && str != base + QString::number( k % kNumStrings ) ) { + TQString str = atStrings[k]->string(); + if( str != base + TQString::number( k ) + && str != base + TQString::number( k % kNumStrings ) ) { qFatal( "unexpected atStrings[%d]: %s", k, str.ascii() ); } delete atStrings[k]; diff --git a/amarok/src/atomicurl.cpp b/amarok/src/atomicurl.cpp index 620ded36..e743e5d6 100644 --- a/amarok/src/atomicurl.cpp +++ b/amarok/src/atomicurl.cpp @@ -17,7 +17,7 @@ Boston, MA 02110-1301, USA. */ -#include +#include #include #include "debug.h" @@ -38,8 +38,8 @@ AtomicURL::AtomicURL( const KURL &url ) if( url.isEmpty() ) return; - QString s = url.protocol() + "://"; - QString host = url.host(); + TQString s = url.protocol() + "://"; + TQString host = url.host(); if( url.hasUser() ) { s += url.user(); @@ -48,14 +48,14 @@ AtomicURL::AtomicURL( const KURL &url ) if( url.hasPass() ) s += ':' + url.pass(); if( url.port() ) - host += QString(":") + QString::number( url.port() ); + host += TQString(":") + TQString::number( url.port() ); m_beginning = s + host; m_directory = url.directory(); m_filename = url.fileName(); m_end = url.query(); if( url.hasRef() ) - m_end += QString("#") + url.ref(); + m_end += TQString("#") + url.ref(); if (url != this->url()) { debug() << "from: " << url << endl; @@ -81,7 +81,7 @@ bool AtomicURL::operator==( const AtomicURL &other ) const && m_end == other.m_end; } -QString AtomicURL::string() const +TQString AtomicURL::string() const { return m_beginning + path() + m_end; } @@ -102,7 +102,7 @@ bool AtomicURL::isEmpty() const && m_end.isEmpty(); } -void AtomicURL::setPath( const QString &path ) +void AtomicURL::setPath( const TQString &path ) { KURL url; url.setPath( path ); @@ -115,13 +115,13 @@ void AtomicURL::setPath( const QString &path ) } } -QString AtomicURL::path() const +TQString AtomicURL::path() const { if( !m_filename.isEmpty() && !m_directory->endsWith("/") ) return m_directory + '/' + m_filename; return m_directory + m_filename; } -QString AtomicURL::fileName() const { return m_filename; } +TQString AtomicURL::fileName() const { return m_filename; } -QString AtomicURL::directory() const { return m_directory; } +TQString AtomicURL::directory() const { return m_directory; } diff --git a/amarok/src/atomicurl.h b/amarok/src/atomicurl.h index 1f45ea7f..9e0b6bc3 100644 --- a/amarok/src/atomicurl.h +++ b/amarok/src/atomicurl.h @@ -26,7 +26,7 @@ #ifndef AMAROK_ATOMICURL_H #define AMAROK_ATOMICURL_H -#include +#include #include "atomicstring.h" #include "amarok_export.h" @@ -36,8 +36,8 @@ class LIBAMAROK_EXPORT AtomicURL { AtomicString m_beginning; AtomicString m_directory; - QString m_filename; - QString m_end; + TQString m_filename; + TQString m_end; public: AtomicURL(); @@ -52,7 +52,7 @@ public: bool operator==( const AtomicURL &other ) const; - QString string() const; + TQString string() const; KURL url() const; @@ -60,13 +60,13 @@ public: bool isEmpty() const; - void setPath( const QString &path ); + void setPath( const TQString &path ); - QString path() const; + TQString path() const; - QString fileName() const; + TQString fileName() const; - QString directory() const; + TQString directory() const; }; #endif diff --git a/amarok/src/browserToolBar.h b/amarok/src/browserToolBar.h index 54cafbfc..6d421ab0 100644 --- a/amarok/src/browserToolBar.h +++ b/amarok/src/browserToolBar.h @@ -18,7 +18,7 @@ namespace Browser class ToolBar : public KToolBar { public: - ToolBar( QWidget *parent ) + ToolBar( TQWidget *parent ) : KToolBar( parent, "NotMainToolBar" ) { setMovingEnabled(false); diff --git a/amarok/src/browserbar.cpp b/amarok/src/browserbar.cpp index fd32be1e..5574a915 100644 --- a/amarok/src/browserbar.cpp +++ b/amarok/src/browserbar.cpp @@ -20,11 +20,11 @@ #include //multiTabBar icons #include -#include //for resize cursor -#include -#include //m_mapper -#include //Amarok::Splitter -#include +#include //for resize cursor +#include +#include //m_mapper +#include //Amarok::Splitter +#include // we emulate a qsplitter, mostly for historic reasons, but there are still a few advantages @@ -33,26 +33,26 @@ namespace Amarok { - class Splitter : public QWidget { + class Splitter : public TQWidget { public: - Splitter( BrowserBar *w ) : QWidget( w, "divider" ) + Splitter( BrowserBar *w ) : TQWidget( w, "divider" ) { - setCursor( QCursor(SplitHCursor) ); + setCursor( TQCursor(SplitHCursor) ); styleChange( style() ); } - virtual void paintEvent( QPaintEvent* ) + virtual void paintEvent( TQPaintEvent* ) { - QPainter p( this ); - parentWidget()->style().drawPrimitive( QStyle::PE_Splitter, &p, rect(), colorGroup(), QStyle::Style_Horizontal ); + TQPainter p( this ); + parentWidget()->style().drawPrimitive( TQStyle::PE_Splitter, &p, rect(), colorGroup(), TQStyle::Style_Horizontal ); } - virtual void styleChange( QStyle& ) + virtual void styleChange( TQStyle& ) { - setFixedWidth( style().pixelMetric( QStyle::PM_SplitterWidth, this ) ); + setFixedWidth( style().pixelMetric( TQStyle::PM_SplitterWidth, this ) ); } - virtual void mouseMoveEvent( QMouseEvent *e ) + virtual void mouseMoveEvent( TQMouseEvent *e ) { static_cast(parent())->mouseMovedOverSplitter( e ); } @@ -61,21 +61,21 @@ namespace Amarok BrowserBar* BrowserBar::s_instance = 0; -BrowserBar::BrowserBar( QWidget *parent ) - : QWidget( parent, "BrowserBar" ) +BrowserBar::BrowserBar( TQWidget *parent ) + : TQWidget( parent, "BrowserBar" ) , EngineObserver( EngineController::instance() ) - , m_playlistBox( new QVBox( this ) ) + , m_playlistBox( new TQVBox( this ) ) , m_divider( new Amarok::Splitter( this ) ) - , m_browserBox( new QVBox( this ) ) + , m_browserBox( new TQVBox( this ) ) , m_currentIndex( -1 ) , m_lastIndex( -1 ) - , m_mapper( new QSignalMapper( this ) ) + , m_mapper( new TQSignalMapper( this ) ) { - m_tabManagementButton = new QPushButton( SmallIconSet(Amarok::icon( "configure" )), 0, this, "tab_managment_button" ); - connect (m_tabManagementButton, SIGNAL(clicked()), SLOT(showBrowserSelectionMenu())); + m_tabManagementButton = new TQPushButton( SmallIconSet(Amarok::icon( "configure" )), 0, this, "tab_managment_button" ); + connect (m_tabManagementButton, TQT_SIGNAL(clicked()), TQT_SLOT(showBrowserSelectionMenu())); m_tabManagementButton->setIsMenuButton ( true ); //deprecated, but since I cannot add menu directly to button it is needed. - QToolTip::add (m_tabManagementButton, i18n("Manage tabs")); + TQToolTip::add (m_tabManagementButton, i18n("Manage tabs")); m_tabBar = new MultiTabBar( MultiTabBar::Vertical, this ); @@ -94,7 +94,7 @@ BrowserBar::BrowserBar( QWidget *parent ) m_tabBar->setFixedWidth( m_pos ); m_tabBar->move( 0, 25 ); - QVBoxLayout *layout = new QVBoxLayout( m_browserBox ); + TQVBoxLayout *layout = new TQVBoxLayout( m_browserBox ); layout->addSpacing( 3 ); // aesthetics layout->setAutoAdd( true ); @@ -103,25 +103,25 @@ BrowserBar::BrowserBar( QWidget *parent ) m_divider->hide(); m_playlistBox->setSpacing( 1 ); - connect( m_mapper, SIGNAL(mapped( int )), SLOT(showHideBrowser( int )) ); + connect( m_mapper, TQT_SIGNAL(mapped( int )), TQT_SLOT(showHideBrowser( int )) ); - //m_tabBar->appendButton( Amarok::icon( "configure" ), 1, 0, QString::null ); + //m_tabBar->appendButton( Amarok::icon( "configure" ), 1, 0, TQString::null ); } BrowserBar::~BrowserBar() { KConfig* const config = Amarok::config( "BrowserBar" ); - config->writeEntry( "CurrentPane", m_currentIndex != -1 ? QString(currentBrowser()->name()) : QString::null ); + config->writeEntry( "CurrentPane", m_currentIndex != -1 ? TQString(currentBrowser()->name()) : TQString::null ); config->writeEntry( "Width", m_browserBox->width() ); } void -BrowserBar::makeDropProxy( const QString &name, DropProxyTarget *finalTarget ) +BrowserBar::makeDropProxy( const TQString &name, DropProxyTarget *finalTarget ) { int id = m_browserIds[name]; MultiTabBarButton *button = m_tabBar->tab( id ); @@ -146,7 +146,7 @@ BrowserBar::polish() { DEBUG_FUNC_INFO - QWidget::polish(); + TQWidget::polish(); uint M = 0; foreachType( BrowserList, m_browsers ) { @@ -189,7 +189,7 @@ BrowserBar::adjustWidgetSizes() } void -BrowserBar::mouseMovedOverSplitter( QMouseEvent *e ) +BrowserBar::mouseMovedOverSplitter( TQMouseEvent *e ) { const uint oldPos = m_pos; const uint newPos = mapFromGlobal( e->globalPos() ).x(); @@ -210,11 +210,11 @@ BrowserBar::mouseMovedOverSplitter( QMouseEvent *e ) } bool -BrowserBar::event( QEvent *e ) +BrowserBar::event( TQEvent *e ) { switch( e->type() ) { - case QEvent::LayoutHint: + case TQEvent::LayoutHint: //FIXME include browserholder width setMinimumWidth( m_tabBar->minimumWidth() + @@ -223,7 +223,7 @@ BrowserBar::event( QEvent *e ) m_playlistBox->minimumWidth() ); break; - case QEvent::Resize: + case TQEvent::Resize: // DEBUG_LINE_INFO m_divider->resize( 0, height() ); //Qt will set width @@ -237,39 +237,39 @@ BrowserBar::event( QEvent *e ) ; } - return QWidget::event( e ); + return TQWidget::event( e ); } void -BrowserBar::addBrowser( const QString &identifier, QWidget *widget, const QString &title, const QString& icon ) +BrowserBar::addBrowser( const TQString &identifier, TQWidget *widget, const TQString &title, const TQString& icon ) { const int id = m_tabBar->tabs()->count(); // the next available id - const QString name( widget->name() ); + const TQString name( widget->name() ); m_browserIds[name] = id; - QWidget *tab; + TQWidget *tab; - widget->reparent( m_browserBox, QPoint() ); + widget->reparent( m_browserBox, TQPoint() ); widget->hide(); m_tabBar->appendTab( SmallIcon( icon ), id, title, identifier ); tab = m_tabBar->tab( id ); - tab->setFocusPolicy( QWidget::NoFocus ); //FIXME you can focus on the tab, but they respond to no input! + tab->setFocusPolicy( TQWidget::NoFocus ); //FIXME you can focus on the tab, but they respond to no input! //we use a SignalMapper to show/hide the corresponding browser when tabs are clicked - connect( tab, SIGNAL(clicked()), m_mapper, SLOT(map()) ); + connect( tab, TQT_SIGNAL(clicked()), m_mapper, TQT_SLOT(map()) ); m_mapper->setMapping( tab, id ); - connect( tab, SIGNAL(initiateDrag ( int ) ), this, SLOT( showBrowser( int )) ); + connect( tab, TQT_SIGNAL(initiateDrag ( int ) ), this, TQT_SLOT( showBrowser( int )) ); m_browsers.push_back( widget ); } void -BrowserBar::removeMediaBrowser( QWidget *widget ) +BrowserBar::removeMediaBrowser( TQWidget *widget ) { BrowserList::iterator it = qFind( m_browsers.begin(), m_browsers.end(), widget ); if( it != m_browsers.end() ) m_browsers.erase( it ); - QWidget *tab; + TQWidget *tab; tab = m_tabBar->tab( m_browserIds["MediaBrowser"] ); m_mapper->removeMappings( tab ); m_tabBar->removeTab( m_browserIds["MediaBrowser"] ); @@ -301,7 +301,7 @@ BrowserBar::showHideBrowser( int index ) else if( (uint)index < m_browsers.count() ) { ///open up target - QWidget* const target = m_browsers[index]; + TQWidget* const target = m_browsers[index]; m_currentIndex = index; m_divider->show(); @@ -325,7 +325,7 @@ void BrowserBar::showHideVisibleBrowser( int index ) { int realindex = -1; - QPtrList tabs = *m_tabBar->tabs(); + TQPtrList tabs = *m_tabBar->tabs(); for( int i = 0, n = tabs.count(); i < n; ++i ) { if( tabs.at( i )->visible() ) @@ -341,8 +341,8 @@ BrowserBar::showHideVisibleBrowser( int index ) showHideBrowser( realindex ); } -QWidget* -BrowserBar::browser( const QString &name ) const +TQWidget* +BrowserBar::browser( const TQString &name ) const { foreachType( BrowserList, m_browsers ) if( name == (*it)->name() ) @@ -355,7 +355,7 @@ int BrowserBar::visibleCount() const { int num = 0; - QPtrList tabs = *m_tabBar->tabs(); + TQPtrList tabs = *m_tabBar->tabs(); for( int i = 0, n = tabs.count(); i < n; ++i ) { if( tabs.at( i )->visible() ) @@ -366,7 +366,7 @@ BrowserBar::visibleCount() const } int -BrowserBar::indexForName( const QString &name ) const +BrowserBar::indexForName( const TQString &name ) const { for( uint x = 0; x < m_browsers.count(); ++x ) if( name == m_browsers[x]->name() ) @@ -377,7 +377,7 @@ BrowserBar::indexForName( const QString &name ) const void BrowserBar::showBrowserSelectionMenu() { - m_tabBar->showTabSelectionMenu(mapToGlobal(QPoint(m_tabManagementButton->pos().x(), m_tabManagementButton->pos().y() +m_tabManagementButton->height() ))); + m_tabBar->showTabSelectionMenu(mapToGlobal(TQPoint(m_tabManagementButton->pos().x(), m_tabManagementButton->pos().y() +m_tabManagementButton->height() ))); } void diff --git a/amarok/src/browserbar.h b/amarok/src/browserbar.h index ea2fcefd..54b3b090 100644 --- a/amarok/src/browserbar.h +++ b/amarok/src/browserbar.h @@ -14,59 +14,59 @@ #include "amarok_export.h" //LIBAMAROK_EXPORT #include "engineobserver.h" //baseclass -#include //baseclass -#include //stack allocated -#include //stack allocated -#include +#include //baseclass +#include //stack allocated +#include //stack allocated +#include -typedef QValueVector BrowserList; -typedef QMap BrowserIdMap; +typedef TQValueVector BrowserList; +typedef TQMap BrowserIdMap; class MultiTabBar; class MultiTabBarTab; class DropProxyTarget; class KURL; -class QSignalMapper; -class QVBox; +class TQSignalMapper; +class TQVBox; -class BrowserBar : public QWidget, public EngineObserver +class BrowserBar : public TQWidget, public EngineObserver { Q_OBJECT public: - BrowserBar( QWidget *parent ); + BrowserBar( TQWidget *parent ); ~BrowserBar(); LIBAMAROK_EXPORT static BrowserBar* instance() { return s_instance; } - QVBox *container() const { return m_playlistBox; } - QVBox *browserBox() const { return m_browserBox; } + TQVBox *container() const { return m_playlistBox; } + TQVBox *browserBox() const { return m_browserBox; } - QWidget *browser( const QString& ) const; - QWidget *browser( int index ) const { if( index < 0 ) index = 0; return m_browsers[index]; } - QWidget *currentBrowser() const { return m_currentIndex < 0 ? 0 : browser( m_currentIndex ); } + TQWidget *browser( const TQString& ) const; + TQWidget *browser( int index ) const { if( index < 0 ) index = 0; return m_browsers[index]; } + TQWidget *currentBrowser() const { return m_currentIndex < 0 ? 0 : browser( m_currentIndex ); } int count() const { return m_browsers.count(); } int visibleCount() const; - void addBrowser( const QString &identifier, QWidget*, const QString&, const QString& ); - void removeMediaBrowser( QWidget *widget ); - int indexForName( const QString& ) const; + void addBrowser( const TQString &identifier, TQWidget*, const TQString&, const TQString& ); + void removeMediaBrowser( TQWidget *widget ); + int indexForName( const TQString& ) const; int restoreWidth(); /// for internal use - void mouseMovedOverSplitter( QMouseEvent* ); - void makeDropProxy( const QString &browserName, DropProxyTarget *finalTarget ); + void mouseMovedOverSplitter( TQMouseEvent* ); + void makeDropProxy( const TQString &browserName, DropProxyTarget *finalTarget ); protected: - virtual bool event( QEvent* ); + virtual bool event( TQEvent* ); virtual void polish(); protected: virtual void engineStateChanged( Engine::State, Engine::State = Engine::Empty ); public slots: - void showBrowser( const QString& name ) { showBrowser( indexForName( name ) ); } + void showBrowser( const TQString& name ) { showBrowser( indexForName( name ) ); } void showBrowser( int index ) { if( index != m_currentIndex ) showHideBrowser( index ); } void showHideBrowser( int ); void showHideVisibleBrowser( int ); @@ -84,17 +84,17 @@ private: LIBAMAROK_EXPORT static BrowserBar *s_instance; uint m_pos; ///the x-axis position of m_divider - QVBox *m_playlistBox; ///parent to playlist, playlist filter and toolbar - QWidget *m_divider; ///a qsplitter like widget + TQVBox *m_playlistBox; ///parent to playlist, playlist filter and toolbar + TQWidget *m_divider; ///a qsplitter like widget MultiTabBar *m_tabBar; BrowserList m_browsers; BrowserIdMap m_browserIds; - QVBox *m_browserBox; ///parent widget to the browsers + TQVBox *m_browserBox; ///parent widget to the browsers int m_currentIndex; int m_lastIndex; - QSignalMapper *m_mapper; ///maps tab clicks to browsers + TQSignalMapper *m_mapper; ///maps tab clicks to browsers - QPushButton *m_tabManagementButton; + TQPushButton *m_tabManagementButton; diff --git a/amarok/src/clicklineedit.cpp b/amarok/src/clicklineedit.cpp index d9dc62f5..f33da486 100644 --- a/amarok/src/clicklineedit.cpp +++ b/amarok/src/clicklineedit.cpp @@ -22,10 +22,10 @@ #include "clicklineedit.h" -#include "qpainter.h" +#include "tqpainter.h" -ClickLineEdit::ClickLineEdit( const QString &msg, QWidget *parent, const char* name ) : +ClickLineEdit::ClickLineEdit( const TQString &msg, TQWidget *parent, const char* name ) : KLineEdit( parent, name ) { mDrawClickMsg = true; @@ -37,14 +37,14 @@ ClickLineEdit::ClickLineEdit( const QString &msg, QWidget *parent, const char* n // PUBLIC ///////////////////////////////////////////////////////////////////////////////////// -void ClickLineEdit::setClickMessage( const QString &msg ) +void ClickLineEdit::setClickMessage( const TQString &msg ) { mClickMessage = msg; repaint(); } -void ClickLineEdit::setText( const QString &txt ) +void ClickLineEdit::setText( const TQString &txt ) { mDrawClickMsg = txt.isEmpty(); repaint(); @@ -57,14 +57,14 @@ void ClickLineEdit::setText( const QString &txt ) ///////////////////////////////////////////////////////////////////////////////////// //#include -void ClickLineEdit::drawContents( QPainter *p ) +void ClickLineEdit::drawContents( TQPainter *p ) { KLineEdit::drawContents( p ); if ( mDrawClickMsg == true && !hasFocus() ) { - QPen tmp = p->pen(); - p->setPen( palette().color( QPalette::Disabled, QColorGroup::Text ) ); - QRect cr = contentsRect(); + TQPen tmp = p->pen(); + p->setPen( palette().color( TQPalette::Disabled, TQColorGroup::Text ) ); + TQRect cr = contentsRect(); //p->drawPixmap( 3, 3, SmallIcon("filter") ); @@ -75,30 +75,30 @@ void ClickLineEdit::drawContents( QPainter *p ) } } -void ClickLineEdit::dropEvent( QDropEvent *ev ) +void ClickLineEdit::dropEvent( TQDropEvent *ev ) { mDrawClickMsg = false; KLineEdit::dropEvent( ev ); } -void ClickLineEdit::focusInEvent( QFocusEvent *ev ) +void ClickLineEdit::focusInEvent( TQFocusEvent *ev ) { if ( mDrawClickMsg == true ) { mDrawClickMsg = false; repaint(); } - QLineEdit::focusInEvent( ev ); + TQLineEdit::focusInEvent( ev ); } -void ClickLineEdit::focusOutEvent( QFocusEvent *ev ) +void ClickLineEdit::focusOutEvent( TQFocusEvent *ev ) { if ( text().isEmpty() ) { mDrawClickMsg = true; repaint(); } - QLineEdit::focusOutEvent( ev ); + TQLineEdit::focusOutEvent( ev ); } #include "clicklineedit.moc" diff --git a/amarok/src/clicklineedit.h b/amarok/src/clicklineedit.h index 2912c087..5dc02a1f 100644 --- a/amarok/src/clicklineedit.h +++ b/amarok/src/clicklineedit.h @@ -33,23 +33,23 @@ class ClickLineEdit : public KLineEdit { Q_OBJECT - Q_PROPERTY( QString clickMessage READ clickMessage WRITE setClickMessage ) + Q_PROPERTY( TQString clickMessage READ clickMessage WRITE setClickMessage ) public: - ClickLineEdit( const QString &msg, QWidget *parent, const char* name = 0 ); + ClickLineEdit( const TQString &msg, TQWidget *parent, const char* name = 0 ); - void setClickMessage( const QString &msg ); - QString clickMessage() const { return mClickMessage; } + void setClickMessage( const TQString &msg ); + TQString clickMessage() const { return mClickMessage; } - virtual void setText( const QString& txt ); + virtual void setText( const TQString& txt ); protected: - virtual void drawContents( QPainter *p ); - virtual void dropEvent( QDropEvent *ev ); - virtual void focusInEvent( QFocusEvent *ev ); - virtual void focusOutEvent( QFocusEvent *ev ); + virtual void drawContents( TQPainter *p ); + virtual void dropEvent( TQDropEvent *ev ); + virtual void focusInEvent( TQFocusEvent *ev ); + virtual void focusOutEvent( TQFocusEvent *ev ); private: - QString mClickMessage; + TQString mClickMessage; bool mDrawClickMsg; }; diff --git a/amarok/src/collectionbrowser.cpp b/amarok/src/collectionbrowser.cpp index 57a55e0d..ce777298 100644 --- a/amarok/src/collectionbrowser.cpp +++ b/amarok/src/collectionbrowser.cpp @@ -37,20 +37,20 @@ #include //CollectionView ctor -#include -#include -#include -#include //infobox -#include -#include -#include -#include -#include -#include -#include -#include //QToolTip::add() -#include -#include +#include +#include +#include +#include //infobox +#include +#include +#include +#include +#include +#include +#include +#include //TQToolTip::add() +#include +#include #include #include //kapp @@ -77,18 +77,18 @@ extern "C" using namespace CollectionBrowserIds; -namespace Amarok { extern KConfig *config( const QString& ); } +namespace Amarok { extern KConfig *config( const TQString& ); } class CoverFetcher; CollectionBrowser *CollectionBrowser::s_instance = 0; CollectionBrowser::CollectionBrowser( const char* name ) - : QVBox( 0, name ) + : TQVBox( 0, name ) , m_cat1Menu( new KPopupMenu( this ) ) , m_cat2Menu( new KPopupMenu( this ) ) , m_cat3Menu( new KPopupMenu( this ) ) - , m_timer( new QTimer( this ) ) + , m_timer( new TQTimer( this ) ) , m_returnPressed( false ) { s_instance = this; @@ -107,13 +107,13 @@ CollectionBrowser::CollectionBrowser( const char* name ) KPushButton *filterButton = new KPushButton("...", searchToolBar, "filter"); searchToolBar->setStretchableWidget( m_searchEdit ); - m_searchEdit->setFrame( QFrame::Sunken ); - connect( button, SIGNAL( clicked() ), SLOT( slotClearFilter() ) ); - connect( filterButton, SIGNAL( clicked() ), SLOT( slotEditFilter() ) ); + m_searchEdit->setFrame( TQFrame::Sunken ); + connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( slotClearFilter() ) ); + connect( filterButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotEditFilter() ) ); - QToolTip::add( button, i18n( "Clear search field" ) ); - QToolTip::add( m_searchEdit, i18n( "Enter space-separated terms to search in the collection" ) ); - QToolTip::add( filterButton, i18n( "Click to edit collection filter" ) ); + TQToolTip::add( button, i18n( "Clear search field" ) ); + TQToolTip::add( m_searchEdit, i18n( "Enter space-separated terms to search in the collection" ) ); + TQToolTip::add( filterButton, i18n( "Click to edit collection filter" ) ); } // @@ -122,13 +122,13 @@ CollectionBrowser::CollectionBrowser( const char* name ) // hidden when not in iPod browsing mode; it is shown and hidden // in CollectionView::setViewMode(). m_ipodHbox holds m_timeFilter // and m_ipodToolbar - m_ipodHbox = new QHBox( this ); + m_ipodHbox = new TQHBox( this ); m_ipodHbox->setSpacing( 7 ); // looks better m_timeFilter = new KComboBox( m_ipodHbox, "timeFilter" ); m_ipodHbox->setStretchFactor( m_timeFilter, 1 ); // Allow the combobox to shrink so the iPod buttons are still visible - m_timeFilter->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + m_timeFilter->setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ); m_timeFilter->insertItem( i18n( "Entire Collection" ) ); m_timeFilter->insertItem( i18n( "Added Today" ) ); m_timeFilter->insertItem( i18n( "Added Within One Week" ) ); @@ -149,10 +149,10 @@ CollectionBrowser::CollectionBrowser( const char* name ) m_view = new CollectionView( this ); m_view->installEventFilter( this ); - m_configureAction = new KAction( i18n( "Configure Folders" ), Amarok::icon( "configure" ), 0, this, SLOT( setupDirs() ), ac, "Configure" ); - m_treeViewAction = new KRadioAction( i18n( "Tree View" ), "view_tree", 0, m_view, SLOT( setTreeMode() ), ac, "Tree View" ); - m_flatViewAction = new KRadioAction( i18n( "Flat View" ), "view_detailed", 0, m_view, SLOT( setFlatMode() ), ac, "Flat View" ); - m_ipodViewAction = new KRadioAction( i18n( "iPod View" ), Amarok::icon("device"), 0, m_view, SLOT( setIpodMode() ), ac, "iPod View" ); + m_configureAction = new KAction( i18n( "Configure Folders" ), Amarok::icon( "configure" ), 0, this, TQT_SLOT( setupDirs() ), ac, "Configure" ); + m_treeViewAction = new KRadioAction( i18n( "Tree View" ), "view_tree", 0, m_view, TQT_SLOT( setTreeMode() ), ac, "Tree View" ); + m_flatViewAction = new KRadioAction( i18n( "Flat View" ), "view_detailed", 0, m_view, TQT_SLOT( setFlatMode() ), ac, "Flat View" ); + m_ipodViewAction = new KRadioAction( i18n( "iPod View" ), Amarok::icon("device"), 0, m_view, TQT_SLOT( setIpodMode() ), ac, "iPod View" ); m_treeViewAction->setExclusiveGroup("view mode"); m_flatViewAction->setExclusiveGroup("view mode"); m_ipodViewAction->setExclusiveGroup("view mode"); @@ -169,7 +169,7 @@ CollectionBrowser::CollectionBrowser( const char* name ) break; } - m_showDividerAction = new KToggleAction( i18n( "Show Divider" ), "leftjust", 0, this, SLOT( toggleDivider() ), ac, "Show Divider" ); + m_showDividerAction = new KToggleAction( i18n( "Show Divider" ), "leftjust", 0, this, TQT_SLOT( toggleDivider() ), ac, "Show Divider" ); m_showDividerAction->setChecked(m_view->m_showDivider); @@ -177,12 +177,12 @@ CollectionBrowser::CollectionBrowser( const char* name ) // correspond to moving forward / backward in the iPod collection // browser window; see the "For iPod-style navigation" comments below. m_ipodDecrement = new KAction( i18n( "Browse backward" ), - QIconSet( m_view->ipodDecrementIcon(), QIconSet::Small ), - 0, m_view, SLOT( decrementDepth() ), ac, + TQIconSet( m_view->ipodDecrementIcon(), TQIconSet::Small ), + 0, m_view, TQT_SLOT( decrementDepth() ), ac, "iPod Decrement" ); m_ipodIncrement = new KAction( i18n( "Browse forward" ), - QIconSet( m_view->ipodIncrementIcon(), QIconSet::Small ), - 0, m_view, SLOT( incrementDepth() ), ac, + TQIconSet( m_view->ipodIncrementIcon(), TQIconSet::Small ), + 0, m_view, TQT_SLOT( incrementDepth() ), ac, "iPod Increment" ); m_ipodDecrement->plug( m_ipodToolbar ); m_ipodIncrement->plug( m_ipodToolbar ); @@ -195,17 +195,17 @@ CollectionBrowser::CollectionBrowser( const char* name ) m_tagfilterMenuButton->setDelayed( false ); // FIXME: either both or nothing //m_tagfilterMenuButton->setEnabled( m_view->m_viewMode == CollectionView::modeTreeView ); - //connect ( m_treeViewAction, SIGNAL ( toggled(bool) ), m_tagfilterMenuButton, SLOT( setEnabled (bool) ) ); + //connect ( m_treeViewAction, TQT_SIGNAL ( toggled(bool) ), m_tagfilterMenuButton, TQT_SLOT( setEnabled (bool) ) ); layoutToolbar(); m_categoryMenu = m_tagfilterMenuButton->popupMenu(); - m_categoryMenu->insertItem( i18n( "Artist" ), m_view, SLOT( presetMenu( int ) ), 0, IdArtist ); - m_categoryMenu->insertItem( i18n( "Artist / Album" ), m_view, SLOT( presetMenu( int ) ), 0, IdArtistAlbum ); - m_categoryMenu->insertItem( i18n( "Artist" )+" / "+ i18n( "Year" ) + i18n( " - " ) + i18n( "Album" ), m_view, SLOT( presetMenu( int ) ), 0, IdArtistVisYearAlbum ); - m_categoryMenu->insertItem( i18n( "Album" ), m_view, SLOT( presetMenu( int ) ), 0, IdAlbum ); - m_categoryMenu->insertItem( i18n( "Genre / Artist" ), m_view, SLOT( presetMenu( int ) ), 0, IdGenreArtist ); - m_categoryMenu->insertItem( i18n( "Genre / Artist / Album" ), m_view, SLOT( presetMenu( int ) ), 0, IdGenreArtistAlbum ); + m_categoryMenu->insertItem( i18n( "Artist" ), m_view, TQT_SLOT( presetMenu( int ) ), 0, IdArtist ); + m_categoryMenu->insertItem( i18n( "Artist / Album" ), m_view, TQT_SLOT( presetMenu( int ) ), 0, IdArtistAlbum ); + m_categoryMenu->insertItem( i18n( "Artist" )+" / "+ i18n( "Year" ) + i18n( " - " ) + i18n( "Album" ), m_view, TQT_SLOT( presetMenu( int ) ), 0, IdArtistVisYearAlbum ); + m_categoryMenu->insertItem( i18n( "Album" ), m_view, TQT_SLOT( presetMenu( int ) ), 0, IdAlbum ); + m_categoryMenu->insertItem( i18n( "Genre / Artist" ), m_view, TQT_SLOT( presetMenu( int ) ), 0, IdGenreArtist ); + m_categoryMenu->insertItem( i18n( "Genre / Artist / Album" ), m_view, TQT_SLOT( presetMenu( int ) ), 0, IdGenreArtistAlbum ); m_categoryMenu->insertSeparator(); @@ -213,42 +213,42 @@ CollectionBrowser::CollectionBrowser( const char* name ) m_categoryMenu->insertItem( i18n( "&Second Level"), m_cat2Menu ); m_categoryMenu->insertItem( i18n( "&Third Level" ), m_cat3Menu ); - m_cat1Menu ->insertItem( i18n( "&Album" ), m_view, SLOT( cat1Menu( int ) ), 0, IdAlbum ); - m_cat1Menu ->insertItem( i18n( "(Y&ear) - Album" ), m_view, SLOT( cat1Menu( int ) ), 0, IdVisYearAlbum); - m_cat1Menu ->insertItem( i18n( "A&rtist"), m_view, SLOT( cat1Menu( int ) ), 0, IdArtist ); - m_cat1Menu ->insertItem( i18n( "&Composer"), m_view, SLOT( cat1Menu( int ) ), 0, IdComposer ); - m_cat1Menu ->insertItem( i18n( "&Genre" ), m_view, SLOT( cat1Menu( int ) ), 0, IdGenre ); - m_cat1Menu ->insertItem( i18n( "&Year" ), m_view, SLOT( cat1Menu( int ) ), 0, IdYear ); - m_cat1Menu ->insertItem( i18n( "&Label" ), m_view, SLOT( cat1Menu( int ) ), 0, IdLabel ); + m_cat1Menu ->insertItem( i18n( "&Album" ), m_view, TQT_SLOT( cat1Menu( int ) ), 0, IdAlbum ); + m_cat1Menu ->insertItem( i18n( "(Y&ear) - Album" ), m_view, TQT_SLOT( cat1Menu( int ) ), 0, IdVisYearAlbum); + m_cat1Menu ->insertItem( i18n( "A&rtist"), m_view, TQT_SLOT( cat1Menu( int ) ), 0, IdArtist ); + m_cat1Menu ->insertItem( i18n( "&Composer"), m_view, TQT_SLOT( cat1Menu( int ) ), 0, IdComposer ); + m_cat1Menu ->insertItem( i18n( "&Genre" ), m_view, TQT_SLOT( cat1Menu( int ) ), 0, IdGenre ); + m_cat1Menu ->insertItem( i18n( "&Year" ), m_view, TQT_SLOT( cat1Menu( int ) ), 0, IdYear ); + m_cat1Menu ->insertItem( i18n( "&Label" ), m_view, TQT_SLOT( cat1Menu( int ) ), 0, IdLabel ); - m_cat2Menu ->insertItem( i18n( "&None" ), m_view, SLOT( cat2Menu( int ) ), 0, IdNone ); + m_cat2Menu ->insertItem( i18n( "&None" ), m_view, TQT_SLOT( cat2Menu( int ) ), 0, IdNone ); m_cat2Menu ->insertSeparator(); - m_cat2Menu ->insertItem( i18n( "&Album" ), m_view, SLOT( cat2Menu( int ) ), 0, IdAlbum ); - m_cat2Menu ->insertItem( i18n( "(Y&ear) - Album" ), m_view, SLOT( cat2Menu( int ) ), 0, IdVisYearAlbum); - m_cat2Menu ->insertItem( i18n( "A&rtist" ), m_view, SLOT( cat2Menu( int ) ), 0, IdArtist ); - m_cat2Menu ->insertItem( i18n( "&Composer"), m_view, SLOT( cat2Menu( int ) ), 0, IdComposer ); - m_cat2Menu ->insertItem( i18n( "&Genre" ), m_view, SLOT( cat2Menu( int ) ), 0, IdGenre ); - m_cat2Menu ->insertItem( i18n( "&Year" ), m_view, SLOT( cat2Menu( int ) ), 0, IdYear ); - m_cat2Menu ->insertItem( i18n( "&Label" ), m_view, SLOT( cat2Menu( int ) ), 0, IdLabel ); - - m_cat3Menu ->insertItem( i18n( "&None" ), m_view, SLOT( cat3Menu( int ) ), 0, IdNone ); + m_cat2Menu ->insertItem( i18n( "&Album" ), m_view, TQT_SLOT( cat2Menu( int ) ), 0, IdAlbum ); + m_cat2Menu ->insertItem( i18n( "(Y&ear) - Album" ), m_view, TQT_SLOT( cat2Menu( int ) ), 0, IdVisYearAlbum); + m_cat2Menu ->insertItem( i18n( "A&rtist" ), m_view, TQT_SLOT( cat2Menu( int ) ), 0, IdArtist ); + m_cat2Menu ->insertItem( i18n( "&Composer"), m_view, TQT_SLOT( cat2Menu( int ) ), 0, IdComposer ); + m_cat2Menu ->insertItem( i18n( "&Genre" ), m_view, TQT_SLOT( cat2Menu( int ) ), 0, IdGenre ); + m_cat2Menu ->insertItem( i18n( "&Year" ), m_view, TQT_SLOT( cat2Menu( int ) ), 0, IdYear ); + m_cat2Menu ->insertItem( i18n( "&Label" ), m_view, TQT_SLOT( cat2Menu( int ) ), 0, IdLabel ); + + m_cat3Menu ->insertItem( i18n( "&None" ), m_view, TQT_SLOT( cat3Menu( int ) ), 0, IdNone ); m_cat3Menu ->insertSeparator(); - m_cat3Menu ->insertItem( i18n( "A&lbum" ), m_view, SLOT( cat3Menu( int ) ), 0, IdAlbum ); - m_cat3Menu ->insertItem( i18n( "(Y&ear) - Album" ), m_view, SLOT( cat3Menu( int ) ), 0, IdVisYearAlbum); - m_cat3Menu ->insertItem( i18n( "A&rtist" ), m_view, SLOT( cat3Menu( int ) ), 0, IdArtist ); - m_cat3Menu ->insertItem( i18n( "&Composer"), m_view, SLOT( cat3Menu( int ) ), 0, IdComposer ); - m_cat3Menu ->insertItem( i18n( "&Genre" ), m_view, SLOT( cat3Menu( int ) ), 0, IdGenre ); - m_cat3Menu ->insertItem( i18n( "&Year" ), m_view, SLOT( cat3Menu( int ) ), 0, IdYear ); - m_cat3Menu ->insertItem( i18n( "&Label" ), m_view, SLOT( cat3Menu( int ) ), 0, IdLabel ); + m_cat3Menu ->insertItem( i18n( "A&lbum" ), m_view, TQT_SLOT( cat3Menu( int ) ), 0, IdAlbum ); + m_cat3Menu ->insertItem( i18n( "(Y&ear) - Album" ), m_view, TQT_SLOT( cat3Menu( int ) ), 0, IdVisYearAlbum); + m_cat3Menu ->insertItem( i18n( "A&rtist" ), m_view, TQT_SLOT( cat3Menu( int ) ), 0, IdArtist ); + m_cat3Menu ->insertItem( i18n( "&Composer"), m_view, TQT_SLOT( cat3Menu( int ) ), 0, IdComposer ); + m_cat3Menu ->insertItem( i18n( "&Genre" ), m_view, TQT_SLOT( cat3Menu( int ) ), 0, IdGenre ); + m_cat3Menu ->insertItem( i18n( "&Year" ), m_view, TQT_SLOT( cat3Menu( int ) ), 0, IdYear ); + m_cat3Menu ->insertItem( i18n( "&Label" ), m_view, TQT_SLOT( cat3Menu( int ) ), 0, IdLabel ); m_view->cat1Menu( m_view->m_cat1, false ); m_view->cat2Menu( m_view->m_cat2, false ); m_view->cat3Menu( m_view->m_cat3, false ); m_view->setViewMode( m_view->m_viewMode ); - connect( m_timer, SIGNAL( timeout() ), SLOT( slotSetFilter() ) ); - connect( m_searchEdit, SIGNAL( textChanged( const QString& ) ), SLOT( slotSetFilterTimeout() ) ); - connect( m_timeFilter, SIGNAL( activated( int ) ), SLOT( slotSetFilter() ) ); + connect( m_timer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotSetFilter() ) ); + connect( m_searchEdit, TQT_SIGNAL( textChanged( const TQString& ) ), TQT_SLOT( slotSetFilterTimeout() ) ); + connect( m_timeFilter, TQT_SIGNAL( activated( int ) ), TQT_SLOT( slotSetFilter() ) ); setFocusProxy( m_view ); //default object to get focus } @@ -258,8 +258,8 @@ CollectionBrowser::slotClearFilter() //SLOT { m_searchEdit->clear(); kapp->processEvents(); //Let the search bar redraw fully. - QTimer::singleShot( 0, this, SLOT( slotSetFilter() ) ); //Filter instantly - QTimer::singleShot( 0, m_view, SLOT( slotEnsureSelectedItemVisible() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( slotSetFilter() ) ); //Filter instantly + TQTimer::singleShot( 0, m_view, TQT_SLOT( slotEnsureSelectedItemVisible() ) ); } void @@ -283,19 +283,19 @@ CollectionBrowser::slotSetFilter() //SLOT } void -CollectionBrowser::slotSetFilter( const QString &filter ) //SLOT +CollectionBrowser::slotSetFilter( const TQString &filter ) //SLOT { m_searchEdit->setText( filter ); kapp->processEvents(); //Let the search bar redraw fully. - QTimer::singleShot( 0, this, SLOT( slotSetFilter() ) ); //Filter instantly - QTimer::singleShot( 0, m_view, SLOT( slotEnsureSelectedItemVisible() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( slotSetFilter() ) ); //Filter instantly + TQTimer::singleShot( 0, m_view, TQT_SLOT( slotEnsureSelectedItemVisible() ) ); } void CollectionBrowser::slotEditFilter() //SLOT { EditFilterDialog *cod = new EditFilterDialog( this, false, m_searchEdit->text() ); - connect( cod, SIGNAL(filterChanged(const QString &)), SLOT(slotSetFilter(const QString &)) ); + connect( cod, TQT_SIGNAL(filterChanged(const TQString &)), TQT_SLOT(slotSetFilter(const TQString &)) ); if( cod->exec() ) m_searchEdit->setText( cod->filter() ); delete cod; @@ -326,15 +326,15 @@ CollectionBrowser::appendSearchResults() } bool -CollectionBrowser::eventFilter( QObject *o, QEvent *e ) +CollectionBrowser::eventFilter( TQObject *o, TQEvent *e ) { switch( e->type() ) { - case 6/*QEvent::KeyPress*/: + case 6/*TQEvent::KeyPress*/: //there are a few keypresses that we intercept - #define e static_cast(e) + #define e static_cast(e) if( o == m_searchEdit ) //the search lineedit { @@ -345,7 +345,7 @@ CollectionBrowser::eventFilter( QObject *o, QEvent *e ) case Key_PageDown: case Key_PageUp: m_view->setFocus(); - QApplication::sendEvent( m_view, e ); + TQApplication::sendEvent( m_view, e ); return true; case Key_Escape: @@ -359,7 +359,7 @@ CollectionBrowser::eventFilter( QObject *o, QEvent *e ) //Immediately filter and add results m_timer->stop(); m_returnPressed = true; - QTimer::singleShot( 0, this, SLOT( slotSetFilter() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( slotSetFilter() ) ); } else { @@ -381,7 +381,7 @@ CollectionBrowser::eventFilter( QObject *o, QEvent *e ) if( ( e->key() >= Key_0 && e->key() <= Key_Z ) || e->key() == Key_Backspace || e->key() == Key_Escape ) { m_searchEdit->setFocus(); - QApplication::sendEvent( m_searchEdit, e ); + TQApplication::sendEvent( m_searchEdit, e ); return true; } #undef e @@ -391,7 +391,7 @@ CollectionBrowser::eventFilter( QObject *o, QEvent *e ) break; } - return QVBox::eventFilter( o, e ); + return TQVBox::eventFilter( o, e ); } void @@ -452,7 +452,7 @@ CollectionView::CollectionView( CollectionBrowser* parent ) DEBUG_FUNC_INFO m_instance = this; - setSelectionMode( QListView::Extended ); + setSelectionMode( TQListView::Extended ); setItemsMovable( false ); setSorting( 0 ); setShowSortIndicator( true ); @@ -486,44 +486,44 @@ CollectionView::CollectionView( CollectionBrowser* parent ) updateTrackDepth(); m_flatColumnWidths.clear(); - QStringList flatWidths = config->readListEntry( "FlatColumnWidths" ); - for( QStringList::iterator it = flatWidths.begin(); + TQStringList flatWidths = config->readListEntry( "FlatColumnWidths" ); + for( TQStringList::iterator it = flatWidths.begin(); it != flatWidths.end(); it++ ) m_flatColumnWidths.push_back( (*it).toInt() ); // KActionCollection* ac = new KActionCollection( this ); - KStdAction::selectAll( this, SLOT( selectAll() ), ac, "collectionview_select_all" ); - - connect( CollectionDB::instance(), SIGNAL( scanStarted() ), - this, SLOT( scanStarted() ) ); - connect( CollectionDB::instance(), SIGNAL( scanDone( bool ) ), - this, SLOT( scanDone( bool ) ) ); - connect( BrowserBar::instance(), SIGNAL( browserActivated( int ) ), - this, SLOT( renderView() ) ); // renderView() checks if current tab is this - connect( CollectionDB::instance(), SIGNAL( ratingChanged( const QString&, int ) ), - this, SLOT( ratingChanged( const QString&, int ) ) ); - - connect( this, SIGNAL( expanded( QListViewItem* ) ), - this, SLOT( slotExpand( QListViewItem* ) ) ); - connect( this, SIGNAL( collapsed( QListViewItem* ) ), - this, SLOT( slotCollapse( QListViewItem* ) ) ); - connect( this, SIGNAL( returnPressed( QListViewItem* ) ), - this, SLOT( invokeItem( QListViewItem* ) ) ); - connect( this, SIGNAL( doubleClicked( QListViewItem*, const QPoint&, int ) ), - this, SLOT( invokeItem( QListViewItem*, const QPoint&, int ) ) ); - connect( this, SIGNAL( clicked( QListViewItem*, const QPoint&, int ) ), - this, SLOT( ipodItemClicked( QListViewItem*, const QPoint&, int ) ) ); - connect( this, SIGNAL( contextMenuRequested( QListViewItem*, const QPoint&, int ) ), - this, SLOT( rmbPressed( QListViewItem*, const QPoint&, int ) ) ); - connect( header(), SIGNAL( sizeChange( int, int, int ) ), - this, SLOT( triggerUpdate() ) ); - - connect( MountPointManager::instance(), SIGNAL( mediumConnected( int ) ), - this, SLOT( databaseChanged() ) ); - connect( MountPointManager::instance(), SIGNAL( mediumRemoved( int ) ), - this, SLOT( databaseChanged() ) ); + KStdAction::selectAll( this, TQT_SLOT( selectAll() ), ac, "collectionview_select_all" ); + + connect( CollectionDB::instance(), TQT_SIGNAL( scanStarted() ), + this, TQT_SLOT( scanStarted() ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( scanDone( bool ) ), + this, TQT_SLOT( scanDone( bool ) ) ); + connect( BrowserBar::instance(), TQT_SIGNAL( browserActivated( int ) ), + this, TQT_SLOT( renderView() ) ); // renderView() checks if current tab is this + connect( CollectionDB::instance(), TQT_SIGNAL( ratingChanged( const TQString&, int ) ), + this, TQT_SLOT( ratingChanged( const TQString&, int ) ) ); + + connect( this, TQT_SIGNAL( expanded( TQListViewItem* ) ), + this, TQT_SLOT( slotExpand( TQListViewItem* ) ) ); + connect( this, TQT_SIGNAL( collapsed( TQListViewItem* ) ), + this, TQT_SLOT( slotCollapse( TQListViewItem* ) ) ); + connect( this, TQT_SIGNAL( returnPressed( TQListViewItem* ) ), + this, TQT_SLOT( invokeItem( TQListViewItem* ) ) ); + connect( this, TQT_SIGNAL( doubleClicked( TQListViewItem*, const TQPoint&, int ) ), + this, TQT_SLOT( invokeItem( TQListViewItem*, const TQPoint&, int ) ) ); + connect( this, TQT_SIGNAL( clicked( TQListViewItem*, const TQPoint&, int ) ), + this, TQT_SLOT( ipodItemClicked( TQListViewItem*, const TQPoint&, int ) ) ); + connect( this, TQT_SIGNAL( contextMenuRequested( TQListViewItem*, const TQPoint&, int ) ), + this, TQT_SLOT( rmbPressed( TQListViewItem*, const TQPoint&, int ) ) ); + connect( header(), TQT_SIGNAL( sizeChange( int, int, int ) ), + this, TQT_SLOT( triggerUpdate() ) ); + + connect( MountPointManager::instance(), TQT_SIGNAL( mediumConnected( int ) ), + this, TQT_SLOT( databaseChanged() ) ); + connect( MountPointManager::instance(), TQT_SIGNAL( mediumRemoved( int ) ), + this, TQT_SLOT( databaseChanged() ) ); } @@ -537,11 +537,11 @@ CollectionView::~CollectionView() { config->writeEntry( "ViewMode", m_viewMode ); config->writeEntry( "ShowDivider", m_showDivider ); - QStringList flatWidths; - for( QValueList::iterator it = m_flatColumnWidths.begin(); + TQStringList flatWidths; + for( TQValueList::iterator it = m_flatColumnWidths.begin(); it != m_flatColumnWidths.end(); it++ ) - flatWidths.push_back( QString::number( (*it) ) ); + flatWidths.push_back( TQString::number( (*it) ) ); config->writeEntry( "FlatColumnWidths", flatWidths ); } @@ -561,9 +561,9 @@ CollectionView::setShowDivider( bool show ) // necessary. When Left or Right is pressed and we are viewing in // iPod mode, the iPod "move forward / backward" actions are activated. void -CollectionView::keyPressEvent( QKeyEvent *e ) +CollectionView::keyPressEvent( TQKeyEvent *e ) { - typedef QListViewItemIterator It; + typedef TQListViewItemIterator It; // Reimplement up and down to skip dividers and to loop around. // Some of this code used to be in CollectionBrowser::eventFilter. @@ -577,7 +577,7 @@ CollectionView::keyPressEvent( QKeyEvent *e ) // Handle both up and down at once to avoid code duplication (it's // a delicate piece of logic, and was hard to get right) - QListViewItem *cur = currentItem(); + TQListViewItem *cur = currentItem(); #define nextItem (e->key() == Key_Up ? cur->itemAbove() : cur->itemBelow()) @@ -607,11 +607,11 @@ CollectionView::keyPressEvent( QKeyEvent *e ) // Wrap around if necessary, by sending a Key_Home/Key_End event. if( wraparound ) { - QKeyEvent e2 ( e->type(), + TQKeyEvent e2 ( e->type(), (e->key() == Key_Up ? Key_End : Key_Home), 0, e->state(), - QString::null, e->isAutoRepeat(), e->count() ); - QApplication::sendEvent( this, &e2 ); + TQString::null, e->isAutoRepeat(), e->count() ); + TQApplication::sendEvent( this, &e2 ); cur = currentItem(); // The first item may also be a divider, so keep moving @@ -723,7 +723,7 @@ CollectionView::setupDirs() //SLOT // Make the dialog a bit bigger, default is too small to be useful dialog.resize( dialog.width() + 50, dialog.height() + 150 ); - if ( dialog.exec() != QDialog::Rejected ) + if ( dialog.exec() != TQDialog::Rejected ) { const bool rescan = ( MountPointManager::instance()->collectionFolders() != setup->dirs() ); setup->writeConfig(); @@ -758,16 +758,16 @@ CollectionView::slotEnsureSelectedItemVisible() //SLOT //Scroll to make sure the first selected item is visible //Find the first selected item - QListViewItem *r=0; - for ( QListViewItem *i = firstChild(); i && !r; i=i->nextSibling() ) + TQListViewItem *r=0; + for ( TQListViewItem *i = firstChild(); i && !r; i=i->nextSibling() ) { if ( i->isSelected() ) r = i; - for ( QListViewItem *j = i->firstChild(); j && !r; j=j->nextSibling() ) + for ( TQListViewItem *j = i->firstChild(); j && !r; j=j->nextSibling() ) { if ( j->isSelected() ) r = j; - for ( QListViewItem *k = j->firstChild(); k && !r; k=k->nextSibling() ) + for ( TQListViewItem *k = j->firstChild(); k && !r; k=k->nextSibling() ) { if ( k->isSelected() ) r = k; @@ -787,7 +787,7 @@ CollectionView::slotEnsureSelectedItemVisible() //SLOT //Create a reverse list of parents, grandparents etc. //Later we try to make the grandparents in view, then their children etc. //This means that the selected item has the most priority as it is done last. - QValueStack parents; + TQValueStack parents; while ( r ) { parents.push( r ); @@ -806,12 +806,12 @@ CollectionView::slotEnsureSelectedItemVisible() //SLOT } void -CollectionView::slotExpand( QListViewItem* item ) //SLOT +CollectionView::slotExpand( TQListViewItem* item ) //SLOT { if ( !item || !item->isExpandable() ) return; int category = 0; - QStringList values; + TQStringList values; QueryBuilder qb; bool c = false; @@ -824,7 +824,7 @@ CollectionView::slotExpand( QListViewItem* item ) //SLOT SortbyTrackFirst = true; // initialization for year - album mode - QString tmptext; + TQString tmptext; int VisYearAlbum = -1; int VisLabel = -1; int q_cat1=m_cat1; @@ -864,9 +864,9 @@ CollectionView::slotExpand( QListViewItem* item ) //SLOT } if ( translateTimeFilter( timeFilter() ) > 0 ) - qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, QString().setNum( QDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater ); + qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater ); - QString itemText; + TQString itemText; bool isUnknown; if ( dynamic_cast( item ) ) @@ -891,7 +891,7 @@ CollectionView::slotExpand( QListViewItem* item ) //SLOT if( VisYearAlbum == 1 ) { tmptext = item->text( 0 ); - QString year = tmptext.left( tmptext.find( i18n(" - ") ) ); + TQString year = tmptext.left( tmptext.find( i18n(" - ") ) ); yearAlbumCalc( year, tmptext ); qb.addMatch( QueryBuilder::tabYear, year, false, true ); if ( isUnknown ) @@ -951,7 +951,7 @@ CollectionView::slotExpand( QListViewItem* item ) //SLOT if( VisYearAlbum == 1 ) { tmptext = item->parent()->text( 0 ); - QString year = tmptext.left( tmptext.find( i18n(" - ") ) ); + TQString year = tmptext.left( tmptext.find( i18n(" - ") ) ); yearAlbumCalc( year, tmptext ); qb.addMatch( QueryBuilder::tabYear, year, false, true ); if ( isUnknown ) @@ -972,7 +972,7 @@ CollectionView::slotExpand( QListViewItem* item ) //SLOT if( VisYearAlbum == 2 ) { tmptext = item->text( 0 ); - QString year = tmptext.left( tmptext.find( i18n(" - ") ) ); + TQString year = tmptext.left( tmptext.find( i18n(" - ") ) ); yearAlbumCalc( year, tmptext ); qb.addMatch( QueryBuilder::tabYear, year, false, true ); if ( isUnknown ) @@ -1026,7 +1026,7 @@ CollectionView::slotExpand( QListViewItem* item ) //SLOT if( VisYearAlbum == 1 ) { tmptext = item->parent()->parent()->text( 0 ); - QString year = tmptext.left( tmptext.find( i18n(" - ") ) ); + TQString year = tmptext.left( tmptext.find( i18n(" - ") ) ); yearAlbumCalc( year, tmptext ); qb.addMatch( QueryBuilder::tabYear, year, false, true ); if ( isUnknown ) @@ -1049,7 +1049,7 @@ CollectionView::slotExpand( QListViewItem* item ) //SLOT if( VisYearAlbum == 2 ) { tmptext = item->parent()->text( 0 ); - QString year = tmptext.left( tmptext.find( i18n(" - ") ) ); + TQString year = tmptext.left( tmptext.find( i18n(" - ") ) ); yearAlbumCalc( year, tmptext ); qb.addMatch( QueryBuilder::tabYear, year, false, true ); if ( isUnknown ) @@ -1064,7 +1064,7 @@ CollectionView::slotExpand( QListViewItem* item ) //SLOT if( VisYearAlbum == 3 ) { tmptext = item->text( 0 ); - QString year = tmptext.left( tmptext.find( i18n(" - ") ) ); + TQString year = tmptext.left( tmptext.find( i18n(" - ") ) ); yearAlbumCalc( year, tmptext ); qb.addMatch( QueryBuilder::tabYear, year, false, true ); if ( isUnknown ) @@ -1100,7 +1100,7 @@ CollectionView::slotExpand( QListViewItem* item ) //SLOT values = qb.run(); uint countReturnValues = qb.countReturnValues(); - QPixmap pixmap; + TQPixmap pixmap; bool expandable = category != IdNone; if ( expandable ) pixmap = iconForCategory( category ); @@ -1111,7 +1111,7 @@ CollectionView::slotExpand( QListViewItem* item ) //SLOT for ( int i = values.count() - countReturnValues; i >= 0; i -= countReturnValues ) { - QString text; + TQString text; bool unknown=false; if ( category == IdVisYearAlbum ) @@ -1156,13 +1156,13 @@ CollectionView::slotExpand( QListViewItem* item ) //SLOT { CollectionItem *i = static_cast( item ); if ( i->m_cat == IdAlbum || i->m_cat == IdVisYearAlbum ) - i->setPixmap( 0, QPixmap() ); //The pixmap given is unimportant. The cover is used. + i->setPixmap( 0, TQPixmap() ); //The pixmap given is unimportant. The cover is used. } } void -CollectionView::slotCollapse( QListViewItem* item ) //SLOT +CollectionView::slotCollapse( TQListViewItem* item ) //SLOT { //On collapse, go back from showing the cover to showing the icon for albums if ( dynamic_cast( item ) ) @@ -1172,8 +1172,8 @@ CollectionView::slotCollapse( QListViewItem* item ) //SLOT i->setPixmap( 0, iconForCategory( i->m_cat ) ); } - QListViewItem* child = item->firstChild(); - QListViewItem* childTmp; + TQListViewItem* child = item->firstChild(); + TQListViewItem* childTmp; //delete all children while ( child ) @@ -1185,10 +1185,10 @@ CollectionView::slotCollapse( QListViewItem* item ) //SLOT } void -CollectionView::ratingChanged( const QString&, int ) +CollectionView::ratingChanged( const TQString&, int ) { m_dirty = true; - QTimer::singleShot( 0, CollectionView::instance(), SLOT( renderView() ) ); + TQTimer::singleShot( 0, CollectionView::instance(), TQT_SLOT( renderView() ) ); } void @@ -1335,19 +1335,19 @@ CollectionView::enableCat3Menu( bool enable ) void -CollectionView::invokeItem( QListViewItem* i, const QPoint& point, int column ) //SLOT +CollectionView::invokeItem( TQListViewItem* i, const TQPoint& point, int column ) //SLOT { if( column == -1 ) return; - QPoint p = mapFromGlobal( point ); + TQPoint p = mapFromGlobal( point ); if ( p.x() > header()->sectionPos( header()->mapToIndex( 0 ) ) + treeStepSize() * ( i->depth() + ( rootIsDecorated() ? 1 : 0) ) + itemMargin() || p.x() < header()->sectionPos( header()->mapToIndex( 0 ) ) ) invokeItem( i ); } void -CollectionView::invokeItem( QListViewItem* item ) //SLOT +CollectionView::invokeItem( TQListViewItem* item ) //SLOT { if ( !item || dynamic_cast(item) ) return; @@ -1366,7 +1366,7 @@ CollectionView::invokeItem( QListViewItem* item ) //SLOT // This slot is here to handle clicks on the right-arrow buttons // in iPod browsing mode void -CollectionView::ipodItemClicked( QListViewItem *item, const QPoint&, int c ) +CollectionView::ipodItemClicked( TQListViewItem *item, const TQPoint&, int c ) { if( item == 0 || c == 0 ) return; @@ -1374,12 +1374,12 @@ CollectionView::ipodItemClicked( QListViewItem *item, const QPoint&, int c ) return; // The Qt manual says NOT to delete items from within this slot - QTimer::singleShot( 0, m_parent->m_ipodIncrement, SLOT( activate() ) ); + TQTimer::singleShot( 0, m_parent->m_ipodIncrement, TQT_SLOT( activate() ) ); } void -CollectionView::rmbPressed( QListViewItem* item, const QPoint& point, int ) //SLOT +CollectionView::rmbPressed( TQListViewItem* item, const TQPoint& point, int ) //SLOT { if ( dynamic_cast( item ) ) return; @@ -1421,9 +1421,9 @@ CollectionView::rmbPressed( QListViewItem* item, const QPoint& point, int ) //SL COMPILATION_SET, COMPILATION_UNSET, ORGANIZE, DELETE, TRASH, FILE_MENU }; - QString trueItemText = getTrueItemText( cat, item ); + TQString trueItemText = getTrueItemText( cat, item ); KURL::List selection = listSelected(); - QStringList siblingSelection = listSelectedSiblingsOf( cat, item ); + TQStringList siblingSelection = listSelectedSiblingsOf( cat, item ); menu.insertItem( SmallIconSet( Amarok::icon( "files" ) ), i18n( "&Load" ), MAKE ); menu.insertItem( SmallIconSet( Amarok::icon( "add_playlist" ) ), i18n( "&Append to Playlist" ), APPEND ); @@ -1471,7 +1471,7 @@ CollectionView::rmbPressed( QListViewItem* item, const QPoint& point, int ) //SL if( (cat == IdAlbum || cat == IdVisYearAlbum) && siblingSelection.count() == 1 ) // cover fetch isn't multiselection capable { - menu.insertItem( SmallIconSet( Amarok::icon( "download" ) ), i18n( "&Fetch Cover From amazon.%1" ).arg( CoverManager::amazonTld() ), this, SLOT( fetchCover() ), 0, FETCH ); + menu.insertItem( SmallIconSet( Amarok::icon( "download" ) ), i18n( "&Fetch Cover From amazon.%1" ).arg( CoverManager::amazonTld() ), this, TQT_SLOT( fetchCover() ), 0, FETCH ); #ifndef AMAZON_SUPPORT menu.setItemEnabled( FETCH, false ); #endif @@ -1491,7 +1491,7 @@ CollectionView::rmbPressed( QListViewItem* item, const QPoint& point, int ) //SL menu.insertItem( SmallIconSet( Amarok::icon( "info" ) ) , i18n( "Edit Track &Information...", "Edit &Information for %n Tracks...", selection.count()) - , this, SLOT( showTrackInfo() ), 0, INFO ); + , this, TQT_SLOT( showTrackInfo() ), 0, INFO ); switch( menu.exec( point ) ) { @@ -1523,7 +1523,7 @@ CollectionView::rmbPressed( QListViewItem* item, const QPoint& point, int ) //SL } else { - QString artist; + TQString artist; if( item->depth() - artistLevel == 1 ) artist = item->parent()->text( 0 ); else if( item->depth() - artistLevel == 2 ) @@ -1553,7 +1553,7 @@ CollectionView::rmbPressed( QListViewItem* item, const QPoint& point, int ) //SL CollectionDB::instance()->emitFileDeleted( (*it).path() ); } m_dirty = true; - QTimer::singleShot( 0, CollectionView::instance(), SLOT( renderView() ) ); + TQTimer::singleShot( 0, CollectionView::instance(), TQT_SLOT( renderView() ) ); break; } } @@ -1602,25 +1602,25 @@ CollectionView::setViewMode( int mode, bool rerender /*=true*/ ) } void -CollectionItem::setPixmap(int column, const QPixmap & pix) +CollectionItem::setPixmap(int column, const TQPixmap & pix) { //Don't show the cover if the album isn't expanded (for speed) if ( !isOpen() ) { - QListViewItem::setPixmap( column, pix ); + TQListViewItem::setPixmap( column, pix ); return; } //Generate Album name - QString album( text( 0 ) ), artist; + TQString album( text( 0 ) ), artist; if ( m_cat == IdVisYearAlbum ) { - QString pointlessString; + TQString pointlessString; CollectionView::yearAlbumCalc( pointlessString, album ); } else if ( m_cat != IdAlbum ) { - QListViewItem::setPixmap( column, pix ); + TQListViewItem::setPixmap( column, pix ); return; } @@ -1646,7 +1646,7 @@ CollectionItem::setPixmap(int column, const QPixmap & pix) qb.addReturnValue( QueryBuilder::tabArtist, QueryBuilder::valName ); qb.addMatch( QueryBuilder::tabAlbum, QueryBuilder::valName, album ); - QStringList values( qb.run() ); + TQStringList values( qb.run() ); if ( !values.isEmpty() ) artist = values[ 0 ]; @@ -1654,12 +1654,12 @@ CollectionItem::setPixmap(int column, const QPixmap & pix) { //Don't bother trying to create a shadow because it won't work anyway. The //nocover image has intial transparency, so adding the shadow doesn't work. - QListViewItem::setPixmap( column, QPixmap( CollectionDB::instance()->notAvailCover( false, 50 ) ) ); + TQListViewItem::setPixmap( column, TQPixmap( CollectionDB::instance()->notAvailCover( false, 50 ) ) ); return; } } - QListViewItem::setPixmap( column, QPixmap( CollectionDB::instance()->albumImage( artist, album, true, 50 ) ) ); + TQListViewItem::setPixmap( column, TQPixmap( CollectionDB::instance()->albumImage( artist, album, true, 50 ) ) ); } @@ -1684,24 +1684,24 @@ CollectionView::fetchCover() //SLOT break; } - QString album = item->text(0); + TQString album = item->text(0); if( cat == IdVisYearAlbum ) { // we can't use findRev since an album may have " - " within it. - QString sep = i18n(" - "); + TQString sep = i18n(" - "); album = album.right( album.length() - sep.length() - album.find( sep ) ); } // find the first artist's name - QStringList values = - CollectionDB::instance()->query( QString ( + TQStringList values = + CollectionDB::instance()->query( TQString ( "SELECT DISTINCT artist.name FROM artist, album, tags " "WHERE artist.id = tags.artist AND tags.album = album.id " "AND album.name = '%1';" ) .arg( CollectionDB::instance()->escapeString( album ) ) ); if ( !values.isEmpty() ) - CollectionDB::instance()->fetchCover( this, values[0], album, false, static_cast(item) ); + CollectionDB::instance()->fetchCover( this, values[0], album, false, static_cast(item) ); #endif } @@ -1741,11 +1741,11 @@ void CollectionView::cancelOrganizingFiles() } void -CollectionView::organizeFiles( const KURL::List &urls, const QString &caption, bool copy ) //SLOT +CollectionView::organizeFiles( const KURL::List &urls, const TQString &caption, bool copy ) //SLOT { if( m_organizingFileCancelled ) { - QString shortMsg = i18n( "Cannot start organize operation until jobs are aborted." ); + TQString shortMsg = i18n( "Cannot start organize operation until jobs are aborted." ); Amarok::StatusBar::instance()->shortMessage( shortMsg, KDE::StatusBar::Sorry ); return; } @@ -1754,7 +1754,7 @@ CollectionView::organizeFiles( const KURL::List &urls, const QString &caption, b { if( copy != m_organizeCopyMode ) { - QString shortMsg = i18n( "Cannot start organize operation of different kind while another is in progress." ); + TQString shortMsg = i18n( "Cannot start organize operation of different kind while another is in progress." ); Amarok::StatusBar::instance()->shortMessage( shortMsg, KDE::StatusBar::Sorry ); return; } @@ -1766,17 +1766,17 @@ CollectionView::organizeFiles( const KURL::List &urls, const QString &caption, b } } - QStringList folders = MountPointManager::instance()->collectionFolders(); + TQStringList folders = MountPointManager::instance()->collectionFolders(); if( folders.isEmpty() ) { - QString longMsg = i18n( "You need to configure at least one folder for your collection for organizing your files." ); + TQString longMsg = i18n( "You need to configure at least one folder for your collection for organizing your files." ); Amarok::StatusBar::instance()->longMessage( longMsg, KDE::StatusBar::Sorry ); return; } OrganizeCollectionDialogBase base( m_parent, "OrganizeFiles", true, caption, KDialogBase::Ok|KDialogBase::Cancel|KDialogBase::Details ); - QVBox* page = base.makeVBoxMainWidget(); + TQVBox* page = base.makeVBoxMainWidget(); OrganizeCollectionDialog dialog( page ); dialog.folderCombo->insertStringList( folders, 0 ); @@ -1793,7 +1793,7 @@ CollectionView::organizeFiles( const KURL::List &urls, const QString &caption, b dialog.formatEdit->setText( AmarokConfig::customScheme() ); dialog.regexpEdit->setText( AmarokConfig::replacementRegexp() ); dialog.replaceEdit->setText( AmarokConfig::replacementString() ); - connect( &base, SIGNAL(detailsClicked()), &dialog, SLOT(slotDetails()) ); + connect( &base, TQT_SIGNAL(detailsClicked()), &dialog, TQT_SLOT(slotDetails()) ); if( dialog.customschemeCheck->isChecked() ) { @@ -1811,7 +1811,7 @@ CollectionView::organizeFiles( const KURL::List &urls, const QString &caption, b dialog.update( 0 ); } - base.setInitialSize( QSize( 450, 350 ) ); + base.setInitialSize( TQSize( 450, 350 ) ); if( base.exec() == KDialogBase::Accepted ) { @@ -1835,7 +1835,7 @@ CollectionView::organizeFiles( const KURL::List &urls, const QString &caption, b CollectionDB::instance()->createTables( true ); // create temp tables Amarok::StatusBar::instance()->newProgressOperation( this ) .setDescription( caption ) - .setAbortSlot( this, SLOT( cancelOrganizingFiles() ) ) + .setAbortSlot( this, TQT_SLOT( cancelOrganizingFiles() ) ) .setTotalSteps( m_organizeURLs.count() ); while( !m_organizeURLs.empty() && !m_organizingFileCancelled ) @@ -1858,11 +1858,11 @@ CollectionView::organizeFiles( const KURL::List &urls, const QString &caption, b CollectionDB::instance()->dropTables( true ); // and drop them // and now do an incremental scan since this was disabled while organizing files - QTimer::singleShot( 0, CollectionDB::instance(), SLOT( scanMonitor() ) ); + TQTimer::singleShot( 0, CollectionDB::instance(), TQT_SLOT( scanMonitor() ) ); if( !m_organizingFileCancelled && skipped.count() > 0 ) { - QString longMsg = i18n( "The following file could not be organized: ", + TQString longMsg = i18n( "The following file could not be organized: ", "The following %n files could not be organized: ", skipped.count() ); bool first = true; for( KURL::List::iterator it = skipped.begin(); @@ -1877,7 +1877,7 @@ CollectionView::organizeFiles( const KURL::List &urls, const QString &caption, b } longMsg += i18n( "." ); - QString shortMsg = i18n( "Sorry, one file could not be organized.", + TQString shortMsg = i18n( "Sorry, one file could not be organized.", "Sorry, %n files could not be organized.", skipped.count() ); Amarok::StatusBar::instance()->shortLongMessage( shortMsg, longMsg, KDE::StatusBar::Sorry ); } @@ -1888,7 +1888,7 @@ CollectionView::organizeFiles( const KURL::List &urls, const QString &caption, b } m_dirty = true; - QTimer::singleShot( 0, CollectionView::instance(), SLOT( renderView() ) ); + TQTimer::singleShot( 0, CollectionView::instance(), TQT_SLOT( renderView() ) ); Amarok::StatusBar::instance()->endProgressOperation( this ); } } @@ -1898,19 +1898,19 @@ CollectionView::organizeFiles( const KURL::List &urls, const QString &caption, b ////////////////////////////////////////////////////////////////////////////////////////// void -CollectionView::contentsDragEnterEvent( QDragEnterEvent *e ) +CollectionView::contentsDragEnterEvent( TQDragEnterEvent *e ) { e->accept( e->source() != viewport() && e->source() != this && KURLDrag::canDecode( e ) ); } void -CollectionView::contentsDragMoveEvent( QDragMoveEvent *e ) +CollectionView::contentsDragMoveEvent( TQDragMoveEvent *e ) { e->accept( e->source() != viewport() && e->source() != this && KURLDrag::canDecode( e ) ); } void -CollectionView::contentsDropEvent( QDropEvent *e ) +CollectionView::contentsDropEvent( TQDropEvent *e ) { KURL::List list; if( KURLDrag::decode( e, list ) ) @@ -1922,7 +1922,7 @@ CollectionView::contentsDropEvent( QDropEvent *e ) it != list.end(); ++it ) { - if( (*it).isLocalFile() && QFileInfo( (*it).path() ).isDir() ) + if( (*it).isLocalFile() && TQFileInfo( (*it).path() ).isDir() ) expandedList += Amarok::recursiveUrlExpand( *it ); else expandedList += *it; @@ -1933,7 +1933,7 @@ CollectionView::contentsDropEvent( QDropEvent *e ) it != expandedList.end(); ++it ) { - QString proto = (*it).protocol(); + TQString proto = (*it).protocol(); if( !MetaBundle::isKioUrl( *it ) ) invalid++; else if( (*it).isLocalFile() && CollectionDB::instance()->isFileInCollection( (*it).path() ) ) @@ -1942,7 +1942,7 @@ CollectionView::contentsDropEvent( QDropEvent *e ) cleanList += *it; } - QString msg; + TQString msg; if( dropped > 0 ) msg += i18n( "One file already in collection", "%n files already in collection", dropped ); @@ -1961,7 +1961,7 @@ CollectionView::contentsDropEvent( QDropEvent *e ) } void -CollectionView::dropProxyEvent( QDropEvent *e ) +CollectionView::dropProxyEvent( TQDropEvent *e ) { contentsDropEvent( e ); } @@ -1973,10 +1973,10 @@ CollectionView::safeClear() blockSignals( true ); clearSelection(); - QMap *itemCoverMap = CollectionDB::instance()->getItemCoverMap(); - QMutex* itemCoverMapMutex = CollectionDB::instance()->getItemCoverMapMutex(); - QListViewItem *c = firstChild(); - QListViewItem *n; + TQMap *itemCoverMap = CollectionDB::instance()->getItemCoverMap(); + TQMutex* itemCoverMapMutex = CollectionDB::instance()->getItemCoverMapMutex(); + TQListViewItem *c = firstChild(); + TQListViewItem *n; itemCoverMapMutex->lock(); while( c ) { if( itemCoverMap->contains( c ) ) @@ -1999,7 +1999,7 @@ CollectionView::updateColumnHeader() if ( m_viewMode == modeFlatView ) { - setResizeMode( QListView::NoColumn ); + setResizeMode( TQListView::NoColumn ); if( m_flatColumnWidths.size() == 0 ) { @@ -2077,9 +2077,9 @@ CollectionView::updateColumnHeader() setColumnAlignment( Playcount, Qt::AlignCenter ); setColumnAlignment( BPM, Qt::AlignRight ); - //QListView allows invisible columns to be resized, so we disable resizing for them + //TQListView allows invisible columns to be resized, so we disable resizing for them for ( int i = 0; i < columns(); ++i ) { - setColumnWidthMode ( i, QListView::Manual ); + setColumnWidthMode ( i, TQListView::Manual ); if ( columnWidth( i ) == 0 ) header()->setResizeEnabled( false, i ); } @@ -2087,9 +2087,9 @@ CollectionView::updateColumnHeader() } else if ( m_viewMode == modeTreeView ) { - setResizeMode( QListView::LastColumn ); + setResizeMode( TQListView::LastColumn ); - QString caption = captionForCategory( m_cat1 ); + TQString caption = captionForCategory( m_cat1 ); int catArr[2] = {m_cat2, m_cat3}; for(int i = 0; i < 2; i++) { @@ -2107,7 +2107,7 @@ CollectionView::updateColumnHeader() // right-arrow pixmap. In any case we're not in tree mode. else if ( m_viewMode == modeIpodView ) { - QString caption; + TQString caption; if( m_currentDepth == trackDepth() ) caption = i18n( "Tracks" ); @@ -2122,7 +2122,7 @@ CollectionView::updateColumnHeader() if( m_currentDepth != trackDepth() ) { - QPixmap pixmap = ipodDecrementIcon(); + TQPixmap pixmap = ipodDecrementIcon(); // This column is for the "->" buttons. The width is just // a guess, and will be changed once an item is added. addColumn( "", pixmap.width() + 10 ); @@ -2139,7 +2139,7 @@ CollectionView::updateColumnHeader() } //manage column widths - QResizeEvent rev( size(), QSize() ); + TQResizeEvent rev( size(), TQSize() ); viewportResizeEvent( &rev ); m_parent->m_categoryMenu->setItemChecked( IdArtist, m_cat1 == IdArtist && m_cat2 == IdNone ); @@ -2157,20 +2157,20 @@ CollectionView::startDrag() KURL::List urls = listSelected(); KURLDrag* d = new KURLDrag( urls, this ); d->setPixmap( CollectionDB::createDragPixmap(urls), - QPoint( CollectionDB::DRAGPIXMAP_OFFSET_X, + TQPoint( CollectionDB::DRAGPIXMAP_OFFSET_X, CollectionDB::DRAGPIXMAP_OFFSET_Y ) ); d->dragCopy(); } QString -CollectionView::getTrueItemText( int cat, QListViewItem* item ) const +CollectionView::getTrueItemText( int cat, TQListViewItem* item ) const { //Work out the true name of the album ( where Unknown is "" ) , and the - QString trueItemText; + TQString trueItemText; if ( item == 0 ) { warning() << "getTrueItemText() called for empty CollectionItem" << endl; - return QString(); + return TQString(); } if ( dynamic_cast( item ) ) { @@ -2188,12 +2188,12 @@ CollectionView::getTrueItemText( int cat, QListViewItem* item ) const } QStringList -CollectionView::listSelectedSiblingsOf( int cat, QListViewItem* item ) +CollectionView::listSelectedSiblingsOf( int cat, TQListViewItem* item ) { // notice that using the nextSibling()-axis does not work in this case as this // would only select items below the specified item. - QStringList list; - QString trueItemText; + TQStringList list; + TQString trueItemText; int depth = item->depth(); // go to top most item @@ -2223,12 +2223,12 @@ CollectionView::listSelected() //and another one for the children. KURL::List list; - QListViewItem* item; - QStringList values; + TQListViewItem* item; + TQStringList values; QueryBuilder qb; // initialization for year - album mode - QString tmptext; + TQString tmptext; bool unknownText; int VisYearAlbum = -1; int q_cat1=m_cat1; @@ -2287,8 +2287,8 @@ CollectionView::listSelected() // If we're already displaying tracks, just return the selected ones if( m_currentDepth == trackDepth() ) { - QPtrList selected = selectedItems(); - QPtrList::iterator it = selected.begin(); + TQPtrList selected = selectedItems(); + TQPtrList::iterator it = selected.begin(); while( it != selected.end() ) { if( dynamic_cast(*it) != 0 ) @@ -2306,10 +2306,10 @@ CollectionView::listSelected() incrementDepth( false ); // Copy the filter list before calling decrementDepth() below - QStringList filters[3]; + TQStringList filters[3]; for( int i = 0; i < m_currentDepth; ++i ) filters[i] = m_ipodFilters[i]; - QStringList filterYear = m_ipodFilterYear; + TQStringList filterYear = m_ipodFilterYear; // Undo the fake depth incrementation decrementDepth( false ); @@ -2335,7 +2335,7 @@ CollectionView::listSelected() buildIpodQuery( qb, trackDepth(), filters, filterYear, true, true ); if ( translateTimeFilter( timeFilter() ) > 0 ) - qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, QString().setNum( QDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater ); + qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater ); qb.setOptions( QueryBuilder::optOnlyCompilations ); qb.setGoogleFilter( tables | QueryBuilder::tabSong, m_filter ); @@ -2350,7 +2350,7 @@ CollectionView::listSelected() buildIpodQuery( qb, trackDepth(), filters, filterYear, true, false ); if ( translateTimeFilter( timeFilter() ) > 0 ) - qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, QString().setNum( QDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater ); + qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater ); if( sortByTrackFirst ) qb.setOptions( QueryBuilder::optNoCompilations ); @@ -2366,7 +2366,7 @@ CollectionView::listSelected() return list; - QStringList::Iterator it = values.begin(); + TQStringList::Iterator it = values.begin(); KURL tmp; while ( it != values.end() ) { @@ -2385,7 +2385,7 @@ CollectionView::listSelected() const bool sampler = static_cast( item )->isSampler(); qb.clear(); if ( translateTimeFilter( timeFilter() ) > 0 ) - qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, QString().setNum( QDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater ); + qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater ); qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL ); @@ -2399,7 +2399,7 @@ CollectionView::listSelected() if( VisYearAlbum == 1 ) { tmptext = item->text( 0 ); - QString year = tmptext.left( tmptext.find( i18n(" - ") ) ); + TQString year = tmptext.left( tmptext.find( i18n(" - ") ) ); yearAlbumCalc( year, tmptext ); qb.addMatch( QueryBuilder::tabYear, year, false, true ); if ( unknownText ) @@ -2449,19 +2449,19 @@ CollectionView::listSelected() if ( m_cat2 == IdNone ) { for ( item = firstChild(); item; item = item->nextSibling() ) - for ( QListViewItem* child = item->firstChild(); child; child = child->nextSibling() ) + for ( TQListViewItem* child = item->firstChild(); child; child = child->nextSibling() ) if ( child->isSelected() && !child->parent()->isSelected() ) list << static_cast( child ) ->url(); } else { for ( item = firstChild(); item; item = item->nextSibling() ) - for ( QListViewItem* child = item->firstChild(); child; child = child->nextSibling() ) + for ( TQListViewItem* child = item->firstChild(); child; child = child->nextSibling() ) if ( child->isSelected() && !child->parent()->isSelected() ) { const bool sampler = static_cast( item )->isSampler(); qb.clear(); if ( translateTimeFilter( timeFilter() ) > 0 ) - qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, QString().setNum( QDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater ); + qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater ); qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL ); @@ -2476,7 +2476,7 @@ CollectionView::listSelected() if( VisYearAlbum == 1 ) { tmptext = item->text( 0 ); - QString year = tmptext.left( tmptext.find( i18n(" - ") ) ); + TQString year = tmptext.left( tmptext.find( i18n(" - ") ) ); yearAlbumCalc( year, tmptext ); qb.addMatch( QueryBuilder::tabYear, year, false, true ); if ( unknownText ) @@ -2495,7 +2495,7 @@ CollectionView::listSelected() if( VisYearAlbum == 2 ) { tmptext = child->text( 0 ); - QString year = tmptext.left( tmptext.find( i18n(" - ") ) ); + TQString year = tmptext.left( tmptext.find( i18n(" - ") ) ); yearAlbumCalc( year, tmptext ); qb.addMatch( QueryBuilder::tabYear, year, false, true ); if ( unknownText ) @@ -2541,8 +2541,8 @@ CollectionView::listSelected() //third pass: category 2 for ( item = firstChild(); item; item = item->nextSibling() ) - for ( QListViewItem* child = item->firstChild(); child; child = child->nextSibling() ) - for ( QListViewItem* grandChild = child->firstChild(); grandChild; grandChild = grandChild->nextSibling() ) + for ( TQListViewItem* child = item->firstChild(); child; child = child->nextSibling() ) + for ( TQListViewItem* grandChild = child->firstChild(); grandChild; grandChild = grandChild->nextSibling() ) if ( grandChild->isSelected() && !grandChild->isExpandable() && !child->parent()->isSelected() && !child->isSelected() ) list << static_cast( grandChild ) ->url(); @@ -2550,22 +2550,22 @@ CollectionView::listSelected() if ( m_cat3 == IdNone ) { for ( item = firstChild(); item; item = item->nextSibling() ) - for ( QListViewItem* child = item->firstChild(); child; child = child->nextSibling() ) - for ( QListViewItem* grandChild = child->firstChild(); grandChild; grandChild = grandChild->nextSibling() ) - for ( QListViewItem* grandChild2 = grandChild->firstChild(); grandChild2; grandChild2 = grandChild2->nextSibling() ) + for ( TQListViewItem* child = item->firstChild(); child; child = child->nextSibling() ) + for ( TQListViewItem* grandChild = child->firstChild(); grandChild; grandChild = grandChild->nextSibling() ) + for ( TQListViewItem* grandChild2 = grandChild->firstChild(); grandChild2; grandChild2 = grandChild2->nextSibling() ) if ( grandChild2->isSelected() && !child->parent()->isSelected() && !child->isSelected() && !grandChild->isSelected() ) list << static_cast( grandChild2 ) ->url(); } else { for ( item = firstChild(); item; item = item->nextSibling() ) - for ( QListViewItem* child = item->firstChild(); child; child = child->nextSibling() ) - for ( QListViewItem* grandChild = child->firstChild(); grandChild; grandChild = grandChild->nextSibling() ) + for ( TQListViewItem* child = item->firstChild(); child; child = child->nextSibling() ) + for ( TQListViewItem* grandChild = child->firstChild(); grandChild; grandChild = grandChild->nextSibling() ) if ( grandChild->isSelected() && !grandChild->parent()->isSelected() ) { const bool sampler = static_cast( item )->isSampler(); qb.clear(); if ( translateTimeFilter( timeFilter() ) > 0 ) - qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, QString().setNum( QDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater ); + qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater ); qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL ); @@ -2580,7 +2580,7 @@ CollectionView::listSelected() if( VisYearAlbum == 1 ) { tmptext = item->text( 0 ); - QString year = tmptext.left( tmptext.find( i18n(" - ") ) ); + TQString year = tmptext.left( tmptext.find( i18n(" - ") ) ); yearAlbumCalc( year, tmptext ); qb.addMatch( QueryBuilder::tabYear, year, false, true ); if ( unknownText ) @@ -2598,7 +2598,7 @@ CollectionView::listSelected() if( VisYearAlbum == 2 ) { tmptext = child->text( 0 ); - QString year = tmptext.left( tmptext.find( i18n(" - ") ) ); + TQString year = tmptext.left( tmptext.find( i18n(" - ") ) ); yearAlbumCalc( year, tmptext ); qb.addMatch( QueryBuilder::tabYear, year, false, true ); if ( unknownText ) @@ -2613,7 +2613,7 @@ CollectionView::listSelected() if( VisYearAlbum == 3 ) { tmptext = grandChild->text( 0 ); - QString year = tmptext.left( tmptext.find( i18n(" - ") ) ); + TQString year = tmptext.left( tmptext.find( i18n(" - ") ) ); yearAlbumCalc( year, tmptext ); qb.addMatch( QueryBuilder::tabYear, year, false, true ); if ( unknownText ) @@ -2658,9 +2658,9 @@ CollectionView::listSelected() //category 3 for ( item = firstChild(); item; item = item->nextSibling() ) - for ( QListViewItem* child = item->firstChild(); child; child = child->nextSibling() ) - for ( QListViewItem* grandChild = child->firstChild(); grandChild; grandChild = grandChild->nextSibling() ) - for ( QListViewItem* grandChild2 = grandChild->firstChild(); grandChild2; grandChild2 = grandChild2->nextSibling() ) + for ( TQListViewItem* child = item->firstChild(); child; child = child->nextSibling() ) + for ( TQListViewItem* grandChild = child->firstChild(); grandChild; grandChild = grandChild->nextSibling() ) + for ( TQListViewItem* grandChild2 = grandChild->firstChild(); grandChild2; grandChild2 = grandChild2->nextSibling() ) if ( grandChild2->isSelected() && !child->parent()->isSelected() && !child->isSelected() && !grandChild->isSelected() ) list << static_cast( grandChild2 ) ->url(); @@ -2671,31 +2671,31 @@ CollectionView::listSelected() void CollectionView::playlistFromURLs( const KURL::List &urls ) { - QString suggestion; - typedef QListViewItemIterator It; + TQString suggestion; + typedef TQListViewItemIterator It; It it( this, It::Visible | It::Selected ); if( (*it) && !(*(++it)) ) suggestion = (*It( this, It::Visible | It::Selected ))->text( 0 ); else suggestion = i18n( "Untitled" ); - const QString path = PlaylistDialog::getSaveFileName( suggestion ); + const TQString path = PlaylistDialog::getSaveFileName( suggestion ); if( path.isEmpty() ) return; CollectionDB* db = CollectionDB::instance(); - QValueList titles; - QValueList lengths; + TQValueList titles; + TQValueList lengths; for( KURL::List::ConstIterator it = urls.constBegin(), end = urls.constEnd(); it != end; ++it ) { int deviceid = MountPointManager::instance()->getIdForUrl( *it ); KURL rpath; MountPointManager::instance()->getRelativePath( deviceid, *it, rpath ); - const QString query = QString("SELECT title, length FROM tags WHERE url = '%1' AND deviceid = %2;") + const TQString query = TQString("SELECT title, length FROM tags WHERE url = '%1' AND deviceid = %2;") .arg( db->escapeString( rpath.path() ) ).arg( deviceid ); debug() << "media id: " << deviceid << " rpath: " << rpath.path() << endl; - QStringList result = db->query( query ); + TQStringList result = db->query( query ); titles << result[0]; lengths << result[1].toInt(); } @@ -2707,7 +2707,7 @@ CollectionView::playlistFromURLs( const KURL::List &urls ) QPixmap CollectionView::iconForCategory( const int cat ) const { - QString icon; + TQString icon; switch( cat ) { case IdAlbum: @@ -2769,14 +2769,14 @@ CollectionView::captionForCategory( const int cat ) const break; } - return QString(); + return TQString(); } QString CollectionView::captionForTag( const Tag tag) const { - QString caption; + TQString caption; switch( tag ) { case Artist: caption = i18n( "Artist" ); break; @@ -2883,7 +2883,7 @@ CollectionView::captionForTag( const Tag tag) const * unique item if there's only one). If we've just browsed back, * reselect the saved selection. * CollectionView::ipodIncrementIcon(), CollectionView::ipodDecrementIcon() - * -- returns a QPixmap of the small version of the right, resp. left + * -- returns a TQPixmap of the small version of the right, resp. left * arrow buttons * CollectionView::viewportResizeEvent() * CollectionItem::compare() @@ -2921,7 +2921,7 @@ CollectionView::allForCategory( const int cat, const int num ) const break; } - return QString(); + return TQString(); } // This slot is called when the "browse right" action is activated, @@ -2969,21 +2969,21 @@ CollectionView::incrementDepth( bool rerender /*= true*/ ) m_ipodFilterYear.clear(); m_ipodSelected[m_currentDepth].clear(); - m_ipodCurrent[m_currentDepth] = QString::null; - m_ipodTopItem[m_currentDepth] = QString::null; + m_ipodCurrent[m_currentDepth] = TQString::null; + m_ipodTopItem[m_currentDepth] = TQString::null; // Save the current item if( currentItem() ) m_ipodCurrent[m_currentDepth] = currentItem()->text( 0 ); //cache viewport's top item - QListViewItem* item = itemAt( QPoint(0, 0) ); + TQListViewItem* item = itemAt( TQPoint(0, 0) ); if ( item ) m_ipodTopItem[m_currentDepth] = item->text( 0 ); // Figure out the next filter, and save the current selection - QPtrList selected = selectedItems(); - QPtrList::iterator it = selected.begin(); + TQPtrList selected = selectedItems(); + TQPtrList::iterator it = selected.begin(); while( it != selected.end() ) { @@ -3003,15 +3003,15 @@ CollectionView::incrementDepth( bool rerender /*= true*/ ) // selection, since All will then be reselected automatically // in selectIpodItems() m_ipodSelected[m_currentDepth].clear(); - m_ipodCurrent[m_currentDepth] = QString::null; + m_ipodCurrent[m_currentDepth] = TQString::null; break; } if( cat == IdVisYearAlbum ) { - QString tmptext = item->text( 0 ); - QString year = tmptext.left( tmptext.find( i18n(" - ") ) ); + TQString tmptext = item->text( 0 ); + TQString year = tmptext.left( tmptext.find( i18n(" - ") ) ); yearAlbumCalc( year, tmptext ); if( !item->isUnknown() ) m_ipodFilters[m_currentDepth] << tmptext; @@ -3062,8 +3062,8 @@ CollectionView::decrementDepth ( bool rerender /*= true*/ ) for( int i = m_currentDepth + 1; i < 3; ++i ) { m_ipodSelected[i].clear(); - m_ipodCurrent[i] = QString::null; - m_ipodTopItem[i] = QString::null; + m_ipodCurrent[i] = TQString::null; + m_ipodTopItem[i] = TQString::null; } if( rerender ) @@ -3113,8 +3113,8 @@ CollectionView::resetIpodDepth ( void ) // a compilations-only search, all tracks should behave as if the artist // were Various Artists for sorting purposes. void -CollectionView::buildIpodQuery ( QueryBuilder &qb, int depth, QStringList filters[3], - QStringList filterYear, bool recursiveSort /*= false*/, bool compilationsOnly /*= false*/) +CollectionView::buildIpodQuery ( QueryBuilder &qb, int depth, TQStringList filters[3], + TQStringList filterYear, bool recursiveSort /*= false*/, bool compilationsOnly /*= false*/) { int catArr[3] = {m_cat1, m_cat2, m_cat3}; int q_cat; @@ -3134,8 +3134,8 @@ CollectionView::buildIpodQuery ( QueryBuilder &qb, int depth, QStringList filter { // This is very annoying -- we have to do an OR of queries // of the form (album = ? AND year = ??) - QStringList::iterator album = filters[i].begin(); - QStringList::iterator year = filterYear.begin(); + TQStringList::iterator album = filters[i].begin(); + TQStringList::iterator year = filterYear.begin(); qb.beginOR(); @@ -3189,7 +3189,7 @@ CollectionView::buildIpodQuery ( QueryBuilder &qb, int depth, QStringList filter qb.sortBy( q_cat, QueryBuilder::valName ); // ensure we don't get empty genres/albums/etc due to tag changes - qb.addFilter( QueryBuilder::tabSong, QString::null ); + qb.addFilter( QueryBuilder::tabSong, TQString::null ); } @@ -3253,10 +3253,10 @@ CollectionView::selectIpodItems ( void ) { KListView::selectAll( false ); int selected = 0; - QStringList::iterator it = m_ipodSelected[m_currentDepth].begin(); + TQStringList::iterator it = m_ipodSelected[m_currentDepth].begin(); while( it != m_ipodSelected[m_currentDepth].end() ) { - QListViewItem *item = findItem( *it, 0 ); + TQListViewItem *item = findItem( *it, 0 ); ++it; if( !item ) @@ -3281,7 +3281,7 @@ CollectionView::selectIpodItems ( void ) !m_ipodTopItem[m_currentDepth].isNull() ) { //scroll to previous viewport top item - QListViewItem* item = findItem( m_ipodTopItem[m_currentDepth], 0 ); + TQListViewItem* item = findItem( m_ipodTopItem[m_currentDepth], 0 ); if ( item ) setContentsPos( 0, itemPos( item ) ); } @@ -3289,7 +3289,7 @@ CollectionView::selectIpodItems ( void ) if( !m_ipodCurrent[m_currentDepth].isEmpty() && !m_ipodCurrent[m_currentDepth].isNull() ) { - QListViewItem *item = findItem( m_ipodCurrent[m_currentDepth], 0); + TQListViewItem *item = findItem( m_ipodCurrent[m_currentDepth], 0); if( item ) setCurrentItem( item ); } @@ -3304,7 +3304,7 @@ CollectionView::selectIpodItems ( void ) if( m_ipodIncremented == 1 ) { KListView::selectAll( false ); - QListViewItem *item = firstChild(); + TQListViewItem *item = firstChild(); // There will be a divider in the first slot if there is only // one item in the list and m_showDivider is on @@ -3343,13 +3343,13 @@ void CollectionView::setCompilation( const KURL::List &urls, bool compilation ) { //visual feedback - QApplication::setOverrideCursor( KCursor::waitCursor() ); + TQApplication::setOverrideCursor( KCursor::waitCursor() ); //Set it in the DB. We don't need to update the view now as we do it at the end. CollectionDB::instance()->setCompilation( urls, compilation, false ); foreachType( KURL::List, urls ) { - if ( !TagLib::File::isWritable( QFile::encodeName( ( *it ).path() ) ) ) + if ( !TagLib::File::isWritable( TQFile::encodeName( ( *it ).path() ) ) ) continue; MetaBundle mb( *it ); @@ -3363,7 +3363,7 @@ CollectionView::setCompilation( const KURL::List &urls, bool compilation ) } } //visual feedback - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if ( !urls.isEmpty() ) renderView(true); } @@ -3378,13 +3378,13 @@ CollectionView::cacheView() //cache expanded/open items if ( m_viewMode == modeTreeView ) { - QListViewItemIterator it( this ); + TQListViewItemIterator it( this ); while ( it.current() ) { - QListViewItem *item = it.current(); + TQListViewItem *item = it.current(); if ( item->isOpen() ) { //construct path to item - QStringList itemPath; - for( const QListViewItem *i = item; i; i = i->parent() ) + TQStringList itemPath; + for( const TQListViewItem *i = item; i; i = i->parent() ) itemPath.prepend( i->text( 0 ) ); m_cacheOpenItemPaths.append ( itemPath ); @@ -3394,7 +3394,7 @@ CollectionView::cacheView() } //cache viewport's top item - m_cacheViewportTopItem = makeStructuredNameList( itemAt( QPoint(0, 0) ) ); + m_cacheViewportTopItem = makeStructuredNameList( itemAt( TQPoint(0, 0) ) ); } @@ -3403,9 +3403,9 @@ CollectionView::restoreView() { //expand cached items if ( m_viewMode == modeTreeView ) { - QValueList::const_iterator it; + TQValueList::const_iterator it; for ( it = m_cacheOpenItemPaths.begin(); it != m_cacheOpenItemPaths.end(); ++it ) { - QListViewItem* item = findItem( (*it)[0], 0 ); + TQListViewItem* item = findItem( (*it)[0], 0 ); if ( item ) item->setOpen ( true ); @@ -3421,7 +3421,7 @@ CollectionView::restoreView() } //scroll to previous viewport top item - QListViewItem* item = findFromStructuredNameList( m_cacheViewportTopItem ); + TQListViewItem* item = findFromStructuredNameList( m_cacheViewportTopItem ); if ( item ) setContentsPos( 0, itemPos(item) ); @@ -3437,23 +3437,23 @@ CollectionView::restoreView() //free cache m_cacheOpenItemPaths.clear(); - m_cacheViewportTopItem = QStringList(); - m_cacheCurrentItem = QStringList(); + m_cacheViewportTopItem = TQStringList(); + m_cacheCurrentItem = TQStringList(); } QStringList -CollectionView::makeStructuredNameList( QListViewItem *item ) const +CollectionView::makeStructuredNameList( TQListViewItem *item ) const { - QStringList nameList; - for ( QListViewItem *current = item; current; current = current->parent() ) + TQStringList nameList; + for ( TQListViewItem *current = item; current; current = current->parent() ) nameList.push_front( current->text( 0 ) ); return nameList; } -QListViewItem* -CollectionView::findFromStructuredNameList( const QStringList &nameList ) const +TQListViewItem* +CollectionView::findFromStructuredNameList( const TQStringList &nameList ) const { - QListViewItem *item( firstChild() ); + TQListViewItem *item( firstChild() ); bool firstTime = true; foreach( nameList ) { @@ -3478,11 +3478,11 @@ CollectionView::findFromStructuredNameList( const QStringList &nameList ) const // Small function aimed to convert Eagles, The -> The Eagles (and back again) // TODO Internationlise void -CollectionView::manipulateThe( QString &str, bool reverse ) +CollectionView::manipulateThe( TQString &str, bool reverse ) { if( reverse ) { - QString begin = str.left( 3 ); + TQString begin = str.left( 3 ); str = str.append( ", %1" ).arg( begin ); str = str.mid( 4 ); return; @@ -3491,7 +3491,7 @@ CollectionView::manipulateThe( QString &str, bool reverse ) if( !endsInThe( str ) ) return; - QString end = str.right( 3 ); + TQString end = str.right( 3 ); str = str.prepend( "%1 " ).arg( end ); uint newLen = str.length() - end.length() - 2; @@ -3500,14 +3500,14 @@ CollectionView::manipulateThe( QString &str, bool reverse ) } bool -CollectionView::endsInThe( const QString & text ) +CollectionView::endsInThe( const TQString & text ) { return text.endsWith( ", the", false ); } // avoid code duplication void -CollectionView::yearAlbumCalc( QString &year, QString &text ) +CollectionView::yearAlbumCalc( TQString &year, TQString &text ) { if( year == "\?" ) year = ""; @@ -3518,7 +3518,7 @@ CollectionView::yearAlbumCalc( QString &year, QString &text ) } void -CollectionView::viewportPaintEvent( QPaintEvent *e ) +CollectionView::viewportPaintEvent( TQPaintEvent *e ) { KListView::viewportPaintEvent( e ); @@ -3526,13 +3526,13 @@ CollectionView::viewportPaintEvent( QPaintEvent *e ) if ( m_viewMode == modeFlatView && childCount() == 0 ) { - QPainter p( viewport() ); + TQPainter p( viewport() ); - QSimpleRichText t( i18n( + TQSimpleRichText t( i18n( "
" "

Flat-View Mode

" "To enable the Flat-View mode, please enter search terms in the search line above." - "
" ), QApplication::font() ); + "" ), TQApplication::font() ); t.setWidth( width() - 50 ); @@ -3541,7 +3541,7 @@ CollectionView::viewportPaintEvent( QPaintEvent *e ) p.setBrush( colorGroup().background() ); p.drawRoundRect( 15, 15, w, h, (8*200)/w, (8*200)/h ); - t.draw( &p, 20, 20, QRect(), colorGroup() ); + t.draw( &p, 20, 20, TQRect(), colorGroup() ); } } @@ -3565,7 +3565,7 @@ CollectionView::updateTrackDepth() { } void -CollectionView::viewportResizeEvent( QResizeEvent* e) +CollectionView::viewportResizeEvent( TQResizeEvent* e) { if( m_viewMode != modeIpodView ) { @@ -3619,11 +3619,11 @@ CollectionView::viewportResizeEvent( QResizeEvent* e) } bool -CollectionView::eventFilter( QObject* o, QEvent* e ) +CollectionView::eventFilter( TQObject* o, TQEvent* e ) { if( o == header() - && e->type() == QEvent::MouseButtonPress - && static_cast( e )->button() == Qt::RightButton + && e->type() == TQEvent::MouseButtonPress + && static_cast( e )->button() == Qt::RightButton && m_viewMode == modeFlatView ) { KPopupMenu popup; @@ -3641,7 +3641,7 @@ CollectionView::eventFilter( QObject* o, QEvent* e ) popup.setItemVisible( Score, AmarokConfig::useScores() ); popup.setItemVisible( Rating, AmarokConfig::useRatings() ); - const int returnID = popup.exec( static_cast(e)->globalPos() ); + const int returnID = popup.exec( static_cast(e)->globalPos() ); if ( returnID != -1 ) { @@ -3655,7 +3655,7 @@ CollectionView::eventFilter( QObject* o, QEvent* e ) header()->setResizeEnabled( false, returnID ); } //manage column widths - QResizeEvent rev ( size(), QSize() ); + TQResizeEvent rev ( size(), TQSize() ); viewportResizeEvent( &rev ); } @@ -3706,11 +3706,11 @@ uint CollectionView::translateTimeFilter( uint filterMode ) void CollectionView::renderFlatModeView( bool /*=false*/ ) { - QStringList values; + TQStringList values; QueryBuilder qb; if ( translateTimeFilter( timeFilter() ) > 0 ) - qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, QString().setNum( QDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater ); + qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater ); if ( translateTimeFilter( timeFilter() ) <= 0 && (m_filter.length() < 3 || (!m_filter.contains( " " ) && m_filter.endsWith( ":" ) ) ) ) @@ -3720,7 +3720,7 @@ CollectionView::renderFlatModeView( bool /*=false*/ ) return; } - QValueList visibleColumns; + TQValueList visibleColumns; for ( int c = 0; c < columns(); ++c ) if ( columnWidth( c ) != 0 ) { @@ -3732,7 +3732,7 @@ CollectionView::renderFlatModeView( bool /*=false*/ ) //device automatically added int filterTables = 0; - for ( QValueList::ConstIterator it = visibleColumns.constBegin(); it != visibleColumns.constEnd(); ++it ) + for ( TQValueList::ConstIterator it = visibleColumns.constBegin(); it != visibleColumns.constEnd(); ++it ) { switch ( *it ) { @@ -3819,23 +3819,23 @@ CollectionView::renderFlatModeView( bool /*=false*/ ) //we leftjoin the query so it can return mysql NULL cells, i.e. for score and playcount //this is an ugly hack - should be integrated in querybuilder itself instead. - QString leftQuery = qb.query(); + TQString leftQuery = qb.query(); leftQuery.replace( "INNER JOIN", "LEFT JOIN" ); values = CollectionDB::instance()->query( leftQuery ); //construct items - QStringList::ConstIterator it = values.constBegin(); - QStringList::ConstIterator end = values.constEnd(); + TQStringList::ConstIterator it = values.constBegin(); + TQStringList::ConstIterator end = values.constEnd(); while ( it != end ) { CollectionItem* item = new CollectionItem( this ); item->setDragEnabled( true ); item->setDropEnabled( false ); - QString rpath = *it; + TQString rpath = *it; item->setUrl( MountPointManager::instance()->getAbsolutePath( (*++it).toInt(), rpath ) ); ++it; - for ( QValueList::ConstIterator it_c = visibleColumns.constBegin(); it_c != visibleColumns.constEnd(); ++it_c ) + for ( TQValueList::ConstIterator it_c = visibleColumns.constBegin(); it_c != visibleColumns.constEnd(); ++it_c ) { switch ( *it_c ) { @@ -3849,7 +3849,7 @@ CollectionView::renderFlatModeView( bool /*=false*/ ) case Lastplay: case Modified: { - QDateTime time = QDateTime(); + TQDateTime time = TQDateTime(); time.setTime_t( (*it).toUInt() ); item->setText( *it_c, time.date().toString( Qt::LocalDate ) ); break; @@ -3879,11 +3879,11 @@ CollectionView::renderFlatModeView( bool /*=false*/ ) void CollectionView::renderTreeModeView( bool /*=false*/ ) { - QStringList values; + TQStringList values; QueryBuilder qb; if ( translateTimeFilter( timeFilter() ) > 0 ) - qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, QString().setNum( QDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater ); + qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater ); setSorting( 0 ); int VisYearAlbum = -1; @@ -3922,7 +3922,7 @@ CollectionView::renderTreeModeView( bool /*=false*/ ) else VisLabel = 3; } - QPixmap pixmap = iconForCategory( m_cat1 ); + TQPixmap pixmap = iconForCategory( m_cat1 ); qb.addReturnValue( q_cat1, QueryBuilder::valName, true ); @@ -3941,7 +3941,7 @@ CollectionView::renderTreeModeView( bool /*=false*/ ) qb.setOptions( QueryBuilder::optNoCompilations ); // ensure we don't get empty genres/albums/etc due to tag changes - qb.addFilter( QueryBuilder::tabSong, QString::null ); + qb.addFilter( QueryBuilder::tabSong, TQString::null ); values = qb.run(); @@ -3951,9 +3951,9 @@ CollectionView::renderTreeModeView( bool /*=false*/ ) if( values.count() ) { //keep track of headers already added - QMap containedDivider; + TQMap containedDivider; - for ( QStringList::Iterator it = values.fromLast(), begin = values.begin(); true; --it ) + for ( TQStringList::Iterator it = values.fromLast(), begin = values.begin(); true; --it ) { bool unknown = false; @@ -3961,7 +3961,7 @@ CollectionView::renderTreeModeView( bool /*=false*/ ) if ( VisYearAlbum == 1 ) { ( *it ) = ( *it ).isEmpty() ? "?" : ( *it ) + i18n( " - " ); - QStringList::Iterator album = it; + TQStringList::Iterator album = it; --album; if ( (*album).isEmpty() ) { @@ -3984,11 +3984,11 @@ CollectionView::renderTreeModeView( bool /*=false*/ ) { //Dividers for "The Who" should be created as "W", not "T", because //that's how we sort it - QString actualStr = *it; + TQString actualStr = *it; if ( m_cat1 == IdArtist && actualStr.startsWith( "the ", false ) ) manipulateThe( actualStr, true ); - QString headerStr = DividerItem::createGroup( actualStr, m_cat1); + TQString headerStr = DividerItem::createGroup( actualStr, m_cat1); if ( !containedDivider[headerStr] && !headerStr.isEmpty() ) { @@ -4020,7 +4020,7 @@ CollectionView::renderTreeModeView( bool /*=false*/ ) qb.clear(); if ( translateTimeFilter( timeFilter() ) > 0 ) qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, - QString().setNum( QDateTime::currentDateTime().toTime_t() - + TQString().setNum( TQDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater ); qb.addReturnValue( q_cat1, QueryBuilder::valName, true ); @@ -4049,13 +4049,13 @@ CollectionView::renderTreeModeView( bool /*=false*/ ) //should be shown in the listview ( maxRows) after which we give up. If an item has //more than one child and we haven't reached the limit, we may end up expanding it //later. - QValueList couldOpen; + TQValueList couldOpen; int totalCount = childCount() - dividerCount; const int maxRows = 20; //This seems like a fair limit for a 1024x768 screen if ( totalCount < maxRows ) { //Generate initial list of top list items to look at - for ( QListViewItem* top = firstChild(); top; top = top->nextSibling() ) + for ( TQListViewItem* top = firstChild(); top; top = top->nextSibling() ) { if ( !dynamic_cast( top ) ) continue; @@ -4063,14 +4063,14 @@ CollectionView::renderTreeModeView( bool /*=false*/ ) } //Expand suggested items and expand or enqueue their children until we run out of //rows or have expanded everything - for ( QValueList::iterator it = couldOpen.begin(); it != couldOpen.end() && totalCount < maxRows; ++it ) + for ( TQValueList::iterator it = couldOpen.begin(); it != couldOpen.end() && totalCount < maxRows; ++it ) { if ( !( *it )->isOpen() ) ( *it )->setOpen( true ); totalCount += ( *it )->childCount(); if ( ( *it )->firstChild()->isExpandable() ) //Check we have not reached the bottom { - for ( QListViewItem *j = ( *it )->firstChild(); j && totalCount < maxRows; j = j->nextSibling() ) + for ( TQListViewItem *j = ( *it )->firstChild(); j && totalCount < maxRows; j = j->nextSibling() ) { j->setOpen( true ); if ( j->childCount() > 1 ) //More than one child - maybe later @@ -4081,7 +4081,7 @@ CollectionView::renderTreeModeView( bool /*=false*/ ) else { //Prioritize expanding its children - add it immediately next - QValueList::iterator next = it; + TQValueList::iterator next = it; ++next; couldOpen.insert( next, j ); ++totalCount; @@ -4097,7 +4097,7 @@ CollectionView::renderTreeModeView( bool /*=false*/ ) //will stay in view, assuming you only had one real result. if ( childCount() - dividerCount == 1 ) { - QListViewItem *item = firstChild(); + TQListViewItem *item = firstChild(); if ( dynamic_cast( item ) ) //Skip a divider, if present item = item->nextSibling(); for ( ; item ; item = item->firstChild() ) @@ -4120,10 +4120,10 @@ CollectionView::removeDuplicatedHeaders() /* Following code depends on the order! */ sort(); - QValueList toDelete; + TQValueList toDelete; DividerItem *current=0, *last=0; bool empty; - QListViewItem *item; + TQListViewItem *item; /* If we have two consecutive headers, one of them is useless, and should be removed */ for( item = firstChild(),empty=false; item; item=item->nextSibling() ) { @@ -4149,7 +4149,7 @@ CollectionView::removeDuplicatedHeaders() empty=false; } - for ( QValueList::iterator it = toDelete.begin(); it != toDelete.end(); ++it ) + for ( TQValueList::iterator it = toDelete.begin(); it != toDelete.end(); ++it ) delete *it; } @@ -4170,11 +4170,11 @@ CollectionView::removeDuplicatedHeaders() void CollectionView::renderIpodModeView( bool /*=false*/ ) { - QStringList values; + TQStringList values; QueryBuilder qb; if ( translateTimeFilter( timeFilter() ) > 0 ) - qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, QString().setNum( QDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater ); + qb.addFilter( QueryBuilder::tabSong, QueryBuilder::valCreateDate, TQString().setNum( TQDateTime::currentDateTime().toTime_t() - translateTimeFilter( timeFilter() ) ), QueryBuilder::modeGreater ); int catArr[3] = {m_cat1, m_cat2, m_cat3}; // stillFiltering is true when we're not viewing tracks @@ -4242,14 +4242,14 @@ CollectionView::renderIpodModeView( bool /*=false*/ ) // We want to load the pixmap only once if we're still filtering // Otherwise just load a dummy pixmap - QPixmap pixmap = iconForCategory( q_cat ); - QPixmap incPixmap = ipodIncrementIcon(); + TQPixmap pixmap = iconForCategory( q_cat ); + TQPixmap incPixmap = ipodIncrementIcon(); int width = incPixmap.width() + 10; // Set the column width below // Keep track of the dividers we've created. - QMap containedDivider; + TQMap containedDivider; - QStringList::Iterator itStep = values.end(); - QStringList::Iterator begin = values.begin(); + TQStringList::Iterator itStep = values.end(); + TQStringList::Iterator begin = values.begin(); itStep -= qb.countReturnValues(); // It's an awkward business stepping through a list backward // when the elements are in tuples, going forward. @@ -4257,7 +4257,7 @@ CollectionView::renderIpodModeView( bool /*=false*/ ) while( 1 ) { CollectionItem* item; - QStringList::Iterator it = itStep; + TQStringList::Iterator it = itStep; // Add non-track items if( stillFiltering ) @@ -4277,8 +4277,8 @@ CollectionView::renderIpodModeView( bool /*=false*/ ) if( VisYearAlbum ) { - QString album = *it; - QString year = *(++it); + TQString album = *it; + TQString year = *(++it); if( year.isEmpty() ) year = "?"; item->setText( 0, year + i18n(" - ") + album ); @@ -4298,12 +4298,12 @@ CollectionView::renderIpodModeView( bool /*=false*/ ) { //Dividers for "The Who" should be created as "W", not "T", //because that's how we sort it - QString actualStr = item->text( 0 ); + TQString actualStr = item->text( 0 ); if ( m_cat == IdArtist && actualStr.startsWith( "the ", false ) ) manipulateThe( actualStr, true ); - QString headerStr = DividerItem::createGroup( actualStr, m_cat ); + TQString headerStr = DividerItem::createGroup( actualStr, m_cat ); if ( !containedDivider[headerStr] && !headerStr.isEmpty() ) { @@ -4347,7 +4347,7 @@ CollectionView::renderIpodModeView( bool /*=false*/ ) sort(); } setColumnWidth( 1, width ); - QResizeEvent rev( size(), QSize() ); + TQResizeEvent rev( size(), TQSize() ); viewportResizeEvent( &rev ); } @@ -4358,17 +4358,17 @@ CollectionView::renderIpodModeView( bool /*=false*/ ) // CLASS CollectionItem ////////////////////////////////////////////////////////////////////////////////////////// void -CollectionItem::paintCell ( QPainter * painter, const QColorGroup & cg, +CollectionItem::paintCell ( TQPainter * painter, const TQColorGroup & cg, int column, int width, int align ) { if( static_cast(column) == CollectionView::Rating ) { - QPixmap buf( width, height() ); - QPainter p( &buf, true ); + TQPixmap buf( width, height() ); + TQPainter p( &buf, true ); - const QColorGroup _cg = listView()->palette().active(); + const TQColorGroup _cg = listView()->palette().active(); - QColor bg = isSelected() ? _cg.highlight() + TQColor bg = isSelected() ? _cg.highlight() : isAlternate() ? listView()->alternateBackground() : listView()->viewport()->backgroundColor(); #if KDE_IS_VERSION( 3, 3, 91 ) @@ -4379,7 +4379,7 @@ CollectionItem::paintCell ( QPainter * painter, const QColorGroup & cg, Copyright (C) 2000,2003 Charles Samuels Copyright (C) 2000 Peter Putzer */ if ( bg == Qt::black ) - bg = QColor(55, 55, 55); // dark gray + bg = TQColor(55, 55, 55); // dark gray else { int h,s,v; @@ -4419,10 +4419,10 @@ CollectionItem::paintCell ( QPainter * painter, const QColorGroup & cg, } int -CollectionItem::compare( QListViewItem* i, int col, bool ascending ) const +CollectionItem::compare( TQListViewItem* i, int col, bool ascending ) const { - QString a = text( col ); - QString b = i->text( col ); + TQString a = text( col ); + TQString b = i->text( col ); int ia, ib; //Special cases go first to take priority @@ -4503,7 +4503,7 @@ CollectionItem::compare( QListViewItem* i, int col, bool ascending ) const ia = a.toInt(); ib = b.toInt(); if (ia==ib) - return QString::localeAwareCompare( text( col ).lower(), i->text( col ).lower() ); + return TQString::localeAwareCompare( text( col ).lower(), i->text( col ).lower() ); if (ia( listView() ); // Sort only if it's not the tracks if ( depth() + 1 < view->trackDepth()) - QListViewItem::sortChildItems( column, ascending ); + TQListViewItem::sortChildItems( column, ascending ); } // // DividerItem -DividerItem::DividerItem( QListView* parent, QString txt, int cat/*, bool sortYearsInverted*/) +DividerItem::DividerItem( TQListView* parent, TQString txt, int cat/*, bool sortYearsInverted*/) : KListViewItem( parent), m_blockText(false), m_text(txt), m_cat(cat)/*, m_sortYearsInverted(sortYearsInverted)*/ { setExpandable(false); @@ -4547,7 +4547,7 @@ DividerItem::DividerItem( QListView* parent, QString txt, int cat/*, bool sortYe } void -DividerItem::paintCell ( QPainter * p, const QColorGroup & cg, +DividerItem::paintCell ( TQPainter * p, const TQColorGroup & cg, int column, int width, int align ) { p->save(); @@ -4558,34 +4558,34 @@ DividerItem::paintCell ( QPainter * p, const QColorGroup & cg, setBlockText( false ); //use bold font for the divider - QFont f = p->font(); + TQFont f = p->font(); f.setBold( true ); p->setFont( f ); // draw the text offset a little bit if( column == 0 ) // For iPod viewing mode { - QFontMetrics fm( p->fontMetrics() ); - int x = !QApplication::reverseLayout() ? 25 : width - 25; + TQFontMetrics fm( p->fontMetrics() ); + int x = !TQApplication::reverseLayout() ? 25 : width - 25; int y = fm.ascent() + (height() - fm.height())/2; p->drawText( x, y, m_text ); } //draw the baseline - p->setPen( QPen(Qt::gray, 2) ); + p->setPen( TQPen(Qt::gray, 2) ); p->drawLine(0, height() -2 , width, height() -2 ); p->restore(); } void -DividerItem::paintFocus ( QPainter* /*p*/, const QColorGroup& /*cg*/, const QRect& /*r*/ ) +DividerItem::paintFocus ( TQPainter* /*p*/, const TQColorGroup& /*cg*/, const TQRect& /*r*/ ) { //not implemented, we don't to show focus } //to draw the text on my own I have to be able to block the text, otherwise I could -// not use QListViewItem::paintCell() to draw the basic cell +// not use TQListViewItem::paintCell() to draw the basic cell QString DividerItem::text(int column) const { @@ -4596,10 +4596,10 @@ DividerItem::text(int column) const } int -DividerItem::compare( QListViewItem* i, int col, bool ascending ) const +DividerItem::compare( TQListViewItem* i, int col, bool ascending ) const { if (!i) { - return QString::localeAwareCompare( text(col).lower(), QString("") ); + return TQString::localeAwareCompare( text(col).lower(), TQString("") ); } if (dynamic_cast(i)) { return -1 * i->compare(const_cast(this), col, ascending); @@ -4619,13 +4619,13 @@ DividerItem::compare( QListViewItem* i, int col, bool ascending ) const else return -1; } } - return QString::localeAwareCompare( text(col).lower(), i->text(col).lower() ); + return TQString::localeAwareCompare( text(col).lower(), i->text(col).lower() ); } QString -DividerItem::createGroup(const QString& src, int cat) +DividerItem::createGroup(const TQString& src, int cat) { - QString ret; + TQString ret; switch (cat) { case IdVisYearAlbum: { ret = src.left( src.find(" - ") ); @@ -4659,7 +4659,7 @@ DividerItem::createGroup(const QString& src, int cat) ret = i18n( "Others" );*/ /* By returning an empty string, no header is created. */ - if (QChar(ret.at(0)).isDigit()) { + if (TQChar(ret.at(0)).isDigit()) { ret = "0-9"; } } @@ -4668,15 +4668,15 @@ DividerItem::createGroup(const QString& src, int cat) } bool -DividerItem::shareTheSameGroup(const QString& itemStr, const QString& divStr, int cat) +DividerItem::shareTheSameGroup(const TQString& itemStr, const TQString& divStr, int cat) { bool inGroup = false; - QString tmp = itemStr.stripWhiteSpace(); + TQString tmp = itemStr.stripWhiteSpace(); switch (cat) { case IdVisYearAlbum: { - QString sa = itemStr.left( itemStr.find( i18n(" - ") ) ); - QString sb = divStr.left( divStr.find( i18n(" - ") ) ); + TQString sa = itemStr.left( itemStr.find( i18n(" - ") ) ); + TQString sb = divStr.left( divStr.find( i18n(" - ") ) ); if (sa == sb) { inGroup = true; } @@ -4703,7 +4703,7 @@ DividerItem::shareTheSameGroup(const QString& itemStr, const QString& divStr, in //Fall through default: if ( !tmp.isEmpty() ) { - if (divStr == "0-9" && QChar(tmp.at(0)).isDigit()) { + if (divStr == "0-9" && TQChar(tmp.at(0)).isDigit()) { inGroup = true; } else if (tmp.startsWith(divStr, 0)) { diff --git a/amarok/src/collectionbrowser.h b/amarok/src/collectionbrowser.h index 407c4f7c..f4325ba5 100644 --- a/amarok/src/collectionbrowser.h +++ b/amarok/src/collectionbrowser.h @@ -7,12 +7,12 @@ #ifndef AMAROK_COLLECTIONBROWSER_H #define AMAROK_COLLECTIONBROWSER_H -#include -#include //stack allocated -#include //baseclass +#include +#include //stack allocated +#include //baseclass #include //baseclass -#include //stack allocated +#include //stack allocated #include //stack allocated #include //baseclass #include @@ -24,11 +24,11 @@ class ClickLineEdit; class CollectionDB; -class QCString; -class QDragObject; -class QPixmap; -class QPoint; -class QStringList; +class TQCString; +class TQDragObject; +class TQPixmap; +class TQPoint; +class TQStringList; class KAction; class KComboBox; @@ -63,7 +63,7 @@ class CollectionBrowser: public QVBox public: CollectionBrowser( const char* name ); - virtual bool eventFilter( QObject*, QEvent* ); + virtual bool eventFilter( TQObject*, TQEvent* ); KToolBar* getToolBar() const { return m_toolbar; } static CollectionBrowser *instance() { return s_instance; } @@ -75,7 +75,7 @@ class CollectionBrowser: public QVBox void slotClearFilter(); void slotSetFilterTimeout(); void slotSetFilter(); - void slotSetFilter( const QString &filter ); + void slotSetFilter( const TQString &filter ); void slotEditFilter(); private: @@ -90,7 +90,7 @@ class CollectionBrowser: public QVBox // For iPod-style browsing KAction *m_ipodIncrement, *m_ipodDecrement; class KToolBar *m_ipodToolbar; - class QHBox *m_ipodHbox; + class TQHBox *m_ipodHbox; KToggleAction *m_showDividerAction; KRadioAction *m_treeViewAction; @@ -105,7 +105,7 @@ class CollectionBrowser: public QVBox KLineEdit* m_searchEdit; KComboBox* m_timeFilter; CollectionView* m_view; - QTimer* m_timer; + TQTimer* m_timer; bool m_returnPressed; @@ -119,25 +119,25 @@ class CollectionBrowser: public QVBox class DividerItem : public KListViewItem { public: - static QString createGroup(const QString& src, int cat); - static bool shareTheSameGroup(const QString& a, const QString& b, int cat); + static TQString createGroup(const TQString& src, int cat); + static bool shareTheSameGroup(const TQString& a, const TQString& b, int cat); public: - DividerItem( QListView* parent, QString txt, int cat); + DividerItem( TQListView* parent, TQString txt, int cat); - virtual void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ); - virtual void paintFocus ( QPainter * p, const QColorGroup & cg, const QRect & r ); + virtual void paintCell ( TQPainter * p, const TQColorGroup & cg, int column, int width, int align ); + virtual void paintFocus ( TQPainter * p, const TQColorGroup & cg, const TQRect & r ); - virtual QString text(int column) const; + virtual TQString text(int column) const; void setBlockText(bool block) { m_blockText = block; } private: - virtual int compare( QListViewItem*, int, bool ) const; + virtual int compare( TQListViewItem*, int, bool ) const; private: bool m_blockText; - QString m_text; + TQString m_text; int m_cat; }; @@ -145,22 +145,22 @@ private: class CollectionItem : public KListViewItem { public: - CollectionItem( QListView* parent, int cat = 0, bool unknown = false, bool sampler=false ) + CollectionItem( TQListView* parent, int cat = 0, bool unknown = false, bool sampler=false ) : KListViewItem( parent ) , m_cat( cat ) , m_isUnknown( unknown ) , m_isSampler( sampler ) {}; - CollectionItem( QListViewItem* parent, int cat = 0, bool unknown = false, bool sampler=false ) + CollectionItem( TQListViewItem* parent, int cat = 0, bool unknown = false, bool sampler=false ) : KListViewItem( parent ) , m_cat( cat ) , m_isUnknown( unknown ) , m_isSampler( sampler ) {}; - void setUrl( const QString& url ) { m_url.setPath( url ); } + void setUrl( const TQString& url ) { m_url.setPath( url ); } const KURL& url() const { return m_url; } virtual void sortChildItems ( int column, bool ascending ); //reimplemented - inline QString getSQLText( int column ) + inline TQString getSQLText( int column ) { return ( !column && m_isUnknown ) ? "" : text( column ); } @@ -168,17 +168,17 @@ class CollectionItem : public KListViewItem { inline bool isUnknown() {return m_isUnknown;} inline bool isSampler() {return m_isSampler;} - virtual void setPixmap(int column, const QPixmap & pix); + virtual void setPixmap(int column, const TQPixmap & pix); /// convenience functions CollectionView *listView() const { return reinterpret_cast( KListViewItem::listView() ); } private: friend class CollectionView; - virtual void paintCell ( QPainter * painter, const QColorGroup & cg, int column, int width, int align ); + virtual void paintCell ( TQPainter * painter, const TQColorGroup & cg, int column, int width, int align ); //for sorting - virtual int compare( QListViewItem*, int, bool ) const; //reimplemented + virtual int compare( TQListViewItem*, int, bool ) const; //reimplemented //attributes: KURL m_url; @@ -204,9 +204,9 @@ class CollectionView : public KListView, public DropProxyTarget LIBAMAROK_EXPORT static CollectionView* instance() { return m_instance; } - void setFilter( const QString &filter ) { m_filter = filter; } + void setFilter( const TQString &filter ) { m_filter = filter; } void setTimeFilter( const uint timeFilter ) { m_timeFilter = timeFilter; } - QString filter() { return m_filter; } + TQString filter() { return m_filter; } uint timeFilter() { return m_timeFilter; } CollectionItem* currentItem() { return static_cast( KListView::currentItem() ); } @@ -214,18 +214,18 @@ class CollectionView : public KListView, public DropProxyTarget int viewMode() const { return m_viewMode; } // Transform "The Who" -> "Who, The" or the other way - static void manipulateThe( QString &str, bool reverse ); + static void manipulateThe( TQString &str, bool reverse ); void setShowDivider(bool show); bool isOrganizingFiles() const; //Useful helper function to avoid duplicating code - static inline void yearAlbumCalc( QString &year, QString &text ); + static inline void yearAlbumCalc( TQString &year, TQString &text ); protected: // Reimplemented for iPod-style navigation, etc. - virtual void keyPressEvent( QKeyEvent *e ); + virtual void keyPressEvent( TQKeyEvent *e ); public slots: @@ -242,7 +242,7 @@ class CollectionView : public KListView, public DropProxyTarget void cat1Menu( int id, bool rerender = true ); void cat2Menu( int id, bool rerender = true ); void cat3Menu( int id, bool rerender = true ); - void organizeFiles( const KURL::List &list, const QString &caption, bool addToCollection=false ) LIBAMAROK_EXPORT; + void organizeFiles( const KURL::List &list, const TQString &caption, bool addToCollection=false ) LIBAMAROK_EXPORT; private slots: void setupDirs(); @@ -256,19 +256,19 @@ class CollectionView : public KListView, public DropProxyTarget void scanStarted(); void scanDone( bool changed = true ); - void slotExpand( QListViewItem* ); - void slotCollapse( QListViewItem* ); + void slotExpand( TQListViewItem* ); + void slotCollapse( TQListViewItem* ); void enableCat3Menu( bool ); - void invokeItem( QListViewItem*, const QPoint &, int column ); - void invokeItem( QListViewItem* ); + void invokeItem( TQListViewItem*, const TQPoint &, int column ); + void invokeItem( TQListViewItem* ); // ipod-style navigation slots - void ipodItemClicked( QListViewItem*, const QPoint&, int ); + void ipodItemClicked( TQListViewItem*, const TQPoint&, int ); void incrementDepth ( bool rerender = true ); void decrementDepth ( bool rerender = true ); - void rmbPressed( QListViewItem*, const QPoint&, int ); - void selectAll() {QListView::selectAll(true); } + void rmbPressed( TQListViewItem*, const TQPoint&, int ); + void selectAll() {TQListView::selectAll(true); } /** Tries to download the cover image from Amazon.com */ void fetchCover(); /** Shows dialog with information on selected track */ @@ -279,7 +279,7 @@ class CollectionView : public KListView, public DropProxyTarget */ void cancelOrganizingFiles(); - void ratingChanged( const QString&, int ); + void ratingChanged( const TQString&, int ); private: enum Tag { Title = 0, Artist, Composer, Album, Genre, Length, DiscNumber, Track, Year, @@ -290,22 +290,22 @@ class CollectionView : public KListView, public DropProxyTarget void removeDuplicatedHeaders(); void startDrag(); - QString getTrueItemText( int, QListViewItem* ) const; - QStringList listSelectedSiblingsOf( int, QListViewItem* ); + TQString getTrueItemText( int, TQListViewItem* ) const; + TQStringList listSelectedSiblingsOf( int, TQListViewItem* ); KURL::List listSelected(); void playlistFromURLs( const KURL::List &urls ); - QPixmap iconForCategory( const int cat ) const; - QString captionForCategory( const int cat ) const; - inline QString captionForTag( const Tag ) const; + TQPixmap iconForCategory( const int cat ) const; + TQString captionForCategory( const int cat ) const; + inline TQString captionForTag( const Tag ) const; // For iPod-style navigation - QString allForCategory( const int cat, const int num ) const; + TQString allForCategory( const int cat, const int num ) const; void resetIpodDepth ( void ); - void buildIpodQuery ( QueryBuilder &qb, int depth, QStringList filters[3], QStringList filterYear, bool recursiveSort = false, bool compilationsOnly = false ); + void buildIpodQuery ( QueryBuilder &qb, int depth, TQStringList filters[3], TQStringList filterYear, bool recursiveSort = false, bool compilationsOnly = false ); void selectIpodItems ( void ); - QPixmap ipodIncrementIcon ( void ); - QPixmap ipodDecrementIcon ( void ); + TQPixmap ipodIncrementIcon ( void ); + TQPixmap ipodDecrementIcon ( void ); void setCompilation( const KURL::List &urls, bool compilation ); @@ -315,11 +315,11 @@ class CollectionView : public KListView, public DropProxyTarget //Used to store the name of an item (and its parents), so it can be recalled later //even if the pointer to the item has been invalidated. - QStringList makeStructuredNameList( QListViewItem* ) const; - QListViewItem* findFromStructuredNameList( const QStringList& ) const; + TQStringList makeStructuredNameList( TQListViewItem* ) const; + TQListViewItem* findFromStructuredNameList( const TQStringList& ) const; // avoid duplicated code - static inline bool endsInThe( const QString & text ); + static inline bool endsInThe( const TQString & text ); inline void updateTrackDepth(); uint translateTimeFilter( uint filterMode ); @@ -327,14 +327,14 @@ class CollectionView : public KListView, public DropProxyTarget /**Call when a category has changed **/ void updateColumnHeader(); // Reimplemented from KListView - void viewportPaintEvent( QPaintEvent* ); - void viewportResizeEvent( QResizeEvent* ); - bool eventFilter( QObject*, QEvent* ); - void contentsDragEnterEvent( QDragEnterEvent* ); - void contentsDragMoveEvent( QDragMoveEvent* ); - void contentsDropEvent( QDropEvent *e ); + void viewportPaintEvent( TQPaintEvent* ); + void viewportResizeEvent( TQResizeEvent* ); + bool eventFilter( TQObject*, TQEvent* ); + void contentsDragEnterEvent( TQDragEnterEvent* ); + void contentsDragMoveEvent( TQDragMoveEvent* ); + void contentsDropEvent( TQDropEvent *e ); // Reimplemented from DropProxyTarget - void dropProxyEvent( QDropEvent *e ); + void dropProxyEvent( TQDropEvent *e ); void safeClear(); @@ -343,7 +343,7 @@ class CollectionView : public KListView, public DropProxyTarget CollectionBrowser* m_parent; - QString m_filter; + TQString m_filter; uint m_timeFilter; int m_cat1; int m_cat2; @@ -353,26 +353,26 @@ class CollectionView : public KListView, public DropProxyTarget // The iPod-style viewing attributes int m_currentDepth; // Current viewing depth - QStringList m_ipodFilters[3]; // Selections at each stage - QStringList m_ipodFilterYear; // See the comment for incrementDepth() + TQStringList m_ipodFilters[3]; // Selections at each stage + TQStringList m_ipodFilterYear; // See the comment for incrementDepth() // For auto-selection int m_ipodIncremented; // 0 = nothing, 1 = just incremented, 2 = just decremented - QStringList m_ipodSelected[3]; // Saved selections at lower levels - QString m_ipodCurrent[3]; // Saved current selections - QString m_ipodTopItem[3]; // Saved viewport positions + TQStringList m_ipodSelected[3]; // Saved selections at lower levels + TQString m_ipodCurrent[3]; // Saved current selections + TQString m_ipodTopItem[3]; // Saved viewport positions bool m_dirty; // we use this to avoid re-rendering the view when unnecessary (eg, browser is not visible) - QValueList m_cacheOpenItemPaths; - QStringList m_cacheViewportTopItem; - QStringList m_cacheCurrentItem; + TQValueList m_cacheOpenItemPaths; + TQStringList m_cacheViewportTopItem; + TQStringList m_cacheCurrentItem; KURL::List m_organizeURLs; bool m_organizeCopyMode; bool m_organizingFileCancelled; bool m_showDivider; - QValueList m_flatColumnWidths; + TQValueList m_flatColumnWidths; }; // why is signal detailsClicked() missing from KDialogBase? @@ -380,8 +380,8 @@ class OrganizeCollectionDialogBase : public KDialogBase { Q_OBJECT public: - OrganizeCollectionDialogBase( QWidget *parent=0, const char *name=0, bool modal=true, - const QString &caption=QString::null, + OrganizeCollectionDialogBase( TQWidget *parent=0, const char *name=0, bool modal=true, + const TQString &caption=TQString::null, int buttonMask=Ok|Apply|Cancel ) : KDialogBase( parent, name, modal, caption, buttonMask ) { diff --git a/amarok/src/collectiondb.cpp b/amarok/src/collectiondb.cpp index 0fb4ca7f..a1bcd0fc 100644 --- a/amarok/src/collectiondb.cpp +++ b/amarok/src/collectiondb.cpp @@ -38,16 +38,16 @@ #include "statusbar.h" #include "threadmanager.h" -#include -#include -#include -#include -#include -#include -#include //setHTMLLyrics() -#include -#include //createDragPixmap() -#include +#include +#include +#include +#include +#include +#include +#include //setHTMLLyrics() +#include +#include //createDragPixmap() +#include #include //debugging, can be removed later #include //setHTMLLyrics() @@ -114,7 +114,7 @@ INotify::~INotify() bool -INotify::watchDir( const QString directory ) +INotify::watchDir( const TQString directory ) { #ifdef HAVE_INOTIFY int wd = inotify_add_watch( m_fd, directory.local8Bit(), IN_CLOSE_WRITE | IN_DELETE | IN_MOVE | @@ -138,19 +138,19 @@ INotify::doJob() DEBUG_BLOCK IdList list = MountPointManager::instance()->getMountedDeviceIds(); - QString deviceIds; + TQString deviceIds; foreachType( IdList, list ) { if ( !deviceIds.isEmpty() ) deviceIds += ','; - deviceIds += QString::number(*it); + deviceIds += TQString::number(*it); } - const QStringList values = m_parent->query( QString( "SELECT dir, deviceid FROM directories WHERE deviceid IN (%1);" ) + const TQStringList values = m_parent->query( TQString( "SELECT dir, deviceid FROM directories WHERE deviceid IN (%1);" ) .arg( deviceIds ) ); foreach( values ) { - QString rpath = *it; + TQString rpath = *it; int deviceid = (*(++it)).toInt(); - QString abspath = MountPointManager::instance()->getAbsolutePath( deviceid, rpath ); + TQString abspath = MountPointManager::instance()->getAbsolutePath( deviceid, rpath ); watchDir( abspath ); } @@ -185,7 +185,7 @@ INotify::doJob() i += EVENT_SIZE + event->len; } - QTimer::singleShot( 0, m_parent, SLOT( scanMonitor() ) ); + TQTimer::singleShot( 0, m_parent, TQT_SLOT( scanMonitor() ) ); } } } @@ -200,12 +200,12 @@ INotify::doJob() // CLASS CollectionDB ////////////////////////////////////////////////////////////////////////////////////////// -QMutex* CollectionDB::connectionMutex = new QMutex(); -QMutex* CollectionDB::itemCoverMapMutex = new QMutex(); +TQMutex* CollectionDB::connectionMutex = new TQMutex(); +TQMutex* CollectionDB::itemCoverMapMutex = new TQMutex(); //we don't have to worry about this map leaking memory since ThreadManager limits the total //number of QThreads ever created -QMap *CollectionDB::threadConnections = new QMap(); -QMap *CollectionDB::itemCoverMap = new QMap(); +TQMap *CollectionDB::threadConnections = new TQMap(); +TQMap *CollectionDB::itemCoverMap = new TQMap(); CollectionDB* CollectionDB::instance() { @@ -248,26 +248,26 @@ CollectionDB::CollectionDB() // Remove cached "nocover" images, so that a new version actually gets shown // The asterisk is for also deleting the shadow-caches. - const QStringList entryList = cacheCoverDir().entryList( "*nocover.png*", QDir::Files ); + const TQStringList entryList = cacheCoverDir().entryList( "*nocover.png*", TQDir::Files ); foreach( entryList ) cacheCoverDir().remove( *it ); - connect( this, SIGNAL(fileMoved(const QString&, const QString&, const QString&)), - this, SLOT(aftMigratePermanentTablesUrl(const QString&, const QString&, const QString&)) ); - connect( this, SIGNAL(uniqueIdChanged(const QString&, const QString&, const QString&)), - this, SLOT(aftMigratePermanentTablesUniqueId(const QString&, const QString&, const QString&)) ); + connect( this, TQT_SIGNAL(fileMoved(const TQString&, const TQString&, const TQString&)), + this, TQT_SLOT(aftMigratePermanentTablesUrl(const TQString&, const TQString&, const TQString&)) ); + connect( this, TQT_SIGNAL(uniqueIdChanged(const TQString&, const TQString&, const TQString&)), + this, TQT_SLOT(aftMigratePermanentTablesUniqueId(const TQString&, const TQString&, const TQString&)) ); - connect( qApp, SIGNAL( aboutToQuit() ), this, SLOT( disableAutoScoring() ) ); + connect( qApp, TQT_SIGNAL( aboutToQuit() ), this, TQT_SLOT( disableAutoScoring() ) ); - connect( this, SIGNAL( coverRemoved( const QString&, const QString& ) ), - SIGNAL( coverChanged( const QString&, const QString& ) ) ); - connect( Scrobbler::instance(), SIGNAL( similarArtistsFetched( const QString&, const QStringList& ) ), - this, SLOT( similarArtistsFetched( const QString&, const QStringList& ) ) ); + connect( this, TQT_SIGNAL( coverRemoved( const TQString&, const TQString& ) ), + TQT_SIGNAL( coverChanged( const TQString&, const TQString& ) ) ); + connect( Scrobbler::instance(), TQT_SIGNAL( similarArtistsFetched( const TQString&, const TQStringList& ) ), + this, TQT_SLOT( similarArtistsFetched( const TQString&, const TQStringList& ) ) ); // If we're supposed to monitor dirs for changes, make sure we run it once // on startup, since inotify can't inform us about old events -// QTimer::singleShot( 0, this, SLOT( scanMonitor() ) ) +// TQTimer::singleShot( 0, this, TQT_SLOT( scanMonitor() ) ) initDirOperations(); m_aftEnabledPersistentTables << "lyrics" << "statistics" << "tags_labels"; } @@ -287,23 +287,23 @@ CollectionDB::~CollectionDB() inline QString -CollectionDB::exactCondition( const QString &right ) +CollectionDB::exactCondition( const TQString &right ) { if ( DbConnection::mysql == instance()->getDbConnectionType() ) - return QString( "= BINARY '" + instance()->escapeString( right ) + '\'' ); + return TQString( "= BINARY '" + instance()->escapeString( right ) + '\'' ); else - return QString( "= '" + instance()->escapeString( right ) + '\'' ); + return TQString( "= '" + instance()->escapeString( right ) + '\'' ); } QString -CollectionDB::likeCondition( const QString &right, bool anyBegin, bool anyEnd ) +CollectionDB::likeCondition( const TQString &right, bool anyBegin, bool anyEnd ) { - QString escaped = right; + TQString escaped = right; escaped.replace( '/', "//" ).replace( '%', "/%" ).replace( '_', "/_" ); escaped = instance()->escapeString( escaped ); - QString ret; + TQString ret; if ( DbConnection::postgresql == instance()->getDbConnectionType() ) ret = " ILIKE "; //case-insensitive according to locale else @@ -360,10 +360,10 @@ CollectionDB::initDirOperations() /** * Executes a SQL query on the already opened database * @param statement SQL program to execute. Only one SQL statement is allowed. - * @return The queried data, or QStringList() on error. + * @return The queried data, or TQStringList() on error. */ QStringList -CollectionDB::query( const QString& statement, bool suppressDebug ) +CollectionDB::query( const TQString& statement, bool suppressDebug ) { m_mutex.lock(); clock_t start; @@ -375,13 +375,13 @@ CollectionDB::query( const QString& statement, bool suppressDebug ) if ( statement.stripWhiteSpace().isEmpty() ) { m_mutex.unlock(); - return QStringList(); + return TQStringList(); } DbConnection *dbConn; dbConn = getMyConnection(); - QStringList values = dbConn->query( statement, suppressDebug ); + TQStringList values = dbConn->query( statement, suppressDebug ); if ( DEBUG ) { clock_t finish = clock(); @@ -399,7 +399,7 @@ CollectionDB::query( const QString& statement, bool suppressDebug ) * @return The rowid of the inserted item. */ int -CollectionDB::insert( const QString& statement, const QString& table ) +CollectionDB::insert( const TQString& statement, const TQString& table ) { m_mutex.lock(); clock_t start; @@ -430,11 +430,11 @@ CollectionDB::deviceidSelection( const bool showAll ) if ( !showAll ) { IdList list = MountPointManager::instance()->getMountedDeviceIds(); - QString deviceIds = ""; + TQString deviceIds = ""; foreachType( IdList, list ) { if ( it != list.begin() ) deviceIds += ','; - deviceIds += QString::number(*it); + deviceIds += TQString::number(*it); } return " AND tags.deviceid IN (" + deviceIds + ')'; } @@ -442,9 +442,9 @@ CollectionDB::deviceidSelection( const bool showAll ) } QStringList -CollectionDB::URLsFromQuery( const QStringList &result ) const +CollectionDB::URLsFromQuery( const TQStringList &result ) const { - QStringList values; + TQStringList values; foreach( result ) { const int id = (*it).toInt(); @@ -454,14 +454,14 @@ CollectionDB::URLsFromQuery( const QStringList &result ) const } KURL::List -CollectionDB::URLsFromSqlDrag( const QStringList &values ) const +CollectionDB::URLsFromSqlDrag( const TQStringList &values ) const { KURL::List urls; - for( QStringList::const_iterator it = values.begin(); + for( TQStringList::const_iterator it = values.begin(); it != values.end(); it++ ) { - const QString &rel = *it; + const TQString &rel = *it; it++; int id = (*it).toInt(); urls += KURL::fromPathOrURL( MountPointManager::instance()->getAbsolutePath( id, rel ) ); @@ -477,7 +477,7 @@ CollectionDB::URLsFromSqlDrag( const QStringList &values ) const bool CollectionDB::isEmpty( ) { - QStringList values; + TQStringList values; values = query( "SELECT COUNT( url ) FROM tags LIMIT 1 OFFSET 0;" ); @@ -488,11 +488,11 @@ CollectionDB::isEmpty( ) bool CollectionDB::isValid( ) { - QStringList values1; - QStringList values2; - QStringList values3; - QStringList values4; - QStringList values5; + TQStringList values1; + TQStringList values2; + TQStringList values3; + TQStringList values4; + TQStringList values5; values1 = query( "SELECT COUNT( url ) FROM tags LIMIT 1 OFFSET 0;" ); values2 = query( "SELECT COUNT( url ) FROM statistics LIMIT 1 OFFSET 0;" ); @@ -506,26 +506,26 @@ CollectionDB::isValid( ) QString -CollectionDB::adminValue( QString noption ) { - QStringList values; +CollectionDB::adminValue( TQString noption ) { + TQStringList values; values = query ( - QString( "SELECT value FROM admin WHERE noption = '%1';").arg(noption) + TQString( "SELECT value FROM admin WHERE noption = '%1';").arg(noption) ); return values.isEmpty() ? "" : values.first(); } void -CollectionDB::setAdminValue( QString noption, QString value ) { +CollectionDB::setAdminValue( TQString noption, TQString value ) { - QStringList values = query( QString( "SELECT value FROM admin WHERE noption = '%1';").arg( noption )); + TQStringList values = query( TQString( "SELECT value FROM admin WHERE noption = '%1';").arg( noption )); if(values.count() > 0) { - query( QString( "UPDATE admin SET value = '%1' WHERE noption = '%2';" ).arg( value, noption ) ); + query( TQString( "UPDATE admin SET value = '%1' WHERE noption = '%2';" ).arg( value, noption ) ); } else { - insert( QString( "INSERT INTO admin (value, noption) values ( '%1', '%2' );" ).arg( value, noption ), + insert( TQString( "INSERT INTO admin (value, noption) values ( '%1', '%2' );" ).arg( value, noption ), NULL ); } } @@ -538,7 +538,7 @@ CollectionDB::createTables( const bool temporary ) DEBUG_BLOCK //create tag table - query( QString( "CREATE %1 TABLE tags%2 (" + query( TQString( "CREATE %1 TABLE tags%2 (" "url " + exactTextColumnType() + "," "dir " + exactTextColumnType() + "," "createdate INTEGER," @@ -563,27 +563,27 @@ CollectionDB::createTables( const bool temporary ) .arg( temporary ? "TEMPORARY" : "" ) .arg( temporary ? "_temp" : "" ) ); - QString albumAutoIncrement = ""; - QString artistAutoIncrement = ""; - QString composerAutoIncrement = ""; - QString genreAutoIncrement = ""; - QString yearAutoIncrement = ""; + TQString albumAutoIncrement = ""; + TQString artistAutoIncrement = ""; + TQString composerAutoIncrement = ""; + TQString genreAutoIncrement = ""; + TQString yearAutoIncrement = ""; if ( getDbConnectionType() == DbConnection::postgresql ) { if(!temporary) { - query( QString( "CREATE SEQUENCE album_seq;" ) ); - query( QString( "CREATE SEQUENCE artist_seq;" ) ); - query( QString( "CREATE SEQUENCE composer_seq;" ) ); - query( QString( "CREATE SEQUENCE genre_seq;" ) ); - query( QString( "CREATE SEQUENCE year_seq;" ) ); + query( TQString( "CREATE SEQUENCE album_seq;" ) ); + query( TQString( "CREATE SEQUENCE artist_seq;" ) ); + query( TQString( "CREATE SEQUENCE composer_seq;" ) ); + query( TQString( "CREATE SEQUENCE genre_seq;" ) ); + query( TQString( "CREATE SEQUENCE year_seq;" ) ); } - albumAutoIncrement = QString("DEFAULT nextval('album_seq')"); - artistAutoIncrement = QString("DEFAULT nextval('artist_seq')"); - composerAutoIncrement = QString("DEFAULT nextval('composer_seq')"); - genreAutoIncrement = QString("DEFAULT nextval('genre_seq')"); - yearAutoIncrement = QString("DEFAULT nextval('year_seq')"); + albumAutoIncrement = TQString("DEFAULT nextval('album_seq')"); + artistAutoIncrement = TQString("DEFAULT nextval('artist_seq')"); + composerAutoIncrement = TQString("DEFAULT nextval('composer_seq')"); + genreAutoIncrement = TQString("DEFAULT nextval('genre_seq')"); + yearAutoIncrement = TQString("DEFAULT nextval('year_seq')"); } else if ( getDbConnectionType() == DbConnection::mysql ) { @@ -595,7 +595,7 @@ CollectionDB::createTables( const bool temporary ) } //create album table - query( QString( "CREATE %1 TABLE album%2 (" + query( TQString( "CREATE %1 TABLE album%2 (" "id INTEGER PRIMARY KEY %3," "name " + textColumnType() + ");" ) .arg( temporary ? "TEMPORARY" : "" ) @@ -603,7 +603,7 @@ CollectionDB::createTables( const bool temporary ) .arg( albumAutoIncrement ) ); //create artist table - query( QString( "CREATE %1 TABLE artist%2 (" + query( TQString( "CREATE %1 TABLE artist%2 (" "id INTEGER PRIMARY KEY %3," "name " + textColumnType() + ");" ) .arg( temporary ? "TEMPORARY" : "" ) @@ -611,7 +611,7 @@ CollectionDB::createTables( const bool temporary ) .arg( artistAutoIncrement ) ); //create composer table - query( QString( "CREATE %1 TABLE composer%2 (" + query( TQString( "CREATE %1 TABLE composer%2 (" "id INTEGER PRIMARY KEY %3," "name " + textColumnType() + ");" ) .arg( temporary ? "TEMPORARY" : "" ) @@ -619,7 +619,7 @@ CollectionDB::createTables( const bool temporary ) .arg( composerAutoIncrement ) ); //create genre table - query( QString( "CREATE %1 TABLE genre%2 (" + query( TQString( "CREATE %1 TABLE genre%2 (" "id INTEGER PRIMARY KEY %3," "name " + textColumnType() +");" ) .arg( temporary ? "TEMPORARY" : "" ) @@ -627,7 +627,7 @@ CollectionDB::createTables( const bool temporary ) .arg( genreAutoIncrement ) ); //create year table - query( QString( "CREATE %1 TABLE year%2 (" + query( TQString( "CREATE %1 TABLE year%2 (" "id INTEGER PRIMARY KEY %3," "name " + textColumnType() + ");" ) .arg( temporary ? "TEMPORARY" : "" ) @@ -635,7 +635,7 @@ CollectionDB::createTables( const bool temporary ) .arg( yearAutoIncrement ) ); //create images table - query( QString( "CREATE %1 TABLE images%2 (" + query( TQString( "CREATE %1 TABLE images%2 (" "path " + exactTextColumnType() + "," "deviceid INTEGER," "artist " + textColumnType() + "," @@ -644,7 +644,7 @@ CollectionDB::createTables( const bool temporary ) .arg( temporary ? "_temp" : "" ) ); //create embed table - query( QString( "CREATE %1 TABLE embed%2 (" + query( TQString( "CREATE %1 TABLE embed%2 (" "url " + exactTextColumnType() + "," "deviceid INTEGER," "hash " + exactTextColumnType() + "," @@ -653,7 +653,7 @@ CollectionDB::createTables( const bool temporary ) .arg( temporary ? "_temp" : "" ) ); // create directory statistics table - query( QString( "CREATE %1 TABLE directories%2 (" + query( TQString( "CREATE %1 TABLE directories%2 (" "dir " + exactTextColumnType() + "," "deviceid INTEGER," "changedate INTEGER);" ) @@ -661,7 +661,7 @@ CollectionDB::createTables( const bool temporary ) .arg( temporary ? "_temp" : "" ) ); //create uniqueid table - query( QString( "CREATE %1 TABLE uniqueid%2 (" + query( TQString( "CREATE %1 TABLE uniqueid%2 (" "url " + exactTextColumnType() + "," "deviceid INTEGER," "uniqueid " + exactTextColumnType(32) + " UNIQUE," @@ -670,26 +670,26 @@ CollectionDB::createTables( const bool temporary ) .arg( temporary ? "_temp" : "" ) ); //create indexes - query( QString( "CREATE INDEX album_idx%1 ON album%2( name );" ) + query( TQString( "CREATE INDEX album_idx%1 ON album%2( name );" ) .arg( temporary ? "_temp" : "" ).arg( temporary ? "_temp" : "" ) ); - query( QString( "CREATE INDEX artist_idx%1 ON artist%2( name );" ) + query( TQString( "CREATE INDEX artist_idx%1 ON artist%2( name );" ) .arg( temporary ? "_temp" : "" ).arg( temporary ? "_temp" : "" ) ); - query( QString( "CREATE INDEX composer_idx%1 ON composer%2( name );" ) + query( TQString( "CREATE INDEX composer_idx%1 ON composer%2( name );" ) .arg( temporary ? "_temp" : "" ).arg( temporary ? "_temp" : "" ) ); - query( QString( "CREATE INDEX genre_idx%1 ON genre%2( name );" ) + query( TQString( "CREATE INDEX genre_idx%1 ON genre%2( name );" ) .arg( temporary ? "_temp" : "" ).arg( temporary ? "_temp" : "" ) ); - query( QString( "CREATE INDEX year_idx%1 ON year%2( name );" ) + query( TQString( "CREATE INDEX year_idx%1 ON year%2( name );" ) .arg( temporary ? "_temp" : "" ).arg( temporary ? "_temp" : "" ) ); if ( !temporary ) { //create admin table -- holds the db version, put here other stuff if necessary - query( QString( "CREATE TABLE admin (" + query( TQString( "CREATE TABLE admin (" "noption " + textColumnType() + ", " "value " + textColumnType() + ");" ) ); // create related artists cache - query( QString( "CREATE TABLE related_artists (" + query( TQString( "CREATE TABLE related_artists (" "artist " + textColumnType() + "," "suggestion " + textColumnType() + "," "changedate INTEGER );" ) ); @@ -791,30 +791,30 @@ CollectionDB::createPermanentIndices() void CollectionDB::dropTables( const bool temporary ) { - query( QString( "DROP TABLE tags%1;" ).arg( temporary ? "_temp" : "" ) ); - query( QString( "DROP TABLE album%1;" ).arg( temporary ? "_temp" : "" ) ); - query( QString( "DROP TABLE artist%1;" ).arg( temporary ? "_temp" : "" ) ); - query( QString( "DROP TABLE composer%1;" ).arg( temporary ? "_temp" : "" ) ); - query( QString( "DROP TABLE genre%1;" ).arg( temporary ? "_temp" : "" ) ); - query( QString( "DROP TABLE year%1;" ).arg( temporary ? "_temp" : "" ) ); - query( QString( "DROP TABLE images%1;" ).arg( temporary ? "_temp" : "" ) ); - query( QString( "DROP TABLE embed%1;" ).arg( temporary ? "_temp" : "" ) ); - query( QString( "DROP TABLE directories%1;" ).arg( temporary ? "_temp" : "" ) ); - query( QString( "DROP TABLE uniqueid%1;" ).arg( temporary ? "_temp" : "" ) ); + query( TQString( "DROP TABLE tags%1;" ).arg( temporary ? "_temp" : "" ) ); + query( TQString( "DROP TABLE album%1;" ).arg( temporary ? "_temp" : "" ) ); + query( TQString( "DROP TABLE artist%1;" ).arg( temporary ? "_temp" : "" ) ); + query( TQString( "DROP TABLE composer%1;" ).arg( temporary ? "_temp" : "" ) ); + query( TQString( "DROP TABLE genre%1;" ).arg( temporary ? "_temp" : "" ) ); + query( TQString( "DROP TABLE year%1;" ).arg( temporary ? "_temp" : "" ) ); + query( TQString( "DROP TABLE images%1;" ).arg( temporary ? "_temp" : "" ) ); + query( TQString( "DROP TABLE embed%1;" ).arg( temporary ? "_temp" : "" ) ); + query( TQString( "DROP TABLE directories%1;" ).arg( temporary ? "_temp" : "" ) ); + query( TQString( "DROP TABLE uniqueid%1;" ).arg( temporary ? "_temp" : "" ) ); if ( !temporary ) { - query( QString( "DROP TABLE related_artists;" ) ); + query( TQString( "DROP TABLE related_artists;" ) ); debug() << "Dropping media table" << endl; } if ( getDbConnectionType() == DbConnection::postgresql ) { if (temporary == false) { - query( QString( "DROP SEQUENCE album_seq;" ) ); - query( QString( "DROP SEQUENCE artist_seq;" ) ); - query( QString( "DROP SEQUENCE composer_seq;" ) ); - query( QString( "DROP SEQUENCE genre_seq;" ) ); - query( QString( "DROP SEQUENCE year_seq;" ) ); + query( TQString( "DROP SEQUENCE album_seq;" ) ); + query( TQString( "DROP SEQUENCE artist_seq;" ) ); + query( TQString( "DROP SEQUENCE composer_seq;" ) ); + query( TQString( "DROP SEQUENCE genre_seq;" ) ); + query( TQString( "DROP SEQUENCE year_seq;" ) ); } } } @@ -823,28 +823,28 @@ CollectionDB::dropTables( const bool temporary ) void CollectionDB::clearTables( const bool temporary ) { - QString clearCommand = "DELETE FROM"; + TQString clearCommand = "DELETE FROM"; if ( getDbConnectionType() == DbConnection::mysql || getDbConnectionType() == DbConnection::postgresql) { // TRUNCATE TABLE is faster than DELETE FROM TABLE, so use it when supported. clearCommand = "TRUNCATE TABLE"; } - query( QString( "%1 tags%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) ); - query( QString( "%1 album%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) ); - query( QString( "%1 artist%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) ); - query( QString( "%1 composer%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) ); - query( QString( "%1 genre%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) ); - query( QString( "%1 year%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) ); - query( QString( "%1 images%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) ); - query( QString( "%1 embed%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) ); - query( QString( "%1 directories%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) ); - query( QString( "%1 uniqueid%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) ); + query( TQString( "%1 tags%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) ); + query( TQString( "%1 album%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) ); + query( TQString( "%1 artist%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) ); + query( TQString( "%1 composer%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) ); + query( TQString( "%1 genre%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) ); + query( TQString( "%1 year%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) ); + query( TQString( "%1 images%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) ); + query( TQString( "%1 embed%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) ); + query( TQString( "%1 directories%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) ); + query( TQString( "%1 uniqueid%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) ); if ( !temporary ) { - query( QString( "%1 related_artists;" ).arg( clearCommand ) ); + query( TQString( "%1 related_artists;" ).arg( clearCommand ) ); //debug() << "Clearing media table" << endl; - //query( QString( "%1 media;" ).arg( clearCommand ) ); + //query( TQString( "%1 media;" ).arg( clearCommand ) ); } } @@ -857,52 +857,52 @@ CollectionDB::copyTempTables( ) insert( "INSERT INTO tags SELECT * FROM tags_temp;", NULL ); //mysql 5 supports subqueries with IN, mysql 4 doesn't. this way will work for all SQL servers - QStringList albumIdList = query( "SELECT album.id FROM album;" ); + TQStringList albumIdList = query( "SELECT album.id FROM album;" ); //in an empty database, albumIdList is empty. This would result in a SQL query like NOT IN ( ) without //the -1 below which is invalid SQL. The auto generated values start at 1 so this is fine - QString albumIds = "-1"; + TQString albumIds = "-1"; foreach( albumIdList ) { albumIds += ','; albumIds += *it; } - insert( QString ( "INSERT INTO album SELECT * FROM album_temp WHERE album_temp.id NOT IN ( %1 );" ).arg( albumIds ), NULL ); + insert( TQString ( "INSERT INTO album SELECT * FROM album_temp WHERE album_temp.id NOT IN ( %1 );" ).arg( albumIds ), NULL ); - QStringList artistIdList = query( "SELECT artist.id FROM artist;" ); - QString artistIds = "-1"; + TQStringList artistIdList = query( "SELECT artist.id FROM artist;" ); + TQString artistIds = "-1"; foreach( artistIdList ) { artistIds += ','; artistIds += *it; } - insert( QString ( "INSERT INTO artist SELECT * FROM artist_temp WHERE artist_temp.id NOT IN ( %1 );" ).arg( artistIds ), NULL ); + insert( TQString ( "INSERT INTO artist SELECT * FROM artist_temp WHERE artist_temp.id NOT IN ( %1 );" ).arg( artistIds ), NULL ); - QStringList composerIdList = query( "SELECT composer.id FROM composer;" ); - QString composerIds = "-1"; + TQStringList composerIdList = query( "SELECT composer.id FROM composer;" ); + TQString composerIds = "-1"; foreach( composerIdList ) { composerIds += ','; composerIds += *it; } - insert( QString ( "INSERT INTO composer SELECT * FROM composer_temp WHERE composer_temp.id NOT IN ( %1 );" ).arg( composerIds ), NULL ); + insert( TQString ( "INSERT INTO composer SELECT * FROM composer_temp WHERE composer_temp.id NOT IN ( %1 );" ).arg( composerIds ), NULL ); - QStringList genreIdList = query( "SELECT genre.id FROM genre;" ); - QString genreIds = "-1"; + TQStringList genreIdList = query( "SELECT genre.id FROM genre;" ); + TQString genreIds = "-1"; foreach( genreIdList ) { genreIds += ','; genreIds += *it; } - insert( QString ( "INSERT INTO genre SELECT * FROM genre_temp WHERE genre_temp.id NOT IN ( %1 );" ).arg( genreIds ), NULL ); + insert( TQString ( "INSERT INTO genre SELECT * FROM genre_temp WHERE genre_temp.id NOT IN ( %1 );" ).arg( genreIds ), NULL ); - QStringList yearIdList = query( "SELECT year.id FROM year;" ); - QString yearIds = "-1"; + TQStringList yearIdList = query( "SELECT year.id FROM year;" ); + TQString yearIds = "-1"; foreach( yearIdList ) { yearIds += ','; yearIds += *it; } - insert( QString ( "INSERT INTO year SELECT * FROM year_temp WHERE year_temp.id NOT IN ( %1 );" ).arg( yearIds ), NULL ); + insert( TQString ( "INSERT INTO year SELECT * FROM year_temp WHERE year_temp.id NOT IN ( %1 );" ).arg( yearIds ), NULL ); insert( "INSERT INTO images SELECT * FROM images_temp;", NULL ); insert( "INSERT INTO embed SELECT * FROM embed_temp;", NULL ); @@ -925,17 +925,17 @@ void CollectionDB::createDevicesTable() { debug() << "Creating DEVICES table" << endl; - QString deviceAutoIncrement = ""; + TQString deviceAutoIncrement = ""; if ( getDbConnectionType() == DbConnection::postgresql ) { - query( QString( "CREATE SEQUENCE devices_seq;" ) ); - deviceAutoIncrement = QString("DEFAULT nextval('devices_seq')"); + query( TQString( "CREATE SEQUENCE devices_seq;" ) ); + deviceAutoIncrement = TQString("DEFAULT nextval('devices_seq')"); } else if ( getDbConnectionType() == DbConnection::mysql ) { deviceAutoIncrement = "AUTO_INCREMENT"; } - query( QString( "CREATE TABLE devices (" + query( TQString( "CREATE TABLE devices (" "id INTEGER PRIMARY KEY %1," "type " + textColumnType() + "," "label " + textColumnType() + "," @@ -953,7 +953,7 @@ void CollectionDB::createStatsTable() { // create music statistics database - query( QString( "CREATE TABLE statistics (" + query( TQString( "CREATE TABLE statistics (" "url " + exactTextColumnType() + "," "deviceid INTEGER," "createdate INTEGER," @@ -972,7 +972,7 @@ void CollectionDB::createStatsTableV8() { // create music statistics database - old form, for upgrade code. - query( QString( "CREATE TABLE statistics (" + query( TQString( "CREATE TABLE statistics (" "url " + textColumnType() + " UNIQUE," "createdate INTEGER," "accessdate INTEGER," @@ -994,7 +994,7 @@ void CollectionDB::createStatsTableV10( bool temp ) { // create music statistics database - query( QString( "CREATE %1 TABLE statistics%2 (" + query( TQString( "CREATE %1 TABLE statistics%2 (" "url " + exactTextColumnType() + "," "deviceid INTEGER," "createdate INTEGER," @@ -1042,23 +1042,23 @@ CollectionDB::createPersistentTables() "refetchdate INTEGER );" ); // create lyrics table - query( QString( "CREATE TABLE lyrics (" + query( TQString( "CREATE TABLE lyrics (" "url " + exactTextColumnType() + ", " "deviceid INTEGER," "lyrics " + longTextColumnType() + ", " "uniqueid " + exactTextColumnType(32) + ");" ) ); - query( QString( "CREATE TABLE playlists (" + query( TQString( "CREATE TABLE playlists (" "playlist " + textColumnType() + ", " "url " + exactTextColumnType() + ", " "tracknum INTEGER );" ) ); - QString labelsAutoIncrement = ""; + TQString labelsAutoIncrement = ""; if ( getDbConnectionType() == DbConnection::postgresql ) { - query( QString( "CREATE SEQUENCE labels_seq;" ) ); + query( TQString( "CREATE SEQUENCE labels_seq;" ) ); - labelsAutoIncrement = QString("DEFAULT nextval('labels_seq')"); + labelsAutoIncrement = TQString("DEFAULT nextval('labels_seq')"); } else if ( getDbConnectionType() == DbConnection::mysql ) { @@ -1066,12 +1066,12 @@ CollectionDB::createPersistentTables() } //create labels tables - query( QString( "CREATE TABLE labels (" + query( TQString( "CREATE TABLE labels (" "id INTEGER PRIMARY KEY " + labelsAutoIncrement + ", " "name " + textColumnType() + ", " "type INTEGER);" ) ); - query( QString( "CREATE TABLE tags_labels (" + query( TQString( "CREATE TABLE tags_labels (" "deviceid INTEGER," "url " + exactTextColumnType() + ", " "uniqueid " + exactTextColumnType(32) + ", " //m:n relationship, DO NOT MAKE UNIQUE! @@ -1089,16 +1089,16 @@ CollectionDB::createPersistentTablesV12() "refetchdate INTEGER );" ); // create lyrics table - query( QString( "CREATE TABLE lyrics (" + query( TQString( "CREATE TABLE lyrics (" "url " + textColumnType() + ", " "lyrics " + longTextColumnType() + ");" ) ); // create labels table - query( QString( "CREATE TABLE label (" + query( TQString( "CREATE TABLE label (" "url " + textColumnType() + "," "label " + textColumnType() + ");" ) ); - query( QString( "CREATE TABLE playlists (" + query( TQString( "CREATE TABLE playlists (" "playlist " + textColumnType() + ", " "url " + textColumnType() + ", " "tracknum INTEGER );" ) ); @@ -1112,23 +1112,23 @@ CollectionDB::createPersistentTablesV12() void CollectionDB::createPersistentTablesV14( bool temp ) { - const QString a( temp ? "TEMPORARY" : "" ); - const QString b( temp ? "_fix" : "" ); + const TQString a( temp ? "TEMPORARY" : "" ); + const TQString b( temp ? "_fix" : "" ); // create amazon table - query( QString( "CREATE %1 TABLE amazon%2 ( " + query( TQString( "CREATE %1 TABLE amazon%2 ( " "asin " + textColumnType(20) + ", " "locale " + textColumnType(2) + ", " "filename " + exactTextColumnType(33) + ", " "refetchdate INTEGER );" ).arg( a,b ) ); // create lyrics table - query( QString( "CREATE %1 TABLE lyrics%2 (" + query( TQString( "CREATE %1 TABLE lyrics%2 (" "url " + exactTextColumnType() + ", " "deviceid INTEGER," "lyrics " + longTextColumnType() + ");" ).arg( a,b ) ); - query( QString( "CREATE %1 TABLE playlists%2 (" + query( TQString( "CREATE %1 TABLE playlists%2 (" "playlist " + textColumnType() + ", " "url " + exactTextColumnType() + ", " "tracknum INTEGER );" ).arg( a,b ) ); @@ -1144,16 +1144,16 @@ CollectionDB::createPersistentTablesV14( bool temp ) void CollectionDB::createPodcastTables() { - QString podcastAutoIncrement = ""; - QString podcastFolderAutoInc = ""; + TQString podcastAutoIncrement = ""; + TQString podcastFolderAutoInc = ""; if ( getDbConnectionType() == DbConnection::postgresql ) { - query( QString( "CREATE SEQUENCE podcastepisode_seq;" ) ); + query( TQString( "CREATE SEQUENCE podcastepisode_seq;" ) ); - query( QString( "CREATE SEQUENCE podcastfolder_seq;" ) ); + query( TQString( "CREATE SEQUENCE podcastfolder_seq;" ) ); - podcastAutoIncrement = QString("DEFAULT nextval('podcastepisode_seq')"); - podcastFolderAutoInc = QString("DEFAULT nextval('podcastfolder_seq')"); + podcastAutoIncrement = TQString("DEFAULT nextval('podcastepisode_seq')"); + podcastFolderAutoInc = TQString("DEFAULT nextval('podcastfolder_seq')"); } else if ( getDbConnectionType() == DbConnection::mysql ) { @@ -1162,7 +1162,7 @@ CollectionDB::createPodcastTables() } // create podcast channels table - query( QString( "CREATE TABLE podcastchannels (" + query( TQString( "CREATE TABLE podcastchannels (" "url " + exactTextColumnType() + " UNIQUE," "title " + textColumnType() + "," "weblink " + exactTextColumnType() + "," @@ -1175,7 +1175,7 @@ CollectionDB::createPodcastTables() "autotransfer BOOL, haspurge BOOL, purgecount INTEGER );" ) ); // create podcast episodes table - query( QString( "CREATE TABLE podcastepisodes (" + query( TQString( "CREATE TABLE podcastepisodes (" "id INTEGER PRIMARY KEY %1, " "url " + exactTextColumnType() + " UNIQUE," "localurl " + exactTextColumnType() + "," @@ -1193,7 +1193,7 @@ CollectionDB::createPodcastTables() .arg( podcastAutoIncrement ) ); // create podcast folders table - query( QString( "CREATE TABLE podcastfolders (" + query( TQString( "CREATE TABLE podcastfolders (" "id INTEGER PRIMARY KEY %1, " "name " + textColumnType() + "," "parent INTEGER, isOpen BOOL );" ) @@ -1208,19 +1208,19 @@ CollectionDB::createPodcastTables() void CollectionDB::createPodcastTablesV2( bool temp ) { - const QString a( temp ? "TEMPORARY" : "" ); - const QString b( temp ? "_fix" : "" ); + const TQString a( temp ? "TEMPORARY" : "" ); + const TQString b( temp ? "_fix" : "" ); - QString podcastAutoIncrement = ""; - QString podcastFolderAutoInc = ""; + TQString podcastAutoIncrement = ""; + TQString podcastFolderAutoInc = ""; if ( getDbConnectionType() == DbConnection::postgresql ) { - query( QString( "CREATE SEQUENCE podcastepisode_seq;" ) ); + query( TQString( "CREATE SEQUENCE podcastepisode_seq;" ) ); - query( QString( "CREATE SEQUENCE podcastfolder_seq;" ) ); + query( TQString( "CREATE SEQUENCE podcastfolder_seq;" ) ); - podcastAutoIncrement = QString("DEFAULT nextval('podcastepisode_seq')"); - podcastFolderAutoInc = QString("DEFAULT nextval('podcastfolder_seq')"); + podcastAutoIncrement = TQString("DEFAULT nextval('podcastepisode_seq')"); + podcastFolderAutoInc = TQString("DEFAULT nextval('podcastfolder_seq')"); } else if ( getDbConnectionType() == DbConnection::mysql ) { @@ -1229,7 +1229,7 @@ CollectionDB::createPodcastTablesV2( bool temp ) } // create podcast channels table - query( QString( "CREATE %1 TABLE podcastchannels%2 (" + query( TQString( "CREATE %1 TABLE podcastchannels%2 (" "url " + exactTextColumnType() + " UNIQUE," "title " + textColumnType() + "," "weblink " + exactTextColumnType() + "," @@ -1242,7 +1242,7 @@ CollectionDB::createPodcastTablesV2( bool temp ) "autotransfer BOOL, haspurge BOOL, purgecount INTEGER );" ).arg( a,b ) ); // create podcast episodes table - query( QString( "CREATE %2 TABLE podcastepisodes%3 (" + query( TQString( "CREATE %2 TABLE podcastepisodes%3 (" "id INTEGER PRIMARY KEY %1, " "url " + exactTextColumnType() + " UNIQUE," "localurl " + exactTextColumnType() + "," @@ -1260,7 +1260,7 @@ CollectionDB::createPodcastTablesV2( bool temp ) .arg( podcastAutoIncrement, a, b ) ); // create podcast folders table - query( QString( "CREATE %2 TABLE podcastfolders%3 (" + query( TQString( "CREATE %2 TABLE podcastfolders%3 (" "id INTEGER PRIMARY KEY %1, " "name " + textColumnType() + "," "parent INTEGER, isOpen BOOL );" ) @@ -1318,7 +1318,7 @@ CollectionDB::dropDevicesTable() } uint -CollectionDB::artistID( QString value, bool autocreate, const bool temporary, bool exact /* = true */ ) +CollectionDB::artistID( TQString value, bool autocreate, const bool temporary, bool exact /* = true */ ) { // lookup cache if ( m_validArtistCache && m_cacheArtist[(int)temporary] == value ) @@ -1346,7 +1346,7 @@ CollectionDB::artistValue( uint id ) if ( m_cacheArtistID[0] == id ) return m_cacheArtist[0]; - QString value = valueFromID( "artist", id ); + TQString value = valueFromID( "artist", id ); // cache values m_cacheArtist[0] = value; @@ -1357,7 +1357,7 @@ CollectionDB::artistValue( uint id ) uint -CollectionDB::composerID( QString value, bool autocreate, const bool temporary, bool exact /* = true */ ) +CollectionDB::composerID( TQString value, bool autocreate, const bool temporary, bool exact /* = true */ ) { // lookup cache if ( m_validComposerCache && m_cacheComposer[(int)temporary] == value ) @@ -1385,7 +1385,7 @@ CollectionDB::composerValue( uint id ) if ( m_cacheComposerID[0] == id ) return m_cacheComposer[0]; - QString value = valueFromID( "composer", id ); + TQString value = valueFromID( "composer", id ); // cache values m_cacheComposer[0] = value; @@ -1396,7 +1396,7 @@ CollectionDB::composerValue( uint id ) uint -CollectionDB::albumID( QString value, bool autocreate, const bool temporary, bool exact /* = true */ ) +CollectionDB::albumID( TQString value, bool autocreate, const bool temporary, bool exact /* = true */ ) { // lookup cache if ( m_validAlbumCache && m_cacheAlbum[(int)temporary] == value ) @@ -1423,7 +1423,7 @@ CollectionDB::albumValue( uint id ) if ( m_cacheAlbumID[0] == id ) return m_cacheAlbum[0]; - QString value = valueFromID( "album", id ); + TQString value = valueFromID( "album", id ); // cache values m_cacheAlbum[0] = value; @@ -1433,7 +1433,7 @@ CollectionDB::albumValue( uint id ) } uint -CollectionDB::genreID( QString value, bool autocreate, const bool temporary, bool exact /* = true */ ) +CollectionDB::genreID( TQString value, bool autocreate, const bool temporary, bool exact /* = true */ ) { return exact ? IDFromExactValue( "genre", value, autocreate, temporary ).toUInt() : @@ -1448,7 +1448,7 @@ CollectionDB::genreValue( uint id ) uint -CollectionDB::yearID( QString value, bool autocreate, const bool temporary, bool exact /* = true */ ) +CollectionDB::yearID( TQString value, bool autocreate, const bool temporary, bool exact /* = true */ ) { return exact ? IDFromExactValue( "year", value, autocreate, temporary ).toUInt() : @@ -1464,7 +1464,7 @@ CollectionDB::yearValue( uint id ) uint -CollectionDB::IDFromValue( QString name, QString value, bool autocreate, const bool temporary ) +CollectionDB::IDFromValue( TQString name, TQString value, bool autocreate, const bool temporary ) { if ( temporary ) name.append( "_temp" ); @@ -1472,8 +1472,8 @@ CollectionDB::IDFromValue( QString name, QString value, bool autocreate, const b // else // conn = NULL; - QStringList values = - query( QString( + TQStringList values = + query( TQString( "SELECT id, name FROM %1 WHERE name %2;" ) .arg( name ) .arg( CollectionDB::likeCondition( value ) ) ); @@ -1482,7 +1482,7 @@ CollectionDB::IDFromValue( QString name, QString value, bool autocreate, const b uint id; if ( values.isEmpty() && autocreate ) { - id = insert( QString( "INSERT INTO %1 ( name ) VALUES ( '%2' );" ) + id = insert( TQString( "INSERT INTO %1 ( name ) VALUES ( '%2' );" ) .arg( name ) .arg( CollectionDB::instance()->escapeString( value ) ), name ); @@ -1494,10 +1494,10 @@ CollectionDB::IDFromValue( QString name, QString value, bool autocreate, const b QString -CollectionDB::valueFromID( QString table, uint id ) +CollectionDB::valueFromID( TQString table, uint id ) { - QStringList values = - query( QString( + TQStringList values = + query( TQString( "SELECT name FROM %1 WHERE id=%2;" ) .arg( table ) .arg( id ) ); @@ -1508,10 +1508,10 @@ CollectionDB::valueFromID( QString table, uint id ) QString -CollectionDB::albumSongCount( const QString &artist_id, const QString &album_id ) +CollectionDB::albumSongCount( const TQString &artist_id, const TQString &album_id ) { - QStringList values = - query( QString( + TQStringList values = + query( TQString( "SELECT COUNT( url ) FROM tags WHERE album = %1 AND artist = %2;" ) .arg( album_id ) .arg( artist_id ) ); @@ -1519,10 +1519,10 @@ CollectionDB::albumSongCount( const QString &artist_id, const QString &album_id } bool -CollectionDB::albumIsCompilation( const QString &album_id ) +CollectionDB::albumIsCompilation( const TQString &album_id ) { - QStringList values = - query( QString( + TQStringList values = + query( TQString( "SELECT sampler FROM tags WHERE sampler=%1 AND album=%2" ) .arg( CollectionDB::instance()->boolT() ) .arg( album_id ) ); @@ -1531,7 +1531,7 @@ CollectionDB::albumIsCompilation( const QString &album_id ) } QStringList -CollectionDB::albumTracks( const QString &artist_id, const QString &album_id ) +CollectionDB::albumTracks( const TQString &artist_id, const TQString &album_id ) { QueryBuilder qb; qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL ); @@ -1541,13 +1541,13 @@ CollectionDB::albumTracks( const QString &artist_id, const QString &album_id ) qb.addMatch( QueryBuilder::tabArtist, QueryBuilder::valID, artist_id ); qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valDiscNumber ); qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valTrack ); - QStringList ret = qb.run(); + TQStringList ret = qb.run(); uint returnValues = qb.countReturnValues(); if ( returnValues > 1 ) { - QStringList ret2; - for ( QStringList::size_type i = 0; i < ret.size(); i += returnValues ) + TQStringList ret2; + for ( TQStringList::size_type i = 0; i < ret.size(); i += returnValues ) ret2 << ret[ i ]; return ret2; } @@ -1556,16 +1556,16 @@ CollectionDB::albumTracks( const QString &artist_id, const QString &album_id ) } QStringList -CollectionDB::albumDiscTracks( const QString &artist_id, const QString &album_id, const QString &discNumber) +CollectionDB::albumDiscTracks( const TQString &artist_id, const TQString &album_id, const TQString &discNumber) { - QStringList rs; - rs = query( QString( "SELECT tags.deviceid, tags.url FROM tags, year WHERE tags.album = %1 AND " + TQStringList rs; + rs = query( TQString( "SELECT tags.deviceid, tags.url FROM tags, year WHERE tags.album = %1 AND " "tags.artist = %2 AND year.id = tags.year AND tags.discnumber = %3 " + deviceidSelection() + " ORDER BY tags.track;" ) .arg( album_id ) .arg( artist_id ) .arg( discNumber ) ); - QStringList result; + TQStringList result; foreach( rs ) { const int id = (*it).toInt(); @@ -1575,13 +1575,13 @@ CollectionDB::albumDiscTracks( const QString &artist_id, const QString &album_id } QStringList -CollectionDB::artistTracks( const QString &artist_id ) +CollectionDB::artistTracks( const TQString &artist_id ) { - QStringList rs = query( QString( "SELECT tags.deviceid, tags.url FROM tags, album " + TQStringList rs = query( TQString( "SELECT tags.deviceid, tags.url FROM tags, album " "WHERE tags.artist = '%1' AND album.id = tags.album " + deviceidSelection() + "ORDER BY album.name, tags.discnumber, tags.track;" ) .arg( artist_id ) ); - QStringList result = QStringList(); + TQStringList result = TQStringList(); foreach( rs ) { const int id = (*it).toInt(); @@ -1592,21 +1592,21 @@ CollectionDB::artistTracks( const QString &artist_id ) void -CollectionDB::addImageToAlbum( const QString& image, QValueList< QPair > info, const bool temporary ) +CollectionDB::addImageToAlbum( const TQString& image, TQValueList< QPair > info, const bool temporary ) { int deviceid = MountPointManager::instance()->getIdForUrl( image ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, image ); - for ( QValueList< QPair >::ConstIterator it = info.begin(); it != info.end(); ++it ) + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, image ); + for ( TQValueList< QPair >::ConstIterator it = info.begin(); it != info.end(); ++it ) { if ( (*it).first.isEmpty() || (*it).second.isEmpty() ) continue; - QString sql = QString( "INSERT INTO images%1 ( path, deviceid, artist, album ) VALUES ( '%3', %2" ) + TQString sql = TQString( "INSERT INTO images%1 ( path, deviceid, artist, album ) VALUES ( '%3', %2" ) .arg( temporary ? "_temp" : "" ) .arg( deviceid ) .arg( escapeString( rpath ) ); - sql += QString( ", '%1'" ).arg( escapeString( (*it).first ) ); - sql += QString( ", '%1' );" ).arg( escapeString( (*it).second ) ); + sql += TQString( ", '%1'" ).arg( escapeString( (*it).first ) ); + sql += TQString( ", '%1' );" ).arg( escapeString( (*it).second ) ); // debug() << "Added image for album: " << (*it).first << " - " << (*it).second << ": " << image << endl; insert( sql, NULL ); @@ -1614,14 +1614,14 @@ CollectionDB::addImageToAlbum( const QString& image, QValueList< QPairgetIdForUrl( path ); - QString rpath = MountPointManager::instance()->getRelativePath(deviceid, path ); - insert( QString( "INSERT INTO embed_temp ( url, deviceid, hash, description ) VALUES ( '%2', %1, '%3', '%4' );" ) + TQString rpath = MountPointManager::instance()->getRelativePath(deviceid, path ); + insert( TQString( "INSERT INTO embed_temp ( url, deviceid, hash, description ) VALUES ( '%2', %1, '%3', '%4' );" ) .arg( deviceid ) .arg( escapeString( rpath ), escapeString( hash ), escapeString( description ) ), NULL ); } @@ -1631,21 +1631,21 @@ CollectionDB::removeOrphanedEmbeddedImages() { //TODO refactor // do it the hard way, since a delete subquery wont work on MySQL - QStringList orphaned = query( "SELECT embed.deviceid, embed.url FROM embed LEFT JOIN tags ON embed.url = tags.url AND embed.deviceid = tags.deviceid WHERE tags.url IS NULL;" ); + TQStringList orphaned = query( "SELECT embed.deviceid, embed.url FROM embed LEFT JOIN tags ON embed.url = tags.url AND embed.deviceid = tags.deviceid WHERE tags.url IS NULL;" ); foreach( orphaned ) { - QString deviceid = *it; - QString rpath = *(++it); - query( QString( "DELETE FROM embed WHERE embed.deviceid = %1 AND embed.url = '%2';" ) + TQString deviceid = *it; + TQString rpath = *(++it); + query( TQString( "DELETE FROM embed WHERE embed.deviceid = %1 AND embed.url = '%2';" ) .arg( deviceid, escapeString( rpath ) ) ); } } QPixmap -CollectionDB::createDragPixmapFromSQL( const QString &sql, QString textOverRide ) +CollectionDB::createDragPixmapFromSQL( const TQString &sql, TQString textOverRide ) { // it is too slow to check if the url is actually in the colleciton. //TODO mountpointmanager: figure out what has to be done here - QStringList values = instance()->query( sql ); + TQStringList values = instance()->query( sql ); KURL::List list; foreach( values ) { @@ -1657,7 +1657,7 @@ CollectionDB::createDragPixmapFromSQL( const QString &sql, QString textOverRide } QPixmap -CollectionDB::createDragPixmap( const KURL::List &urls, QString textOverRide ) +CollectionDB::createDragPixmap( const KURL::List &urls, TQString textOverRide ) { // settings const int maxCovers = 4; // maximum number of cover images to show @@ -1674,10 +1674,10 @@ CollectionDB::createDragPixmap( const KURL::List &urls, QString textOverRide ) int remoteUrls = 0; int playlists = 0; - QMap albumMap; - QPixmap coverPm[maxCovers]; + TQMap albumMap; + TQPixmap coverPm[maxCovers]; - QString song, album; + TQString song, album; // iterate urls, get covers and count artist/albums @@ -1706,14 +1706,14 @@ CollectionDB::createDragPixmap( const KURL::List &urls, QString textOverRide ) song = mb.title(); album = mb.album(); - QString artist = mb.artist(); + TQString artist = mb.artist(); if( mb.compilation() == MetaBundle::CompilationYes ) - artist = QString( "Various_AMAROK_Artists" ); // magic key for the albumMap! + artist = TQString( "Various_AMAROK_Artists" ); // magic key for the albumMap! if( !albumMap.contains( artist + album ) ) { albumMap[ artist + album ] = 1; - QString coverName = CollectionDB::instance()->albumImage( mb.artist(), album, false, coverW ); + TQString coverName = CollectionDB::instance()->albumImage( mb.artist(), album, false, coverW ); if ( !coverName.endsWith( "@nocover.png" ) ) coverPm[covers++].load( coverName ); @@ -1725,7 +1725,7 @@ CollectionDB::createDragPixmap( const KURL::List &urls, QString textOverRide ) if( !albumMap.contains( mb.artist() + mb.album() ) ) { albumMap[ mb.artist() + mb.album() ] = 1; - QString coverName = CollectionDB::instance()->podcastImage( mb, false, coverW ); + TQString coverName = CollectionDB::instance()->podcastImage( mb, false, coverW ); if ( covers < maxCovers && !coverName.endsWith( "@nocover.png" ) ) coverPm[covers++].load( coverName ); @@ -1736,7 +1736,7 @@ CollectionDB::createDragPixmap( const KURL::List &urls, QString textOverRide ) // make better text... int albums = albumMap.count(); - QString text; + TQString text; if( !textOverRide.isEmpty() ) { @@ -1765,8 +1765,8 @@ CollectionDB::createDragPixmap( const KURL::List &urls, QString textOverRide ) else text = i18n( "Unknown item" ); - QFont font; - QFontMetrics fm( font ); + TQFont font; + TQFontMetrics fm( font ); int fontH = fm.height() + margin; int minWidth = fm.width( text ) + margin*2; //margin either side @@ -1779,8 +1779,8 @@ CollectionDB::createDragPixmap( const KURL::List &urls, QString textOverRide ) for ( int i = maxCovers-1; i > 0; i-- ) coverPm[i] = coverPm[i-1]; - QImage im( locate( "data","amarok/images/more_albums.png" ) ); - coverPm[0].convertFromImage( im.smoothScale( coverW, coverH, QImage::ScaleMin ) ); + TQImage im( locate( "data","amarok/images/more_albums.png" ) ); + coverPm[0].convertFromImage( im.smoothScale( coverW, coverH, TQImage::ScaleMin ) ); } pixmapH = coverPm[0].height(); @@ -1806,21 +1806,21 @@ CollectionDB::createDragPixmap( const KURL::List &urls, QString textOverRide ) pixmapH = fontH; } - QPixmap pmdrag( pixmapW, pixmapH ); - QPixmap pmtext( pixmapW, fontH ); + TQPixmap pmdrag( pixmapW, pixmapH ); + TQPixmap pmtext( pixmapW, fontH ); - QPalette palette = QToolTip::palette(); + TQPalette palette = TQToolTip::palette(); - QPainter p; + TQPainter p; p.begin( &pmtext ); - p.fillRect( 0, 0, pixmapW, fontH, QBrush( Qt::black ) ); // border - p.fillRect( 1, 1, pixmapW-margin, fontH-margin, palette.brush( QPalette::Normal, QColorGroup::Background ) ); - p.setBrush( palette.color( QPalette::Normal, QColorGroup::Text ) ); + p.fillRect( 0, 0, pixmapW, fontH, TQBrush( Qt::black ) ); // border + p.fillRect( 1, 1, pixmapW-margin, fontH-margin, palette.brush( TQPalette::Normal, TQColorGroup::Background ) ); + p.setBrush( palette.color( TQPalette::Normal, TQColorGroup::Text ) ); p.setFont( font ); p.drawText( margin, fm.ascent() + 1, text ); p.end(); - QBitmap pmtextMask(pixmapW, fontH); + TQBitmap pmtextMask(pixmapW, fontH); pmtextMask.fill( Qt::color1 ); // when we have found no covers, just display the text message @@ -1839,10 +1839,10 @@ CollectionDB::createDragPixmap( const KURL::List &urls, QString textOverRide ) bitBlt( &pmdrag, 0, pixmapH - fontH, &pmtext, 0, Qt::CopyROP ); p.end(); - QBitmap pmdragMask( pmdrag.size(), true ); + TQBitmap pmdragMask( pmdrag.size(), true ); for ( int i = 0; i < covers; i++ ) { - QBitmap coverMask( coverPm[i].width(), coverPm[i].height() ); + TQBitmap coverMask( coverPm[i].width(), coverPm[i].height() ); coverMask.fill( Qt::color1 ); bitBlt( &pmdragMask, i * coverSpacing, i * coverSpacing, &coverMask, 0, Qt::CopyROP ); } @@ -1853,24 +1853,24 @@ CollectionDB::createDragPixmap( const KURL::List &urls, QString textOverRide ) } QImage -CollectionDB::fetchImage( const KURL& url, QString &/*tmpFile*/ ) +CollectionDB::fetchImage( const KURL& url, TQString &/*tmpFile*/ ) { if ( url.protocol() != "file" ) { - QString tmpFile; + TQString tmpFile; KIO::NetAccess::download( url, tmpFile, 0 ); //TODO set 0 to the window, though it probably doesn't really matter - return QImage( tmpFile ); + return TQImage( tmpFile ); } else { - return QImage( url.path() ); + return TQImage( url.path() ); } } bool -CollectionDB::setAlbumImage( const QString& artist, const QString& album, const KURL& url ) +CollectionDB::setAlbumImage( const TQString& artist, const TQString& album, const KURL& url ) { - QString tmpFile; + TQString tmpFile; bool success = setAlbumImage( artist, album, fetchImage(url, tmpFile) ); KIO::NetAccess::removeTempFile( tmpFile ); //only removes file if it was created with NetAccess return success; @@ -1878,18 +1878,18 @@ CollectionDB::setAlbumImage( const QString& artist, const QString& album, const bool -CollectionDB::setAlbumImage( const QString& artist, const QString& album, QImage img, const QString& amazonUrl, const QString& asin ) +CollectionDB::setAlbumImage( const TQString& artist, const TQString& album, TQImage img, const TQString& amazonUrl, const TQString& asin ) { //show a wait cursor for the duration Amarok::OverrideCursor keep; - const bool isCompilation = albumIsCompilation( QString::number( albumID( album, false, false, true ) ) ); - const QString artist_ = isCompilation ? "" : artist; + const bool isCompilation = albumIsCompilation( TQString::number( albumID( album, false, false, true ) ) ); + const TQString artist_ = isCompilation ? "" : artist; // remove existing album covers removeAlbumImage( artist_, album ); - QCString key = md5sum( artist_, album ); + TQCString key = md5sum( artist_, album ); newAmazonReloadDate(asin, AmarokConfig::amazonLocale(), key); // Save Amazon product page URL as embedded string, for later retreival if ( !amazonUrl.isEmpty() ) @@ -1925,14 +1925,14 @@ CollectionDB::podcastImage( const MetaBundle &bundle, const bool withShadow, uin QString -CollectionDB::podcastImage( const QString &remoteURL, const bool withShadow, uint width ) +CollectionDB::podcastImage( const TQString &remoteURL, const bool withShadow, uint width ) { // we aren't going to need a 1x1 size image. this is just a quick hack to be able to show full size images. // width of 0 == full size if( width == 1 ) width = AmarokConfig::coverPreviewSize(); - QString s = findAmazonImage( "Podcast", remoteURL, width ); + TQString s = findAmazonImage( "Podcast", remoteURL, width ); if( s.isEmpty() ) { @@ -1943,7 +1943,7 @@ CollectionDB::podcastImage( const QString &remoteURL, const bool withShadow, uin { KIO::Job *job = KIO::storedGet( url, false, false ); m_podcastImageJobs[job] = remoteURL; - connect( job, SIGNAL( result( KIO::Job* ) ), SLOT( podcastImageResult( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), TQT_SLOT( podcastImageResult( KIO::Job* ) ) ); } } @@ -1956,7 +1956,7 @@ CollectionDB::podcastImage( const QString &remoteURL, const bool withShadow, uin void CollectionDB::podcastImageResult( KIO::Job *gjob ) { - QString url = m_podcastImageJobs[gjob]; + TQString url = m_podcastImageJobs[gjob]; m_podcastImageJobs.remove( gjob ); KIO::StoredTransferJob *job = dynamic_cast( gjob ); @@ -1978,13 +1978,13 @@ CollectionDB::podcastImageResult( KIO::Job *gjob ) return; } - QImage image( job->data() ); + TQImage image( job->data() ); if( !image.isNull() ) { if( url.isEmpty() ) url = job->url().url(); - QCString key = md5sum( "Podcast", url ); + TQCString key = md5sum( "Podcast", url ); if( image.save( largeCoverDir().filePath( key ), "PNG") ) emit imageFetched( url ); } @@ -1992,9 +1992,9 @@ CollectionDB::podcastImageResult( KIO::Job *gjob ) QString -CollectionDB::albumImage( const QString &artist, const QString &album, bool withShadow, uint width, bool* embedded ) +CollectionDB::albumImage( const TQString &artist, const TQString &album, bool withShadow, uint width, bool* embedded ) { - QString s; + TQString s; // we aren't going to need a 1x1 size image. this is just a quick hack to be able to show full size images. // width of 0 == full size if( width == 1 ) @@ -2037,12 +2037,12 @@ CollectionDB::albumImage( const uint artist_id, const uint album_id, bool withSh QString CollectionDB::albumImage( const MetaBundle &trackInformation, bool withShadow, uint width, bool* embedded ) { - QString s; + TQString s; if( width == 1 ) width = AmarokConfig::coverPreviewSize(); - QString album = trackInformation.album(); - QString artist = trackInformation.artist(); + TQString album = trackInformation.album(); + TQString artist = trackInformation.artist(); // this art is per track, so should check for it first s = findMetaBundleImage( trackInformation, width ); @@ -2063,38 +2063,38 @@ CollectionDB::albumImage( const MetaBundle &trackInformation, bool withShadow, u } QString -CollectionDB::makeShadowedImage( const QString& albumImage, bool cache ) +CollectionDB::makeShadowedImage( const TQString& albumImage, bool cache ) { qApp->lock(); - const QImage original( albumImage, "PNG" ); + const TQImage original( albumImage, "PNG" ); qApp->unlock(); if( original.hasAlphaBuffer() ) return albumImage; - const QFileInfo fileInfo( albumImage ); + const TQFileInfo fileInfo( albumImage ); const uint shadowSize = static_cast( original.width() / 100.0 * 6.0 ); - const QString cacheFile = fileInfo.fileName() + "@shadow"; + const TQString cacheFile = fileInfo.fileName() + "@shadow"; if ( !cache && cacheCoverDir().exists( cacheFile ) ) return cacheCoverDir().filePath( cacheFile ); - QImage shadow; + TQImage shadow; - const QString folder = Amarok::saveLocation( "covershadow-cache/" ); - const QString file = QString( "shadow_albumcover%1x%2.png" ).arg( original.width() + shadowSize ).arg( original.height() + shadowSize ); - if ( QFile::exists( folder + file ) ) { + const TQString folder = Amarok::saveLocation( "covershadow-cache/" ); + const TQString file = TQString( "shadow_albumcover%1x%2.png" ).arg( original.width() + shadowSize ).arg( original.height() + shadowSize ); + if ( TQFile::exists( folder + file ) ) { qApp->lock(); shadow.load( folder + file, "PNG" ); qApp->unlock(); } else { - shadow = QDeepCopy(instance()->m_shadowImage); + shadow = TQDeepCopy(instance()->m_shadowImage); shadow = shadow.smoothScale( original.width() + shadowSize, original.height() + shadowSize ); shadow.save( folder + file, "PNG" ); } - QImage target(shadow); + TQImage target(shadow); bitBlt( &target, 0, 0, &original ); if ( cache ) { @@ -2109,27 +2109,27 @@ CollectionDB::makeShadowedImage( const QString& albumImage, bool cache ) // Amazon Image QString -CollectionDB::findAmazonImage( const QString &artist, const QString &album, uint width ) +CollectionDB::findAmazonImage( const TQString &artist, const TQString &album, uint width ) { - QCString widthKey = makeWidthKey( width ); + TQCString widthKey = makeWidthKey( width ); if ( artist.isEmpty() && album.isEmpty() ) - return QString(); + return TQString(); - QCString key = md5sum( artist, album ); + TQCString key = md5sum( artist, album ); // check cache for existing cover if ( cacheCoverDir().exists( widthKey + key ) ) return cacheCoverDir().filePath( widthKey + key ); // we need to create a scaled version of this cover - QDir imageDir = largeCoverDir(); + TQDir imageDir = largeCoverDir(); if ( imageDir.exists( key ) ) { if ( width > 1 ) { - QImage img( imageDir.filePath( key ) ); - img.smoothScale( width, width, QImage::ScaleMin ).save( cacheCoverDir().filePath( widthKey + key ), "PNG" ); + TQImage img( imageDir.filePath( key ) ); + img.smoothScale( width, width, TQImage::ScaleMin ).save( cacheCoverDir().filePath( widthKey + key ), "PNG" ); return cacheCoverDir().filePath( widthKey + key ); } @@ -2137,31 +2137,31 @@ CollectionDB::findAmazonImage( const QString &artist, const QString &album, uint return imageDir.filePath( key ); } - return QString(); + return TQString(); } QString -CollectionDB::findDirectoryImage( const QString& artist, const QString& album, uint width ) +CollectionDB::findDirectoryImage( const TQString& artist, const TQString& album, uint width ) { if ( width == 1 ) width = AmarokConfig::coverPreviewSize(); - QCString widthKey = makeWidthKey( width ); + TQCString widthKey = makeWidthKey( width ); if ( album.isEmpty() ) - return QString(); + return TQString(); IdList list = MountPointManager::instance()->getMountedDeviceIds(); - QString deviceIds; + TQString deviceIds; foreachType( IdList, list ) { if ( !deviceIds.isEmpty() ) deviceIds += ','; - deviceIds += QString::number(*it); + deviceIds += TQString::number(*it); } - QStringList rs; + TQStringList rs; if ( artist == i18n( "Various Artists" ) || artist.isEmpty() ) { - rs = query( QString( + rs = query( TQString( "SELECT distinct images.deviceid,images.path FROM images, artist, tags " "WHERE images.artist = artist.name " "AND artist.id = tags.artist " @@ -2174,19 +2174,19 @@ CollectionDB::findDirectoryImage( const QString& artist, const QString& album, u } else { - rs = query( QString( + rs = query( TQString( "SELECT distinct images.deviceid,images.path FROM images WHERE artist %1 AND album %2 AND deviceid IN (%3) ORDER BY path;" ) .arg( CollectionDB::likeCondition( artist ) ) .arg( CollectionDB::likeCondition( album ) ) .arg( deviceIds ) ); } - QStringList values = URLsFromQuery( rs ); + TQStringList values = URLsFromQuery( rs ); if ( !values.isEmpty() ) { - QString image( values.first() ); + TQString image( values.first() ); uint matches = 0; uint maxmatches = 0; - QRegExp iTunesArt( "^AlbumArt_.*Large" ); + TQRegExp iTunesArt( "^AlbumArt_.*Large" ); for ( uint i = 0; i < values.count(); i++ ) { matches = values[i].contains( "front", false ) + values[i].contains( "cover", false ) + values[i].contains( "folder", false ) + values[i].contains( iTunesArt ); @@ -2197,36 +2197,36 @@ CollectionDB::findDirectoryImage( const QString& artist, const QString& album, u } } - QCString key = md5sum( artist, album, image ); + TQCString key = md5sum( artist, album, image ); if ( width > 1 ) { - QString path = cacheCoverDir().filePath( widthKey + key ); - if ( !QFile::exists( path ) ) + TQString path = cacheCoverDir().filePath( widthKey + key ); + if ( !TQFile::exists( path ) ) { - QImage img( image ); - img.smoothScale( width, width, QImage::ScaleMin ).save( path, "PNG" ); + TQImage img( image ); + img.smoothScale( width, width, TQImage::ScaleMin ).save( path, "PNG" ); } return path; } else //large image return image; } - return QString(); + return TQString(); } QString -CollectionDB::findEmbeddedImage( const QString& artist, const QString& album, uint width ) +CollectionDB::findEmbeddedImage( const TQString& artist, const TQString& album, uint width ) { // In the case of multiple embedded images, we arbitrarily choose one from the newest file // could potentially select multiple images within a file based on description, although a // lot of tagging software doesn't fill in that field, so we just get whatever the DB // happens to return for us - QStringList rs; + TQStringList rs; if ( artist == i18n("Various Artists") || artist.isEmpty() ) { // VAs need special handling to not match on artist name but instead check for sampler flag - rs = query( QString( + rs = query( TQString( "SELECT embed.hash, embed.deviceid, embed.url FROM " "tags INNER JOIN embed ON tags.url = embed.url " "INNER JOIN album ON tags.album = album.id " @@ -2237,7 +2237,7 @@ CollectionDB::findEmbeddedImage( const QString& artist, const QString& album, ui .arg( escapeString( album ) ) .arg( boolT() ) ); } else { - rs = query( QString( + rs = query( TQString( "SELECT embed.hash, embed.deviceid, embed.url FROM " "tags INNER JOIN embed ON tags.url = embed.url " "INNER JOIN artist ON tags.artist = artist.id " @@ -2250,15 +2250,15 @@ CollectionDB::findEmbeddedImage( const QString& artist, const QString& album, ui .arg( escapeString( album ) ) ); } - QStringList values = QStringList(); + TQStringList values = TQStringList(); if ( rs.count() == 3 ) { values += rs.first(); values += MountPointManager::instance()->getAbsolutePath( rs[1].toInt(), rs[2] ); } if ( values.count() == 2 ) { - QCString hash = values.first().utf8(); - QString result = loadHashFile( hash, width ); + TQCString hash = values.first().utf8(); + TQString result = loadHashFile( hash, width ); if ( result.isEmpty() ) { // need to get original from file first MetaBundle mb( KURL::fromPathOrURL( values.last() ) ); @@ -2269,7 +2269,7 @@ CollectionDB::findEmbeddedImage( const QString& artist, const QString& album, ui } return result; } - return QString(); + return TQString(); } @@ -2277,16 +2277,16 @@ QString CollectionDB::findMetaBundleImage( const MetaBundle& trackInformation, uint width ) { int deviceid = MountPointManager::instance()->getIdForUrl( trackInformation.url() ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, trackInformation.url().path() ); - QStringList values = - query( QString( + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, trackInformation.url().path() ); + TQStringList values = + query( TQString( "SELECT embed.hash FROM tags LEFT JOIN embed ON tags.url = embed.url " " AND tags.deviceid = embed.deviceid WHERE tags.url = '%2' AND tags.deviceid = %1 ORDER BY hash DESC LIMIT 1;" ) .arg( deviceid ).arg( escapeString( rpath ) ) ); if ( values.empty() || !values.first().isEmpty() ) { - QCString hash; - QString result; + TQCString hash; + TQString result; if( !values.empty() ) { // file in collection, so we know the hash hash = values.first().utf8(); result = loadHashFile( hash, width ); @@ -2300,45 +2300,45 @@ CollectionDB::findMetaBundleImage( const MetaBundle& trackInformation, uint widt } return result; } - return QString(); + return TQString(); } QCString CollectionDB::makeWidthKey( uint width ) { - return QString::number( width ).local8Bit() + '@'; + return TQString::number( width ).local8Bit() + '@'; } bool -CollectionDB::removeAlbumImage( const QString &artist, const QString &album ) +CollectionDB::removeAlbumImage( const TQString &artist, const TQString &album ) { DEBUG_BLOCK - QCString widthKey = "*@"; - QCString key = md5sum( artist, album ); + TQCString widthKey = "*@"; + TQCString key = md5sum( artist, album ); query( "DELETE FROM amazon WHERE filename='" + key + '\'' ); // remove scaled versions of images (and add the asterisk for the shadow-caches) - QStringList scaledList = cacheCoverDir().entryList( widthKey + key + '*' ); + TQStringList scaledList = cacheCoverDir().entryList( widthKey + key + '*' ); if ( scaledList.count() > 0 ) for ( uint i = 0; i < scaledList.count(); i++ ) - QFile::remove( cacheCoverDir().filePath( scaledList[ i ] ) ); + TQFile::remove( cacheCoverDir().filePath( scaledList[ i ] ) ); bool deleted = false; // remove large, original image - if ( largeCoverDir().exists( key ) && QFile::remove( largeCoverDir().filePath( key ) ) ) + if ( largeCoverDir().exists( key ) && TQFile::remove( largeCoverDir().filePath( key ) ) ) deleted = true; - QString hardImage = findDirectoryImage( artist, album ); + TQString hardImage = findDirectoryImage( artist, album ); debug() << "hardImage: " << hardImage << endl; if( !hardImage.isEmpty() ) { int id = MountPointManager::instance()->getIdForUrl( hardImage ); - QString rpath = MountPointManager::instance()->getRelativePath( id, hardImage ); - query( "DELETE FROM images WHERE path='" + escapeString( hardImage ) + "' AND deviceid = " + QString::number( id ) + ';' ); + TQString rpath = MountPointManager::instance()->getRelativePath( id, hardImage ); + query( "DELETE FROM images WHERE path='" + escapeString( hardImage ) + "' AND deviceid = " + TQString::number( id ) + ';' ); deleted = true; } @@ -2364,14 +2364,14 @@ CollectionDB::notAvailCover( const bool withShadow, int width ) { if ( width <= 1 ) width = AmarokConfig::coverPreviewSize(); - QString widthKey = QString::number( width ) + '@'; - QString s; + TQString widthKey = TQString::number( width ) + '@'; + TQString s; if( cacheCoverDir().exists( widthKey + "nocover.png" ) ) s = cacheCoverDir().filePath( widthKey + "nocover.png" ); else { - m_noCover.smoothScale( width, width, QImage::ScaleMin ).save( cacheCoverDir().filePath( widthKey + "nocover.png" ), "PNG" ); + m_noCover.smoothScale( width, width, TQImage::ScaleMin ).save( cacheCoverDir().filePath( widthKey + "nocover.png" ), "PNG" ); s = cacheCoverDir().filePath( widthKey + "nocover.png" ); } @@ -2487,15 +2487,15 @@ CollectionDB::labelList() } QStringList -CollectionDB::albumListOfArtist( const QString &artist, bool withUnknown, bool withCompilations ) +CollectionDB::albumListOfArtist( const TQString &artist, bool withUnknown, bool withCompilations ) { if (getDbConnectionType() == DbConnection::postgresql) { return query( "SELECT DISTINCT album.name, lower( album.name ) AS __discard FROM tags, album, artist WHERE " "tags.album = album.id AND tags.artist = artist.id " "AND lower(artist.name) = lower('" + escapeString( artist ) + "') " + - ( withUnknown ? QString::null : "AND album.name <> '' " ) + - ( withCompilations ? QString::null : "AND tags.sampler = " + boolF() ) + deviceidSelection() + + ( withUnknown ? TQString::null : "AND album.name <> '' " ) + + ( withCompilations ? TQString::null : "AND tags.sampler = " + boolF() ) + deviceidSelection() + " ORDER BY lower( album.name );" ); } // mysql is case insensitive and lower() is very slow @@ -2504,8 +2504,8 @@ CollectionDB::albumListOfArtist( const QString &artist, bool withUnknown, bool w return query( "SELECT DISTINCT album.name FROM tags, album, artist WHERE " "tags.album = album.id AND tags.artist = artist.id " "AND artist.name = '" + escapeString( artist ) + "' " + - ( withUnknown ? QString::null : "AND album.name <> '' " ) + - ( withCompilations ? QString::null : "AND tags.sampler = " + boolF() ) + deviceidSelection() + + ( withUnknown ? TQString::null : "AND album.name <> '' " ) + + ( withCompilations ? TQString::null : "AND tags.sampler = " + boolF() ) + deviceidSelection() + " ORDER BY album.name;" ); } else // sqlite @@ -2513,8 +2513,8 @@ CollectionDB::albumListOfArtist( const QString &artist, bool withUnknown, bool w return query( "SELECT DISTINCT album.name FROM tags, album, artist WHERE " "tags.album = album.id AND tags.artist = artist.id " "AND lower(artist.name) = lower('" + escapeString( artist ) + "') " + - ( withUnknown ? QString::null : "AND album.name <> '' " ) + - ( withCompilations ? QString::null : "AND tags.sampler = " + boolF() ) + deviceidSelection() + + ( withUnknown ? TQString::null : "AND album.name <> '' " ) + + ( withCompilations ? TQString::null : "AND tags.sampler = " + boolF() ) + deviceidSelection() + " ORDER BY lower( album.name );" ); } } @@ -2527,16 +2527,16 @@ CollectionDB::artistAlbumList( bool withUnknown, bool withCompilations ) { return query( "SELECT DISTINCT artist.name, album.name, lower( album.name ) AS __discard FROM tags, album, artist WHERE " "tags.album = album.id AND tags.artist = artist.id " + - ( withUnknown ? QString::null : "AND album.name <> '' AND artist.name <> '' " ) + - ( withCompilations ? QString::null : "AND tags.sampler = " + boolF() ) + deviceidSelection() + + ( withUnknown ? TQString::null : "AND album.name <> '' AND artist.name <> '' " ) + + ( withCompilations ? TQString::null : "AND tags.sampler = " + boolF() ) + deviceidSelection() + " ORDER BY lower( album.name );" ); } else { return query( "SELECT DISTINCT artist.name, album.name FROM tags, album, artist WHERE " "tags.album = album.id AND tags.artist = artist.id " + - ( withUnknown ? QString::null : "AND album.name <> '' AND artist.name <> '' " ) + - ( withCompilations ? QString::null : "AND tags.sampler = " + boolF() ) + deviceidSelection() + + ( withUnknown ? TQString::null : "AND album.name <> '' AND artist.name <> '' " ) + + ( withCompilations ? TQString::null : "AND tags.sampler = " + boolF() ) + deviceidSelection() + " ORDER BY lower( album.name );" ); } } @@ -2544,7 +2544,7 @@ CollectionDB::artistAlbumList( bool withUnknown, bool withCompilations ) bool CollectionDB::addPodcastChannel( const PodcastChannelBundle &pcb, const bool &replace ) { - QString command; + TQString command; if( replace ) { command = "REPLACE INTO podcastchannels " "( url, title, weblink, image, comment, copyright, parent, directory" @@ -2557,11 +2557,11 @@ CollectionDB::addPodcastChannel( const PodcastChannelBundle &pcb, const bool &re "VALUES ("; } - QString title = pcb.title(); + TQString title = pcb.title(); KURL link = pcb.link(); KURL image = pcb.imageURL(); - QString description = pcb.description(); - QString copyright = pcb.copyright(); + TQString description = pcb.description(); + TQString copyright = pcb.copyright(); if( title.isEmpty() ) title = pcb.url().prettyURL(); @@ -2572,13 +2572,13 @@ CollectionDB::addPodcastChannel( const PodcastChannelBundle &pcb, const bool &re command += ( image.isEmpty() ? "NULL" : '\'' + escapeString( image.url() ) + '\'' ) + ','; command += ( description.isEmpty() ? "NULL" : '\'' + escapeString( description ) + '\'' ) + ','; command += ( copyright.isEmpty() ? "NULL" : '\'' + escapeString( copyright ) + '\'' ) + ','; - command += QString::number( pcb.parentId() ) + ",'"; + command += TQString::number( pcb.parentId() ) + ",'"; command += escapeString( pcb.saveLocation() ) + "',"; command += pcb.autoscan() ? boolT() + ',' : boolF() + ','; - command += QString::number( pcb.fetchType() ) + ','; + command += TQString::number( pcb.fetchType() ) + ','; command += pcb.autotransfer() ? boolT() + ',' : boolF() + ','; command += pcb.hasPurge() ? boolT() + ',' : boolF() + ','; - command += QString::number( pcb.purgeCount() ) + ");"; + command += TQString::number( pcb.purgeCount() ) + ");"; //FIXME: currently there's no way to check if an INSERT query failed or not - always return true atm. // Now it might be possible as insert returns the rowid. @@ -2589,7 +2589,7 @@ CollectionDB::addPodcastChannel( const PodcastChannelBundle &pcb, const bool &re int CollectionDB::addPodcastEpisode( const PodcastEpisodeBundle &episode, const int idToUpdate ) { - QString command; + TQString command; if( idToUpdate ) { command = "REPLACE INTO podcastepisodes " @@ -2601,14 +2601,14 @@ CollectionDB::addPodcastEpisode( const PodcastEpisodeBundle &episode, const int "VALUES ("; } - QString localurl = episode.localUrl().url(); - QString title = episode.title(); - QString subtitle = episode.subtitle(); - QString author = episode.author(); - QString description = episode.description(); - QString type = episode.type(); - QString date = episode.date(); - QString guid = episode.guid(); + TQString localurl = episode.localUrl().url(); + TQString title = episode.title(); + TQString subtitle = episode.subtitle(); + TQString author = episode.author(); + TQString description = episode.description(); + TQString type = episode.type(); + TQString date = episode.date(); + TQString guid = episode.guid(); int duration = episode.duration(); uint size = episode.size(); @@ -2616,7 +2616,7 @@ CollectionDB::addPodcastEpisode( const PodcastEpisodeBundle &episode, const int title = episode.url().prettyURL(); if( idToUpdate ) - command += QString::number( idToUpdate ) + ','; + command += TQString::number( idToUpdate ) + ','; command += '\'' + escapeString( episode.url().url() ) + "',"; command += ( localurl.isEmpty() ? "NULL" : '\'' + escapeString( localurl ) + '\'' ) + ','; @@ -2628,8 +2628,8 @@ CollectionDB::addPodcastEpisode( const PodcastEpisodeBundle &episode, const int command += ( type.isEmpty() ? "NULL" : '\'' + escapeString( type ) + '\'' ) + ','; command += ( date.isEmpty() ? "NULL" : '\'' + escapeString( date ) + '\'' ) + ','; command += ( guid.isEmpty() ? "NULL" : '\'' + escapeString( guid ) + '\'' ) + ','; - command += QString::number( duration ) + ','; - command += QString::number( size ) + ','; + command += TQString::number( duration ) + ','; + command += TQString::number( size ) + ','; command += episode.isNew() ? boolT() + " );" : boolF() + " );"; insert( command, NULL ); @@ -2637,21 +2637,21 @@ CollectionDB::addPodcastEpisode( const PodcastEpisodeBundle &episode, const int if( idToUpdate ) return idToUpdate; //This is a bit of a hack. We have just inserted an item, so it is going to be the one with the //highest id. Change this if threaded insertions are used in the future. - QStringList values = query( QString("SELECT id FROM podcastepisodes WHERE url='%1' ORDER BY id DESC;") + TQStringList values = query( TQString("SELECT id FROM podcastepisodes WHERE url='%1' ORDER BY id DESC;") .arg( escapeString( episode.url().url() ) ) ); if( values.isEmpty() ) return -1; return values[0].toInt(); } -QValueList +TQValueList CollectionDB::getPodcastChannels() { - QString command = "SELECT url, title, weblink, image, comment, copyright, parent, directory " + TQString command = "SELECT url, title, weblink, image, comment, copyright, parent, directory " ", autoscan, fetchtype, autotransfer, haspurge, purgecount FROM podcastchannels;"; - QStringList values = query( command ); - QValueList bundles; + TQStringList values = query( command ); + TQValueList bundles; foreach( values ) { @@ -2676,19 +2676,19 @@ CollectionDB::getPodcastChannels() return bundles; } -QValueList +TQValueList CollectionDB::getPodcastEpisodes( const KURL &parent, bool onlyNew, int limit ) { - QString command = QString( "SELECT id, url, localurl, parent, guid, title, subtitle, composer, comment, filetype, createdate, length, size, isNew FROM podcastepisodes WHERE ( parent='%1'" ).arg( parent.url() ); + TQString command = TQString( "SELECT id, url, localurl, parent, guid, title, subtitle, composer, comment, filetype, createdate, length, size, isNew FROM podcastepisodes WHERE ( parent='%1'" ).arg( parent.url() ); if( onlyNew ) - command += QString( " AND isNew='%1'" ).arg( boolT() ); + command += TQString( " AND isNew='%1'" ).arg( boolT() ); command += " ) ORDER BY id"; if( limit != -1 ) - command += QString( " DESC LIMIT %1 OFFSET 0" ).arg( limit ); + command += TQString( " DESC LIMIT %1 OFFSET 0" ).arg( limit ); command += ';'; - QStringList values = query( command ); - QValueList bundles; + TQStringList values = query( command ); + TQValueList bundles; foreach( values ) { @@ -2722,9 +2722,9 @@ CollectionDB::getPodcastEpisodes( const KURL &parent, bool onlyNew, int limit ) PodcastEpisodeBundle CollectionDB::getPodcastEpisodeById( int id ) { - QString command = QString( "SELECT url, localurl, parent, guid, title, subtitle, composer, comment, filetype, createdate, length, size, isNew FROM podcastepisodes WHERE id=%1;").arg( id ); + TQString command = TQString( "SELECT url, localurl, parent, guid, title, subtitle, composer, comment, filetype, createdate, length, size, isNew FROM podcastepisodes WHERE id=%1;").arg( id ); - QStringList values = query( command ); + TQStringList values = query( command ); PodcastEpisodeBundle peb; foreach( values ) { @@ -2757,16 +2757,16 @@ CollectionDB::getPodcastEpisodeBundle( const KURL &url, PodcastEpisodeBundle *pe int id = 0; if( url.isLocalFile() ) { - QStringList values = - query( QString( "SELECT id FROM podcastepisodes WHERE localurl = '%1';" ) + TQStringList values = + query( TQString( "SELECT id FROM podcastepisodes WHERE localurl = '%1';" ) .arg( escapeString( url.url() ) ) ); if( !values.isEmpty() ) id = values[0].toInt(); } else { - QStringList values = - query( QString( "SELECT id FROM podcastepisodes WHERE url = '%1';" ) + TQStringList values = + query( TQString( "SELECT id FROM podcastepisodes WHERE url = '%1';" ) .arg( escapeString( url.url() ) ) ); if( !values.isEmpty() ) id = values[0].toInt(); @@ -2784,7 +2784,7 @@ CollectionDB::getPodcastEpisodeBundle( const KURL &url, PodcastEpisodeBundle *pe bool CollectionDB::getPodcastChannelBundle( const KURL &url, PodcastChannelBundle *pcb ) { - QStringList values = query( QString( + TQStringList values = query( TQString( "SELECT url, title, weblink, image, comment, copyright, parent, directory " ", autoscan, fetchtype, autotransfer, haspurge, purgecount FROM podcastchannels WHERE url = '%1';" ).arg( escapeString( url.url() ) ) ); @@ -2812,18 +2812,18 @@ CollectionDB::getPodcastChannelBundle( const KURL &url, PodcastChannelBundle *pc // return newly created folder id int -CollectionDB::addPodcastFolder( const QString &name, const int parent_id, const bool isOpen ) +CollectionDB::addPodcastFolder( const TQString &name, const int parent_id, const bool isOpen ) { - QString command = QString( "INSERT INTO podcastfolders ( name, parent, isOpen ) VALUES ('" ); + TQString command = TQString( "INSERT INTO podcastfolders ( name, parent, isOpen ) VALUES ('" ); command += escapeString( name ) + "',"; - command += QString::number( parent_id ) + ","; + command += TQString::number( parent_id ) + ","; command += isOpen ? boolT() + ");" : boolF() + ");"; insert( command, NULL ); - command = QString( "SELECT id FROM podcastfolders WHERE name = '%1' AND parent = '%2';" ) - .arg( name, QString::number(parent_id) ); - QStringList values = query( command ); + command = TQString( "SELECT id FROM podcastfolders WHERE name = '%1' AND parent = '%2';" ) + .arg( name, TQString::number(parent_id) ); + TQStringList values = query( command ); return values[0].toInt(); } @@ -2836,18 +2836,18 @@ CollectionDB::updatePodcastChannel( const PodcastChannelBundle &b ) query( QStringx( "UPDATE podcastchannels SET title='%1', weblink='%2', comment='%3', " "copyright='%4', parent=%5, directory='%6', autoscan=%7, fetchtype=%8, " "autotransfer=%9, haspurge=%10, purgecount=%11 WHERE url='%12';" ) - .args ( QStringList() + .args ( TQStringList() << escapeString( b.title() ) << escapeString( b.link().url() ) << escapeString( b.description() ) << escapeString( b.copyright() ) - << QString::number( b.parentId() ) + << TQString::number( b.parentId() ) << escapeString( b.saveLocation() ) << ( b.autoscan() ? boolT() : boolF() ) - << QString::number( b.fetchType() ) + << TQString::number( b.fetchType() ) << (b.hasPurge() ? boolT() : boolF() ) << (b.autotransfer() ? boolT() : boolF() ) - << QString::number( b.purgeCount() ) + << TQString::number( b.purgeCount() ) << escapeString( b.url().url() ) ) ); @@ -2864,7 +2864,7 @@ CollectionDB::updatePodcastEpisode( const int id, const PodcastEpisodeBundle &b { query( QStringx( "UPDATE podcastepisodes SET url='%1', localurl='%2', parent='%3', title='%4', subtitle='%5', composer='%6', comment='%7', " "filetype='%8', createdate='%9', guid='%10', length=%11, size=%12, isNew=%13 WHERE id=%14;" ) - .args( QStringList() + .args( TQStringList() << escapeString( b.url().url() ) << ( b.localUrl().isValid() ? escapeString( b.localUrl().url() ) : "NULL" ) << escapeString( b.parent().url() ) @@ -2875,10 +2875,10 @@ CollectionDB::updatePodcastEpisode( const int id, const PodcastEpisodeBundle &b << escapeString( b.type() ) << escapeString( b.date() ) << escapeString( b.guid() ) - << QString::number( b.duration() ) - << escapeString( QString::number( b.size() ) ) + << TQString::number( b.duration() ) + << escapeString( TQString::number( b.size() ) ) << ( b.isNew() ? boolT() : boolF() ) - << QString::number( id ) + << TQString::number( id ) ) ); } @@ -2888,25 +2888,25 @@ CollectionDB::updatePodcastEpisode( const int id, const PodcastEpisodeBundle &b } void -CollectionDB::updatePodcastFolder( const int folder_id, const QString &name, const int parent_id, const bool isOpen ) +CollectionDB::updatePodcastFolder( const int folder_id, const TQString &name, const int parent_id, const bool isOpen ) { if( getDbConnectionType() == DbConnection::postgresql ) { query( QStringx( "UPDATE podcastfolders SET name='%1', parent=%2, isOpen=%3 WHERE id=%4;" ) - .args( QStringList() + .args( TQStringList() << escapeString(name) - << QString::number(parent_id) + << TQString::number(parent_id) << ( isOpen ? boolT() : boolF() ) - << QString::number(folder_id) + << TQString::number(folder_id) ) ); } else { query( QStringx( "REPLACE INTO podcastfolders ( id, name, parent, isOpen ) " "VALUES ( %1, '%2', %3, %4 );" ) - .args( QStringList() - << QString::number(folder_id) + .args( TQStringList() + << TQString::number(folder_id) << escapeString(name) - << QString::number(parent_id) + << TQString::number(parent_id) << ( isOpen ? boolT() : boolF() ) ) ); @@ -2917,10 +2917,10 @@ void CollectionDB::removePodcastChannel( const KURL &url ) { //remove channel - query( QString( "DELETE FROM podcastchannels WHERE url = '%1';" ) + query( TQString( "DELETE FROM podcastchannels WHERE url = '%1';" ) .arg( escapeString( url.url() ) ) ); //remove all children - query( QString( "DELETE FROM podcastepisodes WHERE parent = '%1';" ) + query( TQString( "DELETE FROM podcastepisodes WHERE parent = '%1';" ) .arg( escapeString( url.url() ) ) ); } @@ -2930,31 +2930,31 @@ void CollectionDB::removePodcastEpisode( const int id ) { if( id < 0 ) return; - query( QString( "DELETE FROM podcastepisodes WHERE id = '%1';" ) - .arg( QString::number(id) ) ); + query( TQString( "DELETE FROM podcastepisodes WHERE id = '%1';" ) + .arg( TQString::number(id) ) ); } void CollectionDB::removePodcastFolder( const int id ) { if( id < 0 ) return; - query( QString("DELETE FROM podcastfolders WHERE id=%1;") - .arg( QString::number(id) ) ); + query( TQString("DELETE FROM podcastfolders WHERE id=%1;") + .arg( TQString::number(id) ) ); } bool CollectionDB::addSong( MetaBundle* bundle, const bool incremental ) { - if ( !QFileInfo( bundle->url().path() ).isReadable() ) return false; + if ( !TQFileInfo( bundle->url().path() ).isReadable() ) return false; - QString command = "INSERT INTO tags_temp " + TQString command = "INSERT INTO tags_temp " "( url, dir, deviceid, createdate, modifydate, album, artist, composer, genre, year, title, " "comment, track, discnumber, bpm, sampler, length, bitrate, " "samplerate, filesize, filetype ) " "VALUES ('"; - QString artist = bundle->artist(); - QString title = bundle->title(); + TQString artist = bundle->artist(); + TQString title = bundle->title(); if ( title.isEmpty() ) { title = bundle->url().fileName(); @@ -2979,21 +2979,21 @@ CollectionDB::addSong( MetaBundle* bundle, const bool incremental ) command += escapeString( relativePath.path() ) + "','"; command += escapeString( relativePath.directory() ) + "',"; - command += QString::number( deviceId ) + ','; - command += QString::number( QFileInfo( bundle->url().path() ).created().toTime_t() ) + ','; - command += QString::number( QFileInfo( bundle->url().path() ).lastModified().toTime_t() ) + ','; + command += TQString::number( deviceId ) + ','; + command += TQString::number( TQFileInfo( bundle->url().path() ).created().toTime_t() ) + ','; + command += TQString::number( TQFileInfo( bundle->url().path() ).lastModified().toTime_t() ) + ','; - command += escapeString( QString::number( albumID( bundle->album(), true, !incremental, true ) ) ) + ','; - command += escapeString( QString::number( artistID( bundle->artist(), true, !incremental, true ) ) ) + ','; - command += escapeString( QString::number( composerID( bundle->composer(), true, !incremental, true ) ) ) + ','; - command += escapeString( QString::number( genreID( bundle->genre(), true, !incremental, true ) ) ) + ",'"; - command += escapeString( QString::number( yearID( QString::number( bundle->year() ), true, !incremental, true ) ) ) + "','"; + command += escapeString( TQString::number( albumID( bundle->album(), true, !incremental, true ) ) ) + ','; + command += escapeString( TQString::number( artistID( bundle->artist(), true, !incremental, true ) ) ) + ','; + command += escapeString( TQString::number( composerID( bundle->composer(), true, !incremental, true ) ) ) + ','; + command += escapeString( TQString::number( genreID( bundle->genre(), true, !incremental, true ) ) ) + ",'"; + command += escapeString( TQString::number( yearID( TQString::number( bundle->year() ), true, !incremental, true ) ) ) + "','"; command += escapeString( bundle->title() ) + "','"; command += escapeString( bundle->comment() ) + "', "; - command += escapeString( QString::number( bundle->track() ) ) + " , "; - command += escapeString( QString::number( bundle->discNumber() ) ) + " , "; - command += escapeString( QString::number( bundle->bpm() ) ) + " , "; + command += escapeString( TQString::number( bundle->track() ) ) + " , "; + command += escapeString( TQString::number( bundle->discNumber() ) ) + " , "; + command += escapeString( TQString::number( bundle->bpm() ) ) + " , "; switch( bundle->compilation() ) { case MetaBundle::CompilationNo: command += boolF(); @@ -3011,11 +3011,11 @@ CollectionDB::addSong( MetaBundle* bundle, const bool incremental ) // NOTE any of these may be -1 or -2, this is what we want // see MetaBundle::Undetermined - command += QString::number( bundle->length() ) + ','; - command += QString::number( bundle->bitrate() ) + ','; - command += QString::number( bundle->sampleRate() ) + ','; - command += QString::number( bundle->filesize() ) + ','; - command += QString::number( bundle->fileType() ) + ')'; + command += TQString::number( bundle->length() ) + ','; + command += TQString::number( bundle->bitrate() ) + ','; + command += TQString::number( bundle->sampleRate() ) + ','; + command += TQString::number( bundle->filesize() ) + ','; + command += TQString::number( bundle->fileType() ) + ')'; //FIXME: currently there's no way to check if an INSERT query failed or not - always return true atm. // Now it might be possible as insert returns the rowid. @@ -3035,15 +3035,15 @@ CollectionDB::doAFTStuff( MetaBundle* bundle, const bool tempTables ) MountPointManager *mpm = MountPointManager::instance(); //const to make sure one isn't later modified without the other being changed const int deviceIdInt = mpm->getIdForUrl( bundle->url().path() ); - const QString currdeviceid = QString::number( deviceIdInt ); - QString currid = escapeString( bundle->uniqueId() ); - QString currurl = escapeString( mpm->getRelativePath( deviceIdInt, bundle->url().path() ) ); - QString currdir = escapeString( mpm->getRelativePath( deviceIdInt, bundle->url().directory() ) ); + const TQString currdeviceid = TQString::number( deviceIdInt ); + TQString currid = escapeString( bundle->uniqueId() ); + TQString currurl = escapeString( mpm->getRelativePath( deviceIdInt, bundle->url().path() ) ); + TQString currdir = escapeString( mpm->getRelativePath( deviceIdInt, bundle->url().directory() ) ); //debug() << "Checking currid = " << currid << ", currdir = " << currdir << ", currurl = " << currurl << endl; //debug() << "tempTables = " << (tempTables?"true":"false") << endl; - QStringList urls = query( QString( + TQStringList urls = query( TQString( "SELECT url, uniqueid " "FROM uniqueid%1 " "WHERE deviceid = %2 AND url = '%3';" ) @@ -3051,20 +3051,20 @@ CollectionDB::doAFTStuff( MetaBundle* bundle, const bool tempTables ) , currdeviceid , currurl ) ); - QStringList uniqueids = query( QString( + TQStringList uniqueids = query( TQString( "SELECT url, uniqueid, deviceid " "FROM uniqueid%1 " "WHERE uniqueid = '%2';" ) .arg( tempTables ? "_temp" : "" , currid ) ); - QStringList nonTempIDs = query( QString( + TQStringList nonTempIDs = query( TQString( "SELECT url, uniqueid, deviceid " "FROM uniqueid " "WHERE uniqueid = '%1';" ) .arg( currid ) ); - QStringList nonTempURLs = query( QString( + TQStringList nonTempURLs = query( TQString( "SELECT url, uniqueid " "FROM uniqueid " "WHERE deviceid = %1 AND url = '%2';" ) @@ -3090,9 +3090,9 @@ CollectionDB::doAFTStuff( MetaBundle* bundle, const bool tempTables ) if( !tempTablesAndInPermanent && urls.empty() && uniqueids.empty() ) { //debug() << "first case" << endl; - QString insertline = QStringx( "INSERT INTO uniqueid%1 (deviceid, url, uniqueid, dir) " + TQString insertline = QStringx( "INSERT INTO uniqueid%1 (deviceid, url, uniqueid, dir) " "VALUES ( %2,'%3', '%4', '%5');" ) - .args( QStringList() + .args( TQStringList() << ( tempTables ? "_temp" : "" ) << currdeviceid << currurl @@ -3111,20 +3111,20 @@ CollectionDB::doAFTStuff( MetaBundle* bundle, const bool tempTables ) if( urls.empty() ) //uniqueid already found in temporary table but not url; check the old URL { //stat the original URL - QString absPath = mpm->getAbsolutePath( uniqueids[2].toInt(), uniqueids[0] ); + TQString absPath = mpm->getAbsolutePath( uniqueids[2].toInt(), uniqueids[0] ); //debug() << "At doAFTStuff, stat-ing file " << absPath << endl; bool statSuccessful = false; bool pathsSame = absPath == bundle->url().path(); if( !pathsSame ) - statSuccessful = QFile::exists( absPath ); + statSuccessful = TQFile::exists( absPath ); if( statSuccessful ) //if true, new one is a copy warning() << "Already-scanned file at " << absPath << " has same UID as new file at " << bundle->url().path() << endl; else //it's a move, not a copy, or a copy and then both files were moved...can't detect that { //debug() << "stat was NOT successful, updating tables with: " << endl; - //debug() << QString( "UPDATE uniqueid%1 SET url='%2', dir='%3' WHERE uniqueid='%4';" ).arg( ( tempTables ? "_temp" : "" ), currurl, currdir, currid ) << endl; + //debug() << TQString( "UPDATE uniqueid%1 SET url='%2', dir='%3' WHERE uniqueid='%4';" ).arg( ( tempTables ? "_temp" : "" ), currurl, currdir, currid ) << endl; query( QStringx( "UPDATE uniqueid%1 SET deviceid = %2, url='%3', dir='%4' WHERE uniqueid='%5';" ) - .args( QStringList() + .args( TQStringList() << ( tempTables ? "_temp" : "" ) << currdeviceid << currurl @@ -3141,7 +3141,7 @@ CollectionDB::doAFTStuff( MetaBundle* bundle, const bool tempTables ) else if( uniqueids.empty() ) { //debug() << "file exists in same place as before, new uniqueid" << endl; - query( QString( "UPDATE uniqueid%1 SET uniqueid='%2' WHERE deviceid = %3 AND url='%4';" ) + query( TQString( "UPDATE uniqueid%1 SET uniqueid='%2' WHERE deviceid = %3 AND url='%4';" ) .arg( tempTables ? "_temp" : "" , currid , currdeviceid @@ -3159,11 +3159,11 @@ CollectionDB::doAFTStuff( MetaBundle* bundle, const bool tempTables ) //in this case, just insert into temp table if( permanentFullMatch ) { - QString insertline = QString( "INSERT INTO uniqueid_temp (deviceid, url, uniqueid, dir) " + TQString insertline = TQString( "INSERT INTO uniqueid_temp (deviceid, url, uniqueid, dir) " "VALUES ( %1, '%2'" ) .arg( currdeviceid , currurl ); - insertline += QString( ", '%1', '%2');" ).arg( currid ).arg( currdir ); + insertline += TQString( ", '%1', '%2');" ).arg( currid ).arg( currdir ); //debug() << "running command: " << insertline << endl; insert( insertline, NULL ); //debug() << "aftCheckPermanentTables #2" << endl; @@ -3175,20 +3175,20 @@ CollectionDB::doAFTStuff( MetaBundle* bundle, const bool tempTables ) if( nonTempURLs.empty() ) { //stat the original URL - QString absPath = mpm->getAbsolutePath( nonTempIDs[2].toInt(), nonTempIDs[0] ); + TQString absPath = mpm->getAbsolutePath( nonTempIDs[2].toInt(), nonTempIDs[0] ); //debug() << "At doAFTStuff part 2, stat-ing file " << absPath << endl; bool statSuccessful = false; bool pathsSame = absPath == bundle->url().path(); if( !pathsSame ) - statSuccessful = QFile::exists( absPath ); + statSuccessful = TQFile::exists( absPath ); if( statSuccessful ) //if true, new one is a copy warning() << "Already-scanned file at " << absPath << " has same UID as new file at " << currurl << endl; else //it's a move, not a copy, or a copy and then both files were moved...can't detect that { //debug() << "stat part 2 was NOT successful, updating tables with: " << endl; - query( QString( "DELETE FROM uniqueid WHERE uniqueid='%1';" ) + query( TQString( "DELETE FROM uniqueid WHERE uniqueid='%1';" ) .arg( currid ) ); - query( QString( "INSERT INTO uniqueid_temp (deviceid, url, uniqueid, dir) " + query( TQString( "INSERT INTO uniqueid_temp (deviceid, url, uniqueid, dir) " "VALUES ( %1, '%2', '%3', '%4')" ) .arg( currdeviceid , currurl @@ -3201,10 +3201,10 @@ CollectionDB::doAFTStuff( MetaBundle* bundle, const bool tempTables ) else if( nonTempIDs.empty() ) { //debug() << "file exists in same place as before, part 2, new uniqueid" << endl; - query( QString( "DELETE FROM uniqueid WHERE deviceid = %1 AND url='%2';" ) + query( TQString( "DELETE FROM uniqueid WHERE deviceid = %1 AND url='%2';" ) .arg( currdeviceid ) .arg( currurl ) ); - query( QString( "INSERT INTO uniqueid_temp (deviceid, url, uniqueid, dir) VALUES ( %1, '%2', '%3', '%4')" ) + query( TQString( "INSERT INTO uniqueid_temp (deviceid, url, uniqueid, dir) VALUES ( %1, '%2', '%3', '%4')" ) .arg( currdeviceid , currurl , currid @@ -3217,7 +3217,7 @@ CollectionDB::doAFTStuff( MetaBundle* bundle, const bool tempTables ) } void -CollectionDB::emitFileDeleted( const QString &absPath, const QString &uniqueid ) +CollectionDB::emitFileDeleted( const TQString &absPath, const TQString &uniqueid ) { if( uniqueid.isEmpty() ) emit fileDeleted( absPath ); @@ -3226,7 +3226,7 @@ CollectionDB::emitFileDeleted( const QString &absPath, const QString &uniqueid ) } void -CollectionDB::emitFileAdded( const QString &absPath, const QString &uniqueid ) +CollectionDB::emitFileAdded( const TQString &absPath, const TQString &uniqueid ) { if( uniqueid.isEmpty() ) emit fileAdded( absPath ); @@ -3235,25 +3235,25 @@ CollectionDB::emitFileAdded( const QString &absPath, const QString &uniqueid ) } QString -CollectionDB::urlFromUniqueId( const QString &id ) +CollectionDB::urlFromUniqueId( const TQString &id ) { bool scanning = ( ScanController::instance() && ScanController::instance()->tablesCreated() ); - QStringList urls = query( QString( + TQStringList urls = query( TQString( "SELECT deviceid, url " "FROM uniqueid%1 " "WHERE uniqueid = '%2';" ) - .arg( scanning ? "_temp" : QString::null ) + .arg( scanning ? "_temp" : TQString::null ) .arg( id ), true ); if( urls.empty() && scanning ) - urls = query( QString( + urls = query( TQString( "SELECT deviceid, url " "FROM uniqueid " "WHERE uniqueid = '%1';" ) .arg( id ) ); if( urls.empty() ) - return QString(); + return TQString(); return MountPointManager::instance()->getAbsolutePath( urls[0].toInt(), urls[1] ); } @@ -3263,19 +3263,19 @@ CollectionDB::uniqueIdFromUrl( const KURL &url ) { MountPointManager *mpm = MountPointManager::instance(); int currdeviceid = mpm->getIdForUrl( url.path() ); - QString currurl = escapeString( mpm->getRelativePath( currdeviceid, url.path() ) ); + TQString currurl = escapeString( mpm->getRelativePath( currdeviceid, url.path() ) ); bool scanning = ( ScanController::instance() && ScanController::instance()->tablesCreated() ); - QStringList uid = query( QString( + TQStringList uid = query( TQString( "SELECT uniqueid " "FROM uniqueid%1 " "WHERE deviceid = %2 AND url = '%3';" ) - .arg( scanning ? "_temp" : QString::null ) + .arg( scanning ? "_temp" : TQString::null ) .arg( currdeviceid ) .arg( currurl ), true ); if( uid.empty() && scanning ) - uid = query( QString( + uid = query( TQString( "SELECT uniqueid " "FROM uniqueid " "WHERE deviceid = %1 AND url = '%2';" ) @@ -3283,7 +3283,7 @@ CollectionDB::uniqueIdFromUrl( const KURL &url ) .arg( currurl ) ); if( uid.empty() ) - return QString(); + return TQString(); return uid[0]; } @@ -3293,13 +3293,13 @@ CollectionDB::getURL( const MetaBundle &bundle ) { uint artID = artistID( bundle.artist(), false ); if( !artID ) - return QString(); + return TQString(); uint albID = albumID( bundle.album(), false ); if( !albID ) - return QString(); + return TQString(); - QString q = QString( "SELECT tags.deviceid, tags.url " + TQString q = TQString( "SELECT tags.deviceid, tags.url " "FROM tags " "WHERE tags.album = '%1' AND tags.artist = '%2' AND tags.track = '%3' AND tags.title = '%4'" + deviceidSelection() + ';' ) @@ -3308,19 +3308,19 @@ CollectionDB::getURL( const MetaBundle &bundle ) .arg( bundle.track() ) .arg( escapeString( bundle.title() ) ); - QStringList urls = URLsFromQuery( query( q ) ); + TQStringList urls = URLsFromQuery( query( q ) ); if( urls.empty() ) - return QString(); + return TQString(); if( urls.size() == 1 ) { return urls.first(); } - QString url = urls.first(); + TQString url = urls.first(); int maxPlayed = -1; - for( QStringList::iterator it = urls.begin(); + for( TQStringList::iterator it = urls.begin(); it != urls.end(); it++ ) { @@ -3340,7 +3340,7 @@ CollectionDB::getURL( const MetaBundle &bundle ) // We use the first char of boolT / boolF as not all DBs store true/false as // numerics (and it's only a single-char column) static int -samplerToCompilation( const QString &it ) +samplerToCompilation( const TQString &it ) { if( it == CollectionDB::instance()->boolT().mid( 0, 1 ) ) { @@ -3354,12 +3354,12 @@ samplerToCompilation( const QString &it ) } MetaBundle -CollectionDB::bundleFromQuery( QStringList::const_iterator *iter ) +CollectionDB::bundleFromQuery( TQStringList::const_iterator *iter ) { - QStringList::const_iterator &it = *iter; + TQStringList::const_iterator &it = *iter; MetaBundle b; //QueryBuilder automatically inserts the deviceid as return value if asked for the path - QString rpath = *it; + TQString rpath = *it; int deviceid = (*++it).toInt(); b.setPath ( MountPointManager::instance()->getAbsolutePath( deviceid, rpath ) ); b.setAlbum ( *++it ); @@ -3396,7 +3396,7 @@ CollectionDB::bundleFromQuery( QStringList::const_iterator *iter ) } static void -fillInBundle( QStringList values, MetaBundle &bundle ) +fillInBundle( TQStringList values, MetaBundle &bundle ) { //TODO use this whenever possible @@ -3404,7 +3404,7 @@ fillInBundle( QStringList values, MetaBundle &bundle ) while( values.count() < 16 ) values += "IF YOU CAN SEE THIS THERE IS A BUG!"; - QStringList::ConstIterator it = values.begin(); + TQStringList::ConstIterator it = values.begin(); bundle.setAlbum ( *it ); ++it; bundle.setArtist ( *it ); ++it; @@ -3434,7 +3434,7 @@ CollectionDB::bundleForUrl( MetaBundle* bundle ) int deviceid = MountPointManager::instance()->getIdForUrl( bundle->url() ); KURL rpath; MountPointManager::instance()->getRelativePath( deviceid, bundle->url(), rpath ); - QStringList values = query( QString( + TQStringList values = query( TQString( "SELECT album.name, artist.name, composer.name, genre.name, tags.title, " "year.name, tags.comment, tags.discnumber, " "tags.track, tags.bitrate, tags.length, tags.samplerate, " @@ -3463,7 +3463,7 @@ CollectionDB::bundleForUrl( MetaBundle* bundle ) PodcastEpisodeBundle peb; if( getPodcastEpisodeBundle( bundle->url(), &peb ) ) { - if( bundle->url().protocol() == "file" && QFile::exists( bundle->url().path() ) ) + if( bundle->url().protocol() == "file" && TQFile::exists( bundle->url().path() ) ) { MetaBundle mb( bundle->url(), true /* avoid infinite recursion */ ); *bundle = mb; @@ -3477,11 +3477,11 @@ CollectionDB::bundleForUrl( MetaBundle* bundle ) } -QValueList +TQValueList CollectionDB::bundlesByUrls( const KURL::List& urls ) { BundleList bundles; - QStringList paths; + TQStringList paths; QueryBuilder qb; for( KURL::List::ConstIterator it = urls.begin(), end = urls.end(), last = urls.fromLast(); it != end; ++it ) @@ -3515,7 +3515,7 @@ CollectionDB::bundlesByUrls( const KURL::List& urls ) qb.addURLFilters( paths ); qb.setOptions( QueryBuilder::optRemoveDuplicates ); - const QStringList values = qb.run(); + const TQStringList values = qb.run(); BundleList buns50; MetaBundle b; @@ -3576,10 +3576,10 @@ CollectionDB::bundlesByUrls( const KURL::List& urls ) b = MetaBundle(); b.setUrl( url ); // FIXME: more context for i18n after string freeze - b.setTitle( QString( "%1 %2 %3%4" ) + b.setTitle( TQString( "%1 %2 %3%4" ) .arg( url.filename(), i18n( "from" ), - url.hasHost() ? url.host() : QString(), + url.hasHost() ? url.host() : TQString(), url.directory( false ) ) ); } @@ -3632,7 +3632,7 @@ CollectionDB::addAudioproperties( const MetaBundle& bundle ) int deviceid = MountPointManager::instance()->getIdForUrl( bundle.url() ); KURL rpath; MountPointManager::instance()->getRelativePath( deviceid, bundle.url(), rpath ); - query( QString( "UPDATE tags SET bitrate='%1', length='%2', samplerate='%3' WHERE url='%5' AND deviceid = %4;" ) + query( TQString( "UPDATE tags SET bitrate='%1', length='%2', samplerate='%3' WHERE url='%5' AND deviceid = %4;" ) .arg( bundle.bitrate() ) .arg( bundle.length() ) .arg( bundle.sampleRate() ) @@ -3642,17 +3642,17 @@ CollectionDB::addAudioproperties( const MetaBundle& bundle ) void -CollectionDB::addSongPercentage( const QString &url, float percentage, - const QString &reason, const QDateTime *playtime ) +CollectionDB::addSongPercentage( const TQString &url, float percentage, + const TQString &reason, const TQDateTime *playtime ) { //the URL must always be inserted last! an escaped URL can contain Strings like %1->bug int deviceid = MountPointManager::instance()->getIdForUrl( url ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, url ); + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, url ); //statistics table might not have those values, but we need them later, so keep them int statDevId = deviceid; - QString statRPath = rpath; - QStringList values = - query( QString( + TQString statRPath = rpath; + TQStringList values = + query( TQString( "SELECT playcounter, createdate, percentage, rating FROM statistics " "WHERE url = '%2' AND deviceid = %1;" ) .arg( statDevId ).arg( escapeString( statRPath ) ) ); @@ -3660,8 +3660,8 @@ CollectionDB::addSongPercentage( const QString &url, float percentage, //handle corner case: deviceid!=-1 but there is a statistics row for that song with deviceid -1 if ( values.isEmpty() ) { - QString rpath2 = '.' + url; - values = query( QString( + TQString rpath2 = '.' + url; + values = query( TQString( "SELECT playcounter, createdate, percentage, rating FROM statistics " "WHERE url = '%1' AND deviceid = -1;" ) .arg( escapeString( rpath2 ) ) ); @@ -3672,7 +3672,7 @@ CollectionDB::addSongPercentage( const QString &url, float percentage, } } - uint atime = playtime ? playtime->toTime_t() : QDateTime::currentDateTime().toTime_t(); + uint atime = playtime ? playtime->toTime_t() : TQDateTime::currentDateTime().toTime_t(); // check boundaries if ( percentage > 100.f ) percentage = 100.f; @@ -3682,7 +3682,7 @@ CollectionDB::addSongPercentage( const QString &url, float percentage, { // increment playcounter and update accesstime - query( QString( "UPDATE statistics SET playcounter=%1, accessdate=%2 WHERE url='%4' AND deviceid= %3;" ) + query( TQString( "UPDATE statistics SET playcounter=%1, accessdate=%2 WHERE url='%4' AND deviceid= %3;" ) .arg( values[0] + " + 1" ) .arg( atime ) .arg( statDevId ) @@ -3690,7 +3690,7 @@ CollectionDB::addSongPercentage( const QString &url, float percentage, } else { - insert( QString( "INSERT INTO statistics ( url, deviceid, createdate, accessdate, percentage, playcounter, rating, uniqueid, deleted ) " + insert( TQString( "INSERT INTO statistics ( url, deviceid, createdate, accessdate, percentage, playcounter, rating, uniqueid, deleted ) " "VALUES ( '%6', %5, %1, %2, 0, 1, 0, %3, %4 );" ) .arg( atime ) .arg( atime ) @@ -3710,7 +3710,7 @@ CollectionDB::addSongPercentage( const QString &url, float percentage, if ( playcount ) prevscore = values[ 2 ].toDouble(); } - const QStringList v = query( QString( "SELECT length FROM tags WHERE url = '%2' AND deviceid = %1;" ) + const TQStringList v = query( TQString( "SELECT length FROM tags WHERE url = '%2' AND deviceid = %1;" ) .arg( deviceid ).arg( escapeString( rpath ) ) ); const int length = v.isEmpty() ? 0 : v.first().toInt(); @@ -3719,13 +3719,13 @@ CollectionDB::addSongPercentage( const QString &url, float percentage, float -CollectionDB::getSongPercentage( const QString &url ) +CollectionDB::getSongPercentage( const TQString &url ) { QueryBuilder qb; qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valScore ); qb.addMatch( QueryBuilder::tabStats, QueryBuilder::valURL, url ); - QStringList values = qb.run(); + TQStringList values = qb.run(); if( !values.isEmpty() ) return values.first().toFloat(); @@ -3734,13 +3734,13 @@ CollectionDB::getSongPercentage( const QString &url ) } int -CollectionDB::getSongRating( const QString &url ) +CollectionDB::getSongRating( const TQString &url ) { QueryBuilder qb; qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valRating ); qb.addMatch( QueryBuilder::tabStats, QueryBuilder::valURL, url ); - QStringList values = qb.run(); + TQStringList values = qb.run(); if( values.count() ) return kClamp( values.first().toInt(), 0, 10 ); @@ -3749,20 +3749,20 @@ CollectionDB::getSongRating( const QString &url ) } void -CollectionDB::setSongPercentage( const QString &url , float percentage) +CollectionDB::setSongPercentage( const TQString &url , float percentage) { int deviceid = MountPointManager::instance()->getIdForUrl( url ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, url ); - QStringList values = - query( QString( + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, url ); + TQStringList values = + query( TQString( "SELECT playcounter, createdate, accessdate, rating FROM statistics WHERE url = '%2' AND deviceid = %1;" ) .arg( deviceid ).arg( escapeString( rpath ) ) ); //handle corner case: deviceid!=-1 but there is a statistics row for that song with deviceid -1 if ( values.isEmpty() ) { - QString rpath2 = '.' + url; - values = query( QString( + TQString rpath2 = '.' + url; + values = query( TQString( "SELECT playcounter, createdate, accessdate, rating FROM statistics " "WHERE url = '%1' AND deviceid = -1;" ) .arg( escapeString( rpath2 ) ) ); @@ -3779,16 +3779,16 @@ CollectionDB::setSongPercentage( const QString &url , float percentage) if ( !values.isEmpty() ) { - query( QString( "UPDATE statistics SET percentage=%1 WHERE url='%3' AND deviceid = %2;" ) + query( TQString( "UPDATE statistics SET percentage=%1 WHERE url='%3' AND deviceid = %2;" ) .arg( percentage ) .arg( deviceid ).arg( escapeString( rpath ) ) ); } else { - insert( QString( "INSERT INTO statistics ( url, deviceid, createdate, accessdate, percentage, playcounter, rating, uniqueid, deleted ) " + insert( TQString( "INSERT INTO statistics ( url, deviceid, createdate, accessdate, percentage, playcounter, rating, uniqueid, deleted ) " "VALUES ( '%7', %6, %2, %3, %1, 0, 0, %3, %4 );" ) .arg( percentage ) - .arg( QDateTime::currentDateTime().toTime_t() ) + .arg( TQDateTime::currentDateTime().toTime_t() ) .arg( 0 ) .arg( ( getUniqueId( url ).isNull() ? "NULL" : '\'' + escapeString( getUniqueId( url ) ) + '\'' ) ) .arg( boolF() ) @@ -3800,12 +3800,12 @@ CollectionDB::setSongPercentage( const QString &url , float percentage) } void -CollectionDB::setSongRating( const QString &url, int rating, bool toggleHalf ) +CollectionDB::setSongRating( const TQString &url, int rating, bool toggleHalf ) { int deviceid = MountPointManager::instance()->getIdForUrl( url ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, url ); - QStringList values = - query( QString( + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, url ); + TQStringList values = + query( TQString( "SELECT playcounter, createdate, accessdate, percentage, rating FROM statistics WHERE url = '%2' AND deviceid = %1;" ) .arg( deviceid ) .arg( escapeString( rpath ) ) ); @@ -3813,8 +3813,8 @@ CollectionDB::setSongRating( const QString &url, int rating, bool toggleHalf ) //handle corner case: deviceid!=-1 but there is a statistics row for that song with deviceid -1 if( values.isEmpty() ) { - QString rpath2 = '.' + url; - values = query( QString( + TQString rpath2 = '.' + url; + values = query( TQString( "SELECT playcounter, createdate, accessdate, percentage, rating FROM statistics " "WHERE url = '%1' AND deviceid = -1;" ) .arg( escapeString( rpath2 ) ) ); @@ -3846,17 +3846,17 @@ CollectionDB::setSongRating( const QString &url, int rating, bool toggleHalf ) if ( !values.isEmpty() ) { - query( QString( "UPDATE statistics SET rating=%1 WHERE url='%3' AND deviceid = %2;" ) + query( TQString( "UPDATE statistics SET rating=%1 WHERE url='%3' AND deviceid = %2;" ) .arg( rating ) .arg( deviceid ) .arg( escapeString( rpath ) ) ); } else { - insert( QString( "INSERT INTO statistics ( url, deviceid, createdate, accessdate, percentage, rating, playcounter, uniqueid, deleted ) " + insert( TQString( "INSERT INTO statistics ( url, deviceid, createdate, accessdate, percentage, rating, playcounter, uniqueid, deleted ) " "VALUES ( '%7', %6, %2, %3, 0, %1, 0, %4, %5 );" ) .arg( rating ) - .arg( QDateTime::currentDateTime().toTime_t() ) + .arg( TQDateTime::currentDateTime().toTime_t() ) .arg( 0 ) .arg( ( getUniqueId( url ).isNull() ? "NULL" : '\'' + escapeString( getUniqueId( url ) ) + '\'' ) ) .arg( boolF() ) @@ -3868,39 +3868,39 @@ CollectionDB::setSongRating( const QString &url, int rating, bool toggleHalf ) } int -CollectionDB::getPlayCount( const QString &url ) +CollectionDB::getPlayCount( const TQString &url ) { //queryBuilder is good QueryBuilder qb; qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valPlayCounter ); qb.addMatch( QueryBuilder::tabStats, QueryBuilder::valURL, url ); - QStringList values = qb.run(); + TQStringList values = qb.run(); if( values.count() ) return values.first().toInt(); return 0; } QDateTime -CollectionDB::getFirstPlay( const QString &url ) +CollectionDB::getFirstPlay( const TQString &url ) { QueryBuilder qb; qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valCreateDate ); qb.addMatch( QueryBuilder::tabStats, QueryBuilder::valURL, url ); - QStringList values = qb.run(); - QDateTime dt; + TQStringList values = qb.run(); + TQDateTime dt; if( values.count() ) dt.setTime_t( values.first().toUInt() ); return dt; } QDateTime -CollectionDB::getLastPlay( const QString &url ) +CollectionDB::getLastPlay( const TQString &url ) { QueryBuilder qb; qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valAccessDate ); qb.addMatch( QueryBuilder::tabStats, QueryBuilder::valURL, url ); - QStringList values = qb.run(); - QDateTime dt; + TQStringList values = qb.run(); + TQDateTime dt; if( values.count() ) dt.setTime_t( values.first().toUInt() ); else @@ -3913,52 +3913,52 @@ CollectionDB::getLastPlay( const QString &url ) * FIXME: should we check if lyrics etc exist in the newURL and keep them if necessary? */ void -CollectionDB::migrateFile( const QString &oldURL, const QString &newURL ) +CollectionDB::migrateFile( const TQString &oldURL, const TQString &newURL ) { int oldMediaid = MountPointManager::instance()->getIdForUrl( oldURL ); - QString oldRpath = MountPointManager::instance()->getRelativePath( oldMediaid, oldURL ); + TQString oldRpath = MountPointManager::instance()->getRelativePath( oldMediaid, oldURL ); int newMediaid = MountPointManager::instance()->getIdForUrl( newURL ); - QString newRpath = MountPointManager::instance()->getRelativePath( newMediaid, newURL ); + TQString newRpath = MountPointManager::instance()->getRelativePath( newMediaid, newURL ); // Ensure destination is clear. - query( QString( "DELETE FROM tags WHERE url = '%2' AND deviceid = %1;" ) + query( TQString( "DELETE FROM tags WHERE url = '%2' AND deviceid = %1;" ) .arg( newMediaid ).arg( escapeString( newRpath ) ) ); - query( QString( "DELETE FROM statistics WHERE url = '%2' AND deviceid = %1;" ) + query( TQString( "DELETE FROM statistics WHERE url = '%2' AND deviceid = %1;" ) .arg( newMediaid ).arg( escapeString( newRpath ) ) ); - query( QString( "DELETE FROM tags_labels WHERE url = '%2' and deviceid = %1;" ) + query( TQString( "DELETE FROM tags_labels WHERE url = '%2' and deviceid = %1;" ) .arg( newMediaid).arg( escapeString( newRpath ) ) ); if ( !getLyrics( oldURL ).isEmpty() ) - query( QString( "DELETE FROM lyrics WHERE url = '%2' AND deviceid = %1;" ) + query( TQString( "DELETE FROM lyrics WHERE url = '%2' AND deviceid = %1;" ) .arg( newMediaid ).arg( escapeString( newRpath ) ) ); // Migrate //code looks ugly but prevents problems when the URL contains HTTP escaped characters - query( QString( "UPDATE tags SET url = '%3', deviceid = %1" ) + query( TQString( "UPDATE tags SET url = '%3', deviceid = %1" ) .arg( newMediaid ).arg( escapeString( newRpath ) ) - + QString( " WHERE deviceid=%1 AND url = '%2';" ) + + TQString( " WHERE deviceid=%1 AND url = '%2';" ) .arg( oldMediaid ).arg( escapeString( oldRpath ) ) ); - query( QString( "UPDATE statistics SET url = '%2', deviceid = %1" ) + query( TQString( "UPDATE statistics SET url = '%2', deviceid = %1" ) .arg( newMediaid ).arg( escapeString( newRpath ) ) - + QString( " WHERE deviceid=%1 AND url = '%2';" ) + + TQString( " WHERE deviceid=%1 AND url = '%2';" ) .arg( oldMediaid ).arg( escapeString( oldRpath ) ) ); - query( QString( "UPDATE lyrics SET url = '%2', deviceid = %1" ) + query( TQString( "UPDATE lyrics SET url = '%2', deviceid = %1" ) .arg( newMediaid ).arg( escapeString( newRpath ) ) - + QString( " WHERE deviceid=%1 AND url = '%2';" ) + + TQString( " WHERE deviceid=%1 AND url = '%2';" ) .arg( oldMediaid ).arg( escapeString( oldRpath ) ) ); - query( QString( "UPDATE tags_labels SET url = '%2', deviceid = %1 WHERE deviceid = %3 AND url = '%4';" ) - .arg( QString::number( newMediaid ), escapeString( newRpath ), QString::number( oldMediaid ), escapeString( oldRpath ) ) ); + query( TQString( "UPDATE tags_labels SET url = '%2', deviceid = %1 WHERE deviceid = %3 AND url = '%4';" ) + .arg( TQString::number( newMediaid ), escapeString( newRpath ), TQString::number( oldMediaid ), escapeString( oldRpath ) ) ); - query( QString( "UPDATE uniqueid SET url = '%1', deviceid = %2 WHERE url = '%3' AND deviceid = %4;" ) - .arg( escapeString( newRpath ), QString::number( newMediaid ), - escapeString( oldRpath ), QString::number( oldMediaid ) ) ); + query( TQString( "UPDATE uniqueid SET url = '%1', deviceid = %2 WHERE url = '%3' AND deviceid = %4;" ) + .arg( escapeString( newRpath ), TQString::number( newMediaid ), + escapeString( oldRpath ), TQString::number( oldMediaid ) ) ); - query( QString( "UPDATE playlists SET url = '%1' WHERE url = '%2';" ) + query( TQString( "UPDATE playlists SET url = '%1' WHERE url = '%2';" ) .arg( escapeString( newURL ), escapeString( oldURL ) ) ); } @@ -3995,16 +3995,16 @@ CollectionDB::organizeFile( const KURL &src, const OrganizeCollectionDialog &dia KURL tmpSrc = src; if( !localFile ) { - QString tmp; - QString extension = src.url().section( '.', -1 ); + TQString tmp; + TQString extension = src.url().section( '.', -1 ); extension = extension.section("?", 0, 0); // remove trailling stuff lead by ?, if any int count = 0; do { - tmp = QString( dialog.folderCombo->currentText() + "/amarok-tmp-%1." + extension ).arg( count ); + tmp = TQString( dialog.folderCombo->currentText() + "/amarok-tmp-%1." + extension ).arg( count ); count++; - } while( QFile::exists( tmp ) ); + } while( TQFile::exists( tmp ) ); tmpSrc = KURL::fromPathOrURL( tmp ); KIO::FileCopyJob *job = 0; @@ -4016,17 +4016,17 @@ CollectionDB::organizeFile( const KURL &src, const OrganizeCollectionDialog &dia { job = KIO::file_move( src, tmpSrc, -1, false, false, false ); } - connect( job, SIGNAL(result( KIO::Job * )), SLOT(fileOperationResult( KIO::Job * )) ); + connect( job, TQT_SIGNAL(result( KIO::Job * )), TQT_SLOT(fileOperationResult( KIO::Job * )) ); m_waitForFileOperation = true; while( m_waitForFileOperation ) { if( m_moveFileJobCancelled ) { - disconnect( job, SIGNAL(result( KIO::Job * )), this, SLOT(fileOperationResult( KIO::Job * )) ); + disconnect( job, TQT_SIGNAL(result( KIO::Job * )), this, TQT_SLOT(fileOperationResult( KIO::Job * )) ); - QString partFile = QString( "%1.part" ).arg( (job->destURL()).path() ); + TQString partFile = TQString( "%1.part" ).arg( (job->destURL()).path() ); job->kill(); - QFile file( partFile ); + TQFile file( partFile ); if( file.exists() ) file.remove(); m_waitForFileOperation = false; @@ -4049,7 +4049,7 @@ CollectionDB::organizeFile( const KURL &src, const OrganizeCollectionDialog &dia //Building destination here. MetaBundle mb( tmpSrc ); - QString dest = dialog.buildDestination( dialog.buildFormatString(), mb ); + TQString dest = dialog.buildDestination( dialog.buildFormatString(), mb ); debug() << "Destination: " << dest << endl; @@ -4058,7 +4058,7 @@ CollectionDB::organizeFile( const KURL &src, const OrganizeCollectionDialog &dia if( !CollectionDB::instance()->moveFile( tmpSrc.url(), dest, overwrite, copy && localFile ) ) { if( !localFile ) - QFile::remove( tmpSrc.path() ); + TQFile::remove( tmpSrc.path() ); m_moveFileJobCancelled = false; return false; @@ -4071,12 +4071,12 @@ CollectionDB::organizeFile( const KURL &src, const OrganizeCollectionDialog &dia KURL dstURL = KURL::fromPathOrURL( dest ); dstURL.cleanPath(); - QString path = dstURL.directory(); - QString cover = CollectionDB::instance()->albumImage( mb.artist(), mb.album(), false, 1 ); + TQString path = dstURL.directory(); + TQString cover = CollectionDB::instance()->albumImage( mb.artist(), mb.album(), false, 1 ); - if( !QFile::exists(path + "/.directory") && !cover.endsWith( "nocover.png" ) ) + if( !TQFile::exists(path + "/.directory") && !cover.endsWith( "nocover.png" ) ) { - //QPixmap thumb; //Not amazon nice. + //TQPixmap thumb; //Not amazon nice. //if ( thumb.load( cover ) ){ //thumb.save(path + "/.front.png", "PNG", -1 ); //hide files @@ -4092,7 +4092,7 @@ CollectionDB::organizeFile( const KURL &src, const OrganizeCollectionDialog &dia } } - if( localFile && isDirInCollection( src.directory() ) && QDir().rmdir( src.directory() ) ) + if( localFile && isDirInCollection( src.directory() ) && TQDir().rmdir( src.directory() ) ) { debug() << "removed: " << src.directory() << endl; } @@ -4103,7 +4103,7 @@ CollectionDB::organizeFile( const KURL &src, const OrganizeCollectionDialog &dia } bool -CollectionDB::moveFile( const QString &src, const QString &dest, bool overwrite, bool copy ) +CollectionDB::moveFile( const TQString &src, const TQString &dest, bool overwrite, bool copy ) { DEBUG_BLOCK if(src == dest){ @@ -4125,7 +4125,7 @@ CollectionDB::moveFile( const QString &src, const QString &dest, bool overwrite, // Get just the directory. KURL dir = dstURL; - dir.setFileName(QString::null); + dir.setFileName(TQString::null); // Create the directory. if(!KStandardDirs::exists(dir.path())) @@ -4143,17 +4143,17 @@ CollectionDB::moveFile( const QString &src, const QString &dest, bool overwrite, { job = KIO::file_move( srcURL, dstURL, -1, overwrite, false, false ); } - connect( job, SIGNAL(result( KIO::Job * )), SLOT(fileOperationResult( KIO::Job * )) ); + connect( job, TQT_SIGNAL(result( KIO::Job * )), TQT_SLOT(fileOperationResult( KIO::Job * )) ); m_waitForFileOperation = true; while( m_waitForFileOperation ) { if( m_moveFileJobCancelled ) { - disconnect( job, SIGNAL(result( KIO::Job * )), this, SLOT(fileOperationResult( KIO::Job * )) ); + disconnect( job, TQT_SIGNAL(result( KIO::Job * )), this, TQT_SLOT(fileOperationResult( KIO::Job * )) ); - QString partFile = QString( "%1.part" ).arg( (job->destURL()).path() ); + TQString partFile = TQString( "%1.part" ).arg( (job->destURL()).path() ); job->kill(); - QFile file( partFile ); + TQFile file( partFile ); if( file.exists() ) file.remove(); m_waitForFileOperation = false; @@ -4202,26 +4202,26 @@ CollectionDB::moveFile( const QString &src, const QString &dest, bool overwrite, void -CollectionDB::updateDirStats( QString path, const long datetime, const bool temporary ) +CollectionDB::updateDirStats( TQString path, const long datetime, const bool temporary ) { if ( path.endsWith( "/" ) ) path = path.left( path.length() - 1 ); int deviceid = MountPointManager::instance()->getIdForUrl( path ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, path ); + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, path ); if (getDbConnectionType() == DbConnection::postgresql) { // REPLACE INTO is not valid SQL for postgres, so we need to check whether we // should UPDATE() or INSERT() - QStringList values = query( QString("SELECT * FROM directories%1 WHERE dir='%3' AND deviceid=%2;") + TQStringList values = query( TQString("SELECT * FROM directories%1 WHERE dir='%3' AND deviceid=%2;") .arg( temporary ? "_temp" : "") .arg( deviceid ) .arg( escapeString( rpath ) ) ); if(values.count() > 0 ) { - query( QString( "UPDATE directories%1 SET changedate=%2 WHERE dir='%4'AND deviceid=%3;") + query( TQString( "UPDATE directories%1 SET changedate=%2 WHERE dir='%4'AND deviceid=%3;") .arg( temporary ? "_temp" : "" ) .arg( datetime ) .arg( deviceid ) @@ -4230,7 +4230,7 @@ CollectionDB::updateDirStats( QString path, const long datetime, const bool temp else { - query( QString( "INSERT INTO directories%1 (dir, deviceid,changedate) VALUES ('%4', %3, '%2');") + query( TQString( "INSERT INTO directories%1 (dir, deviceid,changedate) VALUES ('%4', %3, '%2');") .arg( temporary ? "_temp" : "") .arg( datetime ) .arg( deviceid ) @@ -4239,7 +4239,7 @@ CollectionDB::updateDirStats( QString path, const long datetime, const bool temp } else { - query( QString( "REPLACE INTO directories%1 ( dir, deviceid, changedate ) VALUES ( '%4', %3, %2 );" ) + query( TQString( "REPLACE INTO directories%1 ( dir, deviceid, changedate ) VALUES ( '%4', %3, %2 );" ) .arg( temporary ? "_temp" : "" ) .arg( datetime ) .arg( deviceid ) @@ -4251,54 +4251,54 @@ CollectionDB::updateDirStats( QString path, const long datetime, const bool temp void -CollectionDB::removeSongsInDir( QString path, QMap *tagsRemoved ) +CollectionDB::removeSongsInDir( TQString path, TQMap *tagsRemoved ) { if ( path.endsWith( "/" ) ) path = path.left( path.length() - 1 ); int deviceid = MountPointManager::instance()->getIdForUrl( path ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, path ); + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, path ); // Pass back the list of tags we actually delete if requested. if( tagsRemoved ) { - QStringList result - = query( QString( "SELECT tags.deviceid, tags.url, uniqueid.uniqueid FROM tags " + TQStringList result + = query( TQString( "SELECT tags.deviceid, tags.url, uniqueid.uniqueid FROM tags " "LEFT JOIN uniqueid ON uniqueid.url = tags.url " "AND uniqueid.deviceid = tags.deviceid " "WHERE tags.dir = '%2' AND tags.deviceid = %1" ) .arg( deviceid ) .arg( escapeString( rpath ) ) ); - QStringList::ConstIterator it = result.begin(), end = result.end(); + TQStringList::ConstIterator it = result.begin(), end = result.end(); while( it != end ) { int deviceid2 = (*(it++)).toInt(); - QString rpath2 = *(it++); - QString uniqueid = *(it++); + TQString rpath2 = *(it++); + TQString uniqueid = *(it++); (*tagsRemoved)[uniqueid] = MountPointManager::instance()->getAbsolutePath( deviceid2, rpath2 ); } } - query( QString( "DELETE FROM tags WHERE dir = '%2' AND deviceid = %1;" ) + query( TQString( "DELETE FROM tags WHERE dir = '%2' AND deviceid = %1;" ) .arg( deviceid ) .arg( escapeString( rpath ) ) ); - query( QString( "DELETE FROM uniqueid WHERE dir = '%2' AND deviceid = %1;" ) + query( TQString( "DELETE FROM uniqueid WHERE dir = '%2' AND deviceid = %1;" ) .arg( deviceid ) .arg( escapeString( rpath ) ) ); } bool -CollectionDB::isDirInCollection( QString path ) +CollectionDB::isDirInCollection( TQString path ) { if ( path.endsWith( "/" ) ) path = path.left( path.length() - 1 ); int deviceid = MountPointManager::instance()->getIdForUrl( path ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, path ); + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, path ); - QStringList values = - query( QString( "SELECT changedate FROM directories WHERE dir = '%2' AND deviceid = %1;" ) + TQStringList values = + query( TQString( "SELECT changedate FROM directories WHERE dir = '%2' AND deviceid = %1;" ) .arg( deviceid ) .arg( escapeString( rpath ) ) ); @@ -4307,12 +4307,12 @@ CollectionDB::isDirInCollection( QString path ) bool -CollectionDB::isFileInCollection( const QString &url ) +CollectionDB::isFileInCollection( const TQString &url ) { int deviceid = MountPointManager::instance()->getIdForUrl( url ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, url ); + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, url ); - QString sql = QString( "SELECT url FROM tags WHERE url = '%2' AND deviceid = %1" ) + TQString sql = TQString( "SELECT url FROM tags WHERE url = '%2' AND deviceid = %1" ) .arg( deviceid ) .arg( escapeString( rpath ) ); if ( deviceid == -1 ) @@ -4321,11 +4321,11 @@ CollectionDB::isFileInCollection( const QString &url ) } else { - QString rpath2 = '.' + url; - sql += QString( " OR url = '%1' AND deviceid = -1;" ) + TQString rpath2 = '.' + url; + sql += TQString( " OR url = '%1' AND deviceid = -1;" ) .arg( escapeString( rpath2 ) ); } - QStringList values = query( sql ); + TQStringList values = query( sql ); return !values.isEmpty(); } @@ -4337,15 +4337,15 @@ CollectionDB::removeSongs( const KURL::List& urls ) for( KURL::List::ConstIterator it = urls.begin(), end = urls.end(); it != end; ++it ) { int deviceid = MountPointManager::instance()->getIdForUrl( *it ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, (*it).path() ); + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, (*it).path() ); - query( QString( "DELETE FROM tags WHERE url = '%2' AND deviceid = %1;" ) + query( TQString( "DELETE FROM tags WHERE url = '%2' AND deviceid = %1;" ) .arg( deviceid ) .arg( escapeString( rpath ) ) ); - query( QString( "DELETE FROM uniqueid WHERE url = '%2' AND deviceid = %1;" ) + query( TQString( "DELETE FROM uniqueid WHERE url = '%2' AND deviceid = %1;" ) .arg( deviceid ) .arg( escapeString( rpath ) ) ); - query( QString( "UPDATE statistics SET deleted = %1 WHERE url = '%3' AND deviceid = %2;" ) + query( TQString( "UPDATE statistics SET deleted = %1 WHERE url = '%3' AND deviceid = %2;" ) .arg( boolT() ) .arg( deviceid ) .arg( escapeString( rpath ) ) ); @@ -4354,12 +4354,12 @@ CollectionDB::removeSongs( const KURL::List& urls ) QStringList -CollectionDB::similarArtists( const QString &artist, uint count ) +CollectionDB::similarArtists( const TQString &artist, uint count ) { - QStringList values; + TQStringList values; - values = query( QString( "SELECT suggestion FROM related_artists WHERE artist = '%1' ORDER BY %2 LIMIT %3 OFFSET 0;" ) - .arg( escapeString( artist ), randomFunc(), QString::number( count ) ) ); + values = query( TQString( "SELECT suggestion FROM related_artists WHERE artist = '%1' ORDER BY %2 LIMIT %3 OFFSET 0;" ) + .arg( escapeString( artist ), randomFunc(), TQString::number( count ) ) ); if ( values.isEmpty() ) Scrobbler::instance()->similarArtists( artist ); @@ -4371,20 +4371,20 @@ CollectionDB::similarArtists( const QString &artist, uint count ) void CollectionDB::sanitizeCompilations() { - query( QString( "UPDATE tags_temp SET sampler = %1 WHERE sampler IS NULL;").arg( boolF() ) ); + query( TQString( "UPDATE tags_temp SET sampler = %1 WHERE sampler IS NULL;").arg( boolF() ) ); } void -CollectionDB::checkCompilations( const QString &path, const bool temporary ) +CollectionDB::checkCompilations( const TQString &path, const bool temporary ) { - QStringList albums; - QStringList artists; - QStringList dirs; + TQStringList albums; + TQStringList artists; + TQStringList dirs; int deviceid = MountPointManager::instance()->getIdForUrl( path ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, path ); + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, path ); - albums = query( QString( "SELECT DISTINCT album.name FROM tags_temp, album%1 AS album WHERE tags_temp.dir = '%3' AND tags_temp.deviceid = %2 AND album.id = tags_temp.album AND tags_temp.sampler IS NULL;" ) + albums = query( TQString( "SELECT DISTINCT album.name FROM tags_temp, album%1 AS album WHERE tags_temp.dir = '%3' AND tags_temp.deviceid = %2 AND album.id = tags_temp.album AND tags_temp.sampler IS NULL;" ) .arg( temporary ? "_temp" : "" ) .arg( deviceid ) .arg( escapeString( rpath ) ) ); @@ -4394,17 +4394,17 @@ CollectionDB::checkCompilations( const QString &path, const bool temporary ) if ( albums[ i ].isEmpty() ) continue; const uint album_id = albumID( albums[ i ], false, temporary, true ); - artists = query( QString( "SELECT DISTINCT artist.name FROM tags_temp, artist%1 AS artist WHERE tags_temp.album = '%2' AND tags_temp.artist = artist.id;" ) + artists = query( TQString( "SELECT DISTINCT artist.name FROM tags_temp, artist%1 AS artist WHERE tags_temp.album = '%2' AND tags_temp.artist = artist.id;" ) .arg( temporary ? "_temp" : "" ) .arg( album_id ) ); - dirs = query( QString( "SELECT DISTINCT dir FROM tags_temp WHERE album = '%1';" ) + dirs = query( TQString( "SELECT DISTINCT dir FROM tags_temp WHERE album = '%1';" ) .arg( album_id ) ); if ( artists.count() > dirs.count() ) { debug() << "Detected compilation: " << albums[ i ] << " - " << artists.count() << ':' << dirs.count() << endl; } - query( QString( "UPDATE tags_temp SET sampler = %1 WHERE album = '%2' AND sampler IS NULL;" ) + query( TQString( "UPDATE tags_temp SET sampler = %1 WHERE album = '%2' AND sampler IS NULL;" ) .arg(artists.count() > dirs.count() ? boolT() : boolF()).arg( album_id ) ); } } @@ -4414,51 +4414,51 @@ CollectionDB::setCompilation( const KURL::List &urls, bool enabled, bool updateV { for ( KURL::List::const_iterator it = urls.begin(); it != urls.end(); ++it ) { - QString url( ( *it ).path() ); + TQString url( ( *it ).path() ); int deviceid = MountPointManager::instance()->getIdForUrl( url ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, url ); + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, url ); - query( QString( "UPDATE tags SET sampler = %1 WHERE tags.url = '%2' AND tags.deviceid = %3;" ) - .arg( ( enabled ? boolT() : boolF() ), escapeString( rpath ), QString::number( deviceid ) ) ); + query( TQString( "UPDATE tags SET sampler = %1 WHERE tags.url = '%2' AND tags.deviceid = %3;" ) + .arg( ( enabled ? boolT() : boolF() ), escapeString( rpath ), TQString::number( deviceid ) ) ); } // Update the Collection-Browser view, - // using QTimer to make sure we don't manipulate the GUI from a thread + // using TQTimer to make sure we don't manipulate the GUI from a thread if ( updateView ) - QTimer::singleShot( 0, CollectionView::instance(), SLOT( renderView() ) ); + TQTimer::singleShot( 0, CollectionView::instance(), TQT_SLOT( renderView() ) ); } void -CollectionDB::removeDirFromCollection( QString path ) +CollectionDB::removeDirFromCollection( TQString path ) { //if ( path.endsWith( "/" ) ) // path = path.left( path.length() - 1 ); int deviceid = MountPointManager::instance()->getIdForUrl( path ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, path ); + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, path ); - query( QString( "DELETE FROM directories WHERE dir = '%2' AND deviceid = %1;" ) + query( TQString( "DELETE FROM directories WHERE dir = '%2' AND deviceid = %1;" ) .arg( deviceid ) .arg( escapeString( rpath ) ) ); } QString -CollectionDB::IDFromExactValue( QString table, QString value, bool autocreate, bool temporary /* = false */ ) +CollectionDB::IDFromExactValue( TQString table, TQString value, bool autocreate, bool temporary /* = false */ ) { if ( temporary ) { table.append( "_temp" ); } - QString querystr( QString( "SELECT id FROM %1 WHERE name " ).arg( table ) ); + TQString querystr( TQString( "SELECT id FROM %1 WHERE name " ).arg( table ) ); querystr += exactCondition( value ) + ';'; - QStringList result = query( querystr ); + TQStringList result = query( querystr ); if ( result.isEmpty() ) { if ( autocreate ) - return QString::number( insert( QString( "INSERT INTO %1 ( name ) VALUES ( '%2' );" ) + return TQString::number( insert( TQString( "INSERT INTO %1 ( name ) VALUES ( '%2' );" ) .arg( table, escapeString( value ) ), table ) ); else @@ -4473,24 +4473,24 @@ CollectionDB::IDFromExactValue( QString table, QString value, bool autocreate, b } void -CollectionDB::deleteRedundantName( const QString &table, const QString &id ) +CollectionDB::deleteRedundantName( const TQString &table, const TQString &id ) { - QString querystr( QString( "SELECT %1 FROM tags WHERE tags.%1 = %2 LIMIT 1;" ).arg( table, id ) ); - QStringList result = query( querystr ); + TQString querystr( TQString( "SELECT %1 FROM tags WHERE tags.%1 = %2 LIMIT 1;" ).arg( table, id ) ); + TQStringList result = query( querystr ); if ( result.isEmpty() ) - query( QString( "DELETE FROM %1 WHERE id = %2;" ).arg( table,id ) ); + query( TQString( "DELETE FROM %1 WHERE id = %2;" ).arg( table,id ) ); } void -CollectionDB::deleteAllRedundant( const QString &table ) +CollectionDB::deleteAllRedundant( const TQString &table ) { //This works with MySQL4. I thought it might not do, due to the comment in copyTempTables - query( QString( "DELETE FROM %1 WHERE id NOT IN ( SELECT %2 FROM tags )" ).arg( table, table ) ); + query( TQString( "DELETE FROM %1 WHERE id NOT IN ( SELECT %2 FROM tags )" ).arg( table, table ) ); } void -CollectionDB::updateTags( const QString &url, const MetaBundle &bundle, const bool updateView ) +CollectionDB::updateTags( const TQString &url, const MetaBundle &bundle, const bool updateView ) { DEBUG_BLOCK QueryBuilder qb; @@ -4513,9 +4513,9 @@ CollectionDB::updateTags( const QString &url, const MetaBundle &bundle, const bo qb.addReturnValue( QueryBuilder::tabGenre, QueryBuilder::valID ); qb.addReturnValue( QueryBuilder::tabYear, QueryBuilder::valID ); - qb.addURLFilters ( QStringList( url ) ); + qb.addURLFilters ( TQStringList( url ) ); qb.setOptions( QueryBuilder::optRemoveDuplicates ); - QStringList values = qb.run(); + TQStringList values = qb.run(); if ( values.count() > 17 ) { @@ -4527,7 +4527,7 @@ CollectionDB::updateTags( const QString &url, const MetaBundle &bundle, const bo { bool art=false, comp=false, alb=false, gen=false, year=false; - QString command = "UPDATE tags SET "; + TQString command = "UPDATE tags SET "; if ( values[ 0 ] != bundle.title() ) command += "title = '" + escapeString( bundle.title() ) + "', "; if ( values[ 1 ] != bundle.artist() ) @@ -4550,23 +4550,23 @@ CollectionDB::updateTags( const QString &url, const MetaBundle &bundle, const bo gen = true; command += "genre = " + IDFromExactValue( "genre", bundle.genre() ) + ", "; } - if ( values[ 5 ] != QString::number( bundle.year() ) ) + if ( values[ 5 ] != TQString::number( bundle.year() ) ) { year = false; - command += "year = " + IDFromExactValue( "year", QString::number( bundle.year() ) ) + ", "; + command += "year = " + IDFromExactValue( "year", TQString::number( bundle.year() ) ) + ", "; } - if ( values[ 6 ] != QString::number( bundle.track() ) ) - command += "track = " + QString::number( bundle.track() ) + ", "; + if ( values[ 6 ] != TQString::number( bundle.track() ) ) + command += "track = " + TQString::number( bundle.track() ) + ", "; if ( values[ 7 ] != bundle.comment() ) command += "comment = '" + escapeString( bundle.comment() ) + "', "; - if ( values[ 8 ] != QString::number( bundle.discNumber() ) ) - command += "discnumber = '" + QString::number( bundle.discNumber() ) + "', "; - if ( values[ 9 ] != QString::number( bundle.filesize() ) ) - command += "filesize = '" + QString::number( bundle.filesize() ) + "', "; - if ( values[ 10 ] != QString::number( bundle.fileType() ) ) - command += "filetype = '" + QString::number( bundle.fileType() ) + "', "; - if ( values[ 11 ] != QString::number( bundle.bpm() ) ) - command += "bpm = '" + QString::number( bundle.bpm() ) + "', "; + if ( values[ 8 ] != TQString::number( bundle.discNumber() ) ) + command += "discnumber = '" + TQString::number( bundle.discNumber() ) + "', "; + if ( values[ 9 ] != TQString::number( bundle.filesize() ) ) + command += "filesize = '" + TQString::number( bundle.filesize() ) + "', "; + if ( values[ 10 ] != TQString::number( bundle.fileType() ) ) + command += "filetype = '" + TQString::number( bundle.fileType() ) + "', "; + if ( values[ 11 ] != TQString::number( bundle.bpm() ) ) + command += "bpm = '" + TQString::number( bundle.bpm() ) + "', "; if ( "UPDATE tags SET " == command ) { @@ -4575,10 +4575,10 @@ CollectionDB::updateTags( const QString &url, const MetaBundle &bundle, const bo else { int deviceid = MountPointManager::instance()->getIdForUrl( url ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, url ); + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, url ); //We have to remove the trailing comma from command query( command.left( command.length() - 2 ) + " WHERE url = '" + escapeString( rpath ) + - "' AND deviceid = " + QString::number( deviceid ) + ';' ); + "' AND deviceid = " + TQString::number( deviceid ) + ';' ); } //Check to see if we use the entry anymore. If not, delete it @@ -4594,9 +4594,9 @@ CollectionDB::updateTags( const QString &url, const MetaBundle &bundle, const bo deleteRedundantName( "year", values[ 16 ] ); // Update the Collection-Browser view, - // using QTimer to make sure we don't manipulate the GUI from a thread + // using TQTimer to make sure we don't manipulate the GUI from a thread if ( updateView ) - QTimer::singleShot( 0, CollectionView::instance(), SLOT( databaseChanged() ) ); + TQTimer::singleShot( 0, CollectionView::instance(), TQT_SLOT( databaseChanged() ) ); if( art || alb ) emit tagsChanged( values[12], values[14] ); @@ -4613,7 +4613,7 @@ CollectionDB::updateTags( const QString &url, const MetaBundle &bundle, const bo void -CollectionDB::updateURL( const QString &url, const bool updateView ) +CollectionDB::updateURL( const TQString &url, const bool updateView ) { // don't use the KURL ctor as it checks the db first MetaBundle bundle; @@ -4625,85 +4625,85 @@ CollectionDB::updateURL( const QString &url, const bool updateView ) } QString -CollectionDB::getUniqueId( const QString &url ) +CollectionDB::getUniqueId( const TQString &url ) { int deviceid = MountPointManager::instance()->getIdForUrl( url ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, url ); - QStringList values = query( QString( "SELECT uniqueid FROM uniqueid WHERE deviceid = %1 AND url = '%2';" ) + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, url ); + TQStringList values = query( TQString( "SELECT uniqueid FROM uniqueid WHERE deviceid = %1 AND url = '%2';" ) .arg( deviceid ) .arg( escapeString( rpath ) )); if( !values.empty() ) return values[0]; else - return QString(); + return TQString(); } void -CollectionDB::setLyrics( const QString &url, const QString &lyrics, const QString &uniqueid ) +CollectionDB::setLyrics( const TQString &url, const TQString &lyrics, const TQString &uniqueid ) { int deviceid = MountPointManager::instance()->getIdForUrl( url ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, url ); + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, url ); - QStringList values = query(QString("SELECT lyrics FROM lyrics WHERE url = '%2' AND deviceid = %1;") + TQStringList values = query(TQString("SELECT lyrics FROM lyrics WHERE url = '%2' AND deviceid = %1;") .arg( deviceid ).arg( escapeString( rpath ) ) ); if(values.count() > 0) { if ( !lyrics.isEmpty() ) - query( QString( "UPDATE lyrics SET lyrics = '%1' WHERE url = '%3' AND deviceid = %2;" ) - .arg( escapeString( lyrics), QString::number(deviceid), escapeString( rpath ) ) ); + query( TQString( "UPDATE lyrics SET lyrics = '%1' WHERE url = '%3' AND deviceid = %2;" ) + .arg( escapeString( lyrics), TQString::number(deviceid), escapeString( rpath ) ) ); else - query( QString( "DELETE FROM lyrics WHERE url = '%2' AND deviceid = %1;" ) + query( TQString( "DELETE FROM lyrics WHERE url = '%2' AND deviceid = %1;" ) .arg( deviceid).arg( escapeString( rpath ) ) ); } else { - insert( QString( "INSERT INTO lyrics (deviceid, url, lyrics, uniqueid) values ( %1, '%2', '%3', '%4' );" ) - .arg( QString::number(deviceid), escapeString( rpath ), escapeString( lyrics ), escapeString( uniqueid ) ), NULL); + insert( TQString( "INSERT INTO lyrics (deviceid, url, lyrics, uniqueid) values ( %1, '%2', '%3', '%4' );" ) + .arg( TQString::number(deviceid), escapeString( rpath ), escapeString( lyrics ), escapeString( uniqueid ) ), NULL); } } QString -CollectionDB::getLyrics( const QString &url ) +CollectionDB::getLyrics( const TQString &url ) { int deviceid = MountPointManager::instance()->getIdForUrl( url ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, url ); - QStringList values = query( QString( "SELECT lyrics FROM lyrics WHERE url = '%2' AND deviceid = %1;" ) + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, url ); + TQStringList values = query( TQString( "SELECT lyrics FROM lyrics WHERE url = '%2' AND deviceid = %1;" ) .arg( deviceid ).arg( escapeString( rpath ) ) ); return values[0]; } -void CollectionDB::removeInvalidAmazonInfo( const QString& md5sum ) +void CollectionDB::removeInvalidAmazonInfo( const TQString& md5sum ) { - query( QString( "DELETE FROM amazon WHERE filename='%1'" ).arg( md5sum ) ); + query( TQString( "DELETE FROM amazon WHERE filename='%1'" ).arg( md5sum ) ); } -void CollectionDB::newAmazonReloadDate( const QString& asin, const QString& locale, const QString& md5sum) +void CollectionDB::newAmazonReloadDate( const TQString& asin, const TQString& locale, const TQString& md5sum) { - QStringList values = query(QString("SELECT filename FROM amazon WHERE filename = '%1'") + TQStringList values = query(TQString("SELECT filename FROM amazon WHERE filename = '%1'") .arg(md5sum)); if(values.count() > 0) { - query( QString("UPDATE amazon SET asin = '%1', locale = '%2', refetchdate = '%3' WHERE filename = '%4'") + query( TQString("UPDATE amazon SET asin = '%1', locale = '%2', refetchdate = '%3' WHERE filename = '%4'") .arg(asin) .arg(locale) - .arg(QDateTime::currentDateTime().addDays(80).toTime_t()) + .arg(TQDateTime::currentDateTime().addDays(80).toTime_t()) .arg(md5sum)); } else { - insert( QString( "INSERT INTO amazon ( asin, locale, filename, refetchdate ) VALUES ( '%1', '%2', '%3', '%4');" ) + insert( TQString( "INSERT INTO amazon ( asin, locale, filename, refetchdate ) VALUES ( '%1', '%2', '%3', '%4');" ) .arg(asin) .arg(locale) .arg(md5sum) - .arg(QDateTime::currentDateTime().addDays(80).toTime_t()), NULL ); + .arg(TQDateTime::currentDateTime().addDays(80).toTime_t()), NULL ); } } -QStringList CollectionDB::staleImages() +TQStringList CollectionDB::staleImages() { - return query(QString("SELECT asin, locale, filename FROM amazon WHERE refetchdate < %1 ;") - .arg(QDateTime::currentDateTime().toTime_t() )); + return query(TQString("SELECT asin, locale, filename FROM amazon WHERE refetchdate < %1 ;") + .arg(TQDateTime::currentDateTime().toTime_t() )); } void @@ -4793,11 +4793,11 @@ DbConnection * CollectionDB::getMyConnection() connectionMutex->lock(); DbConnection *dbConn; - QThread *currThread = ThreadManager::Thread::getRunning(); + TQThread *currThread = ThreadManager::Thread::getRunning(); if (threadConnections->contains(currThread)) { - QMap::Iterator it = threadConnections->find(currThread); + TQMap::Iterator it = threadConnections->find(currThread); dbConn = it.data(); connectionMutex->unlock(); return dbConn; @@ -4829,14 +4829,14 @@ DbConnection * CollectionDB::getMyConnection() void -CollectionDB::releasePreviousConnection(QThread *currThread) +CollectionDB::releasePreviousConnection(TQThread *currThread) { - //if something already exists, delete the object, and erase knowledge of it from the QMap. + //if something already exists, delete the object, and erase knowledge of it from the TQMap. connectionMutex->lock(); DbConnection *dbConn; if (threadConnections->contains(currThread)) { - QMap::Iterator it = threadConnections->find(currThread); + TQMap::Iterator it = threadConnections->find(currThread); dbConn = it.data(); delete dbConn; threadConnections->erase(currThread); @@ -4855,7 +4855,7 @@ CollectionDB::isConnected() ////////////////////////////////////////////////////////////////////////////////////////// QCString -CollectionDB::md5sum( const QString& artist, const QString& album, const QString& file ) +CollectionDB::md5sum( const TQString& artist, const TQString& album, const TQString& file ) { KMD5 context( artist.lower().local8Bit() + album.lower().local8Bit() + file.local8Bit() ); // debug() << "MD5 SUM for " << artist << ", " << album << ": " << context.hexDigest() << endl; @@ -4863,7 +4863,7 @@ CollectionDB::md5sum( const QString& artist, const QString& album, const QString } -void CollectionDB::engineTrackEnded( int finalPosition, int trackLength, const QString &reason ) +void CollectionDB::engineTrackEnded( int finalPosition, int trackLength, const TQString &reason ) { //This is where percentages are calculated //TODO statistics are not calculated when currentTrack doesn't exist @@ -4902,7 +4902,7 @@ void CollectionDB::engineTrackEnded( int finalPosition, int trackLength, const Q void -CollectionDB::timerEvent( QTimerEvent* ) +CollectionDB::timerEvent( TQTimerEvent* ) { scanMonitor(); } @@ -4913,12 +4913,12 @@ CollectionDB::timerEvent( QTimerEvent* ) ////////////////////////////////////////////////////////////////////////////////////////// void -CollectionDB::fetchCover( QWidget* parent, const QString& artist, const QString& album, bool noedit, QListViewItem* item ) //SLOT +CollectionDB::fetchCover( TQWidget* parent, const TQString& artist, const TQString& album, bool noedit, TQListViewItem* item ) //SLOT { #ifdef AMAZON_SUPPORT debug() << "Fetching cover for " << artist << " - " << album << endl; - const bool isCompilation = albumIsCompilation( QString::number( albumID( album, false, false, true ) ) ); + const bool isCompilation = albumIsCompilation( TQString::number( albumID( album, false, false, true ) ) ); CoverFetcher* fetcher; if( isCompilation ) // avoid putting various artists in front of album title. this causes problems for locales other than US. @@ -4931,7 +4931,7 @@ CollectionDB::fetchCover( QWidget* parent, const QString& artist, const QString& itemCoverMap->insert( item, fetcher ); itemCoverMapMutex->unlock(); } - connect( fetcher, SIGNAL(result( CoverFetcher* )), SLOT(coverFetcherResult( CoverFetcher* )) ); + connect( fetcher, TQT_SIGNAL(result( CoverFetcher* )), TQT_SLOT(coverFetcherResult( CoverFetcher* )) ); fetcher->setUserCanEditQuery( !noedit ); fetcher->startFetch(); #endif @@ -4948,7 +4948,7 @@ CollectionDB::scanMonitor() //SLOT void CollectionDB::startScan() //SLOT { - QStringList folders = MountPointManager::instance()->collectionFolders(); + TQStringList folders = MountPointManager::instance()->collectionFolders(); if ( folders.isEmpty() ) { @@ -4977,7 +4977,7 @@ CollectionDB::stopScan() //SLOT ////////////////////////////////////////////////////////////////////////////////////////// void -CollectionDB::dirDirty( const QString& path ) +CollectionDB::dirDirty( const TQString& path ) { debug() << k_funcinfo << "Dirty: " << path << endl; @@ -5001,13 +5001,13 @@ CollectionDB::coverFetcherResult( CoverFetcher *fetcher ) //check the validity of the CollectionItem as it may have been deleted e.g. by a //collection scan while fetching the cover itemCoverMapMutex->lock(); - QMap::Iterator it; + TQMap::Iterator it; for( it = itemCoverMap->begin(); it != itemCoverMap->end(); ++it ) { if( it.data() == fetcher ) { if( it.key()->isOpen() ) - static_cast(it.key())->setPixmap( 0, QPixmap() ); + static_cast(it.key())->setPixmap( 0, TQPixmap() ); itemCoverMap->erase( it ); } } @@ -5022,9 +5022,9 @@ class SimilarArtistsInsertionJob : public ThreadManager::DependentJob { virtual bool doJob() { - CollectionDB::instance()->query( QString( "DELETE FROM related_artists WHERE artist = '%1';" ).arg( escapedArtist ) ); + CollectionDB::instance()->query( TQString( "DELETE FROM related_artists WHERE artist = '%1';" ).arg( escapedArtist ) ); - const QString sql = "INSERT INTO related_artists ( artist, suggestion, changedate ) VALUES ( '%1', '%2', 0 );"; + const TQString sql = "INSERT INTO related_artists ( artist, suggestion, changedate ) VALUES ( '%1', '%2', 0 );"; foreach( suggestions ) CollectionDB::instance()->insert( sql .arg( escapedArtist, @@ -5035,21 +5035,21 @@ class SimilarArtistsInsertionJob : public ThreadManager::DependentJob virtual void completeJob() { emit CollectionDB::instance()->similarArtistsFetched( artist ); } - const QString artist; - const QString escapedArtist; - const QStringList suggestions; + const TQString artist; + const TQString escapedArtist; + const TQStringList suggestions; public: - SimilarArtistsInsertionJob( CollectionDB *parent, const QString &s, const QStringList &list ) + SimilarArtistsInsertionJob( CollectionDB *parent, const TQString &s, const TQStringList &list ) : ThreadManager::DependentJob( parent, "SimilarArtistsInsertionJob" ) - , artist( QDeepCopy(s) ) - , escapedArtist( parent->escapeString( QDeepCopy(s) ) ) - , suggestions( QDeepCopy(list) ) + , artist( TQDeepCopy(s) ) + , escapedArtist( parent->escapeString( TQDeepCopy(s) ) ) + , suggestions( TQDeepCopy(list) ) {} }; void -CollectionDB::similarArtistsFetched( const QString& artist, const QStringList& suggestions ) +CollectionDB::similarArtistsFetched( const TQString& artist, const TQStringList& suggestions ) { debug() << "Received similar artists\n"; @@ -5057,24 +5057,24 @@ CollectionDB::similarArtistsFetched( const QString& artist, const QStringList& s } void -CollectionDB::aftCheckPermanentTables( const QString &currdeviceid, const QString &currid, const QString &currurl ) +CollectionDB::aftCheckPermanentTables( const TQString &currdeviceid, const TQString &currid, const TQString &currurl ) { //DEBUG_BLOCK //debug() << "deviceid = " << currdeviceid << endl << "url = " << currurl << endl << "uid = " << currid << endl; - QStringList check1, check2; + TQStringList check1, check2; foreach( m_aftEnabledPersistentTables ) { //debug() << "Checking " << (*it) << endl;; - check1 = query( QString( + check1 = query( TQString( "SELECT url, deviceid " "FROM %1 " "WHERE uniqueid = '%2';" ) .arg( escapeString( *it ) ) .arg( currid ) ); - check2 = query( QString( + check2 = query( TQString( "SELECT url, uniqueid " "FROM %1 " "WHERE deviceid = %2 AND url = '%3';" ) @@ -5085,7 +5085,7 @@ CollectionDB::aftCheckPermanentTables( const QString &currdeviceid, const QStrin if( !check1.empty() ) { //debug() << "uniqueid found, updating url" << endl; - query( QString( "UPDATE %1 SET deviceid = %2, url = '%4' WHERE uniqueid = '%3';" ) + query( TQString( "UPDATE %1 SET deviceid = %2, url = '%4' WHERE uniqueid = '%3';" ) .arg( escapeString( *it ) ) .arg( currdeviceid , currid @@ -5094,7 +5094,7 @@ CollectionDB::aftCheckPermanentTables( const QString &currdeviceid, const QStrin else if( !check2.empty() ) { //debug() << "url found, updating uniqueid" << endl; - query( QString( "UPDATE %1 SET uniqueid = '%2' WHERE deviceid = %3 AND url = '%4';" ) + query( TQString( "UPDATE %1 SET uniqueid = '%2' WHERE deviceid = %3 AND url = '%4';" ) .arg( escapeString( *it ) ) .arg( currid , currdeviceid @@ -5104,21 +5104,21 @@ CollectionDB::aftCheckPermanentTables( const QString &currdeviceid, const QStrin } void -CollectionDB::aftMigratePermanentTablesUrl( const QString& /*oldUrl*/, const QString& newUrl, const QString& uniqueid ) +CollectionDB::aftMigratePermanentTablesUrl( const TQString& /*oldUrl*/, const TQString& newUrl, const TQString& uniqueid ) { //DEBUG_BLOCK int deviceid = MountPointManager::instance()->getIdForUrl( newUrl ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, newUrl ); + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, newUrl ); //NOTE: if ever do anything with "deleted" in the statistics table, set deleted to false in query //below; will need special case. //debug() << "deviceid = " << deviceid << endl << "newurl = " << newUrl << endl << "uid = " << uniqueid << endl; foreach( m_aftEnabledPersistentTables ) { - query( QString( "DELETE FROM %1 WHERE deviceid = %2 AND url = '%3';" ) + query( TQString( "DELETE FROM %1 WHERE deviceid = %2 AND url = '%3';" ) .arg( escapeString( *it ) ) .arg( deviceid ) .arg( escapeString( rpath ) ) ); - query( QString( "UPDATE %1 SET deviceid = %2, url = '%4' WHERE uniqueid = '%3';" ) + query( TQString( "UPDATE %1 SET deviceid = %2, url = '%4' WHERE uniqueid = '%3';" ) .arg( escapeString( *it ) ) .arg( deviceid ) .arg( escapeString( uniqueid ) ) @@ -5127,7 +5127,7 @@ CollectionDB::aftMigratePermanentTablesUrl( const QString& /*oldUrl*/, const QSt } void -CollectionDB::aftMigratePermanentTablesUniqueId( const QString& /*url*/, const QString& oldid, const QString& newid ) +CollectionDB::aftMigratePermanentTablesUniqueId( const TQString& /*url*/, const TQString& oldid, const TQString& newid ) { //DEBUG_BLOCK //debug() << "oldid = " << oldid << endl << "newid = " << newid << endl; @@ -5135,10 +5135,10 @@ CollectionDB::aftMigratePermanentTablesUniqueId( const QString& /*url*/, const Q //below; will need special case. foreach( m_aftEnabledPersistentTables ) { - query( QString( "DELETE FROM %1 WHERE uniqueid = '%2';" ) + query( TQString( "DELETE FROM %1 WHERE uniqueid = '%2';" ) .arg( escapeString( *it ) ) .arg( escapeString( newid ) ) ); - query( QString( "UPDATE %1 SET uniqueid = '%1' WHERE uniqueid = '%2';" ) + query( TQString( "UPDATE %1 SET uniqueid = '%1' WHERE uniqueid = '%2';" ) .arg( escapeString( *it ) ) .arg( escapeString( newid ) ) .arg( escapeString( oldid ) ) ); @@ -5160,8 +5160,8 @@ CollectionDB::initialize() #ifdef USE_MYSQL if ( m_dbConnType == DbConnection::mysql ) { - QString appVersion = Amarok::config( "General Options" )->readEntry( "Version" ); - QString passwd = AmarokConfig::mySqlPassword2(); // stored as string type + TQString appVersion = Amarok::config( "General Options" )->readEntry( "Version" ); + TQString passwd = AmarokConfig::mySqlPassword2(); // stored as string type if( passwd.isEmpty() ) { @@ -5190,8 +5190,8 @@ CollectionDB::initialize() #ifdef USE_POSTGRESQL if ( m_dbConnType == DbConnection::postgresql ) { - QString appVersion = Amarok::config( "General Options" )->readEntry( "Version" ); - QString passwd = AmarokConfig::postgresqlPassword2(); + TQString appVersion = Amarok::config( "General Options" )->readEntry( "Version" ); + TQString passwd = AmarokConfig::postgresqlPassword2(); if( passwd.isEmpty() ) { @@ -5253,18 +5253,18 @@ CollectionDB::initialize() Amarok::config( "Collection Browser" )->writeEntry( "Database Persistent Tables Version", DATABASE_PERSISTENT_TABLES_VERSION ); Amarok::config( "Collection Browser" )->writeEntry( "Database Podcast Tables Version", DATABASE_PODCAST_TABLES_VERSION ); Amarok::config( "Collection Browser" )->writeEntry( "Database AFT Version", DATABASE_AFT_VERSION ); - setAdminValue( "Database Version", QString::number( DATABASE_VERSION ) ); - setAdminValue( "Database Stats Version", QString::number( DATABASE_STATS_VERSION ) ); - setAdminValue( "Database Persistent Tables Version", QString::number( DATABASE_PERSISTENT_TABLES_VERSION ) ); - setAdminValue( "Database Podcast Tables Version", QString::number( DATABASE_PODCAST_TABLES_VERSION ) ); - setAdminValue( "Database AFT Version", QString::number( DATABASE_AFT_VERSION ) ); + setAdminValue( "Database Version", TQString::number( DATABASE_VERSION ) ); + setAdminValue( "Database Stats Version", TQString::number( DATABASE_STATS_VERSION ) ); + setAdminValue( "Database Persistent Tables Version", TQString::number( DATABASE_PERSISTENT_TABLES_VERSION ) ); + setAdminValue( "Database Podcast Tables Version", TQString::number( DATABASE_PODCAST_TABLES_VERSION ) ); + setAdminValue( "Database AFT Version", TQString::number( DATABASE_AFT_VERSION ) ); } // Due to a bug in our sqllite handling code, we have to recreate the indices. // We should rmeove this before 1.4.5 if ( m_dbConnType == DbConnection::sqlite ) { - QStringList indices = query( "SELECT name FROM sqlite_master WHERE type='index' ORDER BY name;" ); + TQStringList indices = query( "SELECT name FROM sqlite_master WHERE type='index' ORDER BY name;" ); if (!indices.contains("url_tag")) { createIndices(); } @@ -5298,7 +5298,7 @@ CollectionDB::initialize() } } Amarok::config( "Collection Browser" )->writeEntry( "Database Devices Version", DATABASE_DEVICES_VERSION ); - setAdminValue( "Database Devices Version", QString::number( DATABASE_DEVICES_VERSION ) ); + setAdminValue( "Database Devices Version", TQString::number( DATABASE_DEVICES_VERSION ) ); //make sure that all indices exist createIndices(); @@ -5319,7 +5319,7 @@ CollectionDB::checkDatabase() //Currently broken, so disabled - seems to cause crashes as events are sent to //the Playlist - maybe it's not fully initialised? /* - QString text = i18n( "Amarok has to update your database to be able to use the new Dynamic Collection(insert link) feature. Amarok now has to determine on which physical devices your collection is stored. Please attach all removable devices which contain part of your collection and continue. Cancelling will exit Amarok." ); + TQString text = i18n( "Amarok has to update your database to be able to use the new Dynamic Collection(insert link) feature. Amarok now has to determine on which physical devices your collection is stored. Please attach all removable devices which contain part of your collection and continue. Cancelling will exit Amarok." ); int result = KMessageBox::warningContinueCancel( 0, text, "Database migration" ); if ( result != KMessageBox::Continue ) { @@ -5356,10 +5356,10 @@ CollectionDB::checkDatabase() Consider using a ProgressBarDialog */ - QLabel *label = new QLabel( i18n( "Updating database" ), dialog ); + TQLabel *label = new TQLabel( i18n( "Updating database" ), dialog ); dialog->setMainWidget( label ); label->show(); - QTimer::singleShot( 0, dialog, SLOT( show() ) ); + TQTimer::singleShot( 0, dialog, TQT_SLOT( show() ) ); //process events in the main event loop so that the dialog actually gets shown kapp->processEvents(); debug() << "Beginning database update" << endl; @@ -5393,11 +5393,11 @@ CollectionDB::checkDatabase() Amarok::config( "Collection Browser" )->writeEntry( "Database Podcast Tables Version", DATABASE_PODCAST_TABLES_VERSION ); Amarok::config( "Collection Browser" )->writeEntry( "Database AFT Version", DATABASE_AFT_VERSION ); - setAdminValue( "Database Version", QString::number( DATABASE_VERSION ) ); - setAdminValue( "Database Stats Version", QString::number( DATABASE_STATS_VERSION ) ); - setAdminValue( "Database Persistent Tables Version", QString::number( DATABASE_PERSISTENT_TABLES_VERSION ) ); - setAdminValue( "Database Podcast Tables Version", QString::number( DATABASE_PODCAST_TABLES_VERSION ) ); - setAdminValue( "Database AFT Version", QString::number( DATABASE_AFT_VERSION ) ); + setAdminValue( "Database Version", TQString::number( DATABASE_VERSION ) ); + setAdminValue( "Database Stats Version", TQString::number( DATABASE_STATS_VERSION ) ); + setAdminValue( "Database Persistent Tables Version", TQString::number( DATABASE_PERSISTENT_TABLES_VERSION ) ); + setAdminValue( "Database Podcast Tables Version", TQString::number( DATABASE_PODCAST_TABLES_VERSION ) ); + setAdminValue( "Database AFT Version", TQString::number( DATABASE_AFT_VERSION ) ); initDirOperations(); } @@ -5435,7 +5435,7 @@ CollectionDB::updateStatsTables() debug() << "Different database stats version detected! Stats table will be updated or rebuilt." << endl; #if 0 // causes mysterious crashes - if( getType() == DbConnection::sqlite && QFile::exists( Amarok::saveLocation()+"collection.db" ) ) + if( getType() == DbConnection::sqlite && TQFile::exists( Amarok::saveLocation()+"collection.db" ) ) { debug() << "Creating a backup of the database in " << Amarok::saveLocation()+"collection-backup.db" << '.' << endl; @@ -5461,7 +5461,7 @@ CollectionDB::updateStatsTables() prev = Amarok::config( "Collection Browser" )->readNumEntry( "Database Stats Version", 0 ); //pre somewhere in the 1.3-1.4 timeframe, the version wasn't stored in the DB, so try to guess it - const QString q = "SELECT COUNT( %1 ) FROM statistics;"; + const TQString q = "SELECT COUNT( %1 ) FROM statistics;"; if( !prev && query( q.arg( "url" ) ).first().toInt() && query( q.arg( "createdate" ) ).first().toInt() && query( q.arg( "accessdate" ) ).first().toInt() @@ -5493,7 +5493,7 @@ CollectionDB::updateStatsTables() } if( prev < 8 ) //Versions 6, 7 and 8 all were all attempts to add columns for ATF. his code should do it all. { - query( QString( "CREATE TABLE statistics_fix (" + query( TQString( "CREATE TABLE statistics_fix (" "url " + textColumnType() + " UNIQUE," "createdate INTEGER," "accessdate INTEGER," @@ -5524,18 +5524,18 @@ CollectionDB::updateStatsTables() query( "ALTER TABLE statistics ADD deviceid INTEGER;" ); //FIXME: (max) i know this is bad but its fast - QStringList oldURLs = query( "SELECT url FROM statistics;" ); + TQStringList oldURLs = query( "SELECT url FROM statistics;" ); //it might be necessary to use batch updates to improve speed debug() << "Updating " << oldURLs.count() << " rows in statistics" << endl; foreach( oldURLs ) { - bool exists = QFile::exists( *it ); + bool exists = TQFile::exists( *it ); int deviceid = exists ? MountPointManager::instance()->getIdForUrl( *it ) : -2; - QString rpath = exists ? MountPointManager::instance()->getRelativePath( deviceid, *it ) : *it; - QString update = QString( "UPDATE statistics SET deviceid = %1, url = '%2' WHERE " ) + TQString rpath = exists ? MountPointManager::instance()->getRelativePath( deviceid, *it ) : *it; + TQString update = TQString( "UPDATE statistics SET deviceid = %1, url = '%2' WHERE " ) .arg( deviceid ) .arg( escapeString( rpath ) ); - update += QString( "url = '%1';" ).arg( escapeString( *it ) ); + update += TQString( "url = '%1';" ).arg( escapeString( *it ) ); query ( update ); } } @@ -5565,7 +5565,7 @@ CollectionDB::updateStatsTables() void CollectionDB::updatePersistentTables() { - QString PersistentVersion = adminValue( "Database Persistent Tables Version" ); + TQString PersistentVersion = adminValue( "Database Persistent Tables Version" ); if ( PersistentVersion.isEmpty() ) { /* persistent tables didn't have a version on 1.3X and older, but let's be nice and try to @@ -5574,7 +5574,7 @@ CollectionDB::updatePersistentTables() createPersistentTables(); /* Copy lyrics */ debug() << "Trying to get lyrics from old db schema." << endl; - QStringList Lyrics = query( "SELECT url, lyrics FROM tags where tags.lyrics IS NOT NULL;" ); + TQStringList Lyrics = query( "SELECT url, lyrics FROM tags where tags.lyrics IS NOT NULL;" ); for (uint i=0; igetIdForUrl( *it ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, *it ); - QString update = QString( "UPDATE lyrics SET deviceid = %1, url = '%2' WHERE " ) + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, *it ); + TQString update = TQString( "UPDATE lyrics SET deviceid = %1, url = '%2' WHERE " ) .arg( deviceid ) .arg( escapeString( rpath ) ); - update += QString( "url = '%1';" ).arg( escapeString( *it ) ); + update += TQString( "url = '%1';" ).arg( escapeString( *it ) ); query ( update ); } } @@ -5667,24 +5667,24 @@ CollectionDB::updatePersistentTables() query( "DROP TABLE labels;" ); query( "DROP TABLE tags_labels;" ); //update for label support - QString labelsAutoIncrement = ""; + TQString labelsAutoIncrement = ""; if ( getDbConnectionType() == DbConnection::postgresql ) { - query( QString( "CREATE SEQUENCE labels_seq;" ) ); + query( TQString( "CREATE SEQUENCE labels_seq;" ) ); - labelsAutoIncrement = QString("DEFAULT nextval('labels_seq')"); + labelsAutoIncrement = TQString("DEFAULT nextval('labels_seq')"); } else if ( getDbConnectionType() == DbConnection::mysql ) { labelsAutoIncrement = "AUTO_INCREMENT"; } - query( QString( "CREATE TABLE labels (" + query( TQString( "CREATE TABLE labels (" "id INTEGER PRIMARY KEY " + labelsAutoIncrement + ", " "name " + textColumnType() + ", " "type INTEGER);" ) ); - query( QString( "CREATE TABLE tags_labels (" + query( TQString( "CREATE TABLE tags_labels (" "deviceid INTEGER," "url " + exactTextColumnType() + ", " "uniqueid " + exactTextColumnType(32) + ", " //m:n relationship, DO NOT MAKE UNIQUE! @@ -5724,7 +5724,7 @@ CollectionDB::updatePersistentTables() void CollectionDB::updatePodcastTables() { - QString PodcastVersion = adminValue( "Database Podcast Tables Version" ); + TQString PodcastVersion = adminValue( "Database Podcast Tables Version" ); if ( PodcastVersion.toInt() < 2 ) { createPodcastTablesV2( true ); @@ -5804,7 +5804,7 @@ CollectionDB::scanModifiedDirs() void -CollectionDB::customEvent( QCustomEvent *e ) +CollectionDB::customEvent( TQCustomEvent *e ) { if ( e->type() == (int)ScanController::JobFinishedEvent ) { @@ -5819,7 +5819,7 @@ CollectionDB::customEvent( QCustomEvent *e ) // check if something changed while we were scanning. in this case we should // rescan again, now. if ( m_rescanRequired ) - QTimer::singleShot( 0, CollectionDB::instance(), SLOT( scanMonitor() ) ); + TQTimer::singleShot( 0, CollectionDB::instance(), TQT_SLOT( scanMonitor() ) ); } else { @@ -5831,40 +5831,40 @@ CollectionDB::customEvent( QCustomEvent *e ) QString -CollectionDB::loadHashFile( const QCString& hash, uint width ) +CollectionDB::loadHashFile( const TQCString& hash, uint width ) { //debug() << "loadHashFile: " << hash << " - " << width << endl; - QString full = tagCoverDir().filePath( hash ); + TQString full = tagCoverDir().filePath( hash ); if ( width == 0 ) { - if ( QFileInfo( full ).isReadable() ) { + if ( TQFileInfo( full ).isReadable() ) { //debug() << "loadHashFile: fullsize: " << full << endl; return full; } } else { if ( width == 1 ) width = AmarokConfig::coverPreviewSize(); - QCString widthKey = makeWidthKey( width ); + TQCString widthKey = makeWidthKey( width ); - QString path = cacheCoverDir().filePath( widthKey + hash ); - if ( QFileInfo( path ).isReadable() ) { + TQString path = cacheCoverDir().filePath( widthKey + hash ); + if ( TQFileInfo( path ).isReadable() ) { //debug() << "loadHashFile: scaled: " << path << endl; return path; - } else if ( QFileInfo( full ).isReadable() ) { + } else if ( TQFileInfo( full ).isReadable() ) { //debug() << "loadHashFile: scaling: " << full << endl; - QImage image( full ); - if ( image.smoothScale( width, width, QImage::ScaleMin ).save( path, "PNG" ) ) { + TQImage image( full ); + if ( image.smoothScale( width, width, TQImage::ScaleMin ).save( path, "PNG" ) ) { //debug() << "loadHashFile: scaled: " << path << endl; return path; } } } - return QString(); + return TQString(); } bool -CollectionDB::extractEmbeddedImage( const MetaBundle &trackInformation, QCString& hash ) +CollectionDB::extractEmbeddedImage( const MetaBundle &trackInformation, TQCString& hash ) { //debug() << "extractEmbeddedImage: " << hash << " - " << trackInformation.url().path() << endl; @@ -5883,11 +5883,11 @@ CollectionDB::extractEmbeddedImage( const MetaBundle &trackInformation, QCString } QStringList -CollectionDB::getLabels( const QString &url, const uint type ) +CollectionDB::getLabels( const TQString &url, const uint type ) { int deviceid = MountPointManager::instance()->getIdForUrl( url ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, url ); - return query( QString( "SELECT labels.name FROM labels " + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, url ); + return query( TQString( "SELECT labels.name FROM labels " "LEFT JOIN tags_labels ON labels.id = tags_labels.labelid " "WHERE labels.type = %1 AND tags_labels.deviceid = %2 AND tags_labels.url = '%3';" ) .arg( type ).arg( deviceid ).arg( escapeString( rpath ) ) ); @@ -5897,32 +5897,32 @@ void CollectionDB::cleanLabels() { DEBUG_BLOCK - QStringList labelIds = query( "select labels.id " + TQStringList labelIds = query( "select labels.id " "from labels left join tags_labels on labels.id = tags_labels.labelid " "where tags_labels.labelid is NULL;" ); if ( !labelIds.isEmpty() ) { - QString ids; + TQString ids; foreach( labelIds ) { if ( !ids.isEmpty() ) ids += ','; ids += *it; } - query( QString( "DELETE FROM labels " + query( TQString( "DELETE FROM labels " "WHERE labels.id IN ( %1 );" ) .arg( ids ) ); } } void -CollectionDB::setLabels( const QString &url, const QStringList &labels, const QString &uid, const uint type ) +CollectionDB::setLabels( const TQString &url, const TQStringList &labels, const TQString &uid, const uint type ) { DEBUG_BLOCK int deviceid = MountPointManager::instance()->getIdForUrl( url ); - QString rpath = escapeString( MountPointManager::instance()->getRelativePath( deviceid, url ) ); - QStringList labelIds = query( QString( "SELECT id FROM labels WHERE type = %1;" ).arg( type ) ); - QString ids; + TQString rpath = escapeString( MountPointManager::instance()->getRelativePath( deviceid, url ) ); + TQStringList labelIds = query( TQString( "SELECT id FROM labels WHERE type = %1;" ).arg( type ) ); + TQString ids; if ( !labelIds.isEmpty() ) { foreach( labelIds ) @@ -5932,40 +5932,40 @@ CollectionDB::setLabels( const QString &url, const QStringList &labels, const QS ids += *it; } //TODO: max: add uniqueid handling - query( QString( "DELETE FROM tags_labels " + query( TQString( "DELETE FROM tags_labels " "WHERE tags_labels.labelid IN (%1) AND tags_labels.deviceid = %2 AND tags_labels.url = '%3';" ) - .arg( ids, QString::number(deviceid), rpath ) ); + .arg( ids, TQString::number(deviceid), rpath ) ); } foreach( labels ) { - int id = query( QString( "SELECT id FROM labels WHERE type = %1 AND name = '%2';" ) + int id = query( TQString( "SELECT id FROM labels WHERE type = %1 AND name = '%2';" ) .arg( type ).arg( escapeString( *it ) ) ).first().toInt(); if ( !id ) { - id = insert( QString( "INSERT INTO labels( name, type ) VALUES ( '%2', %1 );" ) + id = insert( TQString( "INSERT INTO labels( name, type ) VALUES ( '%2', %1 );" ) .arg( type ).arg( escapeString( *it ) ), "labels" ); } - insert( QString( "INSERT INTO tags_labels( labelid, deviceid, url, uniqueid ) VALUES ( %1, %2, '%3', '%4' );" ) - .arg( QString::number(id), QString::number(deviceid), rpath, escapeString( uid ) ), 0 ); + insert( TQString( "INSERT INTO tags_labels( labelid, deviceid, url, uniqueid ) VALUES ( %1, %2, '%3', '%4' );" ) + .arg( TQString::number(id), TQString::number(deviceid), rpath, escapeString( uid ) ), 0 ); } emit labelsChanged( url ); } void -CollectionDB::removeLabels( const QString &url, const QStringList &labels, const uint type ) +CollectionDB::removeLabels( const TQString &url, const TQStringList &labels, const uint type ) { DEBUG_BLOCK int deviceid = MountPointManager::instance()->getIdForUrl( url ); - QString rpath = escapeString( MountPointManager::instance()->getRelativePath( deviceid, url ) ); - QString sql = QString( "DELETE FROM tags_labels " + TQString rpath = escapeString( MountPointManager::instance()->getRelativePath( deviceid, url ) ); + TQString sql = TQString( "DELETE FROM tags_labels " "FROM tags_labels AS t LEFT JOIN labels AS l ON t.labelid = l.id " "WHERE l.type = %1 AND t.deviceid = %2 AND t.url = '%3' AND ( 0" ) .arg( type ).arg( deviceid ).arg( rpath ); foreach( labels ) { - sql += QString( " OR l.name = '%1'" ).arg( escapeString( *it ) ); + sql += TQString( " OR l.name = '%1'" ).arg( escapeString( *it ) ); } sql += ");"; query( sql ); @@ -5974,30 +5974,30 @@ CollectionDB::removeLabels( const QString &url, const QStringList &labels, const } bool -CollectionDB::addLabel( const QString &url, const QString &label, const QString &uid, const uint type ) +CollectionDB::addLabel( const TQString &url, const TQString &label, const TQString &uid, const uint type ) { DEBUG_BLOCK int deviceid = MountPointManager::instance()->getIdForUrl( url ); - QString rpath = escapeString( MountPointManager::instance()->getRelativePath( deviceid, url ) ); + TQString rpath = escapeString( MountPointManager::instance()->getRelativePath( deviceid, url ) ); - int id = query( QString( "SELECT id FROM labels WHERE type = %1 AND name = '%2';" ) + int id = query( TQString( "SELECT id FROM labels WHERE type = %1 AND name = '%2';" ) .arg( type ).arg( escapeString( label ) ) ).first().toInt(); bool labelAlreadyExists = id > 0; if ( !id ) { - id = insert( QString( "INSERT INTO labels( name, type ) VALUES ( '%2', %1 );" ) + id = insert( TQString( "INSERT INTO labels( name, type ) VALUES ( '%2', %1 );" ) .arg( type ).arg( escapeString( label ) ), "labels" ); } if ( labelAlreadyExists ) { //we can return if the link between the tags row and the labels row already exists - int count = query( QString( "SELECT COUNT(*) FROM tags_labels WHERE labelid = %1 AND deviceid = %2 AND url = '%3';" ) + int count = query( TQString( "SELECT COUNT(*) FROM tags_labels WHERE labelid = %1 AND deviceid = %2 AND url = '%3';" ) .arg( id ).arg( deviceid ).arg( rpath ) ).first().toInt(); if ( count ) return false; } - insert( QString( "INSERT INTO tags_labels( labelid, deviceid, url, uniqueid ) VALUES ( %1, %2, '%3', '%4' );" ) - .arg( QString::number(id), QString::number(deviceid), rpath, escapeString( uid ) ), "tags_labels" ); + insert( TQString( "INSERT INTO tags_labels( labelid, deviceid, url, uniqueid ) VALUES ( %1, %2, '%3', '%4' );" ) + .arg( TQString::number(id), TQString::number(deviceid), rpath, escapeString( uid ) ), "tags_labels" ); emit labelsChanged( url ); return true; @@ -6006,31 +6006,31 @@ CollectionDB::addLabel( const QString &url, const QString &label, const QString QStringList CollectionDB::favoriteLabels( int type, int count ) { - return query( QString( "SELECT labels.name, count( tags_labels.labelid ) " + return query( TQString( "SELECT labels.name, count( tags_labels.labelid ) " "FROM labels LEFT JOIN tags_labels ON labels.id = tags_labels.labelid " "WHERE labels.type = %1 GROUP BY labels.name " "ORDER BY count(tags_labels.labelid) DESC LIMIT %2;" ) - .arg( QString::number( type ), QString::number( count ) ) ); + .arg( TQString::number( type ), TQString::number( count ) ) ); } QDir CollectionDB::largeCoverDir() //static { - return QDir( Amarok::saveLocation( "albumcovers/large/" ) ); + return TQDir( Amarok::saveLocation( "albumcovers/large/" ) ); } QDir CollectionDB::tagCoverDir() //static { - return QDir( Amarok::saveLocation( "albumcovers/tagcover/" ) ); + return TQDir( Amarok::saveLocation( "albumcovers/tagcover/" ) ); } QDir CollectionDB::cacheCoverDir() //static { - return QDir( Amarok::saveLocation( "albumcovers/cache/" ) ); + return TQDir( Amarok::saveLocation( "albumcovers/cache/" ) ); } @@ -6054,13 +6054,13 @@ SqliteConnection::SqliteConnection( const SqliteConfig* config ) DEBUG_BLOCK - const QCString path = QFile::encodeName( config->dbFile() ); + const TQCString path = TQFile::encodeName( config->dbFile() ); // Open database file and check for correctness - QFile file( path ); + TQFile file( path ); if ( file.open( IO_ReadOnly ) ) { - QString format; + TQString format; file.readLine( format, 50 ); if ( !format.startsWith( "SQLite format 3" ) ) { @@ -6078,7 +6078,7 @@ SqliteConnection::SqliteConnection( const SqliteConfig* config ) if ( !m_initialized ) { // Remove old db file; create new - QFile::remove( path ); + TQFile::remove( path ); if ( sqlite3_open( path, &m_db ) == SQLITE_OK ) { m_initialized = true; @@ -6107,10 +6107,10 @@ SqliteConnection::~SqliteConnection() } -QStringList SqliteConnection::query( const QString& statement, bool /*suppressDebug*/ ) +TQStringList SqliteConnection::query( const TQString& statement, bool /*suppressDebug*/ ) { - QStringList values; + TQStringList values; int error; int rc = 0; const char* tail; @@ -6137,7 +6137,7 @@ QStringList SqliteConnection::query( const QString& statement, bool /*suppressDe Debug::error() << k_funcinfo << " sqlite3_compile error:" << endl; Debug::error() << sqlite3_errmsg( m_db ) << endl; Debug::error() << "on query: " << statement << endl; - values = QStringList(); + values = TQStringList(); break; } else @@ -6167,7 +6167,7 @@ QStringList SqliteConnection::query( const QString& statement, bool /*suppressDe //iterate over columns for ( int i = 0; i < number; i++ ) { - values << QString::fromUtf8( reinterpret_cast( sqlite3_column_text( stmt, i ) ) ); + values << TQString::fromUtf8( reinterpret_cast( sqlite3_column_text( stmt, i ) ) ); } } //deallocate vm resources @@ -6178,7 +6178,7 @@ QStringList SqliteConnection::query( const QString& statement, bool /*suppressDe Debug::error() << k_funcinfo << "sqlite_step error.\n"; Debug::error() << sqlite3_errmsg( m_db ) << endl; Debug::error() << "on query: " << statement << endl; - values = QStringList(); + values = TQStringList(); } if ( rc == SQLITE_SCHEMA ) { @@ -6190,7 +6190,7 @@ QStringList SqliteConnection::query( const QString& statement, bool /*suppressDe { Debug::error() << "Retry-Count has reached maximum. Aborting this SQL statement!" << endl; Debug::error() << "SQL statement: " << statement << endl; - values = QStringList(); + values = TQStringList(); } } } @@ -6201,7 +6201,7 @@ QStringList SqliteConnection::query( const QString& statement, bool /*suppressDe } -int SqliteConnection::insert( const QString& statement, const QString& /* table */ ) +int SqliteConnection::insert( const TQString& statement, const TQString& /* table */ ) { int error; int rc = 0; @@ -6308,8 +6308,8 @@ void SqliteConnection::sqlite_like_new( sqlite3_context *context, int argc, sqli const unsigned char *zA = sqlite3_value_text( argv[0] ); const unsigned char *zB = sqlite3_value_text( argv[1] ); - QString pattern = QString::fromUtf8( (const char*)zA ); - QString text = QString::fromUtf8( (const char*)zB ); + TQString pattern = TQString::fromUtf8( (const char*)zA ); + TQString text = TQString::fromUtf8( (const char*)zB ); int begin = pattern.startsWith( "%" ), end = pattern.endsWith( "%" ); if (begin) @@ -6358,7 +6358,7 @@ MySqlConnection::MySqlConnection( const MySqlConfig* config ) #if MYSQL_VERSION_ID >= 40113 // now set the right charset for the connection - QStringList my_qslist = query( "SHOW VARIABLES LIKE 'character_set_database'" ); + TQStringList my_qslist = query( "SHOW VARIABLES LIKE 'character_set_database'" ); if( !my_qslist.isEmpty() && !mysql_set_character_set( m_db, const_cast( my_qslist[1].latin1() ) ) ) //charset was updated debug() << "Connection Charset is now: " << my_qslist[1].latin1() << endl; @@ -6382,7 +6382,7 @@ MySqlConnection::MySqlConnection( const MySqlConfig* config ) NULL, CLIENT_COMPRESS)) { if ( mysql_query(m_db, - QString( "CREATE DATABASE " + config->database() ).latin1() ) ) + TQString( "CREATE DATABASE " + config->database() ).latin1() ) ) { m_connected = true; m_initialized = true; } else { setMysqlError(); } @@ -6403,9 +6403,9 @@ MySqlConnection::~MySqlConnection() } -QStringList MySqlConnection::query( const QString& statement, bool suppressDebug ) +TQStringList MySqlConnection::query( const TQString& statement, bool suppressDebug ) { - QStringList values; + TQStringList values; if ( !mysql_query( m_db, statement.utf8() ) ) { @@ -6418,7 +6418,7 @@ QStringList MySqlConnection::query( const QString& statement, bool suppressDebug { for ( int i = 0; i < number; i++ ) { - values << QString::fromUtf8( (const char*)row[i] ); + values << TQString::fromUtf8( (const char*)row[i] ); } } } @@ -6428,7 +6428,7 @@ QStringList MySqlConnection::query( const QString& statement, bool suppressDebug { if ( !suppressDebug ) debug() << "MYSQL QUERY FAILED: " << mysql_error( m_db ) << "\n" << "FAILED QUERY: " << statement << "\n"; - values = QStringList(); + values = TQStringList(); } } mysql_free_result( result ); @@ -6437,14 +6437,14 @@ QStringList MySqlConnection::query( const QString& statement, bool suppressDebug { if ( !suppressDebug ) debug() << "MYSQL QUERY FAILED: " << mysql_error( m_db ) << "\n" << "FAILED QUERY: " << statement << "\n"; - values = QStringList(); + values = TQStringList(); } return values; } -int MySqlConnection::insert( const QString& statement, const QString& /* table */ ) +int MySqlConnection::insert( const TQString& statement, const TQString& /* table */ ) { mysql_query( m_db, statement.utf8() ); if ( mysql_errno( m_db ) ) @@ -6473,14 +6473,14 @@ PostgresqlConnection::PostgresqlConnection( const PostgresqlConfig* config ) : DbConnection() , m_connected( false ) { - QString conninfo; + TQString conninfo; debug() << k_funcinfo << endl; // if ( config->username().isEmpty() ) // pApp->slotConfigAmarok("Postgresql"); conninfo = "host='" + config->host() + - "' port=" + QString::number( config->port() ) + + "' port=" + TQString::number( config->port() ) + " dbname='" + config->database() + "' user='" + config->username() + "' password='" + config->password() + '\''; @@ -6516,9 +6516,9 @@ PostgresqlConnection::~PostgresqlConnection() } -QStringList PostgresqlConnection::query( const QString& statement, bool suppressDebug ) +TQStringList PostgresqlConnection::query( const TQString& statement, bool suppressDebug ) { - QStringList values; + TQStringList values; PGresult* result; ExecStatusType status; @@ -6541,9 +6541,9 @@ QStringList PostgresqlConnection::query( const QString& statement, bool suppress int cols = PQnfields( result ); int rows = PQntuples( result ); - QMap discardCols; + TQMap discardCols; for(int col=0; col< cols; col++) { - if (QString(PQfname(result, col)) == QString("__discard") || QString(PQfname(result, col)) == QString("__random")) + if (TQString(PQfname(result, col)) == TQString("__discard") || TQString(PQfname(result, col)) == TQString("__random")) { discardCols[col] = true; } @@ -6555,7 +6555,7 @@ QStringList PostgresqlConnection::query( const QString& statement, bool suppress { if (discardCols[col]) continue; - values << QString::fromUtf8(PQgetvalue(result, row, col)); + values << TQString::fromUtf8(PQgetvalue(result, row, col)); } } @@ -6565,11 +6565,11 @@ QStringList PostgresqlConnection::query( const QString& statement, bool suppress } -int PostgresqlConnection::insert( const QString& statement, const QString& table ) +int PostgresqlConnection::insert( const TQString& statement, const TQString& table ) { PGresult* result; ExecStatusType status; - QString curvalSql; + TQString curvalSql; int id; result = PQexec(m_db, statement.utf8()); @@ -6590,10 +6590,10 @@ int PostgresqlConnection::insert( const QString& statement, const QString& table if (table == NULL) return 0; - QString _table = table; + TQString _table = table; if (table.find("_temp") > 0) _table = table.left(table.find("_temp")); - curvalSql = QString("SELECT currval('%1_seq');").arg(_table); + curvalSql = TQString("SELECT currval('%1_seq');").arg(_table); result = PQexec(m_db, curvalSql.utf8()); if (result == NULL) { @@ -6616,7 +6616,7 @@ int PostgresqlConnection::insert( const QString& statement, const QString& table return 0; } - id = QString::fromUtf8(PQgetvalue(result, 0, 0)).toInt(); + id = TQString::fromUtf8(PQgetvalue(result, 0, 0)).toInt(); PQclear(result); return id; @@ -6636,7 +6636,7 @@ void PostgresqlConnection::setPostgresqlError() // CLASS SqliteConfig ////////////////////////////////////////////////////////////////////////////////////////// -SqliteConfig::SqliteConfig( const QString& dbfile ) +SqliteConfig::SqliteConfig( const TQString& dbfile ) : m_dbfile( dbfile ) {} @@ -6646,11 +6646,11 @@ SqliteConfig::SqliteConfig( const QString& dbfile ) ////////////////////////////////////////////////////////////////////////////////////////// MySqlConfig::MySqlConfig( - const QString& host, + const TQString& host, const int port, - const QString& database, - const QString& username, - const QString& password ) + const TQString& database, + const TQString& username, + const TQString& password ) : m_host( host ), m_port( port ), m_database( database ), @@ -6664,11 +6664,11 @@ MySqlConfig::MySqlConfig( ////////////////////////////////////////////////////////////////////////////////////////// PostgresqlConfig::PostgresqlConfig( - const QString& host, + const TQString& host, const int port, - const QString& database, - const QString& username, - const QString& password ) + const TQString& database, + const TQString& username, + const TQString& password ) : m_host( host ), m_port( port ), m_database( database ), @@ -6731,8 +6731,8 @@ QueryBuilder::linkTables( int tables ) ((m_tables += " LEFT JOIN ") += tableName( tabStats)) += " ON statistics.url=tags.url AND statistics.deviceid = tags.deviceid"; //if ( !m_url.isEmpty() ) { - // QString url = QString( '.' ) + m_url; - // m_tables += QString( " OR statistics.deviceid = -1 AND statistics.url = '%1'" ) + // TQString url = TQString( '.' ) + m_url; + // m_tables += TQString( " OR statistics.deviceid = -1 AND statistics.url = '%1'" ) // .arg( CollectionDB::instance()->escapeString( url ) ); //} } @@ -6816,7 +6816,7 @@ QueryBuilder::countReturnValues() } void -QueryBuilder::addURLFilters( const QStringList& filter ) +QueryBuilder::addURLFilters( const TQStringList& filter ) { if ( !filter.isEmpty() ) { @@ -6825,9 +6825,9 @@ QueryBuilder::addURLFilters( const QStringList& filter ) for ( uint i = 0; i < filter.count(); i++ ) { int deviceid = MountPointManager::instance()->getIdForUrl( filter[i] ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid , filter[i] ); + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid , filter[i] ); m_where += "OR (tags.url = '" + CollectionDB::instance()->escapeString( rpath ) + "' "; - m_where += QString( "AND tags.deviceid = %1 ) " ).arg( QString::number( deviceid ) ); + m_where += TQString( "AND tags.deviceid = %1 ) " ).arg( TQString::number( deviceid ) ); //TODO MountPointManager fix this } @@ -6838,7 +6838,7 @@ QueryBuilder::addURLFilters( const QStringList& filter ) } void -QueryBuilder::setGoogleFilter( int defaultTables, QString query ) +QueryBuilder::setGoogleFilter( int defaultTables, TQString query ) { //TODO MountPointManager fix google syntax //no clue about what needs to be done atm @@ -6850,7 +6850,7 @@ QueryBuilder::setGoogleFilter( int defaultTables, QString query ) for( uint ii = 0, nn = parsed[i].count(); ii < nn; ++ii ) { const expression_element &e = parsed[i][ii]; - QString s = e.text; + TQString s = e.text; int mode; switch( e.match ) { @@ -6890,7 +6890,7 @@ QueryBuilder::setGoogleFilter( int defaultTables, QString query ) table = tabStats; value = valRating; exact = true; - s = QString::number( int( s.toFloat() * 2 ) ); + s = TQString::number( int( s.toFloat() * 2 ) ); } else if( e.field == "directory" ) { @@ -6933,9 +6933,9 @@ QueryBuilder::setGoogleFilter( int defaultTables, QString query ) value = valFilesize; exact = true; if( s.lower().endsWith( "m" ) ) - s = QString::number( s.left( s.length()-1 ).toLong() * 1024 * 1024 ); + s = TQString::number( s.left( s.length()-1 ).toLong() * 1024 * 1024 ); else if( s.lower().endsWith( "k" ) ) - s = QString::number( s.left( s.length()-1 ).toLong() * 1024 ); + s = TQString::number( s.left( s.length()-1 ).toLong() * 1024 ); } else if( e.field == "filename" || e.field == "url" ) { @@ -7007,7 +7007,7 @@ QueryBuilder::setGoogleFilter( int defaultTables, QString query ) } void -QueryBuilder::addFilter( int tables, const QString& filter ) +QueryBuilder::addFilter( int tables, const TQString& filter ) { if ( !filter.isEmpty() ) { @@ -7044,7 +7044,7 @@ QueryBuilder::addFilter( int tables, const QString& filter ) m_where += "OR tags.title = '' "; } if ( ( tables & tabArtist ) && i18n( "Various Artists" ).contains( filter, false ) ) - m_where += QString( "OR tags.sampler = %1 " ).arg( CollectionDB::instance()->boolT() ); + m_where += TQString( "OR tags.sampler = %1 " ).arg( CollectionDB::instance()->boolT() ); m_where += " ) "; } @@ -7052,16 +7052,16 @@ QueryBuilder::addFilter( int tables, const QString& filter ) } void -QueryBuilder::addFilter( int tables, Q_INT64 value, const QString& filter, int mode, bool exact ) +QueryBuilder::addFilter( int tables, Q_INT64 value, const TQString& filter, int mode, bool exact ) { //true for INTEGER fields (see comment of coalesceField(int, Q_INT64) bool useCoalesce = coalesceField( tables, value ); m_where += ANDslashOR() + " ( "; - QString m, s; + TQString m, s; if (mode == modeLess || mode == modeGreater) { - QString escapedFilter; + TQString escapedFilter; if (useCoalesce && DbConnection::sqlite == CollectionDB::instance()->getDbConnectionType()) escapedFilter = CollectionDB::instance()->escapeString( filter ); else @@ -7080,12 +7080,12 @@ QueryBuilder::addFilter( int tables, Q_INT64 value, const QString& filter, int m } if( coalesceField( tables, value ) ) - m_where += QString( "COALESCE(%1.%2,0) " ).arg( tableName( tables ) ).arg( valueName( value ) ) + s; + m_where += TQString( "COALESCE(%1.%2,0) " ).arg( tableName( tables ) ).arg( valueName( value ) ) + s; else - m_where += QString( "%1.%2 " ).arg( tableName( tables ) ).arg( valueName( value ) ) + s; + m_where += TQString( "%1.%2 " ).arg( tableName( tables ) ).arg( valueName( value ) ) + s; if ( !exact && (value & valName) && mode == modeNormal && i18n( "Unknown").contains( filter, false ) ) - m_where += QString( "OR %1.%2 = '' " ).arg( tableName( tables ) ).arg( valueName( value ) ); + m_where += TQString( "OR %1.%2 = '' " ).arg( tableName( tables ) ).arg( valueName( value ) ); m_where += " ) "; @@ -7093,7 +7093,7 @@ QueryBuilder::addFilter( int tables, Q_INT64 value, const QString& filter, int m } void -QueryBuilder::addFilters( int tables, const QStringList& filter ) +QueryBuilder::addFilters( int tables, const TQStringList& filter ) { if ( !filter.isEmpty() ) { @@ -7145,7 +7145,7 @@ QueryBuilder::addFilters( int tables, const QStringList& filter ) } void -QueryBuilder::excludeFilter( int tables, const QString& filter ) +QueryBuilder::excludeFilter( int tables, const TQString& filter ) { if ( !filter.isEmpty() ) { @@ -7194,11 +7194,11 @@ QueryBuilder::excludeFilter( int tables, const QString& filter ) } void -QueryBuilder::excludeFilter( int tables, Q_INT64 value, const QString& filter, int mode, bool exact ) +QueryBuilder::excludeFilter( int tables, Q_INT64 value, const TQString& filter, int mode, bool exact ) { m_where += ANDslashOR() + " ( "; - QString m, s; + TQString m, s; if (mode == modeLess || mode == modeGreater) s = ( mode == modeLess ? ">= '" : "<= '" ) + CollectionDB::instance()->escapeString( filter ) + "' "; else @@ -7217,12 +7217,12 @@ QueryBuilder::excludeFilter( int tables, Q_INT64 value, const QString& filter, i } if( coalesceField( tables, value ) ) - m_where += QString( "COALESCE(%1.%2,0) " ).arg( tableName( tables ) ).arg( valueName( value ) ) + s; + m_where += TQString( "COALESCE(%1.%2,0) " ).arg( tableName( tables ) ).arg( valueName( value ) ) + s; else - m_where += QString( "%1.%2 " ).arg( tableName( tables ) ).arg( valueName( value ) ) + s; + m_where += TQString( "%1.%2 " ).arg( tableName( tables ) ).arg( valueName( value ) ) + s; if ( !exact && (value & valName) && mode == modeNormal && i18n( "Unknown").contains( filter, false ) ) - m_where += QString( "AND %1.%2 <> '' " ).arg( tableName( tables ) ).arg( valueName( value ) ); + m_where += TQString( "AND %1.%2 <> '' " ).arg( tableName( tables ) ).arg( valueName( value ) ); m_where += " ) "; @@ -7230,9 +7230,9 @@ QueryBuilder::excludeFilter( int tables, Q_INT64 value, const QString& filter, i } void -QueryBuilder::addMatch( int tables, const QString& match, bool interpretUnknown /* = true */, bool caseSensitive /* = true */ ) +QueryBuilder::addMatch( int tables, const TQString& match, bool interpretUnknown /* = true */, bool caseSensitive /* = true */ ) { - QString matchCondition = caseSensitive ? CollectionDB::exactCondition( match ) : CollectionDB::likeCondition( match ); + TQString matchCondition = caseSensitive ? CollectionDB::exactCondition( match ) : CollectionDB::likeCondition( match ); (((m_where += ANDslashOR()) += " ( ") += CollectionDB::instance()->boolF()) += ' '; if ( tables & tabAlbum ) @@ -7250,7 +7250,7 @@ QueryBuilder::addMatch( int tables, const QString& match, bool interpretUnknown if ( tables & tabLabels ) (m_where += "OR labels.name ") += matchCondition; - static QString i18nUnknown = i18n("Unknown"); + static TQString i18nUnknown = i18n("Unknown"); if ( interpretUnknown && match == i18nUnknown ) { @@ -7269,7 +7269,7 @@ QueryBuilder::addMatch( int tables, const QString& match, bool interpretUnknown void -QueryBuilder::addMatch( int tables, Q_INT64 value, const QString& match, bool interpretUnknown /* = true */, bool caseSensitive /* = true */ ) +QueryBuilder::addMatch( int tables, Q_INT64 value, const TQString& match, bool interpretUnknown /* = true */, bool caseSensitive /* = true */ ) { m_where += ANDslashOR() + " ( " + CollectionDB::instance()->boolF() + ' '; if ( value & valURL ) @@ -7278,32 +7278,32 @@ QueryBuilder::addMatch( int tables, Q_INT64 value, const QString& match, bool in if ( value & valURL || value & valDirectory ) { int deviceid = MountPointManager::instance()->getIdForUrl( match ); - QString rpath = MountPointManager::instance()->getRelativePath( deviceid, match ); + TQString rpath = MountPointManager::instance()->getRelativePath( deviceid, match ); //we are querying for a specific path, so we don't need the tags.deviceid IN (...) stuff //which is automatially appended if m_showAll = false m_showAll = true; - m_where += QString( "OR %1.%2 " ) + m_where += TQString( "OR %1.%2 " ) .arg( tableName( tables ) ) .arg( valueName( value ) ); m_where += caseSensitive ? CollectionDB::exactCondition( rpath ) : CollectionDB::likeCondition( rpath ); - m_where += QString( " AND %1.deviceid = %2 " ).arg( tableName( tables ) ).arg( deviceid ); + m_where += TQString( " AND %1.deviceid = %2 " ).arg( tableName( tables ) ).arg( deviceid ); if ( deviceid != -1 ) { //handle corner case - QString rpath2( '.' + match ); - m_where += QString( " OR %1.%2 " ).arg( tableName( tables ) ).arg( valueName( value ) ); + TQString rpath2( '.' + match ); + m_where += TQString( " OR %1.%2 " ).arg( tableName( tables ) ).arg( valueName( value ) ); m_where += caseSensitive ? CollectionDB::exactCondition( rpath2 ) : CollectionDB::likeCondition( rpath2 ); - m_where += QString( " AND %1.deviceid = -1 " ).arg( tableName( tables ) ); + m_where += TQString( " AND %1.deviceid = -1 " ).arg( tableName( tables ) ); } } else { - m_where += QString( "OR %1.%2 " ).arg( tableName( tables ) ).arg( valueName( value ) ); + m_where += TQString( "OR %1.%2 " ).arg( tableName( tables ) ).arg( valueName( value ) ); m_where += caseSensitive ? CollectionDB::exactCondition( match ) : CollectionDB::likeCondition( match ); } if ( ( value & valName ) && interpretUnknown && match == i18n( "Unknown" ) ) - m_where += QString( "OR %1.%2 = '' " ).arg( tableName( tables ) ).arg( valueName( value ) ); + m_where += TQString( "OR %1.%2 = '' " ).arg( tableName( tables ) ).arg( valueName( value ) ); m_where += " ) "; @@ -7312,9 +7312,9 @@ QueryBuilder::addMatch( int tables, Q_INT64 value, const QString& match, bool in void -QueryBuilder::addMatches( int tables, const QStringList& match, bool interpretUnknown /* = true */, bool caseSensitive /* = true */ ) +QueryBuilder::addMatches( int tables, const TQStringList& match, bool interpretUnknown /* = true */, bool caseSensitive /* = true */ ) { - QStringList matchConditions; + TQStringList matchConditions; for ( uint i = 0; i < match.count(); i++ ) matchConditions << ( caseSensitive ? CollectionDB::exactCondition( match[i] ) : CollectionDB::likeCondition( match[i] ) ); @@ -7357,7 +7357,7 @@ QueryBuilder::addMatches( int tables, const QStringList& match, bool interpretUn } void -QueryBuilder::excludeMatch( int tables, const QString& match ) +QueryBuilder::excludeMatch( int tables, const TQString& match ) { m_where += ANDslashOR() + " ( " + CollectionDB::instance()->boolT() + ' '; if ( tables & tabAlbum ) m_where += "AND album.name <> '" + CollectionDB::instance()->escapeString( match ) + "' "; @@ -7396,9 +7396,9 @@ QueryBuilder::exclusiveFilter( int tableMatching, int tableNotMatching, Q_INT64 void -QueryBuilder::addNumericFilter(int tables, Q_INT64 value, const QString &n, +QueryBuilder::addNumericFilter(int tables, Q_INT64 value, const TQString &n, int mode /* = modeNormal */, - const QString &endRange /* = QString::null */ ) + const TQString &endRange /* = TQString::null */ ) { m_where.append( ANDslashOR() ).append( " ( " ); @@ -7442,8 +7442,8 @@ QueryBuilder::setOptions( int options ) if ( options & optNoCompilations || options & optOnlyCompilations ) m_linkTables |= tabSong; - if ( options & optNoCompilations ) m_where += QString("AND tags.sampler = %1 ").arg(CollectionDB::instance()->boolF()); - if ( options & optOnlyCompilations ) m_where += QString("AND tags.sampler = %1 ").arg(CollectionDB::instance()->boolT()); + if ( options & optNoCompilations ) m_where += TQString("AND tags.sampler = %1 ").arg(CollectionDB::instance()->boolF()); + if ( options & optOnlyCompilations ) m_where += TQString("AND tags.sampler = %1 ").arg(CollectionDB::instance()->boolT()); if (CollectionDB::instance()->getType() == DbConnection::postgresql && options & optRemoveDuplicates && options & optRandomize) { @@ -7535,7 +7535,7 @@ QueryBuilder::sortByFunction( int function, int table, Q_INT64 value, bool desce if ( b ) m_sort += "LOWER( "; if ( c && CollectionDB::instance()->getType() != DbConnection::mysql) m_sort += "COALESCE( "; - QString columnName; + TQString columnName; if (CollectionDB::instance()->getType() == DbConnection::postgresql) { @@ -7587,11 +7587,11 @@ QueryBuilder::groupBy( int table, Q_INT64 value ) } void -QueryBuilder::having( int table, Q_INT64 value, int function, int mode, const QString& match ) +QueryBuilder::having( int table, Q_INT64 value, int function, int mode, const TQString& match ) { if( !m_having.isEmpty() ) m_having += " AND "; - QString fn = functionName( function ); + TQString fn = functionName( function ); fn.isEmpty() ? m_having += tableName( table ) + '.' + valueName( value ) : m_having += functionName( function )+'('+tableName( table )+'.'+valueName( value )+')'; @@ -7617,7 +7617,7 @@ QueryBuilder::having( int table, Q_INT64 value, int function, int mode, const QS void QueryBuilder::setLimit( int startPos, int length ) { - m_limit = QString( " LIMIT %2 OFFSET %1 " ).arg( startPos ).arg( length ); + m_limit = TQString( " LIMIT %2 OFFSET %1 " ).arg( startPos ).arg( length ); } void @@ -7644,7 +7644,7 @@ QueryBuilder::shuffle( int table, Q_INT64 value ) // because it doesn't matter if it becomes zero (the exponent is always // non-zero), and finally POWER(...) is used instead of 1-POWER(...) because it // only changes the order type. - m_sort += QString("POWER( %1, 1.0 / (%2.%3 + 1) ) DESC") + m_sort += TQString("POWER( %1, 1.0 / (%2.%3 + 1) ) DESC") .arg( CollectionDB::instance()->randomFunc() ) .arg( tableName( table ) ) .arg( valueName( value ) ); @@ -7727,7 +7727,7 @@ QueryBuilder::buildQuery( bool withDeviceidPlaceholder ) foreachType( IdList, list ) { if ( it != list.begin() ) m_query += ','; - m_query += QString::number( *it ); + m_query += TQString::number( *it ); } m_query += ')'; } @@ -7758,7 +7758,7 @@ QueryBuilder::run() { buildQuery(); //debug() << m_query << endl; - QStringList rs = CollectionDB::instance()->query( m_query ); + TQStringList rs = CollectionDB::instance()->query( m_query ); //calling code is unaware of the dynamic collection implementation, it simply expects an URL if( m_deviceidPos > 0 ) return cleanURL( rs ); @@ -7828,9 +7828,9 @@ QueryBuilder::sortByFavoriteAvg() { m_having += " AND "; m_having += " ("; if (AmarokConfig::useRatings() ) - m_having += QString("%1(%2.%3) > 0 OR ") + m_having += TQString("%1(%2.%3) > 0 OR ") .arg( functionName( funcAvg ), tableName(tabStats), valueName(valRating) ); - m_having += QString("%1(%2.%3) > 0") + m_having += TQString("%1(%2.%3) > 0") .arg( functionName( funcAvg ), tableName(tabStats), valueName(valPlayCounter) ); m_having += ")"; } @@ -7874,12 +7874,12 @@ QueryBuilder::tableName( int table ) "labels" }; - int oneBit = searchBit( table, sizeof( tabNames ) / sizeof( QString ) ); + int oneBit = searchBit( table, sizeof( tabNames ) / sizeof( TQString ) ); if ( oneBit >= 0 ) return tabNames[oneBit]; // slow path: multiple tables. This seems to be unneeded at the moment, // but leaving it here since it appears to be intended usage - QString tables; + TQString tables; if ( CollectionDB::instance()->getType() != DbConnection::postgresql ) { @@ -7907,10 +7907,10 @@ QueryBuilder::tableName( int table ) } -const QString & +const TQString & QueryBuilder::valueName( Q_INT64 value ) { - static const QString values[] = { + static const TQString values[] = { "id", "name", "url", @@ -7954,17 +7954,17 @@ QueryBuilder::valueName( Q_INT64 value ) "type" }; - int oneBit = searchBit( value, sizeof( values ) / sizeof( QString ) ); + int oneBit = searchBit( value, sizeof( values ) / sizeof( TQString ) ); if ( oneBit >= 0 ) return values[oneBit]; - static const QString error( "" ); + static const TQString error( "" ); return error; } /* * Return true if we should call COALESCE(..,0) for this DB field * (field names sourced from the old smartplaylistbrowser.cpp code) - * Warning: addFilter( int, Q_INT64, const QString&, int bool ) + * Warning: addFilter( int, Q_INT64, const TQString&, int bool ) * expects this method to return true for all statistics table clomuns of type INTEGER * Sqlite doesn't like comparing strings to an INTEGER column. */ @@ -7986,7 +7986,7 @@ QueryBuilder::coalesceField( int table, Q_INT64 value ) QString QueryBuilder::functionName( int function ) { - QString functions; + TQString functions; if ( function & funcCount ) functions += "Count"; if ( function & funcMax ) functions += "Max"; @@ -8000,7 +8000,7 @@ QueryBuilder::functionName( int function ) // FIXME: the two functions below are inefficient, but this patch is getting too // big already. They are not on any critical path right now. Ovy int -QueryBuilder::getTableByName(const QString &name) +QueryBuilder::getTableByName(const TQString &name) { for ( int i = 1; i <= tabLabels; i <<= 1 ) { @@ -8010,7 +8010,7 @@ QueryBuilder::getTableByName(const QString &name) } Q_INT64 -QueryBuilder::getValueByName(const QString &name) +QueryBuilder::getValueByName(const TQString &name) { for ( Q_INT64 i = 1; i <= valType; i <<= 1 ) { if (valueName(i) == name) return i; @@ -8020,7 +8020,7 @@ QueryBuilder::getValueByName(const QString &name) } bool -QueryBuilder::getField(const QString &tableValue, int *table, Q_INT64 *value) +QueryBuilder::getField(const TQString &tableValue, int *table, Q_INT64 *value) { int dotIndex = tableValue.find( '.' ) ; if ( dotIndex < 0 ) return false; @@ -8041,22 +8041,22 @@ QueryBuilder::getField(const QString &tableValue, int *table, Q_INT64 *value) QStringList -QueryBuilder::cleanURL( QStringList result ) +QueryBuilder::cleanURL( TQStringList result ) { //this method replaces the fields for relative path and devive/media id with a //single field containing the absolute path for each row //TODO Max improve this code int count = 1; - for( QStringList::Iterator it = result.begin(), end = result.end(); it != end; ) + for( TQStringList::Iterator it = result.begin(), end = result.end(); it != end; ) { - QString rpath; + TQString rpath; if ( (count % (m_returnValues + 1)) + 1== m_deviceidPos ) { //this block is reached when the iterator points at the relative path //deviceid is next - QString rpath = *it; + TQString rpath = *it; int deviceid = (*(++it)).toInt(); - QString abspath = MountPointManager::instance()->getAbsolutePath( deviceid, rpath ); + TQString abspath = MountPointManager::instance()->getAbsolutePath( deviceid, rpath ); it = result.remove(--it); result.insert( it, abspath ); it = result.remove( it ); diff --git a/amarok/src/collectiondb.h b/amarok/src/collectiondb.h index a86fd2fa..816c8eca 100644 --- a/amarok/src/collectiondb.h +++ b/amarok/src/collectiondb.h @@ -18,17 +18,17 @@ #include "amarok_export.h" #include -#include //stack allocated -#include -#include -#include -#include //baseclass -#include //baseclass -#include //stack allocated -#include //stack allocated -#include -#include -#include +#include //stack allocated +#include +#include +#include +#include //baseclass +#include //baseclass +#include //stack allocated +#include //stack allocated +#include +#include +#include namespace KIO { class Job; } @@ -38,7 +38,7 @@ class MetaBundle; class OrganizeCollectionDialog; class PodcastChannelBundle; class PodcastEpisodeBundle; -class QListViewItem; +class TQListViewItem; class Scrobbler; class DbConfig @@ -48,12 +48,12 @@ class DbConfig class SqliteConfig : public DbConfig { public: - SqliteConfig( const QString& /* dbfile */ ); + SqliteConfig( const TQString& /* dbfile */ ); - QString dbFile() const { return m_dbfile; } + TQString dbFile() const { return m_dbfile; } private: - QString m_dbfile; + TQString m_dbfile; }; @@ -61,24 +61,24 @@ class MySqlConfig : public DbConfig { public: MySqlConfig( - const QString& /* host */, + const TQString& /* host */, const int /* port */, - const QString& /* database */, - const QString& /* username */, - const QString& /* password */); + const TQString& /* database */, + const TQString& /* username */, + const TQString& /* password */); - QString host() const { return m_host; } + TQString host() const { return m_host; } int port() const { return m_port; } - QString database() const { return m_database; } - QString username() const { return m_username; } - QString password() const { return m_password; } + TQString database() const { return m_database; } + TQString username() const { return m_username; } + TQString password() const { return m_password; } private: - QString m_host; + TQString m_host; int m_port; - QString m_database; - QString m_username; - QString m_password; + TQString m_database; + TQString m_username; + TQString m_password; }; @@ -86,24 +86,24 @@ class PostgresqlConfig : public DbConfig { public: PostgresqlConfig( - const QString& /* host */, + const TQString& /* host */, const int /* port */, - const QString& /* database */, - const QString& /* username */, - const QString& /* password */); + const TQString& /* database */, + const TQString& /* username */, + const TQString& /* password */); - QString host() const { return m_host; } + TQString host() const { return m_host; } int port() const { return m_port; } - QString database() const { return m_database; } - QString username() const { return m_username; } - QString password() const { return m_password; } + TQString database() const { return m_database; } + TQString username() const { return m_username; } + TQString password() const { return m_password; } private: - QString m_host; + TQString m_host; int m_port; - QString m_database; - QString m_username; - QString m_password; + TQString m_database; + TQString m_username; + TQString m_password; }; @@ -115,11 +115,11 @@ class DbConnection DbConnection(); virtual ~DbConnection() {} - virtual QStringList query( const QString& /* statement */, bool suppressDebug ) = 0; - virtual int insert( const QString& /* statement */, const QString& /* table */ ) = 0; + virtual TQStringList query( const TQString& /* statement */, bool suppressDebug ) = 0; + virtual int insert( const TQString& /* statement */, const TQString& /* table */ ) = 0; bool isInitialized() const { return m_initialized; } virtual bool isConnected() const = 0; - virtual QString lastError() const { return "None"; } + virtual TQString lastError() const { return "None"; } protected: bool m_initialized; @@ -136,8 +136,8 @@ class SqliteConnection : public DbConnection SqliteConnection( const SqliteConfig* /* config */ ); ~SqliteConnection(); - QStringList query( const QString& /* statement */, bool suppressDebug = false ); - int insert( const QString& /* statement */, const QString& /* table */ ); + TQStringList query( const TQString& /* statement */, bool suppressDebug = false ); + int insert( const TQString& /* statement */, const TQString& /* table */ ); bool isConnected()const { return true; } private: static void sqlite_rand( sqlite3_context *context, int /*argc*/, sqlite3_value ** /*argv*/ ); @@ -157,15 +157,15 @@ class MySqlConnection : public DbConnection MySqlConnection( const MySqlConfig* /* config */ ); ~MySqlConnection(); - QStringList query( const QString& /* statement */, bool suppressDebug = false ); - int insert( const QString& /* statement */, const QString& /* table */ ); + TQStringList query( const TQString& /* statement */, bool suppressDebug = false ); + int insert( const TQString& /* statement */, const TQString& /* table */ ); bool isConnected()const { return m_connected; } - QString lastError() const { return m_error; } + TQString lastError() const { return m_error; } private: void setMysqlError(); MYSQL* m_db; bool m_connected; - QString m_error; + TQString m_error; }; #endif @@ -179,20 +179,20 @@ class PostgresqlConnection : public DbConnection PostgresqlConnection( const PostgresqlConfig* /* config */ ); ~PostgresqlConnection(); - QStringList query( const QString& /* statement */, bool suppressDebug = false ); - int insert( const QString& /* statement */, const QString& /* table */ ); + TQStringList query( const TQString& /* statement */, bool suppressDebug = false ); + int insert( const TQString& /* statement */, const TQString& /* table */ ); bool isConnected()const { return m_connected; } - QString lastError() const { return m_error; } + TQString lastError() const { return m_error; } private: void setPostgresqlError(); PGconn* m_db; bool m_connected; - QString m_error; + TQString m_error; }; #endif -class LIBAMAROK_EXPORT CollectionDB : public QObject, public EngineObserver +class LIBAMAROK_EXPORT CollectionDB : public TQObject, public EngineObserver { Q_OBJECT @@ -205,26 +205,26 @@ class LIBAMAROK_EXPORT CollectionDB : public QObject, public EngineObserver void databaseUpdateDone(); - void scoreChanged( const QString &url, float score ); - void ratingChanged( const QString &url, int rating ); - void labelsChanged( const QString &url ); - void fileMoved( const QString &srcUrl, const QString &dstUrl ); - void fileMoved( const QString &srcUrl, const QString &dstUrl, const QString &uniqueid ); - void fileDeleted( const QString &absPath ); - void fileDeleted( const QString &absPath, const QString &uniqueid ); - void fileAdded( const QString &absPath ); - void fileAdded( const QString &absPath, const QString &uniqueid ); - void filesAdded( const QMap &map ); - void uniqueIdChanged( const QString &url, const QString &originalid, const QString &newid ); - void coverChanged( const QString &artist, const QString &album ); //whenever a cover changes - void coverFetched( const QString &artist, const QString &album ); //only when fetching from amazon - void coverRemoved( const QString &artist, const QString &album ); - void coverFetcherError( const QString &error ); - - void similarArtistsFetched( const QString &artist ); + void scoreChanged( const TQString &url, float score ); + void ratingChanged( const TQString &url, int rating ); + void labelsChanged( const TQString &url ); + void fileMoved( const TQString &srcUrl, const TQString &dstUrl ); + void fileMoved( const TQString &srcUrl, const TQString &dstUrl, const TQString &uniqueid ); + void fileDeleted( const TQString &absPath ); + void fileDeleted( const TQString &absPath, const TQString &uniqueid ); + void fileAdded( const TQString &absPath ); + void fileAdded( const TQString &absPath, const TQString &uniqueid ); + void filesAdded( const TQMap &map ); + void uniqueIdChanged( const TQString &url, const TQString &originalid, const TQString &newid ); + void coverChanged( const TQString &artist, const TQString &album ); //whenever a cover changes + void coverFetched( const TQString &artist, const TQString &album ); //only when fetching from amazon + void coverRemoved( const TQString &artist, const TQString &album ); + void coverFetcherError( const TQString &error ); + + void similarArtistsFetched( const TQString &artist ); void tagsChanged( const MetaBundle &bundle ); - void tagsChanged( const QString &oldArtist, const QString &oldAlbum ); - void imageFetched( const QString &remoteURL ); //for fetching remote podcast images + void tagsChanged( const TQString &oldArtist, const TQString &oldAlbum ); + void imageFetched( const TQString &remoteURL ); //for fetching remote podcast images public: CollectionDB(); @@ -240,7 +240,7 @@ class LIBAMAROK_EXPORT CollectionDB : public QObject, public EngineObserver enum labelTypes { typeUser = 1 }; //add new types add the end! - QString escapeString(QString string ) const + TQString escapeString(TQString string ) const { return #ifdef USE_MYSQL @@ -251,36 +251,36 @@ class LIBAMAROK_EXPORT CollectionDB : public QObject, public EngineObserver string.replace( '\'', "''" ); } - QString boolT() const { if (getDbConnectionType() == DbConnection::postgresql) return "true"; else return "1"; } - QString boolF() const { if (getDbConnectionType() == DbConnection::postgresql) return "false"; else return "0"; } - inline bool boolFromSql( const QString &b ) { return ( b == boolT() || b == "t" ); } + TQString boolT() const { if (getDbConnectionType() == DbConnection::postgresql) return "true"; else return "1"; } + TQString boolF() const { if (getDbConnectionType() == DbConnection::postgresql) return "false"; else return "0"; } + inline bool boolFromSql( const TQString &b ) { return ( b == boolT() || b == "t" ); } //textColumnType should be used for normal strings, which need to be compared //either case-sensitively or -insensitively - QString textColumnType( int length=255 ) const { if ( getDbConnectionType() == DbConnection::postgresql ) return "TEXT"; else return QString("VARCHAR(%1)").arg(length); } + TQString textColumnType( int length=255 ) const { if ( getDbConnectionType() == DbConnection::postgresql ) return "TEXT"; else return TQString("VARCHAR(%1)").arg(length); } //exactTextColumnType should be used for strings that must be stored exactly, such //as URLs (necessary for holding control chars etc. if present in URL), except for //trailing spaces. Comparisions should always be done case-sensitively. //As we create indices on these columns, we have to restrict them to //<= 255 chars for mysql < 5.0.3 - QString exactTextColumnType( int length=1024 ) const { if ( getDbConnectionType() == DbConnection::mysql ) return QString( "VARBINARY(%1)" ).arg( length>255 ? 255 : length ); else return textColumnType( length ); } + TQString exactTextColumnType( int length=1024 ) const { if ( getDbConnectionType() == DbConnection::mysql ) return TQString( "VARBINARY(%1)" ).arg( length>255 ? 255 : length ); else return textColumnType( length ); } // We might consider using LONGTEXT type, as some lyrics could be VERY long..??? - QString longTextColumnType() const { if ( getDbConnectionType() == DbConnection::postgresql ) return "TEXT"; else return "TEXT"; } - QString randomFunc() const { if ( getDbConnectionType() == DbConnection::postgresql ) return "random()"; else return "RAND()"; } + TQString longTextColumnType() const { if ( getDbConnectionType() == DbConnection::postgresql ) return "TEXT"; else return "TEXT"; } + TQString randomFunc() const { if ( getDbConnectionType() == DbConnection::postgresql ) return "random()"; else return "RAND()"; } - inline static QString exactCondition( const QString &right ); - static QString likeCondition( const QString &right, bool anyBegin=false, bool anyEnd=false ); + inline static TQString exactCondition( const TQString &right ); + static TQString likeCondition( const TQString &right, bool anyBegin=false, bool anyEnd=false ); int getType() { return getDbConnectionType(); } //sql helper methods - QStringList query( const QString& statement, bool suppressDebug = false ); - int insert( const QString& statement, const QString& table ); + TQStringList query( const TQString& statement, bool suppressDebug = false ); + int insert( const TQString& statement, const TQString& table ); /** * TODO: write doc * @param showAll * @return a string which can be appended to an existing sql where statement */ - QString deviceidSelection( const bool showAll = false ); + TQString deviceidSelection( const bool showAll = false ); /** * converts the result of a query which contains a deviceid and a relative path @@ -289,18 +289,18 @@ class LIBAMAROK_EXPORT CollectionDB : public QObject, public EngineObserver * @param result the result of the sql query, deviceid first, relative path second * @return a list of urls */ - QStringList URLsFromQuery( const QStringList &result ) const; + TQStringList URLsFromQuery( const TQStringList &result ) const; /** * converts the result list of a amarok-sql query to a list of urls */ - KURL::List URLsFromSqlDrag( const QStringList &values ) const; + KURL::List URLsFromSqlDrag( const TQStringList &values ) const; //table management methods bool isEmpty(); bool isValid(); - QString adminValue( QString noption ); - void setAdminValue( QString noption, QString value ); + TQString adminValue( TQString noption ); + void setAdminValue( TQString noption, TQString value ); void createTables( const bool temporary = false ); void createIndices( ); void createPermanentIndices(); @@ -309,33 +309,33 @@ class LIBAMAROK_EXPORT CollectionDB : public QObject, public EngineObserver void copyTempTables( ); void prepareTempTables(); - uint artistID( QString value, bool autocreate = true, const bool temporary = false, bool exact = true ); - uint composerID( QString value, bool autocreate = true, const bool temporary = false, bool exact = true ); - uint albumID( QString value, bool autocreate = true, const bool temporary = false, bool exact = true ); - uint genreID( QString value, bool autocreate = true, const bool temporary = false, bool exact = true ); - uint yearID( QString value, bool autocreate = true, const bool temporary = false, bool exact = true ); - - bool isDirInCollection( QString path ); - bool isFileInCollection( const QString &url ); - QString getURL( const MetaBundle &bundle ); - void removeDirFromCollection( QString path ); - void removeSongsInDir( QString path, QMap *tagsRemoved = 0 ); + uint artistID( TQString value, bool autocreate = true, const bool temporary = false, bool exact = true ); + uint composerID( TQString value, bool autocreate = true, const bool temporary = false, bool exact = true ); + uint albumID( TQString value, bool autocreate = true, const bool temporary = false, bool exact = true ); + uint genreID( TQString value, bool autocreate = true, const bool temporary = false, bool exact = true ); + uint yearID( TQString value, bool autocreate = true, const bool temporary = false, bool exact = true ); + + bool isDirInCollection( TQString path ); + bool isFileInCollection( const TQString &url ); + TQString getURL( const MetaBundle &bundle ); + void removeDirFromCollection( TQString path ); + void removeSongsInDir( TQString path, TQMap *tagsRemoved = 0 ); void removeSongs( const KURL::List& urls ); - void updateDirStats( QString path, const long datetime, const bool temporary = false ); + void updateDirStats( TQString path, const long datetime, const bool temporary = false ); //song methods bool addSong( MetaBundle* bundle, const bool incremental = false ); - void aftCheckPermanentTables( const QString &currdeviceid, const QString &currid, const QString &currurl ); + void aftCheckPermanentTables( const TQString &currdeviceid, const TQString &currid, const TQString &currurl ); void doAFTStuff( MetaBundle *bundle, const bool tempTables = true ); - void emitFileAdded( const QString &absPath, - const QString &uniqueid = QString::null ); - void emitFilesAdded( const QMap &map ) { emit filesAdded( map ); } - void emitFileDeleted( const QString &absPath, - const QString &uniqueid = QString::null ); - bool newUniqueIdForFile( const QString &path ); - bool removeUniqueIdFromFile( const QString &path ); - QString urlFromUniqueId( const QString &id ); - QString uniqueIdFromUrl( const KURL &url ); + void emitFileAdded( const TQString &absPath, + const TQString &uniqueid = TQString::null ); + void emitFilesAdded( const TQMap &map ) { emit filesAdded( map ); } + void emitFileDeleted( const TQString &absPath, + const TQString &uniqueid = TQString::null ); + bool newUniqueIdForFile( const TQString &path ); + bool removeUniqueIdFromFile( const TQString &path ); + TQString urlFromUniqueId( const TQString &id ); + TQString uniqueIdFromUrl( const KURL &url ); //podcast methods /// Insert a podcast channel into the database. If @param replace is true, replace the row @@ -344,106 +344,106 @@ class LIBAMAROK_EXPORT CollectionDB : public QObject, public EngineObserver /// Insert a podcast episode into the database. If @param idToUpdate is provided, replace the row /// use updatePodcastEpisode() always in preference int addPodcastEpisode( const PodcastEpisodeBundle &episode, const int idToUpdate=0 ); - int addPodcastFolder( const QString &name, const int parent_id=0, const bool isOpen=false ); - QValueList getPodcastChannels(); + int addPodcastFolder( const TQString &name, const int parent_id=0, const bool isOpen=false ); + TQValueList getPodcastChannels(); PodcastEpisodeBundle getPodcastEpisodeById( int id ); - QValueList getPodcastEpisodes( const KURL &parent, bool newOnly=false, int limit=-1 ); + TQValueList getPodcastEpisodes( const KURL &parent, bool newOnly=false, int limit=-1 ); void removePodcastChannel( const KURL &url ); // will remove all episodes too void removePodcastEpisode( const int id ); void removePodcastFolder( const int id ); void updatePodcastChannel( const PodcastChannelBundle &b ); void updatePodcastEpisode( const int id, const PodcastEpisodeBundle &b ); - void updatePodcastFolder( const int folder_id, const QString &name, const int parent_id=0, const bool isOpen=false ); + void updatePodcastFolder( const int folder_id, const TQString &name, const int parent_id=0, const bool isOpen=false ); // these return false when no bundle was available bool getPodcastChannelBundle( const KURL &url, PodcastChannelBundle *channel ); bool getPodcastEpisodeBundle( const KURL &url, PodcastEpisodeBundle *channel ); - MetaBundle bundleFromQuery( QStringList::const_iterator *iter ); + MetaBundle bundleFromQuery( TQStringList::const_iterator *iter ); /** * The @p bundle parameter's url() will be looked up in the Collection * @param bundle this will be filled in with tags for you * @return true if in the collection */ bool bundleForUrl( MetaBundle* bundle ); - QValueList bundlesByUrls( const KURL::List& urls ); + TQValueList bundlesByUrls( const KURL::List& urls ); void addAudioproperties( const MetaBundle& bundle ); //Helper function for updateTags - void deleteRedundantName( const QString &table, const QString &id ); + void deleteRedundantName( const TQString &table, const TQString &id ); - void deleteAllRedundant( const QString &table ); + void deleteAllRedundant( const TQString &table ); - void updateTags( const QString &url, const MetaBundle &bundle, const bool updateView = true); - void updateURL( const QString &url, const bool updateView = true ); - QString getUniqueId( const QString &url ); + void updateTags( const TQString &url, const MetaBundle &bundle, const bool updateView = true); + void updateURL( const TQString &url, const bool updateView = true ); + TQString getUniqueId( const TQString &url ); //statistics methods - void addSongPercentage( const QString &url, float percentage, - const QString &reason, const QDateTime *playtime = 0 ); - float getSongPercentage( const QString &url ); - int getSongRating( const QString &url ); - void setSongPercentage( const QString &url, float percentage ); - void setSongRating( const QString &url, int percentage, bool toggleHalf = false ); - int getPlayCount( const QString &url ); - QDateTime getFirstPlay( const QString &url ); - QDateTime getLastPlay( const QString &url ); - void migrateFile( const QString &oldURL, const QString &newURL ); - bool moveFile( const QString &src, const QString &dest, bool overwrite, bool copy = false ); + void addSongPercentage( const TQString &url, float percentage, + const TQString &reason, const TQDateTime *playtime = 0 ); + float getSongPercentage( const TQString &url ); + int getSongRating( const TQString &url ); + void setSongPercentage( const TQString &url, float percentage ); + void setSongRating( const TQString &url, int percentage, bool toggleHalf = false ); + int getPlayCount( const TQString &url ); + TQDateTime getFirstPlay( const TQString &url ); + TQDateTime getLastPlay( const TQString &url ); + void migrateFile( const TQString &oldURL, const TQString &newURL ); + bool moveFile( const TQString &src, const TQString &dest, bool overwrite, bool copy = false ); bool organizeFile( const KURL &src, const OrganizeCollectionDialog &dialog, bool copy ); //artist methods - QStringList similarArtists( const QString &artist, uint count ); + TQStringList similarArtists( const TQString &artist, uint count ); //album methods - void checkCompilations( const QString &path, const bool temporary = false ); + void checkCompilations( const TQString &path, const bool temporary = false ); void setCompilation( const KURL::List &urls, bool enabled, bool updateView ); - QString albumSongCount( const QString &artist_id, const QString &album_id ); - bool albumIsCompilation( const QString &album_id ); + TQString albumSongCount( const TQString &artist_id, const TQString &album_id ); + bool albumIsCompilation( const TQString &album_id ); void sanitizeCompilations(); //label methods - QStringList getLabels( const QString &url, const uint type ); - void removeLabels( const QString &url, const QStringList &labels, const uint type ); - bool addLabel( const QString &url, const QString &label, const QString &uid, const uint type ); - void setLabels( const QString &url, const QStringList &labels, const QString &uid, const uint type ); + TQStringList getLabels( const TQString &url, const uint type ); + void removeLabels( const TQString &url, const TQStringList &labels, const uint type ); + bool addLabel( const TQString &url, const TQString &label, const TQString &uid, const uint type ); + void setLabels( const TQString &url, const TQStringList &labels, const TQString &uid, const uint type ); void cleanLabels(); - QStringList favoriteLabels( int type = CollectionDB::typeUser, int count = 10 ); + TQStringList favoriteLabels( int type = CollectionDB::typeUser, int count = 10 ); //list methods - QStringList artistList( bool withUnknowns = true, bool withCompilations = true ); - QStringList composerList( bool withUnknowns = true, bool withCompilations = true ); - QStringList albumList( bool withUnknowns = true, bool withCompilations = true ); - QStringList genreList( bool withUnknowns = true, bool withCompilations = true ); - QStringList yearList( bool withUnknowns = true, bool withCompilations = true ); - QStringList labelList(); + TQStringList artistList( bool withUnknowns = true, bool withCompilations = true ); + TQStringList composerList( bool withUnknowns = true, bool withCompilations = true ); + TQStringList albumList( bool withUnknowns = true, bool withCompilations = true ); + TQStringList genreList( bool withUnknowns = true, bool withCompilations = true ); + TQStringList yearList( bool withUnknowns = true, bool withCompilations = true ); + TQStringList labelList(); - QStringList albumListOfArtist( const QString &artist, bool withUnknown = true, bool withCompilations = true ); - QStringList artistAlbumList( bool withUnknown = true, bool withCompilations = true ); + TQStringList albumListOfArtist( const TQString &artist, bool withUnknown = true, bool withCompilations = true ); + TQStringList artistAlbumList( bool withUnknown = true, bool withCompilations = true ); - QStringList albumTracks( const QString &artist_id, const QString &album_id ); - QStringList albumDiscTracks( const QString &artist_id, const QString &album_id, const QString &discNumber ); - QStringList artistTracks( const QString &artist_id ); + TQStringList albumTracks( const TQString &artist_id, const TQString &album_id ); + TQStringList albumDiscTracks( const TQString &artist_id, const TQString &album_id, const TQString &discNumber ); + TQStringList artistTracks( const TQString &artist_id ); //cover management methods /** Returns the image from a given URL, network-transparently. * You must run KIO::NetAccess::removeTempFile( tmpFile ) when you are finished using the image; **/ - static QImage fetchImage( const KURL& url, QString &tmpFile ); + static TQImage fetchImage( const KURL& url, TQString &tmpFile ); /** Saves images located on the user's filesystem */ - bool setAlbumImage( const QString& artist, const QString& album, const KURL& url ); + bool setAlbumImage( const TQString& artist, const TQString& album, const KURL& url ); /** Saves images obtained from CoverFetcher */ - bool setAlbumImage( const QString& artist, const QString& album, QImage img, const QString& amazonUrl = QString::null, const QString& asin = QString::null ); + bool setAlbumImage( const TQString& artist, const TQString& album, TQImage img, const TQString& amazonUrl = TQString::null, const TQString& asin = TQString::null ); - QString findAmazonImage( const QString &artist, const QString &album, const uint width = 1 ); - QString findDirectoryImage( const QString& artist, const QString& album, uint width = 0 ); - QString findEmbeddedImage( const QString& artist, const QString& album, uint width = 1 ); - QString findMetaBundleImage( const MetaBundle &trackInformation, const uint = 1 ); + TQString findAmazonImage( const TQString &artist, const TQString &album, const uint width = 1 ); + TQString findDirectoryImage( const TQString& artist, const TQString& album, uint width = 0 ); + TQString findEmbeddedImage( const TQString& artist, const TQString& album, uint width = 1 ); + TQString findMetaBundleImage( const MetaBundle &trackInformation, const uint = 1 ); /// ensure the sql only return urls to tracks for efficiency - static QPixmap createDragPixmapFromSQL( const QString &sql, QString textOverRide=QString::null ); - static QPixmap createDragPixmap( const KURL::List &urls, QString textOverRide=QString::null ); + static TQPixmap createDragPixmapFromSQL( const TQString &sql, TQString textOverRide=TQString::null ); + static TQPixmap createDragPixmap( const KURL::List &urls, TQString textOverRide=TQString::null ); static const int DRAGPIXMAP_OFFSET_X = -12; static const int DRAGPIXMAP_OFFSET_Y = -28; @@ -452,46 +452,46 @@ class LIBAMAROK_EXPORT CollectionDB : public QObject, public EngineObserver * initiates fetching of the remote image if necessary. * @param width the size of the image. 0 == full size, 1 == preview size */ - QString podcastImage( const MetaBundle &bundle, const bool withShadow = false, uint width = 1 ); - QString podcastImage( const QString &remoteURL, const bool withShadow = false, uint width = 1 ); + TQString podcastImage( const MetaBundle &bundle, const bool withShadow = false, uint width = 1 ); + TQString podcastImage( const TQString &remoteURL, const bool withShadow = false, uint width = 1 ); /** * Retrieves the path to the image for the album of the requested item * @param width the size of the image. 0 == full size, 1 == preview size * @param embedded if not NULL, sets a bool indicating whether the path is an embedded image */ - QString albumImage( const MetaBundle &trackInformation, const bool withShadow = false, uint width = 1, bool* embedded = 0 ); - QString albumImage( const uint artist_id, const uint album_id, const bool withShadow = false, uint width = 1, bool* embedded = 0 ); - QString albumImage( const QString &artist, const QString &album, const bool withShadow = false, uint width = 1, bool* embedded = 0 ); - QMap * getItemCoverMap() { return itemCoverMap; } - QMutex * getItemCoverMapMutex() { return itemCoverMapMutex; } + TQString albumImage( const MetaBundle &trackInformation, const bool withShadow = false, uint width = 1, bool* embedded = 0 ); + TQString albumImage( const uint artist_id, const uint album_id, const bool withShadow = false, uint width = 1, bool* embedded = 0 ); + TQString albumImage( const TQString &artist, const TQString &album, const bool withShadow = false, uint width = 1, bool* embedded = 0 ); + TQMap * getItemCoverMap() { return itemCoverMap; } + TQMutex * getItemCoverMapMutex() { return itemCoverMapMutex; } bool removeAlbumImage( const uint artist_id, const uint album_id ); - bool removeAlbumImage( const QString &artist, const QString &album ); + bool removeAlbumImage( const TQString &artist, const TQString &album ); - static QString makeShadowedImage( const QString& albumImage, bool cache = true ); + static TQString makeShadowedImage( const TQString& albumImage, bool cache = true ); //local cover methods - void addImageToAlbum( const QString& image, QValueList< QPair > info, const bool temporary ); - QString notAvailCover( const bool withShadow = false, int width = 1 ); + void addImageToAlbum( const TQString& image, TQValueList< QPair > info, const bool temporary ); + TQString notAvailCover( const bool withShadow = false, int width = 1 ); //embedded cover methods - void addEmbeddedImage( const QString& path, const QString& hash, const QString& description ); + void addEmbeddedImage( const TQString& path, const TQString& hash, const TQString& description ); void removeOrphanedEmbeddedImages(); void applySettings(); - void setLyrics( const QString& url, const QString& lyrics, const QString &uniqueid = QString::null ); - QString getLyrics( const QString& url ); + void setLyrics( const TQString& url, const TQString& lyrics, const TQString &uniqueid = TQString::null ); + TQString getLyrics( const TQString& url ); /** Remove from the amazon table the item with the specified md5sum **/ - void removeInvalidAmazonInfo( const QString& md5sum ); - void newAmazonReloadDate( const QString& asin, const QString& locale, const QString& md5sum ); - QStringList staleImages(); + void removeInvalidAmazonInfo( const TQString& md5sum ); + void newAmazonReloadDate( const TQString& asin, const TQString& locale, const TQString& md5sum ); + TQStringList staleImages(); DbConnection::DbConnectionType getDbConnectionType() const { return m_dbConnType; } bool isConnected(); - void releasePreviousConnection(QThread *currThread); + void releasePreviousConnection(TQThread *currThread); void invalidateArtistAlbumCache() { m_validArtistCache=false; m_validComposerCache=false; m_validAlbumCache=false; }; @@ -503,13 +503,13 @@ class LIBAMAROK_EXPORT CollectionDB : public QObject, public EngineObserver void cancelMovingFileJob(); protected: - QCString md5sum( const QString& artist, const QString& album, const QString& file = QString::null ); - void engineTrackEnded( int finalPosition, int trackLength, const QString &reason ); + TQCString md5sum( const TQString& artist, const TQString& album, const TQString& file = TQString::null ); + void engineTrackEnded( int finalPosition, int trackLength, const TQString &reason ); /** Manages regular folder monitoring scan */ - void timerEvent( QTimerEvent* e ); + void timerEvent( TQTimerEvent* e ); public slots: - void fetchCover( QWidget* parent, const QString& artist, const QString& album, bool noedit, QListViewItem* item = 0 ); + void fetchCover( TQWidget* parent, const TQString& artist, const TQString& album, bool noedit, TQListViewItem* item = 0 ); void scanMonitor(); void startScan(); void stopScan(); @@ -519,13 +519,13 @@ class LIBAMAROK_EXPORT CollectionDB : public QObject, public EngineObserver void checkDatabase(); private slots: - void dirDirty( const QString& path ); + void dirDirty( const TQString& path ); void coverFetcherResult( CoverFetcher* ); - void similarArtistsFetched( const QString& artist, const QStringList& suggestions ); + void similarArtistsFetched( const TQString& artist, const TQStringList& suggestions ); void fileOperationResult( KIO::Job *job ); // moveFile depends on it void podcastImageResult( KIO::Job *job ); //for fetching remote podcast images - void aftMigratePermanentTablesUrl( const QString& oldUrl, const QString& newUrl, const QString& uniqueid ); //AFT-enable stats - void aftMigratePermanentTablesUniqueId( const QString& url, const QString& oldid, const QString& newid ); + void aftMigratePermanentTablesUrl( const TQString& oldUrl, const TQString& newUrl, const TQString& uniqueid ); //AFT-enable stats + void aftMigratePermanentTablesUniqueId( const TQString& url, const TQString& oldid, const TQString& newid ); private: //bump DATABASE_VERSION whenever changes to the table structure are made. @@ -544,9 +544,9 @@ class LIBAMAROK_EXPORT CollectionDB : public QObject, public EngineObserver static const int MONITOR_INTERVAL = 60; //sec - static QDir largeCoverDir(); - static QDir tagCoverDir(); - static QDir cacheCoverDir(); + static TQDir largeCoverDir(); + static TQDir tagCoverDir(); + static TQDir cacheCoverDir(); void initialize(); void destroy(); @@ -561,11 +561,11 @@ class LIBAMAROK_EXPORT CollectionDB : public QObject, public EngineObserver //of Composer table void updateGroupBy(); - void customEvent( QCustomEvent * ); + void customEvent( TQCustomEvent * ); // helpers for embedded images - QString loadHashFile( const QCString& hash, uint width ); - bool extractEmbeddedImage( const MetaBundle &trackInformation, QCString& hash ); + TQString loadHashFile( const TQCString& hash, uint width ); + bool extractEmbeddedImage( const MetaBundle &trackInformation, TQCString& hash ); //general management methods void createStatsTable(); @@ -589,41 +589,41 @@ class LIBAMAROK_EXPORT CollectionDB : public QObject, public EngineObserver void dropPodcastTablesV2(); - QCString makeWidthKey( uint width ); - QString artistValue( uint id ); - QString composerValue( uint id ); - QString albumValue( uint id ); - QString genreValue( uint id ); - QString yearValue( uint id ); + TQCString makeWidthKey( uint width ); + TQString artistValue( uint id ); + TQString composerValue( uint id ); + TQString albumValue( uint id ); + TQString genreValue( uint id ); + TQString yearValue( uint id ); //These should be avoided as they will be slow and potentially unsafe. //Use the Exact version where possible (faster and safer). - //To convert output from Exact version from QString to uint, use .toUInt() - uint IDFromValue( QString name, QString value, bool autocreate = true, const bool temporary = false ); - QString IDFromExactValue( QString table, QString value, bool autocreate = true, bool temporary = false ); - QString valueFromID( QString table, uint id ); + //To convert output from Exact version from TQString to uint, use .toUInt() + uint IDFromValue( TQString name, TQString value, bool autocreate = true, const bool temporary = false ); + TQString IDFromExactValue( TQString table, TQString value, bool autocreate = true, bool temporary = false ); + TQString valueFromID( TQString table, uint id ); //member variables - QString m_amazonLicense; + TQString m_amazonLicense; bool m_validArtistCache; bool m_validComposerCache; bool m_validAlbumCache; - QString m_cacheArtist[2]; + TQString m_cacheArtist[2]; uint m_cacheArtistID[2]; - QString m_cacheComposer[2]; + TQString m_cacheComposer[2]; uint m_cacheComposerID[2]; - QString m_cacheAlbum[2]; + TQString m_cacheAlbum[2]; uint m_cacheAlbumID[2]; bool m_monitor; bool m_autoScoring; - static QMap *itemCoverMap; - static QMutex *itemCoverMapMutex; - QImage m_noCover, m_shadowImage; + static TQMap *itemCoverMap; + static TQMutex *itemCoverMapMutex; + TQImage m_noCover, m_shadowImage; - static QMap *threadConnections; - static QMutex *connectionMutex; + static TQMap *threadConnections; + static TQMutex *connectionMutex; DbConnection::DbConnectionType m_dbConnType; DbConfig *m_dbConfig; @@ -633,16 +633,16 @@ class LIBAMAROK_EXPORT CollectionDB : public QObject, public EngineObserver bool m_scanInProgress; bool m_rescanRequired; - QStringList m_aftEnabledPersistentTables; + TQStringList m_aftEnabledPersistentTables; // Cancel move/copy job bool m_moveFileJobCancelled; // for handling podcast image url redirects - QMap m_podcastImageJobs; + TQMap m_podcastImageJobs; // protect against multiple simultaneous queries/inserts - QMutex m_mutex; + TQMutex m_mutex; }; class INotify : public ThreadManager::DependentJob @@ -655,7 +655,7 @@ class INotify : public ThreadManager::DependentJob static INotify *instance() { return s_instance; } - bool watchDir( const QString directory ); + bool watchDir( const TQString directory ); int fd() { return m_fd; } private: @@ -752,30 +752,30 @@ class QueryBuilder void beginAND(); // These do the opposite; for recursive and/or void endAND(); - void setGoogleFilter( int defaultTables, QString query ); + void setGoogleFilter( int defaultTables, TQString query ); - void addURLFilters( const QStringList& filter ); + void addURLFilters( const TQStringList& filter ); - void addFilter( int tables, const QString& filter); - void addFilter( int tables, Q_INT64 value, const QString& filter, int mode = modeNormal, bool exact = false ); - void addFilters( int tables, const QStringList& filter ); - void excludeFilter( int tables, const QString& filter ); - void excludeFilter( int tables, Q_INT64 value, const QString& filter, int mode = modeNormal, bool exact = false ); + void addFilter( int tables, const TQString& filter); + void addFilter( int tables, Q_INT64 value, const TQString& filter, int mode = modeNormal, bool exact = false ); + void addFilters( int tables, const TQStringList& filter ); + void excludeFilter( int tables, const TQString& filter ); + void excludeFilter( int tables, Q_INT64 value, const TQString& filter, int mode = modeNormal, bool exact = false ); - void addMatch( int tables, const QString& match, bool interpretUnknown = true, bool caseSensitive = true ); - void addMatch( int tables, Q_INT64 value, const QString& match, bool interpretUnknown = true, bool caseSensitive = true ); - void addMatches( int tables, const QStringList& match, bool interpretUnknown = true, bool caseSensitive = true ); - void excludeMatch( int tables, const QString& match ); - void having( int table, Q_INT64 value, int function, int mode, const QString& match ); + void addMatch( int tables, const TQString& match, bool interpretUnknown = true, bool caseSensitive = true ); + void addMatch( int tables, Q_INT64 value, const TQString& match, bool interpretUnknown = true, bool caseSensitive = true ); + void addMatches( int tables, const TQStringList& match, bool interpretUnknown = true, bool caseSensitive = true ); + void excludeMatch( int tables, const TQString& match ); + void having( int table, Q_INT64 value, int function, int mode, const TQString& match ); void exclusiveFilter( int tableMatching, int tableNotMatching, Q_INT64 value ); // For numeric filters: // modeNormal means strict equality; modeBeginMatch and modeEndMatch are not // allowed; modeBetween needs a second value endRange - void addNumericFilter(int tables, Q_INT64 value, const QString &n, + void addNumericFilter(int tables, Q_INT64 value, const TQString &n, int mode = modeNormal, - const QString &endRange = QString::null); + const TQString &endRange = TQString::null); void setOptions( int options ); void sortBy( int table, Q_INT64 value, bool descending = false ); @@ -791,52 +791,52 @@ class QueryBuilder void shuffle( int table = 0, Q_INT64 value = 0 ); static const int dragFieldCount; - static QString dragSQLFields(); + static TQString dragSQLFields(); void initSQLDrag(); void buildQuery( bool withDeviceidPlaceholder = false ); - QString getQuery(); + TQString getQuery(); //use withDeviceidPlaceholder = false if the query isn't run immediately (*CurrentTimeT*) //and replace (*MountedDeviceSelection*) with CollectionDB::instance()->deviceIdSelection() - QString query( bool withDeviceidPlaceholder = false ) { buildQuery( withDeviceidPlaceholder ); return m_query; }; + TQString query( bool withDeviceidPlaceholder = false ) { buildQuery( withDeviceidPlaceholder ); return m_query; }; void clear(); - QStringList run(); + TQStringList run(); // Transform a string table.value "field" into enum values // @return true if we succeeded - bool getField(const QString &tableValue, int *table, Q_INT64 *value); + bool getField(const TQString &tableValue, int *table, Q_INT64 *value); private: - QString tableName( int table ); - const QString &valueName( Q_INT64 value ); - QString functionName( int functions ); + TQString tableName( int table ); + const TQString &valueName( Q_INT64 value ); + TQString functionName( int functions ); bool coalesceField( int table, Q_INT64 value ); - int getTableByName(const QString &name); - Q_INT64 getValueByName(const QString &field); + int getTableByName(const TQString &name); + Q_INT64 getValueByName(const TQString &field); - QStringList cleanURL( QStringList result ); + TQStringList cleanURL( TQStringList result ); void linkTables( int tables ); - QValueStack m_OR; + TQValueStack m_OR; bool m_showAll; uint m_deviceidPos; - QString ANDslashOR() const; + TQString ANDslashOR() const; - QString m_query; - QString m_values; - QString m_tables; - QString m_join; - QString m_where; - QString m_sort; - QString m_group; - QString m_limit; - QString m_having; + TQString m_query; + TQString m_values; + TQString m_tables; + TQString m_join; + TQString m_where; + TQString m_sort; + TQString m_group; + TQString m_limit; + TQString m_having; - QString m_url; //url is used as primary key and linkTables needs to do some special stuff with it + TQString m_url; //url is used as primary key and linkTables needs to do some special stuff with it int m_linkTables; uint m_returnValues; @@ -862,7 +862,7 @@ inline void QueryBuilder::endAND() m_where += " ) "; m_OR.pop(); } -inline QString QueryBuilder::ANDslashOR() const { return m_OR.top() ? "OR" : "AND"; } +inline TQString QueryBuilder::ANDslashOR() const { return m_OR.top() ? "OR" : "AND"; } #endif /* AMAROK_COLLECTIONDB_H */ diff --git a/amarok/src/collectionscanner/collectionscanner.cpp b/amarok/src/collectionscanner/collectionscanner.cpp index 50e10e48..a609eaca 100644 --- a/amarok/src/collectionscanner/collectionscanner.cpp +++ b/amarok/src/collectionscanner/collectionscanner.cpp @@ -36,16 +36,16 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include -CollectionScanner::CollectionScanner( const QStringList& folders, +CollectionScanner::CollectionScanner( const TQStringList& folders, bool recursive, bool incremental, bool importPlaylists, @@ -56,17 +56,17 @@ CollectionScanner::CollectionScanner( const QStringList& folders, , m_recursively( recursive ) , m_incremental( incremental ) , m_restart( restart ) - , m_logfile( Amarok::saveLocation( QString::null ) + "collection_scan.log" ) + , m_logfile( Amarok::saveLocation( TQString::null ) + "collection_scan.log" ) , m_pause( false ) { DcopCollectionScannerHandler* dcsh = new DcopCollectionScannerHandler(); - connect( dcsh, SIGNAL(pauseRequest()), this, SLOT(pause()) ); - connect( dcsh, SIGNAL(unpauseRequest()), this, SLOT(resume()) ); - kapp->setName( QString( "amarokcollectionscanner" ).ascii() ); + connect( dcsh, TQT_SIGNAL(pauseRequest()), this, TQT_SLOT(pause()) ); + connect( dcsh, TQT_SIGNAL(unpauseRequest()), this, TQT_SLOT(resume()) ); + kapp->setName( TQString( "amarokcollectionscanner" ).ascii() ); if( !restart ) - QFile::remove( m_logfile ); + TQFile::remove( m_logfile ); - QTimer::singleShot( 0, this, SLOT( doJob() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( doJob() ) ); } @@ -98,31 +98,31 @@ CollectionScanner::doJob() //SLOT std::cout << ""; - QStringList entries; + TQStringList entries; if( m_restart ) { - QFile logFile( m_logfile ); - QString lastFile; + TQFile logFile( m_logfile ); + TQString lastFile; if ( !logFile.open( IO_ReadOnly ) ) warning() << "Failed to open log file " << logFile.name() << " read-only" << endl; else { - QTextStream logStream; + TQTextStream logStream; logStream.setDevice(&logFile); - logStream.setEncoding(QTextStream::UnicodeUTF8); + logStream.setEncoding(TQTextStream::UnicodeUTF8); lastFile = logStream.read(); logFile.close(); } - QFile folderFile( Amarok::saveLocation( QString::null ) + "collection_scan.files" ); + TQFile folderFile( Amarok::saveLocation( TQString::null ) + "collection_scan.files" ); if ( !folderFile.open( IO_ReadOnly ) ) warning() << "Failed to open folder file " << folderFile.name() << " read-only" << endl; else { - QTextStream folderStream; + TQTextStream folderStream; folderStream.setDevice(&folderFile); - folderStream.setEncoding(QTextStream::UnicodeUTF8); - entries = QStringList::split( "\n", folderStream.read() ); + folderStream.setEncoding(TQTextStream::UnicodeUTF8); + entries = TQStringList::split( "\n", folderStream.read() ); } for( int count = entries.findIndex( lastFile ) + 1; count; --count ) @@ -130,26 +130,26 @@ CollectionScanner::doJob() //SLOT } else { - foreachType( QStringList, m_folders ) { + foreachType( TQStringList, m_folders ) { if( (*it).isEmpty() ) //apparently somewhere empty strings get into the mix //which results in a full-system scan! Which we can't allow continue; - QString dir = *it; + TQString dir = *it; if( !dir.endsWith( "/" ) ) dir += '/'; readDir( dir, entries ); } - QFile folderFile( Amarok::saveLocation( QString::null ) + "collection_scan.files" ); + TQFile folderFile( Amarok::saveLocation( TQString::null ) + "collection_scan.files" ); if ( !folderFile.open( IO_WriteOnly ) ) warning() << "Failed to open folder file " << folderFile.name() << " read-only" << endl; else { - QTextStream stream( &folderFile ); - stream.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream stream( &folderFile ); + stream.setEncoding(TQTextStream::UnicodeUTF8); stream << entries.join( "\n" ); folderFile.close(); } @@ -158,7 +158,7 @@ CollectionScanner::doJob() //SLOT if( !entries.isEmpty() ) { if( !m_restart ) { AttributeMap attributes; - attributes["count"] = QString::number( entries.count() ); + attributes["count"] = TQString::number( entries.count() ); writeElement( "itemcount", attributes ); } @@ -172,7 +172,7 @@ CollectionScanner::doJob() //SLOT void -CollectionScanner::readDir( const QString& dir, QStringList& entries ) +CollectionScanner::readDir( const TQString& dir, TQStringList& entries ) { static DCOPRef dcopRef( "amarok", "collection" ); @@ -180,7 +180,7 @@ CollectionScanner::readDir( const QString& dir, QStringList& entries ) if( dir.startsWith( "/dev" ) || dir.startsWith( "/sys" ) || dir.startsWith( "/proc" ) ) return; - const QCString dir8Bit = QFile::encodeName( dir ); + const TQCString dir8Bit = TQFile::encodeName( dir ); DIR *d = opendir( dir8Bit ); if( d == NULL ) { warning() << "Skipping, " << strerror(errno) << ": " << dir << endl; @@ -230,8 +230,8 @@ CollectionScanner::readDir( const QString& dir, QStringList& entries ) m_processedDirs[m_processedDirs.size() - 1] = de; for( dirent *ent; ( ent = readdir( d ) ); ) { - QCString entry (ent->d_name); - QCString entryname (ent->d_name); + TQCString entry (ent->d_name); + TQCString entryname (ent->d_name); if ( entry == "." || entry == ".." ) continue; @@ -256,7 +256,7 @@ CollectionScanner::readDir( const QString& dir, QStringList& entries ) entry = nosymlink; } } - const QString file = QFile::decodeName( entry ); + const TQString file = TQFile::decodeName( entry ); bool isInCollection = false; if( m_incremental ) @@ -268,7 +268,7 @@ CollectionScanner::readDir( const QString& dir, QStringList& entries ) } else if( S_ISREG( statBuf.st_mode ) ) - entries.append( QFile::decodeName( entry ) ); + entries.append( TQFile::decodeName( entry ) ); } closedir( d ); @@ -276,34 +276,34 @@ CollectionScanner::readDir( const QString& dir, QStringList& entries ) void -CollectionScanner::scanFiles( const QStringList& entries ) +CollectionScanner::scanFiles( const TQStringList& entries ) { DEBUG_BLOCK - typedef QPair CoverBundle; + typedef QPair CoverBundle; - QStringList validImages; validImages << "jpg" << "png" << "gif" << "jpeg"; - QStringList validPlaylists; validPlaylists << "m3u" << "pls"; + TQStringList validImages; validImages << "jpg" << "png" << "gif" << "jpeg"; + TQStringList validPlaylists; validPlaylists << "m3u" << "pls"; - QValueList covers; - QStringList images; + TQValueList covers; + TQStringList images; int itemCount = 0; DCOPRef dcopRef( "amarok", "collection" ); - foreachType( QStringList, entries ) { - const QString path = *it; - const QString ext = extension( path ); - const QString dir = directory( path ); + foreachType( TQStringList, entries ) { + const TQString path = *it; + const TQString ext = extension( path ); + const TQString dir = directory( path ); itemCount++; // Write path to logfile if( !m_logfile.isEmpty() ) { - QFile log( m_logfile ); + TQFile log( m_logfile ); if( log.open( IO_WriteOnly ) ) { - QCString cPath = path.utf8(); + TQCString cPath = path.utf8(); log.writeBlock( cPath, cPath.length() ); log.close(); } @@ -343,16 +343,16 @@ CollectionScanner::scanFiles( const QStringList& entries ) // Update Compilation-flag, when this is the last loop-run // or we're going to switch to another dir in the next run - QStringList::ConstIterator itTemp( it ); + TQStringList::ConstIterator itTemp( it ); ++itTemp; if( path == entries.last() || dir != directory( *itTemp ) ) { // we entered the next directory - foreachType( QStringList, images ) { + foreachType( TQStringList, images ) { // Serialize CoverBundle list with AMAROK_MAGIC as separator - QString string; + TQString string; - for( QValueList::ConstIterator it2 = covers.begin(); it2 != covers.end(); ++it2 ) + for( TQValueList::ConstIterator it2 = covers.begin(); it2 != covers.end(); ++it2 ) string += (*it2).first + "AMAROK_MAGIC" + (*it2).second + "AMAROK_MAGIC"; AttributeMap attributes; @@ -415,47 +415,47 @@ CollectionScanner::readTags( const MetaBundle& mb ) attributes["album"] = mb.album(); attributes["comment"] = mb.comment(); attributes["genre"] = mb.genre(); - attributes["year"] = mb.year() ? QString::number( mb.year() ) : QString(); - attributes["track"] = mb.track() ? QString::number( mb.track() ) : QString(); - attributes["discnumber"] = mb.discNumber() ? QString::number( mb.discNumber() ) : QString(); - attributes["bpm"] = mb.bpm() ? QString::number( mb.bpm() ) : QString(); - attributes["filetype"] = QString::number( mb.fileType() ); + attributes["year"] = mb.year() ? TQString::number( mb.year() ) : TQString(); + attributes["track"] = mb.track() ? TQString::number( mb.track() ) : TQString(); + attributes["discnumber"] = mb.discNumber() ? TQString::number( mb.discNumber() ) : TQString(); + attributes["bpm"] = mb.bpm() ? TQString::number( mb.bpm() ) : TQString(); + attributes["filetype"] = TQString::number( mb.fileType() ); attributes["uniqueid"] = mb.uniqueId(); - attributes["compilation"] = QString::number( mb.compilation() ); + attributes["compilation"] = TQString::number( mb.compilation() ); if ( mb.audioPropertiesUndetermined() ) attributes["audioproperties"] = "false"; else { attributes["audioproperties"] = "true"; - attributes["bitrate"] = QString::number( mb.bitrate() ); - attributes["length"] = QString::number( mb.length() ); - attributes["samplerate"] = QString::number( mb.sampleRate() ); + attributes["bitrate"] = TQString::number( mb.bitrate() ); + attributes["length"] = TQString::number( mb.length() ); + attributes["samplerate"] = TQString::number( mb.sampleRate() ); } if ( mb.filesize() >= 0 ) - attributes["filesize"] = QString::number( mb.filesize() ); + attributes["filesize"] = TQString::number( mb.filesize() ); return attributes; } void -CollectionScanner::writeElement( const QString& name, const AttributeMap& attributes ) +CollectionScanner::writeElement( const TQString& name, const AttributeMap& attributes ) { - QDomDocument doc; // A dummy. We don't really use DOM, but SAX2 - QDomElement element = doc.createElement( name ); + TQDomDocument doc; // A dummy. We don't really use DOM, but SAX2 + TQDomElement element = doc.createElement( name ); foreachType( AttributeMap, attributes ) { // There are at least some characters that Qt cannot categorize which make the resulting // xml document ill-formed and prevent the parser from processing the remaining document. // Because of this we skip attributes containing characters not belonging to any category. - QString data = it.data(); + TQString data = it.data(); const unsigned len = data.length(); bool nonPrint = false; for( unsigned i = 0; i < len; i++ ) { - if( data.ref( i ).category() == QChar::NoCategory ) + if( data.ref( i ).category() == TQChar::NoCategory ) { nonPrint = true; break; @@ -468,8 +468,8 @@ CollectionScanner::writeElement( const QString& name, const AttributeMap& attrib element.setAttribute( it.key(), it.data() ); } - QString text; - QTextStream stream( &text, IO_WriteOnly ); + TQString text; + TQTextStream stream( &text, IO_WriteOnly ); element.save( stream, 0 ); std::cout << text.utf8() << std::endl; diff --git a/amarok/src/collectionscanner/collectionscanner.h b/amarok/src/collectionscanner/collectionscanner.h index a6a17a2f..49ae6a41 100644 --- a/amarok/src/collectionscanner/collectionscanner.h +++ b/amarok/src/collectionscanner/collectionscanner.h @@ -26,12 +26,12 @@ #include #include -#include -#include +#include +#include #include -typedef QMap AttributeMap; +typedef TQMap AttributeMap; /** @@ -44,7 +44,7 @@ class CollectionScanner : public KApplication Q_OBJECT public: - CollectionScanner( const QStringList& folders, + CollectionScanner( const TQStringList& folders, bool recursive, bool incremental, bool importPlaylists, @@ -61,13 +61,13 @@ private slots: void doJob(); private: - void readDir( const QString& dir, QStringList& entries ); - void scanFiles( const QStringList& entries ); + void readDir( const TQString& dir, TQStringList& entries ); + void scanFiles( const TQStringList& entries ); /** * Read metadata tags of a given file. * @mb MetaBundle for the file. - * @return QMap containing tags, or empty QMap on failure. + * @return TQMap containing tags, or empty TQMap on failure. */ AttributeMap readTags( const MetaBundle& mb ); @@ -76,13 +76,13 @@ private: * @name Name of the element. * @attributes Key/value map of attributes. */ - void writeElement( const QString& name, const AttributeMap& attributes ); + void writeElement( const TQString& name, const AttributeMap& attributes ); /** * @return the LOWERCASE file extension without the preceding '.', or "" if there is none */ - inline QString extension( const QString &fileName ) + inline TQString extension( const TQString &fileName ) { return fileName.contains( '.' ) ? fileName.mid( fileName.findRev( '.' ) + 1 ).lower() : ""; } @@ -90,18 +90,18 @@ private: /** * @return the last directory in @param fileName */ - inline QString directory( const QString &fileName ) + inline TQString directory( const TQString &fileName ) { return fileName.section( '/', 0, -2 ); } const bool m_importPlaylists; - QStringList m_folders; + TQStringList m_folders; const bool m_recursively; const bool m_incremental; const bool m_restart; - const QString m_logfile; + const TQString m_logfile; bool m_pause; struct direntry { @@ -109,7 +109,7 @@ private: ino_t ino; } KDE_PACKED; - QMemArray m_processedDirs; + TQMemArray m_processedDirs; }; diff --git a/amarok/src/collectionscanner/collectionscannerdcophandler.cpp b/amarok/src/collectionscanner/collectionscannerdcophandler.cpp index c758d571..390fa22f 100644 --- a/amarok/src/collectionscanner/collectionscannerdcophandler.cpp +++ b/amarok/src/collectionscanner/collectionscannerdcophandler.cpp @@ -25,7 +25,7 @@ DcopCollectionScannerHandler::DcopCollectionScannerHandler() : DCOPObject( "scanner" ) - , QObject( kapp ) + , TQObject( kapp ) { // Register with DCOP if ( !kapp->dcopClient()->isRegistered() ) { diff --git a/amarok/src/collectionscanner/collectionscannerdcophandler.h b/amarok/src/collectionscanner/collectionscannerdcophandler.h index e4133212..3973f31a 100644 --- a/amarok/src/collectionscanner/collectionscannerdcophandler.h +++ b/amarok/src/collectionscanner/collectionscannerdcophandler.h @@ -20,11 +20,11 @@ #include "collectionscannerdcopiface.h" -#include +#include #include -class DcopCollectionScannerHandler : public QObject, virtual public CollectionScannerInterface +class DcopCollectionScannerHandler : public TQObject, virtual public CollectionScannerInterface { Q_OBJECT diff --git a/amarok/src/collectionscanner/main.cpp b/amarok/src/collectionscanner/main.cpp index 8ca61a6d..09aca4ed 100644 --- a/amarok/src/collectionscanner/main.cpp +++ b/amarok/src/collectionscanner/main.cpp @@ -20,7 +20,7 @@ #include "collectionscanner.h" #include "metadata/tplugins.h" -#include +#include #include #include @@ -59,9 +59,9 @@ int main( int argc, char *argv[] ) const KCmdLineArgs* const args = KCmdLineArgs::parsedArgs(); // Parse list of folder arguments - QStringList folders; + TQStringList folders; for( int i = 0; i < args->count(); i++ ) - folders << QFile::decodeName( args->arg( i ) ); + folders << TQFile::decodeName( args->arg( i ) ); const bool recursive = args->isSet( "recursive" ); const bool incremental = args->isSet( "incremental" ); diff --git a/amarok/src/colorgenerator.h b/amarok/src/colorgenerator.h index d209012f..b7ab81eb 100644 --- a/amarok/src/colorgenerator.h +++ b/amarok/src/colorgenerator.h @@ -33,7 +33,7 @@ class Color : public QColor static const int SATURATION_TARGET = 30; public: - Color( const QColor &c ) : QColor( c ) + Color( const TQColor &c ) : TQColor( c ) { DEBUG_BLOCK diff --git a/amarok/src/columnlist.cpp b/amarok/src/columnlist.cpp index 21d2ffee..deaaf984 100644 --- a/amarok/src/columnlist.cpp +++ b/amarok/src/columnlist.cpp @@ -19,10 +19,10 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include "amarokconfig.h" @@ -33,15 +33,15 @@ class MyCheckListItem: public QCheckListItem { - typedef QCheckListItem super; + typedef TQCheckListItem super; ColumnList *m_list; public: int column; - MyCheckListItem( int c, QListView *v, const QString &s, Type t, ColumnList *list ): + MyCheckListItem( int c, TQListView *v, const TQString &s, Type t, ColumnList *list ): super( v, s, t ), m_list( list ), column( c ) { } - virtual void paintCell( QPainter * p, const QColorGroup &cg, int c, int w, int a ) + virtual void paintCell( TQPainter * p, const TQColorGroup &cg, int c, int w, int a ) { - QFont f = p->font(); + TQFont f = p->font(); if( isOn() ) f.setBold( !f.bold() ); p->setFont( f ); @@ -52,40 +52,40 @@ public: super::stateChange( b ); m_list->setChanged(); } - MyCheckListItem *itemAbove() { return static_cast( QCheckListItem::itemAbove() ); } - MyCheckListItem *itemBelow() { return static_cast( QCheckListItem::itemBelow() ); } + MyCheckListItem *itemAbove() { return static_cast( TQCheckListItem::itemAbove() ); } + MyCheckListItem *itemBelow() { return static_cast( TQCheckListItem::itemBelow() ); } }; -ColumnList::ColumnList( QWidget *parent, const char *name ) - : QHBox( parent, name ), m_changed( true ) +ColumnList::ColumnList( TQWidget *parent, const char *name ) + : TQHBox( parent, name ), m_changed( true ) { setSpacing( 5 ); - QVBox *buttonbox = new QVBox( this ); + TQVBox *buttonbox = new TQVBox( this ); - m_up = new KPushButton( KGuiItem( QString::null, "up" ), buttonbox ); - QToolTip::add( m_up, i18n( "Move column up" ) ); - connect( m_up, SIGNAL( clicked() ), this, SLOT( moveUp() ) ); + m_up = new KPushButton( KGuiItem( TQString::null, "up" ), buttonbox ); + TQToolTip::add( m_up, i18n( "Move column up" ) ); + connect( m_up, TQT_SIGNAL( clicked() ), this, TQT_SLOT( moveUp() ) ); - m_down = new KPushButton( KGuiItem( QString::null, "down" ), buttonbox ); - QToolTip::add( m_down, i18n( "Move column down" ) ); - connect( m_down, SIGNAL( clicked() ), this, SLOT( moveDown() ) ); + m_down = new KPushButton( KGuiItem( TQString::null, "down" ), buttonbox ); + TQToolTip::add( m_down, i18n( "Move column down" ) ); + connect( m_down, TQT_SIGNAL( clicked() ), this, TQT_SLOT( moveDown() ) ); m_list = new KListView( this ); m_list->addColumn(""); m_list->header()->hide(); - m_list->setSelectionMode( QListView::Single ); - m_list->setResizeMode( QListView::LastColumn ); + m_list->setSelectionMode( TQListView::Single ); + m_list->setResizeMode( TQListView::LastColumn ); m_list->setSorting( -1 ); m_list->setAcceptDrops( true ); m_list->setDragEnabled( true ); m_list->setDropVisualizer( true ); m_list->setDropVisualizerWidth( 3 ); - connect( m_list, SIGNAL( moved() ), this, SLOT( updateUI() ) ); - connect( m_list, SIGNAL( moved() ), this, SLOT( setChanged() ) ); - connect( m_list, SIGNAL( currentChanged( QListViewItem* ) ), this, SLOT( updateUI() ) ); + connect( m_list, TQT_SIGNAL( moved() ), this, TQT_SLOT( updateUI() ) ); + connect( m_list, TQT_SIGNAL( moved() ), this, TQT_SLOT( setChanged() ) ); + connect( m_list, TQT_SIGNAL( currentChanged( TQListViewItem* ) ), this, TQT_SLOT( updateUI() ) ); - QHeader* const h = Playlist::instance()->header(); + TQHeader* const h = Playlist::instance()->header(); for( int i = h->count() - 1; i >= 0; --i ) { const int s = h->mapToSection( i ); @@ -93,7 +93,7 @@ ColumnList::ColumnList( QWidget *parent, const char *name ) ( s != MetaBundle::Mood || AmarokConfig::showMoodbar() ) && ( s != MetaBundle::Score || AmarokConfig::useScores() ) ) { - ( new MyCheckListItem( s, m_list, MetaBundle::prettyColumnName( s ), QCheckListItem::CheckBox, this ) ) + ( new MyCheckListItem( s, m_list, MetaBundle::prettyColumnName( s ), TQCheckListItem::CheckBox, this ) ) ->setOn( h->sectionSize( s ) ); } } @@ -103,18 +103,18 @@ ColumnList::ColumnList( QWidget *parent, const char *name ) resetChanged(); } -QValueList ColumnList::visibleColumns() const +TQValueList ColumnList::visibleColumns() const { - QValueList v; + TQValueList v; for( MyCheckListItem *item = static_cast( m_list->firstChild() ); item; item = item->itemBelow() ) if( item->isOn() ) v.append( item->column ); return v; } -QValueList ColumnList::columnOrder() const +TQValueList ColumnList::columnOrder() const { - QValueList v; + TQValueList v; for( MyCheckListItem *item = static_cast( m_list->firstChild() ); item; item = item->itemBelow() ) v.append( item->column ); return v; @@ -132,7 +132,7 @@ void ColumnList::resetChanged() void ColumnList::moveUp() { - if( QListViewItem *item = m_list->currentItem() ) + if( TQListViewItem *item = m_list->currentItem() ) if( item->itemAbove() ) { m_list->moveItem( item, 0, item->itemAbove()->itemAbove() ); @@ -145,7 +145,7 @@ void ColumnList::moveUp() void ColumnList::moveDown() { - if( QListViewItem *item = m_list->currentItem() ) + if( TQListViewItem *item = m_list->currentItem() ) { m_list->moveItem( item, 0, item->itemBelow() ); m_list->setCurrentItem( item ); @@ -176,7 +176,7 @@ ColumnsDialog::ColumnsDialog() { setMainWidget( m_list ); enableButtonApply( false ); - connect( m_list, SIGNAL( changed() ), this, SLOT( slotChanged() ) ); + connect( m_list, TQT_SIGNAL( changed() ), this, TQT_SLOT( slotChanged() ) ); } ColumnsDialog::~ColumnsDialog() diff --git a/amarok/src/columnlist.h b/amarok/src/columnlist.h index dd32e7da..d28c9be7 100644 --- a/amarok/src/columnlist.h +++ b/amarok/src/columnlist.h @@ -20,20 +20,20 @@ #ifndef AMAROK_COLUMNLIST_H #define AMAROK_COLUMNLIST_H -#include +#include #include class KListView; class KPushButton; -template class QValueList; +template class TQValueList; class ColumnList: public QHBox { Q_OBJECT public: - ColumnList( QWidget *parent = 0, const char *name = 0 ); - QValueList visibleColumns() const; - QValueList columnOrder() const; + ColumnList( TQWidget *parent = 0, const char *name = 0 ); + TQValueList visibleColumns() const; + TQValueList columnOrder() const; bool isChanged() const; void resetChanged(); diff --git a/amarok/src/configdialog.cpp b/amarok/src/configdialog.cpp index d39d329e..1ed07eb5 100644 --- a/amarok/src/configdialog.cpp +++ b/amarok/src/configdialog.cpp @@ -38,18 +38,18 @@ email : markey@web.de #include "plugin/pluginconfig.h" #include "pluginmanager.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include //kapp #include @@ -60,7 +60,7 @@ email : markey@web.de #include namespace Amarok { - int databaseTypeCode( const QString type ) + int databaseTypeCode( const TQString type ) { // can't use kconfigxt for the database comboxbox since we need the DBConnection id and not the index int dbType = DbConnection::sqlite; @@ -79,7 +79,7 @@ int AmarokConfigDialog::s_currentPage = 0; // PUBLIC ////////////////////////////////////////////////////////////////////////////////////////// -AmarokConfigDialog::AmarokConfigDialog( QWidget *parent, const char* name, KConfigSkeleton *config ) +AmarokConfigDialog::AmarokConfigDialog( TQWidget *parent, const char* name, KConfigSkeleton *config ) : KConfigDialog( parent, name, config ) , m_engineConfig( 0 ) , m_opt4( 0 ) @@ -99,22 +99,22 @@ AmarokConfigDialog::AmarokConfigDialog( QWidget *parent, const char* name, KConf #ifdef Q_WS_X11 Options5 *opt5 = new Options5( 0, "OSD" ); #endif - QVBox *opt6 = new QVBox; + TQVBox *opt6 = new TQVBox; m_opt7 = new Options7( 0, "Collection" ); Options8 *opt8 = new Options8( 0, "Scrobbler" ); - QVBox *opt9 = new QVBox; + TQVBox *opt9 = new TQVBox; // Sound System opt6->setName( "Engine" ); opt6->setSpacing( KDialog::spacingHint() ); - QWidget *groupBox, *aboutEngineButton; - groupBox = new QGroupBox( 2, Qt::Horizontal, i18n("Sound System"), opt6 ); - m_engineConfigFrame = new QGroupBox( 1, Qt::Horizontal, opt6 ); - m_soundSystem = new QComboBox( false, groupBox ); - aboutEngineButton = new QPushButton( i18n("About"), groupBox ); + TQWidget *groupBox, *aboutEngineButton; + groupBox = new TQGroupBox( 2, Qt::Horizontal, i18n("Sound System"), opt6 ); + m_engineConfigFrame = new TQGroupBox( 1, Qt::Horizontal, opt6 ); + m_soundSystem = new TQComboBox( false, groupBox ); + aboutEngineButton = new TQPushButton( i18n("About"), groupBox ); - QToolTip::add( m_soundSystem, i18n("Click to select the sound system to use for playback.") ); - QToolTip::add( aboutEngineButton, i18n("Click to get the plugin information.") ); + TQToolTip::add( m_soundSystem, i18n("Click to select the sound system to use for playback.") ); + TQToolTip::add( aboutEngineButton, i18n("Click to get the plugin information.") ); /// Populate the engine selection combo box KTrader::OfferList offers = PluginManager::query( "[X-KDE-Amarok-plugintype] == 'engine'" ); @@ -126,7 +126,7 @@ AmarokConfigDialog::AmarokConfigDialog( QWidget *parent, const char* name, KConf && AmarokConfig::soundSystem() != "void-engine" ) continue; m_soundSystem->insertItem( (*it)->name() ); - // Save name properties in QMap for lookup + // Save name properties in TQMap for lookup m_pluginName[(*it)->name()] = (*it)->property( "X-KDE-Amarok-name" ).toString(); m_pluginAmarokName[(*it)->property( "X-KDE-Amarok-name" ).toString()] = (*it)->name(); } @@ -150,26 +150,26 @@ AmarokConfigDialog::AmarokConfigDialog( QWidget *parent, const char* name, KConf // Media Devices opt9->setName( "Media Devices" ); opt9->setSpacing( KDialog::spacingHint() ); - QVBox *topbox = new QVBox( opt9 ); + TQVBox *topbox = new TQVBox( opt9 ); topbox->setSpacing( KDialog::spacingHint() ); - QGroupBox *mediaBox = new QGroupBox( 2, Qt::Horizontal, i18n("Media Devices"), topbox ); - mediaBox->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ); - QVBox *vbox = new QVBox( mediaBox ); + TQGroupBox *mediaBox = new TQGroupBox( 2, Qt::Horizontal, i18n("Media Devices"), topbox ); + mediaBox->setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Minimum ); + TQVBox *vbox = new TQVBox( mediaBox ); vbox->setSpacing( KDialog::spacingHint() ); m_deviceManager = new MediumPluginManager( vbox ); - QHBox *hbox = new QHBox( topbox ); + TQHBox *hbox = new TQHBox( topbox ); hbox->setSpacing( KDialog::spacingHint() ); - hbox->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ); + hbox->setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Minimum ); KPushButton *autodetect = new KPushButton( i18n( "Autodetect Devices" ), hbox ); - autodetect->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - connect( autodetect, SIGNAL(clicked()), m_deviceManager, SLOT(redetectDevices()) ); + autodetect->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ) ); + connect( autodetect, TQT_SIGNAL(clicked()), m_deviceManager, TQT_SLOT(redetectDevices()) ); KPushButton *add = new KPushButton( i18n( "Add Device..." ), hbox ); - add->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - connect( add, SIGNAL(clicked()), m_deviceManager, SLOT(newDevice()) ); + add->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ) ); + connect( add, TQT_SIGNAL(clicked()), m_deviceManager, TQT_SLOT(newDevice()) ); - QFrame *frame = new QFrame( topbox ); - frame->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); + TQFrame *frame = new TQFrame( topbox ); + frame->setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ); // add pages addPage( m_opt1, i18n( "General" ), Amarok::icon( "settings_general" ), i18n( "Configure General Options" ) ); @@ -184,28 +184,28 @@ AmarokConfigDialog::AmarokConfigDialog( QWidget *parent, const char* name, KConf addPage( opt9, i18n( "Media Devices" ), Amarok::icon( "device" ), i18n( "Configure Portable Player Support" ) ); // Show information labels (must be done after insertions) - QObjectList *list = queryList( "QLabel", "infoPixmap" ); - QPixmap const info = KGlobal::iconLoader()->iconPath( "messagebox_info", -KIcon::SizeHuge ); - for( QObject *label = list->first(); label; label = list->next() ) - static_cast(label)->setPixmap( info ); + TQObjectList *list = queryList( "TQLabel", "infoPixmap" ); + TQPixmap const info = KGlobal::iconLoader()->iconPath( "messagebox_info", -KIcon::SizeHuge ); + for( TQObject *label = list->first(); label; label = list->next() ) + static_cast(label)->setPixmap( info ); delete list; //stop KFont Requesters getting stupidly large - list = queryList( "QLabel", "m_sampleLabel" ); - for( QObject *label = list->first(); label; label = list->next() ) - static_cast(label)->setMaximumWidth( 250 ); + list = queryList( "TQLabel", "m_sampleLabel" ); + for( TQObject *label = list->first(); label; label = list->next() ) + static_cast(label)->setMaximumWidth( 250 ); delete list; - connect( m_deviceManager, SIGNAL(changed()), SLOT(updateButtons()) ); - connect( m_soundSystem, SIGNAL(activated( int )), SLOT(updateButtons()) ); - connect( aboutEngineButton, SIGNAL(clicked()), SLOT(aboutEngine()) ); + connect( m_deviceManager, TQT_SIGNAL(changed()), TQT_SLOT(updateButtons()) ); + connect( m_soundSystem, TQT_SIGNAL(activated( int )), TQT_SLOT(updateButtons()) ); + connect( aboutEngineButton, TQT_SIGNAL(clicked()), TQT_SLOT(aboutEngine()) ); #ifdef Q_WS_X11 - connect( opt5, SIGNAL(settingsChanged()), SLOT(updateButtons()) ); //see options5.ui.h + connect( opt5, TQT_SIGNAL(settingsChanged()), TQT_SLOT(updateButtons()) ); //see options5.ui.h #endif - connect( m_opt2->styleComboBox, SIGNAL( activated( int ) ), SLOT( updateButtons() ) ); - connect( m_opt7->dbSetupFrame->databaseEngine, SIGNAL( activated( int ) ), SLOT( updateButtons() ) ); - connect( m_opt1->kComboBox_browser, SIGNAL( activated( int ) ), SLOT( updateButtons() ) ); - connect( m_opt1->kLineEdit_customBrowser, SIGNAL( textChanged( const QString& ) ), SLOT( updateButtons() ) ); + connect( m_opt2->styleComboBox, TQT_SIGNAL( activated( int ) ), TQT_SLOT( updateButtons() ) ); + connect( m_opt7->dbSetupFrame->databaseEngine, TQT_SIGNAL( activated( int ) ), TQT_SLOT( updateButtons() ) ); + connect( m_opt1->kComboBox_browser, TQT_SIGNAL( activated( int ) ), TQT_SLOT( updateButtons() ) ); + connect( m_opt1->kLineEdit_customBrowser, TQT_SIGNAL( textChanged( const TQString& ) ), TQT_SLOT( updateButtons() ) ); } AmarokConfigDialog::~AmarokConfigDialog() @@ -220,7 +220,7 @@ AmarokConfigDialog::~AmarokConfigDialog() /** Reimplemented from KConfigDialog */ -void AmarokConfigDialog::addPage( QWidget *page, const QString &itemName, const QString &pixmapName, const QString &header, bool manage ) +void AmarokConfigDialog::addPage( TQWidget *page, const TQString &itemName, const TQString &pixmapName, const TQString &header, bool manage ) { // Add the widget pointer to our list, for later reference m_pageList << page; @@ -230,7 +230,7 @@ void AmarokConfigDialog::addPage( QWidget *page, const QString &itemName, const /** Show page by object name */ -void AmarokConfigDialog::showPageByName( const QCString& page ) +void AmarokConfigDialog::showPageByName( const TQCString& page ) { for( uint index = 0; index < m_pageList.count(); index++ ) { if ( m_pageList[index]->name() == page ) { @@ -290,7 +290,7 @@ void AmarokConfigDialog::updateSettings() int dbType = Amarok::databaseTypeCode( m_opt7->dbSetupFrame->databaseEngine->currentText() ); if ( dbType != AmarokConfig::databaseEngine().toInt() ) { - AmarokConfig::setDatabaseEngine( QString::number( dbType ) ); + AmarokConfig::setDatabaseEngine( TQString::number( dbType ) ); emit settingsChanged(); } @@ -300,8 +300,8 @@ void AmarokConfigDialog::updateSettings() { PlaylistWindow::self()->addBrowser( "MediaBrowser", MediaBrowser::instance(), i18n( "Media Device" ), Amarok::icon( "device" ) ); //to re-enable mediabrowser hiding, uncomment this: - //connect( MediaBrowser::instance(), SIGNAL( availabilityChanged( bool ) ), - // PlaylistWindow::self(), SLOT( mbAvailabilityChanged( bool ) ) ); + //connect( MediaBrowser::instance(), TQT_SIGNAL( availabilityChanged( bool ) ), + // PlaylistWindow::self(), TQT_SLOT( mbAvailabilityChanged( bool ) ) ); } @@ -385,7 +385,7 @@ bool AmarokConfigDialog::isDefault() void AmarokConfigDialog::aboutEngine() //SLOT { - PluginManager::showAbout( QString( "Name == '%1'" ).arg( m_soundSystem->currentText() ) ); + PluginManager::showAbout( TQString( "Name == '%1'" ).arg( m_soundSystem->currentText() ) ); } @@ -405,12 +405,12 @@ void AmarokConfigDialog::soundSystemChanged() if( EngineController::hasEngineProperty( "HasConfigure" ) ) { m_engineConfig = EngineController::engine()->configure(); - m_engineConfig->view()->reparent( m_engineConfigFrame, QPoint() ); + m_engineConfig->view()->reparent( m_engineConfigFrame, TQPoint() ); m_engineConfig->view()->show(); m_engineConfigFrame->setTitle( i18n( "to change settings", "Configure %1" ).arg( m_soundSystem->currentText() ) ); m_engineConfigFrame->show(); - connect( m_engineConfig, SIGNAL(viewChanged()), SLOT(updateButtons()) ); + connect( m_engineConfig, TQT_SIGNAL(viewChanged()), TQT_SLOT(updateButtons()) ); } else { m_engineConfig = 0; @@ -431,7 +431,7 @@ void AmarokConfigDialog::soundSystemChanged() } } -QString AmarokConfigDialog::externalBrowser() const +TQString AmarokConfigDialog::externalBrowser() const { return m_opt1->kComboBox_browser->isEnabled() ? #ifdef Q_WS_MAC diff --git a/amarok/src/configdialog.h b/amarok/src/configdialog.h index 2ffd50dc..bd29cc6a 100644 --- a/amarok/src/configdialog.h +++ b/amarok/src/configdialog.h @@ -16,14 +16,14 @@ email : markey@web.de #ifndef AMAROKCONFIGDIALOG_H #define AMAROKCONFIGDIALOG_H -#include -#include +#include +#include #include -class QComboBox; -class QGroupBox; -class QVBox; +class TQComboBox; +class TQGroupBox; +class TQVBox; namespace Amarok { class PluginConfig; @@ -36,13 +36,13 @@ class AmarokConfigDialog : public KConfigDialog Q_OBJECT public: - AmarokConfigDialog( QWidget *parent, const char* name, KConfigSkeleton *config ); + AmarokConfigDialog( TQWidget *parent, const char* name, KConfigSkeleton *config ); ~AmarokConfigDialog(); - void addPage( QWidget *page, const QString &itemName, const QString &pixmapName, - const QString &header=QString::null, bool manage=true); + void addPage( TQWidget *page, const TQString &itemName, const TQString &pixmapName, + const TQString &header=TQString::null, bool manage=true); - void showPageByName( const QCString& page ); + void showPageByName( const TQCString& page ); static int s_currentPage; @@ -61,20 +61,20 @@ class AmarokConfigDialog : public KConfigDialog private: void soundSystemChanged(); - QString externalBrowser() const; + TQString externalBrowser() const; - QComboBox* m_soundSystem; + TQComboBox* m_soundSystem; Amarok::PluginConfig *m_engineConfig; - QGroupBox *m_engineConfigFrame; + TQGroupBox *m_engineConfigFrame; class Options1 *m_opt1; class Options2 *m_opt2; class Options4 *m_opt4; class Options7 *m_opt7; MediumPluginManager *m_deviceManager; - QValueList m_pageList; - QMap m_pluginName; - QMap m_pluginAmarokName; + TQValueList m_pageList; + TQMap m_pluginName; + TQMap m_pluginAmarokName; }; diff --git a/amarok/src/contextbrowser.cpp b/amarok/src/contextbrowser.cpp index 63cfa614..c8dd58d4 100644 --- a/amarok/src/contextbrowser.cpp +++ b/amarok/src/contextbrowser.cpp @@ -37,20 +37,20 @@ #include "tagdialog.h" #include "threadmanager.h" -#include -#include -#include -#include -#include -#include -#include // External CSS reading -#include //wiki tab -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include // External CSS reading +#include //wiki tab +#include +#include +#include +#include +#include +#include #include #include //kapp @@ -73,30 +73,30 @@ namespace Amarok { - QString escapeHTML( const QString &s ) + TQString escapeHTML( const TQString &s ) { - return QString(s).replace( "&", "&" ).replace( "<", "<" ).replace( ">", ">" ); + return TQString(s).replace( "&", "&" ).replace( "<", "<" ).replace( ">", ">" ); // .replace( "%", "%25" ) has to be the first(!) one, otherwise we would do things like converting spaces into %20 and then convert them into %25%20 } - QString escapeHTMLAttr( const QString &s ) + TQString escapeHTMLAttr( const TQString &s ) { - return QString(s).replace( "%", "%25" ).replace( "'", "%27" ).replace( "\"", "%22" ).replace( "#", "%23" ).replace( "?", "%3F" ); + return TQString(s).replace( "%", "%25" ).replace( "'", "%27" ).replace( "\"", "%22" ).replace( "#", "%23" ).replace( "?", "%3F" ); } - QString unescapeHTMLAttr( const QString &s ) + TQString unescapeHTMLAttr( const TQString &s ) { - return QString(s).replace( "%3F", "?" ).replace( "%23", "#" ).replace( "%22", "\"" ).replace( "%27", "'" ).replace( "%25", "%" ); + return TQString(s).replace( "%3F", "?" ).replace( "%23", "#" ).replace( "%22", "\"" ).replace( "%27", "'" ).replace( "%25", "%" ); } - QString verboseTimeSince( const QDateTime &datetime ) + TQString verboseTimeSince( const TQDateTime &datetime ) { - const QDateTime now = QDateTime::currentDateTime(); + const TQDateTime now = TQDateTime::currentDateTime(); const int datediff = datetime.daysTo( now ); if( datediff >= 6*7 /*six weeks*/ ) { // return absolute month/year const KCalendarSystem *cal = KGlobal::locale()->calendar(); - const QDate date = datetime.date(); + const TQDate date = datetime.date(); return i18n( "monthname year", "%1 %2" ).arg( cal->monthName(date), cal->yearString(date, false) ); } @@ -128,30 +128,30 @@ namespace Amarok return i18n( "The future" ); } - QString verboseTimeSince( uint time_t ) + TQString verboseTimeSince( uint time_t ) { if( !time_t ) return i18n( "Never" ); - QDateTime dt; + TQDateTime dt; dt.setTime_t( time_t ); return verboseTimeSince( dt ); } - extern KConfig *config( const QString& ); + extern KConfig *config( const TQString& ); /** * Function that must be used when separating contextBrowser escaped urls * detail can contain track/discnumber */ - void albumArtistTrackFromUrl( QString url, QString &artist, QString &album, QString &detail ) + void albumArtistTrackFromUrl( TQString url, TQString &artist, TQString &album, TQString &detail ) { if ( !url.contains("@@@") ) return; //KHTML removes the trailing space! if ( url.endsWith( " @@@" ) ) url += ' '; - const QStringList list = QStringList::split( " @@@ ", url, true ); + const TQStringList list = TQStringList::split( " @@@ ", url, true ); int size = list.count(); @@ -172,7 +172,7 @@ using Amarok::unescapeHTMLAttr; static -QString albumImageTooltip( const QString &albumImage, int size ) +TQString albumImageTooltip( const TQString &albumImage, int size ) { if ( albumImage == CollectionDB::instance()->notAvailCover( false, size ) ) return escapeHTMLAttr( i18n( "Click to fetch cover from amazon.%1, right-click for menu." ).arg( CoverManager::amazonTld() ) ); @@ -182,7 +182,7 @@ QString albumImageTooltip( const QString &albumImage, int size ) ContextBrowser *ContextBrowser::s_instance = 0; -QString ContextBrowser::s_wikiLocale = "en"; +TQString ContextBrowser::s_wikiLocale = "en"; ContextBrowser::ContextBrowser( const char *name ) @@ -210,12 +210,12 @@ ContextBrowser::ContextBrowser( const char *name ) s_instance = this; s_wikiLocale = AmarokConfig::wikipediaLocale(); - m_contextTab = new QVBox(this, "context_tab"); + m_contextTab = new TQVBox(this, "context_tab"); m_currentTrackPage = new HTMLView( m_contextTab, "current_track_page", true /* DNDEnabled */, true /*JScriptEnabled*/ ); - m_lyricsTab = new QVBox(this, "lyrics_tab"); + m_lyricsTab = new TQVBox(this, "lyrics_tab"); m_lyricsToolBar = new Browser::ToolBar( m_lyricsTab ); m_lyricsToolBar->setIconText( KToolBar::IconTextRight, false ); @@ -238,28 +238,28 @@ ContextBrowser::ContextBrowser( const char *name ) m_lyricsTextBar->boxLayout()->addStretch(); - QWidget *button = new KToolBarButton( "locationbar_erase", 1, m_lyricsTextBar ); - QLabel *filter_label = new QLabel( i18n("S&earch:") + ' ', m_lyricsTextBar ); + TQWidget *button = new KToolBarButton( "locationbar_erase", 1, m_lyricsTextBar ); + TQLabel *filter_label = new TQLabel( i18n("S&earch:") + ' ', m_lyricsTextBar ); m_lyricsSearchText = new ClickLineEdit( i18n( "Search in lyrics" ), m_lyricsTextBar ); filter_label->setBuddy( m_lyricsSearchText ); m_lyricsTextBar->setStretchableWidget(m_lyricsSearchText ); - m_lyricsSearchText->setFrame( QFrame::Sunken ); + m_lyricsSearchText->setFrame( TQFrame::Sunken ); m_lyricsSearchText->installEventFilter( this ); //we intercept keyEvents - connect( button, SIGNAL(clicked()), m_lyricsSearchText, SLOT(clear()) ); + connect( button, TQT_SIGNAL(clicked()), m_lyricsSearchText, TQT_SLOT(clear()) ); - QToolTip::add( button, i18n( "Clear search" ) ); - QString filtertip = i18n( "Enter text to search for. Press enter to advance to the next match." ); + TQToolTip::add( button, i18n( "Clear search" ) ); + TQString filtertip = i18n( "Enter text to search for. Press enter to advance to the next match." ); - QToolTip::add( m_lyricsSearchText, filtertip ); + TQToolTip::add( m_lyricsSearchText, filtertip ); - connect ( button, SIGNAL(clicked()), m_lyricsSearchText, SLOT(clear()) ); - connect ( m_lyricsSearchText, SIGNAL(textChanged(const QString &)), this, SLOT(lyricsSearchText(const QString & )) ); - connect ( m_lyricsSearchText, SIGNAL(returnPressed()), this, (SLOT(lyricsSearchTextNext())) ); + connect ( button, TQT_SIGNAL(clicked()), m_lyricsSearchText, TQT_SLOT(clear()) ); + connect ( m_lyricsSearchText, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(lyricsSearchText(const TQString & )) ); + connect ( m_lyricsSearchText, TQT_SIGNAL(returnPressed()), this, (TQT_SLOT(lyricsSearchTextNext())) ); Amarok::actionCollection()->setAutoConnectShortcuts ( true ); - new KAction( i18n("Search text in lyrics"), KShortcut("/"), this,SLOT( lyricsSearchTextShow() ), Amarok::actionCollection(), "search_text_lyric"); + new KAction( i18n("Search text in lyrics"), KShortcut("/"), this,TQT_SLOT( lyricsSearchTextShow() ), Amarok::actionCollection(), "search_text_lyric"); Amarok::actionCollection()->setAutoConnectShortcuts ( false ); } @@ -270,7 +270,7 @@ ContextBrowser::ContextBrowser( const char *name ) m_lyricsTextEdit->setTextFormat( Qt::PlainText ); m_lyricsTextEdit->hide(); - m_wikiTab = new QVBox(this, "wiki_tab"); + m_wikiTab = new TQVBox(this, "wiki_tab"); m_wikiToolBar = new Browser::ToolBar( m_wikiTab ); m_wikiToolBar->insertButton( "back", WIKI_BACK, false, i18n("Back") ); @@ -289,10 +289,10 @@ ContextBrowser::ContextBrowser( const char *name ) m_wikiPage = new HTMLView( m_wikiTab, "wiki_page", true /* DNDEnabled */, false /* JScriptEnabled */ ); m_cuefile = CueFile::instance(); - connect( m_cuefile, SIGNAL(metaData( const MetaBundle& )), - EngineController::instance(), SLOT(currentTrackMetaDataChanged( const MetaBundle& )) ); - connect( m_cuefile, SIGNAL(newCuePoint( long, long, long )), - Scrobbler::instance(), SLOT(subTrack( long, long, long )) ); + connect( m_cuefile, TQT_SIGNAL(metaData( const MetaBundle& )), + EngineController::instance(), TQT_SLOT(currentTrackMetaDataChanged( const MetaBundle& )) ); + connect( m_cuefile, TQT_SIGNAL(newCuePoint( long, long, long )), + Scrobbler::instance(), TQT_SLOT(subTrack( long, long, long )) ); addTab( m_contextTab, SmallIconSet( Amarok::icon( "music" ) ), i18n( "Music" ) ); addTab( m_lyricsTab, SmallIconSet( Amarok::icon( "lyrics" ) ), i18n( "Lyrics" ) ); @@ -313,72 +313,72 @@ ContextBrowser::ContextBrowser( const char *name ) // Delete folder with the cached coverimage shadow pixmaps KIO::del( KURL::fromPathOrURL( Amarok::saveLocation( "covershadow-cache/" ) ), false, false ); - connect( this, SIGNAL( currentChanged( QWidget* ) ), SLOT( tabChanged( QWidget* ) ) ); - - connect( m_currentTrackPage->browserExtension(), SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ), - this, SLOT( openURLRequest( const KURL & ) ) ); - connect( m_lyricsPage->browserExtension(), SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ), - this, SLOT( openURLRequest( const KURL & ) ) ); - connect( m_wikiPage->browserExtension(), SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ), - this, SLOT( openURLRequest( const KURL & ) ) ); - - connect( m_currentTrackPage, SIGNAL( popupMenu( const QString&, const QPoint& ) ), - this, SLOT( slotContextMenu( const QString&, const QPoint& ) ) ); - connect( m_lyricsPage, SIGNAL( popupMenu( const QString&, const QPoint& ) ), - this, SLOT( slotContextMenu( const QString&, const QPoint& ) ) ); - connect( m_wikiPage, SIGNAL( popupMenu( const QString&, const QPoint& ) ), - this, SLOT( slotContextMenu( const QString&, const QPoint& ) ) ); - - connect( m_lyricsToolBar->getButton( LYRICS_ADD ), SIGNAL(clicked( int )), SLOT(lyricsAdd()) ); - connect( m_lyricsToolBar->getButton( LYRICS_EDIT ), SIGNAL(toggled( int )), SLOT(lyricsEditToggle()) ); - connect( m_lyricsToolBar->getButton( LYRICS_SEARCH ), SIGNAL(clicked( int )), SLOT(lyricsSearch()) ); - connect( m_lyricsToolBar->getButton( LYRICS_REFRESH ), SIGNAL(clicked( int )), SLOT(lyricsRefresh()) ); - connect( m_lyricsToolBar->getButton( LYRICS_BROWSER ), SIGNAL(clicked( int )), SLOT(lyricsExternalPage()) ); - - connect( m_wikiToolBar->getButton( WIKI_BACK ), SIGNAL(clicked( int )), SLOT(wikiHistoryBack()) ); - connect( m_wikiToolBar->getButton( WIKI_FORWARD ), SIGNAL(clicked( int )), SLOT(wikiHistoryForward()) ); - connect( m_wikiToolBar->getButton( WIKI_ARTIST ), SIGNAL(clicked( int )), SLOT(wikiArtistPage()) ); - connect( m_wikiToolBar->getButton( WIKI_ALBUM ), SIGNAL(clicked( int )), SLOT(wikiAlbumPage()) ); - connect( m_wikiToolBar->getButton( WIKI_TITLE ), SIGNAL(clicked( int )), SLOT(wikiTitlePage()) ); - connect( m_wikiToolBar->getButton( WIKI_BROWSER ), SIGNAL(clicked( int )), SLOT(wikiExternalPage()) ); - connect( m_wikiToolBar->getButton( WIKI_CONFIG ), SIGNAL(clicked( int )), SLOT(wikiConfig()) ); - - connect( m_wikiBackPopup, SIGNAL(activated( int )), SLOT(wikiBackPopupActivated( int )) ); - connect( m_wikiForwardPopup, SIGNAL(activated( int )), SLOT(wikiForwardPopupActivated( int )) ); - - connect( CollectionDB::instance(), SIGNAL( scanStarted() ), SLOT( collectionScanStarted() ) ); - connect( CollectionDB::instance(), SIGNAL( scanDone( bool ) ), SLOT( collectionScanDone( bool ) ) ); - connect( CollectionDB::instance(), SIGNAL( databaseEngineChanged() ), SLOT( renderView() ) ); - connect( CollectionDB::instance(), SIGNAL( coverFetched( const QString&, const QString& ) ), - this, SLOT( coverFetched( const QString&, const QString& ) ) ); - connect( CollectionDB::instance(), SIGNAL( coverChanged( const QString&, const QString& ) ), - this, SLOT( coverRemoved( const QString&, const QString& ) ) ); - connect( CollectionDB::instance(), SIGNAL( similarArtistsFetched( const QString& ) ), - this, SLOT( similarArtistsFetched( const QString& ) ) ); - connect( CollectionDB::instance(), SIGNAL( tagsChanged( const MetaBundle& ) ), - this, SLOT( tagsChanged( const MetaBundle& ) ) ); - connect( CollectionDB::instance(), SIGNAL( tagsChanged( const QString&, const QString& ) ), - this, SLOT( tagsChanged( const QString&, const QString& ) ) ); - connect( CollectionDB::instance(), SIGNAL( ratingChanged( const QString&, int ) ), - this, SLOT( ratingOrScoreOrLabelsChanged( const QString& ) ) ); - connect( StarManager::instance(), SIGNAL( ratingsColorsChanged() ), - this, SLOT( ratingOrScoreOrLabelsChanged( const QString& ) ) ); - connect( CollectionDB::instance(), SIGNAL( scoreChanged( const QString&, float ) ), - this, SLOT( ratingOrScoreOrLabelsChanged( const QString& ) ) ); - connect( CollectionDB::instance(), SIGNAL( labelsChanged( const QString& ) ), - this, SLOT( ratingOrScoreOrLabelsChanged( const QString& ) ) ); - connect( CollectionDB::instance(), SIGNAL( imageFetched( const QString& ) ), - this, SLOT( imageFetched( const QString& ) ) ); - - connect( App::instance(), SIGNAL( useScores( bool ) ), - this, SLOT( refreshCurrentTrackPage() ) ); - connect( App::instance(), SIGNAL( useRatings( bool ) ), - this, SLOT( refreshCurrentTrackPage() ) ); - - connect( MountPointManager::instance(), SIGNAL( mediumConnected( int ) ), - this, SLOT( renderView() ) ); - connect( MountPointManager::instance(), SIGNAL( mediumRemoved( int ) ), - this, SLOT( renderView() ) ); + connect( this, TQT_SIGNAL( currentChanged( TQWidget* ) ), TQT_SLOT( tabChanged( TQWidget* ) ) ); + + connect( m_currentTrackPage->browserExtension(), TQT_SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ), + this, TQT_SLOT( openURLRequest( const KURL & ) ) ); + connect( m_lyricsPage->browserExtension(), TQT_SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ), + this, TQT_SLOT( openURLRequest( const KURL & ) ) ); + connect( m_wikiPage->browserExtension(), TQT_SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ), + this, TQT_SLOT( openURLRequest( const KURL & ) ) ); + + connect( m_currentTrackPage, TQT_SIGNAL( popupMenu( const TQString&, const TQPoint& ) ), + this, TQT_SLOT( slotContextMenu( const TQString&, const TQPoint& ) ) ); + connect( m_lyricsPage, TQT_SIGNAL( popupMenu( const TQString&, const TQPoint& ) ), + this, TQT_SLOT( slotContextMenu( const TQString&, const TQPoint& ) ) ); + connect( m_wikiPage, TQT_SIGNAL( popupMenu( const TQString&, const TQPoint& ) ), + this, TQT_SLOT( slotContextMenu( const TQString&, const TQPoint& ) ) ); + + connect( m_lyricsToolBar->getButton( LYRICS_ADD ), TQT_SIGNAL(clicked( int )), TQT_SLOT(lyricsAdd()) ); + connect( m_lyricsToolBar->getButton( LYRICS_EDIT ), TQT_SIGNAL(toggled( int )), TQT_SLOT(lyricsEditToggle()) ); + connect( m_lyricsToolBar->getButton( LYRICS_SEARCH ), TQT_SIGNAL(clicked( int )), TQT_SLOT(lyricsSearch()) ); + connect( m_lyricsToolBar->getButton( LYRICS_REFRESH ), TQT_SIGNAL(clicked( int )), TQT_SLOT(lyricsRefresh()) ); + connect( m_lyricsToolBar->getButton( LYRICS_BROWSER ), TQT_SIGNAL(clicked( int )), TQT_SLOT(lyricsExternalPage()) ); + + connect( m_wikiToolBar->getButton( WIKI_BACK ), TQT_SIGNAL(clicked( int )), TQT_SLOT(wikiHistoryBack()) ); + connect( m_wikiToolBar->getButton( WIKI_FORWARD ), TQT_SIGNAL(clicked( int )), TQT_SLOT(wikiHistoryForward()) ); + connect( m_wikiToolBar->getButton( WIKI_ARTIST ), TQT_SIGNAL(clicked( int )), TQT_SLOT(wikiArtistPage()) ); + connect( m_wikiToolBar->getButton( WIKI_ALBUM ), TQT_SIGNAL(clicked( int )), TQT_SLOT(wikiAlbumPage()) ); + connect( m_wikiToolBar->getButton( WIKI_TITLE ), TQT_SIGNAL(clicked( int )), TQT_SLOT(wikiTitlePage()) ); + connect( m_wikiToolBar->getButton( WIKI_BROWSER ), TQT_SIGNAL(clicked( int )), TQT_SLOT(wikiExternalPage()) ); + connect( m_wikiToolBar->getButton( WIKI_CONFIG ), TQT_SIGNAL(clicked( int )), TQT_SLOT(wikiConfig()) ); + + connect( m_wikiBackPopup, TQT_SIGNAL(activated( int )), TQT_SLOT(wikiBackPopupActivated( int )) ); + connect( m_wikiForwardPopup, TQT_SIGNAL(activated( int )), TQT_SLOT(wikiForwardPopupActivated( int )) ); + + connect( CollectionDB::instance(), TQT_SIGNAL( scanStarted() ), TQT_SLOT( collectionScanStarted() ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( scanDone( bool ) ), TQT_SLOT( collectionScanDone( bool ) ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( databaseEngineChanged() ), TQT_SLOT( renderView() ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( coverFetched( const TQString&, const TQString& ) ), + this, TQT_SLOT( coverFetched( const TQString&, const TQString& ) ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( coverChanged( const TQString&, const TQString& ) ), + this, TQT_SLOT( coverRemoved( const TQString&, const TQString& ) ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( similarArtistsFetched( const TQString& ) ), + this, TQT_SLOT( similarArtistsFetched( const TQString& ) ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( tagsChanged( const MetaBundle& ) ), + this, TQT_SLOT( tagsChanged( const MetaBundle& ) ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( tagsChanged( const TQString&, const TQString& ) ), + this, TQT_SLOT( tagsChanged( const TQString&, const TQString& ) ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( ratingChanged( const TQString&, int ) ), + this, TQT_SLOT( ratingOrScoreOrLabelsChanged( const TQString& ) ) ); + connect( StarManager::instance(), TQT_SIGNAL( ratingsColorsChanged() ), + this, TQT_SLOT( ratingOrScoreOrLabelsChanged( const TQString& ) ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( scoreChanged( const TQString&, float ) ), + this, TQT_SLOT( ratingOrScoreOrLabelsChanged( const TQString& ) ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( labelsChanged( const TQString& ) ), + this, TQT_SLOT( ratingOrScoreOrLabelsChanged( const TQString& ) ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( imageFetched( const TQString& ) ), + this, TQT_SLOT( imageFetched( const TQString& ) ) ); + + connect( App::instance(), TQT_SIGNAL( useScores( bool ) ), + this, TQT_SLOT( refreshCurrentTrackPage() ) ); + connect( App::instance(), TQT_SIGNAL( useRatings( bool ) ), + this, TQT_SLOT( refreshCurrentTrackPage() ) ); + + connect( MountPointManager::instance(), TQT_SIGNAL( mediumConnected( int ) ), + this, TQT_SLOT( renderView() ) ); + connect( MountPointManager::instance(), TQT_SIGNAL( mediumRemoved( int ) ), + this, TQT_SLOT( renderView() ) ); showContext( KURL( "current://track" ) ); @@ -406,9 +406,9 @@ ContextBrowser::~ContextBrowser() // PUBLIC METHODS ////////////////////////////////////////////////////////////////////////////////////////// -void ContextBrowser::setFont( const QFont &newFont ) +void ContextBrowser::setFont( const TQFont &newFont ) { - QWidget::setFont( newFont ); + TQWidget::setFont( newFont ); reloadStyleSheet(); } @@ -419,7 +419,7 @@ void ContextBrowser::setFont( const QFont &newFont ) void ContextBrowser::openURLRequest( const KURL &url ) { - QString artist, album, track; + TQString artist, album, track; Amarok::albumArtistTrackFromUrl( url.path(), artist, album, track ); // All http links should be loaded inside wikipedia tab, as that is the only tab that should contain them. @@ -429,7 +429,7 @@ void ContextBrowser::openURLRequest( const KURL &url ) if ( url.hasHTMLRef() ) { KURL base = url; - base.setRef(QString::null); + base.setRef(TQString::null); // Wikipedia also has links to otherpages with Anchors, so we have to check if it's for the current one if ( m_wikiCurrentUrl == base.url() ) { m_wikiPage->gotoAnchor( url.htmlRef() ); @@ -438,14 +438,14 @@ void ContextBrowser::openURLRequest( const KURL &url ) } // new page m_dirtyWikiPage = true; - m_wikiCurrentEntry = QString::null; + m_wikiCurrentEntry = TQString::null; showWikipedia( url.url() ); } else if ( url.protocol() == "show" ) { if ( url.path().contains( "suggestLyric-" ) ) { - QString _url = url.url().mid( url.url().find( QString( "-" ) ) +1 ); + TQString _url = url.url().mid( url.url().find( TQString( "-" ) ) +1 ); debug() << "Clicked lyrics URL: " << _url << endl; m_dirtyLyricsPage = true; showLyrics( _url ); @@ -477,15 +477,15 @@ void ContextBrowser::openURLRequest( const KURL &url ) // When left-clicking on cover image, open browser with amazon site else if ( url.protocol() == "fetchcover" ) { - QString albumPath = CollectionDB::instance()->albumImage(artist, album, false, 0 ); + TQString albumPath = CollectionDB::instance()->albumImage(artist, album, false, 0 ); if ( albumPath == CollectionDB::instance()->notAvailCover( false, 0 ) ) { CollectionDB::instance()->fetchCover( this, artist, album, false ); return; } - QImage img( albumPath ); - const QString amazonUrl = img.text( "amazon-url" ); + TQImage img( albumPath ); + const TQString amazonUrl = img.text( "amazon-url" ); if ( amazonUrl.isEmpty() ) KMessageBox::information( this, i18n( "

There is no product information available for this image.

Right-click on image for menu." ) ); @@ -496,14 +496,14 @@ void ContextBrowser::openURLRequest( const KURL &url ) /* open konqueror with musicbrainz search result for artist-album */ else if ( url.protocol() == "musicbrainz" ) { - const QString url = "http://www.musicbrainz.org/taglookup.html?artist=%1&album=%2&track=%3"; + const TQString url = "http://www.musicbrainz.org/taglookup.html?artist=%1&album=%2&track=%3"; Amarok::invokeBrowser( url.arg( KURL::encode_string_no_slash( artist, 106 /*utf-8*/ ), KURL::encode_string_no_slash( album, 106 /*utf-8*/ ), KURL::encode_string_no_slash( track, 106 /*utf-8*/ ) ) ); } else if ( url.protocol() == "externalurl" ) - Amarok::invokeBrowser( url.url().replace( QRegExp( "^externalurl:" ), "http:") ); + Amarok::invokeBrowser( url.url().replace( TQRegExp( "^externalurl:" ), "http:") ); else if ( url.protocol() == "lastfm" ) { @@ -540,13 +540,13 @@ void ContextBrowser::openURLRequest( const KURL &url ) else if ( url.protocol() == "wikipedia" ) { m_dirtyWikiPage = true; - QString entry = unescapeHTMLAttr( url.path() ); + TQString entry = unescapeHTMLAttr( url.path() ); showWikipediaEntry( entry ); } else if( url.protocol() == "ggartist" ) { - const QString url2 = QString( "http://www.google.com/musicsearch?q=%1&res=artist" ) + const TQString url2 = TQString( "http://www.google.com/musicsearch?q=%1&res=artist" ) .arg( KURL::encode_string_no_slash( unescapeHTMLAttr( url.path() ).replace( " ", "+" ), 106 /*utf-8*/ ) ); Amarok::invokeBrowser( url2 ); } @@ -558,7 +558,7 @@ void ContextBrowser::openURLRequest( const KURL &url ) else if( url.protocol() == "stream" ) { - Playlist::instance()->insertMedia( KURL::fromPathOrURL( url.url().replace( QRegExp( "^stream:" ), "http:" ) ), Playlist::DefaultOptions ); + Playlist::instance()->insertMedia( KURL::fromPathOrURL( url.url().replace( TQRegExp( "^stream:" ), "http:" ) ), Playlist::DefaultOptions ); } else if( url.protocol() == "compilationdisc" || url.protocol() == "albumdisc" ) @@ -611,7 +611,7 @@ void ContextBrowser::renderView() } -void ContextBrowser::lyricsChanged( const QString &url ) { +void ContextBrowser::lyricsChanged( const TQString &url ) { if ( url == EngineController::instance()->bundle().url().path() ) { m_dirtyLyricsPage = true; if ( currentPage() == m_lyricsTab ) @@ -642,8 +642,8 @@ void ContextBrowser::engineNewMetaData( const MetaBundle& bundle, bool trackChan if ( !m_metadataHistory.first().contains( bundle.prettyTitle() ) ) { newMetaData = true; - const QString timeString = KGlobal::locale()->formatTime( QTime::currentTime() ).replace(" ", " "); // don't break over lines - m_metadataHistory.prepend( QString( "" + timeString + " " + escapeHTML( bundle.prettyTitle() ) + "" ) ); + const TQString timeString = KGlobal::locale()->formatTime( TQTime::currentTime() ).replace(" ", " "); // don't break over lines + m_metadataHistory.prepend( TQString( "" + timeString + " " + escapeHTML( bundle.prettyTitle() ) + "" ) ); } if ( currentPage() == m_contextTab && ( bundle.url() != m_currentURL || newMetaData || !trackChanged ) ) @@ -675,8 +675,8 @@ void ContextBrowser::engineNewMetaData( const MetaBundle& bundle, bool trackChan */ // look for the cue file that matches the media file played first - QString path = bundle.url().path(); - QString cueFile = path.left( path.findRev('.') ) + ".cue"; + TQString path = bundle.url().path(); + TQString cueFile = path.left( path.findRev('.') ) + ".cue"; m_cuefile->setCueFileName( cueFile ); @@ -689,21 +689,21 @@ void ContextBrowser::engineNewMetaData( const MetaBundle& bundle, bool trackChan debug() << "[CUEFILE]: " << cueFile << " - Shoot blindly and missed, searching for other cue files." << endl; bool foundCueFile = false; - QDir dir ( bundle.directory() ); - dir.setFilter( QDir::Files ) ; + TQDir dir ( bundle.directory() ); + dir.setFilter( TQDir::Files ) ; dir.setNameFilter( "*.cue *.CUE" ) ; - QStringList cueFilesList = dir.entryList(); + TQStringList cueFilesList = dir.entryList(); if ( !cueFilesList.empty() ) - for ( QStringList::Iterator it = cueFilesList.begin(); it != cueFilesList.end() && !foundCueFile; ++it ) + for ( TQStringList::Iterator it = cueFilesList.begin(); it != cueFilesList.end() && !foundCueFile; ++it ) { - QFile file ( dir.filePath(*it) ); + TQFile file ( dir.filePath(*it) ); if( file.open( IO_ReadOnly ) ) { debug() << "[CUEFILE]: " << *it << " - Opened, looking for the matching FILE stanza." << endl; - QTextStream stream( &file ); - QString line; + TQTextStream stream( &file ); + TQString line; while ( !stream.atEnd() && !foundCueFile) { @@ -791,16 +791,16 @@ void ContextBrowser::engineStateChanged( Engine::State state, Engine::State oldS void ContextBrowser::saveHtmlData() { - QFile exportedDocument( Amarok::saveLocation() + "contextbrowser.html" ); + TQFile exportedDocument( Amarok::saveLocation() + "contextbrowser.html" ); if ( !exportedDocument.open( IO_WriteOnly ) ) warning() << "Failed to open file " << exportedDocument.name() << " write-only" << endl; else { - QTextStream stream( &exportedDocument ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &exportedDocument ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); stream << m_HTMLSource // the pure html data.. .replace( "", - QString( "" ) .arg( HTMLView::loadStyleSheet() ) ); // and the // stylesheet @@ -810,7 +810,7 @@ void ContextBrowser::saveHtmlData() } -void ContextBrowser::paletteChange( const QPalette& /* pal */ ) +void ContextBrowser::paletteChange( const TQPalette& /* pal */ ) { // KTabWidget::paletteChange( pal ); HTMLView::paletteChange(); @@ -857,7 +857,7 @@ void ContextBrowser::wheelDelta( int delta ) // PRIVATE SLOTS ////////////////////////////////////////////////////////////////////////////////////////// -void ContextBrowser::tabChanged( QWidget *page ) +void ContextBrowser::tabChanged( TQWidget *page ) { DEBUG_FUNC_INFO setFocusProxy( page ); //so focus is given to a sensible widget when the tab is opened @@ -870,7 +870,7 @@ DEBUG_FUNC_INFO showWikipedia(); } -void ContextBrowser::slotContextMenu( const QString& urlString, const QPoint& point ) +void ContextBrowser::slotContextMenu( const TQString& urlString, const TQPoint& point ) { enum { APPEND, ASNEXT, MAKE, MEDIA_DEVICE, INFO, TITLE, RELATED, SUGGEST, FAVES, FRESHPODCASTS, NEWALBUMS, FAVALBUMS, LABELS }; debug() << "url string: " << urlString << endl; @@ -894,7 +894,7 @@ void ContextBrowser::slotContextMenu( const QString& urlString, const QPoint& po KPopupMenu menu; KURL::List urls( url ); - QString artist, album, track; // track unused here + TQString artist, album, track; // track unused here Amarok::albumArtistTrackFromUrl( url.path(), artist, album, track ); if( urlString.isEmpty() ) @@ -931,7 +931,7 @@ void ContextBrowser::slotContextMenu( const QString& urlString, const QPoint& po } else if( url.protocol() == "stream" ) { - url = KURL::fromPathOrURL( url.url().replace( QRegExp( "^stream:" ), "http:" ) ); + url = KURL::fromPathOrURL( url.url().replace( TQRegExp( "^stream:" ), "http:" ) ); urls = KURL::List( url ); menu.insertTitle( i18n("Podcast"), TITLE ); menu.insertItem( SmallIconSet( Amarok::icon( "files" ) ), i18n( "&Load" ), MAKE ); @@ -1105,20 +1105,20 @@ public: CurrentTrackJob( ContextBrowser *parent ) : ThreadManager::DependentJob( parent, "CurrentTrackJob" ) , b( parent ) - , m_currentTrack( QDeepCopy( EngineController::instance()->bundle() ) ) + , m_currentTrack( TQDeepCopy( EngineController::instance()->bundle() ) ) , m_isStream( EngineController::engine()->isStream() ) { - for( QStringList::iterator it = b->m_metadataHistory.begin(); + for( TQStringList::iterator it = b->m_metadataHistory.begin(); it != b->m_metadataHistory.end(); ++it ) { - m_metadataHistory += QDeepCopy( *it ); + m_metadataHistory += TQDeepCopy( *it ); } - m_amarokIconPath = QDeepCopy(KGlobal::iconLoader()->iconPath( "amarok", + m_amarokIconPath = TQDeepCopy(KGlobal::iconLoader()->iconPath( "amarok", -KIcon::SizeEnormous ) ); - m_musicBrainIconPath = QDeepCopy(locate( "data", "amarok/images/musicbrainz.png" ) + m_musicBrainIconPath = TQDeepCopy(locate( "data", "amarok/images/musicbrainz.png" ) ); m_lastfmIcon = "file://" + locate( "data","amarok/images/lastfm.png" ); } @@ -1129,21 +1129,21 @@ private: void showLastFm( const MetaBundle ¤tTrack ); void showStream( const MetaBundle ¤tTrack ); void showPodcast( const MetaBundle ¤tTrack ); - void showBrowseArtistHeader( const QString &artist ); - void showBrowseLabelHeader( const QString &label ); + void showBrowseArtistHeader( const TQString &artist ); + void showBrowseLabelHeader( const TQString &label ); void showCurrentArtistHeader( const MetaBundle ¤tTrack ); - void showRelatedArtists( const QString &artist, const QStringList &relArtists ); - void showSuggestedSongs( const QStringList &relArtists ); - void showSongsWithLabel( const QString &label ); - void showArtistsFaves( const QString &artistName, uint artist_id ); - void showArtistsAlbums( const QString &artist, uint artist_id, uint album_id ); - void showArtistsCompilations( const QString &artist, uint artist_id, uint album_id ); + void showRelatedArtists( const TQString &artist, const TQStringList &relArtists ); + void showSuggestedSongs( const TQStringList &relArtists ); + void showSongsWithLabel( const TQString &label ); + void showArtistsFaves( const TQString &artistName, uint artist_id ); + void showArtistsAlbums( const TQString &artist, uint artist_id, uint album_id ); + void showArtistsCompilations( const TQString &artist, uint artist_id, uint album_id ); void showHome(); void showUserLabels( const MetaBundle ¤tTrack ); - QString fetchLastfmImage( const QString& url ); - QStringList showHomeByAlbums(); - void constructHTMLAlbums( const QStringList &albums, QString &htmlCode, const QString &idPrefix ); - static QString statsHTML( int score, int rating, bool statsbox = true ); // meh. + TQString fetchLastfmImage( const TQString& url ); + TQStringList showHomeByAlbums(); + void constructHTMLAlbums( const TQStringList &albums, TQString &htmlCode, const TQString &idPrefix ); + static TQString statsHTML( int score, int rating, bool statsbox = true ); // meh. virtual void completeJob() { @@ -1152,25 +1152,25 @@ private: // return; b->m_shownAlbums.clear(); - for( QStringList::iterator it = m_shownAlbums.begin(); + for( TQStringList::iterator it = m_shownAlbums.begin(); it != m_shownAlbums.end(); ++it ) - b->m_shownAlbums.append( QDeepCopy( *it ) ); - b->m_HTMLSource = QDeepCopy( m_HTMLSource ); + b->m_shownAlbums.append( TQDeepCopy( *it ) ); + b->m_HTMLSource = TQDeepCopy( m_HTMLSource ); b->m_currentTrackPage->set( m_HTMLSource ); b->m_dirtyCurrentTrackPage = false; b->saveHtmlData(); // Send html code to file } - QString m_HTMLSource; - QString m_amarokIconPath; - QString m_musicBrainIconPath; - QString m_lastfmIcon; + TQString m_HTMLSource; + TQString m_amarokIconPath; + TQString m_musicBrainIconPath; + TQString m_lastfmIcon; ContextBrowser *b; MetaBundle m_currentTrack; bool m_isStream; - QStringList m_shownAlbums; - QStringList m_metadataHistory; + TQStringList m_shownAlbums; + TQStringList m_metadataHistory; }; void @@ -1190,8 +1190,8 @@ ContextBrowser::showContext( const KURL &url, bool fromHistory ) { m_browseArtists = false; m_browseLabels = false; - m_label = QString::null; - m_artist = QString::null; + m_label = TQString::null; + m_artist = TQString::null; m_contextBackHistory.clear(); m_contextBackHistory.push_back( "current://track" ); } @@ -1199,14 +1199,14 @@ ContextBrowser::showContext( const KURL &url, bool fromHistory ) { m_browseArtists = true; m_browseLabels = false; - m_label = QString::null; + m_label = TQString::null; m_artist = unescapeHTMLAttr( url.path() ); } else if( url.protocol() == "showlabel" ) { m_browseLabels = true; m_browseArtists = false; - m_artist = QString::null; + m_artist = TQString::null; m_label = unescapeHTMLAttr( url.path() ); } @@ -1242,7 +1242,7 @@ void ContextBrowser::showCurrentTrack() //SLOT { debug() << "current browser is not context, aborting showCurrentTrack()" << endl; m_dirtyCurrentTrackPage = true; - m_currentTrackPage->set( QString( "

%1
" ) + m_currentTrackPage->set( TQString( "
%1
" ) .arg( i18n( "Updating..." ) ) ); return; } @@ -1271,7 +1271,7 @@ void ContextBrowser::showCurrentTrack() //SLOT if( !m_dirtyCurrentTrackPage ) return; m_currentURL = EngineController::instance()->bundle().url(); - m_currentTrackPage->write( QString::null ); + m_currentTrackPage->write( TQString::null ); ThreadManager::instance()->onlyOneJob( new CurrentTrackJob( this ) ); } @@ -1288,41 +1288,41 @@ void CurrentTrackJob::showHome() qb.clear(); //Song count qb.addReturnFunctionValue( QueryBuilder::funcCount, QueryBuilder::tabSong, QueryBuilder::valURL ); qb.setOptions( QueryBuilder::optRemoveDuplicates ); - QStringList a = qb.run(); - QString songCount = a[0]; + TQStringList a = qb.run(); + TQString songCount = a[0]; qb.clear(); //Artist count //qb.addReturnFunctionValue( QueryBuilder::funcCount, QueryBuilder::tabArtist, QueryBuilder::valID ); //qb.setOptions( QueryBuilder::optRemoveDuplicates ); //a = qb.run(); - //QString artistCount = a[0]; + //TQString artistCount = a[0]; qb.setOptions( QueryBuilder::optRemoveDuplicates ); qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valArtistID ); //I can't get the correct value w/o suing a subquery, and querybuilder doesn't support those - QString artistCount = QString::number( qb.run().count() ); + TQString artistCount = TQString::number( qb.run().count() ); qb.clear(); //Album count //qb.addReturnFunctionValue( QueryBuilder::funcCount, QueryBuilder::tabAlbum, QueryBuilder::valID ); //qb.setOptions( QueryBuilder::optRemoveDuplicates ); //a = qb.run(); - //QString albumCount = a[0]; + //TQString albumCount = a[0]; qb.setOptions( QueryBuilder::optRemoveDuplicates ); qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valAlbumID ); - QString albumCount = QString::number( qb.run().count() ); + TQString albumCount = TQString::number( qb.run().count() ); qb.clear(); //Genre count //qb.addReturnFunctionValue( QueryBuilder::funcCount, QueryBuilder::tabGenre, QueryBuilder::valID ); //qb.setOptions( QueryBuilder::optRemoveDuplicates ); //a = qb.run(); - //QString genreCount = a[0]; + //TQString genreCount = a[0]; qb.setOptions( QueryBuilder::optRemoveDuplicates ); qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valGenreID ); - QString genreCount = QString::number( qb.run().count() ); + TQString genreCount = TQString::number( qb.run().count() ); qb.clear(); //Total Playtime qb.addReturnFunctionValue( QueryBuilder::funcSum, QueryBuilder::tabSong, QueryBuilder::valLength ); a = qb.run(); - QString playTime = MetaBundle::fuzzyTime( a[0].toInt() ); + TQString playTime = MetaBundle::fuzzyTime( a[0].toInt() ); m_HTMLSource.append( QStringx( @@ -1347,7 +1347,7 @@ void CurrentTrackJob::showHome() "\n" "\n" "\n" ) - .args( QStringList() + .args( TQStringList() << escapeHTMLAttr( "externalurl://amarok.kde.org" ) << escapeHTMLAttr( m_amarokIconPath ) << i18n( "1 Track", "%n Tracks", songCount.toInt() ) @@ -1364,7 +1364,7 @@ void CurrentTrackJob::showHome() void -CurrentTrackJob::constructHTMLAlbums( const QStringList &reqResult, QString &htmlCode, const QString &stID ) +CurrentTrackJob::constructHTMLAlbums( const TQStringList &reqResult, TQString &htmlCode, const TQString &stID ) { // This function create the html code used to display a list of albums. Each album // is a 'toggleable' block. @@ -1388,41 +1388,41 @@ CurrentTrackJob::constructHTMLAlbums( const QStringList &reqResult, QString &htm qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valTrack ); qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valTitle ); qb.setOptions( QueryBuilder::optNoCompilations ); // samplers __need__ to be handled differently - QStringList albumValues = qb.run(); + TQStringList albumValues = qb.run(); - QString albumYear; + TQString albumYear; if ( !albumValues.isEmpty() ) { albumYear = albumValues[ 3 ]; for ( uint j = 0; j < albumValues.count(); j += qb.countReturnValues()) if ( albumValues[j + 3] != albumYear || albumYear == "0" ) { - albumYear = QString::null; + albumYear = TQString::null; break; } } uint i_albumLength = 0; for ( uint j = 0; j < albumValues.count(); j += qb.countReturnValues() ) - i_albumLength += QString(albumValues[j + 4]).toInt(); + i_albumLength += TQString(albumValues[j + 4]).toInt(); - QString albumLength = ( i_albumLength==0 ? i18n( "Unknown" ) : MetaBundle::prettyTime( i_albumLength, true ) ); + TQString albumLength = ( i_albumLength==0 ? i18n( "Unknown" ) : MetaBundle::prettyTime( i_albumLength, true ) ); htmlCode.append( QStringx ( - "\n" + "\n" "\n" "
\n" "\n" "\n") - .args( QStringList() + .args( TQStringList() << stID + reqResult[i+1] )); - QString albumName = escapeHTML( reqResult[ i ].isEmpty() ? i18n( "Unknown album" ) : reqResult[ i ] ); + TQString albumName = escapeHTML( reqResult[ i ].isEmpty() ? i18n( "Unknown album" ) : reqResult[ i ] ); - QString artistName = albumValues[5].isEmpty() ? i18n( "Unknown artist" ) : albumValues[5]; + TQString artistName = albumValues[5].isEmpty() ? i18n( "Unknown artist" ) : albumValues[5]; - QString albumImage = ContextBrowser::getEncodedImage( CollectionDB::instance()->albumImage( albumValues[5], reqResult[ i ], true, 50 ) ); - QString albumImageTitleAttr = albumImageTooltip( albumImage, 50 ); + TQString albumImage = ContextBrowser::getEncodedImage( CollectionDB::instance()->albumImage( albumValues[5], reqResult[ i ], true, 50 ) ); + TQString albumImageTitleAttr = albumImageTooltip( albumImage, 50 ); // Album image htmlCode.append( QStringx ( @@ -1439,7 +1439,7 @@ CurrentTrackJob::constructHTMLAlbums( const QStringList &reqResult, QString &htm "\n" "%9\n" "\n" ) - .args( QStringList() + .args( TQStringList() << escapeHTMLAttr( albumValues[5] ) // artist name << escapeHTMLAttr( reqResult[ i ].isEmpty() ? i18n( "Unknown" ) : reqResult[ i ] ) // album.name << albumImageTitleAttr @@ -1457,7 +1457,7 @@ CurrentTrackJob::constructHTMLAlbums( const QStringList &reqResult, QString &htm "%2\n" "%3\n" "\n") - .args( QStringList() + .args( TQStringList() << i18n( "Single", "%n Tracks", albumValues.count() / qb.countReturnValues() ) << albumYear << albumLength) ); @@ -1468,17 +1468,17 @@ CurrentTrackJob::constructHTMLAlbums( const QStringList &reqResult, QString &htm "
\n" "
\n" "
\n" ) - .args( QStringList() + .args( TQStringList() << "none" /* shows it if it's the current track album */ << stID + reqResult[ i + 1 ] ) ); - QString discNumber; + TQString discNumber; if ( !albumValues.isEmpty() ) { for ( uint j = 0; j < albumValues.count(); j += qb.countReturnValues() ) { - QString newDiscNumber = albumValues[ j + 7 ].stripWhiteSpace(); + TQString newDiscNumber = albumValues[ j + 7 ].stripWhiteSpace(); if( discNumber != newDiscNumber && newDiscNumber.toInt() > 0) { discNumber = newDiscNumber; @@ -1488,13 +1488,13 @@ CurrentTrackJob::constructHTMLAlbums( const QStringList &reqResult, QString &htm "%4" "\n" "
\n" ) - .args( QStringList() + .args( TQStringList() << albumValues[6] << reqResult[ i + 1 ] //album.id << escapeHTMLAttr( discNumber ) << i18n( "Disc %1" ).arg( discNumber ) ) ); } - QString track = albumValues[j + 2].stripWhiteSpace(); + TQString track = albumValues[j + 2].stripWhiteSpace(); if( track.length() > 0 ) { if( track.length() == 1 ) @@ -1503,9 +1503,9 @@ CurrentTrackJob::constructHTMLAlbums( const QStringList &reqResult, QString &htm track = "\n" + track + " \n"; } - QString length; + TQString length; if( albumValues[j + 4] != "0" ) - length = "(" + MetaBundle::prettyTime( QString(albumValues[j + 4]).toInt(), true ) + ")\n"; + length = "(" + MetaBundle::prettyTime( TQString(albumValues[j + 4]).toInt(), true ) + ")\n"; htmlCode.append( "
\n" @@ -1543,7 +1543,7 @@ CurrentTrackJob::showHomeByAlbums() qb.sortBy( QueryBuilder::tabPodcastEpisodes, QueryBuilder::valID, true ); qb.setOptions( QueryBuilder::optRemoveDuplicates ); qb.setLimit( 0, 5 ); - QStringList channels = qb.run(); + TQStringList channels = qb.run(); if( channels.count() > 0 ) { @@ -1557,7 +1557,7 @@ CurrentTrackJob::showHomeByAlbums() "\n" ); uint i = 0; - for( QStringList::iterator it = channels.begin(); + for( TQStringList::iterator it = channels.begin(); it != channels.end(); it++ ) { @@ -1565,21 +1565,21 @@ CurrentTrackJob::showHomeByAlbums() if( !CollectionDB::instance()->getPodcastChannelBundle( *it, &pcb ) ) continue; - QValueList episodes = CollectionDB::instance()->getPodcastEpisodes( *it, true /* only new */, 1 ); + TQValueList episodes = CollectionDB::instance()->getPodcastEpisodes( *it, true /* only new */, 1 ); if( !episodes.isEmpty() ) { PodcastEpisodeBundle &ep = *episodes.begin(); - QString date; + TQString date; ep.dateTime().isNull() ? date = ep.date() : date = ep.dateTime().toString(); - QString image = CollectionDB::instance()->podcastImage( pcb.imageURL().url(), true, 50 ); - QString imageAttr = escapeHTMLAttr( i18n( "Click to go to podcast website: %1." ).arg( pcb.link().prettyURL() ) ); + TQString image = CollectionDB::instance()->podcastImage( pcb.imageURL().url(), true, 50 ); + TQString imageAttr = escapeHTMLAttr( i18n( "Click to go to podcast website: %1." ).arg( pcb.link().prettyURL() ) ); m_HTMLSource.append( QStringx ( - "\n" + "\n" "\n" "
\n" "
\n" "\n" @@ -1599,19 +1599,19 @@ CurrentTrackJob::showHomeByAlbums() "
\n" "
\n" "
\n" ) - .args( QStringList() - << QString::number( i ) - << pcb.link().url().replace( QRegExp( "^http:" ), "externalurl:" ) + .args( TQStringList() + << TQString::number( i ) + << pcb.link().url().replace( TQRegExp( "^http:" ), "externalurl:" ) << escapeHTMLAttr( imageAttr ) << escapeHTMLAttr( image ) - << escapeHTML( ep.duration() ? MetaBundle::prettyTime( ep.duration() ) : QString( "" ) ) + << escapeHTML( ep.duration() ? MetaBundle::prettyTime( ep.duration() ) : TQString( "" ) ) << ( ep.localUrl().isValid() ? ep.localUrl().url() - : ep.url().url().replace( QRegExp( "^http:" ), "stream:" ) ) + : ep.url().url().replace( TQRegExp( "^http:" ), "stream:" ) ) << escapeHTML( pcb.title() + ": " + ep.title() ) << escapeHTML( date ) << "none" - << QString::number( i ) + << TQString::number( i ) ) ); @@ -1634,7 +1634,7 @@ CurrentTrackJob::showHomeByAlbums() } // - QStringList albums; + TQStringList albums; // if( ContextBrowser::instance()->m_showNewestAlbums ) { @@ -1650,7 +1650,7 @@ CurrentTrackJob::showHomeByAlbums() qb.groupBy( QueryBuilder::tabAlbum, QueryBuilder::valName ); qb.setOptions( QueryBuilder::optNoCompilations ); // samplers __need__ to be handled differently qb.setLimit( 0, 5 ); - QStringList recentAlbums = qb.run(); + TQStringList recentAlbums = qb.run(); foreach( recentAlbums ) { @@ -1696,8 +1696,8 @@ CurrentTrackJob::showHomeByAlbums() qb.groupBy( QueryBuilder::tabAlbum, QueryBuilder::valName ); qb.setOptions( QueryBuilder::optNoCompilations ); // samplers __need__ to be handled differently qb.setLimit( 0, 5 ); - QStringList faveAlbums = qb.run(); - QStringList faveResults; + TQStringList faveAlbums = qb.run(); + TQStringList faveResults; bool ratings = AmarokConfig::useRatings(); bool scores = AmarokConfig::useScores(); @@ -1758,25 +1758,25 @@ void CurrentTrackJob::showLastFm( const MetaBundle ¤tTrack ) const LastFm::Bundle *lastFmInfo = currentTrack.lastFmBundle(); if ( !lastFmInfo ) return; - const QString username = AmarokConfig::scrobblerUsername(); - const QString userpage = "www.last.fm/user/" + username; //no http - const QString albumUrl = lastFmInfo->albumUrl(); - const QString artistUrl = lastFmInfo->artistUrl(); - const QString titleUrl = lastFmInfo->titleUrl(); + const TQString username = AmarokConfig::scrobblerUsername(); + const TQString userpage = "www.last.fm/user/" + username; //no http + const TQString albumUrl = lastFmInfo->albumUrl(); + const TQString artistUrl = lastFmInfo->artistUrl(); + const TQString titleUrl = lastFmInfo->titleUrl(); - const QString coverImage = ContextBrowser::getEncodedImage( lastFmInfo->imageUrl() ); + const TQString coverImage = ContextBrowser::getEncodedImage( lastFmInfo->imageUrl() ); - QPtrList newUrls; + TQPtrList newUrls; newUrls.append( &albumUrl ); newUrls.append( &artistUrl ); newUrls.append( &titleUrl ); - for ( QString* url = newUrls.first(); url; url = newUrls.next() ) - url->replace( QRegExp( "^http:" ), "externalurl:" ); + for ( TQString* url = newUrls.first(); url; url = newUrls.next() ) + url->replace( TQRegExp( "^http:" ), "externalurl:" ); - const QString skipIcon = KGlobal::iconLoader()->iconPath( Amarok::icon("next"), -KIcon::SizeSmallMedium ); - const QString loveIcon = KGlobal::iconLoader()->iconPath( Amarok::icon("love"), -KIcon::SizeSmallMedium ); - const QString banIcon = KGlobal::iconLoader()->iconPath( Amarok::icon("remove"), -KIcon::SizeSmallMedium ); + const TQString skipIcon = KGlobal::iconLoader()->iconPath( Amarok::icon("next"), -KIcon::SizeSmallMedium ); + const TQString loveIcon = KGlobal::iconLoader()->iconPath( Amarok::icon("love"), -KIcon::SizeSmallMedium ); + const TQString banIcon = KGlobal::iconLoader()->iconPath( Amarok::icon("remove"), -KIcon::SizeSmallMedium ); m_HTMLSource.append( QStringx( @@ -1824,7 +1824,7 @@ void CurrentTrackJob::showLastFm( const MetaBundle ¤tTrack ) "
\n" "
\n" ) - .args( QStringList() + .args( TQStringList() << escapeHTML( LastFm::Controller::stationDescription() ) //1 << artistUrl //2 << escapeHTML( currentTrack.artist() ) //3 @@ -1850,7 +1850,7 @@ void CurrentTrackJob::showLastFm( const MetaBundle ¤tTrack ) if( ContextBrowser::instance()->m_showRelated || ContextBrowser::instance()->m_showSuggested ) { - QStringList relArtists = CollectionDB::instance()->similarArtists( currentTrack.artist(), 10 ); + TQStringList relArtists = CollectionDB::instance()->similarArtists( currentTrack.artist(), 10 ); if ( !relArtists.isEmpty() ) { if( ContextBrowser::instance()->m_showRelated ) @@ -1903,7 +1903,7 @@ void CurrentTrackJob::showStream( const MetaBundle ¤tTrack ) "\n" "\n" "\n" ) - .args( QStringList() + .args( TQStringList() << i18n( "Stream Details" ) << escapeHTML( currentTrack.prettyTitle() ) << escapeHTML( currentTrack.streamName() ) @@ -1928,7 +1928,7 @@ void CurrentTrackJob::addMetaHistory() for ( uint i = 0; i < m_metadataHistory.count(); ++i ) { - const QString &str = m_metadataHistory[i]; + const TQString &str = m_metadataHistory[i]; m_HTMLSource.append( QStringx( "%1\n" ).arg( str ) ); } @@ -1952,13 +1952,13 @@ void CurrentTrackJob::showPodcast( const MetaBundle ¤tTrack ) channelInDB = false; } - QString image; + TQString image; if( pcb.imageURL().isValid() ) image = CollectionDB::instance()->podcastImage( pcb.imageURL().url(), true ); else image = CollectionDB::instance()->notAvailCover( true ); - QString imageAttr = escapeHTMLAttr( pcb.link().isValid() + TQString imageAttr = escapeHTMLAttr( pcb.link().isValid() ? i18n( "Click to go to podcast website: %1." ).arg( pcb.link().prettyURL() ) : i18n( "No podcast website." ) ); @@ -1984,11 +1984,11 @@ void CurrentTrackJob::showPodcast( const MetaBundle ¤tTrack ) "\n" "\n" "\n" ) - .args( QStringList() + .args( TQStringList() << escapeHTML( pcb.title() ) << escapeHTML( peb.title() ) << ( pcb.link().isValid() - ? pcb.link().url().replace( QRegExp( "^http:" ), "externalurl:" ) + ? pcb.link().url().replace( TQRegExp( "^http:" ), "externalurl:" ) : "current://track" ) << image << imageAttr @@ -2010,7 +2010,7 @@ void CurrentTrackJob::showPodcast( const MetaBundle ¤tTrack ) for ( uint i = 0; i < m_metadataHistory.count(); ++i ) { - const QString &str = m_metadataHistory[i]; + const TQString &str = m_metadataHistory[i]; m_HTMLSource.append( QStringx( "%1\n" ).arg( str ) ); } @@ -2032,18 +2032,18 @@ void CurrentTrackJob::showPodcast( const MetaBundle ¤tTrack ) "\n" ); uint i = 0; - QValueList episodes = CollectionDB::instance()->getPodcastEpisodes( peb.parent() ); + TQValueList episodes = CollectionDB::instance()->getPodcastEpisodes( peb.parent() ); while( !episodes.isEmpty() ) { PodcastEpisodeBundle &ep = episodes.back(); - QString date; + TQString date; ep.dateTime().isNull() ? date = ep.date() : date = ep.dateTime().toString(); m_HTMLSource.append( QStringx ( - "\n" + "\n" "\n" "\n" @@ -2126,7 +2126,7 @@ void CurrentTrackJob::showBrowseArtistHeader( const QString &artist ) m_HTMLSource.append( "\n" "\n" @@ -2134,7 +2134,7 @@ void CurrentTrackJob::showBrowseArtistHeader( const QString &artist ) m_HTMLSource.append( "\n" "\n" @@ -2150,17 +2150,17 @@ void CurrentTrackJob::showBrowseArtistHeader( const QString &artist ) } void -CurrentTrackJob::showBrowseLabelHeader( const QString &label ) +CurrentTrackJob::showBrowseLabelHeader( const TQString &label ) { bool linkback = ( b->m_contextBackHistory.size() > 0 ); - QString back = ( linkback + TQString back = ( linkback ? "\n" + escapeHTML( i18n( "<- Back" ) ) + "\n" - : QString( "" ) + : TQString( "" ) ); m_HTMLSource.append( - QString( + TQString( "
\n" "
\n" "%1\n" @@ -2180,7 +2180,7 @@ CurrentTrackJob::showBrowseLabelHeader( const QString &label ) m_HTMLSource.append( "
\n" "\n" @@ -2190,7 +2190,7 @@ CurrentTrackJob::showBrowseLabelHeader( const QString &label ) m_HTMLSource.append( "\n" "\n" @@ -2206,7 +2206,7 @@ CurrentTrackJob::showBrowseLabelHeader( const QString &label ) void CurrentTrackJob::showCurrentArtistHeader( const MetaBundle ¤tTrack ) { QueryBuilder qb; - QStringList values; + TQStringList values; // qb.clear(); qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valCreateDate ); @@ -2219,14 +2219,14 @@ void CurrentTrackJob::showCurrentArtistHeader( const MetaBundle ¤tTrack ) usleep( 10000 ); //making 2 tables is most probably not the cleanest way to do it, but it works. - QString albumImage = ContextBrowser::getEncodedImage( CollectionDB::instance()->albumImage( currentTrack, true, 1 ) ); - QString albumImageTitleAttr = albumImageTooltip( albumImage, 0 ); + TQString albumImage = ContextBrowser::getEncodedImage( CollectionDB::instance()->albumImage( currentTrack, true, 1 ) ); + TQString albumImageTitleAttr = albumImageTooltip( albumImage, 0 ); bool isCompilation = false; if( !currentTrack.album().isEmpty() ) { isCompilation = CollectionDB::instance()->albumIsCompilation( - QString::number( CollectionDB::instance()->albumID( currentTrack.album() ) ) + TQString::number( CollectionDB::instance()->albumID( currentTrack.album() ) ) ); } @@ -2256,7 +2256,7 @@ void CurrentTrackJob::showCurrentArtistHeader( const MetaBundle ¤tTrack ) "\n" "\n" ) - .args( QStringList() + .args( TQStringList() << escapeHTML( currentTrack.title() ) << escapeHTML( currentTrack.artist() ) << escapeHTML( currentTrack.album() ) @@ -2269,7 +2269,7 @@ void CurrentTrackJob::showCurrentArtistHeader( const MetaBundle ¤tTrack ) << escapeHTMLAttr( currentTrack.album() ) << escapeHTMLAttr( currentTrack.title() ) << escapeHTML( m_musicBrainIconPath ) ) - : QString ( //no title + : TQString ( //no title "%1 " "\n" "
\n" "
\n" "\n" @@ -2059,16 +2059,16 @@ void CurrentTrackJob::showPodcast( const MetaBundle ¤tTrack ) "
\n" "
\n" "
\n" ) - .args( QStringList() - << QString::number( i ) - << escapeHTML( ep.duration() ? MetaBundle::prettyTime( ep.duration() ) : QString( "" ) ) + .args( TQStringList() + << TQString::number( i ) + << escapeHTML( ep.duration() ? MetaBundle::prettyTime( ep.duration() ) : TQString( "" ) ) << ( ep.localUrl().isValid() ? ep.localUrl().url() - : ep.url().url().replace( QRegExp( "^http:" ), "stream:" ) ) + : ep.url().url().replace( TQRegExp( "^http:" ), "stream:" ) ) << escapeHTML( ep.title() ) << escapeHTML( date ) << (peb.url() == ep.url() ? "block" : "none" ) - << QString::number( i ) + << TQString::number( i ) ) ); @@ -2085,18 +2085,18 @@ void CurrentTrackJob::showPodcast( const MetaBundle ¤tTrack ) m_HTMLSource.append("\n" ); } -void CurrentTrackJob::showBrowseArtistHeader( const QString &artist ) +void CurrentTrackJob::showBrowseArtistHeader( const TQString &artist ) { // bool linkback = ( b->m_contextBackHistory.size() > 0 ); - QString back = ( linkback + TQString back = ( linkback ? "\n" + escapeHTML( i18n( "<- Back" ) ) + "\n" - : QString( "" ) + : TQString( "" ) ); m_HTMLSource.append( - QString( + TQString( "
\n" "
\n" "%1\n" @@ -2116,7 +2116,7 @@ void CurrentTrackJob::showBrowseArtistHeader( const QString &artist ) m_HTMLSource.append( "
\n" - + QString( "\n" ) + + TQString( "\n" ) + i18n( "Information for Current Track" ) + "\n" "
\n" - + QString( "\n" ).arg( escapeHTMLAttr( artist + b->wikiArtistPostfix() ) ) + + TQString( "\n" ).arg( escapeHTMLAttr( artist + b->wikiArtistPostfix() ) ) + i18n( "Wikipedia Information for %1" ).arg( escapeHTML( artist ) ) + "\n" "
\n" - + QString( "\n" ).arg( escapeHTMLAttr( artist ) ) + + TQString( "\n" ).arg( escapeHTMLAttr( artist ) ) + i18n( "Google Musicsearch for %1" ).arg( escapeHTML( artist ) ) + "\n" "
\n" - + QString( "\n" ) + + TQString( "\n" ) + i18n( "Information for Current Track" ) + "\n" "
\n" - + QString( "\n" ).arg( escapeHTMLAttr( label ) ) + + TQString( "\n" ).arg( escapeHTMLAttr( label ) ) + i18n( "Last.fm Information for %1" ).arg( escapeHTML( label ) ) + "\n" "
\n" @@ -2290,9 +2290,9 @@ void CurrentTrackJob::showCurrentArtistHeader( const MetaBundle ¤tTrack ) if ( !values.isEmpty() && values[2].toInt() ) { - QDateTime firstPlay = QDateTime(); + TQDateTime firstPlay = TQDateTime(); firstPlay.setTime_t( values[0].toUInt() ); - QDateTime lastPlay = QDateTime(); + TQDateTime lastPlay = TQDateTime(); lastPlay.setTime_t( values[1].toUInt() ); const uint playtimes = values[2].toInt(); @@ -2301,7 +2301,7 @@ void CurrentTrackJob::showCurrentArtistHeader( const MetaBundle ¤tTrack ) //SAFE = .arg( x, y ) //UNSAFE = .arg( x ).arg( y ) - m_HTMLSource.append( QString( + m_HTMLSource.append( TQString( "%1
\n" "
%2
\n" "%3
\n" @@ -2359,10 +2359,10 @@ void CurrentTrackJob::showCurrentArtistHeader( const MetaBundle ¤tTrack ) uint i = 0; for ( it = b->m_cuefile->begin(); it != b->m_cuefile->end(); ++it ) { m_HTMLSource.append( - "\n" + "\n" "\n" + "\n" "\n" + "\n" "\n" + "\n" "\n" + "\n" "\n" + "\n" "\n" ).arg( i18n( "Score: %1" ).arg( score ) ) + - "\n" + contents += TQString( "\n" ).arg( i18n( "Score: %1" ).arg( score ) ) + + "\n" "\n" "\n"; if( AmarokConfig::useRatings() ) { - contents += QString( "\n" ).arg( i18n( "Rating: %1" ) + contents += TQString( "\n" ).arg( i18n( "Rating: %1" ) .arg( MetaBundle::ratingDescription( rating ) ) ) + ".*", false ); + TQRegExp hidden( ".*", false ); hidden.setMinimal( true ); //greedy behaviour wouldn't be any good! - m_wiki.replace( hidden, QString::null ); + m_wiki.replace( hidden, TQString::null ); // we want to keep our own style (we need to modify the stylesheet a bit to handle things nicely) - m_wiki.replace( QRegExp( "style= *\"[^\"]*\"" ), QString::null ); - m_wiki.replace( QRegExp( "class= *\"[^\"]*\"" ), QString::null ); + m_wiki.replace( TQRegExp( "style= *\"[^\"]*\"" ), TQString::null ); + m_wiki.replace( TQRegExp( "class= *\"[^\"]*\"" ), TQString::null ); // let's remove the form elements, we don't want them. - m_wiki.replace( QRegExp( "]*>" ), QString::null ); - m_wiki.replace( QRegExp( "]*>" ), QString::null ); - m_wiki.replace( "\n" , QString::null ); - m_wiki.replace( QRegExp( "]*>" ), QString::null ); - m_wiki.replace( "\n" , QString::null ); - m_wiki.replace( QRegExp( "]*>" ), QString::null ); - m_wiki.replace( "" , QString::null ); + m_wiki.replace( TQRegExp( "]*>" ), TQString::null ); + m_wiki.replace( TQRegExp( "]*>" ), TQString::null ); + m_wiki.replace( "\n" , TQString::null ); + m_wiki.replace( TQRegExp( "]*>" ), TQString::null ); + m_wiki.replace( "\n" , TQString::null ); + m_wiki.replace( TQRegExp( "]*>" ), TQString::null ); + m_wiki.replace( "" , TQString::null ); //first we convert all the links with protocol to external, as they should all be External Links. - m_wiki.replace( QRegExp( "href= *\"http:" ), "href=\"externalurl:" ); - m_wiki.replace( QRegExp( "href= *\"/" ), "href=\"" +m_wikiBaseUrl ); - m_wiki.replace( QRegExp( "href= *\"#" ), "href=\"" +m_wikiCurrentUrl + '#' ); + m_wiki.replace( TQRegExp( "href= *\"http:" ), "href=\"externalurl:" ); + m_wiki.replace( TQRegExp( "href= *\"/" ), "href=\"" +m_wikiBaseUrl ); + m_wiki.replace( TQRegExp( "href= *\"#" ), "href=\"" +m_wikiCurrentUrl + '#' ); m_HTMLSource = "\n"; m_HTMLSource.append( @@ -4263,7 +4263,7 @@ ContextBrowser::wikiResult( KIO::Job* job ) //SLOT void -ContextBrowser::coverFetched( const QString &artist, const QString &album ) //SLOT +ContextBrowser::coverFetched( const TQString &artist, const TQString &album ) //SLOT { if ( currentPage() == m_contextTab && !EngineController::engine()->loaded() && @@ -4289,7 +4289,7 @@ ContextBrowser::coverFetched( const QString &artist, const QString &album ) //SL void -ContextBrowser::coverRemoved( const QString &artist, const QString &album ) //SLOT +ContextBrowser::coverRemoved( const TQString &artist, const TQString &album ) //SLOT { if ( currentPage() == m_contextTab && !EngineController::engine()->loaded() && @@ -4315,7 +4315,7 @@ ContextBrowser::coverRemoved( const QString &artist, const QString &album ) //SL void -ContextBrowser::similarArtistsFetched( const QString &artist ) //SLOT +ContextBrowser::similarArtistsFetched( const TQString &artist ) //SLOT { if( artist == m_artist || EngineController::instance()->bundle().artist().string() == artist ) { m_dirtyCurrentTrackPage = true; @@ -4325,7 +4325,7 @@ ContextBrowser::similarArtistsFetched( const QString &artist ) //SLOT } void -ContextBrowser::imageFetched( const QString &url ) //SLOT +ContextBrowser::imageFetched( const TQString &url ) //SLOT { const MetaBundle ¤tTrack = EngineController::instance()->bundle(); PodcastEpisodeBundle peb; @@ -4343,7 +4343,7 @@ ContextBrowser::imageFetched( const QString &url ) //SLOT } } -void ContextBrowser::ratingOrScoreOrLabelsChanged( const QString &path ) //SLOT +void ContextBrowser::ratingOrScoreOrLabelsChanged( const TQString &path ) //SLOT { const MetaBundle ¤tTrack = EngineController::instance()->bundle(); @@ -4374,7 +4374,7 @@ void ContextBrowser::tagsChanged( const MetaBundle &bundle ) //SLOT refreshCurrentTrackPage(); } -void ContextBrowser::tagsChanged( const QString &oldArtist, const QString &oldAlbum ) //SLOT +void ContextBrowser::tagsChanged( const TQString &oldArtist, const TQString &oldAlbum ) //SLOT { const MetaBundle ¤tTrack = EngineController::instance()->bundle(); @@ -4404,7 +4404,7 @@ void ContextBrowser::refreshCurrentTrackPage() //SLOT bool ContextBrowser::hasContextProtocol( const KURL &url ) { - QString protocol = url.protocol(); + TQString protocol = url.protocol(); return protocol == "album" || protocol == "artist" || protocol == "stream" @@ -4418,31 +4418,31 @@ KURL::List ContextBrowser::expandURL( const KURL &url ) { KURL::List urls; - QString protocol = url.protocol(); + TQString protocol = url.protocol(); if( protocol == "artist" ) { uint artist_id = CollectionDB::instance()->artistID( url.path(), false ); if( artist_id ) { - QStringList trackUrls = CollectionDB::instance()->artistTracks( QString::number( artist_id ) ); + TQStringList trackUrls = CollectionDB::instance()->artistTracks( TQString::number( artist_id ) ); foreach( trackUrls ) urls += KURL::fromPathOrURL( *it ); } } else if( protocol == "album" ) { - QString artist, album, track; // track unused here + TQString artist, album, track; // track unused here Amarok::albumArtistTrackFromUrl( url.path(), artist, album, track ); - QStringList trackUrls = CollectionDB::instance()->albumTracks( artist, album ); + TQStringList trackUrls = CollectionDB::instance()->albumTracks( artist, album ); foreach( trackUrls ) { urls += KURL::fromPathOrURL( *it ); } } else if( protocol == "albumdisc" ) { - QString artist, album, discnumber; // discnumber is returned in track number field + TQString artist, album, discnumber; // discnumber is returned in track number field Amarok::albumArtistTrackFromUrl( url.path(), artist, album, discnumber ); - QStringList trackUrls = CollectionDB::instance()->albumDiscTracks( artist, album, discnumber ); + TQStringList trackUrls = CollectionDB::instance()->albumDiscTracks( artist, album, discnumber ); foreach( trackUrls ) { urls += KURL::fromPathOrURL( *it ); } @@ -4454,14 +4454,14 @@ ContextBrowser::expandURL( const KURL &url ) qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valDiscNumber ); qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valTrack ); qb.setOptions( QueryBuilder::optOnlyCompilations ); - QStringList values = qb.run(); + TQStringList values = qb.run(); - for( QStringList::ConstIterator it = values.begin(), end = values.end(); it != end; ++it ) { + for( TQStringList::ConstIterator it = values.begin(), end = values.end(); it != end; ++it ) { urls += KURL::fromPathOrURL( *it ); } } else if( protocol == "compilationdisc") { - QString artist, album, discnumber; // artist is unused + TQString artist, album, discnumber; // artist is unused Amarok::albumArtistTrackFromUrl( url.path(), artist, album, discnumber ); QueryBuilder qb; @@ -4470,28 +4470,28 @@ ContextBrowser::expandURL( const KURL &url ) qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valDiscNumber, discnumber ); qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valTrack ); qb.setOptions( QueryBuilder::optOnlyCompilations ); - QStringList values = qb.run(); + TQStringList values = qb.run(); - for( QStringList::ConstIterator it = values.begin(), end = values.end(); it != end; ++it ) { + for( TQStringList::ConstIterator it = values.begin(), end = values.end(); it != end; ++it ) { urls += KURL::fromPathOrURL( *it ); } } else if( protocol == "fetchcover" ) { - QString artist, album, track; // track unused here + TQString artist, album, track; // track unused here Amarok::albumArtistTrackFromUrl( url.path(), artist, album, track ); - QString artistID = QString::number( CollectionDB::instance()->artistID( artist ) ); - QString albumID = QString::number( CollectionDB::instance()->albumID( album ) ); + TQString artistID = TQString::number( CollectionDB::instance()->artistID( artist ) ); + TQString albumID = TQString::number( CollectionDB::instance()->albumID( album ) ); - QStringList trackUrls = CollectionDB::instance()->albumTracks( artistID, albumID ); + TQStringList trackUrls = CollectionDB::instance()->albumTracks( artistID, albumID ); foreach( trackUrls ) { urls += KURL::fromPathOrURL( *it ); } } else if( protocol == "stream" ) { - urls += KURL::fromPathOrURL( url.url().replace( QRegExp( "^stream:" ), "http:" ) ); + urls += KURL::fromPathOrURL( url.url().replace( TQRegExp( "^stream:" ), "http:" ) ); } return urls; diff --git a/amarok/src/contextbrowser.h b/amarok/src/contextbrowser.h index f99304a9..7cc24538 100644 --- a/amarok/src/contextbrowser.h +++ b/amarok/src/contextbrowser.h @@ -22,10 +22,10 @@ class Color; class HTMLView; class KPopupMenu; class MetaBundle; -class QPalette; -class QVBox; -class QLineEdit; -class QComboBox; +class TQPalette; +class TQVBox; +class TQLineEdit; +class TQComboBox; class KDialogBase; class KTabBar; class KTextEdit; @@ -51,48 +51,48 @@ class ContextBrowser : public KTabWidget, public EngineObserver static ContextBrowser *instance() { return s_instance; } - void setFont( const QFont& ); + void setFont( const TQFont& ); void reloadStyleSheet(); static KURL::List expandURL( const KURL &url ); // expand urls (album, compilation, ...) static bool hasContextProtocol( const KURL &url ); // is url expandable by context browser? - virtual bool eventFilter( QObject *o, QEvent *e ); //required by the labels dialog + virtual bool eventFilter( TQObject *o, TQEvent *e ); //required by the labels dialog public slots: void openURLRequest(const KURL &url ); void collectionScanStarted(); void collectionScanDone( bool changed ); void renderView(); - void lyricsChanged( const QString& ); + void lyricsChanged( const TQString& ); void lyricsScriptChanged(); - void lyricsResult( QCString cXmlDoc, bool cached = false ); + void lyricsResult( TQCString cXmlDoc, bool cached = false ); protected: void engineNewMetaData( const MetaBundle&, bool ); void engineStateChanged( Engine::State, Engine::State = Engine::Empty ); - void paletteChange( const QPalette& ); + void paletteChange( const TQPalette& ); protected slots: void wheelDelta( int delta ); private slots: - void tabChanged( QWidget *page ); - void slotContextMenu( const QString& urlString, const QPoint& point ); + void tabChanged( TQWidget *page ); + void slotContextMenu( const TQString& urlString, const TQPoint& point ); void showContext( const KURL& url, bool fromHistory = false ); void showCurrentTrack(); - void showLyrics( const QString& url = QString::null ); - void showWikipedia( const QString& url = QString::null, bool fromHistory = false, bool replaceHistory = false ); - void showWikipediaEntry( const QString& entry, bool replaceHistory = false ); + void showLyrics( const TQString& url = TQString::null ); + void showWikipedia( const TQString& url = TQString::null, bool fromHistory = false, bool replaceHistory = false ); + void showWikipediaEntry( const TQString& entry, bool replaceHistory = false ); void reloadWikipedia(); void showLabelsDialog(); - void coverFetched( const QString &artist, const QString &album ); - void coverRemoved( const QString &artist, const QString &album ); - void similarArtistsFetched( const QString &artist ); - void imageFetched( const QString &remoteURL ); + void coverFetched( const TQString &artist, const TQString &album ); + void coverRemoved( const TQString &artist, const TQString &album ); + void similarArtistsFetched( const TQString &artist ); + void imageFetched( const TQString &remoteURL ); void tagsChanged( const MetaBundle &bundle ); - void tagsChanged( const QString &oldArtist, const QString &oldAlbum ); - void ratingOrScoreOrLabelsChanged( const QString &path ); + void tagsChanged( const TQString &oldArtist, const TQString &oldAlbum ); + void ratingOrScoreOrLabelsChanged( const TQString &path ); void refreshCurrentTrackPage(); void contextHistoryBack(); @@ -103,7 +103,7 @@ class ContextBrowser : public KTabWidget, public EngineObserver void lyricsRefresh(); void lyricsExternalPage(); - void lyricsSearchText( const QString &text ); + void lyricsSearchText( const TQString &text ); void lyricsSearchTextNext(); void lyricsSearchTextHide(); void lyricsSearchTextShow(); @@ -134,64 +134,64 @@ class ContextBrowser : public KTabWidget, public EngineObserver void saveHtmlData(); void showScanning(); - static QString getEncodedImage( const QString &imageUrl ); + static TQString getEncodedImage( const TQString &imageUrl ); - static QString wikiLocale(); - static void setWikiLocale( const QString &locale ); - static QString wikiURL( const QString &item ); - QString wikiArtistPostfix() const; - QString wikiAlbumPostfix() const; - QString wikiTrackPostfix() const; + static TQString wikiLocale(); + static void setWikiLocale( const TQString &locale ); + static TQString wikiURL( const TQString &item ); + TQString wikiArtistPostfix() const; + TQString wikiAlbumPostfix() const; + TQString wikiTrackPostfix() const; HTMLView *m_currentTrackPage; HTMLView *m_lyricsPage; HTMLView *m_wikiPage; - QVBox *m_contextTab; - QVBox *m_lyricsTab; - QVBox *m_wikiTab; + TQVBox *m_contextTab; + TQVBox *m_lyricsTab; + TQVBox *m_wikiTab; // These controls are used to dictate whether the page should be rebuilt // true -> need rebuild bool m_dirtyCurrentTrackPage; bool m_dirtyLyricsPage; bool m_dirtyWikiPage; - QStringList m_contextBackHistory; + TQStringList m_contextBackHistory; KURL m_contextURL; - QString m_styleSheet; + TQString m_styleSheet; bool m_emptyDB; - QString m_lyricAddUrl; - QString m_lyricSearchUrl; - QString m_lyricCurrentUrl; + TQString m_lyricAddUrl; + TQString m_lyricSearchUrl; + TQString m_lyricCurrentUrl; Browser::ToolBar* m_lyricsToolBar; KTextEdit* m_lyricsTextEdit; - QString m_lyricsBeingEditedUrl; - QString m_lyricsBeingEditedArtist; - QString m_lyricsBeingEditedTitle; + TQString m_lyricsBeingEditedUrl; + TQString m_lyricsBeingEditedArtist; + TQString m_lyricsBeingEditedTitle; ClickLineEdit* m_lyricsSearchText; KToolBar* m_lyricsTextBar; bool m_lyricsTextBarShowed; - QString m_wiki; - QString m_wikiLanguages; - static QString s_wikiLocale; - QString m_wikiBaseUrl; - QString m_wikiCurrentUrl; - QString m_wikiCurrentEntry; - QStringList m_wikiBackHistory; - QStringList m_wikiForwardHistory; + TQString m_wiki; + TQString m_wikiLanguages; + static TQString s_wikiLocale; + TQString m_wikiBaseUrl; + TQString m_wikiCurrentUrl; + TQString m_wikiCurrentEntry; + TQStringList m_wikiBackHistory; + TQStringList m_wikiForwardHistory; KPopupMenu* m_wikiBackPopup; KPopupMenu* m_wikiForwardPopup; KIO::TransferJob* m_wikiJob; Browser::ToolBar* m_wikiToolBar; - QLineEdit* m_wikiLocaleEdit; - QComboBox* m_wikiLocaleCombo; + TQLineEdit* m_wikiLocaleEdit; + TQComboBox* m_wikiLocaleCombo; KDialogBase* m_wikiConfigDialog; - QString m_HTMLSource; - QStringList m_metadataHistory; + TQString m_HTMLSource; + TQStringList m_metadataHistory; KURL m_currentURL; bool m_relatedOpen; @@ -208,13 +208,13 @@ class ContextBrowser : public KTabWidget, public EngineObserver bool m_showNewestAlbums; bool m_browseArtists; - QString m_artist; - QStringList m_shownAlbums; + TQString m_artist; + TQStringList m_shownAlbums; bool m_browseLabels; - QString m_label; + TQString m_label; ClickLineEdit* m_addLabelEdit; - QListView* m_labelListView; + TQListView* m_labelListView; CueFile *m_cuefile; }; diff --git a/amarok/src/coverfetcher.cpp b/amarok/src/coverfetcher.cpp index 40e79e7c..bdd7268e 100644 --- a/amarok/src/coverfetcher.cpp +++ b/amarok/src/coverfetcher.cpp @@ -12,11 +12,11 @@ #include "debug.h" #include "statusbar.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -35,7 +35,7 @@ void -Amarok::coverContextMenu( QWidget *parent, QPoint point, const QString &artist, const QString &album, bool showCoverManager ) +Amarok::coverContextMenu( TQWidget *parent, TQPoint point, const TQString &artist, const TQString &album, bool showCoverManager ) { KPopupMenu menu; enum { SHOW, FETCH, CUSTOM, DELETE, MANAGER }; @@ -72,7 +72,7 @@ Amarok::coverContextMenu( QWidget *parent, QPoint point, const QString &artist, { const int button = KMessageBox::warningContinueCancel( parent, i18n( "Are you sure you want to remove this cover from the Collection?" ), - QString::null, + TQString::null, KStdGuiItem::del() ); if ( button == KMessageBox::Continue ) @@ -88,10 +88,10 @@ Amarok::coverContextMenu( QWidget *parent, QPoint point, const QString &artist, case CUSTOM: { - QString artist_id; artist_id.setNum( CollectionDB::instance()->artistID( artist ) ); - QString album_id; album_id.setNum( CollectionDB::instance()->albumID( album ) ); - QStringList values = CollectionDB::instance()->albumTracks( artist_id, album_id ); - QString startPath = ":homedir"; + TQString artist_id; artist_id.setNum( CollectionDB::instance()->artistID( artist ) ); + TQString album_id; album_id.setNum( CollectionDB::instance()->albumID( album ) ); + TQStringList values = CollectionDB::instance()->albumTracks( artist_id, album_id ); + TQString startPath = ":homedir"; if ( !values.isEmpty() ) { KURL url; @@ -113,12 +113,12 @@ Amarok::coverContextMenu( QWidget *parent, QPoint point, const QString &artist, -CoverLabel::CoverLabel ( QWidget * parent, const char * name, WFlags f ) - : QLabel( parent, name, f) +CoverLabel::CoverLabel ( TQWidget * parent, const char * name, WFlags f ) + : TQLabel( parent, name, f) {} -void CoverLabel::mouseReleaseEvent(QMouseEvent *pEvent) { +void CoverLabel::mouseReleaseEvent(TQMouseEvent *pEvent) { if (pEvent->button() == LeftButton || pEvent->button() == RightButton) { Amarok::coverContextMenu( this, pEvent->globalPos(), m_artist, m_album, false ); @@ -126,8 +126,8 @@ void CoverLabel::mouseReleaseEvent(QMouseEvent *pEvent) { } -CoverFetcher::CoverFetcher( QWidget *parent, const QString &artist, QString album ) - : QObject( parent, "CoverFetcher" ) +CoverFetcher::CoverFetcher( TQWidget *parent, const TQString &artist, TQString album ) + : TQObject( parent, "CoverFetcher" ) , m_artist( artist ) , m_album( album ) , m_size( 2 ) @@ -135,15 +135,15 @@ CoverFetcher::CoverFetcher( QWidget *parent, const QString &artist, QString albu { DEBUG_FUNC_INFO - QStringList extensions; + TQStringList extensions; extensions << i18n("disc") << i18n("disk") << i18n("remaster") << i18n("cd") << i18n("single") << i18n("soundtrack") << i18n("part") << "disc" << "disk" << "remaster" << "cd" << "single" << "soundtrack" << "part" << "cds" /*cd single*/; //we do several queries, one raw ie, without the following modifications //the others have the above strings removed with the following regex, as this can increase hit-rate - const QString template1 = " ?-? ?[(^{]* ?%1 ?\\d*[)^}\\]]* *$"; //eg album - [disk 1] -> album + const TQString template1 = " ?-? ?[(^{]* ?%1 ?\\d*[)^}\\]]* *$"; //eg album - [disk 1] -> album foreach( extensions ) { - QRegExp regexp( template1.arg( *it ) ); + TQRegExp regexp( template1.arg( *it ) ); regexp.setCaseSensitive( false ); album.remove( regexp ); } @@ -178,14 +178,14 @@ CoverFetcher::CoverFetcher( QWidget *parent, const QString &artist, QString albu */ m_queries += m_artist; - QApplication::setOverrideCursor( KCursor::workingCursor() ); + TQApplication::setOverrideCursor( KCursor::workingCursor() ); } CoverFetcher::~CoverFetcher() { DEBUG_FUNC_INFO - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } void @@ -194,14 +194,14 @@ CoverFetcher::startFetch() DEBUG_FUNC_INFO // Static license Key. Thanks hydrogen ;-) - const QString LICENSE( "11ZKJS8X1ETSTJ6MT802" ); + const TQString LICENSE( "11ZKJS8X1ETSTJ6MT802" ); // reset all values m_coverAmazonUrls.clear(); m_coverAsins.clear(); m_coverUrls.clear(); m_coverNames.clear(); - m_xml = QString::null; + m_xml = TQString::null; m_size = 2; if ( m_queries.isEmpty() ) { @@ -209,14 +209,14 @@ CoverFetcher::startFetch() finishWithError( i18n("No cover found") ); return; } - QString query = m_queries.front(); + TQString query = m_queries.front(); m_queries.pop_front(); // '&' breaks searching query.remove('&'); - QString locale = AmarokConfig::amazonLocale(); - QString tld; + TQString locale = AmarokConfig::amazonLocale(); + TQString tld; if( locale == "us" ) tld = "com"; @@ -227,7 +227,7 @@ CoverFetcher::startFetch() int mibenum = 106; // utf-8 - QString url; + TQString url; url = "http://ecs.amazonaws." + tld + "/onca/xml?Service=AWSECommerceService&Version=2007-10-29&Operation=ItemSearch&AssociateTag=webservices-20&AWSAccessKeyId=" + LICENSE + "&Keywords=" + KURL::encode_string_no_slash( query, mibenum ) @@ -235,7 +235,7 @@ CoverFetcher::startFetch() debug() << url << endl; KIO::TransferJob* job = KIO::storedGet( url, false, false ); - connect( job, SIGNAL(result( KIO::Job* )), SLOT(finishedXmlFetch( KIO::Job* )) ); + connect( job, TQT_SIGNAL(result( KIO::Job* )), TQT_SLOT(finishedXmlFetch( KIO::Job* )) ); Amarok::StatusBar::instance()->newProgressOperation( job ); } @@ -258,10 +258,10 @@ CoverFetcher::finishedXmlFetch( KIO::Job *job ) //SLOT } if ( job ) { KIO::StoredTransferJob* const storedJob = static_cast( job ); - m_xml = QString::fromUtf8( storedJob->data().data(), storedJob->data().size() ); + m_xml = TQString::fromUtf8( storedJob->data().data(), storedJob->data().size() ); } - QDomDocument doc; + TQDomDocument doc; if( !doc.setContent( m_xml ) ) { m_errors += i18n("The XML obtained from Amazon is invalid."); startFetch(); @@ -274,11 +274,11 @@ CoverFetcher::finishedXmlFetch( KIO::Job *job ) //SLOT m_coverNames.clear(); // the url for the Amazon product info page - const QDomNodeList list = doc.documentElement().namedItem( "Items" ).childNodes(); + const TQDomNodeList list = doc.documentElement().namedItem( "Items" ).childNodes(); for(int i = 0; i < list.count(); i++ ) { - QDomNode n = list.item( i ); + TQDomNode n = list.item( i ); if( n.isElement() && n.nodeName() == "IsValid" ) { if( n.toElement().text() == "False" ) @@ -289,18 +289,18 @@ CoverFetcher::finishedXmlFetch( KIO::Job *job ) //SLOT } else if( list.item( i ).nodeName() == "Item" ) { - const QDomNode node = list.item( i ); + const TQDomNode node = list.item( i ); parseItemNode( node ); } } attemptAnotherFetch(); } -void CoverFetcher::parseItemNode( const QDomNode &node ) +void CoverFetcher::parseItemNode( const TQDomNode &node ) { - QDomNode it = node.firstChild(); + TQDomNode it = node.firstChild(); - QString size; + TQString size; switch( m_size ) { case 0: size = "Small"; break; @@ -311,7 +311,7 @@ void CoverFetcher::parseItemNode( const QDomNode &node ) while ( !it.isNull() ) { if ( it.isElement() ) { - QDomElement e = it.toElement(); + TQDomElement e = it.toElement(); if(e.tagName()=="ASIN") { m_asin = e.text(); @@ -324,15 +324,15 @@ void CoverFetcher::parseItemNode( const QDomNode &node ) } else if( e.tagName() == size ) { - QDomNode subIt = e.firstChild(); + TQDomNode subIt = e.firstChild(); while( !subIt.isNull() ) { if( subIt.isElement() ) { - QDomElement subE = subIt.toElement(); + TQDomElement subE = subIt.toElement(); if( subE.tagName() == "URL" ) { - const QString coverUrl = subE.text(); + const TQString coverUrl = subE.text(); m_coverUrls += coverUrl; break; } @@ -342,10 +342,10 @@ void CoverFetcher::parseItemNode( const QDomNode &node ) } else if( e.tagName() == "ItemAttributes" ) { - QDomNodeList nodes = e.childNodes(); - QDomNode iter; - QString artist; - QString album; + TQDomNodeList nodes = e.childNodes(); + TQDomNode iter; + TQString artist; + TQString album; for( int i = 0; i < nodes.count(); i++ ) { iter = nodes.item( i ); @@ -362,7 +362,7 @@ void CoverFetcher::parseItemNode( const QDomNode &node ) } } } - m_coverNames += QString( artist + " - " + album ); + m_coverNames += TQString( artist + " - " + album ); } } it = it.nextSibling(); @@ -411,7 +411,7 @@ CoverFetcher::attemptAnotherFetch() // try a different query KIO::TransferJob* job = KIO::storedGet( KURL(m_coverUrls.front()), false, false ); - connect( job, SIGNAL(result( KIO::Job* )), SLOT(finishedImageFetch( KIO::Job* )) ); + connect( job, TQT_SIGNAL(result( KIO::Job* )), TQT_SLOT(finishedImageFetch( KIO::Job* )) ); Amarok::StatusBar::instance()->newProgressOperation( job ); @@ -459,7 +459,7 @@ CoverFetcher::attemptAnotherFetch() class EditSearchDialog : public KDialog { public: - EditSearchDialog( QWidget* parent, const QString &text, const QString &keyword, CoverFetcher *fetcher ) + EditSearchDialog( TQWidget* parent, const TQString &text, const TQString &keyword, CoverFetcher *fetcher ) : KDialog( parent ) { setCaption( i18n( "Amazon Query Editor" ) ); @@ -473,13 +473,13 @@ CoverFetcher::attemptAnotherFetch() amazonLocale->insertItem( i18n("Japan"), CoverFetcher::Japan); amazonLocale->insertItem( i18n("United Kingdom"), CoverFetcher::UK ); if( CoverManager::instance() ) - connect( amazonLocale, SIGNAL( activated(int) ), - CoverManager::instance(), SLOT( changeLocale(int) ) ); + connect( amazonLocale, TQT_SIGNAL( activated(int) ), + CoverManager::instance(), TQT_SLOT( changeLocale(int) ) ); else - connect( amazonLocale, SIGNAL( activated(int) ), - fetcher, SLOT( changeLocale(int) ) ); - QHBoxLayout *hbox1 = new QHBoxLayout( 8 ); - hbox1->addWidget( new QLabel( i18n( "Amazon Locale: " ), this ) ); + connect( amazonLocale, TQT_SIGNAL( activated(int) ), + fetcher, TQT_SLOT( changeLocale(int) ) ); + TQHBoxLayout *hbox1 = new TQHBoxLayout( 8 ); + hbox1->addWidget( new TQLabel( i18n( "Amazon Locale: " ), this ) ); hbox1->addWidget( amazonLocale ); int currentLocale = CoverFetcher::localeStringToID( AmarokConfig::amazonLocale() ); @@ -488,14 +488,14 @@ CoverFetcher::attemptAnotherFetch() KPushButton* cancelButton = new KPushButton( KStdGuiItem::cancel(), this ); KPushButton* searchButton = new KPushButton( i18n("&Search"), this ); - QHBoxLayout *hbox2 = new QHBoxLayout( 8 ); - hbox2->addItem( new QSpacerItem( 160, 8, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); + TQHBoxLayout *hbox2 = new TQHBoxLayout( 8 ); + hbox2->addItem( new TQSpacerItem( 160, 8, TQSizePolicy::Expanding, TQSizePolicy::Minimum ) ); hbox2->addWidget( searchButton ); hbox2->addWidget( cancelButton ); - QVBoxLayout *vbox = new QVBoxLayout( this, 8, 8 ); + TQVBoxLayout *vbox = new TQVBoxLayout( this, 8, 8 ); vbox->addLayout( hbox1 ); - vbox->addWidget( new QLabel( "" + text, this ) ); + vbox->addWidget( new TQLabel( "" + text, this ) ); vbox->addWidget( new KLineEdit( keyword, this, "Query" ) ); vbox->addLayout( hbox2 ); @@ -504,11 +504,11 @@ CoverFetcher::attemptAnotherFetch() adjustSize(); setFixedHeight( height() ); - connect( searchButton, SIGNAL(clicked()), SLOT(accept()) ); - connect( cancelButton, SIGNAL(clicked()), SLOT(reject()) ); + connect( searchButton, TQT_SIGNAL(clicked()), TQT_SLOT(accept()) ); + connect( cancelButton, TQT_SIGNAL(clicked()), TQT_SLOT(reject()) ); } - QString query() { return static_cast(child( "Query" ))->text(); } + TQString query() { return static_cast(child( "Query" ))->text(); } }; QString @@ -534,7 +534,7 @@ CoverFetcher::localeIDToString( int id )//static } int -CoverFetcher::localeStringToID( const QString &s ) +CoverFetcher::localeStringToID( const TQString &s ) { int id = International; if( s == "fr" ) id = France; @@ -549,26 +549,26 @@ CoverFetcher::localeStringToID( const QString &s ) void CoverFetcher::changeLocale( int id )//SLOT { - QString locale = localeIDToString( id ); + TQString locale = localeIDToString( id ); AmarokConfig::setAmazonLocale( locale ); } void -CoverFetcher::getUserQuery( QString explanation ) +CoverFetcher::getUserQuery( TQString explanation ) { if( explanation.isEmpty() ) explanation = i18n("Ask Amazon for covers using this query:"); EditSearchDialog dialog( - static_cast( parent() ), + static_cast( parent() ), explanation, m_userQuery, this ); switch( dialog.exec() ) { - case QDialog::Accepted: + case TQDialog::Accepted: m_userQuery = dialog.query(); m_queries = m_userQuery; startFetch(); @@ -582,18 +582,18 @@ CoverFetcher::getUserQuery( QString explanation ) class CoverFoundDialog : public KDialog { public: - CoverFoundDialog( QWidget *parent, const QImage &cover, const QString &productname ) + CoverFoundDialog( TQWidget *parent, const TQImage &cover, const TQString &productname ) : KDialog( parent ) { // Gives the window a small title bar, and skips a taskbar entry KWin::setType( winId(), NET::Utility ); KWin::setState( winId(), NET::SkipTaskbar ); - (new QVBoxLayout( this ))->setAutoAdd( true ); + (new TQVBoxLayout( this ))->setAutoAdd( true ); - QLabel *labelPix = new QLabel( this ); - QLabel *labelName = new QLabel( this ); - QHBox *buttons = new QHBox( this ); + TQLabel *labelPix = new TQLabel( this ); + TQLabel *labelName = new TQLabel( this ); + TQHBox *buttons = new TQHBox( this ); KPushButton *save = new KPushButton( KStdGuiItem::save(), buttons ); KPushButton *newsearch = new KPushButton( i18n( "Ne&w Search..." ), buttons, "NewSearch" ); KPushButton *nextcover = new KPushButton( i18n( "&Next Cover" ), buttons, "NextCover" ); @@ -608,10 +608,10 @@ CoverFetcher::getUserQuery( QString explanation ) this->setFixedSize( sizeHint() ); this->setCaption( i18n("Cover Found") ); - connect( save, SIGNAL(clicked()), SLOT(accept()) ); - connect( newsearch, SIGNAL(clicked()), SLOT(accept()) ); - connect( nextcover, SIGNAL(clicked()), SLOT(accept()) ); - connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); + connect( save, TQT_SIGNAL(clicked()), TQT_SLOT(accept()) ); + connect( newsearch, TQT_SIGNAL(clicked()), TQT_SLOT(accept()) ); + connect( nextcover, TQT_SIGNAL(clicked()), TQT_SLOT(accept()) ); + connect( cancel, TQT_SIGNAL(clicked()), TQT_SLOT(reject()) ); } virtual void accept() @@ -629,7 +629,7 @@ CoverFetcher::getUserQuery( QString explanation ) void CoverFetcher::showCover() { - CoverFoundDialog dialog( static_cast( parent() ), m_image, m_currentCoverName ); + CoverFoundDialog dialog( static_cast( parent() ), m_image, m_currentCoverName ); switch( dialog.exec() ) { @@ -662,7 +662,7 @@ CoverFetcher::finish() } void -CoverFetcher::finishWithError( const QString &message, KIO::Job *job ) +CoverFetcher::finishWithError( const TQString &message, KIO::Job *job ) { if( job ) warning() << message << " KIO::error(): " << job->errorText() << endl; diff --git a/amarok/src/coverfetcher.h b/amarok/src/coverfetcher.h index a24761d3..fad72eea 100644 --- a/amarok/src/coverfetcher.h +++ b/amarok/src/coverfetcher.h @@ -5,32 +5,32 @@ #ifndef AMAROK_COVERFETCHER_H #define AMAROK_COVERFETCHER_H -#include //baseclass -#include //stack allocated -#include //baseclass -#include //stack allocated -#include //stack allocated +#include //baseclass +#include //stack allocated +#include //baseclass +#include //stack allocated +#include //stack allocated namespace Amarok { - void coverContextMenu( QWidget *parent, QPoint point, const QString &artist, const QString &album, bool showCoverManager = true ); + void coverContextMenu( TQWidget *parent, TQPoint point, const TQString &artist, const TQString &album, bool showCoverManager = true ); } -class CoverLabel : public QLabel { +class CoverLabel : public TQLabel { public: - CoverLabel ( QWidget * parent, const char * name = 0, WFlags f = 0 ); + CoverLabel ( TQWidget * parent, const char * name = 0, WFlags f = 0 ); - void setInformation( const QString artist, const QString album ) { + void setInformation( const TQString artist, const TQString album ) { m_artist = artist; m_album = album; } protected: - virtual void mouseReleaseEvent(QMouseEvent *pEvent); + virtual void mouseReleaseEvent(TQMouseEvent *pEvent); private: - QString m_artist; - QString m_album; + TQString m_artist; + TQString m_album; }; @@ -45,7 +45,7 @@ class CoverFetcher : public QObject static const uint MAX_COVERS_CHOICE = 10; public: - CoverFetcher( QWidget *parent, const QString &artist, QString album ); + CoverFetcher( TQWidget *parent, const TQString &artist, TQString album ); ~CoverFetcher(); /// allow the user to edit the query? @@ -54,18 +54,18 @@ public: /// starts the fetch void startFetch(); - QString artist() const { return m_artist; } - QString album() const { return m_album; } - QString amazonURL() const { return m_amazonURL; } - QString asin() const { return m_asin; } - QImage image() const { return m_image; } + TQString artist() const { return m_artist; } + TQString album() const { return m_album; } + TQString amazonURL() const { return m_amazonURL; } + TQString asin() const { return m_asin; } + TQImage image() const { return m_image; } bool wasError() const { return !m_success; } - QStringList errors() const { return m_errors; } + TQStringList errors() const { return m_errors; } enum Locale { International=0, France, Germany, Japan, UK, Canada }; - static QString localeIDToString( int id ); - static int localeStringToID( const QString &locale ); + static TQString localeIDToString( int id ); + static int localeStringToID( const TQString &locale ); signals: /// The CollectionDB can get the cover information using the pointer @@ -77,24 +77,24 @@ private slots: void changeLocale( int id ); private: - const QString m_artist; - const QString m_album; + const TQString m_artist; + const TQString m_album; bool m_userCanEditQuery; - QString m_userQuery; /// the query from the query edit dialog - QString m_xml; - QImage m_image; - QString m_amazonURL; - QString m_asin; + TQString m_userQuery; /// the query from the query edit dialog + TQString m_xml; + TQImage m_image; + TQString m_amazonURL; + TQString m_asin; int m_size; - QStringList m_queries; - QStringList m_coverAsins; - QStringList m_coverAmazonUrls; - QStringList m_coverUrls; - QStringList m_coverNames; - QString m_currentCoverName; - QStringList m_errors; + TQStringList m_queries; + TQStringList m_coverAsins; + TQStringList m_coverAmazonUrls; + TQStringList m_coverUrls; + TQStringList m_coverNames; + TQString m_currentCoverName; + TQStringList m_errors; bool m_success; @@ -102,14 +102,14 @@ private: /// The fetch was successful! void finish(); - /// Parse one QDomNode and append results. - void parseItemNode( const QDomNode &node ); + /// Parse one TQDomNode and append results. + void parseItemNode( const TQDomNode &node ); /// The fetch failed, finish up and log an error message - void finishWithError( const QString &message, KIO::Job *job = 0 ); + void finishWithError( const TQString &message, KIO::Job *job = 0 ); /// Prompt the user for a query - void getUserQuery( QString explanation = QString::null ); + void getUserQuery( TQString explanation = TQString::null ); /// Will try all available queries, and then prompt the user, if allowed void attemptAnotherFetch(); diff --git a/amarok/src/covermanager.cpp b/amarok/src/covermanager.cpp index d4996beb..79b5d571 100644 --- a/amarok/src/covermanager.cpp +++ b/amarok/src/covermanager.cpp @@ -15,24 +15,24 @@ #include "pixmapviewer.h" #include "playlist.h" -#include //ctor: desktop size -#include -#include //paintItem() -#include -#include -#include -#include //used to delete all cover fetchers -#include //paintItem() -#include //paintItem() -#include -#include -#include -#include -#include -#include -#include //search filter timer -#include -#include +#include //ctor: desktop size +#include +#include //paintItem() +#include +#include +#include +#include //used to delete all cover fetchers +#include //paintItem() +#include //paintItem() +#include +#include +#include +#include +#include +#include +#include //search filter timer +#include +#include #include #include @@ -56,35 +56,35 @@ #include #include -static QString artistToSelectInInitFunction; +static TQString artistToSelectInInitFunction; CoverManager *CoverManager::s_instance = 0; class ArtistItem : public KListViewItem { public: - ArtistItem(QListView *view, QListViewItem *item, const QString &text) + ArtistItem(TQListView *view, TQListViewItem *item, const TQString &text) : KListViewItem(view, item, text) {} protected: - int compare( QListViewItem* i, int col, bool ascending ) const + int compare( TQListViewItem* i, int col, bool ascending ) const { Q_UNUSED(col); Q_UNUSED(ascending); - QString a = text(0); - QString b = i->text(0); + TQString a = text(0); + TQString b = i->text(0); if ( a.startsWith( "the ", false ) ) CollectionView::manipulateThe( a, true ); if ( b.startsWith( "the ", false ) ) CollectionView::manipulateThe( b, true ); - return QString::localeAwareCompare( a.lower(), b.lower() ); + return TQString::localeAwareCompare( a.lower(), b.lower() ); } }; CoverManager::CoverManager() - : QSplitter( 0, "TheCoverManager" ) - , m_timer( new QTimer( this ) ) //search filter timer + : TQSplitter( 0, "TheCoverManager" ) + , m_timer( new TQTimer( this ) ) //search filter timer , m_fetchCounter( 0 ) , m_fetchingCovers( 0 ) , m_coversFetched( 0 ) @@ -109,10 +109,10 @@ CoverManager::CoverManager() ArtistItem *item = 0; //load artists from the collection db - const QStringList artists = CollectionDB::instance()->artistList( false, false ); + const TQStringList artists = CollectionDB::instance()->artistList( false, false ); foreach( artists ) { - QString artist = *it; + TQString artist = *it; item = new ArtistItem( m_artistView, item, artist ); item->setPixmap( 0, SmallIcon( Amarok::icon( "artist" ) ) ); } @@ -133,24 +133,24 @@ CoverManager::CoverManager() item->setPixmap( 0, SmallIcon("personal") ); } - QVBox *vbox = new QVBox( this ); - QHBox *hbox = new QHBox( vbox ); + TQVBox *vbox = new TQVBox( this ); + TQHBox *hbox = new TQHBox( vbox ); vbox->setSpacing( 4 ); hbox->setSpacing( 4 ); { // - QHBox *searchBox = new QHBox( hbox ); + TQHBox *searchBox = new TQHBox( hbox ); KToolBar* searchToolBar = new Browser::ToolBar( searchBox ); KToolBarButton *button = new KToolBarButton( "locationbar_erase", 0, searchToolBar ); m_searchEdit = new ClickLineEdit( i18n( "Enter search terms here" ), searchToolBar ); - m_searchEdit->setFrame( QFrame::Sunken ); + m_searchEdit->setFrame( TQFrame::Sunken ); searchToolBar->setStretchableWidget( m_searchEdit ); - connect( button, SIGNAL(clicked()), m_searchEdit, SLOT(clear()) ); + connect( button, TQT_SIGNAL(clicked()), m_searchEdit, TQT_SLOT(clear()) ); - QToolTip::add( button, i18n( "Clear search field" ) ); - QToolTip::add( m_searchEdit, i18n( "Enter space-separated terms to search in the albums" ) ); + TQToolTip::add( button, i18n( "Clear search field" ) ); + TQToolTip::add( m_searchEdit, i18n( "Enter space-separated terms to search in the albums" ) ); hbox->setStretchFactor( searchBox, 1 ); } // @@ -161,7 +161,7 @@ CoverManager::CoverManager() m_viewMenu->insertItem( i18n("Albums With Cover"), AlbumsWithCover ); m_viewMenu->insertItem( i18n("Albums Without Cover"), AlbumsWithoutCover ); m_viewMenu->setItemChecked( AllAlbums, true ); - connect( m_viewMenu, SIGNAL( activated(int) ), SLOT( changeView(int) ) ); + connect( m_viewMenu, TQT_SIGNAL( activated(int) ), TQT_SLOT( changeView(int) ) ); #ifdef AMAZON_SUPPORT // amazon locale menu @@ -172,23 +172,23 @@ CoverManager::CoverManager() m_amazonLocaleMenu->insertItem( i18n("Germany"), CoverFetcher::Germany ); m_amazonLocaleMenu->insertItem( i18n("Japan"), CoverFetcher::Japan); m_amazonLocaleMenu->insertItem( i18n("United Kingdom"), CoverFetcher::UK ); - connect( m_amazonLocaleMenu, SIGNAL( activated(int) ), SLOT( changeLocale(int) ) ); + connect( m_amazonLocaleMenu, TQT_SIGNAL( activated(int) ), TQT_SLOT( changeLocale(int) ) ); #endif KToolBar* toolBar = new KToolBar( hbox ); toolBar->setIconText( KToolBar::IconTextRight ); - toolBar->setFrameShape( QFrame::NoFrame ); + toolBar->setFrameShape( TQFrame::NoFrame ); toolBar->insertButton( "view_choose", 1, m_viewMenu, true, i18n( "View" ) ); #ifdef AMAZON_SUPPORT toolBar->insertButton( "babelfish", 2, m_amazonLocaleMenu, true, i18n( "Amazon Locale" ) ); - QString locale = AmarokConfig::amazonLocale(); + TQString locale = AmarokConfig::amazonLocale(); m_currentLocale = CoverFetcher::localeStringToID( locale ); m_amazonLocaleMenu->setItemChecked( m_currentLocale, true ); //fetch missing covers button m_fetchButton = new KPushButton( KGuiItem( i18n("Fetch Missing Covers"), Amarok::icon( "download" ) ), hbox ); - connect( m_fetchButton, SIGNAL(clicked()), SLOT(fetchMissingCovers()) ); + connect( m_fetchButton, TQT_SIGNAL(clicked()), TQT_SLOT(fetchMissingCovers()) ); #endif //cover view @@ -198,9 +198,9 @@ CoverManager::CoverManager() KStatusBar *m_statusBar = new KStatusBar( vbox ); m_statusBar->addWidget( m_statusLabel = new KSqueezedTextLabel( m_statusBar ), 4 ); m_statusLabel->setIndent( 3 ); - m_statusBar->addWidget( m_progressBox = new QHBox( m_statusBar ), 1, true ); + m_statusBar->addWidget( m_progressBox = new TQHBox( m_statusBar ), 1, true ); KPushButton *stopButton = new KPushButton( KGuiItem(i18n("Abort"), "stop"), m_progressBox ); - connect( stopButton, SIGNAL(clicked()), SLOT(stopFetching()) ); + connect( stopButton, TQT_SIGNAL(clicked()), TQT_SLOT(stopFetching()) ); m_progress = new KProgress( m_progressBox ); m_progress->setCenterIndicator( true ); @@ -211,34 +211,34 @@ CoverManager::CoverManager() // signals and slots connections - connect( m_artistView, SIGNAL(selectionChanged( QListViewItem* ) ), - SLOT(slotArtistSelected( QListViewItem* )) ); - connect( m_coverView, SIGNAL(contextMenuRequested( QIconViewItem*, const QPoint& )), - SLOT(showCoverMenu( QIconViewItem*, const QPoint& )) ); - connect( m_coverView, SIGNAL(executed( QIconViewItem* )), - SLOT(coverItemExecuted( QIconViewItem* )) ); - connect( m_timer, SIGNAL(timeout()), - SLOT(slotSetFilter()) ); - connect( m_searchEdit, SIGNAL(textChanged( const QString& )), - SLOT(slotSetFilterTimeout()) ); + connect( m_artistView, TQT_SIGNAL(selectionChanged( TQListViewItem* ) ), + TQT_SLOT(slotArtistSelected( TQListViewItem* )) ); + connect( m_coverView, TQT_SIGNAL(contextMenuRequested( TQIconViewItem*, const TQPoint& )), + TQT_SLOT(showCoverMenu( TQIconViewItem*, const TQPoint& )) ); + connect( m_coverView, TQT_SIGNAL(executed( TQIconViewItem* )), + TQT_SLOT(coverItemExecuted( TQIconViewItem* )) ); + connect( m_timer, TQT_SIGNAL(timeout()), + TQT_SLOT(slotSetFilter()) ); + connect( m_searchEdit, TQT_SIGNAL(textChanged( const TQString& )), + TQT_SLOT(slotSetFilterTimeout()) ); #ifdef AMAZON_SUPPORT - connect( CollectionDB::instance(), SIGNAL(coverFetched( const QString&, const QString& )), - SLOT(coverFetched( const QString&, const QString& )) ); - connect( CollectionDB::instance(), SIGNAL(coverRemoved( const QString&, const QString& )), - SLOT(coverRemoved( const QString&, const QString& )) ); - connect( CollectionDB::instance(), SIGNAL(coverFetcherError( const QString& )), - SLOT(coverFetcherError()) ); + connect( CollectionDB::instance(), TQT_SIGNAL(coverFetched( const TQString&, const TQString& )), + TQT_SLOT(coverFetched( const TQString&, const TQString& )) ); + connect( CollectionDB::instance(), TQT_SIGNAL(coverRemoved( const TQString&, const TQString& )), + TQT_SLOT(coverRemoved( const TQString&, const TQString& )) ); + connect( CollectionDB::instance(), TQT_SIGNAL(coverFetcherError( const TQString& )), + TQT_SLOT(coverFetcherError()) ); #endif m_currentView = AllAlbums; - QSize size = QApplication::desktop()->screenGeometry( this ).size() / 1.5; + TQSize size = TQApplication::desktop()->screenGeometry( this ).size() / 1.5; resize( Amarok::config( "Cover Manager" )->readSizeEntry( "Window Size", &size ) ); show(); - QTimer::singleShot( 0, this, SLOT(init()) ); + TQTimer::singleShot( 0, this, TQT_SLOT(init()) ); } @@ -256,7 +256,7 @@ void CoverManager::init() { DEBUG_BLOCK - QListViewItem *item = 0; + TQListViewItem *item = 0; if ( !artistToSelectInInitFunction.isEmpty() ) for ( item = m_artistView->firstChild(); item; item = item->nextSibling() ) @@ -270,15 +270,15 @@ void CoverManager::init() } -CoverViewDialog::CoverViewDialog( const QString& artist, const QString& album, QWidget *parent ) - : QDialog( parent, 0, false, WDestructiveClose | WType_TopLevel | WNoAutoErase ) +CoverViewDialog::CoverViewDialog( const TQString& artist, const TQString& album, TQWidget *parent ) + : TQDialog( parent, 0, false, WDestructiveClose | WType_TopLevel | WNoAutoErase ) , m_pixmap( CollectionDB::instance()->albumImage( artist, album, false, 0 ) ) { KWin::setType( winId(), NET::Utility ); kapp->setTopWidget( this ); setCaption( kapp->makeStdCaption( i18n("%1 - %2").arg( artist, album ) ) ); - m_layout = new QHBoxLayout( this ); + m_layout = new TQHBoxLayout( this ); m_layout->setAutoAdd( true ); m_pixmapViewer = new PixmapViewer( this, m_pixmap ); @@ -286,15 +286,15 @@ CoverViewDialog::CoverViewDialog( const QString& artist, const QString& album, Q } -void CoverManager::viewCover( const QString& artist, const QString& album, QWidget *parent ) //static +void CoverManager::viewCover( const TQString& artist, const TQString& album, TQWidget *parent ) //static { - //QDialog means "escape" works as expected - QDialog *dialog = new CoverViewDialog( artist, album, parent ); + //TQDialog means "escape" works as expected + TQDialog *dialog = new CoverViewDialog( artist, album, parent ); dialog->show(); } -QString CoverManager::amazonTld() //static +TQString CoverManager::amazonTld() //static { if (AmarokConfig::amazonLocale() == "us") return "com"; @@ -315,7 +315,7 @@ void CoverManager::fetchMissingCovers() //SLOT DEBUG_BLOCK - for ( QIconViewItem *item = m_coverView->firstItem(); item; item = item->nextItem() ) { + for ( TQIconViewItem *item = m_coverView->firstItem(); item; item = item->nextItem() ) { CoverViewItem *coverItem = static_cast( item ); if( !coverItem->hasCover() ) { m_fetchCovers += coverItem->artist() + " @@@ " + coverItem->album(); @@ -339,7 +339,7 @@ void CoverManager::fetchCoversLoop() //SLOT if( m_fetchCounter < m_fetchCovers.count() ) { //get artist and album from keyword - const QStringList values = QStringList::split( " @@@ ", m_fetchCovers[m_fetchCounter], true ); + const TQStringList values = TQStringList::split( " @@@ ", m_fetchCovers[m_fetchCounter], true ); if( values.count() > 1 ) CollectionDB::instance()->fetchCover( this, values[0], values[1], m_fetchCovers.count() != 1); //edit mode when fetching 1 cover @@ -347,7 +347,7 @@ void CoverManager::fetchCoversLoop() //SLOT m_fetchCounter++; // Wait 1 second, since amazon caps the number of accesses per client - QTimer::singleShot( 1000, this, SLOT( fetchCoversLoop() ) ); + TQTimer::singleShot( 1000, this, TQT_SLOT( fetchCoversLoop() ) ); } else { m_fetchCovers.clear(); @@ -358,7 +358,7 @@ void CoverManager::fetchCoversLoop() //SLOT } -void CoverManager::showOnce( const QString &artist ) +void CoverManager::showOnce( const TQString &artist ) { if ( !s_instance ) { artistToSelectInInitFunction = artist; @@ -370,12 +370,12 @@ void CoverManager::showOnce( const QString &artist ) } } -void CoverManager::slotArtistSelected( QListViewItem *item ) //SLOT +void CoverManager::slotArtistSelected( TQListViewItem *item ) //SLOT { if( item->depth() ) //album item return; - QString artist = item->text(0); + TQString artist = item->text(0); if( artist.endsWith( ", The" ) ) CollectionView::instance()->manipulateThe( artist, false ); @@ -389,9 +389,9 @@ void CoverManager::slotArtistSelected( QListViewItem *item ) //SLOT m_viewMenu->setItemChecked( AlbumsWithCover, false ); m_viewMenu->setItemChecked( AlbumsWithoutCover, false ); - QProgressDialog progress( this, 0, true ); + TQProgressDialog progress( this, 0, true ); progress.setLabelText( i18n("Loading Thumbnails...") ); - progress.QDialog::setCaption( i18n("...") ); + progress.TQDialog::setCaption( i18n("...") ); //NOTE we MUST show the dialog, otherwise the closeEvents get processed // in the processEvents() calls below, GRUMBLE! Qt sux0rs @@ -403,9 +403,9 @@ void CoverManager::slotArtistSelected( QListViewItem *item ) //SLOT kapp->processEvents(); //this can be a bit slow - QApplication::setOverrideCursor( KCursor::waitCursor() ); + TQApplication::setOverrideCursor( KCursor::waitCursor() ); QueryBuilder qb; - QStringList albums; + TQStringList albums; qb.addReturnValue( QueryBuilder::tabArtist, QueryBuilder::valName ); qb.addReturnValue( QueryBuilder::tabAlbum, QueryBuilder::valName ); @@ -424,7 +424,7 @@ void CoverManager::slotArtistSelected( QListViewItem *item ) //SLOT //"Various Artists" (last treenode) if ( item == m_artistView->firstChild() || item == m_artistView->lastChild() ) { - QStringList cl; + TQStringList cl; qb.clear(); qb.addReturnValue( QueryBuilder::tabAlbum, QueryBuilder::valName ); @@ -441,7 +441,7 @@ void CoverManager::slotArtistSelected( QListViewItem *item ) //SLOT } } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); progress.setTotalSteps( (albums.count()/2) + (albums.count()/10) ); @@ -451,13 +451,13 @@ void CoverManager::slotArtistSelected( QListViewItem *item ) //SLOT uint x = 0; foreach( albums ) { - const QString artist = *it; - const QString album = *(++it); + const TQString artist = *it; + const TQString album = *(++it); m_coverItems.append( new CoverViewItem( m_coverView, m_coverView->lastItem(), artist, album ) ); if ( ++x % 50 == 0 ) { progress.setProgress( x / 5 ); // we do it less often due to bug in Qt, ask Max - kapp->processEvents(); // QProgressDialog also calls this, but not always due to Qt bug! + kapp->processEvents(); // TQProgressDialog also calls this, but not always due to Qt bug! //only worth testing for after processEvents() is called if( progress.wasCancelled() ) @@ -466,7 +466,7 @@ void CoverManager::slotArtistSelected( QListViewItem *item ) //SLOT } //now, load the thumbnails - for( QIconViewItem *item = m_coverView->firstItem(); item; item = item->nextItem() ) { + for( TQIconViewItem *item = m_coverView->firstItem(); item; item = item->nextItem() ) { progress.setProgress( progress.progress() + 1 ); kapp->processEvents(); @@ -479,7 +479,7 @@ void CoverManager::slotArtistSelected( QListViewItem *item ) //SLOT updateStatusBar(); } -void CoverManager::showCoverMenu( QIconViewItem *item, const QPoint &p ) //SLOT +void CoverManager::showCoverMenu( TQIconViewItem *item, const TQPoint &p ) //SLOT { #define item static_cast(item) if( !item ) return; @@ -490,7 +490,7 @@ void CoverManager::showCoverMenu( QIconViewItem *item, const QPoint &p ) //SLOT menu.insertTitle( i18n( "Cover Image" ) ); - QPtrList selected = selectedItems(); + TQPtrList selected = selectedItems(); if( selected.count() > 1 ) { menu.insertItem( SmallIconSet( Amarok::icon( "download" ) ), i18n( "&Fetch Selected Covers" ), FETCH ); menu.insertItem( SmallIconSet( Amarok::icon( "files" ) ), i18n( "Set &Custom Cover for Selected Albums" ), CUSTOM ); @@ -538,8 +538,8 @@ void CoverManager::showCoverMenu( QIconViewItem *item, const QPoint &p ) //SLOT CoverViewItem* sel; for ( sel = selected.first(); sel; sel = selected.next() ) { - QString artist_id; - QString album_id; + TQString artist_id; + TQString album_id; artist_id.setNum( CollectionDB::instance()->artistID( sel->artist() ) ); album_id.setNum( CollectionDB::instance()->albumID( sel->album() ) ); Playlist::instance()->insertMedia( CollectionDB::instance()->albumTracks( artist_id, album_id ), Playlist::Append ); @@ -553,7 +553,7 @@ void CoverManager::showCoverMenu( QIconViewItem *item, const QPoint &p ) //SLOT #undef item } -void CoverManager::coverItemExecuted( QIconViewItem *item ) //SLOT +void CoverManager::coverItemExecuted( TQIconViewItem *item ) //SLOT { #define item static_cast(item) @@ -574,16 +574,16 @@ void CoverManager::slotSetFilter() //SLOT m_filter = m_searchEdit->text(); m_coverView->selectAll( false); - QIconViewItem *item = m_coverView->firstItem(); + TQIconViewItem *item = m_coverView->firstItem(); while ( item ) { - QIconViewItem *tmp = item->nextItem(); + TQIconViewItem *tmp = item->nextItem(); m_coverView->takeItem( item ); item = tmp; } m_coverView->setAutoArrange( false ); - for( QIconViewItem *item = m_coverItems.first(); item; item = m_coverItems.next() ) + for( TQIconViewItem *item = m_coverItems.first(); item; item = m_coverItems.next() ) { CoverViewItem *coverItem = static_cast(item); if( coverItem->album().contains( m_filter, false ) || coverItem->artist().contains( m_filter, false ) ) @@ -609,15 +609,15 @@ void CoverManager::changeView( int id ) //SLOT //clear the iconview without deleting items m_coverView->selectAll( false); - QIconViewItem *item = m_coverView->firstItem(); + TQIconViewItem *item = m_coverView->firstItem(); while ( item ) { - QIconViewItem *tmp = item->nextItem(); + TQIconViewItem *tmp = item->nextItem(); m_coverView->takeItem( item ); item = tmp; } m_coverView->setAutoArrange(false ); - for( QIconViewItem *item = m_coverItems.first(); item; item = m_coverItems.next() ) { + for( TQIconViewItem *item = m_coverItems.first(); item; item = m_coverItems.next() ) { bool show = false; CoverViewItem *coverItem = static_cast(item); if( !m_filter.isEmpty() ) { @@ -645,7 +645,7 @@ void CoverManager::changeView( int id ) //SLOT void CoverManager::changeLocale( int id ) //SLOT { - QString locale = CoverFetcher::localeIDToString( id ); + TQString locale = CoverFetcher::localeIDToString( id ); AmarokConfig::setAmazonLocale( locale ); m_amazonLocaleMenu->setItemChecked( m_currentLocale, false ); m_amazonLocaleMenu->setItemChecked( id, true ); @@ -653,7 +653,7 @@ void CoverManager::changeLocale( int id ) //SLOT } -void CoverManager::coverFetched( const QString &artist, const QString &album ) //SLOT +void CoverManager::coverFetched( const TQString &artist, const TQString &album ) //SLOT { loadCover( artist, album ); m_coversFetched++; @@ -661,7 +661,7 @@ void CoverManager::coverFetched( const QString &artist, const QString &album ) / } -void CoverManager::coverRemoved( const QString &artist, const QString &album ) //SLOT +void CoverManager::coverRemoved( const TQString &artist, const TQString &album ) //SLOT { loadCover( artist, album ); m_coversFetched--; @@ -686,8 +686,8 @@ void CoverManager::stopFetching() m_fetchCounter = 0; //delete all cover fetchers - QObjectList* list = queryList( "CoverFetcher" ); - for( QObject *obj = list->first(); obj; obj = list->next() ) + TQObjectList* list = queryList( "CoverFetcher" ); + for( TQObject *obj = list->first(); obj; obj = list->next() ) obj->deleteLater(); delete list; @@ -698,9 +698,9 @@ void CoverManager::stopFetching() // PRIVATE -void CoverManager::loadCover( const QString &artist, const QString &album ) +void CoverManager::loadCover( const TQString &artist, const TQString &album ) { - for( QIconViewItem *item = m_coverItems.first(); item; item = m_coverItems.next() ) + for( TQIconViewItem *item = m_coverItems.first(); item; item = m_coverItems.next() ) { CoverViewItem *coverItem = static_cast(item); if ( album == coverItem->album() && ( artist == coverItem->artist() || ( artist.isEmpty() && coverItem->artist().isEmpty() ) ) ) @@ -714,14 +714,14 @@ void CoverManager::loadCover( const QString &artist, const QString &album ) void CoverManager::setCustomSelectedCovers() { //function assumes something is selected - QPtrList selected = selectedItems(); + TQPtrList selected = selectedItems(); CoverViewItem* first = selected.getFirst(); - QString artist_id; artist_id.setNum( CollectionDB::instance()->artistID( first->artist() ) ); - QString album_id; album_id.setNum( CollectionDB::instance()->albumID( first->album() ) ); - QStringList values = CollectionDB::instance()->albumTracks( artist_id, album_id ); + TQString artist_id; artist_id.setNum( CollectionDB::instance()->artistID( first->artist() ) ); + TQString album_id; album_id.setNum( CollectionDB::instance()->albumID( first->album() ) ); + TQStringList values = CollectionDB::instance()->albumTracks( artist_id, album_id ); - QString startPath = ":homedir"; + TQString startPath = ":homedir"; if ( !values.isEmpty() ) { KURL url; url.setPath( values.first() ); @@ -730,8 +730,8 @@ void CoverManager::setCustomSelectedCovers() KURL file = KFileDialog::getImageOpenURL( startPath, this, i18n( "Select Cover Image File" ) ); if ( !file.isEmpty() ) { qApp->processEvents(); //it may takes a while so process pending events - QString tmpFile; - QImage image = CollectionDB::fetchImage(file, tmpFile); + TQString tmpFile; + TQImage image = CollectionDB::fetchImage(file, tmpFile); for ( CoverViewItem* item = selected.first(); item; item = selected.next() ) { CollectionDB::instance()->setAlbumImage( item->artist(), item->album(), image ); item->loadCover(); @@ -742,7 +742,7 @@ void CoverManager::setCustomSelectedCovers() void CoverManager::fetchSelectedCovers() { - QPtrList selected = selectedItems(); + TQPtrList selected = selectedItems(); for ( CoverViewItem* item = selected.first(); item; item = selected.next() ) m_fetchCovers += item->artist() + " @@@ " + item->album(); @@ -757,13 +757,13 @@ void CoverManager::fetchSelectedCovers() void CoverManager::deleteSelectedCovers() { - QPtrList selected = selectedItems(); + TQPtrList selected = selectedItems(); int button = KMessageBox::warningContinueCancel( this, i18n( "Are you sure you want to remove this cover from the Collection?", "Are you sure you want to delete these %n covers from the Collection?", selected.count() ), - QString::null, + TQString::null, KStdGuiItem::del() ); if ( button == KMessageBox::Continue ) { @@ -776,10 +776,10 @@ void CoverManager::deleteSelectedCovers() } -QPtrList CoverManager::selectedItems() +TQPtrList CoverManager::selectedItems() { - QPtrList selectedItems; - for ( QIconViewItem* item = m_coverView->firstItem(); item; item = item->nextItem() ) + TQPtrList selectedItems; + for ( TQIconViewItem* item = m_coverView->firstItem(); item; item = item->nextItem() ) if ( item->isSelected() ) selectedItems.append( static_cast(item) ); @@ -789,7 +789,7 @@ QPtrList CoverManager::selectedItems() void CoverManager::updateStatusBar() { - QString text; + TQString text; //cover fetching info if( m_fetchingCovers ) { @@ -809,11 +809,11 @@ void CoverManager::updateStatusBar() m_fetchingCovers = 0; m_coversFetched = 0; m_coverErrors = 0; - QTimer::singleShot( 2000, this, SLOT( updateStatusBar() ) ); + TQTimer::singleShot( 2000, this, TQT_SLOT( updateStatusBar() ) ); } if( m_fetchingCovers == 1 ) { - QStringList values = QStringList::split( " @@@ ", m_fetchCovers[0], true ); //get artist and album name + TQStringList values = TQStringList::split( " @@@ ", m_fetchCovers[0], true ); //get artist and album name if ( values.count() >= 2 ) { if( values[0].isEmpty() ) @@ -844,7 +844,7 @@ void CoverManager::updateStatusBar() m_progressBox->hide(); //album info - for( QIconViewItem *item = m_coverView->firstItem(); item; item = item->nextItem() ) { + for( TQIconViewItem *item = m_coverView->firstItem(); item; item = item->nextItem() ) { totalCounter++; if( !static_cast( item )->hasCover() ) missingCounter++; //counter for albums without cover @@ -856,7 +856,7 @@ void CoverManager::updateStatusBar() text = i18n( "1 album", "%n albums", totalCounter ); if( m_artistView->selectedItem() != m_artistView->firstChild() ) //showing albums by an artist { - QString artist = m_artistView->selectedItem()->text(0); + TQString artist = m_artistView->selectedItem()->text(0); if( artist.endsWith( ", The" ) ) CollectionView::instance()->manipulateThe( artist, false ); text += i18n( " by " ) + artist; @@ -874,7 +874,7 @@ void CoverManager::updateStatusBar() m_statusLabel->setText( text ); } -void CoverManager::setStatusText( QString text ) +void CoverManager::setStatusText( TQString text ) { m_oldStatusText = m_statusLabel->text(); m_statusLabel->setText( text ); @@ -884,51 +884,51 @@ void CoverManager::setStatusText( QString text ) // CLASS CoverView ///////////////////////////////////////////////////////////////////// -CoverView::CoverView( QWidget *parent, const char *name, WFlags f ) +CoverView::CoverView( TQWidget *parent, const char *name, WFlags f ) : KIconView( parent, name, f ) { Debug::Block block( __PRETTY_FUNCTION__ ); - setArrangement( QIconView::LeftToRight ); - setResizeMode( QIconView::Adjust ); - setSelectionMode( QIconView::Extended ); + setArrangement( TQIconView::LeftToRight ); + setResizeMode( TQIconView::Adjust ); + setSelectionMode( TQIconView::Extended ); arrangeItemsInGrid(); setAutoArrange( true ); setItemsMovable( false ); - // as long as QIconView only shows tooltips when the cursor is over the + // as long as TQIconView only shows tooltips when the cursor is over the // icon (and not the text), we have to create our own tooltips setShowToolTips( false ); - connect( this, SIGNAL( onItem( QIconViewItem * ) ), SLOT( setStatusText( QIconViewItem * ) ) ); - connect( this, SIGNAL( onViewport() ), CoverManager::instance(), SLOT( updateStatusBar() ) ); + connect( this, TQT_SIGNAL( onItem( TQIconViewItem * ) ), TQT_SLOT( setStatusText( TQIconViewItem * ) ) ); + connect( this, TQT_SIGNAL( onViewport() ), CoverManager::instance(), TQT_SLOT( updateStatusBar() ) ); } -QDragObject *CoverView::dragObject() +TQDragObject *CoverView::dragObject() { CoverViewItem *item = static_cast( currentItem() ); if( !item ) return 0; - const QString sql = "SELECT tags.url FROM tags, album WHERE album.name %1 AND tags.album = album.id ORDER BY tags.track;"; - const QStringList values = CollectionDB::instance()->query( sql.arg( CollectionDB::likeCondition( item->album() ) ) ); + const TQString sql = "SELECT tags.url FROM tags, album WHERE album.name %1 AND tags.album = album.id ORDER BY tags.track;"; + const TQStringList values = CollectionDB::instance()->query( sql.arg( CollectionDB::likeCondition( item->album() ) ) ); KURL::List urls; - for( QStringList::ConstIterator it = values.begin(), end = values.end(); it != end; ++it ) + for( TQStringList::ConstIterator it = values.begin(), end = values.end(); it != end; ++it ) urls += *it; - QString imagePath = CollectionDB::instance()->albumImage( item->artist(), item->album(), false, 1 ); + TQString imagePath = CollectionDB::instance()->albumImage( item->artist(), item->album(), false, 1 ); KMultipleDrag *drag = new KMultipleDrag( this ); drag->setPixmap( item->coverPixmap() ); - drag->addDragObject( new QIconDrag( this ) ); - drag->addDragObject( new QImageDrag( QImage( imagePath ) ) ); + drag->addDragObject( new TQIconDrag( this ) ); + drag->addDragObject( new TQImageDrag( TQImage( imagePath ) ) ); drag->addDragObject( new KURLDrag( urls ) ); return drag; } -void CoverView::setStatusText( QIconViewItem *item ) +void CoverView::setStatusText( TQIconViewItem *item ) { #define item static_cast( item ) if ( !item ) @@ -939,7 +939,7 @@ void CoverView::setStatusText( QIconViewItem *item ) //FIXME: Don't rely on other independent code, use an sql query if( item->artist().isEmpty() ) sampler = true; - QString tipContent = i18n( "%1 - %2" ).arg( sampler ? i18n("Various Artists") : item->artist() ) + TQString tipContent = i18n( "%1 - %2" ).arg( sampler ? i18n("Various Artists") : item->artist() ) .arg( item->album() ); CoverManager::instance()->setStatusText( tipContent ); @@ -951,7 +951,7 @@ void CoverView::setStatusText( QIconViewItem *item ) // CLASS CoverViewItem ///////////////////////////////////////////////////////////////////// -CoverViewItem::CoverViewItem( QIconView *parent, QIconViewItem *after, const QString &artist, const QString &album ) +CoverViewItem::CoverViewItem( TQIconView *parent, TQIconViewItem *after, const TQString &artist, const TQString &album ) : KIconViewItem( parent, after, album ) , m_artist( artist ) , m_album( album ) @@ -965,28 +965,28 @@ CoverViewItem::CoverViewItem( QIconView *parent, QIconViewItem *after, const QSt bool CoverViewItem::hasCover() const { - return !m_coverImagePath.endsWith( "nocover.png" ) && QFile::exists( m_coverImagePath ); + return !m_coverImagePath.endsWith( "nocover.png" ) && TQFile::exists( m_coverImagePath ); } void CoverViewItem::loadCover() { m_coverImagePath = CollectionDB::instance()->albumImage( m_artist, m_album, false, 1, &m_embedded ); - m_coverPixmap = QPixmap( m_coverImagePath ); //create the scaled cover + m_coverPixmap = TQPixmap( m_coverImagePath ); //create the scaled cover repaint(); } -void CoverViewItem::calcRect( const QString& ) +void CoverViewItem::calcRect( const TQString& ) { int thumbWidth = AmarokConfig::coverPreviewSize(); - QFontMetrics fm = iconView()->fontMetrics(); - QRect itemPixmapRect( 5, 1, thumbWidth, thumbWidth ); - QRect itemRect = rect(); + TQFontMetrics fm = iconView()->fontMetrics(); + TQRect itemPixmapRect( 5, 1, thumbWidth, thumbWidth ); + TQRect itemRect = rect(); itemRect.setWidth( thumbWidth + 10 ); itemRect.setHeight( thumbWidth + fm.lineSpacing() + 2 ); - QRect itemTextRect( 0, thumbWidth+2, itemRect.width(), fm.lineSpacing() ); + TQRect itemTextRect( 0, thumbWidth+2, itemRect.width(), fm.lineSpacing() ); setPixmapRect( itemPixmapRect ); setTextRect( itemTextRect ); @@ -994,9 +994,9 @@ void CoverViewItem::calcRect( const QString& ) } -void CoverViewItem::paintItem(QPainter* p, const QColorGroup& cg) +void CoverViewItem::paintItem(TQPainter* p, const TQColorGroup& cg) { - QRect itemRect = rect(); + TQRect itemRect = rect(); p->save(); p->translate( itemRect.x(), itemRect.y() ); @@ -1011,8 +1011,8 @@ void CoverViewItem::paintItem(QPainter* p, const QColorGroup& cg) pixmapRect().y() + (pixmapRect().height() - m_coverPixmap.height())/2, m_coverPixmap ); //justify the album name - QString str = text(); - QFontMetrics fm = p->fontMetrics(); + TQString str = text(); + TQFontMetrics fm = p->fontMetrics(); int nameWidth = fm.width( str ); if( nameWidth > textRect().width() ) { @@ -1032,9 +1032,9 @@ void CoverViewItem::paintItem(QPainter* p, const QColorGroup& cg) } -void CoverViewItem::dropped( QDropEvent *e, const QValueList & ) +void CoverViewItem::dropped( TQDropEvent *e, const TQValueList & ) { - if( QImageDrag::canDecode( e ) ) { + if( TQImageDrag::canDecode( e ) ) { if( hasCover() ) { int button = KMessageBox::warningContinueCancel( iconView(), i18n( "Are you sure you want to overwrite this cover?"), @@ -1044,8 +1044,8 @@ void CoverViewItem::dropped( QDropEvent *e, const QValueList & ) return; } - QImage img; - QImageDrag::decode( e, img ); + TQImage img; + TQImageDrag::decode( e, img ); CollectionDB::instance()->setAlbumImage( artist(), album(), img ); m_coverImagePath = CollectionDB::instance()->albumImage( m_artist, m_album, false, 0 ); loadCover(); diff --git a/amarok/src/covermanager.h b/amarok/src/covermanager.h index bba3f910..638ac1f7 100644 --- a/amarok/src/covermanager.h +++ b/amarok/src/covermanager.h @@ -5,24 +5,24 @@ #ifndef COVERMANAGER_H #define COVERMANAGER_H -#include -#include +#include +#include #include -#include -#include +#include +#include -class QListViewItem; +class TQListViewItem; class CoverViewItem; class ClickLineEdit; class KPushButton; class KPopupMenu; -class QToolButton; -class QLabel; +class TQToolButton; +class TQLabel; class KListView; class CoverView; -class QHBox; +class TQHBox; class KProgress; -class QHBoxLayout; +class TQHBoxLayout; class PixmapViewer; class CoverManager : public QSplitter @@ -37,30 +37,30 @@ class CoverManager : public QSplitter static CoverManager *instance() { return s_instance; } - static void showOnce( const QString &artist = QString::null ); - static void viewCover( const QString& artist, const QString& album, QWidget *parent=0 ); + static void showOnce( const TQString &artist = TQString::null ); + static void viewCover( const TQString& artist, const TQString& album, TQWidget *parent=0 ); - void setStatusText( QString text ); + void setStatusText( TQString text ); /** * Return the top level domain for the current locale **/ - static QString amazonTld(); + static TQString amazonTld(); public slots: void updateStatusBar(); void changeLocale( int id ); private slots: - void slotArtistSelected( QListViewItem* ); - void coverItemExecuted( QIconViewItem *item ); - void showCoverMenu( QIconViewItem *item, const QPoint& ); + void slotArtistSelected( TQListViewItem* ); + void coverItemExecuted( TQIconViewItem *item ); + void showCoverMenu( TQIconViewItem *item, const TQPoint& ); void slotSetFilter(); void slotSetFilterTimeout(); void changeView( int id ); void fetchMissingCovers(); void fetchCoversLoop(); - void coverFetched( const QString&, const QString& ); - void coverRemoved( const QString&, const QString& ); + void coverFetched( const TQString&, const TQString& ); + void coverRemoved( const TQString&, const TQString& ); void coverFetcherError(); void stopFetching(); @@ -69,11 +69,11 @@ class CoverManager : public QSplitter private: enum View { AllAlbums=0, AlbumsWithCover, AlbumsWithoutCover }; - void loadCover( const QString &, const QString & ); + void loadCover( const TQString &, const TQString & ); void setCustomSelectedCovers(); void fetchSelectedCovers(); void deleteSelectedCovers(); - QPtrList selectedItems(); + TQPtrList selectedItems(); KListView *m_artistView; CoverView *m_coverView; @@ -81,24 +81,24 @@ class CoverManager : public QSplitter KPushButton *m_fetchButton; KPopupMenu *m_amazonLocaleMenu; KPopupMenu *m_viewMenu; - QToolButton *m_amazonLocaleButton; - QToolButton *m_viewButton; + TQToolButton *m_amazonLocaleButton; + TQToolButton *m_viewButton; int m_currentLocale; int m_currentView; //status bar widgets - QLabel *m_statusLabel; - QHBox *m_progressBox; + TQLabel *m_statusLabel; + TQHBox *m_progressBox; KProgress *m_progress; - QString m_oldStatusText; + TQString m_oldStatusText; - QTimer *m_timer; //search filter timer - QPtrList m_coverItems; //used for filtering - QString m_filter; + TQTimer *m_timer; //search filter timer + TQPtrList m_coverItems; //used for filtering + TQString m_filter; // Used by fetchCoversLoop() for temporary storage - QStringList m_fetchCovers; + TQStringList m_fetchCovers; uint m_fetchCounter; //used to display information about cover fetching in the status bar @@ -112,55 +112,55 @@ class CoverView : public KIconView Q_OBJECT public: - CoverView( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); + CoverView( TQWidget *parent = 0, const char *name = 0, WFlags f = 0 ); protected: - QDragObject *dragObject(); + TQDragObject *dragObject(); private slots: - void setStatusText( QIconViewItem *item ); + void setStatusText( TQIconViewItem *item ); }; class CoverViewItem : public KIconViewItem { public: - CoverViewItem( QIconView *parent, QIconViewItem *after, const QString &artist, const QString &album ); + CoverViewItem( TQIconView *parent, TQIconViewItem *after, const TQString &artist, const TQString &album ); void loadCover(); bool hasCover() const; bool canRemoveCover() const { return !m_embedded && hasCover(); } - QString artist() const { return m_artist; } - QString album() const { return m_album; } - QPixmap coverPixmap() const { return m_coverPixmap; } + TQString artist() const { return m_artist; } + TQString album() const { return m_album; } + TQPixmap coverPixmap() const { return m_coverPixmap; } protected: - void paintItem(QPainter* painter, const QColorGroup& colorGroup); - void paintFocus(QPainter *, const QColorGroup &) { } - void dropped( QDropEvent *, const QValueList & ); + void paintItem(TQPainter* painter, const TQColorGroup& colorGroup); + void paintFocus(TQPainter *, const TQColorGroup &) { } + void dropped( TQDropEvent *, const TQValueList & ); void dragEntered(); void dragLeft(); - void calcRect( const QString& text_=QString::null ); + void calcRect( const TQString& text_=TQString::null ); private: - QString m_artist; - QString m_album; - QString m_coverImagePath; - QPixmap m_coverPixmap; + TQString m_artist; + TQString m_album; + TQString m_coverImagePath; + TQPixmap m_coverPixmap; bool m_embedded; }; -class CoverViewDialog : public QDialog { +class CoverViewDialog : public TQDialog { Q_OBJECT public: - CoverViewDialog(const QString& artist, const QString& album, QWidget *parent); + CoverViewDialog(const TQString& artist, const TQString& album, TQWidget *parent); private: - QHBoxLayout *m_layout; - QPixmap m_pixmap; + TQHBoxLayout *m_layout; + TQPixmap m_pixmap; PixmapViewer *m_pixmapViewer; - QLabel *m_label; + TQLabel *m_label; }; #endif diff --git a/amarok/src/cuefile.cpp b/amarok/src/cuefile.cpp index d8eb4a60..76915fa2 100644 --- a/amarok/src/cuefile.cpp +++ b/amarok/src/cuefile.cpp @@ -3,9 +3,9 @@ #define DEBUG_PREFIX "CueFile" -#include -#include -#include +#include +#include +#include #include @@ -64,14 +64,14 @@ bool CueFile::load(int mediaLength) clear(); m_lastSeekPos = -1; - if( QFile::exists( m_cueFileName ) ) + if( TQFile::exists( m_cueFileName ) ) { - QFile file( m_cueFileName ); + TQFile file( m_cueFileName ); int track = 0; - QString defaultArtist = QString::null; - QString defaultAlbum = QString::null; - QString artist = QString::null; - QString title = QString::null; + TQString defaultArtist = TQString::null; + TQString defaultAlbum = TQString::null; + TQString artist = TQString::null; + TQString title = TQString::null; long length = 0; long prevIndex = -1; bool index00Present = false; @@ -80,8 +80,8 @@ bool CueFile::load(int mediaLength) int mode = BEGIN; if( file.open( IO_ReadOnly ) ) { - QTextStream stream( &file ); - QString line; + TQTextStream stream( &file ); + TQString line; while ( !stream.atEnd() ) { @@ -93,7 +93,7 @@ bool CueFile::load(int mediaLength) if( mode == BEGIN ) { defaultAlbum = title; - title = QString::null; + title = TQString::null; debug() << "Album: " << defaultAlbum << endl; } else @@ -106,7 +106,7 @@ bool CueFile::load(int mediaLength) if( mode == BEGIN ) { defaultArtist = artist; - artist = QString::null; + artist = TQString::null; debug() << "Album Artist: " << defaultArtist << endl; } else @@ -131,8 +131,8 @@ bool CueFile::load(int mediaLength) // add previous entry to map insert( index, CueFileItem( title, artist, defaultAlbum, track, index ) ); prevIndex = index; - title = QString::null; - artist = QString::null; + title = TQString::null; + artist = TQString::null; track = 0; } track = line.section (' ',1,1).toInt(); @@ -147,7 +147,7 @@ bool CueFile::load(int mediaLength) if( indexNo == 1 ) { - QStringList time = QStringList::split( QChar(':'),line.section (' ',-1,-1) ); + TQStringList time = TQStringList::split( TQChar(':'),line.section (' ',-1,-1) ); index = time[0].toLong()*60*1000 + time[1].toLong()*1000 + time[2].toLong()*1000/75; //75 frames per second @@ -165,7 +165,7 @@ bool CueFile::load(int mediaLength) else if( indexNo == 0 ) // gap, use to calc prev track length { - QStringList time = QStringList::split( QChar(':'),line.section (' ',-1,-1) ); + TQStringList time = TQStringList::split( TQChar(':'),line.section (' ',-1,-1) ); length = time[0].toLong()*60*1000 + time[1].toLong()*1000 + time[2].toLong()*1000/75; //75 frames per second if( prevIndex != -1 ) diff --git a/amarok/src/cuefile.h b/amarok/src/cuefile.h index 621830ab..f0001efc 100644 --- a/amarok/src/cuefile.h +++ b/amarok/src/cuefile.h @@ -4,15 +4,15 @@ #ifndef CUEFILE_H #define CUEFILE_H -#include -#include +#include +#include -#include +#include #include "engineobserver.h" class CueFileItem { public: - CueFileItem (const QString& title, const QString& artist, const QString& album, const int trackNumber, const long index) + CueFileItem (const TQString& title, const TQString& artist, const TQString& album, const int trackNumber, const long index) : m_title( title ) , m_artist( artist ) , m_album( album ) @@ -32,31 +32,31 @@ class CueFileItem { void setLength(const long length) { m_length = length; } - const QString getTitle () const { return m_title; } - const QString getArtist () const { return m_artist; } - const QString getAlbum () const { return m_album; } + const TQString getTitle () const { return m_title; } + const TQString getArtist () const { return m_artist; } + const TQString getAlbum () const { return m_album; } const int getTrackNumber () const { return m_trackNumber; } const long getIndex () const { return m_index; } const long getLength () const { return m_length; } private: - QString m_title; - QString m_artist; - QString m_album; + TQString m_title; + TQString m_artist; + TQString m_album; int m_trackNumber; long m_index; long m_length; }; // <> -class CueFile : public QObject, public QMap, public EngineObserver +class CueFile : public TQObject, public TQMap, public EngineObserver { Q_OBJECT public: static CueFile *instance(); - void setCueFileName( QString name ) { m_cueFileName = name; }; + void setCueFileName( TQString name ) { m_cueFileName = name; }; bool load(int mediaLength); // EngineObserver @@ -74,7 +74,7 @@ class CueFile : public QObject, public QMap, public EngineObs ~CueFile(); private: - QString m_cueFileName; + TQString m_cueFileName; int m_lastSeekPos; // in seconds }; diff --git a/amarok/src/database_refactor/collectiondb.cpp b/amarok/src/database_refactor/collectiondb.cpp index 32a5a237..e38a66e8 100644 --- a/amarok/src/database_refactor/collectiondb.cpp +++ b/amarok/src/database_refactor/collectiondb.cpp @@ -24,9 +24,9 @@ #include "statusbar.h" #include "threadweaver.h" -#include -#include -#include +#include +#include +#include #include #include @@ -80,7 +80,7 @@ CollectionDB::CollectionDB() m_cacheDir.cd( "albumcovers/cache" ); // Load DBEngine plugin - QString query = "[X-KDE-Amarok-plugintype] == 'dbengine' and [X-KDE-Amarok-name] != '%1'"; + TQString query = "[X-KDE-Amarok-plugintype] == 'dbengine' and [X-KDE-Amarok-name] != '%1'"; KTrader::OfferList offers = PluginManager::query( query.arg( "sqlite-dbengine" ) ); m_dbEngine = (DBEngine*) PluginManager::createFromService( offers.first() ); @@ -95,8 +95,8 @@ CollectionDB::CollectionDB() startTimer( MONITOR_INTERVAL * 1000 ); - connect( Scrobbler::instance(), SIGNAL( similarArtistsFetched( const QString&, const QStringList& ) ), - this, SLOT( similarArtistsFetched( const QString&, const QStringList& ) ) ); + connect( Scrobbler::instance(), TQT_SIGNAL( similarArtistsFetched( const TQString&, const TQStringList& ) ), + this, TQT_SLOT( similarArtistsFetched( const TQString&, const TQStringList& ) ) ); } @@ -135,10 +135,10 @@ CollectionDB::returnStaticDbConnection( DbConnection *conn ) /** * Executes a SQL query on the already opened database * @param statement SQL program to execute. Only one SQL statement is allowed. - * @return The queried data, or QStringList() on error. + * @return The queried data, or TQStringList() on error. */ QStringList -CollectionDB::query( const QString& statement, DbConnection *conn ) +CollectionDB::query( const TQString& statement, DbConnection *conn ) { if ( DEBUG ) debug() << "Query-start: " << statement << endl; @@ -155,7 +155,7 @@ CollectionDB::query( const QString& statement, DbConnection *conn ) dbConn = m_dbConnPool->getDbConnection(); } - QStringList values = dbConn->query( statement ); + TQStringList values = dbConn->query( statement ); if ( conn == NULL ) { @@ -178,7 +178,7 @@ CollectionDB::query( const QString& statement, DbConnection *conn ) * @return The rowid of the inserted item. */ int -CollectionDB::insert( const QString& statement, const QString& table, DbConnection *conn ) +CollectionDB::insert( const TQString& statement, const TQString& table, DbConnection *conn ) { if ( DEBUG ) debug() << "insert-start: " << statement << endl; @@ -215,7 +215,7 @@ CollectionDB::insert( const QString& statement, const QString& table, DbConnecti bool CollectionDB::isEmpty() { - QStringList values; + TQStringList values; if (m_dbConnPool->getDbConnectionType() == DbConnection::postgresql) { @@ -233,8 +233,8 @@ CollectionDB::isEmpty() bool CollectionDB::isValid() { - QStringList values1; - QStringList values2; + TQStringList values1; + TQStringList values2; if (m_dbConnPool->getDbConnectionType() == DbConnection::postgresql) { values1 = query( "SELECT COUNT( url ) FROM tags OFFSET 0 LIMIT 1;" ); @@ -257,7 +257,7 @@ CollectionDB::createTables( DbConnection *conn ) DEBUG_FUNC_INFO //create tag table - query( QString( "CREATE %1 TABLE tags%2 (" + query( TQString( "CREATE %1 TABLE tags%2 (" "url " + textColumnType() + "," "dir " + textColumnType() + "," "createdate INTEGER," @@ -275,21 +275,21 @@ CollectionDB::createTables( DbConnection *conn ) .arg( conn ? "TEMPORARY" : "" ) .arg( conn ? "_temp" : "" ), conn ); - QString albumAutoIncrement = ""; - QString artistAutoIncrement = ""; - QString genreAutoIncrement = ""; - QString yearAutoIncrement = ""; + TQString albumAutoIncrement = ""; + TQString artistAutoIncrement = ""; + TQString genreAutoIncrement = ""; + TQString yearAutoIncrement = ""; if ( m_dbConnPool->getDbConnectionType() == DbConnection::postgresql ) { - query( QString( "CREATE SEQUENCE album_seq;" ), conn ); - query( QString( "CREATE SEQUENCE artist_seq;" ), conn ); - query( QString( "CREATE SEQUENCE genre_seq;" ), conn ); - query( QString( "CREATE SEQUENCE year_seq;" ), conn ); + query( TQString( "CREATE SEQUENCE album_seq;" ), conn ); + query( TQString( "CREATE SEQUENCE artist_seq;" ), conn ); + query( TQString( "CREATE SEQUENCE genre_seq;" ), conn ); + query( TQString( "CREATE SEQUENCE year_seq;" ), conn ); - albumAutoIncrement = QString("DEFAULT nextval('album_seq')"); - artistAutoIncrement = QString("DEFAULT nextval('artist_seq')"); - genreAutoIncrement = QString("DEFAULT nextval('genre_seq')"); - yearAutoIncrement = QString("DEFAULT nextval('year_seq')"); + albumAutoIncrement = TQString("DEFAULT nextval('album_seq')"); + artistAutoIncrement = TQString("DEFAULT nextval('artist_seq')"); + genreAutoIncrement = TQString("DEFAULT nextval('genre_seq')"); + yearAutoIncrement = TQString("DEFAULT nextval('year_seq')"); } else if ( m_dbConnPool->getDbConnectionType() == DbConnection::mysql ) { @@ -299,7 +299,7 @@ CollectionDB::createTables( DbConnection *conn ) yearAutoIncrement = "AUTO_INCREMENT"; } //create album table - query( QString( "CREATE %1 TABLE album%2 (" + query( TQString( "CREATE %1 TABLE album%2 (" "id INTEGER PRIMARY KEY %3," "name " + textColumnType() + ");" ) .arg( conn ? "TEMPORARY" : "" ) @@ -307,7 +307,7 @@ CollectionDB::createTables( DbConnection *conn ) .arg( albumAutoIncrement ), conn ); //create artist table - query( QString( "CREATE %1 TABLE artist%2 (" + query( TQString( "CREATE %1 TABLE artist%2 (" "id INTEGER PRIMARY KEY %3," "name " + textColumnType() + ");" ) .arg( conn ? "TEMPORARY" : "" ) @@ -315,7 +315,7 @@ CollectionDB::createTables( DbConnection *conn ) .arg( artistAutoIncrement ), conn ); //create genre table - query( QString( "CREATE %1 TABLE genre%2 (" + query( TQString( "CREATE %1 TABLE genre%2 (" "id INTEGER PRIMARY KEY %3," "name " + textColumnType() +");" ) .arg( conn ? "TEMPORARY" : "" ) @@ -323,7 +323,7 @@ CollectionDB::createTables( DbConnection *conn ) .arg( genreAutoIncrement ), conn ); //create year table - query( QString( "CREATE %1 TABLE year%2 (" + query( TQString( "CREATE %1 TABLE year%2 (" "id INTEGER PRIMARY KEY %3," "name " + textColumnType() + ");" ) .arg( conn ? "TEMPORARY" : "" ) @@ -331,7 +331,7 @@ CollectionDB::createTables( DbConnection *conn ) .arg( yearAutoIncrement ), conn ); //create images table - query( QString( "CREATE %1 TABLE images%2 (" + query( TQString( "CREATE %1 TABLE images%2 (" "path " + textColumnType() + "," "artist " + textColumnType() + "," "album " + textColumnType() + ");" ) @@ -339,7 +339,7 @@ CollectionDB::createTables( DbConnection *conn ) .arg( conn ? "_temp" : "" ), conn ); // create directory statistics table - query( QString( "CREATE %1 TABLE directories%2 (" + query( TQString( "CREATE %1 TABLE directories%2 (" "dir " + textColumnType() + " UNIQUE," "changedate INTEGER );" ) .arg( conn ? "TEMPORARY" : "" ) @@ -347,19 +347,19 @@ CollectionDB::createTables( DbConnection *conn ) //create indexes - query( QString( "CREATE INDEX album_idx%1 ON album%2( name );" ) + query( TQString( "CREATE INDEX album_idx%1 ON album%2( name );" ) .arg( conn ? "_temp" : "" ).arg( conn ? "_temp" : "" ), conn ); - query( QString( "CREATE INDEX artist_idx%1 ON artist%2( name );" ) + query( TQString( "CREATE INDEX artist_idx%1 ON artist%2( name );" ) .arg( conn ? "_temp" : "" ).arg( conn ? "_temp" : "" ), conn ); - query( QString( "CREATE INDEX genre_idx%1 ON genre%2( name );" ) + query( TQString( "CREATE INDEX genre_idx%1 ON genre%2( name );" ) .arg( conn ? "_temp" : "" ).arg( conn ? "_temp" : "" ), conn ); - query( QString( "CREATE INDEX year_idx%1 ON year%2( name );" ) + query( TQString( "CREATE INDEX year_idx%1 ON year%2( name );" ) .arg( conn ? "_temp" : "" ).arg( conn ? "_temp" : "" ), conn ); if ( !conn ) { // create related artists cache - query( QString( "CREATE TABLE related_artists (" + query( TQString( "CREATE TABLE related_artists (" "artist " + textColumnType() + "," "suggestion " + textColumnType() + "," "changedate INTEGER );" ) ); @@ -385,25 +385,25 @@ CollectionDB::dropTables( DbConnection *conn ) { DEBUG_FUNC_INFO - query( QString( "DROP TABLE tags%1;" ).arg( conn ? "_temp" : "" ), conn ); - query( QString( "DROP TABLE album%1;" ).arg( conn ? "_temp" : "" ), conn ); - query( QString( "DROP TABLE artist%1;" ).arg( conn ? "_temp" : "" ), conn ); - query( QString( "DROP TABLE genre%1;" ).arg( conn ? "_temp" : "" ), conn ); - query( QString( "DROP TABLE year%1;" ).arg( conn ? "_temp" : "" ), conn ); - query( QString( "DROP TABLE images%1;" ).arg( conn ? "_temp" : "" ), conn ); - query( QString( "DROP TABLE directories%1;" ).arg( conn ? "_temp" : "" ), conn ); + query( TQString( "DROP TABLE tags%1;" ).arg( conn ? "_temp" : "" ), conn ); + query( TQString( "DROP TABLE album%1;" ).arg( conn ? "_temp" : "" ), conn ); + query( TQString( "DROP TABLE artist%1;" ).arg( conn ? "_temp" : "" ), conn ); + query( TQString( "DROP TABLE genre%1;" ).arg( conn ? "_temp" : "" ), conn ); + query( TQString( "DROP TABLE year%1;" ).arg( conn ? "_temp" : "" ), conn ); + query( TQString( "DROP TABLE images%1;" ).arg( conn ? "_temp" : "" ), conn ); + query( TQString( "DROP TABLE directories%1;" ).arg( conn ? "_temp" : "" ), conn ); if ( !conn ) { - query( QString( "DROP TABLE related_artists;" ) ); + query( TQString( "DROP TABLE related_artists;" ) ); } if ( m_dbConnPool->getDbConnectionType() == DbConnection::postgresql ) { if (conn == NULL) { - query( QString( "DROP SEQUENCE album_seq;" ), conn ); - query( QString( "DROP SEQUENCE artist_seq;" ), conn ); - query( QString( "DROP SEQUENCE genre_seq;" ), conn ); - query( QString( "DROP SEQUENCE year_seq;" ), conn ); + query( TQString( "DROP SEQUENCE album_seq;" ), conn ); + query( TQString( "DROP SEQUENCE artist_seq;" ), conn ); + query( TQString( "DROP SEQUENCE genre_seq;" ), conn ); + query( TQString( "DROP SEQUENCE year_seq;" ), conn ); } } } @@ -414,23 +414,23 @@ CollectionDB::clearTables( DbConnection *conn ) { DEBUG_FUNC_INFO - QString clearCommand = "DELETE FROM"; + TQString clearCommand = "DELETE FROM"; if ( m_dbConnPool->getDbConnectionType() == DbConnection::mysql ) { // TRUNCATE TABLE is faster than DELETE FROM TABLE, so use it when supported. clearCommand = "TRUNCATE TABLE"; } - query( QString( "%1 tags%2;" ).arg( clearCommand ).arg( conn ? "_temp" : "" ), conn ); - query( QString( "%1 album%2;" ).arg( clearCommand ).arg( conn ? "_temp" : "" ), conn ); - query( QString( "%1 artist%2;" ).arg( clearCommand ).arg( conn ? "_temp" : "" ), conn ); - query( QString( "%1 genre%2;" ).arg( clearCommand ).arg( conn ? "_temp" : "" ), conn ); - query( QString( "%1 year%2;" ).arg( clearCommand ).arg( conn ? "_temp" : "" ), conn ); - query( QString( "%1 images%2;" ).arg( clearCommand ).arg( conn ? "_temp" : "" ), conn ); - query( QString( "%1 directories%2;" ).arg( clearCommand ).arg( conn ? "_temp" : "" ), conn ); + query( TQString( "%1 tags%2;" ).arg( clearCommand ).arg( conn ? "_temp" : "" ), conn ); + query( TQString( "%1 album%2;" ).arg( clearCommand ).arg( conn ? "_temp" : "" ), conn ); + query( TQString( "%1 artist%2;" ).arg( clearCommand ).arg( conn ? "_temp" : "" ), conn ); + query( TQString( "%1 genre%2;" ).arg( clearCommand ).arg( conn ? "_temp" : "" ), conn ); + query( TQString( "%1 year%2;" ).arg( clearCommand ).arg( conn ? "_temp" : "" ), conn ); + query( TQString( "%1 images%2;" ).arg( clearCommand ).arg( conn ? "_temp" : "" ), conn ); + query( TQString( "%1 directories%2;" ).arg( clearCommand ).arg( conn ? "_temp" : "" ), conn ); if ( !conn ) { - query( QString( "%1 related_artists;" ).arg( clearCommand ) ); + query( TQString( "%1 related_artists;" ).arg( clearCommand ) ); } } @@ -454,7 +454,7 @@ CollectionDB::createStatsTable() DEBUG_FUNC_INFO // create music statistics database - query( QString( "CREATE TABLE statistics (" + query( TQString( "CREATE TABLE statistics (" "url " + textColumnType() + " UNIQUE," "createdate INTEGER," "accessdate INTEGER," @@ -477,7 +477,7 @@ CollectionDB::dropStatsTable() uint -CollectionDB::artistID( QString value, bool autocreate, const bool temporary, const bool updateSpelling, DbConnection *conn ) +CollectionDB::artistID( TQString value, bool autocreate, const bool temporary, const bool updateSpelling, DbConnection *conn ) { // lookup cache if ( m_cacheArtist == value ) @@ -500,7 +500,7 @@ CollectionDB::artistValue( uint id ) if ( m_cacheArtistID == id ) return m_cacheArtist; - QString value = valueFromID( "artist", id ); + TQString value = valueFromID( "artist", id ); // cache values m_cacheArtist = value; @@ -512,7 +512,7 @@ CollectionDB::artistValue( uint id ) uint -CollectionDB::albumID( QString value, bool autocreate, const bool temporary, const bool updateSpelling, DbConnection *conn ) +CollectionDB::albumID( TQString value, bool autocreate, const bool temporary, const bool updateSpelling, DbConnection *conn ) { // lookup cache if ( m_cacheAlbum == value ) @@ -535,7 +535,7 @@ CollectionDB::albumValue( uint id ) if ( m_cacheAlbumID == id ) return m_cacheAlbum; - QString value = valueFromID( "album", id ); + TQString value = valueFromID( "album", id ); // cache values m_cacheAlbum = value; @@ -546,7 +546,7 @@ CollectionDB::albumValue( uint id ) uint -CollectionDB::genreID( QString value, bool autocreate, const bool temporary, const bool updateSpelling, DbConnection *conn ) +CollectionDB::genreID( TQString value, bool autocreate, const bool temporary, const bool updateSpelling, DbConnection *conn ) { return IDFromValue( "genre", value, autocreate, temporary, updateSpelling, conn ); } @@ -560,7 +560,7 @@ CollectionDB::genreValue( uint id ) uint -CollectionDB::yearID( QString value, bool autocreate, const bool temporary, const bool updateSpelling, DbConnection *conn ) +CollectionDB::yearID( TQString value, bool autocreate, const bool temporary, const bool updateSpelling, DbConnection *conn ) { return IDFromValue( "year", value, autocreate, temporary, updateSpelling, conn ); } @@ -574,22 +574,22 @@ CollectionDB::yearValue( uint id ) uint -CollectionDB::IDFromValue( QString name, QString value, bool autocreate, const bool temporary, const bool updateSpelling, DbConnection *conn ) +CollectionDB::IDFromValue( TQString name, TQString value, bool autocreate, const bool temporary, const bool updateSpelling, DbConnection *conn ) { if ( temporary ) name.append( "_temp" ); else conn = NULL; - QStringList values = - query( QString( + TQStringList values = + query( TQString( "SELECT id, name FROM %1 WHERE name LIKE '%2';" ) .arg( name ) .arg( CollectionDB::instance()->escapeString( value ) ), conn ); if ( updateSpelling && !values.isEmpty() && ( values[1] != value ) ) { - query( QString( "UPDATE %1 SET id = %2, name = '%3' WHERE id = %4;" ) + query( TQString( "UPDATE %1 SET id = %2, name = '%3' WHERE id = %4;" ) .arg( name ) .arg( values.first() ) .arg( CollectionDB::instance()->escapeString( value ) ) @@ -600,7 +600,7 @@ CollectionDB::IDFromValue( QString name, QString value, bool autocreate, const b uint id; if ( values.isEmpty() && autocreate ) { - id = insert( QString( "INSERT INTO %1 ( name ) VALUES ( '%2' );" ) + id = insert( TQString( "INSERT INTO %1 ( name ) VALUES ( '%2' );" ) .arg( name ) .arg( CollectionDB::instance()->escapeString( value ) ), name, conn ); @@ -612,10 +612,10 @@ CollectionDB::IDFromValue( QString name, QString value, bool autocreate, const b QString -CollectionDB::valueFromID( QString table, uint id ) +CollectionDB::valueFromID( TQString table, uint id ) { - QStringList values = - query( QString( + TQStringList values = + query( TQString( "SELECT name FROM %1 WHERE id=%2;" ) .arg( table ) .arg( id ) ); @@ -626,10 +626,10 @@ CollectionDB::valueFromID( QString table, uint id ) QString -CollectionDB::albumSongCount( const QString &artist_id, const QString &album_id ) +CollectionDB::albumSongCount( const TQString &artist_id, const TQString &album_id ) { - QStringList values = - query( QString( + TQStringList values = + query( TQString( "SELECT COUNT( url ) FROM tags WHERE album = %1 AND artist = %2;" ) .arg( album_id ) .arg( artist_id ) ); @@ -637,10 +637,10 @@ CollectionDB::albumSongCount( const QString &artist_id, const QString &album_id } bool -CollectionDB::albumIsCompilation( const QString &album_id ) +CollectionDB::albumIsCompilation( const TQString &album_id ) { - QStringList values = - query( QString( + TQStringList values = + query( TQString( "SELECT sampler FROM tags WHERE sampler=%1 AND album=%2" ) .arg( CollectionDB::instance()->boolT() ) .arg( album_id ) ); @@ -649,10 +649,10 @@ CollectionDB::albumIsCompilation( const QString &album_id ) } QStringList -CollectionDB::albumTracks( const QString &artist_id, const QString &album_id ) +CollectionDB::albumTracks( const TQString &artist_id, const TQString &album_id ) { if (m_dbConnPool->getDbConnectionType() == DbConnection::postgresql) { - return query( QString( "SELECT tags.url, tags.track AS __discard FROM tags, year WHERE tags.album = %1 AND " + return query( TQString( "SELECT tags.url, tags.track AS __discard FROM tags, year WHERE tags.album = %1 AND " "( tags.sampler = %2 OR tags.artist = %3 ) AND year.id = tags.year " "ORDER BY tags.track;" ) .arg( album_id ) @@ -661,7 +661,7 @@ CollectionDB::albumTracks( const QString &artist_id, const QString &album_id ) } else { - return query( QString( "SELECT tags.url FROM tags, year WHERE tags.album = %1 AND " + return query( TQString( "SELECT tags.url FROM tags, year WHERE tags.album = %1 AND " "( tags.sampler = 1 OR tags.artist = %2 ) AND year.id = tags.year " "ORDER BY tags.track;" ) .arg( album_id ) @@ -671,15 +671,15 @@ CollectionDB::albumTracks( const QString &artist_id, const QString &album_id ) void -CollectionDB::addImageToAlbum( const QString& image, QValueList< QPair > info, DbConnection *conn ) +CollectionDB::addImageToAlbum( const TQString& image, TQValueList< QPair > info, DbConnection *conn ) { - for ( QValueList< QPair >::ConstIterator it = info.begin(); it != info.end(); ++it ) + for ( TQValueList< QPair >::ConstIterator it = info.begin(); it != info.end(); ++it ) { if ( (*it).first.isEmpty() || (*it).second.isEmpty() ) continue; debug() << "Added image for album: " << (*it).first << " - " << (*it).second << ": " << image << endl; - insert( QString( "INSERT INTO images%1 ( path, artist, album ) VALUES ( '%1', '%2', '%3' );" ) + insert( TQString( "INSERT INTO images%1 ( path, artist, album ) VALUES ( '%1', '%2', '%3' );" ) .arg( conn ? "_temp" : "" ) .arg( escapeString( image ) ) .arg( escapeString( (*it).first ) ) @@ -688,24 +688,24 @@ CollectionDB::addImageToAlbum( const QString& image, QValueList< QPair 10000000 /*10MB*/ ) - return QString(); + return TQString(); - QImage image; + TQImage image; if( image.loadFromData((const uchar*)imgVector.data(), imgVector.size()) ) { if ( width > 1 ) { - image.smoothScale( width, width, QImage::ScaleMin ).save( m_cacheDir.filePath( widthKey + tagKey ), "PNG" ); + image.smoothScale( width, width, TQImage::ScaleMin ).save( m_cacheDir.filePath( widthKey + tagKey ), "PNG" ); return m_cacheDir.filePath( widthKey + tagKey ); } else { @@ -787,20 +787,20 @@ CollectionDB::findImageByMetabundle( MetaBundle trackInformation, uint width ) } // tag is empty } // caching - return QString(); + return TQString(); } QString -CollectionDB::findImageByArtistAlbum( const QString &artist, const QString &album, uint width ) +CollectionDB::findImageByArtistAlbum( const TQString &artist, const TQString &album, uint width ) { - QCString widthKey = makeWidthKey( width ); + TQCString widthKey = makeWidthKey( width ); if ( artist.isEmpty() && album.isEmpty() ) return notAvailCover( width ); else { - QCString key = md5sum( artist, album ); + TQCString key = md5sum( artist, album ); // check cache for existing cover if ( m_cacheDir.exists( widthKey + key ) ) @@ -808,12 +808,12 @@ CollectionDB::findImageByArtistAlbum( const QString &artist, const QString &albu else { // we need to create a scaled version of this cover - QDir largeCoverDir( amaroK::saveLocation( "albumcovers/large/" ) ); + TQDir largeCoverDir( amaroK::saveLocation( "albumcovers/large/" ) ); if ( largeCoverDir.exists( key ) ) if ( width > 1 ) { - QImage img( largeCoverDir.filePath( key ) ); - img.smoothScale( width, width, QImage::ScaleMin ).save( m_cacheDir.filePath( widthKey + key ), "PNG" ); + TQImage img( largeCoverDir.filePath( key ) ); + img.smoothScale( width, width, TQImage::ScaleMin ).save( m_cacheDir.filePath( widthKey + key ), "PNG" ); return m_cacheDir.filePath( widthKey + key ); } @@ -828,9 +828,9 @@ CollectionDB::findImageByArtistAlbum( const QString &artist, const QString &albu QString -CollectionDB::albumImage( const QString &artist, const QString &album, uint width ) +CollectionDB::albumImage( const TQString &artist, const TQString &album, uint width ) { - QString s; + TQString s; // we aren't going to need a 1x1 size image. this is just a quick hack to be able to show full size images. if ( width == 1 ) width = AmarokConfig::coverPreviewSize(); @@ -852,7 +852,7 @@ CollectionDB::albumImage( const uint artist_id, const uint album_id, const uint QString CollectionDB::albumImage( MetaBundle trackInformation, uint width ) { - QString path = findImageByMetabundle( trackInformation, width ); + TQString path = findImageByMetabundle( trackInformation, width ); if( path.isEmpty() ) path =albumImage( trackInformation.artist(), trackInformation.album(), width ); @@ -863,28 +863,28 @@ CollectionDB::albumImage( MetaBundle trackInformation, uint width ) QCString CollectionDB::makeWidthKey( uint width ) { - return QString::number( width ).local8Bit() + "@"; + return TQString::number( width ).local8Bit() + "@"; } // get image from path QString -CollectionDB::getImageForAlbum( const QString& artist, const QString& album, uint width ) +CollectionDB::getImageForAlbum( const TQString& artist, const TQString& album, uint width ) { if ( width == 1 ) width = AmarokConfig::coverPreviewSize(); - QCString widthKey = QString::number( width ).local8Bit() + "@"; + TQCString widthKey = TQString::number( width ).local8Bit() + "@"; if ( album.isEmpty() ) return notAvailCover( width ); - QStringList values = - query( QString( + TQStringList values = + query( TQString( "SELECT path FROM images WHERE artist LIKE '%1' AND album LIKE '%2' ORDER BY path;" ) .arg( escapeString( artist ) ) .arg( escapeString( album ) ) ); if ( !values.isEmpty() ) { - QString image( values.first() ); + TQString image( values.first() ); uint matches = 0; uint maxmatches = 0; for ( uint i = 0; i < values.count(); i++ ) @@ -897,14 +897,14 @@ CollectionDB::getImageForAlbum( const QString& artist, const QString& album, uin } } - QCString key = md5sum( artist, album, image ); + TQCString key = md5sum( artist, album, image ); if ( width > 1 ) { if ( !m_cacheDir.exists( widthKey + key ) ) { - QImage img = QImage( image ); - img.smoothScale( width, width, QImage::ScaleMin ).save( m_cacheDir.filePath( widthKey + key ), "PNG" ); + TQImage img = TQImage( image ); + img.smoothScale( width, width, TQImage::ScaleMin ).save( m_cacheDir.filePath( widthKey + key ), "PNG" ); } return m_cacheDir.filePath( widthKey + key ); @@ -920,21 +920,21 @@ CollectionDB::getImageForAlbum( const QString& artist, const QString& album, uin bool -CollectionDB::removeAlbumImage( const QString &artist, const QString &album ) +CollectionDB::removeAlbumImage( const TQString &artist, const TQString &album ) { - QCString widthKey = "*@"; - QCString key = md5sum( artist, album ); + TQCString widthKey = "*@"; + TQCString key = md5sum( artist, album ); // remove scaled versions of images - QStringList scaledList = m_cacheDir.entryList( widthKey + key ); + TQStringList scaledList = m_cacheDir.entryList( widthKey + key ); if ( scaledList.count() > 0 ) for ( uint i = 0; i < scaledList.count(); i++ ) - QFile::remove( m_cacheDir.filePath( scaledList[ i ] ) ); + TQFile::remove( m_cacheDir.filePath( scaledList[ i ] ) ); // remove large, original image - QDir largeCoverDir( amaroK::saveLocation( "albumcovers/large/" ) ); + TQDir largeCoverDir( amaroK::saveLocation( "albumcovers/large/" ) ); - if ( largeCoverDir.exists( key ) && QFile::remove( largeCoverDir.filePath( key ) ) ) { + if ( largeCoverDir.exists( key ) && TQFile::remove( largeCoverDir.filePath( key ) ) ) { emit coverRemoved( artist, album ); return true; } @@ -953,14 +953,14 @@ QString CollectionDB::notAvailCover( int width ) { if ( !width ) width = AmarokConfig::coverPreviewSize(); - QString widthKey = QString::number( width ) + "@"; + TQString widthKey = TQString::number( width ) + "@"; if( m_cacheDir.exists( widthKey + "nocover.png" ) ) return m_cacheDir.filePath( widthKey + "nocover.png" ); else { - QImage nocover( locate( "data", "amarok/images/nocover.png" ) ); - nocover.smoothScale( width, width, QImage::ScaleMin ).save( m_cacheDir.filePath( widthKey + "nocover.png" ), "PNG" ); + TQImage nocover( locate( "data", "amarok/images/nocover.png" ) ); + nocover.smoothScale( width, width, TQImage::ScaleMin ).save( m_cacheDir.filePath( widthKey + "nocover.png" ), "PNG" ); return m_cacheDir.filePath( widthKey + "nocover.png" ); } } @@ -1035,15 +1035,15 @@ CollectionDB::yearList( bool withUnknowns, bool withCompilations ) QStringList -CollectionDB::albumListOfArtist( const QString &artist, bool withUnknown, bool withCompilations ) +CollectionDB::albumListOfArtist( const TQString &artist, bool withUnknown, bool withCompilations ) { if (m_dbConnPool->getDbConnectionType() == DbConnection::postgresql) { return query( "SELECT DISTINCT album.name, lower( album.name ) AS __discard FROM tags, album, artist WHERE " "tags.album = album.id AND tags.artist = artist.id " "AND artist.name = '" + escapeString( artist ) + "' " + - ( withUnknown ? QString::null : "AND album.name <> '' " ) + - ( withCompilations ? QString::null : "AND tags.sampler = " + boolF() ) + + ( withUnknown ? TQString::null : "AND album.name <> '' " ) + + ( withCompilations ? TQString::null : "AND tags.sampler = " + boolF() ) + " ORDER BY lower( album.name );" ); } else @@ -1051,8 +1051,8 @@ CollectionDB::albumListOfArtist( const QString &artist, bool withUnknown, bool w return query( "SELECT DISTINCT album.name FROM tags, album, artist WHERE " "tags.album = album.id AND tags.artist = artist.id " "AND artist.name = '" + escapeString( artist ) + "' " + - ( withUnknown ? QString::null : "AND album.name <> '' " ) + - ( withCompilations ? QString::null : "AND tags.sampler = " + boolF() ) + + ( withUnknown ? TQString::null : "AND album.name <> '' " ) + + ( withCompilations ? TQString::null : "AND tags.sampler = " + boolF() ) + " ORDER BY lower( album.name );" ); } } @@ -1065,16 +1065,16 @@ CollectionDB::artistAlbumList( bool withUnknown, bool withCompilations ) { return query( "SELECT DISTINCT artist.name, album.name, lower( album.name ) AS __discard FROM tags, album, artist WHERE " "tags.album = album.id AND tags.artist = artist.id " + - ( withUnknown ? QString::null : "AND album.name <> '' AND artist.name <> '' " ) + - ( withCompilations ? QString::null : "AND tags.sampler = " + boolF() ) + + ( withUnknown ? TQString::null : "AND album.name <> '' AND artist.name <> '' " ) + + ( withCompilations ? TQString::null : "AND tags.sampler = " + boolF() ) + " ORDER BY lower( album.name );" ); } else { return query( "SELECT DISTINCT artist.name, album.name FROM tags, album, artist WHERE " "tags.album = album.id AND tags.artist = artist.id " + - ( withUnknown ? QString::null : "AND album.name <> '' AND artist.name <> '' " ) + - ( withCompilations ? QString::null : "AND tags.sampler = " + boolF() ) + + ( withUnknown ? TQString::null : "AND album.name <> '' AND artist.name <> '' " ) + + ( withCompilations ? TQString::null : "AND tags.sampler = " + boolF() ) + " ORDER BY lower( album.name );" ); } } @@ -1083,14 +1083,14 @@ CollectionDB::artistAlbumList( bool withUnknown, bool withCompilations ) bool CollectionDB::addSong( MetaBundle* bundle, const bool incremental, DbConnection *conn ) { - if ( !QFileInfo( bundle->url().path() ).isReadable() ) return false; + if ( !TQFileInfo( bundle->url().path() ).isReadable() ) return false; - QString command = "INSERT INTO tags_temp " + TQString command = "INSERT INTO tags_temp " "( url, dir, createdate, album, artist, genre, year, title, comment, track, sampler, length, bitrate, samplerate ) " "VALUES ('"; - QString artist = bundle->artist(); - QString title = bundle->title(); + TQString artist = bundle->artist(); + TQString title = bundle->title(); if ( title.isEmpty() ) { title = bundle->url().fileName(); @@ -1107,12 +1107,12 @@ CollectionDB::addSong( MetaBundle* bundle, const bool incremental, DbConnection command += escapeString( bundle->url().path() ) + "','"; command += escapeString( bundle->url().directory() ) + "',"; - command += QString::number( QFileInfo( bundle->url().path() ).lastModified().toTime_t() ) + ","; + command += TQString::number( TQFileInfo( bundle->url().path() ).lastModified().toTime_t() ) + ","; - command += escapeString( QString::number( albumID( bundle->album(), true, !incremental, false, conn ) ) ) + ","; - command += escapeString( QString::number( artistID( bundle->artist(), true, !incremental, false, conn ) ) ) + ","; - command += escapeString( QString::number( genreID( bundle->genre(), true, !incremental, false, conn ) ) ) + ",'"; - command += escapeString( QString::number( yearID( bundle->year(), true, !incremental, false, conn ) ) ) + "','"; + command += escapeString( TQString::number( albumID( bundle->album(), true, !incremental, false, conn ) ) ) + ","; + command += escapeString( TQString::number( artistID( bundle->artist(), true, !incremental, false, conn ) ) ) + ","; + command += escapeString( TQString::number( genreID( bundle->genre(), true, !incremental, false, conn ) ) ) + ",'"; + command += escapeString( TQString::number( yearID( bundle->year(), true, !incremental, false, conn ) ) ) + "','"; command += escapeString( bundle->title() ) + "','"; command += escapeString( bundle->comment() ) + "', "; @@ -1121,9 +1121,9 @@ CollectionDB::addSong( MetaBundle* bundle, const bool incremental, DbConnection // NOTE any of these may be -1 or -2, this is what we want // see MetaBundle::Undetermined - command += QString::number( bundle->length() ) + ","; - command += QString::number( bundle->bitrate() ) + ","; - command += QString::number( bundle->sampleRate() ) + ")"; + command += TQString::number( bundle->length() ) + ","; + command += TQString::number( bundle->bitrate() ) + ","; + command += TQString::number( bundle->sampleRate() ) + ")"; //FIXME: currently there's no way to check if an INSERT query failed or not - always return true atm. // Now it might be possible as insert returns the rowid. @@ -1133,7 +1133,7 @@ CollectionDB::addSong( MetaBundle* bundle, const bool incremental, DbConnection static void -fillInBundle( QStringList values, MetaBundle &bundle ) +fillInBundle( TQStringList values, MetaBundle &bundle ) { //TODO use this whenever possible @@ -1141,7 +1141,7 @@ fillInBundle( QStringList values, MetaBundle &bundle ) while( values.count() != 10 ) values += "IF YOU CAN SEE THIS THERE IS A BUG!"; - QStringList::ConstIterator it = values.begin(); + TQStringList::ConstIterator it = values.begin(); bundle.setAlbum ( *it ); ++it; bundle.setArtist ( *it ); ++it; @@ -1158,7 +1158,7 @@ fillInBundle( QStringList values, MetaBundle &bundle ) bool CollectionDB::bundleForUrl( MetaBundle* bundle ) { - QStringList values = query( QString( + TQStringList values = query( TQString( "SELECT album.name, artist.name, genre.name, tags.title, " "year.name, tags.comment, tags.track, tags.bitrate, tags.length, " "tags.samplerate " @@ -1174,12 +1174,12 @@ CollectionDB::bundleForUrl( MetaBundle* bundle ) } -QValueList +TQValueList CollectionDB::bundlesByUrls( const KURL::List& urls ) { - typedef QValueList BundleList; + typedef TQValueList BundleList; BundleList bundles; - QStringList paths; + TQStringList paths; QueryBuilder qb; for( KURL::List::ConstIterator it = urls.begin(), end = urls.end(), last = urls.fromLast(); it != end; ++it ) @@ -1207,7 +1207,7 @@ CollectionDB::bundlesByUrls( const KURL::List& urls ) qb.addURLFilters( paths ); qb.setOptions( QueryBuilder::optRemoveDuplicates ); - const QStringList values = qb.run(); + const TQStringList values = qb.run(); BundleList buns50; MetaBundle b; @@ -1259,7 +1259,7 @@ CollectionDB::bundlesByUrls( const KURL::List& urls ) void CollectionDB::addAudioproperties( const MetaBundle& bundle ) { - query( QString( "UPDATE tags SET bitrate='%1', length='%2', samplerate='%3' WHERE url='%4';" ) + query( TQString( "UPDATE tags SET bitrate='%1', length='%2', samplerate='%3' WHERE url='%4';" ) .arg( bundle.bitrate() ) .arg( bundle.length() ) .arg( bundle.sampleRate() ) @@ -1268,11 +1268,11 @@ CollectionDB::addAudioproperties( const MetaBundle& bundle ) int -CollectionDB::addSongPercentage( const QString &url, int percentage ) +CollectionDB::addSongPercentage( const TQString &url, int percentage ) { float score; - QStringList values = - query( QString( + TQStringList values = + query( TQString( "SELECT playcounter, createdate, percentage FROM statistics " "WHERE url = '%1';" ) .arg( escapeString( url ) ) ); @@ -1287,18 +1287,18 @@ CollectionDB::addSongPercentage( const QString &url, int percentage ) score = ( ( values[2].toDouble() * values.first().toInt() ) + percentage ) / ( values.first().toInt() + 1 ); if (m_dbConnPool->getDbConnectionType() == DbConnection::postgresql) { - query( QString( "UPDATE statistics SET percentage=%1, playcounter=%2+1 WHERE url='%3';" ) + query( TQString( "UPDATE statistics SET percentage=%1, playcounter=%2+1 WHERE url='%3';" ) .arg( score ) .arg( values[0] + " + 1" ) .arg( escapeString( url ) ) ); } else { - query( QString( "REPLACE INTO statistics ( url, createdate, accessdate, percentage, playcounter ) " + query( TQString( "REPLACE INTO statistics ( url, createdate, accessdate, percentage, playcounter ) " "VALUES ( '%1', %2, %3, %4, %5 );" ) .arg( escapeString( url ) ) .arg( values[1] ) - .arg( QDateTime::currentDateTime().toTime_t() ) + .arg( TQDateTime::currentDateTime().toTime_t() ) .arg( score ) .arg( values[0] + " + 1" ) ); } @@ -1308,11 +1308,11 @@ CollectionDB::addSongPercentage( const QString &url, int percentage ) // entry didn't exist yet, create a new one score = ( ( 50 + percentage ) / 2 ); - insert( QString( "INSERT INTO statistics ( url, createdate, accessdate, percentage, playcounter ) " + insert( TQString( "INSERT INTO statistics ( url, createdate, accessdate, percentage, playcounter ) " "VALUES ( '%1', %2, %3, %4, 1 );" ) .arg( escapeString( url ) ) - .arg( QDateTime::currentDateTime().toTime_t() ) - .arg( QDateTime::currentDateTime().toTime_t() ) + .arg( TQDateTime::currentDateTime().toTime_t() ) + .arg( TQDateTime::currentDateTime().toTime_t() ) .arg( score ), NULL ); } @@ -1323,9 +1323,9 @@ CollectionDB::addSongPercentage( const QString &url, int percentage ) int -CollectionDB::getSongPercentage( const QString &url ) +CollectionDB::getSongPercentage( const TQString &url ) { - QStringList values = query( QString( "SELECT round( percentage + 0.4 ) FROM statistics WHERE url = '%1';" ) + TQStringList values = query( TQString( "SELECT round( percentage + 0.4 ) FROM statistics WHERE url = '%1';" ) .arg( escapeString( url ) ) ); if( values.count() ) @@ -1336,10 +1336,10 @@ CollectionDB::getSongPercentage( const QString &url ) void -CollectionDB::setSongPercentage( const QString &url , int percentage ) +CollectionDB::setSongPercentage( const TQString &url , int percentage ) { - QStringList values = - query( QString( + TQStringList values = + query( TQString( "SELECT playcounter, createdate, accessdate FROM statistics WHERE url = '%1';" ) .arg( escapeString( url ) ) ); @@ -1350,14 +1350,14 @@ CollectionDB::setSongPercentage( const QString &url , int percentage ) if ( !values.isEmpty() ) { if (m_dbConnPool->getDbConnectionType() == DbConnection::postgresql) { - query( QString( "UPDATE statistics SET percentage=%1 WHERE url='%2';" ) + query( TQString( "UPDATE statistics SET percentage=%1 WHERE url='%2';" ) .arg( percentage ) .arg( escapeString( url ) ) ); } else { // entry exists - query( QString( "REPLACE INTO statistics ( url, createdate, accessdate, percentage, playcounter ) " + query( TQString( "REPLACE INTO statistics ( url, createdate, accessdate, percentage, playcounter ) " "VALUES ( '%1', '%2', '%3', %4, %5 );" ) .arg( escapeString( url ) ) .arg( values[1] ) @@ -1368,11 +1368,11 @@ CollectionDB::setSongPercentage( const QString &url , int percentage ) } else { - insert( QString( "INSERT INTO statistics ( url, createdate, accessdate, percentage, playcounter ) " + insert( TQString( "INSERT INTO statistics ( url, createdate, accessdate, percentage, playcounter ) " "VALUES ( '%1', %2, %3, %4, 0 );" ) .arg( escapeString( url ) ) - .arg( QDateTime::currentDateTime().toTime_t() ) - .arg( QDateTime::currentDateTime().toTime_t() ) + .arg( TQDateTime::currentDateTime().toTime_t() ) + .arg( TQDateTime::currentDateTime().toTime_t() ) .arg( percentage ), NULL ); } @@ -1381,20 +1381,20 @@ CollectionDB::setSongPercentage( const QString &url , int percentage ) void -CollectionDB::updateDirStats( QString path, const long datetime, DbConnection *conn ) +CollectionDB::updateDirStats( TQString path, const long datetime, DbConnection *conn ) { if ( path.endsWith( "/" ) ) path = path.left( path.length() - 1 ); if (m_dbConnPool->getDbConnectionType() == DbConnection::postgresql) { - query( QString( "UPDATE directories%1 SET changedate=%2 WHERE dir='%3';") + query( TQString( "UPDATE directories%1 SET changedate=%2 WHERE dir='%3';") .arg( conn ? "_temp" : "" ) .arg( datetime ) .arg( escapeString( path ) ), conn ); } else { - query( QString( "REPLACE INTO directories%1 ( dir, changedate ) VALUES ( '%3', %2 );" ) + query( TQString( "REPLACE INTO directories%1 ( dir, changedate ) VALUES ( '%3', %2 );" ) .arg( conn ? "_temp" : "" ) .arg( datetime ) .arg( escapeString( path ) ), @@ -1404,24 +1404,24 @@ CollectionDB::updateDirStats( QString path, const long datetime, DbConnection *c void -CollectionDB::removeSongsInDir( QString path ) +CollectionDB::removeSongsInDir( TQString path ) { if ( path.endsWith( "/" ) ) path = path.left( path.length() - 1 ); - query( QString( "DELETE FROM tags WHERE dir = '%1';" ) + query( TQString( "DELETE FROM tags WHERE dir = '%1';" ) .arg( escapeString( path ) ) ); } bool -CollectionDB::isDirInCollection( QString path ) +CollectionDB::isDirInCollection( TQString path ) { if ( path.endsWith( "/" ) ) path = path.left( path.length() - 1 ); - QStringList values = - query( QString( "SELECT changedate FROM directories WHERE dir = '%1';" ) + TQStringList values = + query( TQString( "SELECT changedate FROM directories WHERE dir = '%1';" ) .arg( escapeString( path ) ) ); return !values.isEmpty(); @@ -1429,10 +1429,10 @@ CollectionDB::isDirInCollection( QString path ) bool -CollectionDB::isFileInCollection( const QString &url ) +CollectionDB::isFileInCollection( const TQString &url ) { - QStringList values = - query( QString( "SELECT url FROM tags WHERE url = '%1';" ) + TQStringList values = + query( TQString( "SELECT url FROM tags WHERE url = '%1';" ) .arg( escapeString( url ) ) ); return !values.isEmpty(); @@ -1444,24 +1444,24 @@ CollectionDB::removeSongs( const KURL::List& urls ) { for( KURL::List::ConstIterator it = urls.begin(), end = urls.end(); it != end; ++it ) { - query( QString( "DELETE FROM tags WHERE url = '%1';" ) + query( TQString( "DELETE FROM tags WHERE url = '%1';" ) .arg( escapeString( (*it).path() ) ) ); } } QStringList -CollectionDB::similarArtists( const QString &artist, uint count ) +CollectionDB::similarArtists( const TQString &artist, uint count ) { - QStringList values; + TQStringList values; if (m_dbConnPool->getDbConnectionType() == DbConnection::postgresql) { - values = query( QString( "SELECT suggestion FROM related_artists WHERE artist = '%1' OFFSET 0 LIMIT %2;" ) + values = query( TQString( "SELECT suggestion FROM related_artists WHERE artist = '%1' OFFSET 0 LIMIT %2;" ) .arg( escapeString( artist ) ).arg( count ) ); } else { - values = query( QString( "SELECT suggestion FROM related_artists WHERE artist = '%1' LIMIT 0, %2;" ) + values = query( TQString( "SELECT suggestion FROM related_artists WHERE artist = '%1' LIMIT 0, %2;" ) .arg( escapeString( artist ) ).arg( count ) ); } @@ -1473,13 +1473,13 @@ CollectionDB::similarArtists( const QString &artist, uint count ) void -CollectionDB::checkCompilations( const QString &path, const bool temporary, DbConnection *conn ) +CollectionDB::checkCompilations( const TQString &path, const bool temporary, DbConnection *conn ) { - QStringList albums; - QStringList artists; - QStringList dirs; + TQStringList albums; + TQStringList artists; + TQStringList dirs; - albums = query( QString( "SELECT DISTINCT album.name FROM tags_temp, album%1 AS album WHERE tags_temp.dir = '%2' AND album.id = tags_temp.album;" ) + albums = query( TQString( "SELECT DISTINCT album.name FROM tags_temp, album%1 AS album WHERE tags_temp.dir = '%2' AND album.id = tags_temp.album;" ) .arg( temporary ? "_temp" : "" ) .arg( escapeString( path ) ), conn ); @@ -1488,16 +1488,16 @@ CollectionDB::checkCompilations( const QString &path, const bool temporary, DbCo if ( albums[ i ].isEmpty() ) continue; const uint album_id = albumID( albums[ i ], false, temporary, false, conn ); - artists = query( QString( "SELECT DISTINCT artist.name FROM tags_temp, artist%1 AS artist WHERE tags_temp.album = '%2' AND tags_temp.artist = artist.id;" ) + artists = query( TQString( "SELECT DISTINCT artist.name FROM tags_temp, artist%1 AS artist WHERE tags_temp.album = '%2' AND tags_temp.artist = artist.id;" ) .arg( temporary ? "_temp" : "" ) .arg( album_id ), conn ); - dirs = query( QString( "SELECT DISTINCT dir FROM tags_temp WHERE album = '%1';" ) + dirs = query( TQString( "SELECT DISTINCT dir FROM tags_temp WHERE album = '%1';" ) .arg( album_id ), conn ); if ( artists.count() > dirs.count() ) { debug() << "Detected compilation: " << albums[ i ] << " - " << artists.count() << ":" << dirs.count() << endl; - query( QString( "UPDATE tags_temp SET sampler = %1 WHERE album = '%2';" ) + query( TQString( "UPDATE tags_temp SET sampler = %1 WHERE album = '%2';" ) .arg(boolT()).arg( album_id ), conn ); } } @@ -1505,39 +1505,39 @@ CollectionDB::checkCompilations( const QString &path, const bool temporary, DbCo void -CollectionDB::setCompilation( const QString &album, const bool enabled, const bool updateView ) +CollectionDB::setCompilation( const TQString &album, const bool enabled, const bool updateView ) { - query( QString( "UPDATE tags, album SET tags.sampler = %1 WHERE tags.album = album.id AND album.name = '%2';" ) + query( TQString( "UPDATE tags, album SET tags.sampler = %1 WHERE tags.album = album.id AND album.name = '%2';" ) .arg( enabled ? "1" : "0" ) .arg( escapeString( album ) ) ); // Update the Collection-Browser view, - // using QTimer to make sure we don't manipulate the GUI from a thread + // using TQTimer to make sure we don't manipulate the GUI from a thread if ( updateView ) - QTimer::singleShot( 0, CollectionView::instance(), SLOT( renderView() ) ); + TQTimer::singleShot( 0, CollectionView::instance(), TQT_SLOT( renderView() ) ); } void -CollectionDB::removeDirFromCollection( QString path ) +CollectionDB::removeDirFromCollection( TQString path ) { if ( path.endsWith( "/" ) ) path = path.left( path.length() - 1 ); - query( QString( "DELETE FROM directories WHERE dir = '%1';" ) + query( TQString( "DELETE FROM directories WHERE dir = '%1';" ) .arg( escapeString( path ) ) ); } void -CollectionDB::updateTags( const QString &url, const MetaBundle &bundle, const bool updateView ) +CollectionDB::updateTags( const TQString &url, const MetaBundle &bundle, const bool updateView ) { - QString command = "UPDATE tags SET "; + TQString command = "UPDATE tags SET "; command += "title = '" + escapeString( bundle.title() ) + "', "; - command += "artist = " + QString::number( artistID( bundle.artist(), true, false, true ) ) + ", "; - command += "album = " + QString::number( albumID( bundle.album(), true, false, true ) ) + ", "; - command += "genre = " + QString::number( genreID( bundle.genre(), true, false, true ) ) + ", "; - command += "year = " + QString::number( yearID( bundle.year(), true, false, true ) ) + ", "; + command += "artist = " + TQString::number( artistID( bundle.artist(), true, false, true ) ) + ", "; + command += "album = " + TQString::number( albumID( bundle.album(), true, false, true ) ) + ", "; + command += "genre = " + TQString::number( genreID( bundle.genre(), true, false, true ) ) + ", "; + command += "year = " + TQString::number( yearID( bundle.year(), true, false, true ) ) + ", "; if ( !bundle.track().isEmpty() ) command += "track = " + bundle.track() + ", "; command += "comment = '" + escapeString( bundle.comment() ) + "' "; @@ -1552,14 +1552,14 @@ CollectionDB::updateTags( const QString &url, const MetaBundle &bundle, const bo } // Update the Collection-Browser view, - // using QTimer to make sure we don't manipulate the GUI from a thread + // using TQTimer to make sure we don't manipulate the GUI from a thread if ( updateView ) - QTimer::singleShot( 0, CollectionView::instance(), SLOT( renderView() ) ); + TQTimer::singleShot( 0, CollectionView::instance(), TQT_SLOT( renderView() ) ); } void -CollectionDB::updateURL( const QString &url, const bool updateView ) +CollectionDB::updateURL( const TQString &url, const bool updateView ) { // don't use the KURL ctor as it checks the db first MetaBundle bundle; @@ -1632,7 +1632,7 @@ CollectionDB::applySettings() ////////////////////////////////////////////////////////////////////////////////////////// QCString -CollectionDB::md5sum( const QString& artist, const QString& album, const QString& file ) +CollectionDB::md5sum( const TQString& artist, const TQString& album, const TQString& file ) { KMD5 context( artist.lower().local8Bit() + album.lower().local8Bit() + file.local8Bit() ); // debug() << "MD5 SUM for " << artist << ", " << album << ": " << context.hexDigest() << endl; @@ -1663,7 +1663,7 @@ void CollectionDB::engineTrackEnded( int finalPosition, int trackLength ) void -CollectionDB::timerEvent( QTimerEvent* ) +CollectionDB::timerEvent( TQTimerEvent* ) { if ( AmarokConfig::monitorChanges() ) scanMonitor(); @@ -1675,13 +1675,13 @@ CollectionDB::timerEvent( QTimerEvent* ) ////////////////////////////////////////////////////////////////////////////////////////// void -CollectionDB::fetchCover( QWidget* parent, const QString& artist, const QString& album, bool noedit ) //SLOT +CollectionDB::fetchCover( TQWidget* parent, const TQString& artist, const TQString& album, bool noedit ) //SLOT { #ifdef AMAZON_SUPPORT debug() << "Fetching cover for " << artist << " - " << album << endl; CoverFetcher* fetcher = new CoverFetcher( parent, artist, album ); - connect( fetcher, SIGNAL(result( CoverFetcher* )), SLOT(coverFetcherResult( CoverFetcher* )) ); + connect( fetcher, TQT_SIGNAL(result( CoverFetcher* )), TQT_SLOT(coverFetcherResult( CoverFetcher* )) ); fetcher->setUserCanEditQuery( !noedit ); fetcher->startFetch(); #endif @@ -1698,7 +1698,7 @@ CollectionDB::scanMonitor() //SLOT void CollectionDB::startScan() //SLOT { - QStringList folders = MountPointManager::instance()->collectionFolders(); + TQStringList folders = MountPointManager::instance()->collectionFolders(); if ( folders.isEmpty() ) { dropTables(); @@ -1725,7 +1725,7 @@ CollectionDB::stopScan() //SLOT ////////////////////////////////////////////////////////////////////////////////////////// void -CollectionDB::dirDirty( const QString& path ) +CollectionDB::dirDirty( const TQString& path ) { debug() << k_funcinfo << "Dirty: " << path << endl; @@ -1755,9 +1755,9 @@ class SimilarArtistsInsertionJob : public ThreadWeaver::DependentJob { virtual bool doJob() { - CollectionDB::instance()->query( QString( "DELETE FROM related_artists WHERE artist = '%1';" ).arg( escapedArtist ) ); + CollectionDB::instance()->query( TQString( "DELETE FROM related_artists WHERE artist = '%1';" ).arg( escapedArtist ) ); - const QString sql = "INSERT INTO related_artists ( artist, suggestion, changedate ) VALUES ( '%1', '%2', 0 );"; + const TQString sql = "INSERT INTO related_artists ( artist, suggestion, changedate ) VALUES ( '%1', '%2', 0 );"; foreach( suggestions ) CollectionDB::instance()->insert( sql .arg( escapedArtist ) @@ -1768,12 +1768,12 @@ class SimilarArtistsInsertionJob : public ThreadWeaver::DependentJob virtual void completeJob() { emit CollectionDB::instance()->similarArtistsFetched( artist ); } - const QString artist; - const QString escapedArtist; - const QStringList suggestions; + const TQString artist; + const TQString escapedArtist; + const TQStringList suggestions; public: - SimilarArtistsInsertionJob( CollectionDB *parent, const QString &s, const QStringList &list ) + SimilarArtistsInsertionJob( CollectionDB *parent, const TQString &s, const TQStringList &list ) : ThreadWeaver::DependentJob( parent, "SimilarArtistsInsertionJob" ) , artist( s ) , escapedArtist( parent->escapeString( s ) ) @@ -1782,7 +1782,7 @@ public: }; void -CollectionDB::similarArtistsFetched( const QString& artist, const QStringList& suggestions ) +CollectionDB::similarArtistsFetched( const TQString& artist, const TQStringList& suggestions ) { debug() << "Received similar artists\n"; @@ -1850,7 +1850,7 @@ CollectionDB::scanModifiedDirs() void -CollectionDB::customEvent( QCustomEvent *e ) +CollectionDB::customEvent( TQCustomEvent *e ) { if ( e->type() == (int)CollectionReader::JobFinishedEvent ) emit scanDone( static_cast(e)->wasSuccessful() ); diff --git a/amarok/src/database_refactor/collectiondb.h b/amarok/src/database_refactor/collectiondb.h index 7d0f6d12..665da5b1 100644 --- a/amarok/src/database_refactor/collectiondb.h +++ b/amarok/src/database_refactor/collectiondb.h @@ -9,18 +9,18 @@ #include "engineobserver.h" #include "dbenginebase.h" #include -#include //stack allocated -#include //baseclass -#include //baseclass -#include //stack allocated -#include //stack allocated +#include //stack allocated +#include //baseclass +#include //baseclass +#include //stack allocated +#include //stack allocated class CoverFetcher; class MetaBundle; class Scrobbler; -class DbConnectionPool : QPtrQueue +class DbConnectionPool : TQPtrQueue { public: DbConnectionPool(); @@ -35,13 +35,13 @@ class DbConnectionPool : QPtrQueue private: static const int POOL_SIZE = 5; - QSemaphore m_semaphore; + TQSemaphore m_semaphore; DbConnection::DbConnectionType m_dbConnType; DbConfig *m_dbConfig; }; -class CollectionDB : public QObject, public EngineObserver +class CollectionDB : public TQObject, public EngineObserver { Q_OBJECT @@ -52,18 +52,18 @@ class CollectionDB : public QObject, public EngineObserver void scanDone( bool changed ); void databaseEngineChanged(); - void scoreChanged( const QString &url, int score ); + void scoreChanged( const TQString &url, int score ); - void coverFetched( const QString &artist, const QString &album ); - void coverRemoved( const QString &artist, const QString &album ); - void coverFetcherError( const QString &error ); + void coverFetched( const TQString &artist, const TQString &album ); + void coverRemoved( const TQString &artist, const TQString &album ); + void coverFetcherError( const TQString &error ); - void similarArtistsFetched( const QString &artist ); + void similarArtistsFetched( const TQString &artist ); public: static CollectionDB *instance(); - QString escapeString( QString string ) { return m_dbConnPool->escapeString(string); } + TQString escapeString( TQString string ) { return m_dbConnPool->escapeString(string); } int getType() { return m_dbConnPool->getDbConnectionType(); } @@ -84,8 +84,8 @@ class CollectionDB : public QObject, public EngineObserver void returnStaticDbConnection( DbConnection *conn ); //sql helper methods - QStringList query( const QString& statement, DbConnection *conn = NULL ); - int insert( const QString& statement, const QString& table, DbConnection *conn = NULL ); + TQStringList query( const TQString& statement, DbConnection *conn = NULL ); + int insert( const TQString& statement, const TQString& table, DbConnection *conn = NULL ); //table management methods bool isEmpty(); @@ -95,17 +95,17 @@ class CollectionDB : public QObject, public EngineObserver void clearTables( DbConnection *conn = NULL ); void moveTempTables( DbConnection *conn ); - uint artistID( QString value, bool autocreate = true, const bool temporary = false, const bool updateSpelling = false, DbConnection *conn = NULL ); - uint albumID( QString value, bool autocreate = true, const bool temporary = false, const bool updateSpelling = false, DbConnection *conn = NULL ); - uint genreID( QString value, bool autocreate = true, const bool temporary = false, const bool updateSpelling = false, DbConnection *conn = NULL ); - uint yearID( QString value, bool autocreate = true, const bool temporary = false, const bool updateSpelling = false, DbConnection *conn = NULL ); + uint artistID( TQString value, bool autocreate = true, const bool temporary = false, const bool updateSpelling = false, DbConnection *conn = NULL ); + uint albumID( TQString value, bool autocreate = true, const bool temporary = false, const bool updateSpelling = false, DbConnection *conn = NULL ); + uint genreID( TQString value, bool autocreate = true, const bool temporary = false, const bool updateSpelling = false, DbConnection *conn = NULL ); + uint yearID( TQString value, bool autocreate = true, const bool temporary = false, const bool updateSpelling = false, DbConnection *conn = NULL ); - bool isDirInCollection( QString path ); - bool isFileInCollection( const QString &url ); - void removeDirFromCollection( QString path ); - void removeSongsInDir( QString path ); + bool isDirInCollection( TQString path ); + bool isFileInCollection( const TQString &url ); + void removeDirFromCollection( TQString path ); + void removeSongsInDir( TQString path ); void removeSongs( const KURL::List& urls ); - void updateDirStats( QString path, const long datetime, DbConnection *conn = NULL ); + void updateDirStats( TQString path, const long datetime, DbConnection *conn = NULL ); //song methods bool addSong( MetaBundle* bundle, const bool incremental = false, DbConnection *conn = NULL ); @@ -116,60 +116,60 @@ class CollectionDB : public QObject, public EngineObserver * @return true if in the collection */ bool bundleForUrl( MetaBundle* bundle ); - QValueList bundlesByUrls( const KURL::List& urls ); + TQValueList bundlesByUrls( const KURL::List& urls ); void addAudioproperties( const MetaBundle& bundle ); - void updateTags( const QString &url, const MetaBundle &bundle, const bool updateView = true ); - void updateURL( const QString &url, const bool updateView = true ); + void updateTags( const TQString &url, const MetaBundle &bundle, const bool updateView = true ); + void updateURL( const TQString &url, const bool updateView = true ); //statistics methods - int addSongPercentage( const QString &url, int percentage ); - int getSongPercentage( const QString &url ); - void setSongPercentage( const QString &url , int percentage ); + int addSongPercentage( const TQString &url, int percentage ); + int getSongPercentage( const TQString &url ); + void setSongPercentage( const TQString &url , int percentage ); //artist methods - QStringList similarArtists( const QString &artist, uint count ); + TQStringList similarArtists( const TQString &artist, uint count ); //album methods - void checkCompilations( const QString &path, const bool temporary = false, DbConnection *conn = NULL ); - void setCompilation( const QString &album, const bool enabled, const bool updateView = true ); - QString albumSongCount( const QString &artist_id, const QString &album_id ); - bool albumIsCompilation( const QString &album_id ); + void checkCompilations( const TQString &path, const bool temporary = false, DbConnection *conn = NULL ); + void setCompilation( const TQString &album, const bool enabled, const bool updateView = true ); + TQString albumSongCount( const TQString &artist_id, const TQString &album_id ); + bool albumIsCompilation( const TQString &album_id ); //list methods - QStringList artistList( bool withUnknowns = true, bool withCompilations = true ); - QStringList albumList( bool withUnknowns = true, bool withCompilations = true ); - QStringList genreList( bool withUnknowns = true, bool withCompilations = true ); - QStringList yearList( bool withUnknowns = true, bool withCompilations = true ); + TQStringList artistList( bool withUnknowns = true, bool withCompilations = true ); + TQStringList albumList( bool withUnknowns = true, bool withCompilations = true ); + TQStringList genreList( bool withUnknowns = true, bool withCompilations = true ); + TQStringList yearList( bool withUnknowns = true, bool withCompilations = true ); - QStringList albumListOfArtist( const QString &artist, bool withUnknown = true, bool withCompilations = true ); - QStringList artistAlbumList( bool withUnknown = true, bool withCompilations = true ); + TQStringList albumListOfArtist( const TQString &artist, bool withUnknown = true, bool withCompilations = true ); + TQStringList artistAlbumList( bool withUnknown = true, bool withCompilations = true ); - QStringList albumTracks( const QString &artist_id, const QString &album_id ); + TQStringList albumTracks( const TQString &artist_id, const TQString &album_id ); //cover management methods /** Returns the image from a given URL, network-transparently. * You must run KIO::NetAccess::removeTempFile( tmpFile ) when you are finished using the image; **/ - static QImage fetchImage(const KURL& url, QString &tmpFile); + static TQImage fetchImage(const KURL& url, TQString &tmpFile); /** Saves images located on the user's filesystem */ - bool setAlbumImage( const QString& artist, const QString& album, const KURL& url ); + bool setAlbumImage( const TQString& artist, const TQString& album, const KURL& url ); /** Saves images obtained from CoverFetcher */ - bool setAlbumImage( const QString& artist, const QString& album, QImage img, const QString& amazonUrl = QString::null ); + bool setAlbumImage( const TQString& artist, const TQString& album, TQImage img, const TQString& amazonUrl = TQString::null ); - QString findImageByMetabundle( MetaBundle trackInformation, const uint = 1 ); - QString findImageByArtistAlbum( const QString &artist, const QString &album, const uint width = 1 ); - QString albumImage( MetaBundle trackInformation, const uint width = 1 ); - QString albumImage( const uint artist_id, const uint album_id, const uint width = 1 ); - QString albumImage( const QString &artist, const QString &album, const uint width = 1 ); + TQString findImageByMetabundle( MetaBundle trackInformation, const uint = 1 ); + TQString findImageByArtistAlbum( const TQString &artist, const TQString &album, const uint width = 1 ); + TQString albumImage( MetaBundle trackInformation, const uint width = 1 ); + TQString albumImage( const uint artist_id, const uint album_id, const uint width = 1 ); + TQString albumImage( const TQString &artist, const TQString &album, const uint width = 1 ); bool removeAlbumImage( const uint artist_id, const uint album_id ); - bool removeAlbumImage( const QString &artist, const QString &album ); + bool removeAlbumImage( const TQString &artist, const TQString &album ); //local cover methods - void addImageToAlbum( const QString& image, QValueList< QPair > info, DbConnection *conn = NULL ); - QString getImageForAlbum( const QString& artist, const QString& album, uint width = 0 ); - QString notAvailCover( int width = 0 ); + void addImageToAlbum( const TQString& image, TQValueList< QPair > info, DbConnection *conn = NULL ); + TQString getImageForAlbum( const TQString& artist, const TQString& album, uint width = 0 ); + TQString notAvailCover( int width = 0 ); void applySettings(); @@ -177,21 +177,21 @@ class CollectionDB : public QObject, public EngineObserver CollectionDB(); ~CollectionDB(); - QCString md5sum( const QString& artist, const QString& album, const QString& file = QString::null ); + TQCString md5sum( const TQString& artist, const TQString& album, const TQString& file = TQString::null ); void engineTrackEnded( int finalPosition, int trackLength ); /** Manages regular folder monitoring scan */ - void timerEvent( QTimerEvent* e ); + void timerEvent( TQTimerEvent* e ); public slots: - void fetchCover( QWidget* parent, const QString& artist, const QString& album, bool noedit ); + void fetchCover( TQWidget* parent, const TQString& artist, const TQString& album, bool noedit ); void scanMonitor(); void startScan(); void stopScan(); private slots: - void dirDirty( const QString& path ); + void dirDirty( const TQString& path ); void coverFetcherResult( CoverFetcher* ); - void similarArtistsFetched( const QString& artist, const QStringList& suggestions ); + void similarArtistsFetched( const TQString& artist, const TQStringList& suggestions ); private: //bump DATABASE_VERSION whenever changes to the table structure are made. will remove old db file. @@ -202,37 +202,37 @@ class CollectionDB : public QObject, public EngineObserver void initialize(); void destroy(); - void customEvent( QCustomEvent* ); + void customEvent( TQCustomEvent* ); //general management methods void createStatsTable(); void dropStatsTable(); void scanModifiedDirs(); - QCString makeWidthKey( uint width ); - QString artistValue( uint id ); - QString albumValue( uint id ); - QString genreValue( uint id ); - QString yearValue( uint id ); + TQCString makeWidthKey( uint width ); + TQString artistValue( uint id ); + TQString albumValue( uint id ); + TQString genreValue( uint id ); + TQString yearValue( uint id ); - uint IDFromValue( QString name, QString value, bool autocreate = true, const bool temporary = false, + uint IDFromValue( TQString name, TQString value, bool autocreate = true, const bool temporary = false, const bool updateSpelling = false, DbConnection *conn = NULL ); - QString valueFromID( QString table, uint id ); + TQString valueFromID( TQString table, uint id ); //member variables - QString m_amazonLicense; - QString m_cacheArtist; + TQString m_amazonLicense; + TQString m_cacheArtist; uint m_cacheArtistID; - QString m_cacheAlbum; + TQString m_cacheAlbum; uint m_cacheAlbumID; DBEngine* m_dbEngine; DbConnectionPool *m_dbConnPool; bool m_monitor; - QDir m_cacheDir; - QDir m_coverDir; + TQDir m_cacheDir; + TQDir m_coverDir; }; diff --git a/amarok/src/database_refactor/dbenginebase.cpp b/amarok/src/database_refactor/dbenginebase.cpp index 42f40366..837fde90 100644 --- a/amarok/src/database_refactor/dbenginebase.cpp +++ b/amarok/src/database_refactor/dbenginebase.cpp @@ -21,7 +21,7 @@ ***************************************************************************/ #include -#include +#include #include @@ -123,7 +123,7 @@ QueryBuilder::countReturnValues() void -QueryBuilder::addURLFilters( const QStringList& filter ) +QueryBuilder::addURLFilters( const TQStringList& filter ) { if ( !filter.isEmpty() ) { @@ -142,7 +142,7 @@ QueryBuilder::addURLFilters( const QStringList& filter ) void -QueryBuilder::addFilter( int tables, const QString& filter, int /*mode*/ ) +QueryBuilder::addFilter( int tables, const TQString& filter, int /*mode*/ ) { if ( !filter.isEmpty() ) { @@ -160,7 +160,7 @@ QueryBuilder::addFilter( int tables, const QString& filter, int /*mode*/ ) void -QueryBuilder::addFilters( int tables, const QStringList& filter ) +QueryBuilder::addFilters( int tables, const TQStringList& filter ) { if ( !filter.isEmpty() ) { @@ -185,7 +185,7 @@ QueryBuilder::addFilters( int tables, const QStringList& filter ) void -QueryBuilder::addMatch( int tables, const QString& match ) +QueryBuilder::addMatch( int tables, const TQString& match ) { if ( !match.isEmpty() ) { @@ -211,15 +211,15 @@ QueryBuilder::addMatch( int tables, const QString& match ) void -QueryBuilder::addMatch( int tables, int value, const QString& match ) +QueryBuilder::addMatch( int tables, int value, const TQString& match ) { if ( !match.isEmpty() ) { m_where += "AND ( true "; - m_where += QString( "OR %1.%2 LIKE '" ).arg( tableName( tables ) ).arg( valueName( value ) ) + escapeString( match ) + "' "; + m_where += TQString( "OR %1.%2 LIKE '" ).arg( tableName( tables ) ).arg( valueName( value ) ) + escapeString( match ) + "' "; if ( ( value & valName ) && match == i18n( "Unknown" ) ) - m_where += QString( "OR %1.%2 = '' " ).arg( tableName( tables ) ).arg( valueName( value ) ); + m_where += TQString( "OR %1.%2 = '' " ).arg( tableName( tables ) ).arg( valueName( value ) ); m_where += " ) "; } @@ -229,7 +229,7 @@ QueryBuilder::addMatch( int tables, int value, const QString& match ) void -QueryBuilder::addMatches( int tables, const QStringList& match ) +QueryBuilder::addMatches( int tables, const TQStringList& match ) { if ( !match.isEmpty() ) { @@ -261,7 +261,7 @@ QueryBuilder::addMatches( int tables, const QStringList& match ) void -QueryBuilder::excludeFilter( int tables, const QString& filter ) +QueryBuilder::excludeFilter( int tables, const TQString& filter ) { if ( !filter.isEmpty() ) { @@ -279,7 +279,7 @@ QueryBuilder::excludeFilter( int tables, const QString& filter ) void -QueryBuilder::excludeMatch( int tables, const QString& match ) +QueryBuilder::excludeMatch( int tables, const TQString& match ) { if ( !match.isEmpty() ) { @@ -385,7 +385,7 @@ QueryBuilder::sortByFunction( int function, int table, int value, bool descendin if ( b ) m_sort += "LOWER( "; if ( table & tabYear ) m_sort += "("; - QString columnName = functionName( function )+tableName( table )+valueName( value ); + TQString columnName = functionName( function )+tableName( table )+valueName( value ); m_sort += columnName; if ( table & tabYear ) m_sort += "+0)"; @@ -410,7 +410,7 @@ QueryBuilder::groupBy( int table, int value ) void QueryBuilder::setLimit( int startPos, int length ) { - m_limit = QString( " LIMIT %1, %2 " ).arg( startPos ).arg( length ); + m_limit = TQString( " LIMIT %1, %2 " ).arg( startPos ).arg( length ); } @@ -487,7 +487,7 @@ QueryBuilder::clear() QString QueryBuilder::tableName( int table ) { - QString tables; + TQString tables; if ( table & tabSong ) tables += ",tags"; if ( table & tabArtist ) tables += ",artist"; @@ -504,7 +504,7 @@ QueryBuilder::tableName( int table ) QString QueryBuilder::valueName( int value ) { - QString values; + TQString values; if ( value & valID ) values += "id"; if ( value & valName ) values += "name"; @@ -531,7 +531,7 @@ QueryBuilder::valueName( int value ) QString QueryBuilder::functionName( int value ) { - QString function; + TQString function; if ( value & funcCount ) function += "Count"; if ( value & funcMax ) function += "Max"; diff --git a/amarok/src/database_refactor/dbenginebase.h b/amarok/src/database_refactor/dbenginebase.h index 880a34bd..9458d6ce 100644 --- a/amarok/src/database_refactor/dbenginebase.h +++ b/amarok/src/database_refactor/dbenginebase.h @@ -24,13 +24,13 @@ #define AMAROK_DBENGINEBASE_H #include "plugin/plugin.h" //baseclass -#include //baseclass +#include //baseclass class DbConfig {}; -class DbConnection : public QObject, public amaroK::Plugin +class DbConnection : public TQObject, public amaroK::Plugin { public: enum DbConnectionType { sqlite = 0, mysql = 1, postgresql = 2 }; @@ -38,11 +38,11 @@ class DbConnection : public QObject, public amaroK::Plugin DbConnection( DbConfig* /* config */ ); virtual ~DbConnection() = 0; - virtual QStringList query( const QString& /* statement */ ) = 0; - virtual int insert( const QString& /* statement */, const QString& /* table */ ) = 0; + virtual TQStringList query( const TQString& /* statement */ ) = 0; + virtual int insert( const TQString& /* statement */, const TQString& /* table */ ) = 0; const bool isInitialized() const { return m_initialized; } virtual bool isConnected() const = 0; - virtual const QString lastError() const { return "None"; } + virtual const TQString lastError() const { return "None"; } protected: bool m_initialized; @@ -66,7 +66,7 @@ class QueryBuilder QueryBuilder(); - QString escapeString( QString string ) + TQString escapeString( TQString string ) { return #ifdef USE_MYSQL @@ -82,16 +82,16 @@ class QueryBuilder void addReturnFunctionValue( int function, int table, int value); uint countReturnValues(); - void addURLFilters( const QStringList& filter ); + void addURLFilters( const TQStringList& filter ); - void addFilter( int tables, const QString& filter, int mode = modeNormal ); - void addFilters( int tables, const QStringList& filter ); - void excludeFilter( int tables, const QString& filter ); + void addFilter( int tables, const TQString& filter, int mode = modeNormal ); + void addFilters( int tables, const TQStringList& filter ); + void excludeFilter( int tables, const TQString& filter ); - void addMatch( int tables, const QString& match ); - void addMatch( int tables, int value, const QString& match ); - void addMatches( int tables, const QStringList& match ); - void excludeMatch( int tables, const QString& match ); + void addMatch( int tables, const TQString& match ); + void addMatch( int tables, int value, const TQString& match ); + void addMatches( int tables, const TQStringList& match ); + void excludeMatch( int tables, const TQString& match ); void exclusiveFilter( int tableMatching, int tableNotMatching, int value ); @@ -103,27 +103,27 @@ class QueryBuilder void initSQLDrag(); void buildQuery(); - QString getQuery(); - QString query() { buildQuery(); return m_query; }; + TQString getQuery(); + TQString query() { buildQuery(); return m_query; }; void clear(); - QStringList run(); + TQStringList run(); private: - QString tableName( int table ); - QString valueName( int value ); - QString functionName( int value ); + TQString tableName( int table ); + TQString valueName( int value ); + TQString functionName( int value ); void linkTables( int tables ); - QString m_query; - QString m_values; - QString m_tables; - QString m_join; - QString m_where; - QString m_sort; - QString m_group; - QString m_limit; + TQString m_query; + TQString m_values; + TQString m_tables; + TQString m_join; + TQString m_where; + TQString m_sort; + TQString m_group; + TQString m_limit; int m_linkTables; uint m_returnValues; diff --git a/amarok/src/database_refactor/sqlite/sqlite_dbengine.cpp b/amarok/src/database_refactor/sqlite/sqlite_dbengine.cpp index 3d93a84c..c8dd911f 100644 --- a/amarok/src/database_refactor/sqlite/sqlite_dbengine.cpp +++ b/amarok/src/database_refactor/sqlite/sqlite_dbengine.cpp @@ -14,9 +14,9 @@ #include -#include -#include -#include +#include +#include +#include #include //DbConnection::sqlite_power() #include //query() @@ -34,14 +34,14 @@ AMAROK_EXPORT_PLUGIN( SqliteDbEngine ) SqliteDbEngine::SqliteDbEngine() : DbConnection( new SqliteConfig( "collection.db" ) ) { - const QCString path = QString(/*amaroK::saveLocation()+*/"collection.db").local8Bit(); + const TQCString path = TQString(/*amaroK::saveLocation()+*/"collection.db").local8Bit(); // Open database file and check for correctness m_initialized = false; - QFile file( path ); + TQFile file( path ); if ( file.open( IO_ReadOnly ) ) { - QString format; + TQString format; file.readLine( format, 50 ); if ( !format.startsWith( "SQLite format 3" ) ) { @@ -59,7 +59,7 @@ SqliteDbEngine::SqliteDbEngine() if ( !m_initialized ) { // Remove old db file; create new - QFile::remove( path ); + TQFile::remove( path ); if ( sqlite3_open( path, &m_db ) == SQLITE_OK ) { m_initialized = true; @@ -84,9 +84,9 @@ SqliteDbEngine::~SqliteDbEngine() } -QStringList SqliteDbEngine::query( const QString& statement ) +TQStringList SqliteDbEngine::query( const TQString& statement ) { - QStringList values; + TQStringList values; int error; const char* tail; sqlite3_stmt* stmt; @@ -99,7 +99,7 @@ QStringList SqliteDbEngine::query( const QString& statement ) Debug::error() << k_funcinfo << " sqlite3_compile error:" << endl; Debug::error() << sqlite3_errmsg( m_db ) << endl; Debug::error() << "on query: " << statement << endl; - values = QStringList(); + values = TQStringList(); } else { @@ -127,7 +127,7 @@ QStringList SqliteDbEngine::query( const QString& statement ) //iterate over columns for ( int i = 0; i < number; i++ ) { - values << QString::fromUtf8( (const char*) sqlite3_column_text( stmt, i ) ); + values << TQString::fromUtf8( (const char*) sqlite3_column_text( stmt, i ) ); } } //deallocate vm resources @@ -138,7 +138,7 @@ QStringList SqliteDbEngine::query( const QString& statement ) Debug::error() << k_funcinfo << "sqlite_step error.\n"; Debug::error() << sqlite3_errmsg( m_db ) << endl; Debug::error() << "on query: " << statement << endl; - values = QStringList(); + values = TQStringList(); } } @@ -146,7 +146,7 @@ QStringList SqliteDbEngine::query( const QString& statement ) } -int SqliteDbEngine::insert( const QString& statement, const QString& /* table */ ) +int SqliteDbEngine::insert( const TQString& statement, const TQString& /* table */ ) { int error; const char* tail; @@ -221,7 +221,7 @@ void SqliteDbEngine::sqlite_power(sqlite3_context *context, int argc, sqlite3_va // CLASS SqliteConfig ////////////////////////////////////////////////////////////////////////////////////////// -SqliteConfig::SqliteConfig( const QString& dbfile ) +SqliteConfig::SqliteConfig( const TQString& dbfile ) : m_dbfile( dbfile ) {} diff --git a/amarok/src/database_refactor/sqlite/sqlite_dbengine.h b/amarok/src/database_refactor/sqlite/sqlite_dbengine.h index d19263e0..52fe5cdc 100644 --- a/amarok/src/database_refactor/sqlite/sqlite_dbengine.h +++ b/amarok/src/database_refactor/sqlite/sqlite_dbengine.h @@ -8,11 +8,11 @@ #include "dbenginebase.h" #include -#include //stack allocated -#include //baseclass -#include //baseclass -#include //stack allocated -#include //stack allocated +#include //stack allocated +#include //baseclass +#include //baseclass +#include //stack allocated +#include //stack allocated class DbConfig; class DbConnection; @@ -25,12 +25,12 @@ class Scrobbler; class SqliteConfig : public DbConfig { public: - SqliteConfig( const QString& /* dbfile */ ); + SqliteConfig( const TQString& /* dbfile */ ); - const QString dbFile() const { return m_dbfile; } + const TQString dbFile() const { return m_dbfile; } private: - QString m_dbfile; + TQString m_dbfile; }; @@ -44,8 +44,8 @@ class SqliteDbEngine : public DbConnection SqliteDbEngine(); ~SqliteDbEngine(); - QStringList query( const QString& /* statement */ ); - int insert( const QString& /* statement */, const QString& /* table */ ); + TQStringList query( const TQString& /* statement */ ); + int insert( const TQString& /* statement */, const TQString& /* table */ ); bool isConnected()const { return true; } private: static void sqlite_rand(sqlite3_context *context, int /*argc*/, sqlite3_value ** /*argv*/); diff --git a/amarok/src/dbsetup.ui.h b/amarok/src/dbsetup.ui.h index 5b305e0e..6b41b8bb 100644 --- a/amarok/src/dbsetup.ui.h +++ b/amarok/src/dbsetup.ui.h @@ -19,7 +19,7 @@ void DbSetup::init() configStack->raiseWidget( 0 ); #ifdef USE_MYSQL databaseEngine->insertItem( "MySQL", -1 ); - if (AmarokConfig::databaseEngine() == QString::number(DbConnection::mysql)) + if (AmarokConfig::databaseEngine() == TQString::number(DbConnection::mysql)) { databaseEngine->setCurrentItem("MySQL"); configStack->raiseWidget( 1 ); @@ -28,7 +28,7 @@ void DbSetup::init() #ifdef USE_POSTGRESQL databaseEngine->insertItem( "Postgresql", -1 ); - if (AmarokConfig::databaseEngine() == QString::number(DbConnection::postgresql)) + if (AmarokConfig::databaseEngine() == TQString::number(DbConnection::postgresql)) { databaseEngine->setCurrentItem("Postgresql"); configStack->raiseWidget( 2 ); diff --git a/amarok/src/debug.h b/amarok/src/debug.h index 2c83ad79..610704fe 100644 --- a/amarok/src/debug.h +++ b/amarok/src/debug.h @@ -6,14 +6,14 @@ #define AMAROK_DEBUG_H #include -#include -#include -#include -#include +#include +#include +#include +#include #include -class QApplication; -extern QApplication *qApp; ///@see Debug::Indent +class TQApplication; +extern TQApplication *qApp; ///@see Debug::Indent /** @@ -48,30 +48,30 @@ extern QApplication *qApp; ///@see Debug::Indent namespace Debug { - extern QMutex mutex; // defined in app.cpp + extern TQMutex mutex; // defined in app.cpp - // we can't use a statically instantiated QCString for the indent, because + // we can't use a statically instantiated TQCString for the indent, because // static namespaces are unique to each dlopened library. So we piggy back - // the QCString on the KApplication instance + // the TQCString on the KApplication instance - #define qApp reinterpret_cast(qApp) + #define qApp reinterpret_cast(qApp) class Indent : QObject { - friend QCString &modifieableIndent(); - Indent() : QObject( qApp, "DEBUG_indent" ) {} - QCString m_string; + friend TQCString &modifieableIndent(); + Indent() : TQObject( qApp, "DEBUG_indent" ) {} + TQCString m_string; }; - inline QCString &modifieableIndent() + inline TQCString &modifieableIndent() { - QObject *o = qApp ? qApp->child( "DEBUG_indent" ) : 0; - QCString &ret = (o ? static_cast( o ) : new Indent)->m_string; + TQObject *o = qApp ? qApp->child( "DEBUG_indent" ) : 0; + TQCString &ret = (o ? static_cast( o ) : new Indent)->m_string; return ret; } - inline QCString indent() + inline TQCString indent() { - return QDeepCopy( modifieableIndent() ); + return TQDeepCopy( modifieableIndent() ); } #undef qApp @@ -98,10 +98,10 @@ namespace Debug KDEBUG_FATAL = 3 }; - static inline kdbgstream debug() { mutex.lock(); QCString ind = indent(); mutex.unlock(); return kdbgstream( ind, 0, KDEBUG_INFO ) << AMK_PREFIX; } - static inline kdbgstream warning() { mutex.lock(); QCString ind = indent(); mutex.unlock(); return kdbgstream( ind, 0, KDEBUG_WARN ) << AMK_PREFIX << "[WARNING!] "; } - static inline kdbgstream error() { mutex.lock(); QCString ind = indent(); mutex.unlock(); return kdbgstream( ind, 0, KDEBUG_ERROR ) << AMK_PREFIX << "[ERROR!] "; } - static inline kdbgstream fatal() { mutex.lock(); QCString ind = indent(); mutex.unlock(); return kdbgstream( ind, 0, KDEBUG_FATAL ) << AMK_PREFIX; } + static inline kdbgstream debug() { mutex.lock(); TQCString ind = indent(); mutex.unlock(); return kdbgstream( ind, 0, KDEBUG_INFO ) << AMK_PREFIX; } + static inline kdbgstream warning() { mutex.lock(); TQCString ind = indent(); mutex.unlock(); return kdbgstream( ind, 0, KDEBUG_WARN ) << AMK_PREFIX << "[WARNING!] "; } + static inline kdbgstream error() { mutex.lock(); TQCString ind = indent(); mutex.unlock(); return kdbgstream( ind, 0, KDEBUG_ERROR ) << AMK_PREFIX << "[ERROR!] "; } + static inline kdbgstream fatal() { mutex.lock(); TQCString ind = indent(); mutex.unlock(); return kdbgstream( ind, 0, KDEBUG_FATAL ) << AMK_PREFIX; } typedef kdbgstream DebugStream; @@ -193,7 +193,7 @@ namespace Debug Debug::modifieableIndent().truncate( Debug::indent().length() - 2 ); kdDebug() << "END__: " << m_label - << " - Took " << QString::number( duration, 'g', 2 ) << "s\n"; + << " - Took " << TQString::number( duration, 'g', 2 ) << "s\n"; mutex.unlock(); } }; @@ -228,7 +228,7 @@ namespace Debug } -#include +#include namespace Debug { @@ -239,7 +239,7 @@ namespace Debug * debug() << (Debug::List() << anInt << aString << aQStringList << aDouble) << endl; */ - typedef QValueList List; + typedef TQValueList List; } #endif diff --git a/amarok/src/deletedialog.cpp b/amarok/src/deletedialog.cpp index 1c34e7d1..970526c5 100644 --- a/amarok/src/deletedialog.cpp +++ b/amarok/src/deletedialog.cpp @@ -23,13 +23,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include "amarok.h" #include "playlist.h" @@ -41,7 +41,7 @@ // DeleteWidget implementation ////////////////////////////////////////////////////////////////////////////// -DeleteWidget::DeleteWidget(QWidget *parent, const char *name) +DeleteWidget::DeleteWidget(TQWidget *parent, const char *name) : DeleteDialogBase(parent, name) { KConfigGroup messageGroup(KGlobal::config(), "FileRemover"); @@ -84,7 +84,7 @@ void DeleteWidget::slotShouldDelete(bool shouldDelete) // DeleteDialog implementation ////////////////////////////////////////////////////////////////////////////// -DeleteDialog::DeleteDialog(QWidget *parent, const char *name) : +DeleteDialog::DeleteDialog(TQWidget *parent, const char *name) : KDialogBase(Swallow, WStyle_DialogBorder, parent, name, true /* modal */, i18n("About to delete selected files"), Ok | Cancel, Cancel /* Default */, true /* separator */), @@ -98,7 +98,7 @@ DeleteDialog::DeleteDialog(QWidget *parent, const char *name) : adjustSize(); slotShouldDelete(shouldDelete()); - connect(m_widget->ddShouldDelete, SIGNAL(toggled(bool)), SLOT(slotShouldDelete(bool))); + connect(m_widget->ddShouldDelete, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotShouldDelete(bool))); } @@ -106,7 +106,7 @@ bool DeleteDialog::confirmDeleteList(const KURL::List& condemnedFiles) { m_widget->setFiles(condemnedFiles); - return exec() == QDialog::Accepted; + return exec() == TQDialog::Accepted; } void DeleteDialog::setFiles(const KURL::List &files) @@ -131,7 +131,7 @@ void DeleteDialog::slotShouldDelete(bool shouldDelete) setButtonGuiItem(Ok, shouldDelete ? KStdGuiItem::del() : m_trashGuiItem); } -bool DeleteDialog::showTrashDialog(QWidget* parent, const KURL::List& files) +bool DeleteDialog::showTrashDialog(TQWidget* parent, const KURL::List& files) { DeleteDialog dialog(parent); bool doDelete = dialog.confirmDeleteList(files); diff --git a/amarok/src/deletedialog.h b/amarok/src/deletedialog.h index 6127f1fb..7789553e 100644 --- a/amarok/src/deletedialog.h +++ b/amarok/src/deletedialog.h @@ -17,23 +17,23 @@ #define _DELETEDIALOG_H -#include +#include #include #include #include "deletedialogbase.h" -class QStringList; +class TQStringList; class KListBox; class KGuiItem; -class QLabel; -class QWidgetStack; +class TQLabel; +class TQWidgetStack; class DeleteWidget : public DeleteDialogBase { Q_OBJECT public: - DeleteWidget(QWidget *parent = 0, const char *name = 0); + DeleteWidget(TQWidget *parent = 0, const char *name = 0); void setFiles(const KURL::List &files); @@ -46,8 +46,8 @@ class DeleteDialog : public KDialogBase Q_OBJECT public: - DeleteDialog(QWidget *parent, const char *name = "delete_dialog"); - static bool showTrashDialog(QWidget* parent, const KURL::List &files); + DeleteDialog(TQWidget *parent, const char *name = "delete_dialog"); + static bool showTrashDialog(TQWidget* parent, const KURL::List &files); bool confirmDeleteList(const KURL::List &condemnedFiles); void setFiles(const KURL::List &files); diff --git a/amarok/src/device/massstorage/massstoragedevicehandler.cpp b/amarok/src/device/massstorage/massstoragedevicehandler.cpp index 76ff777b..57b0c3d4 100644 --- a/amarok/src/device/massstorage/massstoragedevicehandler.cpp +++ b/amarok/src/device/massstorage/massstoragedevicehandler.cpp @@ -27,7 +27,7 @@ AMAROK_EXPORT_PLUGIN( MassStorageDeviceHandlerFactory ) #include #include -#include +#include MassStorageDeviceHandler::MassStorageDeviceHandler() : DeviceHandler() @@ -35,7 +35,7 @@ MassStorageDeviceHandler::MassStorageDeviceHandler() { } -MassStorageDeviceHandler::MassStorageDeviceHandler( int deviceId, const QString &mountPoint, const QString &uuid ) +MassStorageDeviceHandler::MassStorageDeviceHandler( int deviceId, const TQString &mountPoint, const TQString &uuid ) : DeviceHandler() , m_deviceID( deviceId ) , m_mountPoint( mountPoint ) @@ -53,7 +53,7 @@ bool MassStorageDeviceHandler::isAvailable() const } -QString MassStorageDeviceHandler::type() const +TQString MassStorageDeviceHandler::type() const { return "uuid"; } @@ -63,7 +63,7 @@ int MassStorageDeviceHandler::getDeviceID() return m_deviceID; } -const QString &MassStorageDeviceHandler::getDevicePath() const +const TQString &MassStorageDeviceHandler::getDevicePath() const { return m_mountPoint; } @@ -89,7 +89,7 @@ bool MassStorageDeviceHandler::deviceIsMedium( const Medium * m ) const // class MassStorageDeviceHandlerFactory /////////////////////////////////////////////////////////////////////////////// -QString MassStorageDeviceHandlerFactory::type( ) const +TQString MassStorageDeviceHandlerFactory::type( ) const { return "uuid"; } @@ -124,19 +124,19 @@ DeviceHandler * MassStorageDeviceHandlerFactory::createHandler( const KConfig* ) DeviceHandler * MassStorageDeviceHandlerFactory::createHandler( const Medium * m ) const { - QStringList ids = CollectionDB::instance()->query( QString( "SELECT id, label, lastmountpoint " + TQStringList ids = CollectionDB::instance()->query( TQString( "SELECT id, label, lastmountpoint " "FROM devices WHERE type = 'uuid' " "AND uuid = '%1';" ).arg( m->id() ) ); if ( ids.size() == 3 ) { debug() << "Found existing UUID config for ID " << ids[0] << " , uuid " << m->id() << endl; - CollectionDB::instance()->query( QString( "UPDATE devices SET lastmountpoint = '%2' WHERE " + CollectionDB::instance()->query( TQString( "UPDATE devices SET lastmountpoint = '%2' WHERE " "id = %1;" ).arg( ids[0] ).arg( m->mountPoint() ) ); return new MassStorageDeviceHandler( ids[0].toInt(), m->mountPoint(), m->id() ); } else { - int id = CollectionDB::instance()->insert( QString( "INSERT INTO devices( type, uuid, lastmountpoint ) " + int id = CollectionDB::instance()->insert( TQString( "INSERT INTO devices( type, uuid, lastmountpoint ) " "VALUES ( 'uuid', '%1', '%2' );" ) .arg( m->id() ) .arg( m->mountPoint() ), "devices" ); @@ -151,7 +151,7 @@ DeviceHandler * MassStorageDeviceHandlerFactory::createHandler( const Medium * m } bool -MassStorageDeviceHandlerFactory::excludedFilesystem( const QString &fstype ) const +MassStorageDeviceHandlerFactory::excludedFilesystem( const TQString &fstype ) const { return fstype.isEmpty() || fstype.find( "smb" ) != -1 || diff --git a/amarok/src/device/massstorage/massstoragedevicehandler.h b/amarok/src/device/massstorage/massstoragedevicehandler.h index cb3bdf92..5e7af650 100644 --- a/amarok/src/device/massstorage/massstoragedevicehandler.h +++ b/amarok/src/device/massstorage/massstoragedevicehandler.h @@ -36,10 +36,10 @@ public: virtual DeviceHandler* createHandler( const KConfig* c ) const; - virtual QString type() const; + virtual TQString type() const; private: - bool excludedFilesystem( const QString &fstype ) const; + bool excludedFilesystem( const TQString &fstype ) const; }; /** @@ -49,14 +49,14 @@ class MassStorageDeviceHandler : public DeviceHandler { public: MassStorageDeviceHandler(); - MassStorageDeviceHandler(int deviceId, const QString &mountPoint, const QString &uuid ); + MassStorageDeviceHandler(int deviceId, const TQString &mountPoint, const TQString &uuid ); virtual ~MassStorageDeviceHandler(); virtual bool isAvailable() const; - virtual QString type() const; + virtual TQString type() const; virtual int getDeviceID( ); - virtual const QString &getDevicePath() const; + virtual const TQString &getDevicePath() const; virtual void getURL( KURL &absolutePath, const KURL &relativePath ); virtual void getPlayableURL( KURL &absolutePath, const KURL &relativePath ); virtual bool deviceIsMedium( const Medium *m ) const; @@ -64,8 +64,8 @@ public: private: int m_deviceID; - const QString m_mountPoint; - QString m_uuid; + const TQString m_mountPoint; + TQString m_uuid; }; diff --git a/amarok/src/device/nfs/nfsdevicehandler.cpp b/amarok/src/device/nfs/nfsdevicehandler.cpp index 274f76e5..57c9d58f 100644 --- a/amarok/src/device/nfs/nfsdevicehandler.cpp +++ b/amarok/src/device/nfs/nfsdevicehandler.cpp @@ -24,10 +24,10 @@ AMAROK_EXPORT_PLUGIN( NfsDeviceHandlerFactory ) #include #include -#include +#include -NfsDeviceHandler::NfsDeviceHandler( int deviceId, QString server, QString dir, QString mountPoint ) +NfsDeviceHandler::NfsDeviceHandler( int deviceId, TQString server, TQString dir, TQString mountPoint ) : DeviceHandler() , m_deviceID( deviceId ) , m_mountPoint( mountPoint ) @@ -59,7 +59,7 @@ NfsDeviceHandler::getDeviceID() return m_deviceID; } -const QString & +const TQString & NfsDeviceHandler::getDevicePath() const { return m_mountPoint; @@ -130,9 +130,9 @@ NfsDeviceHandlerFactory::createHandler( const KConfig* ) const DeviceHandler * NfsDeviceHandlerFactory::createHandler( const Medium * m ) const { - QString server = m->deviceNode().section( ":", 0, 0 ); - QString share = m->deviceNode().section( ":", 1, 1 ); - QStringList ids = CollectionDB::instance()->query( QString( "SELECT id, label, lastmountpoint " + TQString server = m->deviceNode().section( ":", 0, 0 ); + TQString share = m->deviceNode().section( ":", 1, 1 ); + TQStringList ids = CollectionDB::instance()->query( TQString( "SELECT id, label, lastmountpoint " "FROM devices WHERE type = 'nfs' " "AND servername = '%1' AND sharename = '%2';" ) .arg( server ) @@ -140,13 +140,13 @@ NfsDeviceHandlerFactory::createHandler( const Medium * m ) const if ( ids.size() == 3 ) { debug() << "Found existing NFS config for ID " << ids[0] << " , server " << server << " ,share " << share << endl; - CollectionDB::instance()->query( QString( "UPDATE devices SET lastmountpoint = '%2' WHERE " + CollectionDB::instance()->query( TQString( "UPDATE devices SET lastmountpoint = '%2' WHERE " "id = %1;" ).arg( ids[0] ).arg( m->mountPoint() ) ); return new NfsDeviceHandler( ids[0].toInt(), server, share, m->mountPoint() ); } else { - int id = CollectionDB::instance()->insert( QString( "INSERT INTO devices" + int id = CollectionDB::instance()->insert( TQString( "INSERT INTO devices" "( type, servername, sharename, lastmountpoint ) " "VALUES ( 'nfs', '%1', '%2', '%3' );" ) .arg( server ) diff --git a/amarok/src/device/nfs/nfsdevicehandler.h b/amarok/src/device/nfs/nfsdevicehandler.h index a17af7aa..165ffe6d 100644 --- a/amarok/src/device/nfs/nfsdevicehandler.h +++ b/amarok/src/device/nfs/nfsdevicehandler.h @@ -36,7 +36,7 @@ public: virtual DeviceHandler* createHandler( const KConfig* c ) const; - virtual QString type() const; + virtual TQString type() const; }; /** @@ -45,14 +45,14 @@ public: class NfsDeviceHandler : public DeviceHandler { public: - NfsDeviceHandler(int deviceId, QString server, QString dir, QString mountPoint ); + NfsDeviceHandler(int deviceId, TQString server, TQString dir, TQString mountPoint ); virtual ~NfsDeviceHandler(); virtual bool isAvailable() const; - virtual QString type() const; + virtual TQString type() const; virtual int getDeviceID( ); - virtual const QString &getDevicePath() const; + virtual const TQString &getDevicePath() const; virtual void getURL( KURL &absolutePath, const KURL &relativePath ); virtual void getPlayableURL( KURL &absolutePath, const KURL &relativePath ); virtual bool deviceIsMedium( const Medium *m ) const; @@ -60,9 +60,9 @@ public: private: int m_deviceID; - const QString m_mountPoint; - QString m_server; - QString m_dir; + const TQString m_mountPoint; + TQString m_server; + TQString m_dir; }; diff --git a/amarok/src/device/smb/smbdevicehandler.cpp b/amarok/src/device/smb/smbdevicehandler.cpp index 2e778fcd..4883fcf7 100644 --- a/amarok/src/device/smb/smbdevicehandler.cpp +++ b/amarok/src/device/smb/smbdevicehandler.cpp @@ -24,10 +24,10 @@ AMAROK_EXPORT_PLUGIN( SmbDeviceHandlerFactory ) #include #include -#include +#include -SmbDeviceHandler::SmbDeviceHandler( int deviceId, QString server, QString dir, QString mountPoint ) +SmbDeviceHandler::SmbDeviceHandler( int deviceId, TQString server, TQString dir, TQString mountPoint ) : DeviceHandler() , m_deviceID( deviceId ) , m_mountPoint( mountPoint ) @@ -59,7 +59,7 @@ SmbDeviceHandler::getDeviceID() return m_deviceID; } -const QString & +const TQString & SmbDeviceHandler::getDevicePath() const { return m_mountPoint; @@ -132,9 +132,9 @@ SmbDeviceHandlerFactory::createHandler( const KConfig* ) const DeviceHandler * SmbDeviceHandlerFactory::createHandler( const Medium * m ) const { - QString server = m->deviceNode().section( "/", 2, 2 ); - QString share = m->deviceNode().section( "/", 3, 3 ); - QStringList ids = CollectionDB::instance()->query( QString( "SELECT id, label, lastmountpoint " + TQString server = m->deviceNode().section( "/", 2, 2 ); + TQString share = m->deviceNode().section( "/", 3, 3 ); + TQStringList ids = CollectionDB::instance()->query( TQString( "SELECT id, label, lastmountpoint " "FROM devices WHERE type = 'smb' " "AND servername = '%1' AND sharename = '%2';" ) .arg( server ) @@ -142,13 +142,13 @@ SmbDeviceHandlerFactory::createHandler( const Medium * m ) const if ( ids.size() == 3 ) { debug() << "Found existing SMB config for ID " << ids[0] << " , server " << server << " ,share " << share << endl; - CollectionDB::instance()->query( QString( "UPDATE devices SET lastmountpoint = '%2' WHERE " + CollectionDB::instance()->query( TQString( "UPDATE devices SET lastmountpoint = '%2' WHERE " "id = %1;" ).arg( ids[0] ).arg( m->mountPoint() ) ); return new SmbDeviceHandler( ids[0].toInt(), server, share, m->mountPoint() ); } else { - int id = CollectionDB::instance()->insert( QString( "INSERT INTO devices" + int id = CollectionDB::instance()->insert( TQString( "INSERT INTO devices" "( type, servername, sharename, lastmountpoint ) " "VALUES ( 'smb', '%1', '%2', '%3' );" ) .arg( server ) diff --git a/amarok/src/device/smb/smbdevicehandler.h b/amarok/src/device/smb/smbdevicehandler.h index e3b04cb0..8eb6d5ed 100644 --- a/amarok/src/device/smb/smbdevicehandler.h +++ b/amarok/src/device/smb/smbdevicehandler.h @@ -36,7 +36,7 @@ public: virtual DeviceHandler* createHandler( const KConfig* c ) const; - virtual QString type() const; + virtual TQString type() const; }; /** @@ -45,14 +45,14 @@ public: class SmbDeviceHandler : public DeviceHandler { public: - SmbDeviceHandler(int deviceId, QString server, QString dir, QString mountPoint ); + SmbDeviceHandler(int deviceId, TQString server, TQString dir, TQString mountPoint ); virtual ~SmbDeviceHandler(); virtual bool isAvailable() const; - virtual QString type() const; + virtual TQString type() const; virtual int getDeviceID( ); - virtual const QString &getDevicePath() const; + virtual const TQString &getDevicePath() const; virtual void getURL( KURL &absolutePath, const KURL &relativePath ); virtual void getPlayableURL( KURL &absolutePath, const KURL &relativePath ); virtual bool deviceIsMedium( const Medium *m ) const; @@ -60,9 +60,9 @@ public: private: int m_deviceID; - const QString m_mountPoint; - QString m_server; - QString m_dir; + const TQString m_mountPoint; + TQString m_server; + TQString m_dir; }; diff --git a/amarok/src/deviceconfiguredialog.cpp b/amarok/src/deviceconfiguredialog.cpp index c9781fe1..2e38be6d 100644 --- a/amarok/src/deviceconfiguredialog.cpp +++ b/amarok/src/deviceconfiguredialog.cpp @@ -20,11 +20,11 @@ #include "pluginmanager.h" #include "scriptmanager.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -33,22 +33,22 @@ #include DeviceConfigureDialog::DeviceConfigureDialog( const Medium &medium ) - : KDialogBase( Amarok::mainWindow(), "deviceconfiguredialog", true, QString("Select Plugin for " + medium.name()), Ok|Cancel, Ok, false ) + : KDialogBase( Amarok::mainWindow(), "deviceconfiguredialog", true, TQString("Select Plugin for " + medium.name()), Ok|Cancel, Ok, false ) { m_medium = new Medium( medium ); kapp->setTopWidget( this ); setCaption( kapp->makeStdCaption( i18n( "Configure Media Device" ) ) ); showButtonApply( false ); - QVBox* vbox = makeVBoxMainWidget(); + TQVBox* vbox = makeVBoxMainWidget(); vbox->setSpacing( KDialog::spacingHint() ); - QLabel *connectLabel = 0; + TQLabel *connectLabel = 0; m_connectEdit = 0; - QLabel *disconnectLabel = 0; + TQLabel *disconnectLabel = 0; m_disconnectEdit = 0; m_transcodeCheck = 0; - QButtonGroup *transcodeGroup = 0; + TQButtonGroup *transcodeGroup = 0; m_transcodeAlways = 0; m_transcodeWhenNecessary = 0; m_transcodeRemove = 0; @@ -60,51 +60,51 @@ DeviceConfigureDialog::DeviceConfigureDialog( const Medium &medium ) device->loadConfig(); // pre-connect/post-disconnect (mount/umount) - connectLabel = new QLabel( vbox ); + connectLabel = new TQLabel( vbox ); connectLabel->setText( i18n( "Pre-&connect command:" ) ); m_connectEdit = new HintLineEdit( device->m_preconnectcmd, vbox ); m_connectEdit->setHint( i18n( "Example: mount %d" ) ); connectLabel->setBuddy( m_connectEdit ); - QToolTip::add( m_connectEdit, i18n( "Set a command to be run before connecting to your device (e.g. a mount command) here.\n%d is replaced by the device node, %m by the mount point.\nEmpty commands are not executed." ) ); + TQToolTip::add( m_connectEdit, i18n( "Set a command to be run before connecting to your device (e.g. a mount command) here.\n%d is replaced by the device node, %m by the mount point.\nEmpty commands are not executed." ) ); - disconnectLabel = new QLabel( vbox ); + disconnectLabel = new TQLabel( vbox ); disconnectLabel->setText( i18n( "Post-&disconnect command:" ) ); m_disconnectEdit = new HintLineEdit( device->m_postdisconnectcmd, vbox ); disconnectLabel->setBuddy( m_disconnectEdit ); m_disconnectEdit->setHint( i18n( "Example: eject %d" ) ); - QToolTip::add( m_disconnectEdit, i18n( "Set a command to be run after disconnecting from your device (e.g. an eject command) here.\n%d is replaced by the device node, %m by the mount point.\nEmpty commands are not executed." ) ); + TQToolTip::add( m_disconnectEdit, i18n( "Set a command to be run after disconnecting from your device (e.g. an eject command) here.\n%d is replaced by the device node, %m by the mount point.\nEmpty commands are not executed." ) ); // transcode - m_transcodeCheck = new QCheckBox( vbox ); + m_transcodeCheck = new TQCheckBox( vbox ); m_transcodeCheck->setText( i18n( "&Transcode before transferring to device" ) ); m_transcodeCheck->setChecked( device->m_transcode ); - transcodeGroup = new QVButtonGroup( vbox ); - QString format = "mp3"; + transcodeGroup = new TQVButtonGroup( vbox ); + TQString format = "mp3"; if( !device->supportedFiletypes().isEmpty() ) format = device->supportedFiletypes().first(); transcodeGroup->setTitle( i18n( "Transcode to preferred format (%1) for device" ).arg( format ) ); - m_transcodeAlways = new QRadioButton( transcodeGroup ); + m_transcodeAlways = new TQRadioButton( transcodeGroup ); m_transcodeAlways->setText( i18n( "Whenever possible" ) ); m_transcodeAlways->setChecked( device->m_transcodeAlways ); - m_transcodeWhenNecessary = new QRadioButton( transcodeGroup ); + m_transcodeWhenNecessary = new TQRadioButton( transcodeGroup ); m_transcodeWhenNecessary->setText( i18n( "When necessary" ) ); m_transcodeWhenNecessary->setChecked( !device->m_transcodeAlways ); - connect( m_transcodeCheck, SIGNAL(toggled( bool )), - transcodeGroup, SLOT(setEnabled( bool )) ); + connect( m_transcodeCheck, TQT_SIGNAL(toggled( bool )), + transcodeGroup, TQT_SLOT(setEnabled( bool )) ); transcodeGroup->insert( m_transcodeAlways ); transcodeGroup->insert( m_transcodeWhenNecessary ); - m_transcodeRemove = new QCheckBox( transcodeGroup ); + m_transcodeRemove = new TQCheckBox( transcodeGroup ); m_transcodeRemove->setText( i18n( "Remove transcoded files after transfer" ) ); m_transcodeRemove->setChecked( device->m_transcodeRemove ); const ScriptManager *sm = ScriptManager::instance(); - m_transcodeCheck->setEnabled( sm->transcodeScriptRunning() != QString::null ); - transcodeGroup->setEnabled( sm->transcodeScriptRunning() != QString::null && device->m_transcode ); + m_transcodeCheck->setEnabled( sm->transcodeScriptRunning() != TQString::null ); + transcodeGroup->setEnabled( sm->transcodeScriptRunning() != TQString::null && device->m_transcode ); if( sm->transcodeScriptRunning().isNull() ) { - QToolTip::add( m_transcodeCheck, i18n( "For this feature, a script of type \"Transcode\" has to be running" ) ); - QToolTip::add( transcodeGroup, i18n( "For this feature, a script of type \"Transcode\" has to be running" ) ); + TQToolTip::add( m_transcodeCheck, i18n( "For this feature, a script of type \"Transcode\" has to be running" ) ); + TQToolTip::add( transcodeGroup, i18n( "For this feature, a script of type \"Transcode\" has to be running" ) ); } device->addConfigElements( vbox ); diff --git a/amarok/src/deviceconfiguredialog.h b/amarok/src/deviceconfiguredialog.h index 920829e9..9d02a360 100644 --- a/amarok/src/deviceconfiguredialog.h +++ b/amarok/src/deviceconfiguredialog.h @@ -15,8 +15,8 @@ #include "hintlineedit.h" -#include -#include +#include +#include #include @@ -45,10 +45,10 @@ class DeviceConfigureDialog : public KDialogBase HintLineEdit *m_connectEdit; HintLineEdit *m_disconnectEdit; - QCheckBox *m_transcodeCheck; - QRadioButton *m_transcodeAlways; - QRadioButton *m_transcodeWhenNecessary; - QCheckBox *m_transcodeRemove; + TQCheckBox *m_transcodeCheck; + TQRadioButton *m_transcodeAlways; + TQRadioButton *m_transcodeWhenNecessary; + TQCheckBox *m_transcodeRemove; }; diff --git a/amarok/src/devicemanager.cpp b/amarok/src/devicemanager.cpp index e97e1274..a6d8a7d9 100644 --- a/amarok/src/devicemanager.cpp +++ b/amarok/src/devicemanager.cpp @@ -19,8 +19,8 @@ #include "medium.h" #include "mediumpluginmanager.h" -#include -#include +#include +#include #include #include @@ -28,7 +28,7 @@ #include typedef Medium::List MediumList; -typedef QMap::Iterator MediumIterator; +typedef TQMap::Iterator MediumIterator; DeviceManager* DeviceManager::instance() { @@ -49,9 +49,9 @@ DeviceManager::DeviceManager() } else { - if (!m_dc->connectDCOPSignal("kded", "mediamanager", "mediumAdded(QString)", "devices", "mediumAdded(QString)", false) || - !m_dc->connectDCOPSignal("kded", "mediamanager", "mediumRemoved(QString)", "devices", "mediumRemoved(QString)", false) || - !m_dc->connectDCOPSignal("kded", "mediamanager", "mediumChanged(QString)", "devices", "mediumChanged(QString)", false)) + if (!m_dc->connectDCOPSignal("kded", "mediamanager", "mediumAdded(TQString)", "devices", "mediumAdded(TQString)", false) || + !m_dc->connectDCOPSignal("kded", "mediamanager", "mediumRemoved(TQString)", "devices", "mediumRemoved(TQString)", false) || + !m_dc->connectDCOPSignal("kded", "mediamanager", "mediumChanged(TQString)", "devices", "mediumChanged(TQString)", false)) { debug() << "DeviceManager: Could not connect to signal mediumAdded/Removed/Changed!" << endl; } @@ -60,10 +60,10 @@ DeviceManager::DeviceManager() m_valid = true; //run the DCOP query here because apparently if you don't run KDE as a DM the first call will fail //...go figure - QByteArray data, replyData; - QCString replyType; - QDataStream arg(data, IO_WriteOnly); - QStringList result; + TQByteArray data, replyData; + TQCString replyType; + TQDataStream arg(data, IO_WriteOnly); + TQStringList result; arg << 5; if (!m_dc->call("kded", "mediamanager", "fullList()", data, replyType, replyData, false, -1)) { @@ -82,7 +82,7 @@ DeviceManager::~DeviceManager() } void -DeviceManager::mediumAdded( const QString name ) +DeviceManager::mediumAdded( const TQString name ) { DEBUG_BLOCK if ( !m_valid ) @@ -97,7 +97,7 @@ DeviceManager::mediumAdded( const QString name ) void -DeviceManager::mediumRemoved( const QString name ) +DeviceManager::mediumRemoved( const TQString name ) { DEBUG_BLOCK if ( !m_valid ) @@ -123,7 +123,7 @@ DeviceManager::mediumRemoved( const QString name ) void -DeviceManager::mediumChanged( const QString name ) +DeviceManager::mediumChanged( const TQString name ) { DEBUG_BLOCK if ( !m_valid ) @@ -140,7 +140,7 @@ DeviceManager::mediumChanged( const QString name ) /* BIG FAT WARNING: Values returned from the below function should not be counted on being unique! -For instance, there may be a Medium object in the QMap that can be accessed through +For instance, there may be a Medium object in the TQMap that can be accessed through other functions that has the same data as the Medium object returned, but is a different object. As you should not be writing to this object, this is okay, however: @@ -163,17 +163,17 @@ DeviceManager::getDeviceStringList() if ( !m_valid ) { - QStringList blah; + TQStringList blah; return blah; } //normal kded Medium doesn't have autodetect, so decrease by 1 int autodetect_insert = Medium::PROPERTIES_COUNT - 1; - QByteArray data, replyData; - QCString replyType; - QDataStream arg(data, IO_WriteOnly); - QStringList result; + TQByteArray data, replyData; + TQCString replyType; + TQDataStream arg(data, IO_WriteOnly); + TQStringList result; arg << 5; if (!m_dc->call("kded", "mediamanager", "fullList()", data, replyType, replyData)) { @@ -181,16 +181,16 @@ DeviceManager::getDeviceStringList() } else { - QDataStream reply(replyData, IO_ReadOnly); + TQDataStream reply(replyData, IO_ReadOnly); while(!reply.atEnd()) { reply >> result; } - QStringList::Iterator it; + TQStringList::Iterator it; for( it = result.begin(); it != result.end(); ++it ) { if (autodetect_insert == Medium::PROPERTIES_COUNT - 1) - result.insert(it, QString("true")); + result.insert(it, TQString("true")); autodetect_insert--; if (autodetect_insert == -1) autodetect_insert = Medium::PROPERTIES_COUNT - 1; @@ -201,7 +201,7 @@ DeviceManager::getDeviceStringList() } Medium* -DeviceManager::getDevice( const QString name ) +DeviceManager::getDevice( const TQString name ) { DEBUG_BLOCK if ( !m_valid ) @@ -260,20 +260,20 @@ DeviceManager::reconcileMediumMap() warning() << "Number of devices does not equal expected number" << endl; } -QString DeviceManager::convertMediaUrlToDevice( QString url ) +TQString DeviceManager::convertMediaUrlToDevice( TQString url ) { - QString device; + TQString device; if ( url.startsWith( "media:" ) || url.startsWith( "system:" ) ) { KURL devicePath( url ); DCOPRef mediamanager( "kded", "mediamanager" ); - DCOPReply reply = mediamanager.call( "properties(QString)", devicePath.fileName() ); + DCOPReply reply = mediamanager.call( "properties(TQString)", devicePath.fileName() ); if ( reply.isValid() ) { - QStringList properties = reply; + TQStringList properties = reply; device = properties[ 5 ]; //kdDebug() << "DeviceManager::convertMediaUrlToDevice() munged to: " << device << "\n"; } else - device = QString(); + device = TQString(); } else device = url; diff --git a/amarok/src/devicemanager.h b/amarok/src/devicemanager.h index 74470390..2cdcf5b4 100644 --- a/amarok/src/devicemanager.h +++ b/amarok/src/devicemanager.h @@ -18,11 +18,11 @@ #include "medium.h" -#include +#include #include -typedef QMap MediumMap; +typedef TQMap MediumMap; //this class provides support for MountPointManager and MediaDeviceManager @@ -38,12 +38,12 @@ class DeviceManager : public QObject ~DeviceManager(); static DeviceManager *instance(); - void mediumAdded( const QString name ); - void mediumChanged( const QString name); - void mediumRemoved( const QString name); + void mediumAdded( const TQString name ); + void mediumChanged( const TQString name); + void mediumRemoved( const TQString name); MediumMap getMediumMap() { return m_mediumMap; } - Medium* getDevice( const QString name ); + Medium* getDevice( const TQString name ); // reconciles m_mediumMap to whatever kded has in it. void reconcileMediumMap(); @@ -54,18 +54,18 @@ class DeviceManager : public QObject //public so can be called from DCOP...but don't use this, see the //warning about getDeviceList() - QStringList getDeviceStringList(); + TQStringList getDeviceStringList(); // Converts a media://media/hdc URL as provided by the KDE media // manager on CD insert to /dev/hdc so amarok can play it. // This method is safe to call with a device path, it returns it // unchanged. - QString convertMediaUrlToDevice( QString url ); + TQString convertMediaUrlToDevice( TQString url ); signals: - void mediumAdded( const Medium*, QString ); - void mediumChanged( const Medium*, QString ); - void mediumRemoved( const Medium*, QString ); + void mediumAdded( const Medium*, TQString ); + void mediumChanged( const Medium*, TQString ); + void mediumRemoved( const Medium*, TQString ); private: diff --git a/amarok/src/directorylist.cpp b/amarok/src/directorylist.cpp index 30ae5bf5..930f597c 100644 --- a/amarok/src/directorylist.cpp +++ b/amarok/src/directorylist.cpp @@ -23,30 +23,30 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include CollectionSetup* CollectionSetup::s_instance; -CollectionSetup::CollectionSetup( QWidget *parent ) - : QVBox( parent, "CollectionSetup" ) +CollectionSetup::CollectionSetup( TQWidget *parent ) + : TQVBox( parent, "CollectionSetup" ) { s_instance = this; - (new QLabel( i18n( + (new TQLabel( i18n( "These folders will be scanned for " "media to make up your collection:"), this ))->setAlignment( Qt::WordBreak ); m_view = new QFixedListView( this ); - m_recursive = new QCheckBox( i18n("&Scan folders recursively"), this ); - m_monitor = new QCheckBox( i18n("&Watch folders for changes"), this ); + m_recursive = new TQCheckBox( i18n("&Scan folders recursively"), this ); + m_monitor = new TQCheckBox( i18n("&Watch folders for changes"), this ); - QToolTip::add( m_recursive, i18n( "If selected, Amarok will read all subfolders." ) ); - QToolTip::add( m_monitor, i18n( "If selected, folders will automatically get rescanned when the content is modified, e.g. when a new file was added." ) ); + TQToolTip::add( m_recursive, i18n( "If selected, Amarok will read all subfolders." ) ); + TQToolTip::add( m_monitor, i18n( "If selected, folders will automatically get rescanned when the content is modified, e.g. when a new file was added." ) ); // Read config values //we have to detect if this is the actual first run and not get the collectionFolders in that case @@ -59,12 +59,12 @@ CollectionSetup::CollectionSetup( QWidget *parent ) m_recursive->setChecked( AmarokConfig::scanRecursively() ); m_monitor->setChecked( AmarokConfig::monitorChanges() ); - m_view->addColumn( QString::null ); + m_view->addColumn( TQString::null ); m_view->setRootIsDecorated( true ); - m_view->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); - m_view->setResizeMode( QListView::LastColumn ); + m_view->setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ); + m_view->setResizeMode( TQListView::LastColumn ); - reinterpret_cast(m_view->header())->hide(); + reinterpret_cast(m_view->header())->hide(); new Collection::Item( m_view ); setSpacing( 6 ); @@ -78,9 +78,9 @@ CollectionSetup::writeConfig() //subdirectories of the selected directories if ( recursive() ) { - for ( QStringList::iterator it=m_dirs.begin(); it!=m_dirs.end(); ++it ) + for ( TQStringList::iterator it=m_dirs.begin(); it!=m_dirs.end(); ++it ) { - QStringList::iterator jt=m_dirs.begin(); + TQStringList::iterator jt=m_dirs.begin(); while ( jt!=m_dirs.end() ) { if ( it==jt ) @@ -112,8 +112,8 @@ CollectionSetup::writeConfig() namespace Collection { -Item::Item( QListView *parent ) - : QCheckListItem( parent, "/", QCheckListItem::CheckBox ) +Item::Item( TQListView *parent ) + : TQCheckListItem( parent, "/", TQCheckListItem::CheckBox ) , m_lister( true ) , m_url( "file:/" ) , m_listed( false ) @@ -121,16 +121,16 @@ Item::Item( QListView *parent ) { //Since we create the "/" checklistitem here, we need to enable it if needed if ( CollectionSetup::instance()->m_dirs.contains( "/" ) ) - static_cast( this )->setOn(true); + static_cast( this )->setOn(true); m_lister.setDirOnlyMode( true ); - connect( &m_lister, SIGNAL(newItems( const KFileItemList& )), SLOT(newItems( const KFileItemList& )) ); + connect( &m_lister, TQT_SIGNAL(newItems( const KFileItemList& )), TQT_SLOT(newItems( const KFileItemList& )) ); setOpen( true ); setVisible( true ); } -Item::Item( QListViewItem *parent, const KURL &url , bool full_disable /* default=false */ ) - : QCheckListItem( parent, url.fileName(), QCheckListItem::CheckBox ) +Item::Item( TQListViewItem *parent, const KURL &url , bool full_disable /* default=false */ ) + : TQCheckListItem( parent, url.fileName(), TQCheckListItem::CheckBox ) , m_lister( true ) , m_url( url ) , m_listed( false ) @@ -138,18 +138,18 @@ Item::Item( QListViewItem *parent, const KURL &url , bool full_disable /* defaul { m_lister.setDirOnlyMode( true ); setExpandable( true ); - connect( &m_lister, SIGNAL(newItems( const KFileItemList& )), SLOT(newItems( const KFileItemList& )) ); - connect( &m_lister, SIGNAL(completed()), SLOT(completed()) ); - connect( &m_lister, SIGNAL(canceled()), SLOT(completed()) ); + connect( &m_lister, TQT_SIGNAL(newItems( const KFileItemList& )), TQT_SLOT(newItems( const KFileItemList& )) ); + connect( &m_lister, TQT_SIGNAL(completed()), TQT_SLOT(completed()) ); + connect( &m_lister, TQT_SIGNAL(canceled()), TQT_SLOT(completed()) ); } QString Item::fullPath() const { - QString path; + TQString path; - for( const QListViewItem *item = this; item != listView()->firstChild(); item = item->parent() ) + for( const TQListViewItem *item = this; item != listView()->firstChild(); item = item->parent() ) { path.prepend( item->text( 0 ) ); path.prepend( '/' ); @@ -168,22 +168,22 @@ Item::setOpen( bool b ) m_listed = true; } - QListViewItem::setOpen( b ); + TQListViewItem::setOpen( b ); } void Item::stateChange( bool b ) { - QStringList &cs_m_dirs = CollectionSetup::instance()->m_dirs; + TQStringList &cs_m_dirs = CollectionSetup::instance()->m_dirs; if ( isFullyDisabled() ) return; if( CollectionSetup::instance()->recursive() ) - for( QListViewItem *item = firstChild(); item; item = item->nextSibling() ) + for( TQListViewItem *item = firstChild(); item; item = item->nextSibling() ) if ( dynamic_cast( item ) && !dynamic_cast( item )->isFullyDisabled() ) - static_cast(item)->QCheckListItem::setOn( b ); + static_cast(item)->TQCheckListItem::setOn( b ); //If it is disabled, allow us to change its appearance (above code) but not add it //to the list of folders (code below) @@ -191,7 +191,7 @@ Item::stateChange( bool b ) return; // Update folder list - QStringList::Iterator it = cs_m_dirs.find( m_url.path() ); + TQStringList::Iterator it = cs_m_dirs.find( m_url.path() ); if ( isOn() ) { if ( it == cs_m_dirs.end() ) cs_m_dirs << m_url.path(); @@ -199,7 +199,7 @@ Item::stateChange( bool b ) // Deselect subdirectories if we are in recursive mode as they are redundant if ( CollectionSetup::instance()->recursive() ) { - QStringList::Iterator diriter = cs_m_dirs.begin(); + TQStringList::Iterator diriter = cs_m_dirs.begin(); while ( diriter != cs_m_dirs.end() ) { // Since the dir "/" starts with '/', we need a hack to stop it removing @@ -221,13 +221,13 @@ Item::stateChange( bool b ) //special case if ( it != cs_m_dirs.end() ) cs_m_dirs.erase( it ); - QStringList::Iterator diriter = cs_m_dirs.begin(); + TQStringList::Iterator diriter = cs_m_dirs.begin(); while ( diriter != cs_m_dirs.end() ) { if ( (*diriter).startsWith( m_url.path(1) ) ) //path(1) adds a trailing '/' { if ( CollectionSetup::instance()->recursive() || - !QFile::exists( *diriter ) ) + !TQFile::exists( *diriter ) ) { diriter = cs_m_dirs.erase(diriter); } @@ -248,7 +248,7 @@ void Item::activate() { if( !isDisabled() ) - QCheckListItem::activate(); + TQCheckListItem::activate(); } @@ -286,30 +286,30 @@ Item::newItems( const KFileItemList &list ) //SLOT void -Item::paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align ) +Item::paintCell( TQPainter * p, const TQColorGroup & cg, int column, int width, int align ) { bool dirty = false; - QStringList &cs_m_dirs = CollectionSetup::instance()->m_dirs; + TQStringList &cs_m_dirs = CollectionSetup::instance()->m_dirs; // Figure out if a child folder is activated - for ( QStringList::const_iterator iter = cs_m_dirs.begin(); iter != cs_m_dirs.end(); + for ( TQStringList::const_iterator iter = cs_m_dirs.begin(); iter != cs_m_dirs.end(); ++iter ) if ( ( *iter ).startsWith( m_url.path(1) ) ) if ( *iter != "/" ) // "/" should not match as a child of "/" dirty = true; // Use a different color if this folder has an activated child folder - const QFont f = p->font(); - QColorGroup _cg = cg; + const TQFont f = p->font(); + TQColorGroup _cg = cg; if ( dirty ) { - _cg.setColor( QColorGroup::Text, listView()->colorGroup().link() ); - QFont font = p->font(); + _cg.setColor( TQColorGroup::Text, listView()->colorGroup().link() ); + TQFont font = p->font(); font.setBold( !font.bold() ); p->setFont( font ); } - QCheckListItem::paintCell( p, isDisabled() ? listView()->palette().disabled() : _cg, column, width, align ); + TQCheckListItem::paintCell( p, isDisabled() ? listView()->palette().disabled() : _cg, column, width, align ); p->setFont( f ); } diff --git a/amarok/src/directorylist.h b/amarok/src/directorylist.h index d6954d98..ef8a89f1 100644 --- a/amarok/src/directorylist.h +++ b/amarok/src/directorylist.h @@ -19,9 +19,9 @@ #ifndef AMAROK_DIRECTORYLIST_H #define AMAROK_DIRECTORYLIST_H -#include //inlined functions -#include //baseclass -#include //baseclass +#include //inlined functions +#include //baseclass +#include //baseclass #include //stack allocated #include //stack allocated @@ -33,11 +33,11 @@ class QFixedListView : public QListView // Reimplement sizeHint to have directorylist not being too big for "low" (1024x768 is not exactly low) resolutions { public: - QFixedListView ( QWidget * parent = 0, const char * name = 0, WFlags f = 0 ) - :QListView(parent, name, f) {}; - QSize sizeHint() const + QFixedListView ( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 ) + :TQListView(parent, name, f) {}; + TQSize sizeHint() const { - return QSize(400, 100); + return TQSize(400, 100); } }; @@ -49,10 +49,10 @@ class CollectionSetup : public QVBox public: static CollectionSetup* instance() { return s_instance; } - CollectionSetup( QWidget* ); + CollectionSetup( TQWidget* ); void writeConfig(); - QStringList dirs() const { return m_dirs; } + TQStringList dirs() const { return m_dirs; } bool recursive() const { return m_recursive->isChecked(); } bool monitor() const { return m_monitor->isChecked(); } @@ -60,30 +60,30 @@ private: static CollectionSetup* s_instance; QFixedListView *m_view; - QStringList m_dirs; - QCheckBox *m_recursive; - QCheckBox *m_monitor; + TQStringList m_dirs; + TQCheckBox *m_recursive; + TQCheckBox *m_monitor; }; namespace Collection { //just to keep it out of the global namespace -class Item : public QObject, public QCheckListItem +class Item : public TQObject, public QCheckListItem { Q_OBJECT public: - Item( QListView *parent ); - Item( QListViewItem *parent, const KURL &url , bool full_disable=false ); + Item( TQListView *parent ); + Item( TQListViewItem *parent, const KURL &url , bool full_disable=false ); - QCheckListItem *parent() const { return static_cast( QListViewItem::parent() ); } + TQCheckListItem *parent() const { return static_cast( TQListViewItem::parent() ); } bool isFullyDisabled() const { return m_fullyDisabled; } bool isDisabled() const { return isFullyDisabled() || ( CollectionSetup::instance()->recursive() && parent() && parent()->isOn() ); } - QString fullPath() const; + TQString fullPath() const; void setOpen( bool b ); // reimpl. void stateChange( bool ); // reimpl. void activate(); // reimpl. - void paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align ); // reimpl. + void paintCell( TQPainter * p, const TQColorGroup & cg, int column, int width, int align ); // reimpl. public slots: void newItems( const KFileItemList& ); diff --git a/amarok/src/dynamicmode.cpp b/amarok/src/dynamicmode.cpp index e7950e49..1bc8aa7b 100644 --- a/amarok/src/dynamicmode.cpp +++ b/amarok/src/dynamicmode.cpp @@ -30,14 +30,14 @@ #include // random func -#include -#include +#include +#include ///////////////////////////////////////////////////////////////////////////// /// CLASS DynamicMode //////////////////////////////////////////////////////////////////////////// -DynamicMode::DynamicMode( const QString &name ) +DynamicMode::DynamicMode( const TQString &name ) : m_title( name ) , m_cycle( true ) , m_upcoming( 20 ) @@ -65,28 +65,28 @@ DynamicMode::edit() ConfigDynamic::editDynamicPlaylist( PlaylistWindow::self(), this ); } -QStringList DynamicMode::items() const { return m_items; } +TQStringList DynamicMode::items() const { return m_items; } -QString DynamicMode::title() const { return m_title; } +TQString DynamicMode::title() const { return m_title; } bool DynamicMode::cycleTracks() const { return m_cycle; } int DynamicMode::upcomingCount() const { return m_upcoming; } int DynamicMode::previousCount() const { return m_previous; } int DynamicMode::appendType() const { return m_appendType; } -void DynamicMode::setItems( const QStringList &list ) { m_items = list; } +void DynamicMode::setItems( const TQStringList &list ) { m_items = list; } void DynamicMode::setCycleTracks( bool e ) { m_cycle = e; } void DynamicMode::setUpcomingCount( int c ) { m_upcoming = c; } void DynamicMode::setPreviousCount( int c ) { m_previous = c; } void DynamicMode::setAppendType( int type ) { m_appendType = type; } -void DynamicMode::setTitle( const QString& title ) { m_title = title; } +void DynamicMode::setTitle( const TQString& title ) { m_title = title; } -void DynamicMode::setDynamicItems( QPtrList& newList ) +void DynamicMode::setDynamicItems( TQPtrList& newList ) { DEBUG_BLOCK - QStringList strListEntries; + TQStringList strListEntries; PlaylistBrowserEntry* entry; - QPtrListIterator it( newList ); + TQPtrListIterator it( newList ); while( (entry = it.current()) != 0 ) { @@ -115,7 +115,7 @@ DEBUG_BLOCK if( appendType() == SUGGESTION ) { // TODO some clever stuff here for spanning across artists - QString artist = EngineController::instance()->bundle().artist(); + TQString artist = EngineController::instance()->bundle().artist(); if( artist.isEmpty() ) { @@ -126,25 +126,25 @@ DEBUG_BLOCK debug() << "seeding from: " << artist << endl; - QStringList suggestions = CollectionDB::instance()->similarArtists( artist, 16 ); + TQStringList suggestions = CollectionDB::instance()->similarArtists( artist, 16 ); // for this artist, choose 4 suggested artists at random, to get further suggestions from - QStringList newChosen; + TQStringList newChosen; for( uint suggestCount = 0; suggestCount < 4; ++suggestCount ) { if( suggestions.isEmpty() ) break; - QString chosen = suggestions[ KApplication::random() % suggestions.count() ]; + TQString chosen = suggestions[ KApplication::random() % suggestions.count() ]; debug() << "found similar artist: " << chosen << endl; - QStringList newSuggestions = CollectionDB::instance()->similarArtists( chosen, 10 ); + TQStringList newSuggestions = CollectionDB::instance()->similarArtists( chosen, 10 ); for( uint c = 0; c < 4; ++c ) // choose another 4 artists { if( newSuggestions.isEmpty() ) break; - QString s = newSuggestions[ KApplication::random() % newSuggestions.count() ]; + TQString s = newSuggestions[ KApplication::random() % newSuggestions.count() ]; debug() << "found extended similar artist: " << s << endl; newChosen += s; @@ -160,7 +160,7 @@ DEBUG_BLOCK qb.setLimit( 0, CACHE_SIZE ); debug() << "Using SQL: " << qb.query() << endl; - QStringList urls = qb.run(); + TQStringList urls = qb.run(); foreach( urls ) //we have to run setPath on all raw paths { @@ -173,7 +173,7 @@ DEBUG_BLOCK else { PlaylistBrowser *pb = PlaylistBrowser::instance(); - QPtrList dynamicEntries = pb->dynamicEntries(); + TQPtrList dynamicEntries = pb->dynamicEntries(); if( !dynamicEntries.count() ) { Amarok::StatusBar::instance()->longMessage( i18n( "This dynamic playlist has no sources set." ), @@ -181,13 +181,13 @@ DEBUG_BLOCK return; } // Create an array of the sizes of each of the playlists - QValueVector trackCount(dynamicEntries.count()) ; + TQValueVector trackCount(dynamicEntries.count()) ; int trackCountTotal = 0; for( uint i=0; i < dynamicEntries.count(); i++ ){ trackCount[i] = 0; - if ( QListViewItem *item = dynamicEntries.at( i ) ){ + if ( TQListViewItem *item = dynamicEntries.at( i ) ){ if( item->rtti() == PlaylistEntry::RTTI ) trackCount[i] = static_cast(item)->tracksURL().count(); else if( item->rtti() == SmartPlaylist::RTTI ) @@ -199,7 +199,7 @@ DEBUG_BLOCK PlaylistBrowserEntry* entry; - QPtrListIterator it( dynamicEntries ); + TQPtrListIterator it( dynamicEntries ); //const int itemsPerSource = CACHE_SIZE / dynamicEntries.count() != 0 ? CACHE_SIZE / dynamicEntries.count() : 1; @@ -265,15 +265,15 @@ DEBUG_BLOCK const bool hasTimeOrder = item->isTimeOrdered(); debug() << "The smart playlist: " << item->text(0) << ", time order? " << hasTimeOrder << endl; - QString sql = item->query(); + TQString sql = item->query(); // FIXME: All this SQL magic out of collectiondb is not a good thing // if there is no ordering, add random ordering - if ( sql.find( QString("ORDER BY"), false ) == -1 ) + if ( sql.find( TQString("ORDER BY"), false ) == -1 ) { - QRegExp limit( "(LIMIT.*)?;$" ); - sql.replace( limit, QString(" ORDER BY %1 LIMIT %2 OFFSET 0;") + TQRegExp limit( "(LIMIT.*)?;$" ); + sql.replace( limit, TQString(" ORDER BY %1 LIMIT %2 OFFSET 0;") .arg( CollectionDB::instance()->randomFunc() ) .arg( songCount ) ); } @@ -281,15 +281,15 @@ DEBUG_BLOCK { uint limit=0, offset=0; - QRegExp limitSearch( "LIMIT.*(\\d+).*OFFSET.*(\\d+)" ); + TQRegExp limitSearch( "LIMIT.*(\\d+).*OFFSET.*(\\d+)" ); int findLocation = limitSearch.search( sql, 0 ); if( findLocation == -1 ) //not found, let's find out the higher limit the hard way { - QString counting( sql ); - counting.replace( QRegExp( "SELECT.*FROM" ), "SELECT COUNT(*) FROM" ); + TQString counting( sql ); + counting.replace( TQRegExp( "SELECT.*FROM" ), "SELECT COUNT(*) FROM" ); // Postgres' grouping rule doesn't like the following clause - counting.replace( QRegExp( "ORDER BY.*" ), "" ); - QStringList countingResult = CollectionDB::instance()->query( counting ); + counting.replace( TQRegExp( "ORDER BY.*" ), "" ); + TQStringList countingResult = CollectionDB::instance()->query( counting ); limit = countingResult[0].toInt(); } else @@ -306,9 +306,9 @@ DEBUG_BLOCK // We can mess with the limits if the smart playlist is not orderd by a time criteria // Why? We can have a smart playlist which is ordered by name or by some other quality which // is meaningless in dynamic mode - QRegExp orderLimit( "(ORDER BY.*)?;$" ); + TQRegExp orderLimit( "(ORDER BY.*)?;$" ); - sql.replace( orderLimit, QString(" ORDER BY %1 LIMIT %2 OFFSET 0;") + sql.replace( orderLimit, TQString(" ORDER BY %1 LIMIT %2 OFFSET 0;") .arg( CollectionDB::instance()->randomFunc() ) .arg( songCount ) ); } @@ -323,19 +323,19 @@ DEBUG_BLOCK if( findLocation == -1 ) // there is no limit { - QRegExp queryEnd( ";$" ); // find the end of the query an add a limit - sql.replace( queryEnd, QString(" LIMIT %1 OFFSET %2;" ).arg( songCount*5 ).arg( offset ) ); + TQRegExp queryEnd( ";$" ); // find the end of the query an add a limit + sql.replace( queryEnd, TQString(" LIMIT %1 OFFSET %2;" ).arg( songCount*5 ).arg( offset ) ); useDirect = false; } else // there is a limit, so find it and replace it - sql.replace( limitSearch, QString(" LIMIT %1 OFFSET %2;" ).arg( songCount ).arg( offset ) ); + sql.replace( limitSearch, TQString(" LIMIT %1 OFFSET %2;" ).arg( songCount ).arg( offset ) ); } } // only return the fields that we need - sql.replace( QRegExp( "SELECT.*FROM" ), "SELECT tags.url, tags.deviceid FROM" ); - QStringList queryResult = CollectionDB::instance()->query( sql ); - QStringList items; + sql.replace( TQRegExp( "SELECT.*FROM" ), "SELECT tags.url, tags.deviceid FROM" ); + TQStringList queryResult = CollectionDB::instance()->query( sql ); + TQStringList items; debug() << "Smart Playlist: adding urls from query: " << sql << endl; if ( !item->query().isEmpty() ) @@ -390,7 +390,7 @@ DEBUG_BLOCK break; const int pos = KApplication::random() % m_cachedItemSet.count(); KURL::List::iterator newItem = m_cachedItemSet.at( pos ); - if( QFile::exists( (*newItem).path() ) ) + if( TQFile::exists( (*newItem).path() ) ) retrieval << (*newItem); m_cachedItemSet.remove( newItem ); } diff --git a/amarok/src/dynamicmode.h b/amarok/src/dynamicmode.h index 8ae8a544..5c0b3fc0 100644 --- a/amarok/src/dynamicmode.h +++ b/amarok/src/dynamicmode.h @@ -36,9 +36,9 @@ #include //KURL::List -class QString; -class QStringList; -template class QPtrList; +class TQString; +class TQStringList; +template class TQPtrList; class PlaylistBrowserEntry; class PlaylistEntry; class SmartPlaylist; @@ -46,13 +46,13 @@ class SmartPlaylist; class DynamicMode { public: - DynamicMode( const QString &name ); + DynamicMode( const TQString &name ); virtual ~DynamicMode(); enum Type { RANDOM=0, SUGGESTION=1, CUSTOM=2 }; void edit(); void deleting(); - void setDynamicItems( QPtrList& newList ); + void setDynamicItems( TQPtrList& newList ); /** * Retrieves \p tracks from the cache, \p m_cachedItemSet @@ -66,8 +66,8 @@ class DynamicMode */ void rebuildCachedItemSet(); - QString title() const; - QStringList items() const; + TQString title() const; + TQStringList items() const; bool cycleTracks() const; int upcomingCount() const; int previousCount() const; @@ -75,10 +75,10 @@ class DynamicMode void setAppendType( int type ); void setCycleTracks( bool cycle ); - void setItems( const QStringList &list ); + void setItems( const TQStringList &list ); void setUpcomingCount( int count ); void setPreviousCount( int count ); - void setTitle( const QString& title ); + void setTitle( const TQString& title ); private: static const int CACHE_SIZE = 200; ///< the number of items to store in the cached set @@ -112,9 +112,9 @@ class DynamicMode */ KURL::List m_cachedItemSet; - QStringList m_items; + TQStringList m_items; - QString m_title; + TQString m_title; bool m_cycle; int m_upcoming; int m_previous; diff --git a/amarok/src/editfilterdialog.cpp b/amarok/src/editfilterdialog.cpp index 75764317..04f3a19b 100644 --- a/amarok/src/editfilterdialog.cpp +++ b/amarok/src/editfilterdialog.cpp @@ -1,17 +1,17 @@ // (c) 2006 Giovanni Venturi // See COPYING file for licensing information. -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -26,7 +26,7 @@ #include "editfilterdialog.h" #include "metabundle.h" -EditFilterDialog::EditFilterDialog( QWidget* parent, bool metaBundleKeywords, const QString &text ) +EditFilterDialog::EditFilterDialog( TQWidget* parent, bool metaBundleKeywords, const TQString &text ) : KDialogBase( Plain, i18n("Edit Filter"), User1|User2|Default|Ok|Cancel, Cancel, parent, "editfilter", /*modal*/true, /*separator*/false ), m_minMaxRadio(0), @@ -55,23 +55,23 @@ EditFilterDialog::EditFilterDialog( QWidget* parent, bool metaBundleKeywords, co setButtonTip(User2, i18n( "Remove last appended filter" ) ); setButtonGuiItem( User2, user2Button ); - m_mainLay = new QVBoxLayout( plainPage() ); + m_mainLay = new TQVBoxLayout( plainPage() ); m_mainLay->activate(); // no filter rule available m_appended = false; // text explanation of this dialog - QLabel *label1 = new QLabel( plainPage(), "label1" ); + TQLabel *label1 = new TQLabel( plainPage(), "label1" ); label1->setText( i18n("

Edit the filter for finding tracks with specific attributes" ", e.g. you can look for a track that has a length of three minutes.

") ); m_mainLay->addWidget( label1 ); - m_mainLay->addItem( new QSpacerItem( 10, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); + m_mainLay->addItem( new TQSpacerItem( 10, 10, TQSizePolicy::Expanding, TQSizePolicy::Minimum ) ); // choosing keyword filtering - QHBoxLayout *keywordLayout = new QHBoxLayout( plainPage() ); - QLabel *label3 = new QLabel( i18n("Attribute:"), plainPage(), "label3" ); - QWhatsThis::add( label3, + TQHBoxLayout *keywordLayout = new TQHBoxLayout( plainPage() ); + TQLabel *label3 = new TQLabel( i18n("Attribute:"), plainPage(), "label3" ); + TQWhatsThis::add( label3, i18n("you can translate the keyword as you will do for the combobox", "

Here you can choose to Simple Search directly or to use " "some keywords to specify some attributes, such as the artist name " @@ -90,9 +90,9 @@ EditFilterDialog::EditFilterDialog( QWidget* parent, bool metaBundleKeywords, co "kbytes, and megabytes as specified in the unit for the filesize keyword), " "track (i.e. the track number), and year.

") ); keywordLayout->addWidget( label3 ); - keywordLayout->addItem( new QSpacerItem( 5, 10, QSizePolicy::Minimum, QSizePolicy::Minimum ) ); - m_comboKeyword = new QComboBox( plainPage(), "keywordComboBox"); - QToolTip::add( m_comboKeyword, i18n("Select an attribute for the filter") ); + keywordLayout->addItem( new TQSpacerItem( 5, 10, TQSizePolicy::Minimum, TQSizePolicy::Minimum ) ); + m_comboKeyword = new TQComboBox( plainPage(), "keywordComboBox"); + TQToolTip::add( m_comboKeyword, i18n("Select an attribute for the filter") ); label3->setBuddy( m_comboKeyword ); m_comboKeyword->insertItem( i18n("Simple Search") ); @@ -172,62 +172,62 @@ EditFilterDialog::EditFilterDialog( QWidget* parent, bool metaBundleKeywords, co m_selectedIndex = 0; keywordLayout->addWidget( m_comboKeyword ); - keywordLayout->addItem( new QSpacerItem( 5, 10, QSizePolicy::Minimum, QSizePolicy::Minimum ) ); + keywordLayout->addItem( new TQSpacerItem( 5, 10, TQSizePolicy::Minimum, TQSizePolicy::Minimum ) ); m_editKeyword = new KLineEdit( plainPage(), "editKeywordBox" ); - QWhatsThis::add( m_editKeyword, i18n("

Type the attribute value or the text to look for here.

") ); + TQWhatsThis::add( m_editKeyword, i18n("

Type the attribute value or the text to look for here.

") ); keywordLayout->addWidget( m_editKeyword ); m_mainLay->addLayout( keywordLayout ); - m_mainLay->addItem( new QSpacerItem( 10, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); - connect(m_comboKeyword, SIGNAL(activated(int)), this, SLOT(selectedKeyword(int))); + m_mainLay->addItem( new TQSpacerItem( 10, 10, TQSizePolicy::Expanding, TQSizePolicy::Minimum ) ); + connect(m_comboKeyword, TQT_SIGNAL(activated(int)), this, TQT_SLOT(selectedKeyword(int))); // group of options on numeric attribute keywords: a value <,>,= ... or a value between Min and Max - m_groupBox = new QGroupBox( plainPage(), "groupBox" ); + m_groupBox = new TQGroupBox( plainPage(), "groupBox" ); m_groupBox->setTitle( i18n( "Attribute value is" ) ); m_mainLay->addWidget( m_groupBox ); - m_mainLay->addItem( new QSpacerItem( 10, 10, QSizePolicy::Minimum, QSizePolicy::Minimum ) ); + m_mainLay->addItem( new TQSpacerItem( 10, 10, TQSizePolicy::Minimum, TQSizePolicy::Minimum ) ); - QVBoxLayout *vertLayout = new QVBoxLayout( m_groupBox, 15, 5 ); + TQVBoxLayout *vertLayout = new TQVBoxLayout( m_groupBox, 15, 5 ); // choose other keyword parameters: smaller than, greater than, equal to... - QHBoxLayout *paramLayout = new QHBoxLayout( vertLayout ); + TQHBoxLayout *paramLayout = new TQHBoxLayout( vertLayout ); - m_comboCondition = new QComboBox( m_groupBox, "valuecondition"); + m_comboCondition = new TQComboBox( m_groupBox, "valuecondition"); m_comboCondition->insertItem( i18n("smaller than") ); m_comboCondition->insertItem( i18n("larger than") ); m_comboCondition->insertItem( i18n("equal to") ); m_comboCondition->insertItem( i18n("between") ); paramLayout->addWidget( m_comboCondition ); - paramLayout->addItem( new QSpacerItem( 5, 10, QSizePolicy::Fixed, QSizePolicy::Minimum ) ); + paramLayout->addItem( new TQSpacerItem( 5, 10, TQSizePolicy::Fixed, TQSizePolicy::Minimum ) ); - m_spinMin1 = new QSpinBox( m_groupBox, "minimum1" ); + m_spinMin1 = new TQSpinBox( m_groupBox, "minimum1" ); paramLayout->addWidget( m_spinMin1 ); - paramLayout->addItem( new QSpacerItem( 5, 10, QSizePolicy::Minimum, QSizePolicy::Minimum ) ); + paramLayout->addItem( new TQSpacerItem( 5, 10, TQSizePolicy::Minimum, TQSizePolicy::Minimum ) ); - m_spinMin2 = new QSpinBox( m_groupBox, "minimum2" ); + m_spinMin2 = new TQSpinBox( m_groupBox, "minimum2" ); paramLayout->addWidget( m_spinMin2 ); - paramLayout->addItem( new QSpacerItem( 5, 10, QSizePolicy::Minimum, QSizePolicy::Minimum ) ); + paramLayout->addItem( new TQSpacerItem( 5, 10, TQSizePolicy::Minimum, TQSizePolicy::Minimum ) ); - connect(m_spinMin1, SIGNAL(valueChanged(int)), this, SLOT(minSpinChanged(int))); + connect(m_spinMin1, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(minSpinChanged(int))); - m_andLabel = new QLabel( i18n("and"), m_groupBox, "andLabel"); + m_andLabel = new TQLabel( i18n("and"), m_groupBox, "andLabel"); paramLayout->addWidget( m_andLabel ); - paramLayout->addItem( new QSpacerItem( 5, 10, QSizePolicy::Minimum, QSizePolicy::Minimum ) ); + paramLayout->addItem( new TQSpacerItem( 5, 10, TQSizePolicy::Minimum, TQSizePolicy::Minimum ) ); - m_spinMax1 = new QSpinBox( m_groupBox, "maximum1" ); + m_spinMax1 = new TQSpinBox( m_groupBox, "maximum1" ); paramLayout->addWidget( m_spinMax1 ); - paramLayout->addItem( new QSpacerItem( 5, 10, QSizePolicy::Minimum, QSizePolicy::Minimum ) ); + paramLayout->addItem( new TQSpacerItem( 5, 10, TQSizePolicy::Minimum, TQSizePolicy::Minimum ) ); - m_spinMax2 = new QSpinBox( m_groupBox, "maximum2" ); + m_spinMax2 = new TQSpinBox( m_groupBox, "maximum2" ); paramLayout->addWidget( m_spinMax2 ); - connect(m_spinMax1, SIGNAL(valueChanged(int)), this, SLOT(maxSpinChanged(int))); + connect(m_spinMax1, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(maxSpinChanged(int))); - QHBoxLayout *filesizeLayout = new QHBoxLayout( vertLayout ); + TQHBoxLayout *filesizeLayout = new TQHBoxLayout( vertLayout ); filesizeLayout->setAlignment( AlignLeft ); - m_filesizeLabel = new QLabel( i18n("Unit:"), m_groupBox, "filesizeLabel"); + m_filesizeLabel = new TQLabel( i18n("Unit:"), m_groupBox, "filesizeLabel"); filesizeLayout->addWidget( m_filesizeLabel ); - filesizeLayout->addItem( new QSpacerItem( 5, 10, QSizePolicy::Fixed, QSizePolicy::Minimum ) ); - m_comboUnitSize = new QComboBox( m_groupBox, "comboUnitSize" ); + filesizeLayout->addItem( new TQSpacerItem( 5, 10, TQSizePolicy::Fixed, TQSizePolicy::Minimum ) ); + m_comboUnitSize = new TQComboBox( m_groupBox, "comboUnitSize" ); m_filesizeLabel->setBuddy( m_comboUnitSize ); m_comboUnitSize->insertItem( i18n("B (1 Byte)") ); m_comboUnitSize->insertItem( i18n("KB (1024 Bytes)") ); @@ -240,39 +240,39 @@ EditFilterDialog::EditFilterDialog( QWidget* parent, bool metaBundleKeywords, co // check the "One Value Choosing" by default chooseOneValue(); - connect( m_comboCondition, SIGNAL(activated(int)), SLOT(chooseCondition(int)) ); + connect( m_comboCondition, TQT_SIGNAL(activated(int)), TQT_SLOT(chooseCondition(int)) ); - QHBoxLayout *otherOptionsLayout = new QHBoxLayout( plainPage() ); + TQHBoxLayout *otherOptionsLayout = new TQHBoxLayout( plainPage() ); otherOptionsLayout->setAlignment( AlignHCenter ); m_mainLay->addLayout( otherOptionsLayout ); // the groupbox to select the action filter - m_groupBox2 = new QGroupBox( plainPage(), "groupBox2" ); + m_groupBox2 = new TQGroupBox( plainPage(), "groupBox2" ); m_groupBox2->setTitle( i18n( "Filter action" ) ); otherOptionsLayout->addWidget( m_groupBox2 ); - QVBoxLayout* ratioLay = new QVBoxLayout( m_groupBox2, 15, 0 ); + TQVBoxLayout* ratioLay = new TQVBoxLayout( m_groupBox2, 15, 0 ); - m_checkALL = new QRadioButton( i18n("Match all words"), m_groupBox2, "checkall" ); - QToolTip::add( m_checkALL, + m_checkALL = new TQRadioButton( i18n("Match all words"), m_groupBox2, "checkall" ); + TQToolTip::add( m_checkALL, i18n("

Check this box to look for the tracks that contain all the words you typed " "in the related Simple Search edit box

")); ratioLay->addWidget( m_checkALL ); - m_checkAtLeastOne = new QRadioButton( i18n("Match any word"), m_groupBox2, "checkor"); - QToolTip::add( m_checkAtLeastOne, + m_checkAtLeastOne = new TQRadioButton( i18n("Match any word"), m_groupBox2, "checkor"); + TQToolTip::add( m_checkAtLeastOne, i18n("

Check this box to look for the tracks that contain at least one of the words " "you typed in the related Simple Search edit box

")); ratioLay->addWidget( m_checkAtLeastOne ); - m_checkExactly = new QRadioButton( i18n("Exact match"), m_groupBox2, "checkexactly"); - QToolTip::add( m_checkExactly, + m_checkExactly = new TQRadioButton( i18n("Exact match"), m_groupBox2, "checkexactly"); + TQToolTip::add( m_checkExactly, i18n("

Check this box to look for all the tracks that contain exactly the words you typed " "in the related Simple Search edit box

")); ratioLay->addWidget( m_checkExactly ); - m_checkExclude = new QRadioButton( i18n("Exclude"), m_groupBox2, "checkexclude"); - QToolTip::add( m_checkExclude, + m_checkExclude = new TQRadioButton( i18n("Exclude"), m_groupBox2, "checkexclude"); + TQToolTip::add( m_checkExclude, i18n("

Check this box to look for all the tracks that do not contain the words you typed " "in the related Simple Search edit box

")); ratioLay->addWidget( m_checkExclude ); @@ -282,60 +282,60 @@ EditFilterDialog::EditFilterDialog( QWidget* parent, bool metaBundleKeywords, co m_actionCheck << m_checkExactly; m_actionCheck << m_checkExclude; - connect( m_checkALL, SIGNAL(clicked()), this, SLOT(slotCheckAll()) ); - connect( m_checkAtLeastOne, SIGNAL(clicked()), this, SLOT(slotCheckAtLeastOne()) ); - connect( m_checkExactly, SIGNAL(clicked()), this, SLOT(slotCheckExactly()) ); - connect( m_checkExclude, SIGNAL(clicked()), this, SLOT(slotCheckExclude()) ); + connect( m_checkALL, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCheckAll()) ); + connect( m_checkAtLeastOne, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCheckAtLeastOne()) ); + connect( m_checkExactly, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCheckExactly()) ); + connect( m_checkExclude, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCheckExclude()) ); // check "select all words" as default slotCheckAll(); // some vertical space - otherOptionsLayout->addItem( new QSpacerItem( 50, 5, QSizePolicy::Minimum, QSizePolicy::Minimum ) ); + otherOptionsLayout->addItem( new TQSpacerItem( 50, 5, TQSizePolicy::Minimum, TQSizePolicy::Minimum ) ); - QVBoxLayout* verticalCondLay = new QVBoxLayout( otherOptionsLayout, 15, 0 ); + TQVBoxLayout* verticalCondLay = new TQVBoxLayout( otherOptionsLayout, 15, 0 ); - m_groupBox3 = new QGroupBox( plainPage(), "groupBox3" ); + m_groupBox3 = new TQGroupBox( plainPage(), "groupBox3" ); m_groupBox3->setTitle( i18n( "Appending condition" ) ); verticalCondLay->addWidget( m_groupBox3 ); - QVBoxLayout* ratioLay2 = new QVBoxLayout( m_groupBox3, 15, 0 ); + TQVBoxLayout* ratioLay2 = new TQVBoxLayout( m_groupBox3, 15, 0 ); - m_checkAND = new QRadioButton( i18n("AND logic condition", "AND"), m_groupBox3, "checkAND" ); - QToolTip::add( m_checkAND, + m_checkAND = new TQRadioButton( i18n("AND logic condition", "AND"), m_groupBox3, "checkAND" ); + TQToolTip::add( m_checkAND, i18n("

Check this box if you want to add another condition and you want that the filter " "to match both the previous conditions and this new one

")); ratioLay2->addWidget( m_checkAND ); - m_checkOR = new QRadioButton( i18n("OR logic condition", "OR"), m_groupBox3, "checkOR" ); - QToolTip::add( m_checkOR, + m_checkOR = new TQRadioButton( i18n("OR logic condition", "OR"), m_groupBox3, "checkOR" ); + TQToolTip::add( m_checkOR, i18n("

Check this box if you want to add another condition and you want that the filter " "to match either the previous conditions or this new one

")); ratioLay2->addWidget( m_checkOR ); - otherOptionsLayout->addItem( new QSpacerItem( 10, 10, QSizePolicy::Minimum, QSizePolicy::Minimum ) ); + otherOptionsLayout->addItem( new TQSpacerItem( 10, 10, TQSizePolicy::Minimum, TQSizePolicy::Minimum ) ); - m_prefixNOT = new QCheckBox( i18n("Invert condition"), plainPage(), "prefixNOT" ); - QToolTip::add( m_prefixNOT, + m_prefixNOT = new TQCheckBox( i18n("Invert condition"), plainPage(), "prefixNOT" ); + TQToolTip::add( m_prefixNOT, i18n("Check this box to negate the defined filter condition")); - QWhatsThis::add( m_prefixNOT, + TQWhatsThis::add( m_prefixNOT, i18n("

If this option is checked the defined filter condition will be negated. " "This means that, for example, you can define a filter that looks for all " "tracks that are not of a specific album, artist, and so on.

")); verticalCondLay->addWidget( m_prefixNOT ); m_prefixNOT->setEnabled( false ); - connect(m_prefixNOT, SIGNAL(clicked()), SLOT(assignPrefixNOT())); + connect(m_prefixNOT, TQT_SIGNAL(clicked()), TQT_SLOT(assignPrefixNOT())); - m_mainLay->addItem( new QSpacerItem( 10, 20, QSizePolicy::Minimum, QSizePolicy::Minimum ) ); + m_mainLay->addItem( new TQSpacerItem( 10, 20, TQSizePolicy::Minimum, TQSizePolicy::Minimum ) ); // you need to append at least one filter condition to specify if do // an "AND" or an "OR" with the next condition if the filter is empty if (m_filterText.isEmpty()) m_groupBox3->setEnabled( false ); - connect( m_checkAND, SIGNAL(clicked()), SLOT(slotCheckAND()) ); - connect( m_checkOR, SIGNAL(clicked()), SLOT(slotCheckOR()) ); + connect( m_checkAND, TQT_SIGNAL(clicked()), TQT_SLOT(slotCheckAND()) ); + connect( m_checkOR, TQT_SIGNAL(clicked()), TQT_SLOT(slotCheckOR()) ); // check "AND" condition as default slotCheckAND(); @@ -349,7 +349,7 @@ EditFilterDialog::~EditFilterDialog() delete m_editKeyword; } -QString EditFilterDialog::filter() const +TQString EditFilterDialog::filter() const { return m_filterText; } @@ -365,10 +365,10 @@ void EditFilterDialog::exclusiveSelectOf( int which ) m_actionCheck[i]->setChecked( true ); } -QString EditFilterDialog::keywordConditionString(const QString& keyword) const +TQString EditFilterDialog::keywordConditionString(const TQString& keyword) const { // this member is called when there is a keyword that needs numeric attributes - QString result, unit; + TQString result, unit; if (m_vector.at(m_selectedIndex) == "size") switch (m_comboUnitSize->currentItem()) @@ -389,7 +389,7 @@ QString EditFilterDialog::keywordConditionString(const QString& keyword) const // less than... result = m_strPrefixNOT + keyword + ":<"; if (keyword == "length") - result += QString::number( m_spinMin1->value() * 60 + m_spinMin2->value() ) + unit; + result += TQString::number( m_spinMin1->value() * 60 + m_spinMin2->value() ) + unit; else result += m_spinMin1->text() + unit; break; @@ -397,23 +397,23 @@ QString EditFilterDialog::keywordConditionString(const QString& keyword) const // greater than... result = m_strPrefixNOT + keyword + ":>"; if (keyword == "length") - result += QString::number( m_spinMin1->value() * 60 + m_spinMin2->value() ) + unit; + result += TQString::number( m_spinMin1->value() * 60 + m_spinMin2->value() ) + unit; else result += m_spinMin1->text() + unit; break; case 2: // equal to... if (keyword == "length") - result = m_strPrefixNOT + "length:" + QString::number( m_spinMin1->value() * 60 + result = m_strPrefixNOT + "length:" + TQString::number( m_spinMin1->value() * 60 + m_spinMin2->value() ) + unit; else { if (m_strPrefixNOT.isEmpty()) - result = keyword + ":>" + QString::number(m_spinMin1->value() - 1) + unit + - " " + keyword + ":<" + QString::number(m_spinMin1->value() + 1) + unit; + result = keyword + ":>" + TQString::number(m_spinMin1->value() - 1) + unit + + " " + keyword + ":<" + TQString::number(m_spinMin1->value() + 1) + unit; else - result = keyword + ":<" + QString::number(m_spinMin1->value()) + unit + - " OR " + keyword + ":>" + QString::number(m_spinMin1->value()) + unit; + result = keyword + ":<" + TQString::number(m_spinMin1->value()) + unit + + " OR " + keyword + ":>" + TQString::number(m_spinMin1->value()) + unit; } break; case 3: @@ -421,20 +421,20 @@ QString EditFilterDialog::keywordConditionString(const QString& keyword) const if (keyword == "length") { if (m_strPrefixNOT.isEmpty()) - result = "length:>" + QString::number( m_spinMin1->value() * 60 + m_spinMin2->value() - 1) + unit - + " length:<" + QString::number( m_spinMax1->value() * 60 + m_spinMax2->value() + 1) + unit; + result = "length:>" + TQString::number( m_spinMin1->value() * 60 + m_spinMin2->value() - 1) + unit + + " length:<" + TQString::number( m_spinMax1->value() * 60 + m_spinMax2->value() + 1) + unit; else - result = "length:<" + QString::number( m_spinMin1->value() * 60 + m_spinMin2->value()) + unit - + " OR length:>" + QString::number( m_spinMax1->value() * 60 + m_spinMax2->value()) + unit; + result = "length:<" + TQString::number( m_spinMin1->value() * 60 + m_spinMin2->value()) + unit + + " OR length:>" + TQString::number( m_spinMax1->value() * 60 + m_spinMax2->value()) + unit; } else { if (m_strPrefixNOT.isEmpty()) - result = keyword + ":>" + QString::number(m_spinMin1->value() - 1) + unit + - " " + keyword + ":<" + QString::number(m_spinMax1->value() + 1) + unit; + result = keyword + ":>" + TQString::number(m_spinMin1->value() - 1) + unit + + " " + keyword + ":<" + TQString::number(m_spinMax1->value() + 1) + unit; else - result = keyword + ":<" + QString::number(m_spinMin1->value() - 1) + unit + - " OR " + keyword + ":>" + QString::number(m_spinMax1->value() + 1) + unit; + result = keyword + ":<" + TQString::number(m_spinMin1->value() - 1) + unit + + " OR " + keyword + ":>" + TQString::number(m_spinMax1->value() + 1) + unit; } break; } @@ -462,11 +462,11 @@ void EditFilterDialog::setMinMaxValueSpins() m_spinMax2->hide(); // fix tooltip - QToolTip::add( m_spinMin1, "" ); - QToolTip::add( m_spinMin2, i18n("Seconds") ); + TQToolTip::add( m_spinMin1, "" ); + TQToolTip::add( m_spinMin2, i18n("Seconds") ); - QToolTip::add( m_spinMax1, "" ); - QToolTip::add( m_spinMax2, i18n("Seconds") ); + TQToolTip::add( m_spinMax1, "" ); + TQToolTip::add( m_spinMax2, i18n("Seconds") ); } // SLOTS @@ -480,7 +480,7 @@ void EditFilterDialog::selectedKeyword(int index) // SLOT setMinMaxValueSpins(); - const QString key = m_vector[index]; + const TQString key = m_vector[index]; if( index == 0 ) { // Simple Search @@ -509,8 +509,8 @@ void EditFilterDialog::selectedKeyword(int index) // SLOT m_spinMax2->show(); m_spinMin1->setValue( 1 ); m_spinMax1->setValue( 5 ); - QToolTip::add( m_spinMin1, i18n("Minutes") ); - QToolTip::add( m_spinMax1, i18n("Minutes") ); + TQToolTip::add( m_spinMin1, i18n("Minutes") ); + TQToolTip::add( m_spinMax1, i18n("Minutes") ); // fix the maximum values to reduce spinboxes size m_spinMin1->setMaxValue( 240 ); @@ -532,7 +532,7 @@ void EditFilterDialog::selectedKeyword(int index) // SLOT { // year: set useful values for the spinboxes m_spinMin1->setValue( 1900 ); - m_spinMax1->setValue( QDate::currentDate().year() ); + m_spinMax1->setValue( TQDate::currentDate().year() ); valueWanted(); } else if( key=="track" || key=="disc" || key=="discnumber" ) @@ -562,7 +562,7 @@ void EditFilterDialog::selectedKeyword(int index) // SLOT textWanted( CollectionDB::instance()->genreList() ); else if( key=="type" || key=="filetype" ) { - QStringList types; + TQStringList types; types << "mp3" << "flac" << "ogg" << "aac" << "m4a" << "mp4" << "mp2" << "ac3" << "wav" << "asf" << "wma"; textWanted( types ); @@ -597,7 +597,7 @@ void EditFilterDialog::textWanted() // SLOT m_editKeyword->completionObject()->clear(); } -void EditFilterDialog::textWanted( const QStringList &completion ) // SLOT +void EditFilterDialog::textWanted( const TQStringList &completion ) // SLOT { m_editKeyword->setEnabled( true ); m_groupBox->setEnabled( false ); @@ -700,8 +700,8 @@ void EditFilterDialog::slotDefault() // SLOT if (m_checkOR->isChecked()) m_filterText += "OR "; } - QStringList list = QStringList::split( " ", m_editKeyword->text() ); - const QString key = m_vector[m_selectedIndex]; + TQStringList list = TQStringList::split( " ", m_editKeyword->text() ); + const TQString key = m_vector[m_selectedIndex]; if( m_selectedIndex == 0 ) { // Simple Search @@ -715,7 +715,7 @@ void EditFilterDialog::slotDefault() // SLOT { // at least one word m_filterText += *(list.begin()); - for ( QStringList::Iterator it = ++list.begin(); it != list.end(); ++it ) + for ( TQStringList::Iterator it = ++list.begin(); it != list.end(); ++it ) m_filterText += " OR " + *it; } else if (m_actionCheck[2]->isChecked()) @@ -726,7 +726,7 @@ void EditFilterDialog::slotDefault() // SLOT else if (m_actionCheck[3]->isChecked()) { // exclude words - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) m_filterText += " -" + *it; } } diff --git a/amarok/src/editfilterdialog.h b/amarok/src/editfilterdialog.h index c6a0fabd..50b1f82a 100644 --- a/amarok/src/editfilterdialog.h +++ b/amarok/src/editfilterdialog.h @@ -4,73 +4,73 @@ #ifndef AMAROK_EDITFILTERDIALOG_H #define AMAROK_EDITFILTERDIALOG_H -#include -#include +#include +#include #include -class QWidget; -class QVBoxLayout; -class QComboBox; -class QCheckBox; -class QLineEdit; -class QRadioButton; -class QGroupBox; -class QSpinBox; -class QStringList; +class TQWidget; +class TQVBoxLayout; +class TQComboBox; +class TQCheckBox; +class TQLineEdit; +class TQRadioButton; +class TQGroupBox; +class TQSpinBox; +class TQStringList; class KComboBox; class EditFilterDialog : public KDialogBase { Q_OBJECT public: - EditFilterDialog( QWidget* parent, bool metaBundleKeywords, const QString &text = "" ); + EditFilterDialog( TQWidget* parent, bool metaBundleKeywords, const TQString &text = "" ); ~EditFilterDialog(); - QString filter() const; + TQString filter() const; signals: - void filterChanged( const QString &filter ); + void filterChanged( const TQString &filter ); private: - QVBoxLayout *m_mainLay; + TQVBoxLayout *m_mainLay; - QCheckBox *m_prefixNOT; - QComboBox *m_comboKeyword; + TQCheckBox *m_prefixNOT; + TQComboBox *m_comboKeyword; KLineEdit *m_editKeyword; - QGroupBox *m_groupBox; + TQGroupBox *m_groupBox; - QComboBox *m_comboCondition; - QLabel *m_filesizeLabel; - QComboBox *m_comboUnitSize; + TQComboBox *m_comboCondition; + TQLabel *m_filesizeLabel; + TQComboBox *m_comboUnitSize; - QRadioButton *m_minMaxRadio; - QSpinBox *m_spinMin1, *m_spinMin2; - QLabel *m_andLabel; - QSpinBox *m_spinMax1, *m_spinMax2; + TQRadioButton *m_minMaxRadio; + TQSpinBox *m_spinMin1, *m_spinMin2; + TQLabel *m_andLabel; + TQSpinBox *m_spinMax1, *m_spinMax2; - QGroupBox *m_groupBox2; - QRadioButton *m_checkALL; - QRadioButton *m_checkAtLeastOne; - QRadioButton *m_checkExactly; - QRadioButton *m_checkExclude; - QValueList m_actionCheck; + TQGroupBox *m_groupBox2; + TQRadioButton *m_checkALL; + TQRadioButton *m_checkAtLeastOne; + TQRadioButton *m_checkExactly; + TQRadioButton *m_checkExclude; + TQValueList m_actionCheck; - QGroupBox *m_groupBox3; - QRadioButton *m_checkAND; - QRadioButton *m_checkOR; + TQGroupBox *m_groupBox3; + TQRadioButton *m_checkAND; + TQRadioButton *m_checkOR; bool m_appended; // true if a filter appended int m_selectedIndex; // the position of the selected keyword in the combobox - QValueVector m_vector; // the vector of the amarok filter keyword - QString m_filterText; // the resulting filter string - QString m_previousFilterText; // the previous resulting filter string - QString m_strPrefixNOT; // is empty if no NOT prefix is needed else it's "-" + TQValueVector m_vector; // the vector of the amarok filter keyword + TQString m_filterText; // the resulting filter string + TQString m_previousFilterText; // the previous resulting filter string + TQString m_strPrefixNOT; // is empty if no NOT prefix is needed else it's "-" private: void exclusiveSelectOf( int which ); - QString keywordConditionString(const QString& keyword) const; + TQString keywordConditionString(const TQString& keyword) const; void setMinMaxValueSpins(); private slots: @@ -80,7 +80,7 @@ class EditFilterDialog : public KDialogBase void maxSpinChanged(int value); void textWanted(); - void textWanted( const QStringList &completions ); + void textWanted( const TQStringList &completions ); void valueWanted(); void chooseCondition(int index); diff --git a/amarok/src/engine/akode/akode-engine.cpp b/amarok/src/engine/akode/akode-engine.cpp index 429f0172..26840589 100644 --- a/amarok/src/engine/akode/akode-engine.cpp +++ b/amarok/src/engine/akode/akode-engine.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include AMAROK_EXPORT_PLUGIN( AkodeEngine ) @@ -26,19 +26,19 @@ namespace Amarok /// Called for all stateChanges virtual void stateChangeEvent( aKode::Player::State ) { - QApplication::postEvent( m_engine, new QCustomEvent( 3000 ) ); + TQApplication::postEvent( m_engine, new TQCustomEvent( 3000 ) ); } /// Called when a decoder reaches end of file virtual void eofEvent() { - QApplication::postEvent( m_engine, new QCustomEvent( 3001 ) ); + TQApplication::postEvent( m_engine, new TQCustomEvent( 3001 ) ); } /// Called when a decoder encounters a fatal error virtual void errorEvent() { - QApplication::postEvent( m_engine, new QCustomEvent( 3002 ) ); + TQApplication::postEvent( m_engine, new TQCustomEvent( 3002 ) ); } public: @@ -96,7 +96,7 @@ AkodeEngine::unpause() bool AkodeEngine::canDecode( const KURL &url ) const { - const QString ext = url.path().right( 4 ).lower(); + const TQString ext = url.path().right( 4 ).lower(); return ext == ".mp3" || ext == ".ogg" || ext == ".wav" || ext ==".mpc" || ext == "flac"; } @@ -156,12 +156,12 @@ AkodeEngine::state() const } bool -AkodeEngine::event( QEvent *e ) +AkodeEngine::event( TQEvent *e ) { switch( e->type() ) { /* - case QEvent::Timer: + case TQEvent::Timer: if( m_player->decoder() && m_player->decoder()->eof() ) { m_player->stop(); emit trackEnded(); diff --git a/amarok/src/engine/akode/akode-engine.h b/amarok/src/engine/akode/akode-engine.h index a5fc41be..ca3e2503 100644 --- a/amarok/src/engine/akode/akode-engine.h +++ b/amarok/src/engine/akode/akode-engine.h @@ -29,7 +29,7 @@ class AkodeEngine : public Engine::Base virtual Engine::State state() const; virtual const Engine::Scope &scope(); - virtual bool event( QEvent* ); + virtual bool event( TQEvent* ); aKode::Player *m_player; aKodeScope m_scope; diff --git a/amarok/src/engine/helix/helix-configdialog.cpp b/amarok/src/engine/helix/helix-configdialog.cpp index 15895db4..5b81e976 100644 --- a/amarok/src/engine/helix/helix-configdialog.cpp +++ b/amarok/src/engine/helix/helix-configdialog.cpp @@ -11,15 +11,15 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -43,54 +43,54 @@ using namespace std; HelixConfigDialogBase *HelixConfigDialog::instance = NULL; -HelixConfigEntry::HelixConfigEntry( QWidget *parent, +HelixConfigEntry::HelixConfigEntry( TQWidget *parent, Amarok::PluginConfig *pluginConfig, int row, - const QString & description, + const TQString & description, const char *defaultvalue, - const QString & tooltip) + const TQString & tooltip) : m_w(0) , m_valueChanged( false ) , m_stringValue( defaultvalue ) { - QGridLayout *grid = (QGridLayout*)parent->layout(); + TQGridLayout *grid = (TQGridLayout*)parent->layout(); m_w = new KLineEdit( m_stringValue, parent ); - connect( (QWidget *) m_w, SIGNAL(textChanged( const QString& )), this, SLOT(slotStringChanged( const QString& )) ); - connect( (QWidget *) m_w, SIGNAL(textChanged( const QString& )), pluginConfig, SIGNAL(viewChanged()) ); + connect( (TQWidget *) m_w, TQT_SIGNAL(textChanged( const TQString& )), this, TQT_SLOT(slotStringChanged( const TQString& )) ); + connect( (TQWidget *) m_w, TQT_SIGNAL(textChanged( const TQString& )), pluginConfig, TQT_SIGNAL(viewChanged()) ); - QToolTip::add( (QWidget *) m_w, "" + tooltip ); + TQToolTip::add( (TQWidget *) m_w, "" + tooltip ); - QLabel* d = new QLabel( description + ':', parent ); - d->setAlignment( QLabel::WordBreak | QLabel::AlignVCenter ); + TQLabel* d = new TQLabel( description + ':', parent ); + d->setAlignment( TQLabel::WordBreak | TQLabel::AlignVCenter ); - grid->addWidget( (QWidget *) m_w, row, 1 ); + grid->addWidget( (TQWidget *) m_w, row, 1 ); grid->addWidget( d, row, 0 ); } -HelixConfigEntry::HelixConfigEntry( QWidget *parent, - QString &str, +HelixConfigEntry::HelixConfigEntry( TQWidget *parent, + TQString &str, Amarok::PluginConfig *pluginConfig, int row, - const QString & description, + const TQString & description, const char *defaultvalue, - const QString & tooltip) + const TQString & tooltip) : m_w(0) , m_valueChanged( false ) , m_stringValue( defaultvalue ) { - QGridLayout *grid = (QGridLayout*)parent->layout(); + TQGridLayout *grid = (TQGridLayout*)parent->layout(); m_key = str; m_w = new KLineEdit( str, parent ); - connect( m_w, SIGNAL(textChanged( const QString& )), this, SLOT(slotStringChanged( const QString& )) ); - connect( m_w, SIGNAL(textChanged( const QString& )), pluginConfig, SIGNAL(viewChanged()) ); + connect( m_w, TQT_SIGNAL(textChanged( const TQString& )), this, TQT_SLOT(slotStringChanged( const TQString& )) ); + connect( m_w, TQT_SIGNAL(textChanged( const TQString& )), pluginConfig, TQT_SIGNAL(viewChanged()) ); - QToolTip::add( m_w, "" + tooltip ); + TQToolTip::add( m_w, "" + tooltip ); - QLabel* d = new QLabel( description + ':', parent ); - d->setAlignment( QLabel::WordBreak | QLabel::AlignVCenter ); + TQLabel* d = new TQLabel( description + ':', parent ); + d->setAlignment( TQLabel::WordBreak | TQLabel::AlignVCenter ); grid->addWidget( m_w, row, 1 ); grid->addWidget( d, row, 0 ); @@ -98,19 +98,19 @@ HelixConfigEntry::HelixConfigEntry( QWidget *parent, inline void -HelixConfigEntry::slotStringChanged( const QString& ) +HelixConfigEntry::slotStringChanged( const TQString& ) { m_stringValue = m_w->text(); m_valueChanged = true; } -HelixSoundDevice::HelixSoundDevice( QWidget *parent, +HelixSoundDevice::HelixSoundDevice( TQWidget *parent, Amarok::PluginConfig *pluginConfig, int &row, HelixEngine *engine ) : deviceComboBox(0), checkBox_outputDevice(0), lineEdit_outputDevice(0), m_changed(false), m_engine(engine) { - QGridLayout *grid = (QGridLayout*)parent->layout(); + TQGridLayout *grid = (TQGridLayout*)parent->layout(); deviceComboBox = new KComboBox( false, parent, "deviceComboBox" ); deviceComboBox->insertItem("oss"); // I believe these are not subject to translation (they don't seem to be in xine, @@ -118,28 +118,28 @@ HelixSoundDevice::HelixSoundDevice( QWidget *parent, deviceComboBox->insertItem("alsa"); // and neither are the equivalents in gst (osssink and alsasink) #endif deviceComboBox->setCurrentItem(HelixConfig::outputplugin()); - QLabel* op = new QLabel( i18n("Output plugin:"), parent ); - op->setAlignment( QLabel::WordBreak | QLabel::AlignVCenter ); + TQLabel* op = new TQLabel( i18n("Output plugin:"), parent ); + op->setAlignment( TQLabel::WordBreak | TQLabel::AlignVCenter ); grid->addWidget( op, row, 0 ); grid->addWidget( deviceComboBox, row, 1); - connect( (QWidget *)deviceComboBox, SIGNAL( activated( const QString& ) ), this, SLOT( slotNewDevice( const QString& )) ); - connect( (QWidget *)deviceComboBox, SIGNAL( activated( const QString& )), pluginConfig, SIGNAL(viewChanged()) ); + connect( (TQWidget *)deviceComboBox, TQT_SIGNAL( activated( const TQString& ) ), this, TQT_SLOT( slotNewDevice( const TQString& )) ); + connect( (TQWidget *)deviceComboBox, TQT_SIGNAL( activated( const TQString& )), pluginConfig, TQT_SIGNAL(viewChanged()) ); ++row; - checkBox_outputDevice = new QCheckBox( parent, "checkBox_outputDevice" ); - checkBox_outputDevice->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, checkBox_outputDevice->sizePolicy().hasHeightForWidth() ) ); + checkBox_outputDevice = new TQCheckBox( parent, "checkBox_outputDevice" ); + checkBox_outputDevice->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, checkBox_outputDevice->sizePolicy().hasHeightForWidth() ) ); grid->addWidget( checkBox_outputDevice, row, 0 ); checkBox_outputDevice->setText( i18n( "Device:" ) ); lineEdit_outputDevice = new KLineEdit( HelixConfig::device(), parent ); - connect( (QWidget *) lineEdit_outputDevice, SIGNAL(textChanged( const QString& )), this, SLOT(slotStringChanged( const QString& )) ); - connect( (QWidget *) lineEdit_outputDevice, SIGNAL( textChanged( const QString& )), pluginConfig, SIGNAL(viewChanged()) ); - connect( checkBox_outputDevice, SIGNAL( toggled(bool) ), lineEdit_outputDevice, SLOT( setEnabled(bool) ) ); - connect( checkBox_outputDevice, SIGNAL( toggled(bool) ), pluginConfig, SIGNAL(viewChanged()) ); + connect( (TQWidget *) lineEdit_outputDevice, TQT_SIGNAL(textChanged( const TQString& )), this, TQT_SLOT(slotStringChanged( const TQString& )) ); + connect( (TQWidget *) lineEdit_outputDevice, TQT_SIGNAL( textChanged( const TQString& )), pluginConfig, TQT_SIGNAL(viewChanged()) ); + connect( checkBox_outputDevice, TQT_SIGNAL( toggled(bool) ), lineEdit_outputDevice, TQT_SLOT( setEnabled(bool) ) ); + connect( checkBox_outputDevice, TQT_SIGNAL( toggled(bool) ), pluginConfig, TQT_SIGNAL(viewChanged()) ); - connect( checkBox_outputDevice, SIGNAL( toggled(bool) ), this, SLOT( slotDeviceChecked(bool) ) ); - grid->addWidget( (QWidget *) lineEdit_outputDevice, row, 1 ); + connect( checkBox_outputDevice, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT( slotDeviceChecked(bool) ) ); + grid->addWidget( (TQWidget *) lineEdit_outputDevice, row, 1 ); if (HelixConfig::deviceenabled()) { @@ -160,7 +160,7 @@ HelixSoundDevice::HelixSoundDevice( QWidget *parent, } void -HelixSoundDevice::slotNewDevice( const QString &dev ) +HelixSoundDevice::slotNewDevice( const TQString &dev ) { if (dev == "oss") { @@ -180,7 +180,7 @@ HelixSoundDevice::slotNewDevice( const QString &dev ) } void -HelixSoundDevice::slotStringChanged( const QString& ) +HelixSoundDevice::slotStringChanged( const TQString& ) { m_changed = true; } @@ -247,8 +247,8 @@ void HelixConfigDialogBase::setSoundSystem( int api ) } -HelixConfigDialogBase::HelixConfigDialogBase( HelixEngine *engine, Amarok::PluginConfig *config, QWidget *p ) - : QTabWidget( p ) +HelixConfigDialogBase::HelixConfigDialogBase( HelixEngine *engine, Amarok::PluginConfig *config, TQWidget *p ) + : TQTabWidget( p ) , m_core(0) , m_plugin(0) , m_codec(0) @@ -256,22 +256,22 @@ HelixConfigDialogBase::HelixConfigDialogBase( HelixEngine *engine, Amarok::Plugi , m_engine( engine ) { int row = 0; - QString currentPage; - QWidget *parent = 0; - QGridLayout *grid = 0; - QScrollView *sv = 0; + TQString currentPage; + TQWidget *parent = 0; + TQGridLayout *grid = 0; + TQScrollView *sv = 0; - QString pageName( i18n("Main") ); + TQString pageName( i18n("Main") ); - addTab( sv = new QScrollView, pageName ); - parent = new QWidget( sv->viewport() ); + addTab( sv = new TQScrollView, pageName ); + parent = new TQWidget( sv->viewport() ); - sv->setResizePolicy( QScrollView::AutoOneFit ); - sv->setHScrollBarMode( QScrollView::AlwaysOff ); - sv->setFrameShape( QFrame::NoFrame ); + sv->setResizePolicy( TQScrollView::AutoOneFit ); + sv->setHScrollBarMode( TQScrollView::AlwaysOff ); + sv->setFrameShape( TQFrame::NoFrame ); sv->addChild( parent ); - grid = new QGridLayout( parent, /*rows*/20, /*cols*/2, /*margin*/10, /*spacing*/10 ); + grid = new TQGridLayout( parent, /*rows*/20, /*cols*/2, /*margin*/10, /*spacing*/10 ); grid->setColStretch( 0, 1 ); grid->setColStretch( 1, 1 ); @@ -305,34 +305,34 @@ HelixConfigDialogBase::HelixConfigDialogBase( HelixEngine *engine, Amarok::Plugi m_device = new HelixSoundDevice( parent, config, row, engine ); // lets find the logo if we can - QPixmap *pm = 0; - QString logo = HelixConfig::coreDirectory(); + TQPixmap *pm = 0; + TQString logo = HelixConfig::coreDirectory(); if (logo.isEmpty()) logo = HELIX_LIBS "/common"; logo.append("/../share/"); - QString tmp = logo; + TQString tmp = logo; tmp.append("hxplay/logo.png"); - if (QFileInfo(tmp).exists()) + if (TQFileInfo(tmp).exists()) { logo = tmp; - pm = new QPixmap(logo); + pm = new TQPixmap(logo); } else { tmp = logo; tmp.append("realplay/logo.png"); - if (QFileInfo(tmp).exists()) + if (TQFileInfo(tmp).exists()) { logo = tmp; - pm = new QPixmap(logo); + pm = new TQPixmap(logo); } } if (pm) { - QLabel *l = new QLabel(parent); + TQLabel *l = new TQLabel(parent); l->setPixmap(*pm); grid->addMultiCellWidget( l, 20, 20, 1, 1, Qt::AlignRight ); } @@ -341,19 +341,19 @@ HelixConfigDialogBase::HelixConfigDialogBase( HelixEngine *engine, Amarok::Plugi pageName = i18n("Plugins"); - addTab( sv = new QScrollView, pageName ); - parent = new QWidget( sv->viewport() ); + addTab( sv = new TQScrollView, pageName ); + parent = new TQWidget( sv->viewport() ); - sv->setResizePolicy( QScrollView::AutoOneFit ); + sv->setResizePolicy( TQScrollView::AutoOneFit ); sv->addChild( parent ); - QTextEdit *le = new QTextEdit( parent ); + TQTextEdit *le = new TQTextEdit( parent ); if( sv ) sv->setMinimumWidth( le->sizeHint().width() ); - grid = new QGridLayout( parent, /*rows*/1, /*cols*/1, /*margin*/2, /*spacing*/1 ); + grid = new TQGridLayout( parent, /*rows*/1, /*cols*/1, /*margin*/2, /*spacing*/1 ); grid->addMultiCellWidget( le, 0, 1, 0, 1, 0 ); - le->setWordWrap(QTextEdit::NoWrap); + le->setWordWrap(TQTextEdit::NoWrap); int n = engine->numPlugins(); const char *description, *copyright, *moreinfourl; @@ -362,10 +362,10 @@ HelixConfigDialogBase::HelixConfigDialogBase( HelixEngine *engine, Amarok::Plugi { if (!engine->getPluginInfo(i, description, copyright, moreinfourl)) { - le->append(QString(description)); - le->append(QString(copyright)); - le->append(QString(moreinfourl)); - le->append(QString(" ")); + le->append(TQString(description)); + le->append(TQString(copyright)); + le->append(TQString(moreinfourl)); + le->append(TQString(" ")); } } @@ -384,7 +384,7 @@ HelixConfigDialogBase::~HelixConfigDialogBase() bool HelixConfigDialogBase::hasChanged() const { - for( QPtrListIterator it( entries ); *it != 0; ++it ) + for( TQPtrListIterator it( entries ); *it != 0; ++it ) if ( (*it)->isChanged() ) return true; if (m_core->isChanged() || m_plugin->isChanged() || m_codec->isChanged() || m_device->isChanged()) @@ -452,7 +452,7 @@ HelixConfigDialogBase::save() } -HelixConfigDialog::HelixConfigDialog( HelixEngine *engine, QWidget *p ) : Amarok::PluginConfig() +HelixConfigDialog::HelixConfigDialog( HelixEngine *engine, TQWidget *p ) : Amarok::PluginConfig() { if (!instance) instance = new HelixConfigDialogBase( engine, this, p ); diff --git a/amarok/src/engine/helix/helix-configdialog.h b/amarok/src/engine/helix/helix-configdialog.h index 0e9487c7..4a70e595 100644 --- a/amarok/src/engine/helix/helix-configdialog.h +++ b/amarok/src/engine/helix/helix-configdialog.h @@ -12,13 +12,13 @@ #define _HELIX_CONFIG_H_ #include "plugin/pluginconfig.h" -#include -#include -#include +#include +#include +#include -class QGridLayout; +class TQGridLayout; class KComboBox; -class QCheckBox; +class TQCheckBox; class KLineEdit; class HelixEngine; @@ -29,46 +29,46 @@ class HelixConfigEntry : public QObject { Q_OBJECT public: - HelixConfigEntry( QWidget *parent, Amarok::PluginConfig*, - int row, const QString & description, const char *defaultvalue, const QString & tooltip ); - HelixConfigEntry( QWidget *parent, QString &str, Amarok::PluginConfig*, - int row, const QString & description, const char *defaultvalue, const QString & tooltip ); + HelixConfigEntry( TQWidget *parent, Amarok::PluginConfig*, + int row, const TQString & description, const char *defaultvalue, const TQString & tooltip ); + HelixConfigEntry( TQWidget *parent, TQString &str, Amarok::PluginConfig*, + int row, const TQString & description, const char *defaultvalue, const TQString & tooltip ); bool isChanged() const { return m_valueChanged; } void setUnchanged() { m_valueChanged = false; } - const QString& key() const { return m_key; } - QString stringValue() const { return m_stringValue; } + const TQString& key() const { return m_key; } + TQString stringValue() const { return m_stringValue; } int numValue() const { return m_numValue; } private slots: - void slotStringChanged( const QString& ); + void slotStringChanged( const TQString& ); private: KLineEdit *m_w; bool m_valueChanged; int m_numValue; - QString m_key; - QString m_stringValue; + TQString m_key; + TQString m_stringValue; }; class HelixSoundDevice : public QObject { Q_OBJECT public: - HelixSoundDevice( QWidget *parent, Amarok::PluginConfig *config, int &row, HelixEngine *engine ); + HelixSoundDevice( TQWidget *parent, Amarok::PluginConfig *config, int &row, HelixEngine *engine ); bool save(); void setSoundSystem( int api ); bool isChanged() const { return m_changed; } void setUnchanged() { m_changed = false; } private slots: - void slotNewDevice( const QString& ); - void slotStringChanged( const QString& ); + void slotNewDevice( const TQString& ); + void slotStringChanged( const TQString& ); void slotDeviceChecked( bool ); private: KComboBox* deviceComboBox; - QCheckBox* checkBox_outputDevice; + TQCheckBox* checkBox_outputDevice; KLineEdit* lineEdit_outputDevice; bool m_changed; HelixEngine *m_engine; @@ -78,10 +78,10 @@ private: class HelixConfigDialogBase : public QTabWidget { public: - HelixConfigDialogBase( HelixEngine *engine, Amarok::PluginConfig *config, QWidget *parent = 0 ); + HelixConfigDialogBase( HelixEngine *engine, Amarok::PluginConfig *config, TQWidget *parent = 0 ); ~HelixConfigDialogBase(); - virtual QWidget *view() { return this; } + virtual TQWidget *view() { return this; } virtual bool hasChanged() const; virtual bool isDefault() const; @@ -92,7 +92,7 @@ public: void setEngine(HelixEngine *e) { m_engine = e; } private: - QPtrList entries; + TQPtrList entries; HelixConfigEntry *m_core; HelixConfigEntry *m_plugin; HelixConfigEntry *m_codec; @@ -103,10 +103,10 @@ private: class HelixConfigDialog : public Amarok::PluginConfig { public: - HelixConfigDialog( HelixEngine *engine, QWidget *parent = 0 ); + HelixConfigDialog( HelixEngine *engine, TQWidget *parent = 0 ); ~HelixConfigDialog(); - virtual QWidget *view() { return instance->view(); } + virtual TQWidget *view() { return instance->view(); } virtual bool hasChanged() const { return instance->hasChanged(); } virtual bool isDefault() const { return instance->isDefault(); } diff --git a/amarok/src/engine/helix/helix-engine.cpp b/amarok/src/engine/helix/helix-engine.cpp index f8c8b26a..fb4dc695 100644 --- a/amarok/src/engine/helix/helix-engine.cpp +++ b/amarok/src/engine/helix/helix-engine.cpp @@ -7,7 +7,7 @@ * (at your option) any later version. * * * ***************************************************************************/ -#include +#include #include #include #include @@ -25,9 +25,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "helix-engine.h" #include "helix-configdialog.h" @@ -58,7 +58,7 @@ extern "C" ///returns the configuration we will use -static inline QCString configPath() { return QFile::encodeName( QDir::homeDirPath() + "/.helix/config" ); } +static inline TQCString configPath() { return TQFile::encodeName( TQDir::homeDirPath() + "/.helix/config" ); } HelixEngine::HelixEngine() @@ -124,18 +124,18 @@ int HelixEngine::print2stderr(const char *fmt, ...) void HelixEngine::notifyUser(unsigned long code, const char *moreinfo, const char *moreinfourl) { - QString *err = HelixErrors::errorText(code); + TQString *err = HelixErrors::errorText(code); if (err) - emit statusText(i18n("Helix Core returned error: %1 %2 %3").arg(QString(*err)).arg(QString(moreinfo)).arg(QString(moreinfourl))); + emit statusText(i18n("Helix Core returned error: %1 %2 %3").arg(TQString(*err)).arg(TQString(moreinfo)).arg(TQString(moreinfourl))); else emit statusText(i18n("Helix Core returned error: ")); } void HelixEngine::interruptUser(unsigned long code, const char *moreinfo, const char *moreinfourl) { - QString *err = HelixErrors::errorText(code); + TQString *err = HelixErrors::errorText(code); if (err) - emit infoMessage(i18n("Helix Core returned error: %1 %1 %1").arg(QString(*err)).arg(QString(moreinfo)).arg(QString(moreinfourl))); + emit infoMessage(i18n("Helix Core returned error: %1 %1 %1").arg(TQString(*err)).arg(TQString(moreinfo)).arg(TQString(moreinfourl))); else emit infoMessage(i18n("Helix Core returned error: ")); @@ -146,7 +146,7 @@ void HelixEngine::interruptUser(unsigned long code, const char *moreinfo, const void HelixEngine::onContacting(const char *host) { - emit statusText( i18n("Contacting: %1").arg( QString(host) ) ); + emit statusText( i18n("Contacting: %1").arg( TQString(host) ) ); } void HelixEngine::onBuffering(int pcnt) @@ -211,7 +211,7 @@ HelixEngine::init() long vol=0; bool eqenabled=false; int savedpreamp=0; - QValueList savedequalizerGains; + TQValueList savedequalizerGains; if (m_inited) { @@ -257,12 +257,12 @@ HelixEngine::init() MimeEntry *entry; while (ml) { - QString mt = ml->mimetypes; - QString me = ml->mimeexts; + TQString mt = ml->mimetypes; + TQString me = ml->mimeexts; entry = new MimeEntry; - entry->type = QStringList::split('|', mt); - entry->ext = QStringList::split('|', me); + entry->type = TQStringList::split('|', mt); + entry->ext = TQStringList::split('|', me); m_mimes[i] = *entry; debug() << ml->mimetypes << endl; @@ -287,8 +287,8 @@ HelixEngine::load( const KURL &url, bool isStream ) if (!canDecode(url)) { - const QString path = url.path(); - const QString ext = path.mid( path.findRev( '.' ) + 1 ).lower(); + const TQString path = url.path(); + const TQString ext = path.mid( path.findRev( '.' ) + 1 ).lower(); emit statusText( i18n("No plugin found for the %1 format").arg(ext) ); return false; } @@ -316,7 +316,7 @@ HelixEngine::load( const KURL &url, bool isStream ) setFadeout(true, m_xfadeLength, m_current); } Engine::Base::load( url, false ); // we don't crossfade streams ?? do we load the base here ?? - PlayerControl::setURL( QFile::encodeName( url.url() ), nextPlayer, !isStream ); + PlayerControl::setURL( TQFile::encodeName( url.url() ), nextPlayer, !isStream ); m_isStream = false; } else @@ -333,11 +333,11 @@ HelixEngine::load( const KURL &url, bool isStream ) m_url = url; if (url.isLocalFile()) - PlayerControl::setURL( QFile::encodeName( url.url() ), nextPlayer, !m_isStream ); + PlayerControl::setURL( TQFile::encodeName( url.url() ), nextPlayer, !m_isStream ); else { m_isStream = true; - PlayerControl::setURL( QFile::encodeName( url.url() ), nextPlayer, !m_isStream ); + PlayerControl::setURL( TQFile::encodeName( url.url() ), nextPlayer, !m_isStream ); } return true; @@ -549,8 +549,8 @@ HelixEngine::canDecode( const KURL &url ) const if (url.protocol() == "http" || url.protocol() == "rtsp") return true; - const QString path = url.path(); - const QString ext = path.mid( path.findRev( '.' ) + 1 ).lower(); + const TQString path = url.path(); + const TQString ext = path.mid( path.findRev( '.' ) + 1 ).lower(); if (ext != "txt") for (int i=0; i<(int)m_mimes.size(); i++) @@ -568,7 +568,7 @@ HelixEngine::canDecode( const KURL &url ) const } void -HelixEngine::timerEvent( QTimerEvent * ) +HelixEngine::timerEvent( TQTimerEvent * ) { PlayerControl::dispatch(); // dispatch the players if ( m_xfadeLength <= 0 && m_state == Engine::Playing && PlayerControl::done(m_current) ) @@ -622,12 +622,12 @@ HelixEngine::timerEvent( QTimerEvent * ) * we'll put the 'title' in album instead... */ Engine::SimpleMetaBundle bndl; - bndl.album = QString::fromUtf8( m_md.title ); - if ( bndl.album.startsWith( QString("clipinfo:") ) ) + bndl.album = TQString::fromUtf8( m_md.title ); + if ( bndl.album.startsWith( TQString("clipinfo:") ) ) { bndl.album = bndl.album.remove(0, 9); - QStringList sl = QStringList::split('|', bndl.album); - for ( QStringList::Iterator it = sl.begin(); it != sl.end(); ++it ) + TQStringList sl = TQStringList::split('|', bndl.album); + for ( TQStringList::Iterator it = sl.begin(); it != sl.end(); ++it ) { if ((*it).startsWith("title=")) bndl.title = (*it).section('=', 1, 1); @@ -652,19 +652,19 @@ HelixEngine::timerEvent( QTimerEvent * ) tmp--; c = *tmp; *tmp = '\0'; - bndl.artist = QString::fromUtf8( m_md.artist ); + bndl.artist = TQString::fromUtf8( m_md.artist ); *tmp = c; tmp+=3; - bndl.title = QString::fromUtf8( tmp ); - bndl.album = QString::fromUtf8( m_md.title ); + bndl.title = TQString::fromUtf8( tmp ); + bndl.album = TQString::fromUtf8( m_md.title ); } else // just copy them as is... { - bndl.title = QString::fromUtf8( m_md.title ); - bndl.artist = QString::fromUtf8( m_md.artist ); + bndl.title = TQString::fromUtf8( m_md.title ); + bndl.artist = TQString::fromUtf8( m_md.artist ); } } - bndl.bitrate = QString::number( m_md.bitrate / 1000 ); + bndl.bitrate = TQString::number( m_md.bitrate / 1000 ); emit EngineBase::metaData( bndl ); } } @@ -876,7 +876,7 @@ HelixEngine::setEqualizerEnabled( bool enabled ) //SLOT // ok, this is lifted from gst... but why mess with what works? void -HelixEngine::setEqualizerParameters( int preamp, const QValueList& bandGains ) //SLOT +HelixEngine::setEqualizerParameters( int preamp, const TQValueList& bandGains ) //SLOT { m_preamp = ( preamp + 100 ) / 2; @@ -891,7 +891,7 @@ HelixEngine::setEqualizerParameters( int preamp, const QValueList& bandGain namespace Debug { #undef helix_indent - QCString helix_indent; + TQCString helix_indent; } #include "helix-engine.moc" diff --git a/amarok/src/engine/helix/helix-engine.h b/amarok/src/engine/helix/helix-engine.h index e7282d3b..bd89c601 100644 --- a/amarok/src/engine/helix/helix-engine.h +++ b/amarok/src/engine/helix/helix-engine.h @@ -12,11 +12,11 @@ #define _HELIX_ENGINE_H_ #include "enginebase.h" -#include +#include #include #include -class QStringList; +class TQStringList; struct timeval; class HelixEngine : public Engine::Base, public PlayerControl @@ -52,7 +52,7 @@ public slots: virtual void seek( uint ); virtual void setEqualizerEnabled( bool ); - virtual void setEqualizerParameters( int preamp, const QValueList& ); + virtual void setEqualizerParameters( int preamp, const TQValueList& ); protected: @@ -62,9 +62,9 @@ private: Engine::State m_state; KURL m_url; - QString m_coredir; - QString m_pluginsdir; - QString m_codecsdir; + TQString m_coredir; + TQString m_pluginsdir; + TQString m_codecsdir; bool m_inited; int m_numPlayers; @@ -94,8 +94,8 @@ private: typedef struct MimeEntry { - QStringList type; - QStringList ext; + TQStringList type; + TQStringList ext; }; std::vector m_mimes; @@ -108,7 +108,7 @@ private: } m_pfade[2]; void cleanup(); - void timerEvent( QTimerEvent * ); + void timerEvent( TQTimerEvent * ); void resetScope(int playerIndex); int print2stdout(const char *fmt, ...) diff --git a/amarok/src/engine/helix/helix-errors.cpp b/amarok/src/engine/helix/helix-errors.cpp index e4412c7b..bad40dfc 100644 --- a/amarok/src/engine/helix/helix-errors.cpp +++ b/amarok/src/engine/helix/helix-errors.cpp @@ -7,7 +7,7 @@ * (at your option) any later version. * * * ***************************************************************************/ -#include +#include #include #include #include "debug.h" @@ -21,7 +21,7 @@ using namespace std; struct HelixCoreErrors { unsigned long code; - QString error_string; + TQString error_string; } helixErrors[500] = { {0x80040004, i18n("Invalid Operation")}, @@ -419,17 +419,17 @@ public: HelixErrorsBase(); ~HelixErrorsBase(); - QString *errorText(unsigned long code); + TQString *errorText(unsigned long code); private: - std::map m_errors; + std::map m_errors; int m_nerrors; }; HelixErrorsBase *HelixErrors::m_base = new HelixErrorsBase(); -QString *HelixErrors::errorText(unsigned long code) +TQString *HelixErrors::errorText(unsigned long code) { return m_base->errorText(code); } @@ -439,7 +439,7 @@ HelixErrorsBase::HelixErrorsBase() : m_nerrors(0) while (helixErrors[m_nerrors].code) m_nerrors++; for (int i=0; ipData member. */ - STDMETHOD(OnBuffer) (THIS_ + STDQT_METHOD(OnBuffer) (THIS_ HXAudioData* /*IN*/ pAudioInData, HXAudioData* /*OUT*/ pAudioOutData) PURE; }; @@ -689,7 +689,7 @@ DECLARE_INTERFACE_(IHXAudioDeviceHookManager, IUnknown) /* * IUnknown methods! */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -706,7 +706,7 @@ DECLARE_INTERFACE_(IHXAudioDeviceHookManager, IUnknown) * Purpose: * Last chance to modify data being written to the audio device. */ - STDMETHOD(AddAudioDeviceHook) (THIS_ + STDQT_METHOD(AddAudioDeviceHook) (THIS_ IHXAudioHook* /*IN*/ pHook, AudioDeviceHookType /*IN*/ type ) PURE; @@ -717,7 +717,7 @@ DECLARE_INTERFACE_(IHXAudioDeviceHookManager, IUnknown) * Purpose: * Removes the audio device hook that was set with AddAudioDeviceHook. */ - STDMETHOD(RemoveAudioDeviceHook) (THIS_ + STDQT_METHOD(RemoveAudioDeviceHook) (THIS_ IHXAudioHook* /*IN*/ pHook ) PURE; @@ -728,7 +728,7 @@ DECLARE_INTERFACE_(IHXAudioDeviceHookManager, IUnknown) * Called by audio device implementations to process the hooks on a * given audio buffer */ - STDMETHOD(ProcessAudioDeviceHooks) (THIS_ + STDQT_METHOD(ProcessAudioDeviceHooks) (THIS_ IHXBuffer*& /*IN/OUT*/ pBuffer, HXBOOL& /*OUT*/ bChanged ) PURE; @@ -762,7 +762,7 @@ DECLARE_INTERFACE_(IHXAudioStreamInfoResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -787,7 +787,7 @@ DECLARE_INTERFACE_(IHXAudioStreamInfoResponse, IUnknown) * IHXAudioStreamInfoResponse object should be written to handle * OnStream() in the midst of the presentation as well. */ - STDMETHOD(OnStream) (THIS_ + STDQT_METHOD(OnStream) (THIS_ IHXAudioStream* /*IN*/ pAudioStream) PURE; }; @@ -824,7 +824,7 @@ DECLARE_INTERFACE_(IHXVolume, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -841,7 +841,7 @@ DECLARE_INTERFACE_(IHXVolume, IUnknown) * Purpose: * Call this to set the volume level. */ - STDMETHOD(SetVolume) (THIS_ + STDQT_METHOD(SetVolume) (THIS_ const UINT16 /*IN*/ uVolume ) PURE; /************************************************************************ @@ -858,7 +858,7 @@ DECLARE_INTERFACE_(IHXVolume, IUnknown) * Purpose: * Call this to mute the volume. */ - STDMETHOD(SetMute) (THIS_ + STDQT_METHOD(SetMute) (THIS_ const HXBOOL /*IN*/ bMute ) PURE; /************************************************************************ @@ -879,7 +879,7 @@ DECLARE_INTERFACE_(IHXVolume, IUnknown) * ever IHXVolume::SetVolume() and IHXVolume::SetMute() are * called. */ - STDMETHOD(AddAdviseSink) (THIS_ + STDQT_METHOD(AddAdviseSink) (THIS_ IHXVolumeAdviseSink* /*IN*/ pSink ) PURE; @@ -891,7 +891,7 @@ DECLARE_INTERFACE_(IHXVolume, IUnknown) * you are no longer interested in receiving volume or mute change * notifications. */ - STDMETHOD(RemoveAdviseSink) (THIS_ + STDQT_METHOD(RemoveAdviseSink) (THIS_ IHXVolumeAdviseSink* /*IN*/ pSink ) PURE; }; @@ -926,7 +926,7 @@ DECLARE_INTERFACE_(IHXVolumeAdviseSink, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -945,7 +945,7 @@ DECLARE_INTERFACE_(IHXVolumeAdviseSink, IUnknown) * This interface is called whenever the associated IHXVolume * SetVolume() is called. */ - STDMETHOD(OnVolumeChange) (THIS_ + STDQT_METHOD(OnVolumeChange) (THIS_ const UINT16 uVolume ) PURE; @@ -957,7 +957,7 @@ DECLARE_INTERFACE_(IHXVolumeAdviseSink, IUnknown) * SetMute() is called. * */ - STDMETHOD(OnMuteChange) (THIS_ + STDQT_METHOD(OnMuteChange) (THIS_ const HXBOOL bMute ) PURE; }; @@ -984,7 +984,7 @@ DECLARE_INTERFACE_(IHXAudioLevelNormalization, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -995,7 +995,7 @@ DECLARE_INTERFACE_(IHXAudioLevelNormalization, IUnknown) /* * IHXAudioLevelNormalization methods */ - STDMETHOD(SetSoundLevelOffset) (THIS_ INT16 nOffset) PURE; + STDQT_METHOD(SetSoundLevelOffset) (THIS_ INT16 nOffset) PURE; STDMETHOD_(INT16, GetSoundLevelOffset)(THIS) PURE; }; @@ -1026,7 +1026,7 @@ DECLARE_INTERFACE_(IHXDryNotification, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1048,7 +1048,7 @@ DECLARE_INTERFACE_(IHXDryNotification, IUnknown) * done synchronously within the call to this function. * It is OK to not write any data. Silence will be played instead. */ - STDMETHOD(OnDryNotification) (THIS_ + STDQT_METHOD(OnDryNotification) (THIS_ UINT32 /*IN*/ ulCurrentStreamTime, UINT32 /*IN*/ ulMinimumDurationRequired ) PURE; @@ -1081,7 +1081,7 @@ DECLARE_INTERFACE_(IHXAudioDeviceManager, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1100,7 +1100,7 @@ DECLARE_INTERFACE_(IHXAudioDeviceManager, IUnknown) * This is used to replace the default implementation of the audio * device by the given audio device interface. */ - STDMETHOD(Replace) (THIS_ + STDQT_METHOD(Replace) (THIS_ IHXAudioDevice* /*IN*/ pAudioDevice) PURE; /********************************************************************** @@ -1110,7 +1110,7 @@ DECLARE_INTERFACE_(IHXAudioDeviceManager, IUnknown) * This is used to remove the audio device given to the manager in * the earlier call to Replace. */ - STDMETHOD(Remove) (THIS_ + STDQT_METHOD(Remove) (THIS_ IHXAudioDevice* /*IN*/ pAudioDevice) PURE; /************************************************************************ @@ -1122,7 +1122,7 @@ DECLARE_INTERFACE_(IHXAudioDeviceManager, IUnknown) * is to be written to the audio device. This can be done in call * to OnInit() in IHXAudioHook. */ - STDMETHOD(SetFinalHook) (THIS_ + STDQT_METHOD(SetFinalHook) (THIS_ IHXAudioHook* /*IN*/ pHook ) PURE; @@ -1132,7 +1132,7 @@ DECLARE_INTERFACE_(IHXAudioDeviceManager, IUnknown) * Purpose: * Remove final hook */ - STDMETHOD(RemoveFinalHook) (THIS_ + STDQT_METHOD(RemoveFinalHook) (THIS_ IHXAudioHook* /*IN*/ pHook ) PURE; @@ -1144,7 +1144,7 @@ DECLARE_INTERFACE_(IHXAudioDeviceManager, IUnknown) * This function will fill in the pre-allocated HXAudioFormat * structure passed in. */ - STDMETHOD(GetAudioFormat) (THIS_ + STDQT_METHOD(GetAudioFormat) (THIS_ HXAudioFormat* /*IN/OUT*/pAudioFormat) PURE; }; @@ -1175,7 +1175,7 @@ DECLARE_INTERFACE_(IHXAudioCrossFade, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1202,7 +1202,7 @@ DECLARE_INTERFACE_(IHXAudioCrossFade, IUnknown) * to be done * */ - STDMETHOD(CrossFade) (THIS_ + STDQT_METHOD(CrossFade) (THIS_ IHXAudioStream* pStreamFrom, IHXAudioStream* pStreamTo, UINT32 ulFromCrossFadeStartTime, @@ -1236,7 +1236,7 @@ DECLARE_INTERFACE_(IHXAudioStream2, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1254,7 +1254,7 @@ DECLARE_INTERFACE_(IHXAudioStream2, IUnknown) * Use this to remove itself from the notification response object * during the stream switching. */ - STDMETHOD(RemoveDryNotification) (THIS_ + STDQT_METHOD(RemoveDryNotification) (THIS_ IHXDryNotification* /*IN*/ pNotification ) PURE; @@ -1266,7 +1266,7 @@ DECLARE_INTERFACE_(IHXAudioStream2, IUnknown) * renderer. This function will fill in the pre-allocated * HXAudioFormat structure passed in. */ - STDMETHOD(GetAudioFormat) (THIS_ + STDQT_METHOD(GetAudioFormat) (THIS_ HXAudioFormat* /*IN/OUT*/pAudioFormat) PURE; }; @@ -1297,7 +1297,7 @@ DECLARE_INTERFACE_(IHXAudioPushdown, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1316,7 +1316,7 @@ DECLARE_INTERFACE_(IHXAudioPushdown, IUnknown) * This is the amount of audio data that is being written * to the audio device before starting playback. */ - STDMETHOD(SetAudioPushdown) (THIS_ + STDQT_METHOD(SetAudioPushdown) (THIS_ UINT32 /*IN*/ ulAudioPushdown ) PURE; }; @@ -1348,7 +1348,7 @@ DECLARE_INTERFACE_(IHXAudioHookManager, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1365,7 +1365,7 @@ DECLARE_INTERFACE_(IHXAudioHookManager, IUnknown) * Purpose: * Use this to add a hook */ - STDMETHOD(AddHook) (THIS_ + STDQT_METHOD(AddHook) (THIS_ IHXAudioHook* /*IN*/ pHook ) PURE; @@ -1375,7 +1375,7 @@ DECLARE_INTERFACE_(IHXAudioHookManager, IUnknown) * Purpose: * Use this to remove a hook */ - STDMETHOD(RemoveHook) (THIS_ + STDQT_METHOD(RemoveHook) (THIS_ IHXAudioHook* /*IN*/ pHook ) PURE; }; @@ -1407,7 +1407,7 @@ DECLARE_INTERFACE_(IHXMultiPlayPauseSupport, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1447,7 +1447,7 @@ DECLARE_INTERFACE_(IHXAudioDeviceManager2, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1496,7 +1496,7 @@ DECLARE_INTERFACE_(IHXAudioResampler, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1561,7 +1561,7 @@ DECLARE_INTERFACE_(IHXAudioResamplerManager, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1573,7 +1573,7 @@ DECLARE_INTERFACE_(IHXAudioResamplerManager, IUnknown) * IHXAudioResamplerManager methods * */ - STDMETHOD(CreateResampler) (THIS_ + STDQT_METHOD(CreateResampler) (THIS_ HXAudioFormat inAudioFormat, REF(HXAudioFormat) outAudioFormat, REF(IHXAudioResampler*) pResampler) PURE; @@ -1605,7 +1605,7 @@ DECLARE_INTERFACE_(IHXAudioPushdown2, IHXAudioPushdown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1621,7 +1621,7 @@ DECLARE_INTERFACE_(IHXAudioPushdown2, IHXAudioPushdown) * This is the amount of audio data that is being written * to the audio device before starting playback. */ - STDMETHOD(SetAudioPushdown) (THIS_ + STDQT_METHOD(SetAudioPushdown) (THIS_ UINT32 /*IN */ ulAudioPushdown) PURE; /************************************************************************ @@ -1632,7 +1632,7 @@ DECLARE_INTERFACE_(IHXAudioPushdown2, IHXAudioPushdown) * This is the amount of audio data that is being written * to the audio device before starting playback. */ - STDMETHOD(GetAudioPushdown) (THIS_ + STDQT_METHOD(GetAudioPushdown) (THIS_ REF(UINT32) /*OUT*/ ulAudioPushdown) PURE; /************************************************************************ @@ -1642,7 +1642,7 @@ DECLARE_INTERFACE_(IHXAudioPushdown2, IHXAudioPushdown) * Use this to get the audio pushed down to the audio device and haven't * been played yet */ - STDMETHOD(GetCurrentAudioDevicePushdown) (THIS_ + STDQT_METHOD(GetCurrentAudioDevicePushdown) (THIS_ REF(UINT32) /*OUT*/ ulAudioPusheddown) PURE; }; @@ -1672,7 +1672,7 @@ DECLARE_INTERFACE_(IHXAudioMultiChannel, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1698,14 +1698,14 @@ DEFINE_GUID(IID_IHXTimelineWatcher, #define INTERFACE IHXTimelineWatcher DECLARE_INTERFACE_(IHXTimelineWatcher, IUnknown) { - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; STDMETHOD_(ULONG32,Release) (THIS) PURE; - STDMETHOD(OnPause) (THIS) PURE; - STDMETHOD(OnResume) (THIS) PURE; - STDMETHOD(OnClose) (THIS) PURE; - STDMETHOD(OnTimeSync) (THIS_ UINT32 currentTime ) PURE; + STDQT_METHOD(OnPause) (THIS) PURE; + STDQT_METHOD(OnResume) (THIS) PURE; + STDQT_METHOD(OnClose) (THIS) PURE; + STDQT_METHOD(OnTimeSync) (THIS_ UINT32 currentTime ) PURE; }; // TimelineManager @@ -1716,12 +1716,12 @@ DEFINE_GUID(IID_IHXTimelineManager, #define INTERFACE IHXTimelineManager DECLARE_INTERFACE_(IHXTimelineManager, IUnknown) { - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; STDMETHOD_(ULONG32,Release) (THIS) PURE; - STDMETHOD(AddTimelineWatcher) (THIS_ IHXTimelineWatcher* ) PURE; - STDMETHOD(RemoveTimelineWatcher) (THIS_ IHXTimelineWatcher* ) PURE; + STDQT_METHOD(AddTimelineWatcher) (THIS_ IHXTimelineWatcher* ) PURE; + STDQT_METHOD(RemoveTimelineWatcher) (THIS_ IHXTimelineWatcher* ) PURE; }; #endif /* #if defined(HELIX_FEATURE_TIMELINE_WATCHER) */ diff --git a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxauth.h b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxauth.h index 903c835f..aad4aed4 100644 --- a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxauth.h +++ b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxauth.h @@ -51,7 +51,7 @@ DEFINE_GUID(IID_IHXAuthenticator, 0x00001800, 0x901, 0x11d1, 0x8b, 0x6, 0x0, DECLARE_INTERFACE_(IHXAuthenticator, IUnknown) { - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -64,7 +64,7 @@ DECLARE_INTERFACE_(IHXAuthenticator, IUnknown) * object in order to pass it an IHXAuthenticatorRequest object, * usually implemented by the creator itself. */ - STDMETHOD(InitAuthenticator) (THIS_ + STDQT_METHOD(InitAuthenticator) (THIS_ IHXAuthenticatorRequest* pRequest) PURE; /* * Authenticate is called by a file object (and others??) @@ -78,21 +78,21 @@ DECLARE_INTERFACE_(IHXAuthenticator, IUnknown) * part of their Init() call, and not call InitDone until they receive * a response one way or the other. */ - STDMETHOD(Authenticate) (THIS_ + STDQT_METHOD(Authenticate) (THIS_ IHXValues* pValues, IHXAuthenticatorResponse* pResponse) PURE; /* GenerateAuthRequest is called by the creator of this object * when they want to send an authentication request to someone. */ - STDMETHOD(GenerateAuthRequest) (THIS_ + STDQT_METHOD(GenerateAuthRequest) (THIS_ UINT32 authType, REF(IHXValues*) pValues) PURE; /* * AuthValuesReady is called by IHXAuthenticatorRequest when it * is ready to respond to a GetAuthValues request. */ - STDMETHOD(AuthValuesReady) (THIS_ + STDQT_METHOD(AuthValuesReady) (THIS_ HX_RESULT result, IHXValues* pValues) PURE; }; @@ -122,7 +122,7 @@ DEFINE_GUID(IID_IHXAuthenticatorResponse, 0x00001801, 0x901, 0x11d1, 0x8b, 0x6, DECLARE_INTERFACE_(IHXAuthenticatorResponse, IUnknown) { - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -135,7 +135,7 @@ DECLARE_INTERFACE_(IHXAuthenticatorResponse, IUnknown) * then the values contain authorization information as generated by * IHXPassword. */ - STDMETHOD(AuthenticateDone) (THIS_ HX_RESULT result, + STDQT_METHOD(AuthenticateDone) (THIS_ HX_RESULT result, IHXValues* pAuthResponseValues) PURE; }; @@ -164,7 +164,7 @@ DEFINE_GUID(IID_IHXAuthenticatorRequest, 0x00001802, 0x901, 0x11d1, 0x8b, 0x6, 0 DECLARE_INTERFACE_(IHXAuthenticatorRequest, IUnknown) { - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -177,7 +177,7 @@ DECLARE_INTERFACE_(IHXAuthenticatorRequest, IUnknown) * * This object should call AuthValuesReady when ready. */ - STDMETHOD(GetAuthValues) (THIS_ IHXValues* pOrigValues) PURE; + STDQT_METHOD(GetAuthValues) (THIS_ IHXValues* pOrigValues) PURE; }; @@ -215,7 +215,7 @@ DECLARE_INTERFACE_(IHXPassword, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -227,11 +227,11 @@ DECLARE_INTERFACE_(IHXPassword, IUnknown) * IHXPassword methods */ - STDMETHOD(Crypt) (THIS_ IHXValues* pAuthentication) PURE; - STDMETHOD(Verify) (THIS_ IHXValues* pAuth1, IHXValues* pAuth2) PURE; + STDQT_METHOD(Crypt) (THIS_ IHXValues* pAuthentication) PURE; + STDQT_METHOD(Verify) (THIS_ IHXValues* pAuth1, IHXValues* pAuth2) PURE; - STDMETHOD(AsString) (THIS_ IHXValues* pAuth, REF(IHXBuffer*) pBuffer) PURE; - STDMETHOD(AsValues) (THIS_ const char* str, IHXValues* pValues) PURE; + STDQT_METHOD(AsString) (THIS_ IHXValues* pAuth, REF(IHXBuffer*) pBuffer) PURE; + STDQT_METHOD(AsValues) (THIS_ const char* str, IHXValues* pValues) PURE; /* * CreateBuffer is provided for the convenince of external users, @@ -239,12 +239,12 @@ DECLARE_INTERFACE_(IHXPassword, IUnknown) * just to create IHXBuffers. This method can be used instead, but * is not advisable if other means are available. */ - STDMETHOD(CreateBuffer) (THIS_ REF(IHXBuffer*) pBuffer) PURE; + STDQT_METHOD(CreateBuffer) (THIS_ REF(IHXBuffer*) pBuffer) PURE; /* * Ditto for CreateValues */ - STDMETHOD(CreateValues) (THIS_ REF(IHXValues*) pValues) PURE; + STDQT_METHOD(CreateValues) (THIS_ REF(IHXValues*) pValues) PURE; }; @@ -272,7 +272,7 @@ DEFINE_GUID(IID_IHXAuthenticationManager, 0x00001a00, 0x901, 0x11d1, DECLARE_INTERFACE_(IHXAuthenticationManager, IUnknown) { - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; @@ -281,7 +281,7 @@ DECLARE_INTERFACE_(IHXAuthenticationManager, IUnknown) /* HandleAuthenticationRequest is called when the core wants us to get * a username and password. */ - STDMETHOD(HandleAuthenticationRequest) ( + STDQT_METHOD(HandleAuthenticationRequest) ( THIS_ IHXAuthenticationManagerResponse* pResponse) PURE; }; @@ -316,7 +316,7 @@ DEFINE_GUID(IID_IHXAuthenticationManager2, DECLARE_INTERFACE_(IHXAuthenticationManager2, IUnknown) { - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; @@ -325,7 +325,7 @@ DECLARE_INTERFACE_(IHXAuthenticationManager2, IUnknown) /* HandleAuthenticationRequest2 is called when the core wants us to get * a username and password. */ - STDMETHOD(HandleAuthenticationRequest2) ( + STDQT_METHOD(HandleAuthenticationRequest2) ( THIS_ IHXAuthenticationManagerResponse* pResponse, IHXValues* pHeader) PURE; @@ -357,7 +357,7 @@ DEFINE_GUID(IID_IHXAuthenticationManagerResponse, 0x00001a01, 0x901, 0x11d1, DECLARE_INTERFACE_(IHXAuthenticationManagerResponse, IUnknown) { - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; @@ -366,7 +366,7 @@ DECLARE_INTERFACE_(IHXAuthenticationManagerResponse, IUnknown) /* HandleAuthenticationRequest is called when the core wants us to get * a username and password. */ - STDMETHOD(AuthenticationRequestDone) (THIS_ + STDQT_METHOD(AuthenticationRequestDone) (THIS_ HX_RESULT result, const char* pUserName, const char* pPassword) PURE; diff --git a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxccf.h b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxccf.h index b99d4bdb..9b2f8f43 100644 --- a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxccf.h +++ b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxccf.h @@ -47,7 +47,7 @@ DECLARE_INTERFACE_(IHXCommonClassFactory, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -74,7 +74,7 @@ DECLARE_INTERFACE_(IHXCommonClassFactory, IUnknown) * not passed to this function, and you do not need to code for this * situation. */ - STDMETHOD(CreateInstance) (THIS_ + STDQT_METHOD(CreateInstance) (THIS_ REFCLSID /*IN*/ rclsid, void** /*OUT*/ ppUnknown) PURE; @@ -95,7 +95,7 @@ DECLARE_INTERFACE_(IHXCommonClassFactory, IUnknown) * NOTE 2: The output interface is always the non-delegating * IUnknown. */ - STDMETHOD(CreateInstanceAggregatable) + STDQT_METHOD(CreateInstanceAggregatable) (THIS_ REFCLSID /*IN*/ rclsid, REF(IUnknown*) /*OUT*/ ppUnknown, diff --git a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxcom.h b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxcom.h index 9a5f6891..96ddd9a2 100644 --- a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxcom.h +++ b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxcom.h @@ -59,7 +59,7 @@ * Use this for constant methods in an interface * Compiles away under C */ -#if !defined( CONSTMETHOD ) +#if !defined( CONSTQT_METHOD ) #if defined(__cplusplus) #define CONSTMETHOD const @@ -219,7 +219,7 @@ typedef unsigned int MMRESULT; #if defined(__cplusplus) && !defined(CINTERFACE) #define _INTERFACE struct -#define STDMETHOD(method) virtual HX_RESULT STDMETHODCALLTYPE method +#define STDQT_METHOD(method) virtual HX_RESULT STDMETHODCALLTYPE method #define STDMETHOD_(type,method) virtual type STDMETHODCALLTYPE method #define PURE = 0 #define THIS_ @@ -250,7 +250,7 @@ typedef unsigned int MMRESULT; #define _INTERFACE struct -#define STDMETHOD(method) HX_RESULT (STDMETHODCALLTYPE * method) +#define STDQT_METHOD(method) HX_RESULT (STDMETHODCALLTYPE * method) #define STDMETHOD_(type,method) type (STDMETHODCALLTYPE * method) #if !defined(BEGIN_INTERFACE) @@ -474,7 +474,7 @@ DEFINE_GUID(IID_IUnknown, 0x00000000, 0x0000, 0x0000, 0xC0, 0x00, DECLARE_INTERFACE(IUnknown) { - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -510,7 +510,7 @@ DECLARE_INTERFACE_(IMalloc, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; diff --git a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxcomm.h b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxcomm.h index dc4c8ea4..b8a5b9f7 100644 --- a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxcomm.h +++ b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxcomm.h @@ -58,7 +58,7 @@ DECLARE_INTERFACE_(IHXStatistics, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -77,7 +77,7 @@ DECLARE_INTERFACE_(IHXStatistics, IUnknown) * Pass registry ID to the caller * */ - STDMETHOD(InitializeStatistics) (THIS_ + STDQT_METHOD(InitializeStatistics) (THIS_ UINT32 /*IN*/ ulRegistryID) PURE; /************************************************************************ @@ -87,7 +87,7 @@ DECLARE_INTERFACE_(IHXStatistics, IUnknown) * Notify the client to update its statistics stored in the registry * */ - STDMETHOD(UpdateStatistics) (THIS) PURE; + STDQT_METHOD(UpdateStatistics) (THIS) PURE; }; @@ -119,7 +119,7 @@ DECLARE_INTERFACE_(IHXRegistryID, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -138,7 +138,7 @@ DECLARE_INTERFACE_(IHXRegistryID, IUnknown) * Get the registry ID of the object. * */ - STDMETHOD(GetID) (THIS_ + STDQT_METHOD(GetID) (THIS_ REF(UINT32) /*OUT*/ ulRegistryID) PURE; }; @@ -172,7 +172,7 @@ DECLARE_INTERFACE_(IHXServerFork, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -232,7 +232,7 @@ DECLARE_INTERFACE_(IHXServerControl, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -250,7 +250,7 @@ DECLARE_INTERFACE_(IHXServerControl, IUnknown) * Purpose: * Shutdown the server. */ - STDMETHOD(ShutdownServer) (THIS_ + STDQT_METHOD(ShutdownServer) (THIS_ UINT32 status) PURE; }; @@ -282,7 +282,7 @@ DECLARE_INTERFACE_(IHXServerControl2, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -302,7 +302,7 @@ DECLARE_INTERFACE_(IHXServerControl2, IUnknown) * Completely shutdown the server, then restart. Mainly used to * cause not hot setting config var changes to take effect. */ - STDMETHOD(RestartServer) (THIS) PURE; + STDQT_METHOD(RestartServer) (THIS) PURE; /************************************************************************ * IHXServerControl2::ReconfigServer @@ -312,7 +312,7 @@ DECLARE_INTERFACE_(IHXServerControl2, IUnknown) * Used to cause the server to re-read in config from file or registry * (however it was started) and attempt to use the values. */ - STDMETHOD(ReconfigServer) (THIS_ IHXReconfigServerResponse* pResp) PURE; + STDQT_METHOD(ReconfigServer) (THIS_ IHXReconfigServerResponse* pResp) PURE; }; @@ -344,7 +344,7 @@ DECLARE_INTERFACE_(IHXReconfigServerResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -359,7 +359,7 @@ DECLARE_INTERFACE_(IHXReconfigServerResponse, IUnknown) * * Notification that reconfiguring the server is done. */ - STDMETHOD(ReconfigServerDone) (THIS_ + STDQT_METHOD(ReconfigServerDone) (THIS_ HX_RESULT res, IHXBuffer** pInfo, UINT32 ulNumInfo) PURE; @@ -396,7 +396,7 @@ DECLARE_INTERFACE_(IHXServerReconfigNotification, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -411,7 +411,7 @@ DECLARE_INTERFACE_(IHXServerReconfigNotification, IUnknown) * * Tell the server that you want reconfig notification. */ - STDMETHOD(WantReconfigNotification) (THIS_ + STDQT_METHOD(WantReconfigNotification) (THIS_ IHXWantServerReconfigNotification* pResponse) PURE; /************************************************************************ @@ -421,7 +421,7 @@ DECLARE_INTERFACE_(IHXServerReconfigNotification, IUnknown) * * Tell the server that you no longer want reconfig notification. */ - STDMETHOD(CancelReconfigNotification) (THIS_ + STDQT_METHOD(CancelReconfigNotification) (THIS_ IHXWantServerReconfigNotification* pResponse) PURE; }; @@ -456,7 +456,7 @@ DECLARE_INTERFACE_(IHXWantServerReconfigNotification, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -472,7 +472,7 @@ DECLARE_INTERFACE_(IHXWantServerReconfigNotification, IUnknown) * Notify user that a server reconfig request had come in and it * is now your turn to do external (not server config) reconfiguration.* */ - STDMETHOD(ServerReconfig) (THIS_ + STDQT_METHOD(ServerReconfig) (THIS_ IHXReconfigServerResponse* pResponse) PURE; }; @@ -491,7 +491,7 @@ DECLARE_INTERFACE_(IHXResolverExec, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -499,7 +499,7 @@ DECLARE_INTERFACE_(IHXResolverExec, IUnknown) STDMETHOD_(ULONG32,Release) (THIS) PURE; - STDMETHOD(ResolverExec) (THIS_ int readfd, int writefd) PURE; + STDQT_METHOD(ResolverExec) (THIS_ int readfd, int writefd) PURE; }; @@ -530,7 +530,7 @@ DECLARE_INTERFACE_(IHXFastAlloc, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -606,7 +606,7 @@ DECLARE_INTERFACE_(IHXAccurateClock, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; diff --git a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxcore.h b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxcore.h index e76f85c4..872ce014 100644 --- a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxcore.h +++ b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxcore.h @@ -148,7 +148,7 @@ DECLARE_INTERFACE_(IHXStream, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -168,7 +168,7 @@ DECLARE_INTERFACE_(IHXStream, IUnknown) * a part of. * */ - STDMETHOD(GetSource) (THIS_ + STDQT_METHOD(GetSource) (THIS_ REF(IHXStreamSource*) pSource) PURE; /************************************************************************ @@ -219,7 +219,7 @@ DECLARE_INTERFACE_(IHXStream, IUnknown) * a unQuality of 100. * */ - STDMETHOD(ReportQualityOfService) (THIS_ + STDQT_METHOD(ReportQualityOfService) (THIS_ UINT8 unQuality) PURE; /************************************************************************ @@ -240,7 +240,7 @@ DECLARE_INTERFACE_(IHXStream, IUnknown) * 5,5. * */ - STDMETHOD(ReportRebufferStatus) (THIS_ + STDQT_METHOD(ReportRebufferStatus) (THIS_ UINT8 unNeeded, UINT8 unAvailable) PURE; @@ -253,7 +253,7 @@ DECLARE_INTERFACE_(IHXStream, IUnknown) * Valid to call before stream actually begins. Best to call during * IHXRenderer::OnHeader(). */ - STDMETHOD(SetGranularity) (THIS_ + STDQT_METHOD(SetGranularity) (THIS_ ULONG32 ulGranularity) PURE; /************************************************************************ @@ -271,7 +271,7 @@ DECLARE_INTERFACE_(IHXStream, IUnknown) * Purpose: * Returns the Nth renderer instance supported by this stream. */ - STDMETHOD(GetRenderer) (THIS_ + STDQT_METHOD(GetRenderer) (THIS_ UINT16 nIndex, REF(IUnknown*) pUnknown) PURE; }; @@ -315,7 +315,7 @@ DECLARE_INTERFACE_(IHXStream2, IHXStream) * * The rest semantic are the same between the 2 calls. */ - STDMETHOD(ReportAudioRebufferStatus) (THIS_ + STDQT_METHOD(ReportAudioRebufferStatus) (THIS_ UINT8 unNeeded, UINT8 unAvailable) PURE; }; @@ -347,7 +347,7 @@ DECLARE_INTERFACE_(IHXStreamSource, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -376,7 +376,7 @@ DECLARE_INTERFACE_(IHXStreamSource, IUnknown) * a part of. * */ - STDMETHOD(GetPlayer) (THIS_ + STDQT_METHOD(GetPlayer) (THIS_ REF(IHXPlayer*) pPlayer) PURE; /************************************************************************ @@ -405,7 +405,7 @@ DECLARE_INTERFACE_(IHXStreamSource, IUnknown) * Purpose: * Returns the Nth stream instance supported by this source. */ - STDMETHOD(GetStream) (THIS_ + STDQT_METHOD(GetStream) (THIS_ UINT16 nIndex, REF(IUnknown*) pUnknown) PURE; }; @@ -439,7 +439,7 @@ DECLARE_INTERFACE_(IHXPlayer, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -459,7 +459,7 @@ DECLARE_INTERFACE_(IHXPlayer, IUnknown) * player is a part of. * */ - STDMETHOD(GetClientEngine) (THIS_ + STDQT_METHOD(GetClientEngine) (THIS_ REF(IHXClientEngine*) pEngine) PURE; /************************************************************************ @@ -496,7 +496,7 @@ DECLARE_INTERFACE_(IHXPlayer, IUnknown) * Tell the player to begin playback of all its sources. * */ - STDMETHOD(OpenURL) (THIS_ + STDQT_METHOD(OpenURL) (THIS_ const char* pURL) PURE; /************************************************************************ @@ -506,7 +506,7 @@ DECLARE_INTERFACE_(IHXPlayer, IUnknown) * Tell the player to begin playback of all its sources. * */ - STDMETHOD(Begin) (THIS) PURE; + STDQT_METHOD(Begin) (THIS) PURE; /************************************************************************ * Method: @@ -515,7 +515,7 @@ DECLARE_INTERFACE_(IHXPlayer, IUnknown) * Tell the player to stop playback of all its sources. * */ - STDMETHOD(Stop) (THIS) PURE; + STDQT_METHOD(Stop) (THIS) PURE; /************************************************************************ * Method: @@ -524,7 +524,7 @@ DECLARE_INTERFACE_(IHXPlayer, IUnknown) * Tell the player to pause playback of all its sources. * */ - STDMETHOD(Pause) (THIS) PURE; + STDQT_METHOD(Pause) (THIS) PURE; /************************************************************************ * Method: @@ -534,7 +534,7 @@ DECLARE_INTERFACE_(IHXPlayer, IUnknown) * sources. * */ - STDMETHOD(Seek) (THIS_ + STDQT_METHOD(Seek) (THIS_ ULONG32 ulTime) PURE; /************************************************************************ @@ -552,7 +552,7 @@ DECLARE_INTERFACE_(IHXPlayer, IUnknown) * Purpose: * Returns the Nth source instance supported by this player. */ - STDMETHOD(GetSource) (THIS_ + STDQT_METHOD(GetSource) (THIS_ UINT16 nIndex, REF(IUnknown*) pUnknown) PURE; @@ -564,7 +564,7 @@ DECLARE_INTERFACE_(IHXPlayer, IUnknown) * services to the core. This is traditionally called by the top * level client application. */ - STDMETHOD(SetClientContext) (THIS_ + STDQT_METHOD(SetClientContext) (THIS_ IUnknown* pUnknown) PURE; /************************************************************************ @@ -574,7 +574,7 @@ DECLARE_INTERFACE_(IHXPlayer, IUnknown) * Called to get the client context for this player. This is * set by the top level client application. */ - STDMETHOD(GetClientContext) (THIS_ + STDQT_METHOD(GetClientContext) (THIS_ REF(IUnknown*) pUnknown) PURE; /************************************************************************ @@ -584,7 +584,7 @@ DECLARE_INTERFACE_(IHXPlayer, IUnknown) * Call this method to add a client advise sink. * */ - STDMETHOD(AddAdviseSink) (THIS_ + STDQT_METHOD(AddAdviseSink) (THIS_ IHXClientAdviseSink* pAdviseSink) PURE; /************************************************************************ @@ -593,7 +593,7 @@ DECLARE_INTERFACE_(IHXPlayer, IUnknown) * Purpose: * Call this method to remove a client advise sink. */ - STDMETHOD(RemoveAdviseSink) (THIS_ + STDQT_METHOD(RemoveAdviseSink) (THIS_ IHXClientAdviseSink* pAdviseSink) PURE; }; @@ -624,7 +624,7 @@ DECLARE_INTERFACE_(IHXClientEngine, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -643,7 +643,7 @@ DECLARE_INTERFACE_(IHXClientEngine, IUnknown) * Creates a new IHXPlayer instance. * */ - STDMETHOD(CreatePlayer) (THIS_ + STDQT_METHOD(CreatePlayer) (THIS_ REF(IHXPlayer*) pPlayer) PURE; /************************************************************************ @@ -653,7 +653,7 @@ DECLARE_INTERFACE_(IHXClientEngine, IUnknown) * Called by the client when it is done using the player... * */ - STDMETHOD(ClosePlayer) (THIS_ + STDQT_METHOD(ClosePlayer) (THIS_ IHXPlayer* pPlayer) PURE; /************************************************************************ @@ -672,7 +672,7 @@ DECLARE_INTERFACE_(IHXClientEngine, IUnknown) * Returns the Nth IHXPlayer instances supported by this client * engine instance. */ - STDMETHOD(GetPlayer) (THIS_ + STDQT_METHOD(GetPlayer) (THIS_ UINT16 nPlayerNumber, REF(IUnknown*) pUnknown) PURE; @@ -683,7 +683,7 @@ DECLARE_INTERFACE_(IHXClientEngine, IUnknown) * Clients call this to pass OS events to all players. HXxEvent * defines a cross-platform event. */ - STDMETHOD(EventOccurred) (THIS_ + STDQT_METHOD(EventOccurred) (THIS_ HXxEvent* /*IN*/ pEvent) PURE; }; @@ -715,7 +715,7 @@ DECLARE_INTERFACE_(IHXClientEngineMapper, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -734,7 +734,7 @@ DECLARE_INTERFACE_(IHXClientEngineMapper, IUnknown) * Returns the IHXPlayer instance supported by this client * engine instance that contains the specified IHXSite. */ - STDMETHOD(GetPlayerBySite) (THIS_ + STDQT_METHOD(GetPlayerBySite) (THIS_ IHXSite* pSite, REF(IUnknown*) pUnknown) PURE; }; @@ -752,7 +752,7 @@ DECLARE_INTERFACE_(IHXClientEngineSelector, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -802,7 +802,7 @@ DECLARE_INTERFACE_(IHXClientEngineSetup, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -822,7 +822,7 @@ DECLARE_INTERFACE_(IHXClientEngineSetup, IUnknown) * interfaces implemented by the core. Current over-ridable * interfaces are: IHXPreferences, IHXHyperNavigate */ - STDMETHOD(Setup) (THIS_ + STDQT_METHOD(Setup) (THIS_ IUnknown* pContext) PURE; }; @@ -853,7 +853,7 @@ DECLARE_INTERFACE_(IHXInfoLogger, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -872,7 +872,7 @@ DECLARE_INTERFACE_(IHXInfoLogger, IUnknown) * Logs any user defined information in form of action and * associated data. */ - STDMETHOD(LogInformation) (THIS_ + STDQT_METHOD(LogInformation) (THIS_ const char* /*IN*/ pAction, const char* /*IN*/ pData) PURE; }; @@ -903,7 +903,7 @@ DECLARE_INTERFACE_(IHXPersistenceManager, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -927,7 +927,7 @@ DECLARE_INTERFACE_(IHXPersistenceManager, IUnknown) * b) All the groups within the current presentation have been * played. */ - STDMETHOD(AddPersistentComponent) (THIS_ + STDQT_METHOD(AddPersistentComponent) (THIS_ IUnknown* /*IN*/ pComponent) PURE; /************************************************************************ @@ -936,7 +936,7 @@ DECLARE_INTERFACE_(IHXPersistenceManager, IUnknown) * Purpose: * Remove an earlier registered persistent component. */ - STDMETHOD(RemovePersistentComponent) (THIS_ + STDQT_METHOD(RemovePersistentComponent) (THIS_ IUnknown* /*IN*/ pComponent) PURE; /************************************************************************ @@ -945,7 +945,7 @@ DECLARE_INTERFACE_(IHXPersistenceManager, IUnknown) * Purpose: * Return an earlier registered persistent component. */ - STDMETHOD(GetPersistentComponent) (THIS_ + STDQT_METHOD(GetPersistentComponent) (THIS_ REF(IUnknown*) /*OUT*/ pComponent) PURE; }; @@ -975,7 +975,7 @@ DECLARE_INTERFACE_(IHXDriverStreamManager, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -993,7 +993,7 @@ DECLARE_INTERFACE_(IHXDriverStreamManager, IUnknown) * Add a renderer advise sink * */ - STDMETHOD(AddRendererAdviseSink) (THIS_ + STDQT_METHOD(AddRendererAdviseSink) (THIS_ IHXRendererAdviseSink* pSink) PURE; /************************************************************************ @@ -1003,7 +1003,7 @@ DECLARE_INTERFACE_(IHXDriverStreamManager, IUnknown) * Remove an advise sink * */ - STDMETHOD(RemoveRendererAdviseSink) (THIS_ + STDQT_METHOD(RemoveRendererAdviseSink) (THIS_ IHXRendererAdviseSink* pSink) PURE; }; @@ -1033,7 +1033,7 @@ DECLARE_INTERFACE_(IHXRendererAdviseSink, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1045,19 +1045,19 @@ DECLARE_INTERFACE_(IHXRendererAdviseSink, IUnknown) * IHXRendererAdviseSink methods */ - STDMETHOD(TrackDurationSet) (THIS_ + STDQT_METHOD(TrackDurationSet) (THIS_ UINT32 ulGroupIndex, UINT32 ulTrackIndex, UINT32 ulDuration, UINT32 ulDelay, HXBOOL bIsLive) PURE; - STDMETHOD(RepeatedTrackDurationSet) (THIS_ + STDQT_METHOD(RepeatedTrackDurationSet) (THIS_ const char* pID, UINT32 ulDuration, HXBOOL bIsLive) PURE; - STDMETHOD(TrackUpdated) (THIS_ + STDQT_METHOD(TrackUpdated) (THIS_ UINT32 ulGroupIndex, UINT32 ulTrackIndex, IHXValues* pValues) PURE; @@ -1069,7 +1069,7 @@ DECLARE_INTERFACE_(IHXRendererAdviseSink, IUnknown) * Notification of renderer initialization * */ - STDMETHOD(RendererInitialized) (THIS_ + STDQT_METHOD(RendererInitialized) (THIS_ IHXRenderer* pRenderer, IUnknown* pStream, IHXValues* pInfo) PURE; @@ -1081,7 +1081,7 @@ DECLARE_INTERFACE_(IHXRendererAdviseSink, IUnknown) * Notification of renderer close * */ - STDMETHOD(RendererClosed) (THIS_ + STDQT_METHOD(RendererClosed) (THIS_ IHXRenderer* pRenderer, IHXValues* pInfo) PURE; }; @@ -1113,7 +1113,7 @@ DECLARE_INTERFACE_(IHXLayoutStream, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1133,7 +1133,7 @@ DECLARE_INTERFACE_(IHXLayoutStream, IUnknown) * * */ - STDMETHOD(GetProperties) (THIS_ + STDQT_METHOD(GetProperties) (THIS_ REF(IHXValues*) pValue) PURE; /************************************************************************ @@ -1143,7 +1143,7 @@ DECLARE_INTERFACE_(IHXLayoutStream, IUnknown) * Set layout stream property * */ - STDMETHOD(SetProperties) (THIS_ + STDQT_METHOD(SetProperties) (THIS_ IHXValues* pValue) PURE; }; @@ -1173,7 +1173,7 @@ DECLARE_INTERFACE_(IHXRendererUpgrade, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1203,7 +1203,7 @@ DECLARE_INTERFACE_(IHXRendererUpgrade, IUnknown) * Force an upgrade for any unloaded renderers * */ - STDMETHOD(ForceUpgrade) (THIS) PURE; + STDQT_METHOD(ForceUpgrade) (THIS) PURE; }; /**************************************************************************** @@ -1232,7 +1232,7 @@ DECLARE_INTERFACE_(IHXValidator, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1263,7 +1263,7 @@ DECLARE_INTERFACE_(IHXValidator, IUnknown) * * */ - STDMETHOD(ValidateMetaFile) (THIS_ + STDQT_METHOD(ValidateMetaFile) (THIS_ IHXRequest* pRequest, IHXBuffer* pContent) PURE; }; @@ -1299,7 +1299,7 @@ DECLARE_INTERFACE_(IHXPrivateStreamSource, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1344,7 +1344,7 @@ DECLARE_INTERFACE_(IHXPlayer2, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1358,7 +1358,7 @@ DECLARE_INTERFACE_(IHXPlayer2, IUnknown) * Purpose: * Call this method to set the minimum preroll of this clip */ - STDMETHOD(SetMinimumPreroll) (THIS_ + STDQT_METHOD(SetMinimumPreroll) (THIS_ UINT32 ulMinPreroll) PURE; /************************************************************************ @@ -1367,7 +1367,7 @@ DECLARE_INTERFACE_(IHXPlayer2, IUnknown) * Purpose: * Call this method to get the minimum preroll of this clip */ - STDMETHOD(GetMinimumPreroll) (THIS_ + STDQT_METHOD(GetMinimumPreroll) (THIS_ REF(UINT32) ulMinPreroll) PURE; /************************************************************************ @@ -1376,7 +1376,7 @@ DECLARE_INTERFACE_(IHXPlayer2, IUnknown) * Purpose: * Call this method to open the IHXRequest */ - STDMETHOD(OpenRequest) (THIS_ + STDQT_METHOD(OpenRequest) (THIS_ IHXRequest* pRequest) PURE; /************************************************************************ @@ -1385,7 +1385,7 @@ DECLARE_INTERFACE_(IHXPlayer2, IUnknown) * Purpose: * Call this method to get the IHXRequest */ - STDMETHOD(GetRequest) (THIS_ + STDQT_METHOD(GetRequest) (THIS_ REF(IHXRequest*) pRequest) PURE; }; @@ -1416,7 +1416,7 @@ DECLARE_INTERFACE_(IHXUpdateProperties, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1430,7 +1430,7 @@ DECLARE_INTERFACE_(IHXUpdateProperties, IUnknown) * Purpose: * Call this method to update the timestamp offset of cached packets */ - STDMETHOD(UpdatePacketTimeOffset) (THIS_ + STDQT_METHOD(UpdatePacketTimeOffset) (THIS_ INT32 lTimeOffset) PURE; /************************************************************************ @@ -1439,7 +1439,7 @@ DECLARE_INTERFACE_(IHXUpdateProperties, IUnknown) * Purpose: * Call this method to update properties */ - STDMETHOD(UpdatePlayTimes) (THIS_ + STDQT_METHOD(UpdatePlayTimes) (THIS_ IHXValues* pProps) PURE; }; @@ -1469,7 +1469,7 @@ DECLARE_INTERFACE_(IHXUpdateProperties2, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1483,7 +1483,7 @@ DECLARE_INTERFACE_(IHXUpdateProperties2, IUnknown) * Purpose: * Call this method to update the stream header */ - STDMETHOD(UpdateHeader) (THIS_ + STDQT_METHOD(UpdateHeader) (THIS_ IHXValues* pProps) PURE; }; // $EndPrivate. @@ -1514,7 +1514,7 @@ DECLARE_INTERFACE_(IHXPlayerNavigator, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1528,7 +1528,7 @@ DECLARE_INTERFACE_(IHXPlayerNavigator, IUnknown) * Purpose: * Add child player to the current player */ - STDMETHOD(AddChildPlayer) (THIS_ + STDQT_METHOD(AddChildPlayer) (THIS_ IHXPlayer* pPlayer) PURE; /************************************************************************ @@ -1537,7 +1537,7 @@ DECLARE_INTERFACE_(IHXPlayerNavigator, IUnknown) * Purpose: * Remove child player from the current player */ - STDMETHOD(RemoveChildPlayer) (THIS_ + STDQT_METHOD(RemoveChildPlayer) (THIS_ IHXPlayer* pPlayer) PURE; /************************************************************************ @@ -1554,7 +1554,7 @@ DECLARE_INTERFACE_(IHXPlayerNavigator, IUnknown) * Purpose: * Get Nth child player */ - STDMETHOD(GetChildPlayer) (THIS_ + STDQT_METHOD(GetChildPlayer) (THIS_ UINT16 uPlayerIndex, REF(IHXPlayer*) pPlayer) PURE; @@ -1564,7 +1564,7 @@ DECLARE_INTERFACE_(IHXPlayerNavigator, IUnknown) * Purpose: * Set the parent player */ - STDMETHOD(SetParentPlayer) (THIS_ + STDQT_METHOD(SetParentPlayer) (THIS_ IHXPlayer* pPlayer) PURE; /************************************************************************ @@ -1573,7 +1573,7 @@ DECLARE_INTERFACE_(IHXPlayerNavigator, IUnknown) * Purpose: * Remove the parent player */ - STDMETHOD(RemoveParentPlayer) (THIS_ + STDQT_METHOD(RemoveParentPlayer) (THIS_ IHXPlayer* pPlayer) PURE; /************************************************************************ @@ -1582,7 +1582,7 @@ DECLARE_INTERFACE_(IHXPlayerNavigator, IUnknown) * Purpose: * Get the parent player */ - STDMETHOD(GetParentPlayer) (THIS_ + STDQT_METHOD(GetParentPlayer) (THIS_ REF(IHXPlayer*) pPlayer) PURE; }; @@ -1613,7 +1613,7 @@ DECLARE_INTERFACE_(IHXPersistentComponentManager, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1627,7 +1627,7 @@ DECLARE_INTERFACE_(IHXPersistentComponentManager, IUnknown) * Purpose: * create persistent component */ - STDMETHOD(CreatePersistentComponent) (THIS_ + STDQT_METHOD(CreatePersistentComponent) (THIS_ REF(IHXPersistentComponent*) pPersistentComponent) PURE; @@ -1637,7 +1637,7 @@ DECLARE_INTERFACE_(IHXPersistentComponentManager, IUnknown) * Purpose: * add persistent component */ - STDMETHOD(AddPersistentComponent) (THIS_ + STDQT_METHOD(AddPersistentComponent) (THIS_ IHXPersistentComponent* pPersistentComponent) PURE; /************************************************************************ @@ -1646,7 +1646,7 @@ DECLARE_INTERFACE_(IHXPersistentComponentManager, IUnknown) * Purpose: * remove persistent component */ - STDMETHOD(RemovePersistentComponent) (THIS_ + STDQT_METHOD(RemovePersistentComponent) (THIS_ UINT32 ulPersistentComponentID) PURE; /************************************************************************ @@ -1655,7 +1655,7 @@ DECLARE_INTERFACE_(IHXPersistentComponentManager, IUnknown) * Purpose: * get persistent component information */ - STDMETHOD(GetPersistentComponent) (THIS_ + STDQT_METHOD(GetPersistentComponent) (THIS_ UINT32 ulPersistentComponentID, REF(IHXPersistentComponent*) pPersistentComponent) PURE; @@ -1665,7 +1665,7 @@ DECLARE_INTERFACE_(IHXPersistentComponentManager, IUnknown) * Purpose: * get persistent component information */ - STDMETHOD(AttachPersistentComponentLayout) (THIS_ + STDQT_METHOD(AttachPersistentComponentLayout) (THIS_ IUnknown* pLSG, IHXValues* pProps) PURE; }; @@ -1696,7 +1696,7 @@ DECLARE_INTERFACE_(IHXPersistentComponent, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1710,7 +1710,7 @@ DECLARE_INTERFACE_(IHXPersistentComponent, IUnknown) * Purpose: * initialize persistent component */ - STDMETHOD(Init) (THIS_ + STDQT_METHOD(Init) (THIS_ IHXPersistentRenderer* pPersistentRenderer) PURE; /************************************************************************ @@ -1719,7 +1719,7 @@ DECLARE_INTERFACE_(IHXPersistentComponent, IUnknown) * Purpose: * add renderer advise sink */ - STDMETHOD(AddRendererAdviseSink) (THIS_ + STDQT_METHOD(AddRendererAdviseSink) (THIS_ IHXRendererAdviseSink* pSink) PURE; /************************************************************************ @@ -1728,7 +1728,7 @@ DECLARE_INTERFACE_(IHXPersistentComponent, IUnknown) * Purpose: * remove renderer advise sink */ - STDMETHOD(RemoveRendererAdviseSink) (THIS_ + STDQT_METHOD(RemoveRendererAdviseSink) (THIS_ IHXRendererAdviseSink* pSink) PURE; /************************************************************************ @@ -1737,7 +1737,7 @@ DECLARE_INTERFACE_(IHXPersistentComponent, IUnknown) * Purpose: * add renderer advise sink */ - STDMETHOD(AddGroupSink) (THIS_ + STDQT_METHOD(AddGroupSink) (THIS_ IHXGroupSink* pSink) PURE; /************************************************************************ @@ -1746,7 +1746,7 @@ DECLARE_INTERFACE_(IHXPersistentComponent, IUnknown) * Purpose: * remove renderer advise sink */ - STDMETHOD(RemoveGroupSink) (THIS_ + STDQT_METHOD(RemoveGroupSink) (THIS_ IHXGroupSink* pSink) PURE; /************************************************************************ @@ -1755,7 +1755,7 @@ DECLARE_INTERFACE_(IHXPersistentComponent, IUnknown) * Purpose: * get persistent renderer */ - STDMETHOD(GetPersistentRenderer) (THIS_ + STDQT_METHOD(GetPersistentRenderer) (THIS_ REF(IHXPersistentRenderer*) pPersistentRenderer) PURE; /************************************************************************ @@ -1764,7 +1764,7 @@ DECLARE_INTERFACE_(IHXPersistentComponent, IUnknown) * Purpose: * get persistent component properties */ - STDMETHOD(GetPersistentProperties) (THIS_ + STDQT_METHOD(GetPersistentProperties) (THIS_ REF(IHXValues*) pProperties) PURE; }; @@ -1797,7 +1797,7 @@ DECLARE_INTERFACE_(IHXClientStatisticsGranularity, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1811,7 +1811,7 @@ DECLARE_INTERFACE_(IHXClientStatisticsGranularity, IUnknown) * Purpose: * Set the granularity */ - STDMETHOD(SetStatsGranularity) (THIS_ ULONG32 ulGranularity) PURE; + STDQT_METHOD(SetStatsGranularity) (THIS_ ULONG32 ulGranularity) PURE; }; // $EndPrivate. @@ -1850,7 +1850,7 @@ DECLARE_INTERFACE_(IHXSourceBufferingStats, IUnknown) * Get the current buffering information */ - STDMETHOD(GetCurrentBuffering) (THIS_ UINT16 uStreamNumber, + STDQT_METHOD(GetCurrentBuffering) (THIS_ UINT16 uStreamNumber, REF(INT64) llLowestTimestamp, REF(INT64) llHighestTimestamp, REF(UINT32) ulNumBytes, @@ -1889,7 +1889,7 @@ DECLARE_INTERFACE_(IHXSourceBufferingStats2, IHXSourceBufferingStats) * Purpose: * Get the amount of buffering in the transport */ - STDMETHOD(GetCurrentBuffering) (THIS_ UINT16 uStreamNumber, + STDQT_METHOD(GetCurrentBuffering) (THIS_ UINT16 uStreamNumber, REF(INT64) llLowestTimestamp, REF(INT64) llHighestTimestamp, REF(UINT32) ulNumBytes, @@ -1904,7 +1904,7 @@ DECLARE_INTERFACE_(IHXSourceBufferingStats2, IHXSourceBufferingStats) * the renderer */ - STDMETHOD(GetTotalBuffering) (THIS_ UINT16 uStreamNumber, + STDQT_METHOD(GetTotalBuffering) (THIS_ UINT16 uStreamNumber, REF(INT64) llLowestTimestamp, REF(INT64) llHighestTimestamp, REF(UINT32) ulNumBytes, @@ -1942,7 +1942,7 @@ DECLARE_INTERFACE_(IHXSourceLatencyStats, IUnknown) * Purpose: * set the live sync start time */ - STDMETHOD(SetLiveSyncOffset) (THIS_ UINT32 ulLiveSyncStartTime) PURE; + STDQT_METHOD(SetLiveSyncOffset) (THIS_ UINT32 ulLiveSyncStartTime) PURE; /************************************************************************ * Method: @@ -1951,7 +1951,7 @@ DECLARE_INTERFACE_(IHXSourceLatencyStats, IUnknown) * call this for each arriving packet! */ - STDMETHOD(NewPacketTimeStamp) (THIS_ UINT32 ulDueTimeStamp) PURE; + STDQT_METHOD(NewPacketTimeStamp) (THIS_ UINT32 ulDueTimeStamp) PURE; /************************************************************************ * Method: @@ -1960,7 +1960,7 @@ DECLARE_INTERFACE_(IHXSourceLatencyStats, IUnknown) * call this for each arriving packet! */ - STDMETHOD(GetLatencyStats) (THIS_ + STDQT_METHOD(GetLatencyStats) (THIS_ REF(UINT32) ulAverageLatency, REF(UINT32) ulMinimumLatency, REF(UINT32) ulMaximumLatency ) PURE; @@ -1973,7 +1973,7 @@ DECLARE_INTERFACE_(IHXSourceLatencyStats, IUnknown) * call this for each arriving packet! */ - STDMETHOD(ResetLatencyStats) (THIS_ ) PURE; + STDQT_METHOD(ResetLatencyStats) (THIS_ ) PURE; }; @@ -2010,7 +2010,7 @@ DECLARE_INTERFACE_(IHXPlayerPresentation, IUnknown) * Call this method to close the player's current presentation. This will free * all resources associated with the current presentation. */ - STDMETHOD(ClosePresentation) (THIS) PURE; + STDQT_METHOD(ClosePresentation) (THIS) PURE; }; // $EndPrivate. @@ -2047,7 +2047,7 @@ DECLARE_INTERFACE_(IHXCoreMutex, IUnknown) * Purpose: * Call this method to lock the client engine's core mutex. */ - STDMETHOD(LockCoreMutex) (THIS) PURE; + STDQT_METHOD(LockCoreMutex) (THIS) PURE; /************************************************************************ * Method: @@ -2055,7 +2055,7 @@ DECLARE_INTERFACE_(IHXCoreMutex, IUnknown) * Purpose: * Call this method to unlock the client engine's core mutex. */ - STDMETHOD(UnlockCoreMutex) (THIS) PURE; + STDQT_METHOD(UnlockCoreMutex) (THIS) PURE; }; @@ -2091,7 +2091,7 @@ DECLARE_INTERFACE_(IHXMacBlitMutex, IUnknown) * Purpose: * Call this method to lock the client engine's core mutex. */ - STDMETHOD(LockMacBlitMutex) (THIS) PURE; + STDQT_METHOD(LockMacBlitMutex) (THIS) PURE; /************************************************************************ * Method: @@ -2099,7 +2099,7 @@ DECLARE_INTERFACE_(IHXMacBlitMutex, IUnknown) * Purpose: * Call this method to unlock the client engine's core mutex. */ - STDMETHOD(UnlockMacBlitMutex) (THIS) PURE; + STDQT_METHOD(UnlockMacBlitMutex) (THIS) PURE; }; // $EndPrivate. diff --git a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxengin.h b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxengin.h index cc4d1b49..010a58a4 100644 --- a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxengin.h +++ b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxengin.h @@ -104,7 +104,7 @@ DECLARE_INTERFACE_(IHXCallback, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -123,7 +123,7 @@ DECLARE_INTERFACE_(IHXCallback, IUnknown) * This is the function that will be called when a callback is * to be executed. */ - STDMETHOD(Func) (THIS) PURE; + STDQT_METHOD(Func) (THIS) PURE; }; @@ -162,7 +162,7 @@ DECLARE_INTERFACE_(IHXScheduler, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -202,7 +202,7 @@ DECLARE_INTERFACE_(IHXScheduler, IUnknown) * Purpose: * Remove a callback from the scheduler. */ - STDMETHOD(Remove) (THIS_ + STDQT_METHOD(Remove) (THIS_ CallbackHandle Handle) PURE; /************************************************************************ @@ -242,7 +242,7 @@ DECLARE_INTERFACE_(IHXTCPResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -260,7 +260,7 @@ DECLARE_INTERFACE_(IHXTCPResponse, IUnknown) * Purpose: * A Connect operation has been completed or an error has occurred. */ - STDMETHOD(ConnectDone) (THIS_ + STDQT_METHOD(ConnectDone) (THIS_ HX_RESULT status) PURE; /************************************************************************ @@ -270,7 +270,7 @@ DECLARE_INTERFACE_(IHXTCPResponse, IUnknown) * A Read operation has been completed or an error has occurred. * The data is returned in the IHXBuffer. */ - STDMETHOD(ReadDone) (THIS_ + STDQT_METHOD(ReadDone) (THIS_ HX_RESULT status, IHXBuffer* pBuffer) PURE; @@ -281,7 +281,7 @@ DECLARE_INTERFACE_(IHXTCPResponse, IUnknown) * This is the response method for WantWrite. * If HX_RESULT is ok, then the TCP channel is ok to Write to. */ - STDMETHOD(WriteReady) (THIS_ + STDQT_METHOD(WriteReady) (THIS_ HX_RESULT status) PURE; /************************************************************************ @@ -291,7 +291,7 @@ DECLARE_INTERFACE_(IHXTCPResponse, IUnknown) * This method is called to inform you that the TCP channel has * been closed by the peer or closed due to error. */ - STDMETHOD(Closed) (THIS_ + STDQT_METHOD(Closed) (THIS_ HX_RESULT status) PURE; }; @@ -322,7 +322,7 @@ DECLARE_INTERFACE_(IHXTCPSocket, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -337,27 +337,27 @@ DECLARE_INTERFACE_(IHXTCPSocket, IUnknown) * */ - STDMETHOD(Init) (THIS_ + STDQT_METHOD(Init) (THIS_ IHXTCPResponse* /*IN*/ pTCPResponse) PURE; - STDMETHOD(SetResponse) (THIS_ + STDQT_METHOD(SetResponse) (THIS_ IHXTCPResponse* pTCPResponse) PURE; - STDMETHOD(Bind) (THIS_ + STDQT_METHOD(Bind) (THIS_ UINT32 ulLocalAddr, UINT16 nPort) PURE; /* * pDestination is a string containing host name or dotted-ip notation */ - STDMETHOD(Connect) (THIS_ + STDQT_METHOD(Connect) (THIS_ const char* pDestination, UINT16 nPort) PURE; - STDMETHOD(Read) (THIS_ + STDQT_METHOD(Read) (THIS_ UINT16 Size) PURE; - STDMETHOD(Write) (THIS_ + STDQT_METHOD(Write) (THIS_ IHXBuffer* pBuffer) PURE; /************************************************************************ @@ -371,7 +371,7 @@ DECLARE_INTERFACE_(IHXTCPSocket, IUnknown) * written to, the response interfaces WriteReady method will be * called. */ - STDMETHOD(WantWrite) (THIS) PURE; + STDQT_METHOD(WantWrite) (THIS) PURE; /************************************************************************ * Method: @@ -380,10 +380,10 @@ DECLARE_INTERFACE_(IHXTCPSocket, IUnknown) * Returns the address of the other end of the TCP socket as a * ULONG32 in local host order */ - STDMETHOD(GetForeignAddress) (THIS_ + STDQT_METHOD(GetForeignAddress) (THIS_ REF(ULONG32) lAddress) PURE; - STDMETHOD(GetLocalAddress) (THIS_ + STDQT_METHOD(GetLocalAddress) (THIS_ REF(ULONG32) lAddress) PURE; /************************************************************************ @@ -393,10 +393,10 @@ DECLARE_INTERFACE_(IHXTCPSocket, IUnknown) * Returns the port of the other end of the TCP socket in local * host order. */ - STDMETHOD(GetForeignPort) (THIS_ + STDQT_METHOD(GetForeignPort) (THIS_ REF(UINT16) port) PURE; - STDMETHOD(GetLocalPort) (THIS_ + STDQT_METHOD(GetLocalPort) (THIS_ REF(UINT16) port) PURE; }; @@ -425,7 +425,7 @@ DECLARE_INTERFACE_(IHXTCPSecureSocket, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -436,7 +436,7 @@ DECLARE_INTERFACE_(IHXTCPSecureSocket, IUnknown) /* * IHXTCPSecureSocket method */ - STDMETHOD(SetSecure) (THIS_ + STDQT_METHOD(SetSecure) (THIS_ HXBOOL bSecure) PURE; }; // $EndPrivate. @@ -464,7 +464,7 @@ DECLARE_INTERFACE_(IHXSSL, IUnknown) * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -476,11 +476,11 @@ DECLARE_INTERFACE_(IHXSSL, IUnknown) * */ - STDMETHOD(Initialize) (THIS) PURE; + STDQT_METHOD(Initialize) (THIS) PURE; - STDMETHOD(Shutdown) (THIS) PURE; + STDQT_METHOD(Shutdown) (THIS) PURE; - STDMETHOD(PostConnect) (THIS_ + STDQT_METHOD(PostConnect) (THIS_ LONG32 nSocketNumber) PURE; STDMETHOD_(LONG32, Read) (THIS_ @@ -493,10 +493,10 @@ DECLARE_INTERFACE_(IHXSSL, IUnknown) void* buff, LONG32 buffLen) PURE; - STDMETHOD(Close) (THIS_ + STDQT_METHOD(Close) (THIS_ LONG32 nSocketNumber) PURE; - STDMETHOD(SetCallbacks) (THIS_ + STDQT_METHOD(SetCallbacks) (THIS_ void* readCallback, void* writeCallback, void* closeCallback) PURE; @@ -537,7 +537,7 @@ DECLARE_INTERFACE_(IHXBufferedSocket, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -549,12 +549,12 @@ DECLARE_INTERFACE_(IHXBufferedSocket, IUnknown) * IHXTCPSocket methods */ - STDMETHOD(BufferedWrite) (THIS_ + STDQT_METHOD(BufferedWrite) (THIS_ IHXBuffer* pBuffer) PURE; - STDMETHOD(FlushWrite) (THIS) PURE; + STDQT_METHOD(FlushWrite) (THIS) PURE; - STDMETHOD(SetDesiredPacketSize) (THIS_ + STDQT_METHOD(SetDesiredPacketSize) (THIS_ UINT32 ulPacketSize) PURE; }; @@ -588,7 +588,7 @@ DECLARE_INTERFACE_(IHXListenResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -600,7 +600,7 @@ DECLARE_INTERFACE_(IHXListenResponse, IUnknown) * IHXListenResponse methods */ - STDMETHOD(NewConnection) (THIS_ + STDQT_METHOD(NewConnection) (THIS_ HX_RESULT status, IHXTCPSocket* pTCPSocket) PURE; }; @@ -632,7 +632,7 @@ DECLARE_INTERFACE_(IHXListenSocket, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -644,7 +644,7 @@ DECLARE_INTERFACE_(IHXListenSocket, IUnknown) * IHXListenSocket methods */ - STDMETHOD(Init) (THIS_ + STDQT_METHOD(Init) (THIS_ UINT32 ulLocalAddr, UINT16 port, IHXListenResponse* /*IN*/ pListenResponse @@ -679,7 +679,7 @@ DECLARE_INTERFACE_(IHXNetworkServices, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -697,7 +697,7 @@ DECLARE_INTERFACE_(IHXNetworkServices, IUnknown) * Purpose: * Create a new TCP socket. */ - STDMETHOD(CreateTCPSocket) (THIS_ + STDQT_METHOD(CreateTCPSocket) (THIS_ IHXTCPSocket** /*OUT*/ ppTCPSocket) PURE; /************************************************************************ @@ -706,7 +706,7 @@ DECLARE_INTERFACE_(IHXNetworkServices, IUnknown) * Purpose: * Create a new UDP socket. */ - STDMETHOD(CreateUDPSocket) (THIS_ + STDQT_METHOD(CreateUDPSocket) (THIS_ IHXUDPSocket** /*OUT*/ ppUDPSocket) PURE; /************************************************************************ @@ -716,7 +716,7 @@ DECLARE_INTERFACE_(IHXNetworkServices, IUnknown) * Create a new TCP socket that will listen for connections on a * particular port. */ - STDMETHOD(CreateListenSocket) (THIS_ + STDQT_METHOD(CreateListenSocket) (THIS_ IHXListenSocket** /*OUT*/ ppListenSocket ) PURE; @@ -726,7 +726,7 @@ DECLARE_INTERFACE_(IHXNetworkServices, IUnknown) * Purpose: * Create a new resolver that can lookup host names */ - STDMETHOD(CreateResolver) (THIS_ + STDQT_METHOD(CreateResolver) (THIS_ IHXResolver** /*OUT*/ ppResolver) PURE; }; @@ -762,7 +762,7 @@ DECLARE_INTERFACE_(IHXNetworkServices2, IHXNetworkServices) * Purpose: * Create a new local bound TCP socket. */ - STDMETHOD(CreateLBoundTCPSocket) (THIS_ + STDQT_METHOD(CreateLBoundTCPSocket) (THIS_ IHXTCPSocket** /*OUT*/ ppTCPSocket) PURE; }; @@ -795,7 +795,7 @@ DECLARE_INTERFACE_(IHXUDPResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -807,7 +807,7 @@ DECLARE_INTERFACE_(IHXUDPResponse, IUnknown) * IHXUDPResponse methods */ - STDMETHOD(ReadDone) (THIS_ + STDQT_METHOD(ReadDone) (THIS_ HX_RESULT status, IHXBuffer* pBuffer, ULONG32 ulAddr, @@ -841,7 +841,7 @@ DECLARE_INTERFACE_(IHXUDPSocket, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -855,34 +855,34 @@ DECLARE_INTERFACE_(IHXUDPSocket, IUnknown) * Network addresses and ports are in native byte order */ - STDMETHOD(Init) (THIS_ + STDQT_METHOD(Init) (THIS_ ULONG32 ulAddr, UINT16 nPort, IHXUDPResponse* pUDPResponse) PURE; - STDMETHOD(Bind) (THIS_ + STDQT_METHOD(Bind) (THIS_ UINT32 ulLocalAddr, UINT16 nPort) PURE; - STDMETHOD(Read) (THIS_ + STDQT_METHOD(Read) (THIS_ UINT16 Size) PURE; - STDMETHOD(Write) (THIS_ + STDQT_METHOD(Write) (THIS_ IHXBuffer* pBuffer) PURE; - STDMETHOD(WriteTo) (THIS_ + STDQT_METHOD(WriteTo) (THIS_ ULONG32 ulAddr, UINT16 nPort, IHXBuffer* pBuffer) PURE; - STDMETHOD(GetLocalPort) (THIS_ + STDQT_METHOD(GetLocalPort) (THIS_ REF(UINT16) port) PURE; - STDMETHOD(JoinMulticastGroup) (THIS_ + STDQT_METHOD(JoinMulticastGroup) (THIS_ ULONG32 ulMulticastAddr, ULONG32 ulInterfaceAddr) PURE; - STDMETHOD(LeaveMulticastGroup) (THIS_ + STDQT_METHOD(LeaveMulticastGroup) (THIS_ ULONG32 ulMulticastAddr, ULONG32 ulInterfaceAddr) PURE; }; @@ -914,7 +914,7 @@ DECLARE_INTERFACE_(IHXResolver, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -926,10 +926,10 @@ DECLARE_INTERFACE_(IHXResolver, IUnknown) * IHXResolver methods */ - STDMETHOD(Init) (THIS_ + STDQT_METHOD(Init) (THIS_ IHXResolverResponse* pResponse) PURE; - STDMETHOD(GetHostByName) (THIS_ + STDQT_METHOD(GetHostByName) (THIS_ const char* pHostName) PURE; }; @@ -961,7 +961,7 @@ DECLARE_INTERFACE_(IHXResolverResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -973,7 +973,7 @@ DECLARE_INTERFACE_(IHXResolverResponse, IUnknown) * IHXResolverResponse methods */ - STDMETHOD(GetHostByNameDone) (THIS_ + STDQT_METHOD(GetHostByNameDone) (THIS_ HX_RESULT status, ULONG32 ulAddr) PURE; }; @@ -1010,7 +1010,7 @@ DECLARE_INTERFACE_(IHXInterruptSafe, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1063,7 +1063,7 @@ DECLARE_INTERFACE_(IHXAsyncIOSelection, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1084,7 +1084,7 @@ DECLARE_INTERFACE_(IHXAsyncIOSelection, IUnknown) * exception. This function is only available on Unix, and is * intended to replace the functionality of select(). */ - STDMETHOD(Add) (THIS_ + STDQT_METHOD(Add) (THIS_ IHXCallback* pCallback, INT32 lFileDescriptor, UINT32 ulType) PURE; @@ -1098,7 +1098,7 @@ DECLARE_INTERFACE_(IHXAsyncIOSelection, IUnknown) * This function is only available on Unix, and is intended to * replace the functionality of select(). */ - STDMETHOD(Remove) (THIS_ + STDQT_METHOD(Remove) (THIS_ INT32 lFileDescriptor, UINT32 ulType) PURE; }; @@ -1131,7 +1131,7 @@ DECLARE_INTERFACE_(IHXUDPMulticastInit, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1153,7 +1153,7 @@ DECLARE_INTERFACE_(IHXUDPMulticastInit, IUnknown) * the number of routers specified in the ulTTL parameter. */ - STDMETHOD(InitMulticast) (THIS_ + STDQT_METHOD(InitMulticast) (THIS_ UINT8 chTTL) PURE; }; @@ -1187,7 +1187,7 @@ DECLARE_INTERFACE_(IHXInterruptState, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1214,7 +1214,7 @@ DECLARE_INTERFACE_(IHXInterruptState, IUnknown) * Purpose: * This function is called when starting a deferred/interrupt task */ - STDMETHOD(EnterInterruptState) (THIS) PURE; + STDQT_METHOD(EnterInterruptState) (THIS) PURE; /************************************************************************ * Method: @@ -1222,7 +1222,7 @@ DECLARE_INTERFACE_(IHXInterruptState, IUnknown) * Purpose: * This function is called when leaving a deferred/interrupt task */ - STDMETHOD(LeaveInterruptState) (THIS) PURE; + STDQT_METHOD(LeaveInterruptState) (THIS) PURE; /************************************************************************ * Method: @@ -1231,7 +1231,7 @@ DECLARE_INTERFACE_(IHXInterruptState, IUnknown) * This function can be called to enable/disable interrupt time * processsing */ - STDMETHOD(EnableInterrupt) (THIS_ + STDQT_METHOD(EnableInterrupt) (THIS_ HXBOOL bEnable) PURE; /************************************************************************ @@ -1277,7 +1277,7 @@ DECLARE_INTERFACE_(IHXOptimizedScheduler, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1317,7 +1317,7 @@ DECLARE_INTERFACE_(IHXOptimizedScheduler, IUnknown) * Purpose: * Remove a callback from the scheduler. */ - STDMETHOD(Remove) (THIS_ + STDQT_METHOD(Remove) (THIS_ CallbackHandle Handle) PURE; /************************************************************************ @@ -1357,7 +1357,7 @@ DECLARE_INTERFACE_(IHXThreadSafeScheduler, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1398,7 +1398,7 @@ DECLARE_INTERFACE_(IHXThreadSafeScheduler, IUnknown) * Purpose: * Remove a callback from the scheduler. */ - STDMETHOD(Remove) (THIS_ + STDQT_METHOD(Remove) (THIS_ CallbackHandle Handle) PURE; }; @@ -1428,7 +1428,7 @@ DECLARE_INTERFACE_(IHXProcessEntryPoint, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1436,7 +1436,7 @@ DECLARE_INTERFACE_(IHXProcessEntryPoint, IUnknown) STDMETHOD_(ULONG32,Release) (THIS) PURE; - STDMETHOD(Func) (THIS_ + STDQT_METHOD(Func) (THIS_ IUnknown* pContext) PURE; }; @@ -1467,7 +1467,7 @@ DECLARE_INTERFACE_(IHXProcess, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1475,7 +1475,7 @@ DECLARE_INTERFACE_(IHXProcess, IUnknown) STDMETHOD_(ULONG32,Release) (THIS) PURE; - STDMETHOD(Start) (THIS_ + STDQT_METHOD(Start) (THIS_ const char* pProcessName, IHXProcessEntryPoint* pEntryPoint) PURE; }; @@ -1511,7 +1511,7 @@ DECLARE_INTERFACE_(IHXLoadBalancedListen, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1534,7 +1534,7 @@ DECLARE_INTERFACE_(IHXLoadBalancedListen, IUnknown) * two completely different plugins to listen on the same port using * the load balanced listener. */ - STDMETHOD(SetID) (THIS_ + STDQT_METHOD(SetID) (THIS_ REFIID ID) PURE; /************************************************************************ @@ -1545,7 +1545,7 @@ DECLARE_INTERFACE_(IHXLoadBalancedListen, IUnknown) * than reserve limit descriptors / sockets are left then a new * instance of the plugin will be created. */ - STDMETHOD(SetReserveLimit) (THIS_ + STDQT_METHOD(SetReserveLimit) (THIS_ UINT32 ulDescriptors, UINT32 ulSockets) PURE; }; @@ -1583,7 +1583,7 @@ DECLARE_INTERFACE_(IHXOverrideDefaultServices, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1602,7 +1602,7 @@ DECLARE_INTERFACE_(IHXOverrideDefaultServices, IUnknown) * Override default services provided by the G2 system. * */ - STDMETHOD(OverrideServices) (THIS_ + STDQT_METHOD(OverrideServices) (THIS_ IUnknown* pContext) PURE; }; @@ -1642,7 +1642,7 @@ DECLARE_INTERFACE_(IHXSetSocketOption, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1654,7 +1654,7 @@ DECLARE_INTERFACE_(IHXSetSocketOption, IUnknown) * IHXListenSocket methods */ - STDMETHOD(SetOption) (THIS_ + STDQT_METHOD(SetOption) (THIS_ HX_SOCKET_OPTION option, UINT32 ulValue) PURE; }; @@ -1786,7 +1786,7 @@ DECLARE_INTERFACE_(IHXThreadSafeMethods, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1840,7 +1840,7 @@ DECLARE_INTERFACE_(IHXMutex, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1853,11 +1853,11 @@ DECLARE_INTERFACE_(IHXMutex, IUnknown) */ /* XXXSMPNOW Comments */ - STDMETHOD(Lock) (THIS) PURE; + STDQT_METHOD(Lock) (THIS) PURE; - STDMETHOD(TryLock) (THIS) PURE; + STDQT_METHOD(TryLock) (THIS) PURE; - STDMETHOD(Unlock) (THIS) PURE; + STDQT_METHOD(Unlock) (THIS) PURE; }; // $Private: @@ -1887,7 +1887,7 @@ DECLARE_INTERFACE_(IHXFastPathNetWrite, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1900,7 +1900,7 @@ DECLARE_INTERFACE_(IHXFastPathNetWrite, IUnknown) * */ - STDMETHOD(FastWrite) (THIS_ + STDQT_METHOD(FastWrite) (THIS_ const UINT8* pBuffer, UINT32 ulLen) PURE; }; @@ -1929,7 +1929,7 @@ DECLARE_INTERFACE_(IHXWouldBlockResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1950,8 +1950,8 @@ DECLARE_INTERFACE_(IHXWouldBlockResponse, IUnknown) * WouldBlockCleared call. HXR_anythingelse to ignore. */ - STDMETHOD(WouldBlock) (THIS_ UINT32 id) PURE; - STDMETHOD(WouldBlockCleared)(THIS_ UINT32 id) PURE; + STDQT_METHOD(WouldBlock) (THIS_ UINT32 id) PURE; + STDQT_METHOD(WouldBlockCleared)(THIS_ UINT32 id) PURE; }; @@ -1981,7 +1981,7 @@ DECLARE_INTERFACE_(IHXWouldBlock, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1994,7 +1994,7 @@ DECLARE_INTERFACE_(IHXWouldBlock, IUnknown) * */ - STDMETHOD(WantWouldBlock) (THIS_ + STDQT_METHOD(WantWouldBlock) (THIS_ IHXWouldBlockResponse*, UINT32 id) PURE; }; @@ -2026,7 +2026,7 @@ DECLARE_INTERFACE_(IHXSharedUDPServices, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -2037,11 +2037,11 @@ DECLARE_INTERFACE_(IHXSharedUDPServices, IUnknown) /* * IHXSharedUDPServices methods */ - STDMETHOD(RegisterSharedResponse) (THIS_ + STDQT_METHOD(RegisterSharedResponse) (THIS_ IHXUDPResponse* response, UINT16 sPortEnum) PURE; - STDMETHOD(UnregisterSharedResponse) (THIS) PURE; + STDQT_METHOD(UnregisterSharedResponse) (THIS) PURE; STDMETHOD_(UINT16, GetSharedPort) (THIS) PURE; @@ -2075,7 +2075,7 @@ DECLARE_INTERFACE_(IHXThreadLocal, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -2130,7 +2130,7 @@ DECLARE_INTERFACE_(IHXMemoryServices, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -2161,7 +2161,7 @@ DECLARE_INTERFACE_(IHXMemoryServices, IUnknown) * 0x00000002 do rudimentary checks on internal SharedMemory data arrays. * */ - STDMETHOD(ValidateMemory) (THIS_ + STDQT_METHOD(ValidateMemory) (THIS_ INT32 lStartPage, INT32 lPages, UINT32 ulFlags) PURE; @@ -2198,7 +2198,7 @@ DECLARE_INTERFACE_(IHXSetPrivateSocketOption, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -2210,7 +2210,7 @@ DECLARE_INTERFACE_(IHXSetPrivateSocketOption, IUnknown) * IHXSetPrivateSocketOption methods */ - STDMETHOD(SetOption) (THIS_ + STDQT_METHOD(SetOption) (THIS_ HX_PRIVATE_SOCKET_OPTION option, UINT32 ulValue) PURE; }; @@ -2331,7 +2331,7 @@ DECLARE_INTERFACE_(IHXNetInterfaces, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -2342,18 +2342,18 @@ DECLARE_INTERFACE_(IHXNetInterfaces, IUnknown) /* * IHXNetworkInterfaces methods */ - STDMETHOD(UpdateNetInterfaces) (THIS) PURE; + STDQT_METHOD(UpdateNetInterfaces) (THIS) PURE; STDMETHOD_(UINT32, GetNumOfNetInterfaces) (THIS) PURE; - STDMETHOD(GetNetInterfaces) (THIS_ + STDQT_METHOD(GetNetInterfaces) (THIS_ UINT16 lIndex, REF(NIInfo*) pNIInfo) PURE; - STDMETHOD(AddAdviseSink) (THIS_ + STDQT_METHOD(AddAdviseSink) (THIS_ IHXNetInterfacesAdviseSink* pSink) PURE; - STDMETHOD(RemoveAdviseSink) (THIS_ + STDQT_METHOD(RemoveAdviseSink) (THIS_ IHXNetInterfacesAdviseSink* pSink) PURE; }; @@ -2382,7 +2382,7 @@ DECLARE_INTERFACE_(IHXNetInterfacesAdviseSink, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -2393,7 +2393,7 @@ DECLARE_INTERFACE_(IHXNetInterfacesAdviseSink, IUnknown) /* * IHXNetInterfacesAdviseSink methods */ - STDMETHOD(NetInterfacesUpdated) (THIS) PURE; + STDQT_METHOD(NetInterfacesUpdated) (THIS) PURE; }; // $EndPrivate. @@ -2424,7 +2424,7 @@ DECLARE_INTERFACE_(IHXNetworkInterfaceEnumerator, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; @@ -2440,7 +2440,7 @@ DECLARE_INTERFACE_(IHXNetworkInterfaceEnumerator, IUnknown) * If a buffer passed in is too small, it will return * HXR_BUFFERTOOSMALL with ulNumInterfaces updated. */ - STDMETHOD(EnumerateInterfaces) (THIS_ + STDQT_METHOD(EnumerateInterfaces) (THIS_ REF(UINT32*) pulInterfaces, REF(UINT32) ulNumInterfaces) PURE; }; @@ -2470,7 +2470,7 @@ DECLARE_INTERFACE_(IHXUDPConnectedSocket, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; @@ -2486,7 +2486,7 @@ DECLARE_INTERFACE_(IHXUDPConnectedSocket, IUnknown) * Connect to the foreign addr and port the socket already knows * about; this is implementation-dependent. */ - STDMETHOD(UDPConnect) (THIS) PURE; + STDQT_METHOD(UDPConnect) (THIS) PURE; /************************************************************************ * Method: @@ -2496,7 +2496,7 @@ DECLARE_INTERFACE_(IHXUDPConnectedSocket, IUnknown) * Usage: * Specify the host-ordered foreign addr and port to connect to. */ - STDMETHOD(UDPConnect) (THIS_ ULONG32 ulAddr, UINT16 nPort) PURE; + STDQT_METHOD(UDPConnect) (THIS_ ULONG32 ulAddr, UINT16 nPort) PURE; /************************************************************************ * Method: @@ -2504,7 +2504,7 @@ DECLARE_INTERFACE_(IHXUDPConnectedSocket, IUnknown) * Purpose: * Disconnect the udp socket */ - STDMETHOD(UDPDisconnect) (THIS) PURE; + STDQT_METHOD(UDPDisconnect) (THIS) PURE; /************************************************************************ * Method: @@ -2555,7 +2555,7 @@ DECLARE_INTERFACE_(IHXAutoBWDetection, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -2566,11 +2566,11 @@ DECLARE_INTERFACE_(IHXAutoBWDetection, IUnknown) /* * IHXAutoBWDetection methods */ - STDMETHOD(InitAutoBWDetection) (THIS_ + STDQT_METHOD(InitAutoBWDetection) (THIS_ HXBOOL bEnabled) PURE; - STDMETHOD(AddAutoBWDetectionSink) (THIS_ + STDQT_METHOD(AddAutoBWDetectionSink) (THIS_ IHXAutoBWDetectionAdviseSink* pSink) PURE; - STDMETHOD(RemoveAutoBWDetectionSink) (THIS_ + STDQT_METHOD(RemoveAutoBWDetectionSink) (THIS_ IHXAutoBWDetectionAdviseSink* pSink) PURE; }; @@ -2599,7 +2599,7 @@ DECLARE_INTERFACE_(IHXAutoBWDetectionAdviseSink, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -2610,7 +2610,7 @@ DECLARE_INTERFACE_(IHXAutoBWDetectionAdviseSink, IUnknown) /* * IHXAutoBWDetectionAdviseSink methods */ - STDMETHOD(AutoBWDetectionDone) (THIS_ + STDQT_METHOD(AutoBWDetectionDone) (THIS_ HX_RESULT status, UINT32 ulBW) PURE; }; @@ -2641,7 +2641,7 @@ DECLARE_INTERFACE_(IHXAutoBWCalibration, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -2652,13 +2652,13 @@ DECLARE_INTERFACE_(IHXAutoBWCalibration, IUnknown) /* * IHXAutoBWCalibration methods */ - STDMETHOD(InitAutoBWCalibration) (THIS_ + STDQT_METHOD(InitAutoBWCalibration) (THIS_ IHXValues* pValues) PURE; - STDMETHOD(StartAutoBWCalibration) (THIS) PURE; - STDMETHOD(StopAutoBWCalibration) (THIS) PURE; - STDMETHOD(AddAutoBWCalibrationSink) (THIS_ + STDQT_METHOD(StartAutoBWCalibration) (THIS) PURE; + STDQT_METHOD(StopAutoBWCalibration) (THIS) PURE; + STDQT_METHOD(AddAutoBWCalibrationSink) (THIS_ IHXAutoBWCalibrationAdviseSink* pSink) PURE; - STDMETHOD(RemoveAutoBWCalibrationSink) (THIS_ + STDQT_METHOD(RemoveAutoBWCalibrationSink) (THIS_ IHXAutoBWCalibrationAdviseSink* pSink) PURE; }; @@ -2687,7 +2687,7 @@ DECLARE_INTERFACE_(IHXAutoBWCalibrationAdviseSink, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -2698,9 +2698,9 @@ DECLARE_INTERFACE_(IHXAutoBWCalibrationAdviseSink, IUnknown) /* * IHXAutoBWCalibrationAdviseSink methods */ - STDMETHOD(AutoBWCalibrationStarted) (THIS_ + STDQT_METHOD(AutoBWCalibrationStarted) (THIS_ const char* pszServer) PURE; - STDMETHOD(AutoBWCalibrationDone) (THIS_ + STDQT_METHOD(AutoBWCalibrationDone) (THIS_ HX_RESULT status, UINT32 ulBW) PURE; }; @@ -2729,7 +2729,7 @@ DECLARE_INTERFACE_(IHXConnectionBWAdviseSink, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -2740,7 +2740,7 @@ DECLARE_INTERFACE_(IHXConnectionBWAdviseSink, IUnknown) /* * IHXConnectionBWAdviseSink methods */ - STDMETHOD(NewConnectionBW)(THIS_ UINT32 uConnectionBW) PURE; + STDQT_METHOD(NewConnectionBW)(THIS_ UINT32 uConnectionBW) PURE; }; @@ -2769,7 +2769,7 @@ DECLARE_INTERFACE_(IHXConnectionBWInfo, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -2780,9 +2780,9 @@ DECLARE_INTERFACE_(IHXConnectionBWInfo, IUnknown) /* * IHXConnectionBWInfo methods */ - STDMETHOD(AddABDInfo)(THIS_ IHXAutoBWDetection* pABD, + STDQT_METHOD(AddABDInfo)(THIS_ IHXAutoBWDetection* pABD, IHXPreferredTransport* pPrefTransport) PURE; - STDMETHOD(RemoveABDInfo)(THIS_ IHXAutoBWDetection* pABD) PURE; + STDQT_METHOD(RemoveABDInfo)(THIS_ IHXAutoBWDetection* pABD) PURE; /* * IHXConnectionBWInfo::GetConnectionBW() @@ -2803,10 +2803,10 @@ DECLARE_INTERFACE_(IHXConnectionBWInfo, IUnknown) * HXR_FAILED : No connection BW is available at this time * */ - STDMETHOD(GetConnectionBW)(THIS_ REF(UINT32) uBw, HXBOOL bDetectedBWOnly) PURE; + STDQT_METHOD(GetConnectionBW)(THIS_ REF(UINT32) uBw, HXBOOL bDetectedBWOnly) PURE; - STDMETHOD(AddSink)(THIS_ IHXConnectionBWAdviseSink* pSink) PURE; - STDMETHOD(RemoveSink)(THIS_ IHXConnectionBWAdviseSink* pSink) PURE; + STDQT_METHOD(AddSink)(THIS_ IHXConnectionBWAdviseSink* pSink) PURE; + STDQT_METHOD(RemoveSink)(THIS_ IHXConnectionBWAdviseSink* pSink) PURE; }; #endif /* _HXENGIN_H_ */ diff --git a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxerror.h b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxerror.h index b3d318c7..b01ad60d 100644 --- a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxerror.h +++ b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxerror.h @@ -72,7 +72,7 @@ DECLARE_INTERFACE_(IHXErrorMessages, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -118,7 +118,7 @@ DECLARE_INTERFACE_(IHXErrorMessages, IUnknown) * User specific more info URL string. * */ - STDMETHOD(Report) (THIS_ + STDQT_METHOD(Report) (THIS_ const UINT8 unSeverity, HX_RESULT ulHXCode, const ULONG32 ulUserCode, @@ -166,7 +166,7 @@ DECLARE_INTERFACE_(IHXErrorSink, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -189,7 +189,7 @@ DECLARE_INTERFACE_(IHXErrorSink, IUnknown) * The meaning of the arguments is exactly as described in * hxerror.h */ - STDMETHOD(ErrorOccurred) (THIS_ + STDQT_METHOD(ErrorOccurred) (THIS_ const UINT8 unSeverity, const ULONG32 ulHXCode, const ULONG32 ulUserCode, @@ -226,7 +226,7 @@ DECLARE_INTERFACE_(IHXErrorSinkControl, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -253,7 +253,7 @@ DECLARE_INTERFACE_(IHXErrorSinkControl, IUnknown) * * The default severity range is HXLOG_EMERG to HXLOG_INFO (0-6). */ - STDMETHOD(AddErrorSink) (THIS_ + STDQT_METHOD(AddErrorSink) (THIS_ IHXErrorSink* pErrorSink, const UINT8 unLowSeverity, const UINT8 unHighSeverity) PURE; @@ -264,7 +264,7 @@ DECLARE_INTERFACE_(IHXErrorSinkControl, IUnknown) * Purpose: * Call this method to remove an error sink. */ - STDMETHOD(RemoveErrorSink) (THIS_ + STDQT_METHOD(RemoveErrorSink) (THIS_ IHXErrorSink* pErrorSink) PURE; }; diff --git a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxfiles.h b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxfiles.h index f516af6b..ebaeb100 100644 --- a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxfiles.h +++ b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxfiles.h @@ -140,7 +140,7 @@ DECLARE_INTERFACE_(IHXFileObject, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -161,7 +161,7 @@ DECLARE_INTERFACE_(IHXFileObject, IUnknown) * for validity of the object (for example by opening it if it is * a local file). */ - STDMETHOD(Init) (THIS_ + STDQT_METHOD(Init) (THIS_ ULONG32 /*IN*/ ulFlags, IHXFileResponse* /*IN*/ pFileResponse) PURE; @@ -177,7 +177,7 @@ DECLARE_INTERFACE_(IHXFileObject, IUnknown) * core (i.e. when you return control to the RMA core) * */ - STDMETHOD(GetFilename) (THIS_ + STDQT_METHOD(GetFilename) (THIS_ REF(const char*) /*OUT*/ pFilename) PURE; /************************************************************************ @@ -187,7 +187,7 @@ DECLARE_INTERFACE_(IHXFileObject, IUnknown) * Closes the file resource and releases all resources associated * with the object. */ - STDMETHOD(Close) (THIS) PURE; + STDQT_METHOD(Close) (THIS) PURE; /************************************************************************ * Method: @@ -197,7 +197,7 @@ DECLARE_INTERFACE_(IHXFileObject, IUnknown) * and asynchronously returns it to the caller via the * IHXFileResponse interface passed in to Init. */ - STDMETHOD(Read) (THIS_ + STDQT_METHOD(Read) (THIS_ ULONG32 ulCount) PURE; /************************************************************************ @@ -208,7 +208,7 @@ DECLARE_INTERFACE_(IHXFileObject, IUnknown) * the caller via the IHXFileResponse interface passed in to Init, * of the completeness of the operation. */ - STDMETHOD(Write) (THIS_ + STDQT_METHOD(Write) (THIS_ IHXBuffer* pBuffer) PURE; /************************************************************************ @@ -221,7 +221,7 @@ DECLARE_INTERFACE_(IHXFileObject, IUnknown) * If the bRelative flag is TRUE, it is a relative seek; else * an absolute seek. */ - STDMETHOD(Seek) (THIS_ + STDQT_METHOD(Seek) (THIS_ ULONG32 ulOffset, HXBOOL bRelative) PURE; @@ -232,7 +232,7 @@ DECLARE_INTERFACE_(IHXFileObject, IUnknown) * To pass information to the File Object advising it about usage * heuristics. */ - STDMETHOD(Advise) (THIS_ + STDQT_METHOD(Advise) (THIS_ ULONG32 ulInfo) PURE; }; @@ -263,7 +263,7 @@ DECLARE_INTERFACE_(IHXFileObjectExt, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -283,7 +283,7 @@ DECLARE_INTERFACE_(IHXFileObjectExt, IUnknown) * core (i.e. when you return control to the RMA core) * */ - STDMETHOD(GetFullFilename) (THIS_ + STDQT_METHOD(GetFullFilename) (THIS_ REF(IHXBuffer*) /*OUT*/ pFullFilename) PURE; }; @@ -314,7 +314,7 @@ DECLARE_INTERFACE_(IHXFileResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -336,7 +336,7 @@ DECLARE_INTERFACE_(IHXFileResponse, IUnknown) * for the file system, the status HXR_FAILED should be * returned. */ - STDMETHOD(InitDone) (THIS_ + STDQT_METHOD(InitDone) (THIS_ HX_RESULT status) PURE; /************************************************************************ @@ -347,7 +347,7 @@ DECLARE_INTERFACE_(IHXFileResponse, IUnknown) * interface. This method is called by the IHXFileObject when the * close of the file is complete. */ - STDMETHOD(CloseDone) (THIS_ + STDQT_METHOD(CloseDone) (THIS_ HX_RESULT status) PURE; /************************************************************************ @@ -358,7 +358,7 @@ DECLARE_INTERFACE_(IHXFileResponse, IUnknown) * interface. This method is called by the IHXFileObject when the * last read from the file is complete and a buffer is available. */ - STDMETHOD(ReadDone) (THIS_ + STDQT_METHOD(ReadDone) (THIS_ HX_RESULT status, IHXBuffer* pBuffer) PURE; @@ -370,7 +370,7 @@ DECLARE_INTERFACE_(IHXFileResponse, IUnknown) * interface. This method is called by the IHXFileObject when the * last write to the file is complete. */ - STDMETHOD(WriteDone) (THIS_ + STDQT_METHOD(WriteDone) (THIS_ HX_RESULT status) PURE; /************************************************************************ @@ -381,7 +381,7 @@ DECLARE_INTERFACE_(IHXFileResponse, IUnknown) * interface. This method is called by the IHXFileObject when the * last seek in the file is complete. */ - STDMETHOD(SeekDone) (THIS_ + STDQT_METHOD(SeekDone) (THIS_ HX_RESULT status) PURE; }; @@ -411,7 +411,7 @@ DECLARE_INTERFACE_(IHXAdvise, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -431,7 +431,7 @@ DECLARE_INTERFACE_(IHXAdvise, IUnknown) * usage heuristics. It should pass HX_FILERESPONSEADVISE_xxx * flags into this method. */ - STDMETHOD(Advise) (THIS_ ULONG32 ulInfo) PURE; + STDQT_METHOD(Advise) (THIS_ ULONG32 ulInfo) PURE; }; @@ -462,7 +462,7 @@ DECLARE_INTERFACE_(IHXFileSystemObject, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -484,21 +484,21 @@ DECLARE_INTERFACE_(IHXFileSystemObject, IUnknown) * pShortName should be a short, human readable name in the form * of "company-fsname". For example: pShortName = "pn-local". */ - STDMETHOD(GetFileSystemInfo) (THIS_ + STDQT_METHOD(GetFileSystemInfo) (THIS_ REF(const char*) /*OUT*/ pShortName, REF(const char*) /*OUT*/ pProtocol) PURE; - STDMETHOD(InitFileSystem) (THIS_ + STDQT_METHOD(InitFileSystem) (THIS_ IHXValues* pOptions) PURE; - STDMETHOD(CreateFile) (THIS_ + STDQT_METHOD(CreateFile) (THIS_ IUnknown** /*OUT*/ ppFileObject) PURE; /* * The following method is deprecated and should return HXR_NOTIMPL */ - STDMETHOD(CreateDir) (THIS_ + STDQT_METHOD(CreateDir) (THIS_ IUnknown** /*OUT*/ ppDirObject) PURE; }; @@ -530,7 +530,7 @@ DECLARE_INTERFACE_(IHXFileStat, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -542,7 +542,7 @@ DECLARE_INTERFACE_(IHXFileStat, IUnknown) * IHXFileStat methods */ - STDMETHOD(Stat) (THIS_ + STDQT_METHOD(Stat) (THIS_ IHXFileStatResponse* pFileStatResponse ) PURE; }; @@ -574,7 +574,7 @@ DECLARE_INTERFACE_(IHXFileStatResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -586,7 +586,7 @@ DECLARE_INTERFACE_(IHXFileStatResponse, IUnknown) * IHXFileStat methods */ - STDMETHOD(StatDone) (THIS_ + STDQT_METHOD(StatDone) (THIS_ HX_RESULT status, UINT32 ulSize, UINT32 ulCreationTime, @@ -623,7 +623,7 @@ DECLARE_INTERFACE_(IHXFileSystemManager, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -635,7 +635,7 @@ DECLARE_INTERFACE_(IHXFileSystemManager, IUnknown) * IHXFileSystemManager methods */ - STDMETHOD(Init) (THIS_ + STDQT_METHOD(Init) (THIS_ IHXFileSystemManagerResponse* /*IN*/ pFileManagerResponse ) PURE; @@ -643,7 +643,7 @@ DECLARE_INTERFACE_(IHXFileSystemManager, IUnknown) * method in each file system's objects, and returns that object through * FSManagerResponse->FileObjectReady */ - STDMETHOD(GetFileObject) (THIS_ + STDQT_METHOD(GetFileObject) (THIS_ IHXRequest* pRequest, IHXAuthenticator* pAuthenticator) PURE; @@ -653,11 +653,11 @@ DECLARE_INTERFACE_(IHXFileSystemManager, IUnknown) * which is then returned through FileObjectReady. This is especially * useful for those who wish to open a brand new file for writing. */ - STDMETHOD(GetNewFileObject) (THIS_ + STDQT_METHOD(GetNewFileObject) (THIS_ IHXRequest* pRequest, IHXAuthenticator* pAuthenticator) PURE; - STDMETHOD(GetRelativeFileObject) (THIS_ + STDQT_METHOD(GetRelativeFileObject) (THIS_ IUnknown* pOriginalObject, const char* pPath) PURE; @@ -665,7 +665,7 @@ DECLARE_INTERFACE_(IHXFileSystemManager, IUnknown) * The following method is deprecated and should return HXR_NOTIMPL */ - STDMETHOD(GetDirObjectFromURL) (THIS_ + STDQT_METHOD(GetDirObjectFromURL) (THIS_ const char* pURL) PURE; }; @@ -696,7 +696,7 @@ DECLARE_INTERFACE_(IHXFileSystemManagerResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -713,10 +713,10 @@ DECLARE_INTERFACE_(IHXFileSystemManagerResponse, IUnknown) * IHXFileSystemManagerResponse::InitDone * Purpose: */ - STDMETHOD(InitDone) (THIS_ + STDQT_METHOD(InitDone) (THIS_ HX_RESULT status) PURE; - STDMETHOD(FileObjectReady) (THIS_ + STDQT_METHOD(FileObjectReady) (THIS_ HX_RESULT status, IUnknown* pObject) PURE; @@ -724,7 +724,7 @@ DECLARE_INTERFACE_(IHXFileSystemManagerResponse, IUnknown) * The following method is deprecated and should return HXR_NOTIMPL */ - STDMETHOD(DirObjectReady) (THIS_ + STDQT_METHOD(DirObjectReady) (THIS_ HX_RESULT status, IUnknown* pDirObject) PURE; }; @@ -756,7 +756,7 @@ DECLARE_INTERFACE_(IHXFileExists, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -773,7 +773,7 @@ DECLARE_INTERFACE_(IHXFileExists, IUnknown) * IHXFileExists::DoesExist * Purpose: */ - STDMETHOD(DoesExist) (THIS_ + STDQT_METHOD(DoesExist) (THIS_ const char* /*IN*/ pPath, IHXFileExistsResponse* /*IN*/ pFileResponse) PURE; }; @@ -805,7 +805,7 @@ DECLARE_INTERFACE_(IHXFileExistsResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -817,7 +817,7 @@ DECLARE_INTERFACE_(IHXFileExistsResponse, IUnknown) * IHXFileExistsResponse methods */ - STDMETHOD(DoesExistDone) (THIS_ + STDQT_METHOD(DoesExistDone) (THIS_ HXBOOL bExist) PURE; }; @@ -849,7 +849,7 @@ DECLARE_INTERFACE_(IHXFileMimeMapper, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -866,7 +866,7 @@ DECLARE_INTERFACE_(IHXFileMimeMapper, IUnknown) * IHXFileMimeMapper::FindMimeType * Purpose: */ - STDMETHOD(FindMimeType) (THIS_ + STDQT_METHOD(FindMimeType) (THIS_ const char* /*IN*/ pURL, IHXFileMimeMapperResponse* /*IN*/ pMimeMapperResponse ) PURE; @@ -900,7 +900,7 @@ DECLARE_INTERFACE_(IHXFileMimeMapperResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -926,7 +926,7 @@ DECLARE_INTERFACE_(IHXFileMimeMapperResponse, IUnknown) * a mime type of NULL. * */ - STDMETHOD(MimeTypeFound) (THIS_ + STDQT_METHOD(MimeTypeFound) (THIS_ HX_RESULT status, const char* pMimeType) PURE; }; @@ -959,7 +959,7 @@ DECLARE_INTERFACE_(IHXBroadcastMapper, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -976,7 +976,7 @@ DECLARE_INTERFACE_(IHXBroadcastMapper, IUnknown) * IHXBroadcastMapper::FindBroadcastType * Purpose: */ - STDMETHOD(FindBroadcastType) (THIS_ + STDQT_METHOD(FindBroadcastType) (THIS_ const char* /*IN*/ pURL, IHXBroadcastMapperResponse* /*IN*/ pBroadcastMapperResponse) PURE; }; @@ -1009,7 +1009,7 @@ DECLARE_INTERFACE_(IHXBroadcastMapperResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1033,7 +1033,7 @@ DECLARE_INTERFACE_(IHXBroadcastMapperResponse, IUnknown) * with the broadcast type set to NULL. * */ - STDMETHOD(BroadcastTypeFound) (THIS_ + STDQT_METHOD(BroadcastTypeFound) (THIS_ HX_RESULT status, const char* pBroadcastType) PURE; }; @@ -1066,7 +1066,7 @@ DECLARE_INTERFACE_(IHXGetFileFromSamePool, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1084,7 +1084,7 @@ DECLARE_INTERFACE_(IHXGetFileFromSamePool, IUnknown) * Purpose: * To get another FileObject from the same pool. */ - STDMETHOD(GetFileObjectFromPool) (THIS_ + STDQT_METHOD(GetFileObjectFromPool) (THIS_ IHXGetFileFromSamePoolResponse*) PURE; }; @@ -1116,7 +1116,7 @@ DECLARE_INTERFACE_(IHXGetFileFromSamePoolResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1133,7 +1133,7 @@ DECLARE_INTERFACE_(IHXGetFileFromSamePoolResponse, IUnknown) * Purpose: * To return another FileObject from the same pool. */ - STDMETHOD(FileObjectReady) (THIS_ + STDQT_METHOD(FileObjectReady) (THIS_ HX_RESULT status, IUnknown* ppUnknown) PURE; }; @@ -1166,7 +1166,7 @@ DECLARE_INTERFACE_(IHXFileAuthenticator, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1177,10 +1177,10 @@ DECLARE_INTERFACE_(IHXFileAuthenticator, IUnknown) /* * IHXFileAuthenticator methods */ - STDMETHOD(SetAuthenticator) (THIS_ + STDQT_METHOD(SetAuthenticator) (THIS_ IHXAuthenticator* pAuthenticator) PURE; - STDMETHOD(GetAuthenticator) (THIS_ + STDQT_METHOD(GetAuthenticator) (THIS_ REF(IHXAuthenticator*) pAuthenticator) PURE; }; @@ -1213,7 +1213,7 @@ DECLARE_INTERFACE_(IHXRequestHandler, IUnknown) * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1227,7 +1227,7 @@ DECLARE_INTERFACE_(IHXRequestHandler, IUnknown) * Purpose: * Associates an IHXRequest with an object */ - STDMETHOD(SetRequest) (THIS_ + STDQT_METHOD(SetRequest) (THIS_ IHXRequest* /*IN*/ pRequest) PURE; /************************************************************************ @@ -1236,7 +1236,7 @@ DECLARE_INTERFACE_(IHXRequestHandler, IUnknown) * Purpose: * Gets the IHXRequest object associated with an object */ - STDMETHOD(GetRequest) (THIS_ + STDQT_METHOD(GetRequest) (THIS_ REF(IHXRequest*) /*OUT*/ pRequest) PURE; }; @@ -1270,7 +1270,7 @@ DECLARE_INTERFACE_(IHXRequestContext, IUnknown) * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1288,7 +1288,7 @@ DECLARE_INTERFACE_(IHXRequestContext, IUnknown) * Purpose: * Sets the Authenticated users Context. */ - STDMETHOD(SetUserContext) + STDQT_METHOD(SetUserContext) ( THIS_ IUnknown* pIUnknownNewContext @@ -1300,7 +1300,7 @@ DECLARE_INTERFACE_(IHXRequestContext, IUnknown) * Purpose: * Gets the Authenticated users Context. */ - STDMETHOD(GetUserContext) + STDQT_METHOD(GetUserContext) ( THIS_ REF(IUnknown*) pIUnknownCurrentContext @@ -1312,7 +1312,7 @@ DECLARE_INTERFACE_(IHXRequestContext, IUnknown) * Purpose: * Sets the Object that made the request. */ - STDMETHOD(SetRequester) + STDQT_METHOD(SetRequester) ( THIS_ IUnknown* pIUnknownNewRequester @@ -1324,7 +1324,7 @@ DECLARE_INTERFACE_(IHXRequestContext, IUnknown) * Purpose: * Gets the Object that made the request. */ - STDMETHOD(GetRequester) + STDQT_METHOD(GetRequester) ( THIS_ REF(IUnknown*) pIUnknownCurrentRequester @@ -1359,7 +1359,7 @@ DECLARE_INTERFACE_(IHXRequest, IUnknown) * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1378,7 +1378,7 @@ DECLARE_INTERFACE_(IHXRequest, IUnknown) * Sets the headers that will be sent in the RFC822 header section * of the request message */ - STDMETHOD(SetRequestHeaders) (THIS_ + STDQT_METHOD(SetRequestHeaders) (THIS_ IHXValues* pRequestHeaders) PURE; /************************************************************************ @@ -1388,7 +1388,7 @@ DECLARE_INTERFACE_(IHXRequest, IUnknown) * Gets the headers that were sent in the RFC822 header section * of the request message */ - STDMETHOD(GetRequestHeaders) (THIS_ + STDQT_METHOD(GetRequestHeaders) (THIS_ REF(IHXValues*) pRequestHeaders) PURE; /************************************************************************ @@ -1398,7 +1398,7 @@ DECLARE_INTERFACE_(IHXRequest, IUnknown) * Sets the headers that will be returned in the RFC822 header * section of the response message */ - STDMETHOD(SetResponseHeaders) (THIS_ + STDQT_METHOD(SetResponseHeaders) (THIS_ IHXValues* pResponseHeaders) PURE; /************************************************************************ @@ -1408,7 +1408,7 @@ DECLARE_INTERFACE_(IHXRequest, IUnknown) * Gets the headers that were returned in the RFC822 header section * of the response message */ - STDMETHOD(GetResponseHeaders) (THIS_ + STDQT_METHOD(GetResponseHeaders) (THIS_ REF(IHXValues*) pResponseHeaders) PURE; /************************************************************************ @@ -1419,7 +1419,7 @@ DECLARE_INTERFACE_(IHXRequest, IUnknown) * Note: On the server, this path does not include the file system * mount point. */ - STDMETHOD(SetURL) (THIS_ + STDQT_METHOD(SetURL) (THIS_ const char* pURL) PURE; /************************************************************************ @@ -1434,7 +1434,7 @@ DECLARE_INTERFACE_(IHXRequest, IUnknown) * caller returns from a function which was called from the RMA * core (i.e. when you return control to the RMA core) */ - STDMETHOD(GetURL) (THIS_ + STDQT_METHOD(GetURL) (THIS_ REF(const char*) pURL) PURE; }; @@ -1465,7 +1465,7 @@ DECLARE_INTERFACE_(IHXFileRename, IUnknown) * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1483,7 +1483,7 @@ DECLARE_INTERFACE_(IHXFileRename, IUnknown) * Purpose: * Renames a file to a new name. */ - STDMETHOD(Rename) (THIS_ + STDQT_METHOD(Rename) (THIS_ const char* pNewFileName) PURE; }; @@ -1516,7 +1516,7 @@ DECLARE_INTERFACE_(IHXFileMove, IUnknown) * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1534,7 +1534,7 @@ DECLARE_INTERFACE_(IHXFileMove, IUnknown) * Purpose: * Moves a file to a different location in the file system */ - STDMETHOD(Move) (THIS_ + STDQT_METHOD(Move) (THIS_ const char* pNewFilePathName) PURE; }; @@ -1564,7 +1564,7 @@ DECLARE_INTERFACE_(IHXDirHandler, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1583,7 +1583,7 @@ DECLARE_INTERFACE_(IHXDirHandler, IUnknown) * Associates a directory handler with the directory handler * response, it should notify of operation completness. */ - STDMETHOD(InitDirHandler) (THIS_ + STDQT_METHOD(InitDirHandler) (THIS_ IHXDirHandlerResponse* /*IN*/ pDirResponse) PURE; /************************************************************************ @@ -1593,7 +1593,7 @@ DECLARE_INTERFACE_(IHXDirHandler, IUnknown) * Closes the directory handler resource and releases all resources * associated with the object. */ - STDMETHOD(CloseDirHandler) (THIS) PURE; + STDQT_METHOD(CloseDirHandler) (THIS) PURE; /************************************************************************ * Method: @@ -1601,7 +1601,7 @@ DECLARE_INTERFACE_(IHXDirHandler, IUnknown) * Purpose: * Create the directory */ - STDMETHOD(MakeDir) (THIS) PURE; + STDQT_METHOD(MakeDir) (THIS) PURE; /************************************************************************ * Method: @@ -1609,7 +1609,7 @@ DECLARE_INTERFACE_(IHXDirHandler, IUnknown) * Purpose: * Get a dump of the directory */ - STDMETHOD(ReadDir) (THIS) PURE; + STDQT_METHOD(ReadDir) (THIS) PURE; }; @@ -1638,7 +1638,7 @@ DECLARE_INTERFACE_(IHXDirHandlerResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1658,7 +1658,7 @@ DECLARE_INTERFACE_(IHXDirHandlerResponse, IUnknown) * interface. This method is called by the IHXDirHandler when the * initialization of the object is complete. */ - STDMETHOD(InitDirHandlerDone) (THIS_ + STDQT_METHOD(InitDirHandlerDone) (THIS_ HX_RESULT status) PURE; /************************************************************************ @@ -1669,7 +1669,7 @@ DECLARE_INTERFACE_(IHXDirHandlerResponse, IUnknown) * interface. This method is called by the IHXDirHandler when the * close of the directory is complete. */ - STDMETHOD(CloseDirHandlerDone) (THIS_ + STDQT_METHOD(CloseDirHandlerDone) (THIS_ HX_RESULT status) PURE; /************************************************************************ @@ -1680,7 +1680,7 @@ DECLARE_INTERFACE_(IHXDirHandlerResponse, IUnknown) * interface. This method is called by the IHXDirHandler when the * attempt to create the directory is complete. */ - STDMETHOD(MakeDirDone) (THIS_ + STDQT_METHOD(MakeDirDone) (THIS_ HX_RESULT status) PURE; /************************************************************************ @@ -1691,7 +1691,7 @@ DECLARE_INTERFACE_(IHXDirHandlerResponse, IUnknown) * interface. This method is called by the IHXDirHandler when the * read from the directory is complete and a buffer is available. */ - STDMETHOD(ReadDirDone) (THIS_ + STDQT_METHOD(ReadDirDone) (THIS_ HX_RESULT status, IHXBuffer* pBuffer) PURE; }; @@ -1723,7 +1723,7 @@ DECLARE_INTERFACE_(IHXGetRecursionLevel, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1762,7 +1762,7 @@ DEFINE_GUID(IID_IHXFileRestrictor, 0x00000219, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0x DECLARE_INTERFACE_(IHXFileRestrictor, IUnknown) { /* IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; STDMETHOD_(ULONG32,Release) (THIS) PURE; @@ -1803,7 +1803,7 @@ DECLARE_INTERFACE_(IHXFileRemove, IUnknown) * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1821,7 +1821,7 @@ DECLARE_INTERFACE_(IHXFileRemove, IUnknown) * Purpose: * Removes a file from the file system. */ - STDMETHOD(Remove) (THIS) PURE; + STDQT_METHOD(Remove) (THIS) PURE; }; @@ -1856,7 +1856,7 @@ DECLARE_INTERFACE_(IHXFastFileFactory, IUnknown) * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1876,7 +1876,7 @@ DECLARE_INTERFACE_(IHXFastFileFactory, IUnknown) * uninitialized) file object. * */ - STDMETHOD(Wrap) (THIS_ + STDQT_METHOD(Wrap) (THIS_ REF(IUnknown*) /*OUT*/ pWrapper, IUnknown* /*IN*/ pFileObj, UINT32 /*IN*/ ulBlockSize, @@ -1919,7 +1919,7 @@ DECLARE_INTERFACE_(IHXFastFileFactory2, IUnknown) * uninitialized) file object. * */ - STDMETHOD(Wrap) (THIS_ + STDQT_METHOD(Wrap) (THIS_ REF(IUnknown*) /*OUT*/ pWrapper, IUnknown* /*IN*/ pFileObj, UINT32 /*IN*/ ulBlockSize, @@ -1955,7 +1955,7 @@ DECLARE_INTERFACE_(IHXFilePlacementRead, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1966,7 +1966,7 @@ DECLARE_INTERFACE_(IHXFilePlacementRead, IUnknown) /* * IHXFilePlacementRead methods */ - STDMETHOD(Read) (THIS_ + STDQT_METHOD(Read) (THIS_ ULONG32 ulAmount, ULONG32 ulOffset, char* pBuffer, @@ -2014,7 +2014,7 @@ DECLARE_INTERFACE_(IHXFastFileStats, IUnknown) * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -2026,7 +2026,7 @@ DECLARE_INTERFACE_(IHXFastFileStats, IUnknown) * IHXFastFileStats methods */ - STDMETHOD(UpdateFileObjectStats) (THIS_ + STDQT_METHOD(UpdateFileObjectStats) (THIS_ UINT32 /*IN*/ ulFastFileBytesSaved, UINT32 /*IN*/ ulFastFileBytesNeeded) PURE; }; @@ -2061,7 +2061,7 @@ DECLARE_INTERFACE_(IHXHTTPPostObject, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -2082,7 +2082,7 @@ DECLARE_INTERFACE_(IHXHTTPPostObject, IUnknown) * for validity of the object (for example by opening it if it is * a local file). */ - STDMETHOD(Init) (THIS_ + STDQT_METHOD(Init) (THIS_ ULONG32 /*IN*/ ulFlags, IHXHTTPPostResponse* /*IN*/ pFileResponse) PURE; @@ -2093,7 +2093,7 @@ DECLARE_INTERFACE_(IHXHTTPPostObject, IUnknown) * Closes the file resource and releases all resources associated * with the object. */ - STDMETHOD(Close) (THIS) PURE; + STDQT_METHOD(Close) (THIS) PURE; /************************************************************************ * Method: @@ -2102,7 +2102,7 @@ DECLARE_INTERFACE_(IHXHTTPPostObject, IUnknown) * Tells the object to retrieve any response data from the POST. * Calls IHXHTTPPostResponse with ResponseReady(IHXValues*). */ - STDMETHOD(GetResponse) (THIS) PURE; + STDQT_METHOD(GetResponse) (THIS) PURE; /************************************************************************ @@ -2113,7 +2113,7 @@ DECLARE_INTERFACE_(IHXHTTPPostObject, IUnknown) * the caller via the IHXFileResponse interface passed in to Init, * of the completeness of the operation. */ - STDMETHOD(Post) (THIS_ + STDQT_METHOD(Post) (THIS_ IHXBuffer* pBuffer) PURE; /************************************************************************ @@ -2122,7 +2122,7 @@ DECLARE_INTERFACE_(IHXHTTPPostObject, IUnknown) * Purpose: * Set the total size of the Post(s) about to be made. */ - STDMETHOD(SetSize) (THIS_ + STDQT_METHOD(SetSize) (THIS_ ULONG32 ulLength) PURE; }; @@ -2153,7 +2153,7 @@ DECLARE_INTERFACE_(IHXHTTPPostResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -2175,7 +2175,7 @@ DECLARE_INTERFACE_(IHXHTTPPostResponse, IUnknown) * for the file system, the status HXR_FAILED should be * returned. */ - STDMETHOD(InitDone) (THIS_ + STDQT_METHOD(InitDone) (THIS_ HX_RESULT status) PURE; /************************************************************************ @@ -2186,7 +2186,7 @@ DECLARE_INTERFACE_(IHXHTTPPostResponse, IUnknown) * interface. This method is called by the IHXHTTPPostObject when the * close of the file is complete. */ - STDMETHOD(CloseDone) (THIS_ + STDQT_METHOD(CloseDone) (THIS_ HX_RESULT status) PURE; /************************************************************************ @@ -2197,7 +2197,7 @@ DECLARE_INTERFACE_(IHXHTTPPostResponse, IUnknown) * interface. This method is called by the IHXHTTPPostObject when the * POST response data has been completely read. */ - STDMETHOD(ResponseReady) (THIS_ + STDQT_METHOD(ResponseReady) (THIS_ HX_RESULT status, IHXBuffer* pContentBuffer) PURE; @@ -2209,7 +2209,7 @@ DECLARE_INTERFACE_(IHXHTTPPostResponse, IUnknown) * interface. This method is called by the IHXHTTPPostObject when the * last write to the file is complete. */ - STDMETHOD(PostDone) (THIS_ + STDQT_METHOD(PostDone) (THIS_ HX_RESULT status) PURE; }; // $EndPrivate. @@ -2243,7 +2243,7 @@ DECLARE_INTERFACE_(IHXHTTPRedirect, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -2261,7 +2261,7 @@ DECLARE_INTERFACE_(IHXHTTPRedirect, IUnknown) * Purpose: * Initialize the response object */ - STDMETHOD(Init) (THIS_ + STDQT_METHOD(Init) (THIS_ IHXHTTPRedirectResponse* pRedirectResponse) PURE; /************************************************************************ @@ -2270,7 +2270,7 @@ DECLARE_INTERFACE_(IHXHTTPRedirect, IUnknown) * Purpose: * Initialize the response object w/o calling Init */ - STDMETHOD(SetResponseObject) (THIS_ + STDQT_METHOD(SetResponseObject) (THIS_ IHXHTTPRedirectResponse* pRedirectResponse) PURE; }; @@ -2302,7 +2302,7 @@ DECLARE_INTERFACE_(IHXHTTPRedirectResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -2320,7 +2320,7 @@ DECLARE_INTERFACE_(IHXHTTPRedirectResponse, IUnknown) * Purpose: * return the redirect URL */ - STDMETHOD(RedirectDone) (THIS_ + STDQT_METHOD(RedirectDone) (THIS_ IHXBuffer* pURL) PURE; }; @@ -2356,7 +2356,7 @@ DECLARE_INTERFACE_(IHXRM2Converter2, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; @@ -2365,13 +2365,13 @@ DECLARE_INTERFACE_(IHXRM2Converter2, IUnknown) /* * IHXRM2Converter2 methods */ - STDMETHOD(Init) (THIS_ + STDQT_METHOD(Init) (THIS_ IHXRM2Converter2Response* pResponse) PURE; // // AddStream takes a stream from an RM1 file and // adds it to the new RM2 multirate section // - STDMETHOD(AddStream) (THIS_ + STDQT_METHOD(AddStream) (THIS_ const char* pFilename, IHXFileObject* pFileObject, UINT16 nStreamNumber, @@ -2382,7 +2382,7 @@ DECLARE_INTERFACE_(IHXRM2Converter2, IUnknown) // RM1 file and adds it to the initial interleaved // backward compatibility section // - STDMETHOD(AddInterleavedStream) (THIS_ + STDQT_METHOD(AddInterleavedStream) (THIS_ const char* pFilename, IHXFileObject* pFileObject, UINT16 nStreamNumber) PURE; @@ -2392,7 +2392,7 @@ DECLARE_INTERFACE_(IHXRM2Converter2, IUnknown) // an RM1 file and adds them to the new RM2 // multirate section. // - STDMETHOD(AddFile) (THIS_ + STDQT_METHOD(AddFile) (THIS_ const char* pFilename, IHXFileObject* pFileObject) PURE; @@ -2400,13 +2400,13 @@ DECLARE_INTERFACE_(IHXRM2Converter2, IUnknown) // SetTitle,Author,Copyright, and Comment // should all be pretty self explanatory... // - STDMETHOD(SetTitle) (THIS_ + STDQT_METHOD(SetTitle) (THIS_ const char* pTitle) PURE; - STDMETHOD(SetAuthor) (THIS_ + STDQT_METHOD(SetAuthor) (THIS_ const char* pAuthor) PURE; - STDMETHOD(SetCopyright) (THIS_ + STDQT_METHOD(SetCopyright) (THIS_ const char* pCopyright) PURE; - STDMETHOD(SetComment) (THIS_ + STDQT_METHOD(SetComment) (THIS_ const char* pComment) PURE; // @@ -2415,19 +2415,19 @@ DECLARE_INTERFACE_(IHXRM2Converter2, IUnknown) // bandwidth (i.e. the sum of the stream // bandwidths involved). // - STDMETHOD(PairStreams) (THIS_ + STDQT_METHOD(PairStreams) (THIS_ const char* pFilename1, UINT16 nStreamNumber1, const char* pFilename2, UINT16 nStreamNumber2) PURE; - STDMETHOD(Merge) (THIS_ + STDQT_METHOD(Merge) (THIS_ const char* pFilename, IHXFileObject* pOutputFile, UINT32 ulBytesToWrite) PURE; - STDMETHOD(Reset) (THIS) PURE; - STDMETHOD(Done) (THIS) PURE; + STDQT_METHOD(Reset) (THIS) PURE; + STDQT_METHOD(Done) (THIS) PURE; }; @@ -2458,7 +2458,7 @@ DECLARE_INTERFACE_(IHXRM2Converter2Response, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; @@ -2467,15 +2467,15 @@ DECLARE_INTERFACE_(IHXRM2Converter2Response, IUnknown) /* * IHXRM2Converter2Response methods */ - STDMETHOD(InitDone) (THIS_ + STDQT_METHOD(InitDone) (THIS_ HX_RESULT status) PURE; - STDMETHOD(AddStreamDone) (THIS_ + STDQT_METHOD(AddStreamDone) (THIS_ HX_RESULT status) PURE; - STDMETHOD(AddInterleavedStreamDone) (THIS_ + STDQT_METHOD(AddInterleavedStreamDone) (THIS_ HX_RESULT status) PURE; - STDMETHOD(AddFileDone) (THIS_ + STDQT_METHOD(AddFileDone) (THIS_ HX_RESULT status) PURE; - STDMETHOD(MergeDone) (THIS_ + STDQT_METHOD(MergeDone) (THIS_ HX_RESULT status) PURE; }; @@ -2507,7 +2507,7 @@ DECLARE_INTERFACE_(IHXPoolPathAdjustment, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -2518,7 +2518,7 @@ DECLARE_INTERFACE_(IHXPoolPathAdjustment, IUnknown) /* * IHXPoolPathAdjustment Methods. */ - STDMETHOD(AdjustAbsolutePath) (THIS_ + STDQT_METHOD(AdjustAbsolutePath) (THIS_ IHXBuffer* /*IN*/ pOldPath, REF(IHXBuffer*) /*OUT*/ pNewPath) PURE; @@ -2554,7 +2554,7 @@ DECLARE_INTERFACE_(IHXPostDataHandler, IUnknown) * IUnknownMethods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -2564,7 +2564,7 @@ DECLARE_INTERFACE_(IHXPostDataHandler, IUnknown) /* * IHXPostDataHandler methods */ - STDMETHOD(PostData) (THIS_ + STDQT_METHOD(PostData) (THIS_ IHXBuffer* pBuf) PURE; }; diff --git a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxmon.h b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxmon.h index d2f9f8af..89c3d687 100644 --- a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxmon.h +++ b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxmon.h @@ -81,7 +81,7 @@ DECLARE_INTERFACE_(IHXRegistry, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -102,7 +102,7 @@ DECLARE_INTERFACE_(IHXRegistry, IUnknown) * * pPropWatch - OUT - returns a new addref'ed IHXPropWatch object */ - STDMETHOD(CreatePropWatch) (THIS_ + STDQT_METHOD(CreatePropWatch) (THIS_ REF(IHXPropWatch*) pPropWatch) PURE; /************************************************************************ @@ -148,7 +148,7 @@ DECLARE_INTERFACE_(IHXRegistry, IUnknown) * nValue - OUT - parameter into which the value of the Property is * going to be returned */ - STDMETHOD(GetIntByName) (THIS_ + STDQT_METHOD(GetIntByName) (THIS_ const char* pName, REF(INT32) nValue) const PURE; @@ -164,7 +164,7 @@ DECLARE_INTERFACE_(IHXRegistry, IUnknown) * nValue - OUT - parameter into which the value of the Property is * going to be returned */ - STDMETHOD(GetIntById) (THIS_ + STDQT_METHOD(GetIntById) (THIS_ const UINT32 ulId, REF(INT32) nValue) const PURE; @@ -179,7 +179,7 @@ DECLARE_INTERFACE_(IHXRegistry, IUnknown) * pName - IN - name of the Property whose value is to be set * nValue - IN - the new value of the Property which is going to be set */ - STDMETHOD(SetIntByName) (THIS_ + STDQT_METHOD(SetIntByName) (THIS_ const char* pName, const INT32 nValue) PURE; @@ -194,7 +194,7 @@ DECLARE_INTERFACE_(IHXRegistry, IUnknown) * ulId - IN - unique id of the Property whose value is to be set * nValue - IN - the new value of the Property which is going to be set */ - STDMETHOD(SetIntById) (THIS_ + STDQT_METHOD(SetIntById) (THIS_ const UINT32 id, const INT32 nValue) PURE; @@ -226,7 +226,7 @@ DECLARE_INTERFACE_(IHXRegistry, IUnknown) * pValue - OUT - parameter into which the value of the Property is * going to be returned */ - STDMETHOD(GetStrByName) (THIS_ + STDQT_METHOD(GetStrByName) (THIS_ const char* pName, REF(IHXBuffer*) pValue) const PURE; @@ -242,7 +242,7 @@ DECLARE_INTERFACE_(IHXRegistry, IUnknown) * pValue - OUT - parameter into which the value of the Property is * going to be returned */ - STDMETHOD(GetStrById) (THIS_ + STDQT_METHOD(GetStrById) (THIS_ const UINT32 ulId, REF(IHXBuffer*) pValue) const PURE; @@ -257,7 +257,7 @@ DECLARE_INTERFACE_(IHXRegistry, IUnknown) * pName - IN - name of the Property whose value is to be set * pValue - IN - the new value of the Property which is going to be set */ - STDMETHOD(SetStrByName) (THIS_ + STDQT_METHOD(SetStrByName) (THIS_ const char* pName, IHXBuffer* pValue) PURE; @@ -272,7 +272,7 @@ DECLARE_INTERFACE_(IHXRegistry, IUnknown) * ulId - IN - unique id of the Property whose value is to be set * pValue - IN - the new value of the Property which is going to be set */ - STDMETHOD(SetStrById) (THIS_ + STDQT_METHOD(SetStrById) (THIS_ const UINT32 ulId, IHXBuffer* pValue) PURE; @@ -304,7 +304,7 @@ DECLARE_INTERFACE_(IHXRegistry, IUnknown) * pValue - OUT - parameter into which the value of the Property is * going to be returned */ - STDMETHOD(GetBufByName) (THIS_ + STDQT_METHOD(GetBufByName) (THIS_ const char* pName, REF(IHXBuffer*) pValue) const PURE; @@ -320,7 +320,7 @@ DECLARE_INTERFACE_(IHXRegistry, IUnknown) * pValue - OUT - parameter into which the value of the Property is * going to be returned */ - STDMETHOD(GetBufById) (THIS_ + STDQT_METHOD(GetBufById) (THIS_ const UINT32 ulId, REF(IHXBuffer*) pValue) const PURE; @@ -335,7 +335,7 @@ DECLARE_INTERFACE_(IHXRegistry, IUnknown) * pName - IN - name of the Property whose value is to be set * pValue - IN - the new value of the Property which is going to be set */ - STDMETHOD(SetBufByName) (THIS_ + STDQT_METHOD(SetBufByName) (THIS_ const char* pName, IHXBuffer* pValue) PURE; @@ -350,7 +350,7 @@ DECLARE_INTERFACE_(IHXRegistry, IUnknown) * ulId - IN - unique id of the Property whose value is to be set * pValue - IN - the new value of the Property which is going to be set */ - STDMETHOD(SetBufById) (THIS_ + STDQT_METHOD(SetBufById) (THIS_ const UINT32 ulId, IHXBuffer* pValue) PURE; @@ -455,7 +455,7 @@ DECLARE_INTERFACE_(IHXRegistry, IUnknown) * pName - OUT - parameter into which the Property name is going to be * returned */ - STDMETHOD(GetPropName) (THIS_ + STDQT_METHOD(GetPropName) (THIS_ const UINT32 ulId, REF(IHXBuffer*) pName) const PURE; @@ -481,7 +481,7 @@ DECLARE_INTERFACE_(IHXRegistry, IUnknown) * pValues - OUT - list of property name and unique id at the * highest level (root) in the registry */ - STDMETHOD(GetPropListOfRoot) (THIS_ + STDQT_METHOD(GetPropListOfRoot) (THIS_ REF(IHXValues*) pValues) const PURE; /************************************************************************ @@ -496,7 +496,7 @@ DECLARE_INTERFACE_(IHXRegistry, IUnknown) * pValues - OUT - list of property name and unique id under the * Property whose name is in "pName" */ - STDMETHOD(GetPropListByName) (THIS_ + STDQT_METHOD(GetPropListByName) (THIS_ const char* pName, REF(IHXValues*) pValues) const PURE; @@ -512,7 +512,7 @@ DECLARE_INTERFACE_(IHXRegistry, IUnknown) * pValues - OUT - list of property name and unique id under the * Property whose is is in "ulId" */ - STDMETHOD(GetPropListById) (THIS_ + STDQT_METHOD(GetPropListById) (THIS_ const UINT32 ulId, REF(IHXValues*) pValues) const PURE; @@ -580,7 +580,7 @@ DECLARE_INTERFACE_(IHXPropWatch, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -603,7 +603,7 @@ DECLARE_INTERFACE_(IHXPropWatch, IUnknown) * initialize the IHXPropWatch object. the response * object gets AddRef'd in the Init method. */ - STDMETHOD(Init) (THIS_ + STDQT_METHOD(Init) (THIS_ IHXPropWatchResponse* pResponse) PURE; /************************************************************************ @@ -651,7 +651,7 @@ DECLARE_INTERFACE_(IHXPropWatch, IUnknown) * Purpose: * It clears the watch on the root of the registry. */ - STDMETHOD(ClearWatchOnRoot) (THIS) PURE; + STDQT_METHOD(ClearWatchOnRoot) (THIS) PURE; /************************************************************************ * Method: @@ -661,7 +661,7 @@ DECLARE_INTERFACE_(IHXPropWatch, IUnknown) * * pName - IN - name of Property whose watch point is to be cleared */ - STDMETHOD(ClearWatchByName) (THIS_ + STDQT_METHOD(ClearWatchByName) (THIS_ const char* pName) PURE; /************************************************************************ @@ -672,7 +672,7 @@ DECLARE_INTERFACE_(IHXPropWatch, IUnknown) * * ulId - IN - unique id of Property whose watch point is to be cleared */ - STDMETHOD(ClearWatchById) (THIS_ + STDQT_METHOD(ClearWatchById) (THIS_ const UINT32 ulId) PURE; }; @@ -704,7 +704,7 @@ DECLARE_INTERFACE_(IHXPropWatchResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -725,7 +725,7 @@ DECLARE_INTERFACE_(IHXPropWatchResponse, IUnknown) * added, its datatype and the id of its immediate parent COMPOSITE * property. */ - STDMETHOD(AddedProp) (THIS_ + STDQT_METHOD(AddedProp) (THIS_ const UINT32 ulId, const HXPropType propType, const UINT32 ulParentID) PURE; @@ -738,7 +738,7 @@ DECLARE_INTERFACE_(IHXPropWatchResponse, IUnknown) * the id of the Property just modified, its datatype and the * id of its immediate parent COMPOSITE property. */ - STDMETHOD(ModifiedProp) (THIS_ + STDQT_METHOD(ModifiedProp) (THIS_ const UINT32 ulId, const HXPropType propType, const UINT32 ulParentID) PURE; @@ -751,7 +751,7 @@ DECLARE_INTERFACE_(IHXPropWatchResponse, IUnknown) * seen, it returns the id of the Property just deleted and * its immediate parent COMPOSITE property. */ - STDMETHOD(DeletedProp) (THIS_ + STDQT_METHOD(DeletedProp) (THIS_ const UINT32 ulId, const UINT32 ulParentID) PURE; }; @@ -783,7 +783,7 @@ DECLARE_INTERFACE_(IHXActiveRegistry, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -797,7 +797,7 @@ DECLARE_INTERFACE_(IHXActiveRegistry, IUnknown) * Method to set prop pName to active and register pUser as * the active prop user. */ - STDMETHOD(SetAsActive) (THIS_ + STDQT_METHOD(SetAsActive) (THIS_ const char* pName, IHXActivePropUser* pUser) PURE; @@ -806,7 +806,7 @@ DECLARE_INTERFACE_(IHXActiveRegistry, IUnknown) * * Method to remove an IHXActiveUser from Prop activation. */ - STDMETHOD(SetAsInactive) (THIS_ + STDQT_METHOD(SetAsInactive) (THIS_ const char* pName, IHXActivePropUser* pUser) PURE; @@ -824,7 +824,7 @@ DECLARE_INTERFACE_(IHXActiveRegistry, IUnknown) * * Async request to set int pName to ul. */ - STDMETHOD(SetActiveInt) (THIS_ + STDQT_METHOD(SetActiveInt) (THIS_ const char* pName, UINT32 ul, IHXActivePropUserResponse* pResponse) PURE; @@ -834,7 +834,7 @@ DECLARE_INTERFACE_(IHXActiveRegistry, IUnknown) * * Async request to set string pName to string in pBuffer. */ - STDMETHOD(SetActiveStr) (THIS_ + STDQT_METHOD(SetActiveStr) (THIS_ const char* pName, IHXBuffer* pBuffer, IHXActivePropUserResponse* pResponse) PURE; @@ -844,7 +844,7 @@ DECLARE_INTERFACE_(IHXActiveRegistry, IUnknown) * * Async request to set buffer pName to buffer in pBuffer. */ - STDMETHOD(SetActiveBuf) (THIS_ + STDQT_METHOD(SetActiveBuf) (THIS_ const char* pName, IHXBuffer* pBuffer, IHXActivePropUserResponse* pResponse) PURE; @@ -854,7 +854,7 @@ DECLARE_INTERFACE_(IHXActiveRegistry, IUnknown) * * Async request to delete the active property. */ - STDMETHOD(DeleteActiveProp) (THIS_ + STDQT_METHOD(DeleteActiveProp) (THIS_ const char* pName, IHXActivePropUserResponse* pResponse) PURE; @@ -893,7 +893,7 @@ DECLARE_INTERFACE_(IHXActivePropUser, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -906,7 +906,7 @@ DECLARE_INTERFACE_(IHXActivePropUser, IUnknown) * * Async request to set int pName to ul. */ - STDMETHOD(SetActiveInt) (THIS_ + STDQT_METHOD(SetActiveInt) (THIS_ const char* pName, UINT32 ul, IHXActivePropUserResponse* pResponse) PURE; @@ -916,7 +916,7 @@ DECLARE_INTERFACE_(IHXActivePropUser, IUnknown) * * Async request to set string pName to string in pBuffer. */ - STDMETHOD(SetActiveStr) (THIS_ + STDQT_METHOD(SetActiveStr) (THIS_ const char* pName, IHXBuffer* pBuffer, IHXActivePropUserResponse* pResponse) PURE; @@ -926,7 +926,7 @@ DECLARE_INTERFACE_(IHXActivePropUser, IUnknown) * * Async request to set buffer pName to buffer in pBuffer. */ - STDMETHOD(SetActiveBuf) (THIS_ + STDQT_METHOD(SetActiveBuf) (THIS_ const char* pName, IHXBuffer* pBuffer, IHXActivePropUserResponse* pResponse) PURE; @@ -936,7 +936,7 @@ DECLARE_INTERFACE_(IHXActivePropUser, IUnknown) * * Async request to delete the active property. */ - STDMETHOD(DeleteActiveProp) (THIS_ + STDQT_METHOD(DeleteActiveProp) (THIS_ const char* pName, IHXActivePropUserResponse* pResponse) PURE; @@ -970,7 +970,7 @@ DECLARE_INTERFACE_(IHXActivePropUserResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -981,28 +981,28 @@ DECLARE_INTERFACE_(IHXActivePropUserResponse, IUnknown) /************************************************************************ * Called with status result on completion of set request. */ - STDMETHOD(SetActiveIntDone) (THIS_ + STDQT_METHOD(SetActiveIntDone) (THIS_ HX_RESULT res, const char* pName, UINT32 ul, IHXBuffer* pInfo[], UINT32 ulNumInfo) PURE; - STDMETHOD(SetActiveStrDone) (THIS_ + STDQT_METHOD(SetActiveStrDone) (THIS_ HX_RESULT res, const char* pName, IHXBuffer* pBuffer, IHXBuffer* pInfo[], UINT32 ulNumInfo) PURE; - STDMETHOD(SetActiveBufDone) (THIS_ + STDQT_METHOD(SetActiveBufDone) (THIS_ HX_RESULT res, const char* pName, IHXBuffer* pBuffer, IHXBuffer* pInfo[], UINT32 ulNumInfo) PURE; - STDMETHOD(DeleteActivePropDone) (THIS_ + STDQT_METHOD(DeleteActivePropDone) (THIS_ HX_RESULT res, const char* pName, IHXBuffer* pInfo[], @@ -1037,7 +1037,7 @@ DECLARE_INTERFACE_(IHXCopyRegistry, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1050,7 +1050,7 @@ DECLARE_INTERFACE_(IHXCopyRegistry, IUnknown) * * Here it is! The "Copy" method! */ - STDMETHOD (CopyByName) (THIS_ + STDQT_METHOD (CopyByName) (THIS_ const char* pFrom, const char* pTo) PURE; }; @@ -1083,7 +1083,7 @@ DECLARE_INTERFACE_(IHXRegistryAltStringHandling, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1100,7 +1100,7 @@ DECLARE_INTERFACE_(IHXRegistryAltStringHandling, IUnknown) * method it's ID. The property will now be accessible/setable as a, * but it will still be a string! */ - STDMETHOD (SetStringAccessAsBufferById) (THIS_ + STDQT_METHOD (SetStringAccessAsBufferById) (THIS_ UINT32 ulId) PURE; }; @@ -1140,7 +1140,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1161,7 +1161,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * * pPropWatch - OUT - returns a new addref'ed IHXPropWatch object */ - STDMETHOD(CreatePropWatch) (THIS_ + STDQT_METHOD(CreatePropWatch) (THIS_ REF(IHXPropWatch*) pPropWatch) PURE; /************************************************************************ @@ -1207,7 +1207,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * nValue - OUT - parameter into which the value of the Property is * going to be returned */ - STDMETHOD(GetIntByName) (THIS_ + STDQT_METHOD(GetIntByName) (THIS_ const char* pName, REF(INT32) nValue) const PURE; @@ -1223,7 +1223,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * nValue - OUT - parameter into which the value of the Property is * going to be returned */ - STDMETHOD(GetIntById) (THIS_ + STDQT_METHOD(GetIntById) (THIS_ const UINT32 ulId, REF(INT32) nValue) const PURE; @@ -1238,7 +1238,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * pName - IN - name of the Property whose value is to be set * nValue - IN - the new value of the Property which is going to be set */ - STDMETHOD(SetIntByName) (THIS_ + STDQT_METHOD(SetIntByName) (THIS_ const char* pName, const INT32 nValue) PURE; @@ -1253,7 +1253,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * ulId - IN - unique id of the Property whose value is to be set * nValue - IN - the new value of the Property which is going to be set */ - STDMETHOD(SetIntById) (THIS_ + STDQT_METHOD(SetIntById) (THIS_ const UINT32 id, const INT32 nValue) PURE; @@ -1286,7 +1286,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * pValue - OUT - parameter into which the value of the Property is * going to be returned */ - STDMETHOD(GetStrByName) (THIS_ + STDQT_METHOD(GetStrByName) (THIS_ const char* pName, REF(IHXBuffer*) pValue) const PURE; @@ -1302,7 +1302,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * pValue - OUT - parameter into which the value of the Property is * going to be returned */ - STDMETHOD(GetStrById) (THIS_ + STDQT_METHOD(GetStrById) (THIS_ const UINT32 ulId, REF(IHXBuffer*) pValue) const PURE; @@ -1317,7 +1317,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * pName - IN - name of the Property whose value is to be set * pValue - IN - the new value of the Property which is going to be set */ - STDMETHOD(SetStrByName) (THIS_ + STDQT_METHOD(SetStrByName) (THIS_ const char* pName, IHXBuffer* pValue) PURE; @@ -1332,7 +1332,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * ulId - IN - unique id of the Property whose value is to be set * pValue - IN - the new value of the Property which is going to be set */ - STDMETHOD(SetStrById) (THIS_ + STDQT_METHOD(SetStrById) (THIS_ const UINT32 ulId, IHXBuffer* pValue) PURE; @@ -1365,7 +1365,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * pValue - OUT - parameter into which the value of the Property is * going to be returned */ - STDMETHOD(GetBufByName) (THIS_ + STDQT_METHOD(GetBufByName) (THIS_ const char* pName, REF(IHXBuffer*) pValue) const PURE; @@ -1381,7 +1381,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * pValue - OUT - parameter into which the value of the Property is * going to be returned */ - STDMETHOD(GetBufById) (THIS_ + STDQT_METHOD(GetBufById) (THIS_ const UINT32 ulId, REF(IHXBuffer*) pValue) const PURE; @@ -1396,7 +1396,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * pName - IN - name of the Property whose value is to be set * pValue - IN - the new value of the Property which is going to be set */ - STDMETHOD(SetBufByName) (THIS_ + STDQT_METHOD(SetBufByName) (THIS_ const char* pName, IHXBuffer* pValue) PURE; @@ -1411,7 +1411,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * ulId - IN - unique id of the Property whose value is to be set * pValue - IN - the new value of the Property which is going to be set */ - STDMETHOD(SetBufById) (THIS_ + STDQT_METHOD(SetBufById) (THIS_ const UINT32 ulId, IHXBuffer* pValue) PURE; @@ -1517,7 +1517,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * pName - OUT - parameter into which the Property name is going to be * returned */ - STDMETHOD(GetPropName) (THIS_ + STDQT_METHOD(GetPropName) (THIS_ const UINT32 ulId, REF(IHXBuffer*) pName) const PURE; @@ -1543,7 +1543,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * pValues - OUT - list of property name and unique id at the * highest level (root) in the registry */ - STDMETHOD(GetPropListOfRoot) (THIS_ + STDQT_METHOD(GetPropListOfRoot) (THIS_ REF(IHXValues*) pValues) const PURE; /************************************************************************ @@ -1558,7 +1558,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * pValues - OUT - list of property name and unique id under the * Property whose name is in "pName" */ - STDMETHOD(GetPropListByName) (THIS_ + STDQT_METHOD(GetPropListByName) (THIS_ const char* pName, REF(IHXValues*) pValues) const PURE; @@ -1574,7 +1574,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * pValues - OUT - list of property name and unique id under the * Property whose is is in "ulId" */ - STDMETHOD(GetPropListById) (THIS_ + STDQT_METHOD(GetPropListById) (THIS_ const UINT32 ulId, REF(IHXValues*) pValues) const PURE; @@ -1630,7 +1630,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * nValue - OUT - parameter into which the value of the Property is * going to be returned, after modification */ - STDMETHOD(ModifyIntByName) (THIS_ + STDQT_METHOD(ModifyIntByName) (THIS_ const char* pName, INT32 nDelta, REF(INT32) nValue) PURE; @@ -1651,7 +1651,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * nValue - OUT - parameter into which the value of the Property is * going to be returned, after modification */ - STDMETHOD(ModifyIntById) (THIS_ + STDQT_METHOD(ModifyIntById) (THIS_ const UINT32 id, INT32 nDelta, REF(INT32) nValue) PURE; @@ -1681,7 +1681,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * nValue - OUT - parameter into which the value of the Property is * going to be returned, after modification */ - STDMETHOD(BoundedModifyIntByName) (THIS_ + STDQT_METHOD(BoundedModifyIntByName) (THIS_ const char* pName, INT32 nDelta, REF(INT32) nValue, @@ -1713,7 +1713,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * nValue - OUT - parameter into which the value of the Property is * going to be returned, after modification */ - STDMETHOD(BoundedModifyIntById) (THIS_ + STDQT_METHOD(BoundedModifyIntById) (THIS_ const UINT32 id, INT32 nDelta, REF(INT32) nValue, @@ -1735,7 +1735,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * nOldValue - OUT - parameter into which the previous value of the * Property is returned */ - STDMETHOD(SetAndReturnIntByName) (THIS_ + STDQT_METHOD(SetAndReturnIntByName) (THIS_ const char* pName, INT32 nValue, REF(INT32) nOldValue) PURE; @@ -1755,7 +1755,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * nOldValue - OUT - parameter into which the previous value of the * Property is returned */ - STDMETHOD(SetAndReturnIntById) (THIS_ + STDQT_METHOD(SetAndReturnIntById) (THIS_ const UINT32 id, INT32 nValue, REF(INT32) nOldValue) PURE; @@ -1773,7 +1773,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * pName - IN - name of the Property whose value is to be retrieved * pValue - OUT - the address of the integer value */ - STDMETHOD(GetIntRefByName) (THIS_ + STDQT_METHOD(GetIntRefByName) (THIS_ const char* pName, REF(INT32*) pValue) const PURE; @@ -1790,7 +1790,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * pName - IN - name of the Property whose value is to be retrieved * pValue - OUT - the address of the integer value */ - STDMETHOD(GetIntRefById) (THIS_ + STDQT_METHOD(GetIntRefById) (THIS_ const UINT32 id, REF(INT32*) pValue) const PURE; @@ -1825,7 +1825,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * nValue - OUT - parameter into which the value of the Property is * going to be returned */ - STDMETHOD(GetInt64ByName) (THIS_ + STDQT_METHOD(GetInt64ByName) (THIS_ const char* pName, REF(INT64) nValue) const PURE; @@ -1841,7 +1841,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * nValue - OUT - parameter into which the value of the Property is * going to be returned */ - STDMETHOD(GetInt64ById) (THIS_ + STDQT_METHOD(GetInt64ById) (THIS_ const UINT32 ulId, REF(INT64) nValue) const PURE; @@ -1856,7 +1856,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * pName - IN - name of the Property whose value is to be set * nValue - IN - the new value of the Property which is going to be set */ - STDMETHOD(SetInt64ByName) (THIS_ + STDQT_METHOD(SetInt64ByName) (THIS_ const char* pName, const INT64 nValue) PURE; @@ -1871,7 +1871,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * ulId - IN - unique id of the Property whose value is to be set * nValue - IN - the new value of the Property which is going to be set */ - STDMETHOD(SetInt64ById) (THIS_ + STDQT_METHOD(SetInt64ById) (THIS_ const UINT32 id, const INT64 nValue) PURE; @@ -1891,7 +1891,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * nValue - OUT - parameter into which the value of the Property is * going to be returned, after modification */ - STDMETHOD(ModifyInt64ByName) (THIS_ + STDQT_METHOD(ModifyInt64ByName) (THIS_ const char* pName, INT64 nDelta, REF(INT64) nValue) PURE; @@ -1912,7 +1912,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * nValue - OUT - parameter into which the value of the Property is * going to be returned, after modification */ - STDMETHOD(ModifyInt64ById) (THIS_ + STDQT_METHOD(ModifyInt64ById) (THIS_ const UINT32 id, INT64 nDelta, REF(INT64) nValue) PURE; @@ -1946,7 +1946,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * the default values should b changed from INT_MIN/MAX to their * appropriate 64-bit values */ - STDMETHOD(BoundedModifyInt64ByName) (THIS_ + STDQT_METHOD(BoundedModifyInt64ByName) (THIS_ const char* pName, INT64 nDelta, REF(INT64) nValue, @@ -1982,7 +1982,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * the default values should b changed from INT_MIN/MAX to their * appropriate 64-bit values */ - STDMETHOD(BoundedModifyInt64ById) (THIS_ + STDQT_METHOD(BoundedModifyInt64ById) (THIS_ const UINT32 id, INT64 nDelta, REF(INT64) nValue, @@ -2004,7 +2004,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * nOldValue - OUT - parameter into which the previous value of the * Property is returned */ - STDMETHOD(SetAndReturnInt64ByName) (THIS_ + STDQT_METHOD(SetAndReturnInt64ByName) (THIS_ const char* pName, INT64 nValue, REF(INT64) nOldValue) PURE; @@ -2024,7 +2024,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * nOldValue - OUT - parameter into which the previous value of the * Property is returned */ - STDMETHOD(SetAndReturnInt64ById) (THIS_ + STDQT_METHOD(SetAndReturnInt64ById) (THIS_ const UINT32 id, INT64 nValue, REF(INT64) nOldValue) PURE; @@ -2062,7 +2062,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * pName - IN - name of the Property whose value is to be retrieved * pValue - OUT - the address of the integer value */ - STDMETHOD(GetInt64RefByName) (THIS_ + STDQT_METHOD(GetInt64RefByName) (THIS_ const char* pName, REF(INT64*) pValue) const PURE; @@ -2080,7 +2080,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * pName - IN - name of the Property whose value is to be retrieved * pValue - OUT - the address of the integer value */ - STDMETHOD(GetInt64RefById) (THIS_ + STDQT_METHOD(GetInt64RefById) (THIS_ const UINT32 id, REF(INT64*) pValue) const PURE; @@ -2098,7 +2098,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * * Note: The array must be deleted by the user. */ - STDMETHOD(GetChildIdListByName) (THIS_ + STDQT_METHOD(GetChildIdListByName) (THIS_ const char* pName, REF(UINT32*) pValues, REF(UINT32) ulCount) const PURE; @@ -2117,7 +2117,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * * Note: The pValues array must be deleted by the user. */ - STDMETHOD(GetChildIdListById) (THIS_ + STDQT_METHOD(GetChildIdListById) (THIS_ const UINT32 ulId, REF(UINT32*) pValues, REF(UINT32) ulCount) const PURE; @@ -2137,7 +2137,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * HXR_FAIL if property does not exist. */ - STDMETHOD(GetPropStatusById) (THIS_ + STDQT_METHOD(GetPropStatusById) (THIS_ const UINT32 ulId) const PURE; @@ -2155,7 +2155,7 @@ DECLARE_INTERFACE_(IHXRegistry2, IUnknown) * HXR_FAIL if property does not exist. */ - STDMETHOD(GetPropStatusByName) (THIS_ + STDQT_METHOD(GetPropStatusByName) (THIS_ const char* pName) const PURE; }; @@ -2191,7 +2191,7 @@ DECLARE_INTERFACE_(IHXDeletedPropResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -2215,7 +2215,7 @@ DECLARE_INTERFACE_(IHXDeletedPropResponse, IUnknown) * bIsParentNotify - IN - TRUE if this is a parent notification. * pName - IN - name of the deleted Property (null-terminated) */ - STDMETHOD(DeletedComposite)(THIS_ + STDQT_METHOD(DeletedComposite)(THIS_ const UINT32 ulId, const UINT32 ulParentID, const HXBOOL bIsParentNotify, @@ -2233,7 +2233,7 @@ DECLARE_INTERFACE_(IHXDeletedPropResponse, IUnknown) * pName - IN - name of the Property being deleted (null-terminated) * nValue - IN - integer value of the Property which has been deleted */ - STDMETHOD(DeletedInt) (THIS_ + STDQT_METHOD(DeletedInt) (THIS_ const UINT32 ulId, const UINT32 ulParentID, const HXBOOL bIsParentNotify, @@ -2255,7 +2255,7 @@ DECLARE_INTERFACE_(IHXDeletedPropResponse, IUnknown) * pValue - IN - the pointer of the integer reference Property * which has been deleted */ - STDMETHOD(DeletedIntRef) (THIS_ + STDQT_METHOD(DeletedIntRef) (THIS_ const UINT32 ulId, const UINT32 ulParentID, const HXBOOL bIsParentNotify, @@ -2276,7 +2276,7 @@ DECLARE_INTERFACE_(IHXDeletedPropResponse, IUnknown) * pName - IN - name of the deleted Property (null-terminated) * pValue - IN - value of the deleted Property */ - STDMETHOD(DeletedString) (THIS_ + STDQT_METHOD(DeletedString) (THIS_ const UINT32 ulId, const UINT32 ulParentID, const HXBOOL bIsParentNotify, @@ -2296,7 +2296,7 @@ DECLARE_INTERFACE_(IHXDeletedPropResponse, IUnknown) * pName - IN - name of the deleted Property (null-terminated) * pValue - IN - buffer value of the deleted Property */ - STDMETHOD(DeletedBuffer) (THIS_ + STDQT_METHOD(DeletedBuffer) (THIS_ const UINT32 ulId, const UINT32 ulParentID, const HXBOOL bIsParentNotify, @@ -2318,7 +2318,7 @@ DECLARE_INTERFACE_(IHXDeletedPropResponse, IUnknown) * pName - IN - name of the deleted Property (null-terminated) * nValue - IN - 64-bit integer value of the deleted Property */ - STDMETHOD(DeletedInt64) (THIS_ + STDQT_METHOD(DeletedInt64) (THIS_ const UINT32 ulId, const UINT32 ulParentID, const HXBOOL bIsParentNotify, @@ -2342,7 +2342,7 @@ DECLARE_INTERFACE_(IHXDeletedPropResponse, IUnknown) * pValue - IN - the pointer of the 64-bit integer reference Property * which has been deleted */ - STDMETHOD(DeletedInt64Ref) (THIS_ + STDQT_METHOD(DeletedInt64Ref) (THIS_ const UINT32 ulId, const UINT32 ulParentID, const HXBOOL bIsParentNotify, diff --git a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxplugn.h b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxplugn.h index 80461212..179e23ee 100644 --- a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxplugn.h +++ b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxplugn.h @@ -169,7 +169,7 @@ DECLARE_INTERFACE_(IHXPlugin, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -212,7 +212,7 @@ DECLARE_INTERFACE_(IHXPlugin, IUnknown) * pMoreInfoURL which is used in about UIs (can be NULL) * ulVersionNumber The version of this plugin. */ - STDMETHOD(GetPluginInfo) (THIS_ + STDQT_METHOD(GetPluginInfo) (THIS_ REF(HXBOOL) /*OUT*/ bMultipleLoad, REF(const char*) /*OUT*/ pDescription, REF(const char*) /*OUT*/ pCopyright, @@ -228,7 +228,7 @@ DECLARE_INTERFACE_(IHXPlugin, IUnknown) * so that the plugin can have access to the context for creation of * IHXBuffers and IMalloc. */ - STDMETHOD(InitPlugin) (THIS_ + STDQT_METHOD(InitPlugin) (THIS_ IUnknown* /*IN*/ pContext) PURE; }; @@ -261,7 +261,7 @@ DECLARE_INTERFACE_(IHXPluginEnumerator, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -290,7 +290,7 @@ DECLARE_INTERFACE_(IHXPluginEnumerator, IUnknown) * Return an instance (IUnknown) of the plugin * */ - STDMETHOD(GetPlugin) (THIS_ + STDQT_METHOD(GetPlugin) (THIS_ ULONG32 /*IN*/ ulIndex, REF(IUnknown*) /*OUT*/ pPlugin) PURE; @@ -330,7 +330,7 @@ DECLARE_INTERFACE_(IHXPluginGroupEnumerator, IUnknown) /* * IHXPluginGroupEnumerator methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -348,7 +348,7 @@ DECLARE_INTERFACE_(IHXPluginGroupEnumerator, IUnknown) * be called. * */ - STDMETHOD(Init) (THIS_ + STDQT_METHOD(Init) (THIS_ REFIID iid) PURE; @@ -371,7 +371,7 @@ DECLARE_INTERFACE_(IHXPluginGroupEnumerator, IUnknown) * Return an instance (IUnknown) of the plugin * */ - STDMETHOD(GetPlugin) (THIS_ + STDQT_METHOD(GetPlugin) (THIS_ UINT32 /*IN*/ ulIndex, REF(IUnknown*) /*OUT*/ pPlugin) PURE; @@ -404,7 +404,7 @@ DECLARE_INTERFACE_( IHXPluginSearchEnumerator, IUnknown ) /* * IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDQT_METHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef)(THIS) PURE; STDMETHOD_(ULONG32,Release)(THIS) PURE; @@ -441,7 +441,7 @@ DECLARE_INTERFACE_( IHXPluginSearchEnumerator, IUnknown ) * Returns an instance of the next plugin in the collection * */ - STDMETHOD(GetNextPlugin)( THIS_ REF(IUnknown*) pIUnkResult, + STDQT_METHOD(GetNextPlugin)( THIS_ REF(IUnknown*) pIUnkResult, IUnknown* pIUnkOuter ) PURE; /************************************************************************ @@ -452,7 +452,7 @@ DECLARE_INTERFACE_( IHXPluginSearchEnumerator, IUnknown ) * Gets information about the next plugin in the list * */ - STDMETHOD(GetNextPluginInfo)( THIS_ REF(IHXValues*) pRetValues ) PURE; + STDQT_METHOD(GetNextPluginInfo)( THIS_ REF(IHXValues*) pRetValues ) PURE; /************************************************************************ @@ -463,7 +463,7 @@ DECLARE_INTERFACE_( IHXPluginSearchEnumerator, IUnknown ) * Returns an instance of a plugin at a specific index in the list * */ - STDMETHOD(GetPluginAt)( THIS_ UINT32 index, + STDQT_METHOD(GetPluginAt)( THIS_ UINT32 index, REF(IUnknown*) pIUnkResult, IUnknown* pIUnkOuter ) PURE; @@ -475,7 +475,7 @@ DECLARE_INTERFACE_( IHXPluginSearchEnumerator, IUnknown ) * Returns information about a plugin at a specific index in the list * */ - STDMETHOD(GetPluginInfoAt)( THIS_ UINT32 index, + STDQT_METHOD(GetPluginInfoAt)( THIS_ UINT32 index, REF(IHXValues*) pRetValues ) PURE; }; @@ -509,7 +509,7 @@ DECLARE_INTERFACE_(IHXPluginReloader, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -528,7 +528,7 @@ DECLARE_INTERFACE_(IHXPluginReloader, IUnknown) * Causes the client core to reload all plugins. * */ - STDMETHOD(ReloadPlugins) (THIS) PURE; + STDQT_METHOD(ReloadPlugins) (THIS) PURE; }; @@ -563,7 +563,7 @@ DECLARE_INTERFACE_(IHXPluginFactory, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -594,7 +594,7 @@ DECLARE_INTERFACE_(IHXPluginFactory, IUnknown) * Parameters: */ - STDMETHOD(GetPlugin) (THIS_ + STDQT_METHOD(GetPlugin) (THIS_ UINT16 uIndex, IUnknown** pPlugin) PURE; }; @@ -631,7 +631,7 @@ DECLARE_INTERFACE_(IHXPluginChallenger, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -655,7 +655,7 @@ DECLARE_INTERFACE_(IHXPluginChallenger, IUnknown) * tVal A time value which may be used to create the * challenge response. */ - STDMETHOD(Challenge) (THIS_ + STDQT_METHOD(Challenge) (THIS_ HXTimeval /*IN*/ tVal, REF(IHXBuffer*) /*OUT*/ pResponse) PURE; }; @@ -699,7 +699,7 @@ DECLARE_INTERFACE_(IHXPluginQuery, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -719,7 +719,7 @@ DECLARE_INTERFACE_(IHXPluginQuery, IUnknown) * Gets the number of plugins associated with a particular class id. * */ - STDMETHOD(GetNumPluginsGivenGroup) (THIS_ REFIID riid, + STDQT_METHOD(GetNumPluginsGivenGroup) (THIS_ REFIID riid, REF(UINT32) /*OUT*/ unNumPlugins) PURE; /************************************************************************ @@ -730,7 +730,7 @@ DECLARE_INTERFACE_(IHXPluginQuery, IUnknown) * Gets the info of a particular plugin. * */ - STDMETHOD(GetPluginInfo) (THIS_ REFIID riid, + STDQT_METHOD(GetPluginInfo) (THIS_ REFIID riid, UINT32 unIndex, REF(IHXValues*) /*OUT*/ Values) PURE; }; // $EndPrivate. @@ -764,7 +764,7 @@ DECLARE_INTERFACE_(IHXGenericPlugin, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -776,7 +776,7 @@ DECLARE_INTERFACE_(IHXGenericPlugin, IUnknown) * IHXGenericPlugin methods */ - STDMETHOD(IsGeneric) (THIS_ + STDQT_METHOD(IsGeneric) (THIS_ REF(HXBOOL) /*OUT*/ bIsGeneric) PURE; }; @@ -793,7 +793,7 @@ DECLARE_INTERFACE_(IHXPlugin2Handler, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -813,7 +813,7 @@ DECLARE_INTERFACE_(IHXPlugin2Handler, IUnknown) * Specifies the context and sets the pluginhandler in motion. * */ - STDMETHOD(Init) (THIS_ IUnknown* pContext) PURE; + STDQT_METHOD(Init) (THIS_ IUnknown* pContext) PURE; /************************************************************************ * Method: @@ -833,7 +833,7 @@ DECLARE_INTERFACE_(IHXPlugin2Handler, IUnknown) * Gets the info of a particular plugin. * */ - STDMETHOD(GetPluginInfo) (THIS_ + STDQT_METHOD(GetPluginInfo) (THIS_ UINT32 unIndex, REF(IHXValues*) /*OUT*/ Values) PURE; @@ -846,7 +846,7 @@ DECLARE_INTERFACE_(IHXPlugin2Handler, IUnknown) * which currenltly have a refcount of 0. */ - STDMETHOD(FlushCache) (THIS) PURE; + STDQT_METHOD(FlushCache) (THIS) PURE; /************************************************************************ * Method: @@ -860,7 +860,7 @@ DECLARE_INTERFACE_(IHXPlugin2Handler, IUnknown) * cause performance problems. */ - STDMETHOD(SetCacheSize) (THIS_ ULONG32 nSizeKB) PURE; + STDQT_METHOD(SetCacheSize) (THIS_ ULONG32 nSizeKB) PURE; /************************************************************************ * Method: @@ -872,7 +872,7 @@ DECLARE_INTERFACE_(IHXPlugin2Handler, IUnknown) * */ - STDMETHOD(GetInstance) (THIS_ UINT32 index, REF(IUnknown*) pUnknown) PURE; + STDQT_METHOD(GetInstance) (THIS_ UINT32 index, REF(IUnknown*) pUnknown) PURE; /************************************************************************ * Method: @@ -885,7 +885,7 @@ DECLARE_INTERFACE_(IHXPlugin2Handler, IUnknown) * */ - STDMETHOD(FindIndexUsingValues) (THIS_ IHXValues*, + STDQT_METHOD(FindIndexUsingValues) (THIS_ IHXValues*, REF(UINT32) unIndex) PURE; /************************************************************************ @@ -898,7 +898,7 @@ DECLARE_INTERFACE_(IHXPlugin2Handler, IUnknown) * */ - STDMETHOD(FindPluginUsingValues) (THIS_ IHXValues*, + STDQT_METHOD(FindPluginUsingValues) (THIS_ IHXValues*, REF(IUnknown*) pUnk) PURE; /************************************************************************ @@ -912,7 +912,7 @@ DECLARE_INTERFACE_(IHXPlugin2Handler, IUnknown) * NOTE: that a max of two values may be given. */ - STDMETHOD(FindIndexUsingStrings) (THIS_ char* PropName1, + STDQT_METHOD(FindIndexUsingStrings) (THIS_ char* PropName1, char* PropVal1, char* PropName2, char* PropVal2, @@ -930,7 +930,7 @@ DECLARE_INTERFACE_(IHXPlugin2Handler, IUnknown) * NOTE: that a max of two values may be given. */ - STDMETHOD(FindPluginUsingStrings) (THIS_ char* PropName1, + STDQT_METHOD(FindPluginUsingStrings) (THIS_ char* PropName1, char* PropVal1, char* PropName2, char* PropVal2, @@ -947,7 +947,7 @@ DECLARE_INTERFACE_(IHXPlugin2Handler, IUnknown) * ClassID given. An instance of the Class is returned. */ - STDMETHOD(FindImplementationFromClassID) + STDQT_METHOD(FindImplementationFromClassID) ( THIS_ REFGUID GUIDClassID, @@ -964,7 +964,7 @@ DECLARE_INTERFACE_(IHXPlugin2Handler, IUnknown) * */ - STDMETHOD(Close) (THIS) PURE; + STDQT_METHOD(Close) (THIS) PURE; /************************************************************************ * Method: @@ -976,7 +976,7 @@ DECLARE_INTERFACE_(IHXPlugin2Handler, IUnknown) * */ - STDMETHOD(SetRequiredPlugins) (THIS_ const char** ppszRequiredPlugins) PURE; + STDQT_METHOD(SetRequiredPlugins) (THIS_ const char** ppszRequiredPlugins) PURE; }; @@ -1014,7 +1014,7 @@ DECLARE_INTERFACE_(IHXPluginHandler3, IUnknown) * Sets up the context without loading any plugin info * */ - STDMETHOD( RegisterContext )( THIS_ IUnknown* pContext ) PURE; + STDQT_METHOD( RegisterContext )( THIS_ IUnknown* pContext ) PURE; /************************************************************************ * Method: @@ -1024,7 +1024,7 @@ DECLARE_INTERFACE_(IHXPluginHandler3, IUnknown) * Sets up the plugins stored in this preferences object * */ - STDMETHOD( AddPluginMountPoint )( THIS_ const char* pName, UINT32 majorVersion, + STDQT_METHOD( AddPluginMountPoint )( THIS_ const char* pName, UINT32 majorVersion, UINT32 minorVersion, IHXBuffer* pPath ) PURE; @@ -1036,7 +1036,7 @@ DECLARE_INTERFACE_(IHXPluginHandler3, IUnknown) * Refreshes plugin information associated with this * preferences object */ - STDMETHOD( RefreshPluginMountPoint )( THIS_ const char* pName ) PURE; + STDQT_METHOD( RefreshPluginMountPoint )( THIS_ const char* pName ) PURE; /************************************************************************ @@ -1046,7 +1046,7 @@ DECLARE_INTERFACE_(IHXPluginHandler3, IUnknown) * Purpose: * Removes plugins associated with this preferences object */ - STDMETHOD( RemovePluginMountPoint )( THIS_ const char* pName ) PURE; + STDQT_METHOD( RemovePluginMountPoint )( THIS_ const char* pName ) PURE; /************************************************************************ @@ -1060,7 +1060,7 @@ DECLARE_INTERFACE_(IHXPluginHandler3, IUnknown) * context */ - STDMETHOD( FindImplementationFromClassID )( THIS_ REFGUID GUIDClassID, + STDQT_METHOD( FindImplementationFromClassID )( THIS_ REFGUID GUIDClassID, REF(IUnknown*) pIUnknownInstance, IUnknown* pIUnkOuter, IUnknown* pContext ) PURE; @@ -1073,7 +1073,7 @@ DECLARE_INTERFACE_(IHXPluginHandler3, IUnknown) * Maps a text name to a CLSID based on information from * component plugins */ - STDMETHOD( FindCLSIDFromName )( THIS_ const char* pName, REF(IHXBuffer*) pCLSID ) PURE; + STDQT_METHOD( FindCLSIDFromName )( THIS_ const char* pName, REF(IHXBuffer*) pCLSID ) PURE; /************************************************************************ @@ -1084,7 +1084,7 @@ DECLARE_INTERFACE_(IHXPluginHandler3, IUnknown) * Builds a collection of plugins that match the criteria * */ - STDMETHOD(FindGroupOfPluginsUsingValues)(THIS_ IHXValues* pValues, + STDQT_METHOD(FindGroupOfPluginsUsingValues)(THIS_ IHXValues* pValues, REF(IHXPluginSearchEnumerator*) pIEnumerator) PURE; /************************************************************************ @@ -1095,7 +1095,7 @@ DECLARE_INTERFACE_(IHXPluginHandler3, IUnknown) * Builds a collection of plugins that match the criteria * */ - STDMETHOD(FindGroupOfPluginsUsingStrings)(THIS_ char* PropName1, + STDQT_METHOD(FindGroupOfPluginsUsingStrings)(THIS_ char* PropName1, char* PropVal1, char* PropName2, char* PropVal2, @@ -1112,7 +1112,7 @@ DECLARE_INTERFACE_(IHXPluginHandler3, IUnknown) * Allocates a plugin based on index. Supports aggregation * */ - STDMETHOD(GetPlugin)(THIS_ ULONG32 ulIndex, + STDQT_METHOD(GetPlugin)(THIS_ ULONG32 ulIndex, REF(IUnknown*) pIUnkResult, IUnknown* pIUnkOuter ) PURE; @@ -1124,7 +1124,7 @@ DECLARE_INTERFACE_(IHXPluginHandler3, IUnknown) * Allocates a plugin based on criteria. Supports aggregation * */ - STDMETHOD(FindPluginUsingValues)(THIS_ IHXValues*, + STDQT_METHOD(FindPluginUsingValues)(THIS_ IHXValues*, REF(IUnknown*) pIUnkResult, IUnknown* pIUnkOuter ) PURE; @@ -1137,7 +1137,7 @@ DECLARE_INTERFACE_(IHXPluginHandler3, IUnknown) * Allocates a plugin based on criteria. Supports aggregation * */ - STDMETHOD(FindPluginUsingStrings)(THIS_ char* PropName1, + STDQT_METHOD(FindPluginUsingStrings)(THIS_ char* PropName1, char* PropVal1, char* PropName2, char* PropVal2, @@ -1155,7 +1155,7 @@ DECLARE_INTERFACE_(IHXPluginHandler3, IUnknown) * and returns TRUE in response to query */ - STDMETHOD( UnloadPluginFromClassID )( THIS_ REFGUID GUIDClassID ) PURE; + STDQT_METHOD( UnloadPluginFromClassID )( THIS_ REFGUID GUIDClassID ) PURE; /************************************************************************ * Method: @@ -1164,7 +1164,7 @@ DECLARE_INTERFACE_(IHXPluginHandler3, IUnknown) * Purpose: * finds a package from the name passed in and attempts to unload it. */ - STDMETHOD (UnloadPackageByName) (char const* pName) PURE; + STDQT_METHOD (UnloadPackageByName) (char const* pName) PURE; }; // $EndPrivate. @@ -1212,7 +1212,7 @@ DECLARE_INTERFACE_(IHXPluginDatabase, IUnknown) * Create a new index in the plugin-handler * */ - STDMETHOD( AddPluginIndex ) ( THIS_ const char* pKeyName, EPluginIndexType indexType, HXBOOL bScanExisting ) PURE; + STDQT_METHOD( AddPluginIndex ) ( THIS_ const char* pKeyName, EPluginIndexType indexType, HXBOOL bScanExisting ) PURE; /************************************************************************ * Method: @@ -1222,7 +1222,7 @@ DECLARE_INTERFACE_(IHXPluginDatabase, IUnknown) * Remove an index from the plugin handler * */ - STDMETHOD( RemovePluginIndex )( THIS_ const char* pKeyName ) PURE; + STDQT_METHOD( RemovePluginIndex )( THIS_ const char* pKeyName ) PURE; /************************************************************************ @@ -1234,7 +1234,7 @@ DECLARE_INTERFACE_(IHXPluginDatabase, IUnknown) * possible, otherwise defer to a linear search * */ - STDMETHOD( FindPluginInfoViaIndex )( THIS_ const char* pKeyName, const void* pValue, IHXValues** ppIInfo ) PURE; + STDQT_METHOD( FindPluginInfoViaIndex )( THIS_ const char* pKeyName, const void* pValue, IHXValues** ppIInfo ) PURE; /************************************************************************ * Method: @@ -1245,7 +1245,7 @@ DECLARE_INTERFACE_(IHXPluginDatabase, IUnknown) * Find a set of plugins matching a single attribute * */ - STDMETHOD( FindPluginSetViaIndex )( THIS_ const char* pKeyName, const void* pValue, IHXPluginSearchEnumerator** ppIEnumerator ) PURE; + STDQT_METHOD( FindPluginSetViaIndex )( THIS_ const char* pKeyName, const void* pValue, IHXPluginSearchEnumerator** ppIEnumerator ) PURE; /************************************************************************ * Method: @@ -1255,7 +1255,7 @@ DECLARE_INTERFACE_(IHXPluginDatabase, IUnknown) * Create a plugin based on a simple attribute. * */ - STDMETHOD( CreatePluginViaIndex )( THIS_ const char* pKeyName, const void* pValue, IUnknown** ppIUnkPlugin, IUnknown* pIUnkOuter ) PURE; + STDQT_METHOD( CreatePluginViaIndex )( THIS_ const char* pKeyName, const void* pValue, IUnknown** ppIUnkPlugin, IUnknown* pIUnkOuter ) PURE; }; // $EndPrivate. @@ -1289,7 +1289,7 @@ DECLARE_INTERFACE_(IHXProxiedPlugin, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1307,7 +1307,7 @@ DECLARE_INTERFACE_(IHXProxiedPlugin, IUnknown) * Purpose: * Gets the Actual Plugin being used... */ - STDMETHOD(GetProxiedPlugin)(THIS_ + STDQT_METHOD(GetProxiedPlugin)(THIS_ REF(IHXPlugin*) /*OUT*/ pPlugin) PURE; }; @@ -1368,14 +1368,14 @@ DECLARE_INTERFACE_(IHXComponentPlugin, IUnknown) * IHXComponentPlugin::GetPackageName * Purpose: */ - STDMETHOD_(char const*, GetPackageName)(THIS) CONSTMETHOD PURE; + STDMETHOD_(char const*, GetPackageName)(THIS) CONSTQT_METHOD PURE; /************************************************************************ * Method: * IHXComponentPlugin::GetComponentInfoAtIndex * Purpose: */ - STDMETHOD(GetComponentInfoAtIndex) (THIS_ + STDQT_METHOD(GetComponentInfoAtIndex) (THIS_ UINT32 /*IN*/ nIndex, REF(IHXValues*) /*OUT*/ pInfo) PURE; @@ -1384,7 +1384,7 @@ DECLARE_INTERFACE_(IHXComponentPlugin, IUnknown) * IHXComponentPlugin::CreateComponentInstance * Purpose: */ - STDMETHOD(CreateComponentInstance)(THIS_ + STDQT_METHOD(CreateComponentInstance)(THIS_ REFCLSID /*IN*/ rclsid, REF(IUnknown*) /*OUT*/ ppUnknown, IUnknown* /*IN*/ pUnkOuter) PURE; @@ -1415,7 +1415,7 @@ DECLARE_INTERFACE_(IHXPluginNamespace, IUnknown) * IHXPluginNamespace::GetPluginNamespace * Purpose: */ - STDMETHOD(GetPluginNamespace) (THIS_ + STDQT_METHOD(GetPluginNamespace) (THIS_ REF(IHXBuffer*) /*OUT*/ pBuffer) PURE; }; diff --git a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxprefs.h b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxprefs.h index 4750c4c3..2a2b3a08 100644 --- a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxprefs.h +++ b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxprefs.h @@ -114,7 +114,7 @@ DECLARE_INTERFACE_(IHXPreferences, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -132,7 +132,7 @@ DECLARE_INTERFACE_(IHXPreferences, IUnknown) * Purpose: * Read a preference from the registry or configuration. */ - STDMETHOD(ReadPref) (THIS_ + STDQT_METHOD(ReadPref) (THIS_ const char* pPrekKey, REF(IHXBuffer*) pBuffer) PURE; /************************************************************************ @@ -141,7 +141,7 @@ DECLARE_INTERFACE_(IHXPreferences, IUnknown) * Purpose: * TBD */ - STDMETHOD(WritePref) (THIS_ + STDQT_METHOD(WritePref) (THIS_ const char* pPrekKey, IHXBuffer* pBuffer) PURE; }; @@ -174,7 +174,7 @@ DECLARE_INTERFACE_(IHXPreferenceEnumerator, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -193,7 +193,7 @@ DECLARE_INTERFACE_(IHXPreferenceEnumerator, IUnknown) * TBD */ - STDMETHOD(BeginSubPref) (THIS_ const char* szSubPref) PURE; + STDQT_METHOD(BeginSubPref) (THIS_ const char* szSubPref) PURE; /************************************************************************ @@ -203,7 +203,7 @@ DECLARE_INTERFACE_(IHXPreferenceEnumerator, IUnknown) * TBD */ - STDMETHOD(EndSubPref) (THIS) PURE; + STDQT_METHOD(EndSubPref) (THIS) PURE; /************************************************************************ * Method: @@ -212,7 +212,7 @@ DECLARE_INTERFACE_(IHXPreferenceEnumerator, IUnknown) * TBD */ - STDMETHOD(GetPrefKey) (THIS_ UINT32 nIndex, REF(IHXBuffer*) pBuffer) PURE; + STDQT_METHOD(GetPrefKey) (THIS_ UINT32 nIndex, REF(IHXBuffer*) pBuffer) PURE; /************************************************************************ * Method: @@ -220,7 +220,7 @@ DECLARE_INTERFACE_(IHXPreferenceEnumerator, IUnknown) * Purpose: * TBD */ - STDMETHOD(ReadPref) (THIS_ + STDQT_METHOD(ReadPref) (THIS_ const char* pPrefKey, IHXBuffer*& pBuffer) PURE; }; @@ -255,7 +255,7 @@ DECLARE_INTERFACE_(IHXPreferences2, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -274,7 +274,7 @@ DECLARE_INTERFACE_(IHXPreferences2, IUnknown) * Read a preference from the registry or configuration. */ - STDMETHOD(GetPreferenceEnumerator)(THIS_ REF(IHXPreferenceEnumerator*) /*OUT*/ pEnum) PURE; + STDQT_METHOD(GetPreferenceEnumerator)(THIS_ REF(IHXPreferenceEnumerator*) /*OUT*/ pEnum) PURE; /************************************************************************ * Method: @@ -283,7 +283,7 @@ DECLARE_INTERFACE_(IHXPreferences2, IUnknown) * Reset the root of the preferences */ - STDMETHOD(ResetRoot)(THIS_ const char* pCompanyName, const char* pProductName, + STDQT_METHOD(ResetRoot)(THIS_ const char* pCompanyName, const char* pProductName, int nProdMajorVer, int nProdMinorVer) PURE; }; @@ -321,7 +321,7 @@ DECLARE_INTERFACE_(IHXPreferences3, IUnknown) * Open a specified collection of preferences */ - STDMETHOD( Open )(THIS_ const char* pCompanyName, const char* pProductName, + STDQT_METHOD( Open )(THIS_ const char* pCompanyName, const char* pProductName, ULONG32 nProdMajorVer, ULONG32 nProdMinorVer) PURE; /************************************************************************ @@ -331,7 +331,7 @@ DECLARE_INTERFACE_(IHXPreferences3, IUnknown) * Have this preference object read/write from the company wide * shared location for all products */ - STDMETHOD( OpenShared )( THIS_ const char* pCompanyName) PURE; + STDQT_METHOD( OpenShared )( THIS_ const char* pCompanyName) PURE; /************************************************************************ * Method: @@ -340,7 +340,7 @@ DECLARE_INTERFACE_(IHXPreferences3, IUnknown) * Delete a preference */ - STDMETHOD(DeletePref)( THIS_ const char* pPrekKey ) PURE; + STDQT_METHOD(DeletePref)( THIS_ const char* pPrekKey ) PURE; }; // $EndPrivate. diff --git a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxtbuf.h b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxtbuf.h index d7e1b92c..fcfff134 100644 --- a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxtbuf.h +++ b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxtbuf.h @@ -44,7 +44,7 @@ DECLARE_INTERFACE_(IHXTimeStampedBuffer, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -57,7 +57,7 @@ DECLARE_INTERFACE_(IHXTimeStampedBuffer, IUnknown) */ STDMETHOD_(UINT32,GetTimeStamp)(THIS) PURE; - STDMETHOD(SetTimeStamp)(THIS_ + STDQT_METHOD(SetTimeStamp)(THIS_ UINT32 ulTimeStamp) PURE; }; diff --git a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxvalue.h b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxvalue.h index 6d201641..de321d7e 100644 --- a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxvalue.h +++ b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxvalue.h @@ -58,7 +58,7 @@ DECLARE_INTERFACE_(IHXKeyValueList, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -77,7 +77,7 @@ DECLARE_INTERFACE_(IHXKeyValueList, IUnknown) * Add a new key/value tuple to our list of strings. You can have * multiple strings for the same key. */ - STDMETHOD(AddKeyValue) (THIS_ + STDQT_METHOD(AddKeyValue) (THIS_ const char* pKey, IHXBuffer* pStr) PURE; @@ -88,7 +88,7 @@ DECLARE_INTERFACE_(IHXKeyValueList, IUnknown) * Return an iterator that allows you to iterate through all the * key/value tuples in our list of strings. */ - STDMETHOD(GetIter) (THIS_ + STDQT_METHOD(GetIter) (THIS_ REF(IHXKeyValueListIter*) pIter) PURE; @@ -99,7 +99,7 @@ DECLARE_INTERFACE_(IHXKeyValueList, IUnknown) * Return an iterator that allows you to iterate through all the * strings for a particular key. */ - STDMETHOD(GetIterOneKey) (THIS_ + STDQT_METHOD(GetIterOneKey) (THIS_ const char* pKey, REF(IHXKeyValueListIterOneKey*) pIter) PURE; @@ -110,7 +110,7 @@ DECLARE_INTERFACE_(IHXKeyValueList, IUnknown) * Append all the key/string tuples from another list to this list. * (You can have duplicate keys.) */ - STDMETHOD(AppendAllListItems) (THIS_ + STDQT_METHOD(AppendAllListItems) (THIS_ IHXKeyValueList* pList) PURE; /************************************************************************ * Method: @@ -127,7 +127,7 @@ DECLARE_INTERFACE_(IHXKeyValueList, IUnknown) * Purpose: * Create an empty object that is the same class as the current object. */ - STDMETHOD(CreateObject) (THIS_ + STDQT_METHOD(CreateObject) (THIS_ REF(IHXKeyValueList*) pNewList) PURE; /************************************************************************ @@ -139,7 +139,7 @@ DECLARE_INTERFACE_(IHXKeyValueList, IUnknown) * ULONGs and Buffers. You can have duplicate keys, and old data is * left untouched. */ - STDMETHOD(ImportValues) (THIS_ + STDQT_METHOD(ImportValues) (THIS_ IHXValues* pValues) PURE; }; @@ -174,7 +174,7 @@ DECLARE_INTERFACE_(IHXKeyValueListIter, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -195,7 +195,7 @@ DECLARE_INTERFACE_(IHXKeyValueListIter, IUnknown) * list of strings. Strings are returned in same order that they * were inserted. */ - STDMETHOD(GetNextPair) (THIS_ + STDQT_METHOD(GetNextPair) (THIS_ REF(const char*) pKey, REF(IHXBuffer*) pStr) PURE; @@ -206,7 +206,7 @@ DECLARE_INTERFACE_(IHXKeyValueListIter, IUnknown) * Replaces the value in the key/value tuple that was returned * in the last call to GetNextPair with a new string. */ - STDMETHOD(ReplaceCurr) (THIS_ + STDQT_METHOD(ReplaceCurr) (THIS_ IHXBuffer* pStr) PURE; }; @@ -241,7 +241,7 @@ DECLARE_INTERFACE_(IHXKeyValueListIterOneKey, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -263,7 +263,7 @@ DECLARE_INTERFACE_(IHXKeyValueListIterOneKey, IUnknown) * were inserted. * */ - STDMETHOD(GetNextString) (THIS_ + STDQT_METHOD(GetNextString) (THIS_ REF(IHXBuffer*) pStr) PURE; /************************************************************************ @@ -274,7 +274,7 @@ DECLARE_INTERFACE_(IHXKeyValueListIterOneKey, IUnknown) * in the last call to GetNextString with a new string. * */ - STDMETHOD(ReplaceCurr) (THIS_ + STDQT_METHOD(ReplaceCurr) (THIS_ IHXBuffer* pStr) PURE; }; @@ -310,7 +310,7 @@ DECLARE_INTERFACE_(IHXOptions, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -335,7 +335,7 @@ DECLARE_INTERFACE_(IHXOptions, IUnknown) * the current setting for that option. * */ - STDMETHOD(GetOptions) (THIS_ + STDQT_METHOD(GetOptions) (THIS_ REF(IHXValues*) pOptions) PURE; /************************************************************************ @@ -346,7 +346,7 @@ DECLARE_INTERFACE_(IHXOptions, IUnknown) * whether or not the SetOptionULONG32 call succeeded. * */ - STDMETHOD(SetOptionULONG32) (THIS_ + STDQT_METHOD(SetOptionULONG32) (THIS_ const char* pName, ULONG32 ulValue) PURE; @@ -358,7 +358,7 @@ DECLARE_INTERFACE_(IHXOptions, IUnknown) * whether or not the SetOptionCString call succeeded. * */ - STDMETHOD(SetOptionCString) (THIS_ + STDQT_METHOD(SetOptionCString) (THIS_ const char* pName, IHXBuffer* pValue) PURE; @@ -370,7 +370,7 @@ DECLARE_INTERFACE_(IHXOptions, IUnknown) * whether or not the SetOptionBuffer call succeeded. * */ - STDMETHOD(SetOptionBuffer) (THIS_ + STDQT_METHOD(SetOptionBuffer) (THIS_ const char* pName, IHXBuffer* pValue) PURE; }; diff --git a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxvsrc.h b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxvsrc.h index 747aa319..f4d4c368 100644 --- a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxvsrc.h +++ b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxvsrc.h @@ -59,20 +59,20 @@ DECLARE_INTERFACE_(IHXFileViewSource, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; STDMETHOD_(ULONG32,Release) (THIS) PURE; /************************************************************************ * IHXFileViewSource */ - STDMETHOD(InitViewSource) (THIS_ + STDQT_METHOD(InitViewSource) (THIS_ IHXFileObject* /*IN*/ pFileObject, IHXFileViewSourceResponse* /*IN*/ pResp, SOURCE_TYPE /*IN*/ sourceType, IHXValues* /*IN*/ pOptions) PURE; - STDMETHOD(GetSource) (THIS) PURE; - STDMETHOD(Close) (THIS) PURE; + STDQT_METHOD(GetSource) (THIS) PURE; + STDQT_METHOD(Close) (THIS) PURE; }; /**************************************************************************** @@ -98,17 +98,17 @@ DECLARE_INTERFACE_(IHXFileViewSourceResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; STDMETHOD_(ULONG32,Release) (THIS) PURE; /************************************************************************ * IHXFileViewSourceResoponse */ - STDMETHOD(InitDone) (THIS_ HX_RESULT status ) PURE; - STDMETHOD(SourceReady) (THIS_ HX_RESULT status, + STDQT_METHOD(InitDone) (THIS_ HX_RESULT status ) PURE; + STDQT_METHOD(SourceReady) (THIS_ HX_RESULT status, IHXBuffer* pSource ) PURE; - STDMETHOD(CloseDone) (THIS_ HX_RESULT) PURE; + STDQT_METHOD(CloseDone) (THIS_ HX_RESULT) PURE; }; /**************************************************************************** @@ -133,7 +133,7 @@ DECLARE_INTERFACE_(IHXViewSourceCommand, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; STDMETHOD_(ULONG32,Release) (THIS) PURE; @@ -142,9 +142,9 @@ DECLARE_INTERFACE_(IHXViewSourceCommand, IUnknown) */ STDMETHOD_(HXBOOL, CanViewSource) (THIS_ IHXStreamSource* pStream) PURE; - STDMETHOD(DoViewSource) (THIS_ + STDQT_METHOD(DoViewSource) (THIS_ IHXStreamSource* pStream) PURE; - STDMETHOD(GetViewSourceURL) (THIS_ + STDQT_METHOD(GetViewSourceURL) (THIS_ IHXStreamSource* pSource, IHXViewSourceURLResponse* pResp) PURE; }; @@ -171,14 +171,14 @@ DECLARE_INTERFACE_(IHXViewSourceURLResponse, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; STDMETHOD_(ULONG32,Release) (THIS) PURE; /************************************************************************ * IHXViewSourceURLResponse */ - STDMETHOD(ViewSourceURLReady) (THIS_ + STDQT_METHOD(ViewSourceURLReady) (THIS_ const char* /*out*/ pUrl) PURE; }; @@ -205,20 +205,20 @@ DECLARE_INTERFACE_(IHXClientViewSource, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; STDMETHOD_(ULONG32,Release) (THIS) PURE; /************************************************************************ * IHXClientViewSource */ - STDMETHOD(DoViewSource) (THIS_ + STDQT_METHOD(DoViewSource) (THIS_ IUnknown* /*IN*/ pPlayerContext, IHXStreamSource* /*IN*/ pSource) PURE; STDMETHOD_(HXBOOL, CanViewSource) (THIS_ IHXStreamSource* /*IN*/ pSource) PURE; - STDMETHOD(GetViewSourceURL) (THIS_ + STDQT_METHOD(GetViewSourceURL) (THIS_ IUnknown* pPlayerContext, IHXStreamSource* pSource, IHXViewSourceURLResponse* pResp) PURE; @@ -247,14 +247,14 @@ DECLARE_INTERFACE_(IHXClientViewSourceSink, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; STDMETHOD_(ULONG32,Release) (THIS) PURE; /************************************************************************ * IHXClientViewSourceSink */ - STDMETHOD(RegisterViewSourceHdlr) (THIS_ + STDQT_METHOD(RegisterViewSourceHdlr) (THIS_ IHXClientViewSource* /*in*/ pViewSourceHdlr) PURE; }; @@ -280,14 +280,14 @@ DECLARE_INTERFACE_(IHXClientViewRights, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; STDMETHOD_(ULONG32,Release) (THIS) PURE; /************************************************************************ * IHXClientViewRights */ - STDMETHOD(ViewRights) (THIS_ + STDQT_METHOD(ViewRights) (THIS_ IUnknown* /*IN*/ pPlayerContext) PURE; STDMETHOD_(HXBOOL, CanViewRights) (THIS) PURE; diff --git a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxwin.h b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxwin.h index d7cd38fd..2aefb311 100644 --- a/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxwin.h +++ b/amarok/src/engine/helix/helix-sp/helix-include/common/include/hxwin.h @@ -102,7 +102,7 @@ DECLARE_INTERFACE_(IHXSiteWindowed, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -122,21 +122,21 @@ DECLARE_INTERFACE_(IHXSiteWindowed, IUnknown) * of Site. * */ - STDMETHOD(AttachWindow) (THIS_ + STDQT_METHOD(AttachWindow) (THIS_ HXxWindow* /*IN*/ pWindow) PURE; - STDMETHOD(DetachWindow) (THIS) PURE; + STDQT_METHOD(DetachWindow) (THIS) PURE; /* * IHXSiteWindowed methods called by Owners of the site * in the event that want a default top level window created * for the site. */ - STDMETHOD(Create) (THIS_ + STDQT_METHOD(Create) (THIS_ void* ParentWindow, UINT32 style) PURE; - STDMETHOD(Destroy) (THIS) PURE; + STDQT_METHOD(Destroy) (THIS) PURE; /* * IHXSiteWindowed method. Returns actual window of the site. @@ -175,7 +175,7 @@ DECLARE_INTERFACE_(IHXSiteEventHandler, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -188,7 +188,7 @@ DECLARE_INTERFACE_(IHXSiteEventHandler, IUnknown) * The imeplementation of this interface must pass the events * on to the individual CHXSiteWindowed sites. */ - STDMETHOD(EventOccurred) (THIS_ HXxEvent* pEvent) PURE; + STDQT_METHOD(EventOccurred) (THIS_ HXxEvent* pEvent) PURE; }; // $EndPrivate. @@ -222,7 +222,7 @@ DECLARE_INTERFACE_(IHXSiteWindowless, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -233,7 +233,7 @@ DECLARE_INTERFACE_(IHXSiteWindowless, IUnknown) /* * IHXSiteWindowless methods called by owners of the site. */ - STDMETHOD(EventOccurred) (THIS_ + STDQT_METHOD(EventOccurred) (THIS_ HXxEvent* /*IN*/ pEvent) PURE; /* @@ -271,7 +271,7 @@ DECLARE_INTERFACE_(IHXSite, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -284,19 +284,19 @@ DECLARE_INTERFACE_(IHXSite, IUnknown) * associate users with the site, and to create child sites * as appropriate. */ - STDMETHOD(AttachUser) (THIS_ + STDQT_METHOD(AttachUser) (THIS_ IHXSiteUser* /*IN*/ pUser) PURE; - STDMETHOD(DetachUser) (THIS) PURE; + STDQT_METHOD(DetachUser) (THIS) PURE; - STDMETHOD(GetUser) (THIS_ + STDQT_METHOD(GetUser) (THIS_ REF(IHXSiteUser*) /*OUT*/ pUser) PURE; - STDMETHOD(CreateChild) (THIS_ + STDQT_METHOD(CreateChild) (THIS_ REF(IHXSite*) /*OUT*/ pChildSite) PURE; - STDMETHOD(DestroyChild) (THIS_ + STDQT_METHOD(DestroyChild) (THIS_ IHXSite* /*IN*/ pChildSite) PURE; /* @@ -304,34 +304,34 @@ DECLARE_INTERFACE_(IHXSite, IUnknown) * is displayed in order to manage its position. Site users should * not generally call these methods. */ - STDMETHOD(AttachWatcher) (THIS_ + STDQT_METHOD(AttachWatcher) (THIS_ IHXSiteWatcher* /*IN*/ pWatcher) PURE; - STDMETHOD(DetachWatcher) (THIS) PURE; + STDQT_METHOD(DetachWatcher) (THIS) PURE; - STDMETHOD(SetPosition) (THIS_ + STDQT_METHOD(SetPosition) (THIS_ HXxPoint position) PURE; - STDMETHOD(GetPosition) (THIS_ + STDQT_METHOD(GetPosition) (THIS_ REF(HXxPoint) position) PURE; /* * IHXSite methods called by the user of the site to get * information about the site, and to manipulate the site. */ - STDMETHOD(SetSize) (THIS_ + STDQT_METHOD(SetSize) (THIS_ HXxSize size) PURE; - STDMETHOD(GetSize) (THIS_ + STDQT_METHOD(GetSize) (THIS_ REF(HXxSize) size) PURE; - STDMETHOD(DamageRect) (THIS_ + STDQT_METHOD(DamageRect) (THIS_ HXxRect rect) PURE; - STDMETHOD(DamageRegion) (THIS_ + STDQT_METHOD(DamageRegion) (THIS_ HXxRegion region) PURE; - STDMETHOD(ForceRedraw) (THIS) PURE; + STDQT_METHOD(ForceRedraw) (THIS) PURE; }; @@ -362,15 +362,15 @@ DEFINE_GUID(IID_IHXSiteComposition, 0x00000D19, 0x901, 0x11d1, 0x8b, 0x6, 0x0, DECLARE_INTERFACE_(IHXSiteComposition, IUnknown) { /* IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; STDMETHOD_(ULONG32,Release) (THIS) PURE; /* IHXSiteComposition methods. */ - STDMETHOD(LockComposition) (THIS) PURE; - STDMETHOD(UnlockComposition) (THIS) PURE; - STDMETHOD(BltComposition) (THIS) PURE; - STDMETHOD(SetCompositionMode) (THIS_ HXBOOL OnOrOff) PURE; + STDQT_METHOD(LockComposition) (THIS) PURE; + STDQT_METHOD(UnlockComposition) (THIS) PURE; + STDQT_METHOD(BltComposition) (THIS) PURE; + STDQT_METHOD(SetCompositionMode) (THIS_ HXBOOL OnOrOff) PURE; STDMETHOD_(HXBOOL, IsCompositionLocked) (THIS) PURE; STDMETHOD_(HXBOOL, IsCompositionMode) (THIS) PURE; }; @@ -403,7 +403,7 @@ DECLARE_INTERFACE_(IHXSiteUser, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -415,15 +415,15 @@ DECLARE_INTERFACE_(IHXSiteUser, IUnknown) * IHXSiteUser methods usually called by the "context" to * associate users with the site. */ - STDMETHOD(AttachSite) (THIS_ + STDQT_METHOD(AttachSite) (THIS_ IHXSite* /*IN*/ pSite) PURE; - STDMETHOD(DetachSite) (THIS) PURE; + STDQT_METHOD(DetachSite) (THIS) PURE; /* * IHXSiteUser methods called to inform user of an event. */ - STDMETHOD(HandleEvent) (THIS_ + STDQT_METHOD(HandleEvent) (THIS_ HXxEvent* /*IN*/ pEvent) PURE; STDMETHOD_(HXBOOL,NeedsWindowedSites) (THIS) PURE; @@ -455,7 +455,7 @@ DECLARE_INTERFACE_(IHXSiteWatcher, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -467,10 +467,10 @@ DECLARE_INTERFACE_(IHXSiteWatcher, IUnknown) * IHXSiteWatcher methods called by the site when a watcher * is attached to or detached from it. */ - STDMETHOD(AttachSite) (THIS_ + STDQT_METHOD(AttachSite) (THIS_ IHXSite* /*IN*/ pSite) PURE; - STDMETHOD(DetachSite) (THIS) PURE; + STDQT_METHOD(DetachSite) (THIS) PURE; /* * IHXSiteWatcher methods called by the site an attempt is @@ -480,11 +480,11 @@ DECLARE_INTERFACE_(IHXSiteWatcher, IUnknown) * will not change. The site watcher can also modify the new * size of position. */ - STDMETHOD(ChangingPosition) (THIS_ + STDQT_METHOD(ChangingPosition) (THIS_ HXxPoint posOld, REF(HXxPoint)/*IN-OUT*/ posNew) PURE; - STDMETHOD(ChangingSize) (THIS_ + STDQT_METHOD(ChangingSize) (THIS_ HXxSize sizeOld, REF(HXxSize) /*IN-OUT*/ sizeNew) PURE; }; @@ -517,7 +517,7 @@ DECLARE_INTERFACE_(IHXSiteUserSupplier, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -530,10 +530,10 @@ DECLARE_INTERFACE_(IHXSiteUserSupplier, IUnknown) * "context" to ask for additional or to release previously * created site users. */ - STDMETHOD(CreateSiteUser) (THIS_ + STDQT_METHOD(CreateSiteUser) (THIS_ REF(IHXSiteUser*)/*OUT*/ pSiteUser) PURE; - STDMETHOD(DestroySiteUser) (THIS_ + STDQT_METHOD(DestroySiteUser) (THIS_ IHXSiteUser* /*IN*/ pSiteUser) PURE; STDMETHOD_(HXBOOL,NeedsWindowedSites) (THIS) PURE; @@ -568,7 +568,7 @@ DECLARE_INTERFACE_(IHXSiteSupplier, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -592,7 +592,7 @@ DECLARE_INTERFACE_(IHXSiteSupplier, IUnknown) * the client core will inform the site supplier when this requested * site is no longer needed. */ - STDMETHOD(SitesNeeded) (THIS_ + STDQT_METHOD(SitesNeeded) (THIS_ UINT32 uReqestID, IHXValues* pSiteProps) PURE; @@ -606,7 +606,7 @@ DECLARE_INTERFACE_(IHXSiteSupplier, IUnknown) * to fulfill a request for sites it should call the site manager * and remove those sites. */ - STDMETHOD(SitesNotNeeded) (THIS_ + STDQT_METHOD(SitesNotNeeded) (THIS_ UINT32 uReqestID) PURE; @@ -618,7 +618,7 @@ DECLARE_INTERFACE_(IHXSiteSupplier, IUnknown) * it can expect to receive SitesNeeded() and SitesNotNeeded() calls * while a layout change is in progress, */ - STDMETHOD(BeginChangeLayout) (THIS) PURE; + STDQT_METHOD(BeginChangeLayout) (THIS) PURE; /************************************************************************ * Method: @@ -627,7 +627,7 @@ DECLARE_INTERFACE_(IHXSiteSupplier, IUnknown) * Called to inform the site supplier the layout change has been * completed. */ - STDMETHOD(DoneChangeLayout) (THIS) PURE; + STDQT_METHOD(DoneChangeLayout) (THIS) PURE; }; @@ -660,7 +660,7 @@ DECLARE_INTERFACE_(IHXSiteManager, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -678,7 +678,7 @@ DECLARE_INTERFACE_(IHXSiteManager, IUnknown) * Purpose: * Called to inform the site manager of the existence of a site. */ - STDMETHOD(AddSite) (THIS_ + STDQT_METHOD(AddSite) (THIS_ IHXSite* pSite) PURE; /************************************************************************ @@ -688,7 +688,7 @@ DECLARE_INTERFACE_(IHXSiteManager, IUnknown) * Called to inform the site manager that a site is no longer * available. */ - STDMETHOD(RemoveSite) (THIS_ + STDQT_METHOD(RemoveSite) (THIS_ IHXSite* pSite) PURE; }; @@ -730,7 +730,7 @@ DECLARE_INTERFACE_(IHXSiteManager2, IUnknown) * Called to get the number of sites that the site mananger currently * knows about. */ - STDMETHOD(GetNumberOfSites) (THIS_ REF(UINT32) nNumSites ) PURE; + STDQT_METHOD(GetNumberOfSites) (THIS_ REF(UINT32) nNumSites ) PURE; /************************************************************************ * Method: @@ -739,7 +739,7 @@ DECLARE_INTERFACE_(IHXSiteManager2, IUnknown) * Used to iterate over the sites. * */ - STDMETHOD(GetSiteAt) (THIS_ UINT32 nIndex, REF(IHXSite*) pSite) PURE; + STDQT_METHOD(GetSiteAt) (THIS_ UINT32 nIndex, REF(IHXSite*) pSite) PURE; }; // $EndPrivate. @@ -780,7 +780,7 @@ DECLARE_INTERFACE_(IHXMultiInstanceSiteUserSupplier, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -791,10 +791,10 @@ DECLARE_INTERFACE_(IHXMultiInstanceSiteUserSupplier, IUnknown) /* * IHXMultiInstanceSiteUserSupplier methods called by site users. */ - STDMETHOD(SetSingleSiteUser) (THIS_ + STDQT_METHOD(SetSingleSiteUser) (THIS_ IUnknown* pUnknown) PURE; - STDMETHOD(ReleaseSingleSiteUser) (THIS) PURE; + STDQT_METHOD(ReleaseSingleSiteUser) (THIS) PURE; }; @@ -828,7 +828,7 @@ DECLARE_INTERFACE_(IHXSiteEnumerator, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -849,7 +849,7 @@ DECLARE_INTERFACE_(IHXSiteEnumerator, IUnknown) * sitePosition with the position of the next site (if any). * Returns HXR_OK if the first site is available, HXR_FAIL if not. */ - STDMETHOD(GetFirstSite) (THIS_ + STDQT_METHOD(GetFirstSite) (THIS_ REF(IHXSite*) /* OUT */ pFirstSite, REF(SitePosition) /* OUT */ nextPosition) PURE; @@ -862,7 +862,7 @@ DECLARE_INTERFACE_(IHXSiteEnumerator, IUnknown) * following site (if any). * Returns HXR_OK if the first site is available, HXR_FAIL if not. */ - STDMETHOD(GetNextSite) (THIS_ + STDQT_METHOD(GetNextSite) (THIS_ REF(IHXSite*) pNextSite, REF(SitePosition) /* IN/OUT */ nextPosition) PURE; }; @@ -893,7 +893,7 @@ DECLARE_INTERFACE_(IHXSiteFullScreen, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -904,11 +904,11 @@ DECLARE_INTERFACE_(IHXSiteFullScreen, IUnknown) /* * IHXSiteFullScreen methods */ - STDMETHOD(EnterFullScreen) (THIS) PURE; + STDQT_METHOD(EnterFullScreen) (THIS) PURE; - STDMETHOD(ExitFullScreen) (THIS) PURE; + STDQT_METHOD(ExitFullScreen) (THIS) PURE; - STDMETHOD(TestFullScreen) (THIS_ + STDQT_METHOD(TestFullScreen) (THIS_ void* hTestBitmap,const char* pszStatusText) PURE; STDMETHOD_(HXBOOL, IsFullScreen) (THIS) PURE; @@ -941,7 +941,7 @@ DECLARE_INTERFACE_(IHXLayoutSiteGroupManager, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -952,10 +952,10 @@ DECLARE_INTERFACE_(IHXLayoutSiteGroupManager, IUnknown) /* * IHXLayoutSiteGroupManager methods */ - STDMETHOD(AddLayoutSiteGroup) (THIS_ + STDQT_METHOD(AddLayoutSiteGroup) (THIS_ IUnknown* pLSG) PURE; - STDMETHOD(RemoveLayoutSiteGroup) (THIS_ + STDQT_METHOD(RemoveLayoutSiteGroup) (THIS_ IUnknown* pLSG) PURE; }; // $EndPrivate. @@ -986,7 +986,7 @@ DECLARE_INTERFACE_(IHXEventHookMgr, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -997,12 +997,12 @@ DECLARE_INTERFACE_(IHXEventHookMgr, IUnknown) /* * IHXEventHookMgr methods */ - STDMETHOD(AddHook) (THIS_ + STDQT_METHOD(AddHook) (THIS_ IHXEventHook* pHook, const char* pRegionName, UINT16 uLayer) PURE; - STDMETHOD(RemoveHook) (THIS_ + STDQT_METHOD(RemoveHook) (THIS_ IHXEventHook* pHook, const char* pRegionName, UINT16 uLayer) PURE; @@ -1033,7 +1033,7 @@ DECLARE_INTERFACE_(IHXEventHook, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1044,12 +1044,12 @@ DECLARE_INTERFACE_(IHXEventHook, IUnknown) /* * IHXEventHook methods */ - STDMETHOD(SiteAdded) (THIS_ + STDQT_METHOD(SiteAdded) (THIS_ IHXSite* pSite) PURE; - STDMETHOD(HandleEvent) (THIS_ + STDQT_METHOD(HandleEvent) (THIS_ IHXSite* pSite, HXxEvent* pEvent) PURE; - STDMETHOD(SiteRemoved) (THIS_ + STDQT_METHOD(SiteRemoved) (THIS_ IHXSite* pSite) PURE; }; @@ -1079,7 +1079,7 @@ DECLARE_INTERFACE_(IHXStatusMessage, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1091,7 +1091,7 @@ DECLARE_INTERFACE_(IHXStatusMessage, IUnknown) * IHXStatusMessage methods */ - STDMETHOD(SetStatus) (THIS_ const char* pText) PURE; + STDQT_METHOD(SetStatus) (THIS_ const char* pText) PURE; }; // $Private: @@ -1123,7 +1123,7 @@ DECLARE_INTERFACE_(IHXSiteTransition, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -1131,10 +1131,10 @@ DECLARE_INTERFACE_(IHXSiteTransition, IUnknown) STDMETHOD_(ULONG32,Release) (THIS) PURE; - STDMETHOD(Initialize) (THIS_ + STDQT_METHOD(Initialize) (THIS_ IHXValues* pParams) PURE; - STDMETHOD(SetPercentage) (THIS_ + STDQT_METHOD(SetPercentage) (THIS_ UINT32 nThousandnthsComplete) PURE; }; @@ -1174,7 +1174,7 @@ DECLARE_INTERFACE_(IHXRegion, IUnknown) * This function creates a rectangular region. * */ - STDMETHOD(SetRect) (THIS_ HXxRect* pRect) PURE; + STDQT_METHOD(SetRect) (THIS_ HXxRect* pRect) PURE; /************************************************************************ * Method: @@ -1183,7 +1183,7 @@ DECLARE_INTERFACE_(IHXRegion, IUnknown) * This function creates a rectangular region. * */ - STDMETHOD(SetRect) (THIS_ int x, int y, int x1, int y1) PURE; + STDQT_METHOD(SetRect) (THIS_ int x, int y, int x1, int y1) PURE; /************************************************************************ * Method: @@ -1193,7 +1193,7 @@ DECLARE_INTERFACE_(IHXRegion, IUnknown) * */ - STDMETHOD(SetPoly) (THIS_ HXxPoint** pRect, HXBOOL bUseWinding) PURE; + STDQT_METHOD(SetPoly) (THIS_ HXxPoint** pRect, HXBOOL bUseWinding) PURE; /************************************************************************ * Method: @@ -1213,7 +1213,7 @@ DECLARE_INTERFACE_(IHXRegion, IUnknown) * */ - STDMETHOD(GetExtents) (THIS_ REF(HXxRect) rExtents) PURE; + STDQT_METHOD(GetExtents) (THIS_ REF(HXxRect) rExtents) PURE; /************************************************************************ * Method: @@ -1223,7 +1223,7 @@ DECLARE_INTERFACE_(IHXRegion, IUnknown) * */ - STDMETHOD(Offset) (THIS_ HXxPoint* pOrigin) PURE; + STDQT_METHOD(Offset) (THIS_ HXxPoint* pOrigin) PURE; /************************************************************************ * Method: @@ -1267,7 +1267,7 @@ DECLARE_INTERFACE_(IHXRegion, IUnknown) * */ - STDMETHOD(GetRectAtIndex) (THIS_ UINT32 nRectIndex, REF(HXxRect) rRect) PURE; + STDQT_METHOD(GetRectAtIndex) (THIS_ UINT32 nRectIndex, REF(HXxRect) rRect) PURE; /************************************************************************ * Method: @@ -1278,7 +1278,7 @@ DECLARE_INTERFACE_(IHXRegion, IUnknown) * */ - STDMETHOD(UnionRegion) (THIS_ REF(IHXRegion*) pDest, IHXRegion* pSrc1) PURE; + STDQT_METHOD(UnionRegion) (THIS_ REF(IHXRegion*) pDest, IHXRegion* pSrc1) PURE; /************************************************************************ * Method: @@ -1288,7 +1288,7 @@ DECLARE_INTERFACE_(IHXRegion, IUnknown) * */ - STDMETHOD(CopyRegion) (THIS_ REF(IHXRegion*) pDest) PURE; + STDQT_METHOD(CopyRegion) (THIS_ REF(IHXRegion*) pDest) PURE; /************************************************************************ * Method: @@ -1298,7 +1298,7 @@ DECLARE_INTERFACE_(IHXRegion, IUnknown) * */ - STDMETHOD(DiffRegion) (THIS_ REF(IHXRegion*) pDest, IHXRegion* pSrc1) PURE; + STDQT_METHOD(DiffRegion) (THIS_ REF(IHXRegion*) pDest, IHXRegion* pSrc1) PURE; /************************************************************************ * Method: @@ -1308,7 +1308,7 @@ DECLARE_INTERFACE_(IHXRegion, IUnknown) * */ - STDMETHOD(AndRegion) (THIS_ REF(IHXRegion*) pDest, IHXRegion* pSrc1) PURE; + STDQT_METHOD(AndRegion) (THIS_ REF(IHXRegion*) pDest, IHXRegion* pSrc1) PURE; /************************************************************************ * Method: @@ -1318,7 +1318,7 @@ DECLARE_INTERFACE_(IHXRegion, IUnknown) * */ - STDMETHOD(XORRegion) (THIS_ REF(IHXRegion*) pDest, IHXRegion* pSrc1) PURE; + STDQT_METHOD(XORRegion) (THIS_ REF(IHXRegion*) pDest, IHXRegion* pSrc1) PURE; /************************************************************************ * Method: @@ -1361,7 +1361,7 @@ DECLARE_INTERFACE_(IHXColorConverterManager, IUnknown) * Get ColorConverter is called to obtain a color converter to convert * from a particular bitmap to another bitmap. */ - STDMETHOD(GetColorConverter) (THIS_ + STDQT_METHOD(GetColorConverter) (THIS_ HXBitmapInfoHeader* /*IN*/ pBitmapInfoIn, HXBitmapInfoHeader* /*IN*/ pBitmapInfoOut, REF(IHXColorConverter*) /*OUT*/ pConverter) PURE; @@ -1396,7 +1396,7 @@ DECLARE_INTERFACE_(IHXColorConverter, IUnknown) * ColorConvert converts the pBitsIn from one color format to * the format of pBitsOut */ - STDMETHOD(ColorConvert) (THIS_ + STDQT_METHOD(ColorConvert) (THIS_ UCHAR* pBitsIn, UCHAR* pBitsOut, HXxRect* pRectIn, @@ -1430,8 +1430,8 @@ DEFINE_GUID(IID_IHXOverlayResponse, 0x00000D22, 0x903, 0x11d1, 0x8b, DECLARE_INTERFACE_(IHXOverlayResponse, IUnknown) { - STDMETHOD(OverlayGranted) (THIS ) PURE; - STDMETHOD(OverlayRevoked) (THIS ) PURE; + STDQT_METHOD(OverlayGranted) (THIS ) PURE; + STDQT_METHOD(OverlayRevoked) (THIS ) PURE; }; @@ -1460,17 +1460,17 @@ DEFINE_GUID(IID_IHXOverlayManager, 0x00000D21, 0x903, 0x11d1, 0x8b, DECLARE_INTERFACE_(IHXOverlayManager, IUnknown) { - STDMETHOD(HasOverlay) (THIS_ + STDQT_METHOD(HasOverlay) (THIS_ IHXOverlayResponse* pResp ) PURE; - STDMETHOD(AddStats) (THIS_ + STDQT_METHOD(AddStats) (THIS_ IHXOverlayResponse* pResp, UINT32 ulNumPixels ) PURE; - STDMETHOD(RemoveOverlayRequest)(THIS_ IHXOverlayResponse* pResp ) PURE; + STDQT_METHOD(RemoveOverlayRequest)(THIS_ IHXOverlayResponse* pResp ) PURE; }; @@ -1500,8 +1500,8 @@ DEFINE_GUID(IID_IHXKeyBoardFocus, 0x00000D23, 0x903, 0x11d1, 0x8b, DECLARE_INTERFACE_(IHXKeyBoardFocus, IUnknown) { - STDMETHOD(SetKeyboardFocus)(THIS_ IHXSiteUser* pSiteUser ) PURE; - STDMETHOD(GetKeyboardFocus)(THIS_ IHXSiteUser* &pSiteUser ) PURE; + STDQT_METHOD(SetKeyboardFocus)(THIS_ IHXSiteUser* pSiteUser ) PURE; + STDQT_METHOD(GetKeyboardFocus)(THIS_ IHXSiteUser* &pSiteUser ) PURE; }; @@ -1557,7 +1557,7 @@ DECLARE_INTERFACE_(IHXDrawFocus, IUnknown) * CUSTOM_LINE_ENTRIES equals 4. Secondary pixels are not * drawn if RED_OFF, GREEN_OFF, and BLUE_OFF are not set. */ - STDMETHOD(SetStyle) (THIS_ IHXValues* pProperties) PURE; + STDQT_METHOD(SetStyle) (THIS_ IHXValues* pProperties) PURE; /************************************************************************ * Method: @@ -1565,7 +1565,7 @@ DECLARE_INTERFACE_(IHXDrawFocus, IUnknown) * Purpose: * Ask the site to clear the current focus drawing. */ - STDMETHOD(ClearFocus)(THIS) PURE; + STDQT_METHOD(ClearFocus)(THIS) PURE; /************************************************************************ * Method: @@ -1573,7 +1573,7 @@ DECLARE_INTERFACE_(IHXDrawFocus, IUnknown) * Purpose: * Ask the site to draw polygon around focus */ - STDMETHOD(SetFocusPolygon)(THIS_ HXxPoint* pPoints, ULONG32 numPoints) PURE; + STDQT_METHOD(SetFocusPolygon)(THIS_ HXxPoint* pPoints, ULONG32 numPoints) PURE; /************************************************************************ * Method: @@ -1581,7 +1581,7 @@ DECLARE_INTERFACE_(IHXDrawFocus, IUnknown) * Purpose: * Ask the site to draw rectangle around focus */ - STDMETHOD(SetFocusRect) (THIS_ HXxRect* pRect) PURE; + STDQT_METHOD(SetFocusRect) (THIS_ HXxRect* pRect) PURE; /************************************************************************ * Method: @@ -1589,7 +1589,7 @@ DECLARE_INTERFACE_(IHXDrawFocus, IUnknown) * Purpose: * Ask the site to draw ellipse around focus */ - STDMETHOD(SetFocusEllipse) (THIS_ HXxRect* pRect) PURE; + STDQT_METHOD(SetFocusEllipse) (THIS_ HXxRect* pRect) PURE; }; // $Private: @@ -1625,17 +1625,17 @@ DECLARE_INTERFACE_(IHXSubRectSite, IHXSite) * These messages contain actuall dirty rects so that the renderer * does not need to BLT the entire frame. */ - STDMETHOD(SendSubRectMessages) (THIS_ HXBOOL bRet ) PURE; + STDQT_METHOD(SendSubRectMessages) (THIS_ HXBOOL bRet ) PURE; /* * New damage region call that takes the cross platfrom region * defined in hxwintyp.h and invalidates the rects in it */ - STDMETHOD(SubRectDamageRegion) (THIS_ HXxBoxRegion* pRegion ) PURE; + STDQT_METHOD(SubRectDamageRegion) (THIS_ HXxBoxRegion* pRegion ) PURE; /* * Method to get the new video surface that comes with the sub * rect BLT'ing support. */ - STDMETHOD(GetSubRectVideoSurface) (THIS_ + STDQT_METHOD(GetSubRectVideoSurface) (THIS_ REF(IHXSubRectVideoSurface*) pSurface ) PURE; }; @@ -1672,7 +1672,7 @@ DECLARE_INTERFACE_(IHXFocusNavigation, IUnknown) * Purpose: * Ask the renderer to set the focus to the given item. */ - STDMETHOD(SetFocus) (THIS_ HXFocusContext eFocus) PURE; + STDQT_METHOD(SetFocus) (THIS_ HXFocusContext eFocus) PURE; /************************************************************************ * Method: @@ -1680,7 +1680,7 @@ DECLARE_INTERFACE_(IHXFocusNavigation, IUnknown) * Purpose: * Ask the renderer to clear the current focus. */ - STDMETHOD(ClearFocus) (THIS) PURE; + STDQT_METHOD(ClearFocus) (THIS) PURE; /************************************************************************ * Method: @@ -1689,7 +1689,7 @@ DECLARE_INTERFACE_(IHXFocusNavigation, IUnknown) * Ask the renderer to activate the focused link. Do nothing if * there is no focus point. */ - STDMETHOD(ActivateFocus) (THIS) PURE; + STDQT_METHOD(ActivateFocus) (THIS) PURE; /************************************************************************ * Method: diff --git a/amarok/src/engine/helix/helix-sp/helix-include/common/include/ihxpckts.h b/amarok/src/engine/helix/helix-sp/helix-include/common/include/ihxpckts.h index c4a927a8..774fd405 100644 --- a/amarok/src/engine/helix/helix-sp/helix-include/common/include/ihxpckts.h +++ b/amarok/src/engine/helix/helix-sp/helix-include/common/include/ihxpckts.h @@ -59,7 +59,7 @@ DECLARE_INTERFACE_(IHXBuffer, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -70,15 +70,15 @@ DECLARE_INTERFACE_(IHXBuffer, IUnknown) /* * IHXBuffer methods */ - STDMETHOD(Get) (THIS_ + STDQT_METHOD(Get) (THIS_ REF(UCHAR*) pData, REF(ULONG32) ulLength) PURE; - STDMETHOD(Set) (THIS_ + STDQT_METHOD(Set) (THIS_ const UCHAR* pData, ULONG32 ulLength) PURE; - STDMETHOD(SetSize) (THIS_ + STDQT_METHOD(SetSize) (THIS_ ULONG32 ulLength) PURE; STDMETHOD_(ULONG32,GetSize) (THIS) PURE; @@ -119,7 +119,7 @@ DECLARE_INTERFACE_(IHXPacket, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -130,7 +130,7 @@ DECLARE_INTERFACE_(IHXPacket, IUnknown) /* * IHXPacket methods */ - STDMETHOD(Get) (THIS_ + STDQT_METHOD(Get) (THIS_ REF(IHXBuffer*) pBuffer, REF(UINT32) ulTime, REF(UINT16) unStreamNumber, @@ -150,9 +150,9 @@ DECLARE_INTERFACE_(IHXPacket, IUnknown) STDMETHOD_(HXBOOL,IsLost) (THIS) PURE; - STDMETHOD(SetAsLost) (THIS) PURE; + STDQT_METHOD(SetAsLost) (THIS) PURE; - STDMETHOD(Set) (THIS_ + STDQT_METHOD(Set) (THIS_ IHXBuffer* pBuffer, UINT32 ulTime, UINT16 uStreamNumber, @@ -194,7 +194,7 @@ DECLARE_INTERFACE_(IHXRTPPacket, IHXPacket) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -205,7 +205,7 @@ DECLARE_INTERFACE_(IHXRTPPacket, IHXPacket) /* * IHXPacket methods */ - STDMETHOD(Get) (THIS_ + STDQT_METHOD(Get) (THIS_ REF(IHXBuffer*) pBuffer, REF(UINT32) ulTime, REF(UINT16) unStreamNumber, @@ -225,9 +225,9 @@ DECLARE_INTERFACE_(IHXRTPPacket, IHXPacket) STDMETHOD_(HXBOOL,IsLost) (THIS) PURE; - STDMETHOD(SetAsLost) (THIS) PURE; + STDQT_METHOD(SetAsLost) (THIS) PURE; - STDMETHOD(Set) (THIS_ + STDQT_METHOD(Set) (THIS_ IHXBuffer* pBuffer, UINT32 ulTime, UINT16 uStreamNumber, @@ -240,7 +240,7 @@ DECLARE_INTERFACE_(IHXRTPPacket, IHXPacket) */ STDMETHOD_(ULONG32,GetRTPTime) (THIS) PURE; - STDMETHOD(GetRTP) (THIS_ + STDQT_METHOD(GetRTP) (THIS_ REF(IHXBuffer*) pBuffer, REF(UINT32) ulTime, REF(UINT32) ulRTPTime, @@ -249,7 +249,7 @@ DECLARE_INTERFACE_(IHXRTPPacket, IHXPacket) REF(UINT16) unASMRuleNumber ) PURE; - STDMETHOD(SetRTP) (THIS_ + STDQT_METHOD(SetRTP) (THIS_ IHXBuffer* pBuffer, UINT32 ulTime, UINT32 ulRTPTime, @@ -285,7 +285,7 @@ DECLARE_INTERFACE_(IHXRTPPacketInfo, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; STDMETHOD_(ULONG32,Release) (THIS) PURE; @@ -294,37 +294,37 @@ DECLARE_INTERFACE_(IHXRTPPacketInfo, IUnknown) */ STDMETHOD_(UINT8, GetVersion) (THIS) PURE; - STDMETHOD(GetPaddingBit) (THIS_ REF(HXBOOL)bPadding) PURE; - STDMETHOD(SetPaddingBit) (THIS_ HXBOOL bPadding) PURE; + STDQT_METHOD(GetPaddingBit) (THIS_ REF(HXBOOL)bPadding) PURE; + STDQT_METHOD(SetPaddingBit) (THIS_ HXBOOL bPadding) PURE; - STDMETHOD(GetExtensionBit) (THIS_ REF(HXBOOL)bExtension) PURE; - STDMETHOD(SetExtensionBit) (THIS_ HXBOOL bExtension) PURE; + STDQT_METHOD(GetExtensionBit) (THIS_ REF(HXBOOL)bExtension) PURE; + STDQT_METHOD(SetExtensionBit) (THIS_ HXBOOL bExtension) PURE; - STDMETHOD(GetCSRCCount) (THIS_ REF(UINT8)unCSRCCount) PURE; - STDMETHOD(SetCSRCCount) (THIS_ UINT8 unCSRCCount) PURE; + STDQT_METHOD(GetCSRCCount) (THIS_ REF(UINT8)unCSRCCount) PURE; + STDQT_METHOD(SetCSRCCount) (THIS_ UINT8 unCSRCCount) PURE; - STDMETHOD(GetMarkerBit) (THIS_ REF(HXBOOL)bMarker) PURE; - STDMETHOD(SetMarkerBit) (THIS_ HXBOOL bMarker) PURE; + STDQT_METHOD(GetMarkerBit) (THIS_ REF(HXBOOL)bMarker) PURE; + STDQT_METHOD(SetMarkerBit) (THIS_ HXBOOL bMarker) PURE; - STDMETHOD(GetPayloadType) (THIS_ REF(UINT8)unPayloadType) PURE; - STDMETHOD(SetPayloadType) (THIS_ UINT8 unPayloadType) PURE; + STDQT_METHOD(GetPayloadType) (THIS_ REF(UINT8)unPayloadType) PURE; + STDQT_METHOD(SetPayloadType) (THIS_ UINT8 unPayloadType) PURE; - STDMETHOD(GetSequenceNumber) (THIS_ REF(UINT16)unSeqNo) PURE; - STDMETHOD(SetSequenceNumber) (THIS_ UINT16 unSeqNo) PURE; + STDQT_METHOD(GetSequenceNumber) (THIS_ REF(UINT16)unSeqNo) PURE; + STDQT_METHOD(SetSequenceNumber) (THIS_ UINT16 unSeqNo) PURE; - STDMETHOD(GetTimeStamp) (THIS_ REF(UINT32)ulTS) PURE; - STDMETHOD(SetTimeStamp) (THIS_ UINT32 ulTS) PURE; + STDQT_METHOD(GetTimeStamp) (THIS_ REF(UINT32)ulTS) PURE; + STDQT_METHOD(SetTimeStamp) (THIS_ UINT32 ulTS) PURE; - STDMETHOD(GetSSRC) (THIS_ REF(UINT32)ulSSRC) PURE; - STDMETHOD(SetSSRC) (THIS_ UINT32 ulSSRC) PURE; + STDQT_METHOD(GetSSRC) (THIS_ REF(UINT32)ulSSRC) PURE; + STDQT_METHOD(SetSSRC) (THIS_ UINT32 ulSSRC) PURE; - STDMETHOD(GetCSRCList) (THIS_ REF(const char*) pulCSRC) PURE; - STDMETHOD(SetCSRCList) (THIS_ const char* pCSRCList, UINT32 ulSize) PURE; - STDMETHOD(GetPadding) (THIS_ REF(const char*) pPadding) PURE; - STDMETHOD(SetPadding) (THIS_ const char* pPadding, UINT32 ulSize) PURE; - STDMETHOD(GetExtension) (THIS_ REF(const char*) pExtension) PURE; - STDMETHOD(SetExtension) (THIS_ const char* pExtension, UINT32 ulSize) PURE; + STDQT_METHOD(GetCSRCList) (THIS_ REF(const char*) pulCSRC) PURE; + STDQT_METHOD(SetCSRCList) (THIS_ const char* pCSRCList, UINT32 ulSize) PURE; + STDQT_METHOD(GetPadding) (THIS_ REF(const char*) pPadding) PURE; + STDQT_METHOD(SetPadding) (THIS_ const char* pPadding, UINT32 ulSize) PURE; + STDQT_METHOD(GetExtension) (THIS_ REF(const char*) pExtension) PURE; + STDQT_METHOD(SetExtension) (THIS_ const char* pExtension, UINT32 ulSize) PURE; }; @@ -361,7 +361,7 @@ DECLARE_INTERFACE_(IHXValues, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -382,51 +382,51 @@ DECLARE_INTERFACE_(IHXValues, IUnknown) * RMA core (i.e. you exit whatever function gave you a time slice). */ - STDMETHOD(SetPropertyULONG32) (THIS_ + STDQT_METHOD(SetPropertyULONG32) (THIS_ const char* pPropertyName, ULONG32 uPropertyValue) PURE; - STDMETHOD(GetPropertyULONG32) (THIS_ + STDQT_METHOD(GetPropertyULONG32) (THIS_ const char* pPropertyName, REF(ULONG32) uPropertyName) PURE; - STDMETHOD(GetFirstPropertyULONG32) (THIS_ + STDQT_METHOD(GetFirstPropertyULONG32) (THIS_ REF(const char*) pPropertyName, REF(ULONG32) uPropertyValue) PURE; - STDMETHOD(GetNextPropertyULONG32) (THIS_ + STDQT_METHOD(GetNextPropertyULONG32) (THIS_ REF(const char*) pPropertyName, REF(ULONG32) uPropertyValue) PURE; - STDMETHOD(SetPropertyBuffer) (THIS_ + STDQT_METHOD(SetPropertyBuffer) (THIS_ const char* pPropertyName, IHXBuffer* pPropertyValue) PURE; - STDMETHOD(GetPropertyBuffer) (THIS_ + STDQT_METHOD(GetPropertyBuffer) (THIS_ const char* pPropertyName, REF(IHXBuffer*) pPropertyValue) PURE; - STDMETHOD(GetFirstPropertyBuffer) (THIS_ + STDQT_METHOD(GetFirstPropertyBuffer) (THIS_ REF(const char*) pPropertyName, REF(IHXBuffer*) pPropertyValue) PURE; - STDMETHOD(GetNextPropertyBuffer) (THIS_ + STDQT_METHOD(GetNextPropertyBuffer) (THIS_ REF(const char*) pPropertyName, REF(IHXBuffer*) pPropertyValue) PURE; - STDMETHOD(SetPropertyCString) (THIS_ + STDQT_METHOD(SetPropertyCString) (THIS_ const char* pPropertyName, IHXBuffer* pPropertyValue) PURE; - STDMETHOD(GetPropertyCString) (THIS_ + STDQT_METHOD(GetPropertyCString) (THIS_ const char* pPropertyName, REF(IHXBuffer*) pPropertyValue) PURE; - STDMETHOD(GetFirstPropertyCString) (THIS_ + STDQT_METHOD(GetFirstPropertyCString) (THIS_ REF(const char*) pPropertyName, REF(IHXBuffer*) pPropertyValue) PURE; - STDMETHOD(GetNextPropertyCString) (THIS_ + STDQT_METHOD(GetNextPropertyCString) (THIS_ REF(const char*) pPropertyName, REF(IHXBuffer*) pPropertyValue) PURE; }; @@ -460,19 +460,19 @@ DECLARE_INTERFACE_(IHXValues2, IHXValues) * IHXValues2 methods */ - STDMETHOD(SetPropertyObject) (THIS_ + STDQT_METHOD(SetPropertyObject) (THIS_ const char* pPropertyName, IUnknown* pPropertyValue) PURE; - STDMETHOD(GetPropertyObject) (THIS_ + STDQT_METHOD(GetPropertyObject) (THIS_ const char* pPropertyName, REF(IUnknown*) pPropertyValue) PURE; - STDMETHOD(GetFirstPropertyObject) (THIS_ + STDQT_METHOD(GetFirstPropertyObject) (THIS_ REF(const char*) pPropertyName, REF(IUnknown*) pPropertyValue) PURE; - STDMETHOD(GetNextPropertyObject) (THIS_ + STDQT_METHOD(GetNextPropertyObject) (THIS_ REF(const char*) pPropertyName, REF(IUnknown*) pPropertyValue) PURE; @@ -483,7 +483,7 @@ DECLARE_INTERFACE_(IHXValues2, IHXValues) * Remove all items matching pKey. (If you know what datatype you saved * the key as, use the specific method.) */ - STDMETHOD(Remove) (const char* pKey) PURE; + STDQT_METHOD(Remove) (const char* pKey) PURE; /************************************************************************ * Method: @@ -491,7 +491,7 @@ DECLARE_INTERFACE_(IHXValues2, IHXValues) * Purpose: * Remove all ULONG32 items matching pKey. */ - STDMETHOD(RemoveULONG32) (const char* pKey) PURE; + STDQT_METHOD(RemoveULONG32) (const char* pKey) PURE; /************************************************************************ * Method: @@ -499,7 +499,7 @@ DECLARE_INTERFACE_(IHXValues2, IHXValues) * Purpose: * Remove all Buffer items matching pKey. */ - STDMETHOD(RemoveBuffer) (const char* pKey) PURE; + STDQT_METHOD(RemoveBuffer) (const char* pKey) PURE; /************************************************************************ * Method: @@ -507,7 +507,7 @@ DECLARE_INTERFACE_(IHXValues2, IHXValues) * Purpose: * Remove all CString items matching pKey. */ - STDMETHOD(RemoveCString) (const char* pKey) PURE; + STDQT_METHOD(RemoveCString) (const char* pKey) PURE; /************************************************************************ * Method: @@ -515,7 +515,7 @@ DECLARE_INTERFACE_(IHXValues2, IHXValues) * Purpose: * Remove all IUnknown items matching pKey. */ - STDMETHOD(RemoveObject) (const char* pKey) PURE; + STDQT_METHOD(RemoveObject) (const char* pKey) PURE; }; /**************************************************************************** @@ -553,7 +553,7 @@ DECLARE_INTERFACE_(IHXValuesRemove, IUnknown) /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -572,7 +572,7 @@ DECLARE_INTERFACE_(IHXValuesRemove, IUnknown) * Remove all items matching pKey. (If you know what datatype you saved * the key as, use the specific method.) */ - STDMETHOD(Remove) (const char* pKey) PURE; + STDQT_METHOD(Remove) (const char* pKey) PURE; /************************************************************************ * Method: @@ -580,7 +580,7 @@ DECLARE_INTERFACE_(IHXValuesRemove, IUnknown) * Purpose: * Remove all ULONG32 items matching pKey. */ - STDMETHOD(RemoveULONG32) (const char* pKey) PURE; + STDQT_METHOD(RemoveULONG32) (const char* pKey) PURE; /************************************************************************ * Method: @@ -588,7 +588,7 @@ DECLARE_INTERFACE_(IHXValuesRemove, IUnknown) * Purpose: * Remove all Buffer items matching pKey. */ - STDMETHOD(RemoveBuffer) (const char* pKey) PURE; + STDQT_METHOD(RemoveBuffer) (const char* pKey) PURE; /************************************************************************ * Method: @@ -596,7 +596,7 @@ DECLARE_INTERFACE_(IHXValuesRemove, IUnknown) * Purpose: * Remove all CString items matching pKey. */ - STDMETHOD(RemoveCString) (const char* pKey) PURE; + STDQT_METHOD(RemoveCString) (const char* pKey) PURE; }; // $Private: @@ -612,7 +612,7 @@ DECLARE_INTERFACE_(IHXClientPacket, IUnknown) * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -633,7 +633,7 @@ DECLARE_INTERFACE_(IHXBroadcastDistPktExt, IUnknown) * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; @@ -648,10 +648,10 @@ DECLARE_INTERFACE_(IHXBroadcastDistPktExt, IUnknown) STDMETHOD_(UINT16,GetRuleSeqNoArraySize) (THIS) PURE; STDMETHOD_(UINT16*,GetRuleSeqNoArray) (THIS) PURE; - STDMETHOD(SetSeqNo) (THIS_ UINT32 ulSeqNo) PURE; - STDMETHOD(SetStreamSeqNo) (THIS_ UINT32 ulStreamSeqNo) PURE; - STDMETHOD(SetIsLostRelaying) (THIS_ HXBOOL bLostRelay) PURE; - STDMETHOD(SetRuleSeqNoArray) (THIS_ UINT16* pRuleSeqNoArray, UINT16 uSize) PURE; + STDQT_METHOD(SetSeqNo) (THIS_ UINT32 ulSeqNo) PURE; + STDQT_METHOD(SetStreamSeqNo) (THIS_ UINT32 ulStreamSeqNo) PURE; + STDQT_METHOD(SetIsLostRelaying) (THIS_ HXBOOL bLostRelay) PURE; + STDQT_METHOD(SetRuleSeqNoArray) (THIS_ UINT16* pRuleSeqNoArray, UINT16 uSize) PURE; }; // $EndPrivate. diff --git a/amarok/src/engine/helix/helix-sp/helix-sp.cpp b/amarok/src/engine/helix/helix-sp/helix-sp.cpp index c7ac5943..f2e947af 100644 --- a/amarok/src/engine/helix/helix-sp/helix-sp.cpp +++ b/amarok/src/engine/helix/helix-sp/helix-sp.cpp @@ -77,7 +77,7 @@ public: /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj); @@ -88,7 +88,7 @@ public: /* * IHXAudioStreamInfoResponse methods */ - STDMETHOD(OnStream) (THIS_ + STDQT_METHOD(OnStream) (THIS_ IHXAudioStream *pAudioStream ); private: diff --git a/amarok/src/engine/helix/helix-sp/hspadvisesink.h b/amarok/src/engine/helix/helix-sp/hspadvisesink.h index 6816e75a..1a5f7f87 100644 --- a/amarok/src/engine/helix/helix-sp/hspadvisesink.h +++ b/amarok/src/engine/helix/helix-sp/hspadvisesink.h @@ -61,7 +61,7 @@ class HSPClientAdviceSink : public IHXClientAdviseSink /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj); @@ -80,7 +80,7 @@ class HSPClientAdviceSink : public IHXClientAdviseSink * Called to advise the client that the position or length of the * current playback context has changed. */ - STDMETHOD(OnPosLength) (THIS_ + STDQT_METHOD(OnPosLength) (THIS_ UINT32 ulPosition, UINT32 ulLength); @@ -90,7 +90,7 @@ class HSPClientAdviceSink : public IHXClientAdviseSink * Purpose: * Called to advise the client a presentation has been opened. */ - STDMETHOD(OnPresentationOpened) (THIS); + STDQT_METHOD(OnPresentationOpened) (THIS); /************************************************************************ * Method: @@ -98,7 +98,7 @@ class HSPClientAdviceSink : public IHXClientAdviseSink * Purpose: * Called to advise the client a presentation has been closed. */ - STDMETHOD(OnPresentationClosed) (THIS); + STDQT_METHOD(OnPresentationClosed) (THIS); /************************************************************************ * Method: @@ -107,7 +107,7 @@ class HSPClientAdviceSink : public IHXClientAdviseSink * Called to advise the client that the presentation statistics * have changed. */ - STDMETHOD(OnStatisticsChanged) (THIS); + STDQT_METHOD(OnStatisticsChanged) (THIS); /************************************************************************ * Method: @@ -119,7 +119,7 @@ class HSPClientAdviceSink : public IHXClientAdviseSink * time for the stream's time line after the seek will be completed. * */ - STDMETHOD (OnPreSeek) (THIS_ + STDQT_METHOD (OnPreSeek) (THIS_ ULONG32 ulOldTime, ULONG32 ulNewTime); @@ -133,7 +133,7 @@ class HSPClientAdviceSink : public IHXClientAdviseSink * time for the stream's time line after the seek. * */ - STDMETHOD (OnPostSeek) (THIS_ + STDQT_METHOD (OnPostSeek) (THIS_ ULONG32 ulOldTime, ULONG32 ulNewTime); @@ -145,7 +145,7 @@ class HSPClientAdviceSink : public IHXClientAdviseSink * just occurred. * */ - STDMETHOD (OnStop) (THIS); + STDQT_METHOD (OnStop) (THIS); /************************************************************************ * Method: @@ -156,7 +156,7 @@ class HSPClientAdviceSink : public IHXClientAdviseSink * stream's time line before the pause. * */ - STDMETHOD (OnPause) (THIS_ + STDQT_METHOD (OnPause) (THIS_ ULONG32 ulTime); /************************************************************************ @@ -168,7 +168,7 @@ class HSPClientAdviceSink : public IHXClientAdviseSink * for the stream's time line after the resume. * */ - STDMETHOD (OnBegin) (THIS_ + STDQT_METHOD (OnBegin) (THIS_ ULONG32 ulTime); /************************************************************************ @@ -182,7 +182,7 @@ class HSPClientAdviceSink : public IHXClientAdviseSink * buffering process. * */ - STDMETHOD (OnBuffering) (THIS_ + STDQT_METHOD (OnBuffering) (THIS_ ULONG32 ulFlags, UINT16 unPercentComplete); @@ -195,7 +195,7 @@ class HSPClientAdviceSink : public IHXClientAdviseSink * hosts(s). * */ - STDMETHOD (OnContacting) (THIS_ + STDQT_METHOD (OnContacting) (THIS_ const char* pHostName); }; diff --git a/amarok/src/engine/helix/helix-sp/hspalsadevice.h b/amarok/src/engine/helix/helix-sp/hspalsadevice.h index b237e322..23eadae9 100644 --- a/amarok/src/engine/helix/helix-sp/hspalsadevice.h +++ b/amarok/src/engine/helix/helix-sp/hspalsadevice.h @@ -51,7 +51,7 @@ public: /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj); STDMETHOD_(ULONG32,AddRef) (THIS); @@ -59,21 +59,21 @@ public: /* * IHXAudioDevice methods */ - STDMETHOD(CheckFormat) ( + STDQT_METHOD(CheckFormat) ( THIS_ const HXAudioFormat* pAudioFormat ); - STDMETHOD(Close) ( + STDQT_METHOD(Close) ( THIS_ const BOOL bFlush ); - STDMETHOD(Drain) ( + STDQT_METHOD(Drain) ( THIS ); - STDMETHOD(GetCurrentAudioTime) ( + STDQT_METHOD(GetCurrentAudioTime) ( THIS_ REF(ULONG32) ulCurrentTime ); @@ -88,30 +88,30 @@ public: const UINT16 uMaxVolume ); - STDMETHOD(Open) ( + STDQT_METHOD(Open) ( THIS_ const HXAudioFormat* pAudioFormat, IHXAudioDeviceResponse* pStreamResponse ); - STDMETHOD(Pause) ( + STDQT_METHOD(Pause) ( THIS ); - STDMETHOD(Reset) ( + STDQT_METHOD(Reset) ( THIS ); - STDMETHOD(Resume) ( + STDQT_METHOD(Resume) ( THIS ); - STDMETHOD(SetVolume) ( + STDQT_METHOD(SetVolume) ( THIS_ const UINT16 uVolume ); - STDMETHOD(Write) ( + STDQT_METHOD(Write) ( THIS_ const HXAudioData* pAudioData ); diff --git a/amarok/src/engine/helix/helix-sp/hspauthmgr.h b/amarok/src/engine/helix/helix-sp/hspauthmgr.h index 55d95cb7..441e8bbc 100644 --- a/amarok/src/engine/helix/helix-sp/hspauthmgr.h +++ b/amarok/src/engine/helix/helix-sp/hspauthmgr.h @@ -28,10 +28,10 @@ private: public: HSPAuthenticationManager(HelixSimplePlayer *pSplay); virtual ~HSPAuthenticationManager(); - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj); + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj); STDMETHOD_(UINT32,AddRef) (THIS); STDMETHOD_(UINT32,Release) (THIS); - STDMETHOD(HandleAuthenticationRequest) (IHXAuthenticationManagerResponse* pResponse); + STDQT_METHOD(HandleAuthenticationRequest) (IHXAuthenticationManagerResponse* pResponse); }; #endif diff --git a/amarok/src/engine/helix/helix-sp/hspcontext.h b/amarok/src/engine/helix/helix-sp/hspcontext.h index 2d4f5000..067ccdfe 100644 --- a/amarok/src/engine/helix/helix-sp/hspcontext.h +++ b/amarok/src/engine/helix/helix-sp/hspcontext.h @@ -32,7 +32,7 @@ public: /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj); @@ -42,9 +42,9 @@ public: /* * IHXPreferences methods */ - STDMETHOD(ReadPref) (THIS_ const char* pref_key, + STDQT_METHOD(ReadPref) (THIS_ const char* pref_key, IHXBuffer*& buffer); - STDMETHOD(WritePref) (THIS_ const char* pref_key, + STDQT_METHOD(WritePref) (THIS_ const char* pref_key, IHXBuffer* buffer); private: @@ -82,7 +82,7 @@ public: /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj); @@ -92,9 +92,9 @@ public: /* * IHXPreferences methods */ - STDMETHOD(ReadPref) (THIS_ const char* pref_key, + STDQT_METHOD(ReadPref) (THIS_ const char* pref_key, IHXBuffer*& buffer); - STDMETHOD(WritePref) (THIS_ const char* pref_key, + STDQT_METHOD(WritePref) (THIS_ const char* pref_key, IHXBuffer* buffer); }; diff --git a/amarok/src/engine/helix/helix-sp/hsperror.h b/amarok/src/engine/helix/helix-sp/hsperror.h index f50e494d..d48827a5 100644 --- a/amarok/src/engine/helix/helix-sp/hsperror.h +++ b/amarok/src/engine/helix/helix-sp/hsperror.h @@ -29,7 +29,7 @@ public: /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj); @@ -52,7 +52,7 @@ public: * The meaning of the arguments is exactly as described in * hxerror.h */ - STDMETHOD(ErrorOccurred) (THIS_ + STDQT_METHOD(ErrorOccurred) (THIS_ const UINT8 unSeverity, const ULONG32 ulHXCode, const ULONG32 ulUserCode, diff --git a/amarok/src/engine/helix/helix-sp/hsphook.h b/amarok/src/engine/helix/helix-sp/hsphook.h index 6983124f..3e6ab843 100644 --- a/amarok/src/engine/helix/helix-sp/hsphook.h +++ b/amarok/src/engine/helix/helix-sp/hsphook.h @@ -29,7 +29,7 @@ public: /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj); STDMETHOD_(ULONG32,AddRef) (THIS); @@ -37,10 +37,10 @@ public: /* * IHXAudioHook methods */ - STDMETHOD(OnBuffer) (THIS_ + STDQT_METHOD(OnBuffer) (THIS_ HXAudioData *pAudioInData, HXAudioData *pAudioOutData); - STDMETHOD(OnInit) (THIS_ + STDQT_METHOD(OnInit) (THIS_ HXAudioFormat *pFormat); void setFadeout(bool fadeout); @@ -97,7 +97,7 @@ public: /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj); STDMETHOD_(ULONG32,AddRef) (THIS); @@ -105,10 +105,10 @@ public: /* * IHXAudioHook methods */ - STDMETHOD(OnBuffer) (THIS_ + STDQT_METHOD(OnBuffer) (THIS_ HXAudioData *pAudioInData, HXAudioData *pAudioOutData); - STDMETHOD(OnInit) (THIS_ + STDQT_METHOD(OnInit) (THIS_ HXAudioFormat *pFormat); void updateEQgains(int preamp, vector &equalizerGains); @@ -177,7 +177,7 @@ public: /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj); STDMETHOD_(ULONG32,AddRef) (THIS); @@ -185,10 +185,10 @@ public: /* * IHXAudioHook methods */ - STDMETHOD(OnBuffer) (THIS_ + STDQT_METHOD(OnBuffer) (THIS_ HXAudioData *pAudioInData, HXAudioData *pAudioOutData); - STDMETHOD(OnInit) (THIS_ + STDQT_METHOD(OnInit) (THIS_ HXAudioFormat *pFormat); void updateEQgains(int preamp, vector &equalizerGains); @@ -216,7 +216,7 @@ public: /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj); STDMETHOD_(ULONG32,AddRef) (THIS); @@ -224,10 +224,10 @@ public: /* * IHXAudioHook methods */ - STDMETHOD(OnBuffer) (THIS_ + STDQT_METHOD(OnBuffer) (THIS_ HXAudioData *pAudioInData, HXAudioData *pAudioOutData); - STDMETHOD(OnInit) (THIS_ + STDQT_METHOD(OnInit) (THIS_ HXAudioFormat *pFormat); diff --git a/amarok/src/engine/helix/helix-sp/hspvoladvise.h b/amarok/src/engine/helix/helix-sp/hspvoladvise.h index 20b0572b..1c6e3033 100644 --- a/amarok/src/engine/helix/helix-sp/hspvoladvise.h +++ b/amarok/src/engine/helix/helix-sp/hspvoladvise.h @@ -23,7 +23,7 @@ public: /* * IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ + STDQT_METHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj); @@ -34,10 +34,10 @@ public: /* * IHXVolumeAdviceSink methods */ - STDMETHOD(OnVolumeChange) (THIS_ + STDQT_METHOD(OnVolumeChange) (THIS_ const UINT16 uVolume ); - STDMETHOD(OnMuteChange) (THIS_ + STDQT_METHOD(OnMuteChange) (THIS_ const BOOL bMute ); diff --git a/amarok/src/engine/kdemm/kdemmengine.cpp b/amarok/src/engine/kdemm/kdemmengine.cpp index 6c4174de..b39033e0 100644 --- a/amarok/src/engine/kdemm/kdemmengine.cpp +++ b/amarok/src/engine/kdemm/kdemmengine.cpp @@ -24,13 +24,13 @@ what : interface to the KDE Multimedia interface (KDEMM) #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -60,7 +60,7 @@ KDEMMEngine::KDEMMEngine( ) // , m_xfadeValue( 0.0 ) // , m_xfadeCurrent( "invalue2" ) , m_state( Engine::Empty ) - , m_pPlayingTimer( new QTimer( this ) ) + , m_pPlayingTimer( new TQTimer( this ) ) { kdDebug() << k_funcinfo << endl; m_player = new SimplePlayer(); @@ -85,7 +85,7 @@ bool KDEMMEngine::init() m_mixerHW = -1; //initialize */ - connect ( m_pPlayingTimer, SIGNAL( timeout() ), this, SLOT( playingTimeout() ) ); + connect ( m_pPlayingTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( playingTimeout() ) ); kdDebug() << "END " << k_funcinfo << endl; return true; @@ -98,7 +98,7 @@ bool KDEMMEngine::init() bool KDEMMEngine::canDecode( const KURL &url ) const { - static QStringList list; + static TQStringList list; kdDebug() << "BEGIN " << k_funcinfo << endl; kdDebug() << " Param: url: " << url << endl; @@ -107,7 +107,7 @@ bool KDEMMEngine::canDecode( const KURL &url ) const if (url.protocol() == "http" ) return false; // TODO determine list of supported MimeTypes/Extensions from KDEMM - list += QString("audio/x-mp3"); + list += TQString("audio/x-mp3"); KFileItem fileItem( KFileItem::Unknown, KFileItem::Unknown, url, false ); //false = determineMimeType straight away KMimeType::Ptr mimetype = fileItem.determineMimeType(); diff --git a/amarok/src/engine/kdemm/kdemmengine.h b/amarok/src/engine/kdemm/kdemmengine.h index 42bb23fb..fdcd4c11 100644 --- a/amarok/src/engine/kdemm/kdemmengine.h +++ b/amarok/src/engine/kdemm/kdemmengine.h @@ -23,13 +23,13 @@ what : interface to KDE Multimedia (KDEMM) #include -#include -#include -#include -#include +#include +#include +#include +#include -class QTimer; +class TQTimer; class KURL; namespace KDE { namespace Multimedia { class SimplePlayer; } } @@ -72,11 +72,11 @@ class KDEMMEngine : public Engine::Base //int m_scopeSize; //bool m_xfadeFadeout; //float m_xfadeValue; - //QString m_xfadeCurrent; + //TQString m_xfadeCurrent; KURL m_url; KDE::Multimedia::SimplePlayer *m_player; - QTimer* m_pPlayingTimer; + TQTimer* m_pPlayingTimer; }; #endif // AMAROK_KDEMM_ENGINE diff --git a/amarok/src/engine/mas/masengine.cpp b/amarok/src/engine/mas/masengine.cpp index 3abe6f9c..cc9511b8 100644 --- a/amarok/src/engine/mas/masengine.cpp +++ b/amarok/src/engine/mas/masengine.cpp @@ -27,8 +27,8 @@ what : interface to the Media Application Server (MAS) #include //#include -#include -#include +#include +#include #include #include @@ -61,7 +61,7 @@ MasEngine::MasEngine() // , m_xfadeCurrent( "invalue2" ) , m_lastKnownPosition( 0 ) , m_state( Engine::Empty ) - , m_pPlayingTimer( new QTimer( this ) ) + , m_pPlayingTimer( new TQTimer( this ) ) { DEBUG_FUNC_INFO @@ -97,7 +97,7 @@ bool MasEngine::init() } m_inited=true; // we connected to MAS - connect ( m_pPlayingTimer, SIGNAL( timeout() ), this, SLOT( playingTimeout() ) ); + connect ( m_pPlayingTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( playingTimeout() ) ); emit statusText( "MAS Engine inited :-)"); return true; @@ -112,7 +112,7 @@ bool MasEngine::canDecode( const KURL &url ) const { DEBUG_BLOCK - QStringList list; + TQStringList list; bool playable; debug() << " Param: url: " << url << endl; @@ -121,7 +121,7 @@ bool MasEngine::canDecode( const KURL &url ) const if (url.protocol() == "http" ) return false; // TODO determine list of supported MimeTypes/Extensions from MAS - list += QString("audio/x-mp3"); + list += TQString("audio/x-mp3"); KFileItem fileItem( KFileItem::Unknown, KFileItem::Unknown, url, false ); //false = determineMimeType straight away KMimeType::Ptr mimetype = fileItem.determineMimeType(); @@ -169,7 +169,7 @@ bool MasEngine::load( const KURL& url, bool stream ) masc_pushk_int16( &pkg, (char*)"pos", pos ); //masc_push_string( &pkg, (char *)m_url.path().latin1() ); - QCString cs= QFile::encodeName( m_url.path()); + TQCString cs= TQFile::encodeName( m_url.path()); const char *pcs = cs; masc_push_string( &pkg, (char *)pcs); masc_finalize_package( &pkg ); @@ -364,7 +364,7 @@ void MasEngine::setVolumeSW( unsigned int percent ) // PRIVATE METHODS //////////////////////////////////////////////////////////////////////////////// /* -void MasEngine::timerEvent( QTimerEvent* ) +void MasEngine::timerEvent( TQTimerEvent* ) { if ( m_xfadeValue > 0.0 ) { @@ -400,8 +400,8 @@ bool MasEngine::masinit() { warning() << "MAS daemon not running. Starting! Please provide password..." << endl; // masd seems not to be running, let's try to run it - QCString cmdline; - cmdline = QFile::encodeName( KStandardDirs::findExe( QString::fromLatin1( "kdesu" ) ) ); + TQCString cmdline; + cmdline = TQFile::encodeName( KStandardDirs::findExe( TQString::fromLatin1( "kdesu" ) ) ); // TODO !!!hardcoded path cmdline += " -n -f /usr/local/mas/log/mas-1.log -c "; cmdline += "/usr/local/mas/bin/mas-launch"; @@ -431,7 +431,7 @@ bool MasEngine::masinit() if (err < 0) { - QString text = "Connection to MAS daemon FAILED. Please check your installation."; + TQString text = "Connection to MAS daemon FAILED. Please check your installation."; error() << text << endl; emit statusText( text ); return false; diff --git a/amarok/src/engine/mas/masengine.h b/amarok/src/engine/mas/masengine.h index 15c4f6ca..098025eb 100644 --- a/amarok/src/engine/mas/masengine.h +++ b/amarok/src/engine/mas/masengine.h @@ -33,7 +33,7 @@ extern "C" { #endif -class QTimer; +class TQTimer; class KURL; class MasEngine : public Engine::Base @@ -71,7 +71,7 @@ class MasEngine : public Engine::Base private: //void startXfade(); - //void timerEvent( QTimerEvent* ); + //void timerEvent( TQTimerEvent* ); bool masinit(); ///////////////////////////////////////////////////////////////////////////////////// // ATTRIBUTES @@ -86,8 +86,8 @@ class MasEngine : public Engine::Base //int m_scopeSize; //bool m_xfadeFadeout; //float m_xfadeValue; - //QString m_xfadeCurrent; - QTimer* m_pPlayingTimer; + //TQString m_xfadeCurrent; + TQTimer* m_pPlayingTimer; KURL m_url; diff --git a/amarok/src/engine/nmm/HostList.cpp b/amarok/src/engine/nmm/HostList.cpp index c4a0dbf7..38ff4cbe 100644 --- a/amarok/src/engine/nmm/HostList.cpp +++ b/amarok/src/engine/nmm/HostList.cpp @@ -24,14 +24,14 @@ #include "HostList.h" -#include -#include +#include +#include #include #include "debug.h" #include "HostListItem.h" -HostList::HostList( QWidget *parent, const char *name ) +HostList::HostList( TQWidget *parent, const char *name ) : KListView( parent, name ), m_read_only( false ), m_hoveredVolume(0) @@ -58,9 +58,9 @@ HostList::HostList( QWidget *parent, const char *name ) HostList::~HostList() {} -void HostList::notifyHostError( QString hostname, int error) +void HostList::notifyHostError( TQString hostname, int error) { - QListViewItemIterator it( this ); + TQListViewItemIterator it( this ); HostListItem *host; while( it.current() ) { host = static_cast( it.current() ); @@ -75,7 +75,7 @@ void HostList::notifyHostError( QString hostname, int error) } } -void HostList::contentsMousePressEvent( QMouseEvent *e) +void HostList::contentsMousePressEvent( TQMouseEvent *e) { HostListItem *item = static_cast( itemAt( contentsToViewport( e->pos() ) ) ); if( !( e->state() & Qt::ControlButton || e->state() & Qt::ShiftButton ) && ( e->button() & Qt::LeftButton ) && item) @@ -121,13 +121,13 @@ void HostList::contentsMousePressEvent( QMouseEvent *e) KListView::contentsMousePressEvent( e ); } -void HostList::contentsMouseMoveEvent( QMouseEvent *e ) +void HostList::contentsMouseMoveEvent( TQMouseEvent *e ) { if( e ) KListView::contentsMouseMoveEvent( e ); HostListItem *prev = m_hoveredVolume; - const QPoint pos = e ? e->pos() : viewportToContents( viewport()->mapFromGlobal( QCursor::pos() ) ); + const TQPoint pos = e ? e->pos() : viewportToContents( viewport()->mapFromGlobal( TQCursor::pos() ) ); HostListItem *item = static_cast( itemAt( contentsToViewport( pos ) ) ); if( item && pos.x() > header()->sectionPos( HostListItem::Volume ) && @@ -143,7 +143,7 @@ void HostList::contentsMouseMoveEvent( QMouseEvent *e ) prev->updateColumn( HostListItem::Volume ); } -void HostList::leaveEvent( QEvent *e ) +void HostList::leaveEvent( TQEvent *e ) { KListView::leaveEvent( e ); diff --git a/amarok/src/engine/nmm/HostList.h b/amarok/src/engine/nmm/HostList.h index 45d0a590..a67f6d13 100644 --- a/amarok/src/engine/nmm/HostList.h +++ b/amarok/src/engine/nmm/HostList.h @@ -34,13 +34,13 @@ class HostList : public KListView Q_OBJECT public: - HostList( QWidget*, const char* ); + HostList( TQWidget*, const char* ); ~HostList(); void setReadOnly( bool read_only ) { m_read_only = read_only; } bool readOnly() const { return m_read_only; } - void notifyHostError( QString, int); + void notifyHostError( TQString, int); friend class HostListItem; @@ -51,9 +51,9 @@ class HostList : public KListView void viewChanged(); protected slots: - void contentsMousePressEvent( QMouseEvent *e ); - void contentsMouseMoveEvent( QMouseEvent *e = 0 ); - void leaveEvent( QEvent *e ); + void contentsMousePressEvent( TQMouseEvent *e ); + void contentsMouseMoveEvent( TQMouseEvent *e = 0 ); + void leaveEvent( TQEvent *e ); private: bool m_read_only; diff --git a/amarok/src/engine/nmm/HostListItem.cpp b/amarok/src/engine/nmm/HostListItem.cpp index 915632e7..584b4731 100644 --- a/amarok/src/engine/nmm/HostListItem.cpp +++ b/amarok/src/engine/nmm/HostListItem.cpp @@ -24,11 +24,11 @@ #include "HostListItem.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -41,7 +41,7 @@ #include "HostList.h" #include "nmm_engine.h" -HostListItem::HostListItem( QListView *parent, QString hostname, bool audio, bool video, int volume, int status, bool read_only ) +HostListItem::HostListItem( TQListView *parent, TQString hostname, bool audio, bool video, int volume, int status, bool read_only ) : KListViewItem( parent ), m_audio( audio ), m_video( video ), @@ -77,7 +77,7 @@ int HostListItem::volumeAtPosition( int x ) void HostListItem::updateColumn( int column ) const { - const QRect r = listView()->itemRect( this ); + const TQRect r = listView()->itemRect( this ); if( !r.isValid() ) return; @@ -88,12 +88,12 @@ void HostListItem::updateColumn( int column ) const void HostListItem::statusToolTip() { - QWhatsThis::display( prettyStatus( m_status ) ); + TQWhatsThis::display( prettyStatus( m_status ) ); } -QString HostListItem::prettyStatus( int error ) +TQString HostListItem::prettyStatus( int error ) { - QString st; + TQString st; debug() << "### ERROR code : " << error << endl; @@ -117,9 +117,9 @@ QString HostListItem::prettyStatus( int error ) return st; } -void HostListItem::paintCell(QPainter * p, const QColorGroup & cg, int column, int width, int align ) +void HostListItem::paintCell(TQPainter * p, const TQColorGroup & cg, int column, int width, int align ) { - QColorGroup m_cg( cg ); + TQColorGroup m_cg( cg ); // TODO: reuse icons? if( column == HostListItem::Video ) @@ -148,7 +148,7 @@ void HostListItem::paintCell(QPainter * p, const QColorGroup & cg, int column, i } else if( column == HostListItem::Status ) { - QFont font( p->font() ); + TQFont font( p->font() ); if( ! m_status ) // Unknown { font.setBold( false ); @@ -157,20 +157,20 @@ void HostListItem::paintCell(QPainter * p, const QColorGroup & cg, int column, i else if( m_status == NmmEngine::STATUS_OK ) { font.setBold( false ); - m_cg.setColor( QColorGroup::Text, Qt::darkGreen ); + m_cg.setColor( TQColorGroup::Text, Qt::darkGreen ); setText( HostListItem::Status , i18n("OK") ); } else { // error font.setBold( true ); - m_cg.setColor( QColorGroup::Text, Qt::red ); + m_cg.setColor( TQColorGroup::Text, Qt::red ); setText( HostListItem::Status , i18n("Failed") ); } p->setFont( font ); } else if( column == HostListItem::Volume ) { - QPixmap buf( width, height() ); - QColor bg = listView()->viewport()->backgroundColor(); + TQPixmap buf( width, height() ); + TQColor bg = listView()->viewport()->backgroundColor(); buf.fill( bg ); bitBlt( &buf, 0, 0, pixmapVolume( PixInset ) ); @@ -180,7 +180,7 @@ void HostListItem::paintCell(QPainter * p, const QColorGroup & cg, int column, i static int vol; // pixelposition if( this == ((HostList*)listView())->m_hoveredVolume ) { - vol = listView()->viewportToContents( listView()->viewport()->mapFromGlobal( QCursor::pos() ) ).x(); + vol = listView()->viewportToContents( listView()->viewport()->mapFromGlobal( TQCursor::pos() ) ).x(); vol -= listView()->header()->sectionPos( HostListItem::Volume ); } else @@ -200,19 +200,19 @@ void HostListItem::paintCell(QPainter * p, const QColorGroup & cg, int column, i // Calculate actual volume string from pixelposition vol = volumeAtPosition( vol ); - QString vol_text; + TQString vol_text; if( vol > 0 ) vol_text = "+"; - vol_text += QString::number( vol ); + vol_text += TQString::number( vol ); vol_text += '%'; // Draw relative volume number - QPainter p_number(&buf); + TQPainter p_number(&buf); p_number.setPen( cg.buttonText() ); - QFont font; + TQFont font; font.setPixelSize( 9 ); p_number.setFont( font ); - const QRect rect( 40, 0, 34, 15 ); + const TQRect rect( 40, 0, 34, 15 ); p_number.drawText( rect, Qt::AlignRight | Qt::AlignVCenter, vol_text ); p_number.end(); //bitBlt( p_number.device(), 0, 0, &buf ); @@ -224,38 +224,38 @@ void HostListItem::paintCell(QPainter * p, const QColorGroup & cg, int column, i KListViewItem::paintCell(p, m_cg, column, width, align); } -QPixmap* HostListItem::pixmapVolume( int type ) +TQPixmap* HostListItem::pixmapVolume( int type ) { if( type == PixInset ) { - static QPixmap m_pixmapInset( locate( "data", "amarok/images/nmm-volume-inset.png" ) ); + static TQPixmap m_pixmapInset( locate( "data", "amarok/images/nmm-volume-inset.png" ) ); return &m_pixmapInset; } else if( type == PixRight ) { - static QPixmap m_pixmapGradientRight = generateGradient( PixRight ); + static TQPixmap m_pixmapGradientRight = generateGradient( PixRight ); return &m_pixmapGradientRight; } else if ( type == PixLeft ) { - static QPixmap m_pixmapGradientLeft = generateGradient( PixLeft ); + static TQPixmap m_pixmapGradientLeft = generateGradient( PixLeft ); return &m_pixmapGradientLeft; } return 0; } -QPixmap HostListItem::generateGradient( int type ) +TQPixmap HostListItem::generateGradient( int type ) { - QPixmap temp; + TQPixmap temp; if( type == PixRight ) - temp = QPixmap( locate( "data", "amarok/images/nmm-gradient-right.png" ) ); + temp = TQPixmap( locate( "data", "amarok/images/nmm-gradient-right.png" ) ); else // PixLeft - temp = QPixmap( locate( "data", "amarok/images/nmm-gradient-left.png" ) ); - const QBitmap mask( temp.createHeuristicMask() ); + temp = TQPixmap( locate( "data", "amarok/images/nmm-gradient-left.png" ) ); + const TQBitmap mask( temp.createHeuristicMask() ); - KPixmap result = QPixmap( 113, 24 ); + KPixmap result = TQPixmap( 113, 24 ); if( type == PixRight) KPixmapEffect::gradient( result, listView()->colorGroup().background(), listView()->colorGroup().highlight(), KPixmapEffect::HorizontalGradient ); else diff --git a/amarok/src/engine/nmm/HostListItem.h b/amarok/src/engine/nmm/HostListItem.h index 9149fd2c..2a3b649e 100644 --- a/amarok/src/engine/nmm/HostListItem.h +++ b/amarok/src/engine/nmm/HostListItem.h @@ -26,7 +26,7 @@ #define HOSTLISTITEM_H #include -#include +#include class HostListItem : public KListViewItem { public: @@ -40,7 +40,7 @@ class HostListItem : public KListViewItem { Playback }; - HostListItem( QListView*, QString hostname, bool audio = true, bool video = true, int volume = 0, int status = 0, bool read_only = false); + HostListItem( TQListView*, TQString hostname, bool audio = true, bool video = true, int volume = 0, int status = 0, bool read_only = false); ~HostListItem(); bool isVideoEnabled() const { return m_video; } @@ -59,7 +59,7 @@ class HostListItem : public KListViewItem { void updateColumn( int column ) const; /** - * Shows extended status text in a QWhatsThis widget. + * Shows extended status text in a TQWhatsThis widget. * \todo handle different error scenarios */ void statusToolTip(); @@ -69,15 +69,15 @@ class HostListItem : public KListViewItem { * \todo make it user friendly/understandable * \todo right place for this method? */ - static QString prettyStatus( int ); + static TQString prettyStatus( int ); protected: - void paintCell( QPainter * painter, const QColorGroup & cg, int column, int width, int align ); + void paintCell( TQPainter * painter, const TQColorGroup & cg, int column, int width, int align ); private: enum { PixInset, PixLeft, PixRight }; - QPixmap* pixmapVolume( int ); - QPixmap generateGradient( int ); + TQPixmap* pixmapVolume( int ); + TQPixmap generateGradient( int ); bool m_audio; bool m_video; diff --git a/amarok/src/engine/nmm/NmmLocation.cpp b/amarok/src/engine/nmm/NmmLocation.cpp index 6ccd3123..050dbe33 100644 --- a/amarok/src/engine/nmm/NmmLocation.cpp +++ b/amarok/src/engine/nmm/NmmLocation.cpp @@ -27,7 +27,7 @@ NmmLocation::NmmLocation() {} -NmmLocation::NmmLocation( QString hostname, bool audio, bool video, int volume, int status ) +NmmLocation::NmmLocation( TQString hostname, bool audio, bool video, int volume, int status ) : m_hostname(hostname), m_audio(audio), m_video(video), @@ -48,12 +48,12 @@ NmmLocation::NmmLocation( const NmmLocation &old ) NmmLocation::~NmmLocation() {} -QString NmmLocation::hostname() const +TQString NmmLocation::hostname() const { return m_hostname; } -void NmmLocation::setHostname(QString hostname) +void NmmLocation::setHostname(TQString hostname) { m_hostname = hostname; } diff --git a/amarok/src/engine/nmm/NmmLocation.h b/amarok/src/engine/nmm/NmmLocation.h index 3782ba1b..a1bc693d 100644 --- a/amarok/src/engine/nmm/NmmLocation.h +++ b/amarok/src/engine/nmm/NmmLocation.h @@ -25,17 +25,17 @@ #ifndef NMMLOCATION_H #define NMMLOCATION_H -#include +#include class NmmLocation { public: NmmLocation(); - NmmLocation(QString hostname, bool audio, bool video, int volume, int status ); + NmmLocation(TQString hostname, bool audio, bool video, int volume, int status ); NmmLocation(const NmmLocation&); ~NmmLocation(); - QString hostname() const; - void setHostname(QString); + TQString hostname() const; + void setHostname(TQString); bool audio() const { return m_audio; } void setAudio( bool audio ) { m_audio = audio; } @@ -50,7 +50,7 @@ class NmmLocation { int status() const { return m_status; } private: - QString m_hostname; + TQString m_hostname; bool m_audio; bool m_video; int m_volume; diff --git a/amarok/src/engine/nmm/ServerregistryPing.cpp b/amarok/src/engine/nmm/ServerregistryPing.cpp index 7a6d2684..30d13d8a 100644 --- a/amarok/src/engine/nmm/ServerregistryPing.cpp +++ b/amarok/src/engine/nmm/ServerregistryPing.cpp @@ -26,15 +26,15 @@ #include "debug.h" -ServerregistryPing::ServerregistryPing(const QString &host, Q_UINT16 port) - : QSocket() +ServerregistryPing::ServerregistryPing(const TQString &host, Q_UINT16 port) + : TQSocket() { - connect( this, SIGNAL(connected()), - SLOT(socketConnected()) ); - connect( this, SIGNAL(connectionClosed()), - SLOT(socketConnectionClosed()) ); - connect( this, SIGNAL(error(int)), - SLOT(socketError(int)) ); + connect( this, TQT_SIGNAL(connected()), + TQT_SLOT(socketConnected()) ); + connect( this, TQT_SIGNAL(connectionClosed()), + TQT_SLOT(socketConnectionClosed()) ); + connect( this, TQT_SIGNAL(error(int)), + TQT_SLOT(socketError(int)) ); connectToHost(host, port); } diff --git a/amarok/src/engine/nmm/ServerregistryPing.h b/amarok/src/engine/nmm/ServerregistryPing.h index 06313d48..6cf9170d 100644 --- a/amarok/src/engine/nmm/ServerregistryPing.h +++ b/amarok/src/engine/nmm/ServerregistryPing.h @@ -27,7 +27,7 @@ #ifndef SERVERREGISTRYPING_H #define SERVERREGISTRYPING_H -#include +#include /** * Connects to a remote host on the default NMM serverregistry port. @@ -38,7 +38,7 @@ class ServerregistryPing Q_OBJECT public: - ServerregistryPing(const QString & host, Q_UINT16 port = 22801); + ServerregistryPing(const TQString & host, Q_UINT16 port = 22801); private slots: void socketConnected(); diff --git a/amarok/src/engine/nmm/nmm_configdialog.cpp b/amarok/src/engine/nmm/nmm_configdialog.cpp index 6c13b203..b4bcd5da 100644 --- a/amarok/src/engine/nmm/nmm_configdialog.cpp +++ b/amarok/src/engine/nmm/nmm_configdialog.cpp @@ -29,13 +29,13 @@ #include "HostListItem.h" #include "debug.h" -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include NmmConfigDialog::NmmConfigDialog() @@ -53,11 +53,11 @@ NmmConfigDialog::NmmConfigDialog() /* create host list widget stack */ m_environment_list = new HostList( m_view->audioGroup, "TheEnvironmentList" ); m_environment_list->setReadOnly( true ); - m_environment_list->setSelectionMode( QListView::NoSelection ); + m_environment_list->setSelectionMode( TQListView::NoSelection ); m_user_list = new HostList( m_view->audioGroup, "TheUserList" ); - m_user_list->setSelectionMode( QListView::Single ); - connect( m_user_list, SIGNAL( viewChanged() ), this, SLOT( hostListModified() ) ); + m_user_list->setSelectionMode( TQListView::Single ); + connect( m_user_list, TQT_SIGNAL( viewChanged() ), this, TQT_SLOT( hostListModified() ) ); m_view->hostListStack->addWidget( m_environment_list ); m_view->hostListStack->addWidget( m_user_list ); @@ -74,17 +74,17 @@ NmmConfigDialog::NmmConfigDialog() createHostLists(); /* connect 'Add...' and 'Remove' buttons */ - connect( m_view->addLocationButton, SIGNAL( released() ), SLOT( addHost() ) ); - connect( m_view->removeHostButton, SIGNAL( released() ), SLOT( removeHost() ) ); - connect( m_user_list, SIGNAL( selectionChanged() ) , this, SLOT( enableRemoveButton() ) ); + connect( m_view->addLocationButton, TQT_SIGNAL( released() ), TQT_SLOT( addHost() ) ); + connect( m_view->removeHostButton, TQT_SIGNAL( released() ), TQT_SLOT( removeHost() ) ); + connect( m_user_list, TQT_SIGNAL( selectionChanged() ) , this, TQT_SLOT( enableRemoveButton() ) ); /* connect audioGroup selection */ - connect( m_view->audioGroup, SIGNAL( released(int) ), SLOT( clickedAudioGroup(int) ) ); + connect( m_view->audioGroup, TQT_SIGNAL( released(int) ), TQT_SLOT( clickedAudioGroup(int) ) ); - PluginConfig::connect( m_view->audioPlaybackNode, SIGNAL( activated( int ) ), SIGNAL( viewChanged() ) ); - PluginConfig::connect( m_view->audioGroup, SIGNAL( released( int ) ), SIGNAL( viewChanged() ) ); + PluginConfig::connect( m_view->audioPlaybackNode, TQT_SIGNAL( activated( int ) ), TQT_SIGNAL( viewChanged() ) ); + PluginConfig::connect( m_view->audioGroup, TQT_SIGNAL( released( int ) ), TQT_SIGNAL( viewChanged() ) ); -// connect( this, SIGNAL( viewChanged() ) ) +// connect( this, TQT_SIGNAL( viewChanged() ) ) } NmmConfigDialog::~NmmConfigDialog() @@ -121,9 +121,9 @@ void NmmConfigDialog::save() //NmmEngine::instance()->setEnvironmentHostList( tmp_environment_list ); /* save user host list and toggle states for audio, video */ - QValueList tmp_user_list; + TQValueList tmp_user_list; - QListViewItemIterator it( m_user_list ); + TQListViewItemIterator it( m_user_list ); HostListItem *host; while( it.current() ) { host = static_cast( it.current() ); @@ -133,10 +133,10 @@ void NmmConfigDialog::save() NmmEngine::instance()->setUserHostList( tmp_user_list ); - QStringList hosts; - QStringList audio_hosts; - QStringList video_hosts; - QValueList::iterator it_n; + TQStringList hosts; + TQStringList audio_hosts; + TQStringList video_hosts; + TQValueList::iterator it_n; for( it_n = tmp_user_list.begin(); it_n != tmp_user_list.end(); ++it_n ) { debug() << "saved user host" << endl; @@ -165,9 +165,9 @@ void NmmConfigDialog::save() void NmmConfigDialog::addHost() { bool ok; - QString hostname = QInputDialog::getText( - "New NMM sink host", "Enter hostname to add:", QLineEdit::Normal, - QString::null, &ok, NULL); + TQString hostname = QInputDialog::getText( + "New NMM sink host", "Enter hostname to add:", TQLineEdit::Normal, + TQString::null, &ok, NULL); if( ok && !hostname.isEmpty() ) { new HostListItem( m_user_list, hostname ); @@ -221,7 +221,7 @@ void NmmConfigDialog::clickedAudioGroup( int new_selection ) current_audio_group_selection = new_selection; } -void NmmConfigDialog::notifyHostError( QString hostname, int error ) +void NmmConfigDialog::notifyHostError( TQString hostname, int error ) { m_user_list->notifyHostError( hostname, error ); m_environment_list->notifyHostError( hostname, error ); @@ -243,8 +243,8 @@ void NmmConfigDialog::createHostLists() { DEBUG_BLOCK - QValueList::iterator it; - QValueList list; + TQValueList::iterator it; + TQValueList list; list = NmmEngine::instance()->environmentHostList(); for( it = list.begin(); it != list.end(); ++it ) diff --git a/amarok/src/engine/nmm/nmm_configdialog.h b/amarok/src/engine/nmm/nmm_configdialog.h index 97ffd1a1..e67c39ed 100644 --- a/amarok/src/engine/nmm/nmm_configdialog.h +++ b/amarok/src/engine/nmm/nmm_configdialog.h @@ -29,7 +29,7 @@ #include "nmm_configdialogbase.h" #include "plugin/pluginconfig.h" -#include "qobject.h" +#include "tqobject.h" class HostList; class HostListItem; @@ -43,7 +43,7 @@ class NmmConfigDialog : public Amarok::PluginConfig NmmConfigDialog(); ~NmmConfigDialog(); - QWidget* view() { return m_view; } + TQWidget* view() { return m_view; } // \todo doesn't work the intended way bool hasChanged() const; @@ -75,7 +75,7 @@ class NmmConfigDialog : public Amarok::PluginConfig * \param hostname host the error is related to * \param error error identification, see NMMEngineException::Error */ - void notifyHostError( QString hostname, int error ); + void notifyHostError( TQString hostname, int error ); private slots: /** diff --git a/amarok/src/engine/nmm/nmm_engine.cpp b/amarok/src/engine/nmm/nmm_engine.cpp index b2ef176d..f370974a 100644 --- a/amarok/src/engine/nmm/nmm_engine.cpp +++ b/amarok/src/engine/nmm/nmm_engine.cpp @@ -46,8 +46,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -98,7 +98,7 @@ bool NmmEngine::init() createEnvironmentHostList(); createUserHostList(); - connect( this, SIGNAL( hostError( QString, int ) ), SLOT( notifyHostError( QString, int ) ) ); + connect( this, TQT_SIGNAL( hostError( TQString, int ) ), TQT_SLOT( notifyHostError( TQString, int ) ) ); return true; } @@ -131,7 +131,7 @@ void NmmEngine::checkSecurity() if( !optionvalue.empty() ) writepaths_set = true; - QString str; + TQString str; str += ""; str += "Your current NMM setup is insecure.

"; str += "The file .nmmrc in your home directory restricts read and write access for NMM to certain paths.

"; @@ -149,18 +149,18 @@ void NmmEngine::checkSecurity() KMessageBox::information(0, str, i18n( "Insecure NMM setup" ), "insecureNmmSetup", KMessageBox::AllowLink ); } -void NmmEngine::notifyHostError( QString hostname, int error ) +void NmmEngine::notifyHostError( TQString hostname, int error ) { DEBUG_BLOCK - for( QValueList::Iterator it = tmp_user_list.begin(); it != tmp_user_list.end(); ++it ) { + for( TQValueList::Iterator it = tmp_user_list.begin(); it != tmp_user_list.end(); ++it ) { if( (*it).hostname() == hostname ) { (*it).setStatus( error ); break; } } - for( QValueList::Iterator it = tmp_environment_list.begin(); it != tmp_environment_list.end(); ++it ) { + for( TQValueList::Iterator it = tmp_environment_list.begin(); it != tmp_environment_list.end(); ++it ) { if( (*it).hostname() == hostname ) { (*it).setStatus( error ); break; @@ -177,7 +177,7 @@ Engine::State NmmEngine::state() const Amarok::PluginConfig* NmmEngine::configure() const { NmmConfigDialog* dialog = new NmmConfigDialog(); - connect( this, SIGNAL( hostError( QString, int ) ), dialog, SLOT( notifyHostError(QString, int ) ) ); + connect( this, TQT_SIGNAL( hostError( TQString, int ) ), dialog, TQT_SLOT( notifyHostError(TQString, int ) ) ); return dialog; } @@ -191,7 +191,7 @@ bool NmmEngine::load(const KURL& url, bool stream) // check security options static bool already_checked = false; if( !already_checked) { - QTimer::singleShot(100, this, SLOT( checkSecurity() ) ); + TQTimer::singleShot(100, this, TQT_SLOT( checkSecurity() ) ); already_checked = true; } @@ -211,7 +211,7 @@ bool NmmEngine::load(const KURL& url, bool stream) // make the GraphBuilder construct an appropriate graph for the given URL try { - QStringList hosts; + TQStringList hosts; // node for audio playback NodeDescription playback_nd("PlaybackNode"); @@ -347,14 +347,14 @@ bool NmmEngine::load(const KURL& url, bool stream) return true; } catch ( const NMMEngineException e) { - QString host = e.hostname.c_str(); + TQString host = e.hostname.c_str(); emit hostError(host, error); emit statusText( i18n("NMM engine: Stopping playback...") ); } catch (const Exception& e) { cerr << e << endl; - QString status = e.getComment().c_str() ; - emit statusText( QString( i18n("NMM engine: ") ) + status ); + TQString status = e.getComment().c_str() ; + emit statusText( TQString( i18n("NMM engine: ") ) + status ); } catch(...) { emit statusText( i18n("NMM engine: Something went wrong...") ); @@ -368,7 +368,7 @@ bool NmmEngine::load(const KURL& url, bool stream) if( NmmKDEConfig::location() == NmmKDEConfig::EnumLocation::LocalhostOnly ) { m_localhostonly_errordialog = true; - QString detailed_status = HostListItem::prettyStatus( error ); + TQString detailed_status = HostListItem::prettyStatus( error ); KMessageBox::detailedError( 0, i18n("Local NMM playback failed."), detailed_status, i18n("Error"), KMessageBox::AllowLink ); m_localhostonly_errordialog = false; } @@ -487,22 +487,22 @@ void NmmEngine::cleanup() void NmmEngine::createEnvironmentHostList() { - QString hosts = getenv("AUDIO_HOSTS"); - QStringList list = QStringList::split(":", hosts ); + TQString hosts = getenv("AUDIO_HOSTS"); + TQStringList list = TQStringList::split(":", hosts ); /* merge audio hosts */ - for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + for( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { tmp_environment_list.append( NmmLocation( (*it), true, false, 0, NmmEngine::STATUS_UNKNOWN ) ); } /* merge video hosts */ hosts = getenv("VIDEO_HOSTS"); - list = QStringList::split(":", hosts ); + list = TQStringList::split(":", hosts ); bool found = false; - for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + for( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { found = false; - for( QValueList::Iterator it_t = tmp_environment_list.begin(); it_t != tmp_environment_list.end(); ++it_t ) { + for( TQValueList::Iterator it_t = tmp_environment_list.begin(); it_t != tmp_environment_list.end(); ++it_t ) { if( (*it_t).hostname() == *it ) { (*it_t).setVideo(true); found = true; @@ -515,7 +515,7 @@ void NmmEngine::createEnvironmentHostList() } //debug() << "### ENVIRONMENT" << endl; - //for( QValueList::Iterator it = tmp_environment_list.begin(); it != tmp_environment_list.end(); ++it ) { + //for( TQValueList::Iterator it = tmp_environment_list.begin(); it != tmp_environment_list.end(); ++it ) { //debug() << "### hostname " << (*it).hostname() << endl; //debug() << "### audio " << (*it).audio() << endl; //debug() << "### video " << (*it).video() << endl; @@ -525,9 +525,9 @@ void NmmEngine::createEnvironmentHostList() void NmmEngine::createUserHostList() { - QStringList hosts = NmmKDEConfig::hostList(); - QStringList audio_list = NmmKDEConfig::audioToggle(); - QStringList video_list = NmmKDEConfig::videoToggle(); + TQStringList hosts = NmmKDEConfig::hostList(); + TQStringList audio_list = NmmKDEConfig::audioToggle(); + TQStringList video_list = NmmKDEConfig::videoToggle(); bool audio = false; bool video = false; @@ -607,18 +607,18 @@ uint NmmEngine::length() const bool NmmEngine::canDecode(const KURL& url) const { - static QStringList types; + static TQStringList types; if (url.protocol() == "http" ) return false; // the following MIME types can be decoded - types += QString("audio/x-mp3"); - types += QString("audio/x-wav"); - types += QString("audio/ac3"); - types += QString("audio/vorbis"); - types += QString("video/mpeg"); - types += QString("video/x-msvideo"); - types += QString("video/x-ogm"); + types += TQString("audio/x-mp3"); + types += TQString("audio/x-wav"); + types += TQString("audio/ac3"); + types += TQString("audio/vorbis"); + types += TQString("video/mpeg"); + types += TQString("video/x-msvideo"); + types += TQString("video/x-ogm"); KFileItem fileItem( KFileItem::Unknown, KFileItem::Unknown, url, false ); //false = determineMimeType straight away KMimeType::Ptr mimetype = fileItem.determineMimeType(); @@ -636,15 +636,15 @@ void NmmEngine::setVolumeSW(uint percent) } } -QStringList NmmEngine::getSinkHosts( bool audio ) +TQStringList NmmEngine::getSinkHosts( bool audio ) { - QStringList hosts; + TQStringList hosts; // TODO: redundant code... // read locations from environment variable if( NmmKDEConfig::location() == NmmKDEConfig::EnumLocation::EnvironmentVariable ) { - for( QValueList::Iterator it = tmp_environment_list.begin(); it != tmp_environment_list.end(); ++it ) { + for( TQValueList::Iterator it = tmp_environment_list.begin(); it != tmp_environment_list.end(); ++it ) { if( audio && (*it).audio() ) hosts.append( (*it).hostname() ); else if( !audio && (*it).video() ) @@ -657,7 +657,7 @@ QStringList NmmEngine::getSinkHosts( bool audio ) // read locations from host list else if( NmmKDEConfig::location() == NmmKDEConfig::EnumLocation::HostList ) { - for( QValueList::Iterator it = tmp_user_list.begin(); it != tmp_user_list.end(); ++it ) { + for( TQValueList::Iterator it = tmp_user_list.begin(); it != tmp_user_list.end(); ++it ) { if( audio && (*it).audio() ) hosts.append( (*it).hostname() ); else if( !audio && (*it).video() ) @@ -690,7 +690,7 @@ Result NmmEngine::endTrack() __position = 0; // cleanup after this method returned - QTimer::singleShot( 0, instance(), SLOT( endOfStreamReached() ) ); + TQTimer::singleShot( 0, instance(), TQT_SLOT( endOfStreamReached() ) ); return SUCCESS; } diff --git a/amarok/src/engine/nmm/nmm_engine.h b/amarok/src/engine/nmm/nmm_engine.h index dad6887c..18c0b2ef 100644 --- a/amarok/src/engine/nmm/nmm_engine.h +++ b/amarok/src/engine/nmm/nmm_engine.h @@ -60,11 +60,11 @@ public: Amarok::PluginConfig* configure() const; - QValueList environmentHostList() const {return tmp_environment_list;} - void setEnvironmentHostList(QValueList list) { tmp_environment_list = list;} + TQValueList environmentHostList() const {return tmp_environment_list;} + void setEnvironmentHostList(TQValueList list) { tmp_environment_list = list;} - QValueList userHostList() const {return tmp_user_list;} - void setUserHostList(QValueList list) { tmp_user_list = list;} + TQValueList userHostList() const {return tmp_user_list;} + void setUserHostList(TQValueList list) { tmp_user_list = list;} static NmmEngine* instance() { return s_instance; } @@ -92,7 +92,7 @@ private slots: * \param hostname host the error is related to * \param error error identification, see NMMEngineException::Error */ - void notifyHostError( QString hostname, int error ); + void notifyHostError( TQString hostname, int error ); signals: /** @@ -100,7 +100,7 @@ signals: * \param hostname host the error is related to * \param error error identification, see NMMEngineException::Error */ - void hostError( QString hostname, int error ); + void hostError( TQString hostname, int error ); protected: void setVolumeSW( uint ); @@ -129,7 +129,7 @@ private: * * \return the audio/video locations */ - QStringList getSinkHosts( bool audio = true ); + TQStringList getSinkHosts( bool audio = true ); /** * This method is called when a setProgress event is received. The two parameters represent a rational number @@ -234,12 +234,12 @@ private: * Environment variables host list. * Only read on startup, volume can be changed via settings dialog. */ - QValueList tmp_environment_list; + TQValueList tmp_environment_list; /** * User host list. */ - QValueList tmp_user_list; + TQValueList tmp_user_list; static NmmEngine* s_instance; diff --git a/amarok/src/engine/xine/xine-config.cpp b/amarok/src/engine/xine/xine-config.cpp index 95295d3f..cbbbb921 100644 --- a/amarok/src/engine/xine/xine-config.cpp +++ b/amarok/src/engine/xine/xine-config.cpp @@ -17,20 +17,20 @@ #include #include -#include -#include -#include +#include +#include +#include //////////////////// /// XineGeneralEntry //////////////////// -XineGeneralEntry::XineGeneralEntry(const QString& key, xine_t *xine, XineConfigDialog* xcf) +XineGeneralEntry::XineGeneralEntry(const TQString& key, xine_t *xine, XineConfigDialog* xcf) : m_valueChanged(false) , m_key(key) , m_xine(xine) { debug() << "new entry " << m_key << endl; - connect(this, SIGNAL(viewChanged()), xcf, SIGNAL(viewChanged() ) ); + connect(this, TQT_SIGNAL(viewChanged()), xcf, TQT_SIGNAL(viewChanged() ) ); } @@ -44,7 +44,7 @@ void XineGeneralEntry::entryChanged() /// Function saveXineEntry ///////////////// template -void saveXineEntry(Functor& storeEntry, T val, const QString& key, xine_t *xine) +void saveXineEntry(Functor& storeEntry, T val, const TQString& key, xine_t *xine) { if(xine) debug() << "its not null " << key << ' ' << val << endl; xine_cfg_entry_t ent; @@ -68,7 +68,7 @@ XineIntFunctor::operator()( xine_cfg_entry_t* ent, int val ) void -XineStrFunctor::operator()( xine_cfg_entry_t* ent, const QString& val ) +XineStrFunctor::operator()( xine_cfg_entry_t* ent, const TQString& val ) { ent->str_value = const_cast(val.ascii()); } @@ -76,7 +76,7 @@ XineStrFunctor::operator()( xine_cfg_entry_t* ent, const QString& val ) //////////////////// /// XineStrEntry //////////////////// -XineStrEntry::XineStrEntry(QLineEdit* input, const QCString & key, xine_t *xine, XineConfigDialog* xcf) +XineStrEntry::XineStrEntry(TQLineEdit* input, const TQCString & key, xine_t *xine, XineConfigDialog* xcf) : XineGeneralEntry(key,xine,xcf) { xine_cfg_entry_t ent; @@ -85,7 +85,7 @@ XineStrEntry::XineStrEntry(QLineEdit* input, const QCString & key, xine_t *xine, input->setText(ent.str_value); m_val = ent.str_value; } - connect( input, SIGNAL( textChanged( const QString & ) ), this, SLOT( entryChanged(const QString &) ) ); + connect( input, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( entryChanged(const TQString &) ) ); } @@ -99,7 +99,7 @@ XineStrEntry::save() void -XineStrEntry::entryChanged(const QString & val) +XineStrEntry::entryChanged(const TQString & val) { m_val = val; XineGeneralEntry::entryChanged(); @@ -108,7 +108,7 @@ XineStrEntry::entryChanged(const QString & val) //////////////////// /// XineIntEntry //////////////////// -XineIntEntry::XineIntEntry(KIntSpinBox* input, const QCString & key, xine_t *xine, XineConfigDialog* xcf) +XineIntEntry::XineIntEntry(KIntSpinBox* input, const TQCString & key, xine_t *xine, XineConfigDialog* xcf) : XineGeneralEntry(key,xine,xcf) { xine_cfg_entry_t ent; @@ -117,11 +117,11 @@ XineIntEntry::XineIntEntry(KIntSpinBox* input, const QCString & key, xine_t *xin input->setValue(ent.num_value); m_val = ent.num_value; } - connect( input, SIGNAL( valueChanged( int ) ), this, SLOT( entryChanged( int ) ) ); + connect( input, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( entryChanged( int ) ) ); } -XineIntEntry::XineIntEntry(const QString& key, xine_t *xine, XineConfigDialog* xcf) +XineIntEntry::XineIntEntry(const TQString& key, xine_t *xine, XineConfigDialog* xcf) : XineGeneralEntry(key,xine,xcf) { } @@ -145,7 +145,7 @@ XineIntEntry::entryChanged(int val) //////////////////// /// XineEnumEntry //////////////////// -XineEnumEntry::XineEnumEntry(QComboBox* input, const QCString & key, xine_t *xine, XineConfigDialog* xcf) +XineEnumEntry::XineEnumEntry(TQComboBox* input, const TQCString & key, xine_t *xine, XineConfigDialog* xcf) : XineIntEntry(key,xine,xcf) { input->clear(); @@ -154,12 +154,12 @@ XineEnumEntry::XineEnumEntry(QComboBox* input, const QCString & key, xine_t *xin { for( int i = 0; ent.enum_values[i]; ++i ) { - input->insertItem( QString::fromLocal8Bit( ent.enum_values[i] ) ); + input->insertItem( TQString::fromLocal8Bit( ent.enum_values[i] ) ); input->setCurrentItem( ent.num_value ); m_val = ent.num_value; } } - connect( input, SIGNAL( activated( int ) ), this, SLOT( entryChanged( int ) ) ); + connect( input, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( entryChanged( int ) ) ); } /////////////////////// @@ -171,7 +171,7 @@ XineConfigDialog::XineConfigDialog( const xine_t* const xine) , m_xine (const_cast(xine)) { m_view = new XineConfigBase(); - m_view->xineLogo->setPixmap( QPixmap( locate( "data", "amarok/images/xine_logo.png" ) ) ); + m_view->xineLogo->setPixmap( TQPixmap( locate( "data", "amarok/images/xine_logo.png" ) ) ); //sound output combo box m_view->deviceComboBox->insertItem(i18n("Autodetect")); const char* const* drivers = xine_list_audio_output_plugins(m_xine); @@ -181,7 +181,7 @@ XineConfigDialog::XineConfigDialog( const xine_t* const xine) m_view->deviceComboBox->insertItem(drivers[i]); } - connect( m_view->deviceComboBox, SIGNAL( activated( int ) ), SIGNAL( viewChanged() ) ); + connect( m_view->deviceComboBox, TQT_SIGNAL( activated( int ) ), TQT_SIGNAL( viewChanged() ) ); m_entries.setAutoDelete(true); m_view->deviceComboBox->setCurrentItem( (XineCfg::outputPlugin() == "auto" ) ? "Autodetect" : XineCfg::outputPlugin() ); init(); @@ -259,7 +259,7 @@ XineConfigDialog::hasChanged() const if(XineCfg::outputPlugin() != ((m_view->deviceComboBox->currentItem() == 0) ? "auto" : m_view->deviceComboBox->currentText())) return true; - QPtrListIterator it( m_entries ); + TQPtrListIterator it( m_entries ); XineGeneralEntry* entry; while( (entry = it.current()) != 0 ) { diff --git a/amarok/src/engine/xine/xine-config.h b/amarok/src/engine/xine/xine-config.h index 789b4942..6064a3d2 100644 --- a/amarok/src/engine/xine/xine-config.h +++ b/amarok/src/engine/xine/xine-config.h @@ -33,11 +33,11 @@ class XineGeneralEntry : public QObject void viewChanged(); protected: - XineGeneralEntry(const QString& key, xine_t *xine, XineConfigDialog* xcf); + XineGeneralEntry(const TQString& key, xine_t *xine, XineConfigDialog* xcf); void entryChanged(); bool m_valueChanged; - QString m_key; + TQString m_key; xine_t *m_xine; }; @@ -45,7 +45,7 @@ class XineGeneralEntry : public QObject class XineStrFunctor { public: - void operator()( xine_cfg_entry_t* ent, const QString& val ); + void operator()( xine_cfg_entry_t* ent, const TQString& val ); }; @@ -57,7 +57,7 @@ class XineIntFunctor template -void saveXineEntry(Functor& storeEntry, T val, const QString& key, xine_t *xine); +void saveXineEntry(Functor& storeEntry, T val, const TQString& key, xine_t *xine); class XineStrEntry : public XineGeneralEntry @@ -65,14 +65,14 @@ class XineStrEntry : public XineGeneralEntry Q_OBJECT public: - XineStrEntry(QLineEdit* input, const QCString & key, xine_t *m_xine, XineConfigDialog* xcf); + XineStrEntry(TQLineEdit* input, const TQCString & key, xine_t *m_xine, XineConfigDialog* xcf); void save(); private slots: - void entryChanged(const QString& newEntry); + void entryChanged(const TQString& newEntry); private: - QString m_val; + TQString m_val; }; @@ -81,8 +81,8 @@ class XineIntEntry : public XineGeneralEntry Q_OBJECT public: - XineIntEntry(KIntSpinBox* input, const QCString & key, xine_t *xine, XineConfigDialog* xcf); - XineIntEntry(const QString& key, xine_t *xine, XineConfigDialog* xcf); + XineIntEntry(KIntSpinBox* input, const TQCString & key, xine_t *xine, XineConfigDialog* xcf); + XineIntEntry(const TQString& key, xine_t *xine, XineConfigDialog* xcf); void save(); protected slots: @@ -97,7 +97,7 @@ class XineEnumEntry : public XineIntEntry { Q_OBJECT public: - XineEnumEntry(QComboBox* input, const QCString & key, xine_t *xine, XineConfigDialog* xcf); + XineEnumEntry(TQComboBox* input, const TQCString & key, xine_t *xine, XineConfigDialog* xcf); }; @@ -108,7 +108,7 @@ class XineConfigDialog : public Amarok::PluginConfig public: XineConfigDialog( const xine_t* const xine); ~XineConfigDialog(); - QWidget* view() { return m_view; } + TQWidget* view() { return m_view; } /** Return true if any of the view settings are different to the currently saved state */ bool hasChanged() const; /** Return true if all view settings are in their default states */ @@ -124,7 +124,7 @@ class XineConfigDialog : public Amarok::PluginConfig void init(); void showHidePluginConfigs() const; xine_t *m_xine; - QPtrList m_entries; + TQPtrList m_entries; XineConfigBase* m_view; }; diff --git a/amarok/src/engine/xine/xine-engine.cpp b/amarok/src/engine/xine/xine-engine.cpp index 05412aca..1d80f746 100644 --- a/amarok/src/engine/xine/xine-engine.cpp +++ b/amarok/src/engine/xine/xine-engine.cpp @@ -34,8 +34,8 @@ AMAROK_EXPORT_PLUGIN( XineEngine ) #include #include -#include -#include +#include +#include extern "C" { @@ -61,8 +61,8 @@ namespace Log } ///returns the configuration we will use. there is no KInstance, so using this hacked up method. -//static inline QCString configPath() { return QFile::encodeName(KStandardDirs().localkdedir() + KStandardDirs::kde_default("data") + "amarok/xine-config"); } -static inline QCString configPath() { return QFile::encodeName(locate( "data", "amarok/") + "xine-config" ); } +//static inline TQCString configPath() { return TQFile::encodeName(KStandardDirs().localkdedir() + KStandardDirs::kde_default("data") + "amarok/xine-config"); } +static inline TQCString configPath() { return TQFile::encodeName(locate( "data", "amarok/") + "xine-config" ); } static Fader *s_fader = 0; static OutFader *s_outfader = 0; @@ -248,7 +248,7 @@ XineEngine::load( const KURL &url, bool isStream ) debug() << "Before xine_open() *****" << endl; - if( xine_open( m_stream, QFile::encodeName( url.url() ) ) ) + if( xine_open( m_stream, TQFile::encodeName( url.url() ) ) ) { debug() << "After xine_open() *****" << endl; @@ -294,7 +294,7 @@ XineEngine::play( uint offset ) if (has_audio && audio_handled && xine_play( m_stream, 0, offset )) { if( s_fader ) - s_fader->start( QThread::LowestPriority ); + s_fader->start( TQThread::LowestPriority ); emit stateChanged( Engine::Playing ); @@ -320,7 +320,7 @@ XineEngine::determineAndShowErrorMessage() { DEBUG_BLOCK - QString body; + TQString body; debug() << "xine_get_error()\n"; switch (xine_get_error( m_stream )) { @@ -354,7 +354,7 @@ XineEngine::determineAndShowErrorMessage() // xine can read the plugin but it didn't find any codec // THUS xine=daft for telling us it could handle the format in canDecode! body = i18n("There is no available decoder."); - QString const ext = Amarok::extension( m_url.url() ).lower(); + TQString const ext = Amarok::extension( m_url.url() ).lower(); if (ext == "mp3" && EngineController::installDistroCodec( "xine-engine" )) return; } @@ -550,7 +550,7 @@ XineEngine::fadeOut( uint fadeLength, bool* terminate, bool exiting ) uint stepSizeUs = (int)( 1000.0 * (float)length / (float)stepsCount ); ::usleep( stepSizeUs ); - QTime t; + TQTime t; t.start(); float mix = 0.0; while ( mix < 1.0 ) @@ -585,7 +585,7 @@ XineEngine::setEqualizerEnabled( bool enable ) m_equalizerEnabled = enable; if( !enable ) { - QValueList gains; + TQValueList gains; for( uint x = 0; x < 10; x++ ) gains << -101; // sets eq gains to zero. @@ -605,14 +605,14 @@ XineEngine::setEqualizerEnabled( bool enable ) post: (1..200) - (1 = down, 100 = middle, 200 = up, 0 = off) */ void -XineEngine::setEqualizerParameters( int preamp, const QValueList &gains ) +XineEngine::setEqualizerParameters( int preamp, const TQValueList &gains ) { if ( !m_stream ) return; m_equalizerGains = gains; m_intPreamp = preamp; - QValueList::ConstIterator it = gains.begin(); + TQValueList::ConstIterator it = gains.begin(); xine_set_param( m_stream, XINE_PARAM_EQ_30HZ, int( (*it )*0.995 + 100 ) ); xine_set_param( m_stream, XINE_PARAM_EQ_60HZ, int( (*++it)*0.995 + 100 ) ); @@ -632,11 +632,11 @@ XineEngine::setEqualizerParameters( int preamp, const QValueList &gains ) bool XineEngine::canDecode( const KURL &url ) const { - static QStringList list; + static TQStringList list; if(list.isEmpty()) { char* exts = xine_get_file_extensions( m_xine ); - list = QStringList::split( ' ', exts ); + list = TQStringList::split( ' ', exts ); free( exts ); exts = NULL; //images list.remove("png"); @@ -662,14 +662,14 @@ XineEngine::canDecode( const KURL &url ) const // play audio CDs pls return true; - QString path = url.path(); + TQString path = url.path(); // partial downloads from Konqi and other browsers // tend to have a .part extension if (path.endsWith( ".part" )) path = path.left( path.length() - 5 ); - const QString ext = path.mid( path.findRev( '.' ) + 1 ).lower(); + const TQString ext = path.mid( path.findRev( '.' ) + 1 ).lower(); return list.contains( ext ); } @@ -743,7 +743,7 @@ XineEngine::scope() } void -XineEngine::timerEvent( QTimerEvent* ) +XineEngine::timerEvent( TQTimerEvent* ) { if ( !m_stream ) return; @@ -784,15 +784,15 @@ Amarok::PluginConfig* XineEngine::configure() const { XineConfigDialog* xcf = new XineConfigDialog( m_xine ); - connect(xcf, SIGNAL( settingsSaved() ), this, SLOT( configChanged() )); - connect(this, SIGNAL( resetConfig(xine_t*) ), xcf, SLOT( reset(xine_t*) )); + connect(xcf, TQT_SIGNAL( settingsSaved() ), this, TQT_SLOT( configChanged() )); + connect(this, TQT_SIGNAL( resetConfig(xine_t*) ), xcf, TQT_SLOT( reset(xine_t*) )); return xcf; } void -XineEngine::customEvent( QCustomEvent *e ) +XineEngine::customEvent( TQCustomEvent *e ) { - #define message static_cast(e->data()) + #define message static_cast(e->data()) switch( e->type() ) { @@ -899,7 +899,7 @@ XineEngine::XineEventListener( void *p, const xine_event_t* xineEvent ) debug() << "XINE_EVENT_UI_SET_TITLE\n"; - QApplication::postEvent( xe, new QCustomEvent( 3003 ) ); + TQApplication::postEvent( xe, new TQCustomEvent( 3003 ) ); break; @@ -915,7 +915,7 @@ XineEngine::XineEventListener( void *p, const xine_event_t* xineEvent ) xine_set_param( xe->m_stream, XINE_PARAM_GAPLESS_SWITCH, 1); #endif //emit signal from GUI thread - QApplication::postEvent( xe, new QCustomEvent(3000) ); + TQApplication::postEvent( xe, new TQCustomEvent(3000) ); break; case XINE_EVENT_PROGRESS: { @@ -923,13 +923,13 @@ XineEngine::XineEventListener( void *p, const xine_event_t* xineEvent ) QString msg = "%1 %2%"; - msg = msg.arg( QString::fromUtf8( pd->description ) ) + msg = msg.arg( TQString::fromUtf8( pd->description ) ) .arg( KGlobal::locale()->formatNumber( pd->percent, 0 ) ); - QCustomEvent *e = new QCustomEvent( 3002 ); - e->setData( new QString( msg ) ); + TQCustomEvent *e = new TQCustomEvent( 3002 ); + e->setData( new TQString( msg ) ); - QApplication::postEvent( xe, e ); + TQApplication::postEvent( xe, e ); } break; @@ -937,11 +937,11 @@ XineEngine::XineEventListener( void *p, const xine_event_t* xineEvent ) /// xine has read the stream and found it actually links to something else /// so we need to play that instead - QString message = QString::fromUtf8( static_cast(xineEvent->data)->mrl ); - QCustomEvent *e = new QCustomEvent( 3004 ); - e->setData( new QString( message ) ); + TQString message = TQString::fromUtf8( static_cast(xineEvent->data)->mrl ); + TQCustomEvent *e = new TQCustomEvent( 3004 ); + e->setData( new TQString( message ) ); - QApplication::postEvent( xe, e ); + TQApplication::postEvent( xe, e ); } break; @@ -950,7 +950,7 @@ XineEngine::XineEventListener( void *p, const xine_event_t* xineEvent ) debug() << "message received from xine\n"; xine_ui_message_data_t *data = (xine_ui_message_data_t *)xineEvent->data; - QString message; + TQString message; switch( data->type ) { @@ -1014,7 +1014,7 @@ XineEngine::XineEventListener( void *p, const xine_event_t* xineEvent ) { message.prepend( "" ); message += ":

"; - message += QString::fromUtf8( (char*)data + data->explanation ); + message += TQString::fromUtf8( (char*)data + data->explanation ); } else break; //if no explanation then why bother! @@ -1038,17 +1038,17 @@ XineEngine::XineEventListener( void *p, const xine_event_t* xineEvent ) if(data->explanation) { message += "xine parameters: "; - message += QString::fromUtf8( (char*)data + data->parameters ); + message += TQString::fromUtf8( (char*)data + data->parameters ); message += ""; } else message += i18n("Sorry, no additional information is available."); - QApplication::postEvent( xe, new QCustomEvent(QEvent::Type(3001), new QString(message)) ); + TQApplication::postEvent( xe, new TQCustomEvent(TQEvent::Type(3001), new TQString(message)) ); } } //case case XINE_EVENT_UI_CHANNELS_CHANGED: //Flameeyes used this for last.fm track changes - QApplication::postEvent( xe, new QCustomEvent(QEvent::Type(3005) ) ); + TQApplication::postEvent( xe, new TQCustomEvent(TQEvent::Type(3005) ) ); break; } //switch @@ -1059,15 +1059,15 @@ Engine::SimpleMetaBundle XineEngine::fetchMetaData() const { Engine::SimpleMetaBundle bundle; - bundle.title = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_TITLE ) ); - bundle.artist = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_ARTIST ) ); - bundle.album = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_ALBUM ) ); - bundle.comment = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_COMMENT ) ); - bundle.genre = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_GENRE ) ); - bundle.bitrate = QString::number( xine_get_stream_info( m_stream, XINE_STREAM_INFO_AUDIO_BITRATE ) / 1000 ); - bundle.samplerate = QString::number( xine_get_stream_info( m_stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE ) ); - bundle.year = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_YEAR ) ); - bundle.tracknr = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_TRACK_NUMBER ) ); + bundle.title = TQString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_TITLE ) ); + bundle.artist = TQString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_ARTIST ) ); + bundle.album = TQString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_ALBUM ) ); + bundle.comment = TQString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_COMMENT ) ); + bundle.genre = TQString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_GENRE ) ); + bundle.bitrate = TQString::number( xine_get_stream_info( m_stream, XINE_STREAM_INFO_AUDIO_BITRATE ) / 1000 ); + bundle.samplerate = TQString::number( xine_get_stream_info( m_stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE ) ); + bundle.year = TQString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_YEAR ) ); + bundle.tracknr = TQString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_TRACK_NUMBER ) ); return bundle; } @@ -1076,33 +1076,33 @@ bool XineEngine::metaDataForUrl(const KURL &url, Engine::SimpleMetaBundle &b) { bool result = false; xine_stream_t* tmpstream = xine_stream_new(m_xine, NULL, NULL); - if (xine_open(tmpstream, QFile::encodeName(url.url()))) { - QString audioCodec = QString::fromUtf8(xine_get_meta_info(tmpstream, XINE_META_INFO_SYSTEMLAYER)); + if (xine_open(tmpstream, TQFile::encodeName(url.url()))) { + TQString audioCodec = TQString::fromUtf8(xine_get_meta_info(tmpstream, XINE_META_INFO_SYSTEMLAYER)); if (audioCodec == "CDDA") { - QString title = QString::fromUtf8( + TQString title = TQString::fromUtf8( xine_get_meta_info(tmpstream, XINE_META_INFO_TITLE)); if ((!title.isNull()) && (!title.isEmpty())) { //no meta info b.title = title; b.artist = - QString::fromUtf8( + TQString::fromUtf8( xine_get_meta_info(tmpstream, XINE_META_INFO_ARTIST)); b.album = - QString::fromUtf8( + TQString::fromUtf8( xine_get_meta_info(tmpstream, XINE_META_INFO_ALBUM)); b.genre = - QString::fromUtf8( + TQString::fromUtf8( xine_get_meta_info(tmpstream, XINE_META_INFO_GENRE)); b.year = - QString::fromUtf8( + TQString::fromUtf8( xine_get_meta_info(tmpstream, XINE_META_INFO_YEAR)); b.tracknr = - QString::fromUtf8( + TQString::fromUtf8( xine_get_meta_info(tmpstream, XINE_META_INFO_TRACK_NUMBER)); if( b.tracknr.isEmpty() ) b.tracknr = url.filename(); } else { - b.title = QString(i18n("Track %1")).arg(url.filename()); + b.title = TQString(i18n("Track %1")).arg(url.filename()); b.album = i18n("AudioCD"); } } @@ -1117,11 +1117,11 @@ bool XineEngine::metaDataForUrl(const KURL &url, Engine::SimpleMetaBundle &b) int nbrChannels = xine_get_stream_info( tmpstream, XINE_STREAM_INFO_AUDIO_CHANNELS ); int bitrate = (samplerate * bitsPerSample * nbrChannels) / 1000; - b.bitrate = QString::number(bitrate); - b.samplerate = QString::number(samplerate); + b.bitrate = TQString::number(bitrate); + b.samplerate = TQString::number(samplerate); int pos, time, length = 0; xine_get_pos_length(tmpstream, &pos, &time, &length); - b.length = QString::number(length / 1000); + b.length = TQString::number(length / 1000); } xine_close(tmpstream); } @@ -1129,7 +1129,7 @@ bool XineEngine::metaDataForUrl(const KURL &url, Engine::SimpleMetaBundle &b) return result; } -bool XineEngine::getAudioCDContents(const QString &device, KURL::List &urls) +bool XineEngine::getAudioCDContents(const TQString &device, KURL::List &urls) { char **xine_urls = NULL; int num; @@ -1176,8 +1176,8 @@ bool XineEngine::lastFmProxyRequired() ////////////////////////////////////////////////////////////////////////////// Fader::Fader( XineEngine *engine, uint fadeMs ) - : QObject( engine ) - , QThread() + : TQObject( engine ) + , TQThread() , m_engine( engine ) , m_xine( engine->m_xine ) , m_decrease( engine->m_stream ) @@ -1236,7 +1236,7 @@ Fader::run() if ( m_terminated ) break; // sleep a constant amount of time - QThread::usleep( stepSizeUs ); + TQThread::usleep( stepSizeUs ); if ( m_paused ) continue; @@ -1300,8 +1300,8 @@ Fader::finish() ////////////////////////////////////////////////////////////////////////////// OutFader::OutFader( XineEngine *engine, uint fadeLength ) - : QObject( engine ) - , QThread() + : TQObject( engine ) + , TQThread() , m_engine( engine ) , m_terminated( false ) , m_fadeLength( fadeLength ) diff --git a/amarok/src/engine/xine/xine-engine.h b/amarok/src/engine/xine/xine-engine.h index fb4d3ecb..7cb9f3bc 100644 --- a/amarok/src/engine/xine/xine-engine.h +++ b/amarok/src/engine/xine/xine-engine.h @@ -12,7 +12,7 @@ #define XINE_ENGINE_H #include "enginebase.h" -#include +#include extern "C" { @@ -43,7 +43,7 @@ class XineEngine : public Engine::Base virtual void seek( uint ); virtual bool metaDataForUrl(const KURL &url, Engine::SimpleMetaBundle &b); - virtual bool getAudioCDContents(const QString &device, KURL::List &urls); + virtual bool getAudioCDContents(const TQString &device, KURL::List &urls); virtual bool flushBuffer(); virtual Engine::State state() const; @@ -51,13 +51,13 @@ class XineEngine : public Engine::Base virtual Amarok::PluginConfig *configure() const; virtual void setEqualizerEnabled( bool ); - virtual void setEqualizerParameters( int preamp, const QValueList& ); + virtual void setEqualizerParameters( int preamp, const TQValueList& ); virtual void setVolumeSW( uint ); virtual void fadeOut( uint fadeLength, bool* terminate, bool exiting = false ); static void XineEventListener( void*, const xine_event_t* ); - virtual void customEvent( QCustomEvent* ); - virtual void timerEvent( QTimerEvent* ); + virtual void customEvent( TQCustomEvent* ); + virtual void timerEvent( TQTimerEvent* ); virtual void playlistChanged(); @@ -82,12 +82,12 @@ class XineEngine : public Engine::Base bool m_stopFader; bool m_fadeOutRunning; - QString m_currentAudioPlugin; //to see if audio plugin has been changed + TQString m_currentAudioPlugin; //to see if audio plugin has been changed XineConfigDialog* m_configDialog; //need to save these for when the audio plugin is changed and xine reloaded bool m_equalizerEnabled; int m_intPreamp; - QValueList m_equalizerGains; + TQValueList m_equalizerGains; mutable Engine::SimpleMetaBundle m_currentBundle; @@ -101,7 +101,7 @@ signals: void resetConfig(xine_t *xine); }; -class Fader : public QObject, public QThread +class Fader : public TQObject, public QThread { XineEngine *m_engine; xine_t *m_xine; @@ -123,7 +123,7 @@ public: void finish(); }; -class OutFader : public QObject, public QThread +class OutFader : public TQObject, public QThread { XineEngine *m_engine; bool m_terminated; diff --git a/amarok/src/engine/yauap/yauap-engine.cpp b/amarok/src/engine/yauap/yauap-engine.cpp index 0a4fb9d0..bc7ec843 100644 --- a/amarok/src/engine/yauap/yauap-engine.cpp +++ b/amarok/src/engine/yauap/yauap-engine.cpp @@ -13,7 +13,7 @@ copyright : (C) 2006 by Sascha Sommer * * ***************************************************************************/ -#include +#include #include #include @@ -47,13 +47,13 @@ signal_handler( DBusConnection * /*con*/, DBusMessage *msg, void *data ) const char *interface = dbus_message_get_interface(msg); bool handled = true; - debug() << "SIGNAL member " << member << " interface " << interface << " objpath " << objectpath << endl; + debug() << "TQT_SIGNAL member " << member << " interface " << interface << " objpath " << objectpath << endl; if (dbus_message_is_signal( msg, "org.yauap.CommandInterface", "MetadataSignal")) - QApplication::postEvent(engine, new QCustomEvent(3004)); + TQApplication::postEvent(engine, new TQCustomEvent(3004)); else if(dbus_message_is_signal( msg, "org.yauap.CommandInterface", "EosSignal")) { if (engine->m_state == Engine::Playing) - QApplication::postEvent(engine, new QCustomEvent(3000)); + TQApplication::postEvent(engine, new TQCustomEvent(3000)); } else if(dbus_message_is_signal( msg, "org.yauap.CommandInterface", "ErrorSignal")) { @@ -61,9 +61,9 @@ signal_handler( DBusConnection * /*con*/, DBusMessage *msg, void *data ) DBusError error; dbus_error_init(&error); if(dbus_message_get_args( msg, &error, DBUS_TYPE_STRING, &text, DBUS_TYPE_INVALID)) { - QCustomEvent* e = new QCustomEvent(3002); - e->setData(new QString(text)); - QApplication::postEvent(engine, e); + TQCustomEvent* e = new TQCustomEvent(3002); + e->setData(new TQString(text)); + TQApplication::postEvent(engine, e); } } else @@ -167,7 +167,7 @@ DBusConnection::send(const char *method, int first_arg_type, ...) dbus_uint32_t serial = 0; bool ret = false; - QMutexLocker lock(&m_mutex); + TQMutexLocker lock(&m_mutex); DBusMessage* msg = dbus_message_new_method_call( YAUAP_DBUS_SERVICE, YAUAP_DBUS_PATH, YAUAP_DBUS_INTERFACE, @@ -223,7 +223,7 @@ DBusConnection::send_with_reply(const char* method, int first_arg_type, ...) DBusMessage* DBusConnection::send_with_reply(const char* method, int first_arg_type, va_list ap) { - QMutexLocker lock(&m_mutex); + TQMutexLocker lock(&m_mutex); DBusMessage* msg = dbus_message_new_method_call( YAUAP_DBUS_SERVICE, YAUAP_DBUS_PATH, YAUAP_DBUS_INTERFACE, method); @@ -330,9 +330,9 @@ yauapEngine::update_metadata() if(bndl->title.isEmpty() && loaded_url.protocol() == "cdda") return; - QCustomEvent* e = new QCustomEvent(3003); + TQCustomEvent* e = new TQCustomEvent(3003); e->setData(bndl); - QApplication::postEvent(this, e); + TQApplication::postEvent(this, e); } @@ -437,9 +437,9 @@ yauapEngine::handleDbusError(const char* method) #endif void -yauapEngine::customEvent(QCustomEvent *e) +yauapEngine::customEvent(TQCustomEvent *e) { - QString* message = static_cast(e->data()); + TQString* message = static_cast(e->data()); switch (e->type()) { case 3000: @@ -473,7 +473,7 @@ yauapEngine::init() m_state = Engine::Idle; - connect(&helper, SIGNAL(processExited(KProcess*)), SLOT(yauapProcessExited())); + connect(&helper, TQT_SIGNAL(processExited(KProcess*)), TQT_SLOT(yauapProcessExited())); if (initDbusConnection()) return true; @@ -486,7 +486,7 @@ yauapEngine::init() bool yauapEngine::canDecode( const KURL &kurl ) const { - QCString qurl = kurl.url().utf8(); + TQCString qurl = kurl.url().utf8(); const char* url = qurl.data(); return con->call("can_decode", DBUS_TYPE_STRING, &url, DBUS_TYPE_INVALID) > 0; @@ -496,7 +496,7 @@ yauapEngine::canDecode( const KURL &kurl ) const bool yauapEngine::load( const KURL &url, bool isStream ) { - QString qurl = url.url(); + TQString qurl = url.url(); const char* curl = qurl.ascii(); m_isStream = isStream; @@ -616,11 +616,11 @@ yauapEngine::seek( uint offset ) } bool -yauapEngine::getAudioCDContents(const QString &device, KURL::List &urls) +yauapEngine::getAudioCDContents(const TQString &device, KURL::List &urls) { debug() << "Getting AudioCD contents..." << endl; - QCString cdevice = device.latin1(); + TQCString cdevice = device.latin1(); const char* cdevice_ptr = cdevice.data(); DBusMessage* msg = con->send_with_reply("get_audio_cd_contents", @@ -643,10 +643,10 @@ yauapEngine::getAudioCDContents(const QString &device, KURL::List &urls) Engine::SimpleMetaBundle b; char* saveptr; - KURL url = QString("cdda://").append( strtok_r(reply_ptr,"=",&saveptr)); + KURL url = TQString("cdda://").append( strtok_r(reply_ptr,"=",&saveptr)); urls << url; debug() << url << endl; - b.title = QString( i18n( "Track %1" ) ).arg( i+1 ); + b.title = TQString( i18n( "Track %1" ) ).arg( i+1 ); b.length = strtok_r(NULL,"=",&saveptr); b.album = "AudioCD"; b.tracknr = i+1; diff --git a/amarok/src/engine/yauap/yauap-engine.h b/amarok/src/engine/yauap/yauap-engine.h index 1a3a71d9..662b8919 100644 --- a/amarok/src/engine/yauap/yauap-engine.h +++ b/amarok/src/engine/yauap/yauap-engine.h @@ -33,7 +33,7 @@ class DBusConnection : public QObject DBusQt::Connection *qt_connection; DBusConnection *dbus_connection; yauapEngine *context; - QMutex m_mutex; + TQMutex m_mutex; public: bool open(); @@ -50,7 +50,7 @@ public: class yauapProcess : public Amarok::Process { public: - yauapProcess(QObject* parent) : Amarok::Process(parent) {} + yauapProcess(TQObject* parent) : Amarok::Process(parent) {} virtual int commSetupDoneC(); }; @@ -79,14 +79,14 @@ class yauapEngine : public Engine::Base virtual uint length() const ; virtual Engine::State state() const { return m_state; } virtual const Engine::Scope &scope(); - virtual bool getAudioCDContents(const QString &device, KURL::List &urls); + virtual bool getAudioCDContents(const TQString &device, KURL::List &urls); virtual bool metaDataForUrl(const KURL &url, Engine::SimpleMetaBundle &b); public: yauapEngine() : EngineBase(), helper(0) {} /* these need to be public because they are called from the dbus signal handler */ void update_metadata(); void update_scope(); - virtual void customEvent(QCustomEvent*); + virtual void customEvent(TQCustomEvent*); private slots: void yauapProcessExited(); diff --git a/amarok/src/enginebase.h b/amarok/src/enginebase.h index f47858a5..9ea74445 100644 --- a/amarok/src/enginebase.h +++ b/amarok/src/enginebase.h @@ -9,8 +9,8 @@ #include "amarok_export.h" #include -#include //baseclass -#include //stack alloc +#include //baseclass +#include //stack alloc #include #include @@ -58,7 +58,7 @@ namespace Engine { typedef std::vector Scope; - class LIBAMAROK_EXPORT Base : public QObject, public Amarok::Plugin + class LIBAMAROK_EXPORT Base : public TQObject, public Amarok::Plugin { Q_OBJECT @@ -67,14 +67,14 @@ namespace Engine void trackEnded(); /** Transmits status message, the message disappears after ~2s. */ - void statusText( const QString& ); + void statusText( const TQString& ); /** * Shows a long message in a non-invasive manner, you should prefer * this over KMessageBoxes, but do use KMessageBox when you must * interrupt the user or the message is very important. */ - void infoMessage( const QString& ); + void infoMessage( const TQString& ); /** Transmits metadata package. */ void metaData( const Engine::SimpleMetaBundle& ); @@ -86,7 +86,7 @@ namespace Engine void stateChanged( Engine::State ); /** Shows Amarok config dialog at specified page */ - void showConfigDialog( const QCString& ); + void showConfigDialog( const TQCString& ); public: virtual ~Base(); @@ -200,7 +200,7 @@ namespace Engine * @param bandGains a list of 10 integers, ascending in frequency, the exact frequencies you amplify * are not too-important at this time */ - virtual void setEqualizerParameters( int /*preamp*/, const QValueList &/*bandGains*/ ) {}; + virtual void setEqualizerParameters( int /*preamp*/, const TQValueList &/*bandGains*/ ) {}; /** Tries to retrieve metadata for the given url (called only if url @@ -218,11 +218,11 @@ namespace Engine * audio cds: in this case, the KURL::List is filled with the urls of * the songs in the cd... * - * @param device the cdrom device , with QString::null meaning use engine-specific default value + * @param device the cdrom device , with TQString::null meaning use engine-specific default value * @param urls the list of urls for AudioCD tracks to fill * @return true if the engine has the feature of reading from audio cds, false otherwise (note that this should return true also in case of error if the engine is capable of reading audio cds in general...) * */ - virtual bool getAudioCDContents(const QString &, KURL::List &) + virtual bool getAudioCDContents(const TQString &, KURL::List &) { return false; } /** @@ -266,16 +266,16 @@ namespace Engine class SimpleMetaBundle { public: - QString title; - QString artist; - QString album; - QString comment; - QString genre; - QString bitrate; - QString samplerate; - QString length; - QString year; - QString tracknr; + TQString title; + TQString artist; + TQString album; + TQString comment; + TQString genre; + TQString bitrate; + TQString samplerate; + TQString length; + TQString year; + TQString tracknr; }; } diff --git a/amarok/src/enginecontroller.cpp b/amarok/src/enginecontroller.cpp index e16ab2f0..a09fe50a 100644 --- a/amarok/src/enginecontroller.cpp +++ b/amarok/src/enginecontroller.cpp @@ -25,9 +25,9 @@ #include "pluginmanager.h" #include "statusbar.h" -#include -#include -#include +#include +#include +#include #include #include @@ -59,7 +59,7 @@ EngineController::EngineController() , m_delayTime( 0 ) , m_muteVolume( 0 ) , m_xFadeThisTrack( false ) - , m_timer( new QTimer( this ) ) + , m_timer( new TQTimer( this ) ) , m_playFailureCount( 0 ) , m_lastFm( false ) , m_positionOffset( 0 ) @@ -67,7 +67,7 @@ EngineController::EngineController() { m_voidEngine = m_engine = loadEngine( "void-engine" ); - connect( m_timer, SIGNAL( timeout() ), SLOT( slotMainTimer() ) ); + connect( m_timer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotMainTimer() ) ); } EngineController::~EngineController() @@ -113,7 +113,7 @@ EngineController::loadEngine() //static m_engine = loadEngine( AmarokConfig::soundSystem() ); - const QString engineName = PluginManager::getService( m_engine )->property( "X-KDE-Amarok-name" ).toString(); + const TQString engineName = PluginManager::getService( m_engine )->property( "X-KDE-Amarok-name" ).toString(); if( !AmarokConfig::soundSystem().isEmpty() && engineName != AmarokConfig::soundSystem() ) { //AmarokConfig::soundSystem() is empty on the first-ever-run @@ -134,18 +134,18 @@ EngineController::loadEngine() //static return m_engine; } -#include +#include EngineBase* -EngineController::loadEngine( const QString &engineName ) +EngineController::loadEngine( const TQString &engineName ) { /// always returns a valid plugin (exits if it can't get one) DEBUG_BLOCK - QString query = "[X-KDE-Amarok-plugintype] == 'engine' and [X-KDE-Amarok-name] != '%1'"; + TQString query = "[X-KDE-Amarok-plugintype] == 'engine' and [X-KDE-Amarok-name] != '%1'"; KTrader::OfferList offers = PluginManager::query( query.arg( engineName ) ); - // sort by rank, QValueList::operator[] is O(n), so this is quite inefficient + // sort by rank, TQValueList::operator[] is O(n), so this is quite inefficient #define rank( x ) (x)->property( "X-KDE-Amarok-rank" ).toInt() for( int n = offers.count()-1, i = 0; i < n; i++ ) for( int j = n; j > i; j-- ) @@ -161,24 +161,24 @@ EngineController::loadEngine( const QString &engineName ) Amarok::Plugin *plugin = PluginManager::createFromService( *it ); if( plugin ) { - QObject *bar = Amarok::StatusBar::instance(); + TQObject *bar = Amarok::StatusBar::instance(); EngineBase *engine = static_cast( plugin ); - connect( engine, SIGNAL(stateChanged( Engine::State )), - this, SLOT(slotStateChanged( Engine::State )) ); - connect( engine, SIGNAL(trackEnded()), - this, SLOT(slotTrackEnded()) ); + connect( engine, TQT_SIGNAL(stateChanged( Engine::State )), + this, TQT_SLOT(slotStateChanged( Engine::State )) ); + connect( engine, TQT_SIGNAL(trackEnded()), + this, TQT_SLOT(slotTrackEnded()) ); if( bar ) { - connect( engine, SIGNAL(statusText( const QString& )), - bar, SLOT(shortMessage( const QString& )) ); - connect( engine, SIGNAL(infoMessage( const QString& )), - bar, SLOT(longMessage( const QString& )) ); + connect( engine, TQT_SIGNAL(statusText( const TQString& )), + bar, TQT_SLOT(shortMessage( const TQString& )) ); + connect( engine, TQT_SIGNAL(infoMessage( const TQString& )), + bar, TQT_SLOT(longMessage( const TQString& )) ); } - connect( engine, SIGNAL(metaData( const Engine::SimpleMetaBundle& )), - this, SLOT(slotEngineMetaData( const Engine::SimpleMetaBundle& )) ); - connect( engine, SIGNAL(showConfigDialog( const QCString& )), - kapp, SLOT(slotConfigAmarok( const QCString& )) ); + connect( engine, TQT_SIGNAL(metaData( const Engine::SimpleMetaBundle& )), + this, TQT_SLOT(slotEngineMetaData( const Engine::SimpleMetaBundle& )) ); + connect( engine, TQT_SIGNAL(showConfigDialog( const TQCString& )), + kapp, TQT_SLOT(slotConfigAmarok( const TQCString& )) ); if( engine->init() ) return engine; @@ -201,7 +201,7 @@ EngineController::loadEngine( const QString &engineName ) "$ amarok" "More information can be found in the README file. For further assistance join us at #amarok on irc.freenode.net.

" ) ); - // don't use QApplication::exit, as the eventloop may not have started yet + // don't use TQApplication::exit, as the eventloop may not have started yet std::exit( EXIT_SUCCESS ); // Not executed, just here to prevent compiler warning @@ -214,8 +214,8 @@ bool EngineController::canDecode( const KURL &url ) //static //NOTE this function must be thread-safe //TODO a KFileItem version? <- presumably so we can mimetype check - const QString fileName = url.fileName(); - const QString ext = Amarok::extension( fileName ); + const TQString fileName = url.fileName(); + const TQString ext = Amarok::extension( fileName ); if ( PlaylistFile::isPlaylistFile( fileName ) ) return false; @@ -245,8 +245,8 @@ bool EngineController::canDecode( const KURL &url ) //static { //we special case this as otherwise users hate us if ( !valid && ext.lower() == "mp3"){ - QCustomEvent * e = new QCustomEvent( 2000 ); - QApplication::postEvent( Amarok::StatusBar::instance(), e ); + TQCustomEvent * e = new TQCustomEvent( 2000 ); + TQApplication::postEvent( Amarok::StatusBar::instance(), e ); } // Cache this result for the next lookup @@ -268,13 +268,13 @@ void EngineController::unplayableNotification() { .arg( AmarokConfig::soundSystem() ), KDE::StatusBar::Error ); } -bool EngineController::installDistroCodec( const QString& engine /*Filetype type*/) +bool EngineController::installDistroCodec( const TQString& engine /*Filetype type*/) { KService::Ptr service = KTrader::self()->query( "Amarok/CodecInstall" - , QString("[X-KDE-Amarok-codec] == 'mp3' and [X-KDE-Amarok-engine] == '%1'").arg(engine) ).first(); + , TQString("[X-KDE-Amarok-codec] == 'mp3' and [X-KDE-Amarok-engine] == '%1'").arg(engine) ).first(); if( service ) { - QString installScript = service->exec(); + TQString installScript = service->exec(); if( !installScript.isNull() ) //just a sanity check { KGuiItem installButton( i18n( "Install MP3 Support" ) ); @@ -361,7 +361,7 @@ void EngineController::play( const MetaBundle &bundle, uint offset ) m_lastFm = false; //Holds the time since we started trying to play non-existent files //so we know when to abort - static QTime failure_time; + static TQTime failure_time; if ( !m_playFailureCount ) failure_time.start(); @@ -375,7 +375,7 @@ void EngineController::play( const MetaBundle &bundle, uint offset ) if ( url.isLocalFile() ) { // does the file really exist? the playlist entry might be old - if ( ! QFile::exists( url.path()) ) { + if ( ! TQFile::exists( url.path()) ) { //debug() << " file >" << url.path() << "< does not exist!" << endl; Amarok::StatusBar::instance()->shortMessage( i18n("Local file does not exist.") ); goto some_kind_of_failure; @@ -406,10 +406,10 @@ void EngineController::play( const MetaBundle &bundle, uint offset ) if (LastFm::Controller::instance()->changeStation( url.url() ) == -1) // Request was canceled, return immediately. return; - connect( m_engine, SIGNAL( lastFmTrackChange() ), LastFm::Controller::instance()->getService() - , SLOT( requestMetaData() ) ); - connect( LastFm::Controller::instance()->getService(), SIGNAL( metaDataResult( const MetaBundle& ) ), - this, SLOT( slotStreamMetaData( const MetaBundle& ) ) ); + connect( m_engine, TQT_SIGNAL( lastFmTrackChange() ), LastFm::Controller::instance()->getService() + , TQT_SLOT( requestMetaData() ) ); + connect( LastFm::Controller::instance()->getService(), TQT_SIGNAL( metaDataResult( const MetaBundle& ) ), + this, TQT_SLOT( slotStreamMetaData( const MetaBundle& ) ) ); return; } else @@ -422,10 +422,10 @@ void EngineController::play( const MetaBundle &bundle, uint offset ) return; m_lastFm = true; - connect( m_engine, SIGNAL( lastFmTrackChange() ), LastFm::Controller::instance()->getService() - , SLOT( requestMetaData() ) ); - connect( LastFm::Controller::instance()->getService(), SIGNAL( metaDataResult( const MetaBundle& ) ), - this, SLOT( slotStreamMetaData( const MetaBundle& ) ) ); + connect( m_engine, TQT_SIGNAL( lastFmTrackChange() ), LastFm::Controller::instance()->getService() + , TQT_SLOT( requestMetaData() ) ); + connect( LastFm::Controller::instance()->getService(), TQT_SIGNAL( metaDataResult( const MetaBundle& ) ), + this, TQT_SLOT( slotStreamMetaData( const MetaBundle& ) ) ); } debug() << "New URL is " << url.url() << endl; } @@ -500,7 +500,7 @@ void EngineController::play( const MetaBundle &bundle, uint offset ) { //False gives behaviour as if track played successfully next( false ); - QTimer::singleShot( 0, this, SLOT(play()) ); + TQTimer::singleShot( 0, this, TQT_SLOT(play()) ); } else { @@ -747,7 +747,7 @@ void EngineController::slotTrackEnded() //SLOT //FIXME not perfect if ( !m_isTiming ) { - QTimer::singleShot( AmarokConfig::trackDelayLength(), this, SLOT(trackFinished()) ); + TQTimer::singleShot( AmarokConfig::trackDelayLength(), this, TQT_SLOT(trackFinished()) ); m_isTiming = true; } diff --git a/amarok/src/enginecontroller.h b/amarok/src/enginecontroller.h index b85af21d..43a4c703 100644 --- a/amarok/src/enginecontroller.h +++ b/amarok/src/enginecontroller.h @@ -17,11 +17,11 @@ #include "engineobserver.h" #include "metabundle.h" -#include -#include -#include +#include +#include +#include -class QTimer; +class TQTimer; namespace KIO { class Job; } @@ -32,12 +32,12 @@ namespace KIO { class Job; } * TODO: Hide proxy stuff! */ -class EngineController : public QObject, public EngineSubject +class EngineController : public TQObject, public EngineSubject { Q_OBJECT public: - typedef QMap ExtensionCache; + typedef TQMap ExtensionCache; // plugins have their own static space, so calling instance // from a plugin won't do any good. you'll only get a new @@ -46,8 +46,8 @@ public: static EngineBase* engine() { return instance()->m_engine; } static bool canDecode( const KURL& ); static ExtensionCache& extensionCache() { return s_extensionCache; } - static QString engineProperty( const QString& key ) { return engine()->pluginProperty( key ); } - static bool hasEngineProperty( const QString& key ) { return engine()->hasPluginProperty( key ); } + static TQString engineProperty( const TQString& key ) { return engine()->pluginProperty( key ); } + static bool hasEngineProperty( const TQString& key ) { return engine()->hasPluginProperty( key ); } uint trackPosition() const; @@ -68,7 +68,7 @@ public: static const int MAIN_TIMER = 300; /*enum Filetype { MP3 };*/ //assuming MP3 for time being - LIBAMAROK_EXPORT static bool installDistroCodec(const QString& engine /*Filetype type*/); + LIBAMAROK_EXPORT static bool installDistroCodec(const TQString& engine /*Filetype type*/); public slots: void previous(); @@ -102,7 +102,7 @@ signals: void orderPrevious(); void orderCurrent(); void orderNext( const bool ); - void statusText( const QString& ); + void statusText( const TQString& ); private slots: void slotEngineMetaData( const Engine::SimpleMetaBundle& ); @@ -121,7 +121,7 @@ protected: private: static ExtensionCache s_extensionCache; - EngineBase* loadEngine( const QString &engineName ); + EngineBase* loadEngine( const TQString &engineName ); EngineBase* m_engine; EngineBase* m_voidEngine; @@ -132,7 +132,7 @@ private: int m_muteVolume; bool m_xFadeThisTrack; bool m_isTiming; - QTimer* m_timer; + TQTimer* m_timer; uint m_playFailureCount; // try to correct start time for tracks from last.fm streams bool m_lastFm; diff --git a/amarok/src/engineobserver.cpp b/amarok/src/engineobserver.cpp index 082a0c48..68e6fce4 100644 --- a/amarok/src/engineobserver.cpp +++ b/amarok/src/engineobserver.cpp @@ -20,7 +20,7 @@ email : fh@ez.no #include "engineobserver.h" #include "metabundle.h" #include "podcastbundle.h" -#include +#include ////////////////////////////////////////////////////////////////////////////////////////// @@ -60,7 +60,7 @@ void EngineSubject::stateChangedNotify( Engine::State state ) { DEBUG_BLOCK - QPtrListIterator it( Observers ); + TQPtrListIterator it( Observers ); EngineObserver *observer; while( ( observer = it.current() ) != 0 ) { @@ -76,7 +76,7 @@ void EngineSubject::newMetaDataNotify( const MetaBundle &bundle, bool trackChang { DEBUG_BLOCK - QPtrListIterator it( Observers ); + TQPtrListIterator it( Observers ); EngineObserver *observer; PodcastEpisodeBundle peb; @@ -94,16 +94,16 @@ void EngineSubject::newMetaDataNotify( const MetaBundle &bundle, bool trackChang } -void EngineSubject::trackEnded( int finalPosition, int trackLength, const QString &reason ) +void EngineSubject::trackEnded( int finalPosition, int trackLength, const TQString &reason ) { - for( QPtrListIterator it( Observers ); *it; ++it ) + for( TQPtrListIterator it( Observers ); *it; ++it ) (*it)->engineTrackEnded( finalPosition, trackLength, reason ); } void EngineSubject::volumeChangedNotify( int percent ) { - QPtrListIterator it( Observers ); + TQPtrListIterator it( Observers ); EngineObserver *observer; while( ( observer = it.current() ) != 0 ) { @@ -115,7 +115,7 @@ void EngineSubject::volumeChangedNotify( int percent ) void EngineSubject::trackPositionChangedNotify( long position, bool userSeek ) { - QPtrListIterator it( Observers ); + TQPtrListIterator it( Observers ); EngineObserver *observer; while( ( observer = it.current() ) != 0 ) { @@ -127,7 +127,7 @@ void EngineSubject::trackPositionChangedNotify( long position, bool userSeek ) void EngineSubject::trackLengthChangedNotify( long length ) { - QPtrListIterator it( Observers ); + TQPtrListIterator it( Observers ); EngineObserver *observer; while( ( observer = it.current() ) != 0 ) { diff --git a/amarok/src/engineobserver.h b/amarok/src/engineobserver.h index a48419a4..858e8f56 100644 --- a/amarok/src/engineobserver.h +++ b/amarok/src/engineobserver.h @@ -22,7 +22,7 @@ email : fh@ez.no class EngineSubject; class MetaBundle; -class QString; +class TQString; /** * if you want to observe the engine, inherit from this class and attach yourself to @@ -37,7 +37,7 @@ public: virtual ~EngineObserver(); virtual void engineStateChanged( Engine::State /*state*/, Engine::State /*oldState*/ = Engine::Empty ) {} virtual void engineNewMetaData( const MetaBundle &/*bundle*/, bool /*trackChanged*/ ) {} - virtual void engineTrackEnded( int /*finalPosition*/, int /*trackLength*/, const QString &/*reason*/ ) {} + virtual void engineTrackEnded( int /*finalPosition*/, int /*trackLength*/, const TQString &/*reason*/ ) {} virtual void engineVolumeChanged( int /*percent*/ ) {} virtual void engineTrackPositionChanged( long /*position*/ , bool /*userSeek*/ ) {} virtual void engineTrackLengthChanged( long /*length*/ ) {} @@ -46,7 +46,7 @@ private: EngineSubject *m_subject; }; -#include +#include /** * Inherited by EngineController. * Notify observer functionality is captured in this class. @@ -62,14 +62,14 @@ protected: virtual ~EngineSubject(); void stateChangedNotify( Engine::State /*state*/ ); void newMetaDataNotify( const MetaBundle &/*bundle*/, bool /*trackChanged*/ ); - void trackEnded( int /*finalPosition*/, int /*trackLength*/, const QString &reason ); + void trackEnded( int /*finalPosition*/, int /*trackLength*/, const TQString &reason ); void volumeChangedNotify( int /*percent*/ ); /* userSeek means the position didn't change due to normal playback */ void trackPositionChangedNotify( long /*position*/ , bool userSeek=false ); void trackLengthChangedNotify( long /*length*/ ); private: - QPtrList Observers; + TQPtrList Observers; Engine::State m_oldEngineState; }; diff --git a/amarok/src/equalizergraph.cpp b/amarok/src/equalizergraph.cpp index 3714f4d3..bdc007b7 100644 --- a/amarok/src/equalizergraph.cpp +++ b/amarok/src/equalizergraph.cpp @@ -19,16 +19,16 @@ #include "amarokconfig.h" #include "equalizergraph.h" -#include -#include -#include +#include +#include +#include #include -EqualizerGraph::EqualizerGraph( QWidget* parent ) - : QWidget( parent, 0, Qt::WNoAutoErase ) - , m_backgroundPixmap( new QPixmap() ) - , m_composePixmap( new QPixmap() ) +EqualizerGraph::EqualizerGraph( TQWidget* parent ) + : TQWidget( parent, 0, Qt::WNoAutoErase ) + , m_backgroundPixmap( new TQPixmap() ) + , m_composePixmap( new TQPixmap() ) { } @@ -45,7 +45,7 @@ EqualizerGraph::~EqualizerGraph() ///////////////////////////////////////////////////////////////////////////////////// void -EqualizerGraph::resizeEvent( QResizeEvent* ) +EqualizerGraph::resizeEvent( TQResizeEvent* ) { drawBackground(); } @@ -53,23 +53,23 @@ EqualizerGraph::resizeEvent( QResizeEvent* ) QSize EqualizerGraph::sizeHint() const { - return QSize( 100, 60 ); + return TQSize( 100, 60 ); } void -EqualizerGraph::paintEvent( QPaintEvent* ) +EqualizerGraph::paintEvent( TQPaintEvent* ) { bitBlt( m_composePixmap, 0, 0, m_backgroundPixmap ); - QPainter p( m_composePixmap ); + TQPainter p( m_composePixmap ); // Draw middle line int middleLineY = (int) ( ( height() - 1 ) / 2.0 + AmarokConfig::equalizerPreamp() * ( height() - 1 ) / 200.0 ); - QPen pen( colorGroup().dark(), 0, Qt::DotLine); + TQPen pen( colorGroup().dark(), 0, Qt::DotLine); p.setPen( pen ); p.drawLine( 8, middleLineY, width() - 1, middleLineY ); - QColor color( colorGroup().highlight() ); + TQColor color( colorGroup().highlight() ); int h, s, v; color.getHsv( &h, &s, &v ); @@ -142,7 +142,7 @@ EqualizerGraph::drawBackground() m_composePixmap->resize( size() ); m_backgroundPixmap->fill( colorGroup().background().dark( 105 ) ); - QPainter p( m_backgroundPixmap ); + TQPainter p( m_backgroundPixmap ); // Erase background for scale p.fillRect( 0, 0, 7, height() -1, colorGroup().background()); @@ -161,7 +161,7 @@ EqualizerGraph::init_spline( float* x, float* y, int n, float* y2 ) { int i, k; float p, qn, sig, un; - QMemArray u(n * sizeof(float)); + TQMemArray u(n * sizeof(float)); y2[ 0 ] = u[ 0 ] = 0.0; diff --git a/amarok/src/equalizergraph.h b/amarok/src/equalizergraph.h index df76824f..c4c9cbcd 100644 --- a/amarok/src/equalizergraph.h +++ b/amarok/src/equalizergraph.h @@ -18,21 +18,21 @@ #ifndef AMAROK_EQUALIZERGRAPH_H #define AMAROK_EQUALIZERGRAPH_H -#include //baseclass +#include //baseclass -class QPixmap; +class TQPixmap; class EqualizerGraph : public QWidget { public: - EqualizerGraph( QWidget* parent ); + EqualizerGraph( TQWidget* parent ); ~EqualizerGraph(); - QSize sizeHint() const; + TQSize sizeHint() const; protected: - void resizeEvent( QResizeEvent* ); - void paintEvent( QPaintEvent* ); + void resizeEvent( TQResizeEvent* ); + void paintEvent( TQPaintEvent* ); private: static const int NUM_BANDS = 10; @@ -42,8 +42,8 @@ class EqualizerGraph : public QWidget void init_spline( float* x, float* y, int n, float* y2 ); float eval_spline( float xa[], float ya[], float y2a[], int n, float x ); - QPixmap* m_backgroundPixmap; - QPixmap* m_composePixmap; + TQPixmap* m_backgroundPixmap; + TQPixmap* m_composePixmap; }; diff --git a/amarok/src/equalizerpresetmanager.cpp b/amarok/src/equalizerpresetmanager.cpp index 62c3ffb9..d7b9c973 100644 --- a/amarok/src/equalizerpresetmanager.cpp +++ b/amarok/src/equalizerpresetmanager.cpp @@ -19,11 +19,11 @@ #include "equalizerpresetmanager.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -32,38 +32,38 @@ #include #include //locate() -EqualizerPresetManager::EqualizerPresetManager( QWidget *parent, const char *name ) +EqualizerPresetManager::EqualizerPresetManager( TQWidget *parent, const char *name ) : KDialogBase( parent, name, true, i18n("Presets"), Ok | Cancel | Default, Ok, true ) { - QWidget *mainWidget = new QWidget( this ); + TQWidget *mainWidget = new TQWidget( this ); setMainWidget( mainWidget ); - QHBoxLayout *mainLayout = new QHBoxLayout( mainWidget, 0, spacingHint() ); + TQHBoxLayout *mainLayout = new TQHBoxLayout( mainWidget, 0, spacingHint() ); m_presetsView = new KListView( mainWidget, "presetListView" ); m_presetsView->addColumn( i18n( "Presets" ) ); m_presetsView->setFullWidth( true ); - connect(m_presetsView, SIGNAL( selectionChanged() ), SLOT( updateButtonState() )); - connect(m_presetsView, SIGNAL( doubleClicked ( QListViewItem*, const QPoint&, int ) ), SLOT( slotRename() )); + connect(m_presetsView, TQT_SIGNAL( selectionChanged() ), TQT_SLOT( updateButtonState() )); + connect(m_presetsView, TQT_SIGNAL( doubleClicked ( TQListViewItem*, const TQPoint&, int ) ), TQT_SLOT( slotRename() )); mainLayout->addWidget( m_presetsView ); - QVBoxLayout* buttonsLayout = new QVBoxLayout( mainLayout ); + TQVBoxLayout* buttonsLayout = new TQVBoxLayout( mainLayout ); - m_renameBtn = new QPushButton( i18n("&Rename"), mainWidget, "renameBtn" ); - m_deleteBtn = new QPushButton( i18n("&Delete"), mainWidget, "deleteBtn" ); + m_renameBtn = new TQPushButton( i18n("&Rename"), mainWidget, "renameBtn" ); + m_deleteBtn = new TQPushButton( i18n("&Delete"), mainWidget, "deleteBtn" ); buttonsLayout->addWidget( m_renameBtn ); buttonsLayout->addWidget( m_deleteBtn ); - connect(m_renameBtn, SIGNAL( clicked() ), SLOT( slotRename() )); - connect(m_deleteBtn, SIGNAL( clicked() ), SLOT( slotDelete() )); - connect(this, SIGNAL( defaultClicked() ), SLOT( slotDefault() )); + connect(m_renameBtn, TQT_SIGNAL( clicked() ), TQT_SLOT( slotRename() )); + connect(m_deleteBtn, TQT_SIGNAL( clicked() ), TQT_SLOT( slotDelete() )); + connect(this, TQT_SIGNAL( defaultClicked() ), TQT_SLOT( slotDefault() )); - QSpacerItem* spacer = new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 40, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); buttonsLayout->addItem( spacer ); updateButtonState(); - resize( QSize(300, 250).expandedTo(minimumSizeHint()) ); + resize( TQSize(300, 250).expandedTo(minimumSizeHint()) ); } @@ -72,7 +72,7 @@ EqualizerPresetManager::~EqualizerPresetManager() } void -EqualizerPresetManager::setPresets(QMap< QString, QValueList > presets) +EqualizerPresetManager::setPresets(TQMap< TQString, TQValueList > presets) { if ( presets.empty() ) return; @@ -80,13 +80,13 @@ EqualizerPresetManager::setPresets(QMap< QString, QValueList > presets) m_presets = presets; m_presetsView->clear(); - QMap< QString, QValueList >::Iterator end = presets.end(); - for ( QMap< QString, QValueList >::Iterator it = presets.begin(); it != end; ++it ) + TQMap< TQString, TQValueList >::Iterator end = presets.end(); + for ( TQMap< TQString, TQValueList >::Iterator it = presets.begin(); it != end; ++it ) if ( it.key() != i18n( "Zero" ) && it.key() != i18n( "Manual" ) ) // Don't add 'Manual' and 'Zero' new KListViewItem( m_presetsView, it.key() ); } -QMap< QString, QValueList > +TQMap< TQString, TQValueList > EqualizerPresetManager::presets() { return m_presets; @@ -96,8 +96,8 @@ void EqualizerPresetManager::slotRename() { bool ok; - QListViewItem* item = m_presetsView->selectedItem(); - const QString title = KInputDialog::getText( i18n("Rename Equalizer Preset"), + TQListViewItem* item = m_presetsView->selectedItem(); + const TQString title = KInputDialog::getText( i18n("Rename Equalizer Preset"), i18n("Enter new preset name:"), item->text(0), &ok, this); if ( ok && item->text(0) != title ) { @@ -124,36 +124,36 @@ EqualizerPresetManager::slotDefault() return; // Preserve the 'Manual' preset - QValueList manualGains = m_presets[ i18n("Manual") ]; + TQValueList manualGains = m_presets[ i18n("Manual") ]; // Delete all presets m_presets.clear(); // Create predefined presets 'Zero' and 'Manual' - QValueList zeroGains; + TQValueList zeroGains; zeroGains << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0; m_presets[ i18n("Zero") ] = zeroGains; m_presets[ i18n("Manual") ] = manualGains; // Load the default presets - QFile file( locate( "data", "amarok/data/equalizer_presets.xml" ) ); + TQFile file( locate( "data", "amarok/data/equalizer_presets.xml" ) ); - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); - QDomDocument d; + TQDomDocument d; if( !file.open( IO_ReadOnly ) || !d.setContent( stream.read() ) ) return; - QDomNode n = d.namedItem( "equalizerpresets" ).namedItem("preset"); + TQDomNode n = d.namedItem( "equalizerpresets" ).namedItem("preset"); for( ; !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); - QString title = e.attribute( "name" ); + TQDomElement e = n.toElement(); + TQString title = e.attribute( "name" ); - QValueList gains; + TQValueList gains; gains << e.namedItem( "b0" ).toElement().text().toInt(); gains << e.namedItem( "b1" ).toElement().text().toInt(); gains << e.namedItem( "b2" ).toElement().text().toInt(); @@ -177,7 +177,7 @@ EqualizerPresetManager::slotDefault() void EqualizerPresetManager::slotDelete() { - QListViewItem* item = m_presetsView->selectedItem(); + TQListViewItem* item = m_presetsView->selectedItem(); m_presets.remove( item->text(0) ); diff --git a/amarok/src/equalizerpresetmanager.h b/amarok/src/equalizerpresetmanager.h index 17dc7882..44348883 100644 --- a/amarok/src/equalizerpresetmanager.h +++ b/amarok/src/equalizerpresetmanager.h @@ -24,8 +24,8 @@ #include //baseclass -class QPushButton; -class QStringList; +class TQPushButton; +class TQStringList; class KListView; class EqualizerPresetManager : public KDialogBase @@ -33,11 +33,11 @@ class EqualizerPresetManager : public KDialogBase Q_OBJECT public: - EqualizerPresetManager( QWidget *parent = 0, const char *name = 0 ); + EqualizerPresetManager( TQWidget *parent = 0, const char *name = 0 ); virtual ~EqualizerPresetManager(); - void setPresets(QMap< QString, QValueList > presets); - QMap< QString, QValueList > presets(); + void setPresets(TQMap< TQString, TQValueList > presets); + TQMap< TQString, TQValueList > presets(); private slots: void slotRename(); @@ -47,12 +47,12 @@ class EqualizerPresetManager : public KDialogBase void updateButtonState(); private: - QMap< QString, QValueList > m_presets; + TQMap< TQString, TQValueList > m_presets; KListView* m_presetsView; - //QPushButton* m_addBtn; - QPushButton* m_renameBtn; - QPushButton* m_deleteBtn; + //TQPushButton* m_addBtn; + TQPushButton* m_renameBtn; + TQPushButton* m_deleteBtn; }; diff --git a/amarok/src/equalizersetup.cpp b/amarok/src/equalizersetup.cpp index ec1066c6..2b3805ab 100644 --- a/amarok/src/equalizersetup.cpp +++ b/amarok/src/equalizersetup.cpp @@ -24,17 +24,17 @@ #include "equalizersetup.h" #include "sliderwidget.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include //presets -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include //presets +#include +#include #include #include @@ -63,54 +63,54 @@ EqualizerSetup::EqualizerSetup() KWin::setType( winId(), NET::Utility ); KWin::setState( winId(), NET::SkipTaskbar ); - QVBox* vbox = makeVBoxMainWidget(); + TQVBox* vbox = makeVBoxMainWidget(); vbox->setSpacing( KDialog::spacingHint() ); // BEGIN Presets - QHBox* presetBox = new QHBox( vbox ); + TQHBox* presetBox = new TQHBox( vbox ); presetBox->setSpacing( KDialog::spacingHint() ); - new QLabel( i18n("Presets:"), presetBox ); + new TQLabel( i18n("Presets:"), presetBox ); m_presetCombo = new KComboBox( presetBox ); - m_presetCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) ); + m_presetCombo->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Preferred ) ); - QPushButton* presetAdd = new QPushButton( presetBox ); + TQPushButton* presetAdd = new TQPushButton( presetBox ); presetAdd->setIconSet( SmallIconSet( Amarok::icon( "add_playlist" ) ) ); - QToolTip::add( presetAdd, i18n("Add new preset") ); - connect( presetAdd, SIGNAL( clicked() ), SLOT( addPreset() ) ); + TQToolTip::add( presetAdd, i18n("Add new preset") ); + connect( presetAdd, TQT_SIGNAL( clicked() ), TQT_SLOT( addPreset() ) ); - QPushButton* presetConf = new QPushButton( presetBox ); + TQPushButton* presetConf = new TQPushButton( presetBox ); presetConf->setIconSet( SmallIconSet( Amarok::icon( "configure" ) ) ); - QToolTip::add( presetConf, i18n("Manage presets") ); - connect( presetConf, SIGNAL( clicked() ), SLOT( editPresets() ) ); + TQToolTip::add( presetConf, i18n("Manage presets") ); + connect( presetConf, TQT_SIGNAL( clicked() ), TQT_SLOT( editPresets() ) ); loadPresets(); - connect( m_presetCombo, SIGNAL( activated(int) ), SLOT( presetChanged(int) ) ); + connect( m_presetCombo, TQT_SIGNAL( activated(int) ), TQT_SLOT( presetChanged(int) ) ); // END Presets // BEGIN GroupBox - m_groupBoxSliders = new QGroupBox( 1, Qt::Vertical, i18n("Enable Equalizer"), vbox ); + m_groupBoxSliders = new TQGroupBox( 1, Qt::Vertical, i18n("Enable Equalizer"), vbox ); m_groupBoxSliders->setCheckable( true ); m_groupBoxSliders->setChecked( AmarokConfig::equalizerEnabled() ); m_groupBoxSliders->setInsideMargin( KDialog::marginHint() ); - connect( m_groupBoxSliders, SIGNAL( toggled( bool ) ), SLOT( setEqualizerEnabled( bool ) ) ); + connect( m_groupBoxSliders, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( setEqualizerEnabled( bool ) ) ); // Helper widget for layouting inside the groupbox - QWidget* slidersLayoutWidget = new QWidget( m_groupBoxSliders ); - slidersLayoutWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - QGridLayout* slidersGridLayout = new QGridLayout( slidersLayoutWidget, 1, 1, 0, KDialog::spacingHint() ); + TQWidget* slidersLayoutWidget = new TQWidget( m_groupBoxSliders ); + slidersLayoutWidget->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding); + TQGridLayout* slidersGridLayout = new TQGridLayout( slidersLayoutWidget, 1, 1, 0, KDialog::spacingHint() ); // END GroupBox // BEGIN Preamp slider m_slider_preamp = new Slider( Qt::Vertical, slidersLayoutWidget, 100 ); m_slider_preamp->setMinValue( -100 ); - m_slider_preamp->setTickmarks( QSlider::Right ); + m_slider_preamp->setTickmarks( TQSlider::Right ); m_slider_preamp->setTickInterval( 100 ); - connect( m_slider_preamp, SIGNAL( valueChanged( int ) ), SLOT( setEqualizerParameters() ) ); + connect( m_slider_preamp, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( setEqualizerParameters() ) ); slidersGridLayout->addMultiCellWidget(m_slider_preamp, 0, 0, 0, 1, Qt::AlignHCenter ); - QLabel* preampLabel = new QLabel( i18n("Pre-amp"), slidersLayoutWidget ); + TQLabel* preampLabel = new TQLabel( i18n("Pre-amp"), slidersLayoutWidget ); slidersGridLayout->addMultiCellWidget(preampLabel, 1, 1 , 0, 1, Qt::AlignHCenter ); // END @@ -118,7 +118,7 @@ EqualizerSetup::EqualizerSetup() const char *bandLabels[] = { "30", "60", "125", "250", "500", "1k", "2k", "4k", "8k", "16k" }; int minWidth = 0; - QFontMetrics fm = fontMetrics(); //apparently it's an expensive call + TQFontMetrics fm = fontMetrics(); //apparently it's an expensive call for ( int i = 0; i < 10; i++ ) { int w = fm.width( bandLabels[i] ); if ( w > minWidth ) @@ -127,7 +127,7 @@ EqualizerSetup::EqualizerSetup() for ( int i = 0; i < 10; i++ ) { Slider *slider = new Slider( Qt::Vertical, slidersLayoutWidget ); - QLabel *label = new QLabel( bandLabels[i], slidersLayoutWidget ); + TQLabel *label = new TQLabel( bandLabels[i], slidersLayoutWidget ); slider->setMinValue( -100 ); slider->setMaxValue( +100 ); @@ -136,25 +136,25 @@ EqualizerSetup::EqualizerSetup() slidersGridLayout->addMultiCellWidget(label, 1, 1, 2 * i + 2, 2 * i + 3, Qt::AlignHCenter ); m_bandSliders.append( slider ); - connect( slider, SIGNAL( valueChanged( int ) ), SLOT( setEqualizerParameters() ) ); - connect( slider, SIGNAL( valueChanged( int ) ), SLOT( sliderChanged() ) ); + connect( slider, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( setEqualizerParameters() ) ); + connect( slider, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( sliderChanged() ) ); } // END // BEGIN Equalizer Graph Widget - QGroupBox* graphGBox = new QGroupBox( 2, Qt::Horizontal, 0, vbox ); + TQGroupBox* graphGBox = new TQGroupBox( 2, Qt::Horizontal, 0, vbox ); graphGBox->setInsideMargin( KDialog::marginHint() ); - QVBox* graphVBox = new QVBox( graphGBox ); - QLabel* graphLabel1 = new QLabel("+20 db", graphVBox); - QLabel* graphLabel2 = new QLabel("0 db", graphVBox); - QLabel* graphLabel3 = new QLabel("-20 db", graphVBox); + TQVBox* graphVBox = new TQVBox( graphGBox ); + TQLabel* graphLabel1 = new TQLabel("+20 db", graphVBox); + TQLabel* graphLabel2 = new TQLabel("0 db", graphVBox); + TQLabel* graphLabel3 = new TQLabel("-20 db", graphVBox); graphLabel1->setAlignment( Qt::AlignRight | Qt::AlignTop ); graphLabel2->setAlignment( Qt::AlignRight | Qt::AlignVCenter ); graphLabel3->setAlignment( Qt::AlignRight | Qt::AlignBottom ); m_equalizerGraph = new EqualizerGraph( graphGBox ); - m_equalizerGraph->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); + m_equalizerGraph->setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ); // END Graph Widget // Fill the combobox @@ -181,7 +181,7 @@ EqualizerSetup::setActive( bool active ) } void -EqualizerSetup::setBands( int preamp, QValueList gains ) +EqualizerSetup::setBands( int preamp, TQValueList gains ) { m_slider_preamp->setValue( preamp ); @@ -194,7 +194,7 @@ EqualizerSetup::setBands( int preamp, QValueList gains ) } void -EqualizerSetup::setPreset( QString name ) +EqualizerSetup::setPreset( TQString name ) { // Look for the preset id and verify name int i, count = m_presetCombo->count(); @@ -228,19 +228,19 @@ void EqualizerSetup::loadPresets() { // Create predefined presets 'Zero' and 'Manual' - QValueList zeroGains; + TQValueList zeroGains; zeroGains << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0; m_presets[ i18n("Manual") ] = zeroGains; m_presets[ i18n("Zero") ] = zeroGains; - QFile file( presetsCache() ); + TQFile file( presetsCache() ); if ( !file.exists() ) file.setName( locate( "data", "amarok/data/equalizer_presets.xml" ) ); - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); - QDomDocument d; + TQDomDocument d; if( !file.open( IO_ReadOnly ) || !d.setContent( stream.read() ) ) { // Everything went wrong, so at least provide the two predefined presets @@ -248,14 +248,14 @@ EqualizerSetup::loadPresets() return; } - QDomNode n = d.namedItem( "equalizerpresets" ).namedItem("preset"); + TQDomNode n = d.namedItem( "equalizerpresets" ).namedItem("preset"); for( ; !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); - QString title = e.attribute( "name" ); + TQDomElement e = n.toElement(); + TQString title = e.attribute( "name" ); - QValueList gains; + TQValueList gains; gains << e.namedItem( "b0" ).toElement().text().toInt(); gains << e.namedItem( "b1" ).toElement().text().toInt(); gains << e.namedItem( "b2" ).toElement().text().toInt(); @@ -277,41 +277,41 @@ EqualizerSetup::loadPresets() void EqualizerSetup::savePresets() { - QFile file( presetsCache() ); + TQFile file( presetsCache() ); if( !file.open( IO_WriteOnly ) ) return; - QDomDocument doc; - QDomElement e = doc.createElement("equalizerpresets"); + TQDomDocument doc; + TQDomElement e = doc.createElement("equalizerpresets"); e.setAttribute( "product", "Amarok" ); e.setAttribute( "version", APP_VERSION ); e.setAttribute( "formatversion", "1.1" ); doc.appendChild( e ); - QStringList info; + TQStringList info; info << "b0" << "b1" << "b2" << "b3" << "b4" << "b5" << "b6" << "b7" << "b8" << "b9"; for( uint x = 0; x < m_presets.count(); x++ ) { - const QString title = m_presetCombo->text( x ); + const TQString title = m_presetCombo->text( x ); // don't save the 'Zero' preset if ( title == i18n("Zero") ) continue; - QValueList gains = m_presets[ title ]; + TQValueList gains = m_presets[ title ]; - QDomElement i = doc.createElement("preset"); + TQDomElement i = doc.createElement("preset"); i.setAttribute( "name", title ); - QDomElement attr; - QDomText t; + TQDomElement attr; + TQDomText t; for( uint y=0; y < info.count(); y++ ) { attr = doc.createElement( info[y] ); - t = doc.createTextNode( QString::number( gains.first() ) ); + t = doc.createTextNode( TQString::number( gains.first() ) ); attr.appendChild( t ); i.appendChild( attr ); gains.pop_front(); @@ -319,8 +319,8 @@ EqualizerSetup::savePresets() e.appendChild( i ); } - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); stream << "\n"; stream << doc.toString(); file.close(); @@ -333,19 +333,19 @@ EqualizerSetup::editPresets() editor->setPresets(m_presets); if ( editor->exec() ) { - QMap< QString, QValueList > presets = editor->presets(); + TQMap< TQString, TQValueList > presets = editor->presets(); - QString currentTitle = m_presetCombo->currentText(); - QValueList currentGains= m_presets[ currentTitle ]; + TQString currentTitle = m_presetCombo->currentText(); + TQValueList currentGains= m_presets[ currentTitle ]; - QString newTitle = currentTitle; + TQString newTitle = currentTitle; // Check if the selected item was renamed if ( presets.find( currentTitle ) == presets.end() || currentGains != presets[ currentTitle ] ) { // Find the new name - QMap< QString, QValueList >::Iterator end = presets.end(); - for ( QMap< QString, QValueList >::Iterator it = presets.begin(); it != end; ++it ) { + TQMap< TQString, TQValueList >::Iterator end = presets.end(); + for ( TQMap< TQString, TQValueList >::Iterator it = presets.begin(); it != end; ++it ) { if ( it.data() == currentGains ) { newTitle = it.key(); break; @@ -364,7 +364,7 @@ void EqualizerSetup::addPreset() { bool ok; - const QString title = KInputDialog::getText( i18n("Add Equalizer Preset"), + const TQString title = KInputDialog::getText( i18n("Add Equalizer Preset"), i18n("Enter preset name:"), i18n("Untitled"), &ok, this); if (ok) { @@ -377,7 +377,7 @@ EqualizerSetup::addPreset() } // Add the new preset based on the current slider positions - QValueList gains; + TQValueList gains; for ( uint i = 0; i < m_bandSliders.count(); i++ ) gains += m_bandSliders.at( i )->value(); m_presets[ title ] = gains; @@ -391,16 +391,16 @@ EqualizerSetup::addPreset() } void -EqualizerSetup::updatePresets(QString selectTitle) +EqualizerSetup::updatePresets(TQString selectTitle) { // Save the selected item if ( selectTitle.isEmpty() ) selectTitle = m_presetCombo->currentText(); // Sort titles - QStringList titles; - QMap< QString, QValueList >::Iterator end = m_presets.end(); - for ( QMap< QString, QValueList >::Iterator it = m_presets.begin(); it != end; ++it ) + TQStringList titles; + TQMap< TQString, TQValueList >::Iterator end = m_presets.end(); + for ( TQMap< TQString, TQValueList >::Iterator it = m_presets.begin(); it != end; ++it ) titles << it.key(); titles.sort(); @@ -409,8 +409,8 @@ EqualizerSetup::updatePresets(QString selectTitle) int i = 0; int newIndex = -1; m_presetCombo->clear(); - QStringList::Iterator titlesEnd = titles.end(); - for ( QStringList::Iterator it = titles.begin(); it != titlesEnd; ++it ) { + TQStringList::Iterator titlesEnd = titles.end(); + for ( TQStringList::Iterator it = titles.begin(); it != titlesEnd; ++it ) { m_presetCombo->insertItem( *it ); if ( *it == selectTitle ) newIndex = i; @@ -436,9 +436,9 @@ EqualizerSetup::presetChanged( int id ) //SLOT } void -EqualizerSetup::presetChanged( QString title ) //SLOT +EqualizerSetup::presetChanged( TQString title ) //SLOT { - const QValueList gains = m_presets[ title ]; + const TQValueList gains = m_presets[ title ]; for ( uint i = 0; i < m_bandSliders.count(); i++ ) { // Block signals to prevent unwanted setting to 'Manual' @@ -485,7 +485,7 @@ EqualizerSetup::sliderChanged() //SLOT { m_presetCombo->setCurrentItem( m_manualPos ); - QValueList gains; + TQValueList gains; for ( uint i = 0; i < m_bandSliders.count(); i++ ) gains += m_bandSliders.at( i )->value(); diff --git a/amarok/src/equalizersetup.h b/amarok/src/equalizersetup.h index 0be7ee04..6a684c97 100644 --- a/amarok/src/equalizersetup.h +++ b/amarok/src/equalizersetup.h @@ -18,12 +18,12 @@ #ifndef AMAROK_EQUALIZERSETUP_H #define AMAROK_EQUALIZERSETUP_H -#include //stack alloc +#include //stack alloc #include class EqualizerGraph; -class QGroupBox; -class QCheckBox; +class TQGroupBox; +class TQCheckBox; class KComboBox; class KPopupMenu; @@ -43,12 +43,12 @@ class EqualizerSetup : public KDialogBase // for use by DCOP void setActive( bool active ); - void setBands( int preamp, QValueList gains ); - void setPreset( QString name ); + void setBands( int preamp, TQValueList gains ); + void setPreset( TQString name ); private slots: void presetChanged( int id ); - void presetChanged( QString title ); + void presetChanged( TQString title ); void sliderChanged(); void setEqualizerEnabled( bool ); void setEqualizerParameters(); @@ -60,18 +60,18 @@ class EqualizerSetup : public KDialogBase void loadPresets(); void savePresets(); - void updatePresets(QString selectTitle = QString::null); - QString presetsCache() const; + void updatePresets(TQString selectTitle = TQString::null); + TQString presetsCache() const; Amarok::Slider* m_slider_preamp; EqualizerGraph* m_equalizerGraph; - QPtrList m_bandSliders; + TQPtrList m_bandSliders; - QGroupBox* m_groupBoxSliders; + TQGroupBox* m_groupBoxSliders; KComboBox* m_presetCombo; uint m_manualPos; - QMap< QString, QValueList > m_presets; + TQMap< TQString, TQValueList > m_presets; }; #endif /*AMAROK_EQUALIZERSETUP_H*/ diff --git a/amarok/src/expression.cpp b/amarok/src/expression.cpp index bd120b38..143b6601 100644 --- a/amarok/src/expression.cpp +++ b/amarok/src/expression.cpp @@ -19,7 +19,7 @@ #include "expression.h" -ExpressionParser::ExpressionParser( const QString &expression ) +ExpressionParser::ExpressionParser( const TQString &expression ) : m_expression( expression ) , m_state( ExpectMinus ) , m_haveGroup( false ) @@ -37,13 +37,13 @@ ParsedExpression ExpressionParser::parse() return m_parsed; } -ParsedExpression ExpressionParser::parse( const QString &expression ) //static +ParsedExpression ExpressionParser::parse( const TQString &expression ) //static { ExpressionParser p( expression ); return p.parse(); } -bool ExpressionParser::isAdvancedExpression( const QString &expression ) //static +bool ExpressionParser::isAdvancedExpression( const TQString &expression ) //static { return ( expression.contains( '"' ) || expression.contains( ':' ) || @@ -54,7 +54,7 @@ bool ExpressionParser::isAdvancedExpression( const QString &expression ) //stati /* PRIVATE */ -void ExpressionParser::parseChar( const QChar &c ) +void ExpressionParser::parseChar( const TQChar &c ) { if( m_inQuote && c != '"' ) m_string += c; @@ -72,13 +72,13 @@ void ExpressionParser::parseChar( const QChar &c ) handleChar( c ); } -void ExpressionParser::handleSpace( const QChar& ) +void ExpressionParser::handleSpace( const TQChar& ) { if( m_state > ExpectMinus ) finishedToken(); } -void ExpressionParser::handleMinus( const QChar &c ) +void ExpressionParser::handleMinus( const TQChar &c ) { if( m_state == ExpectMinus ) { @@ -89,19 +89,19 @@ void ExpressionParser::handleMinus( const QChar &c ) handleChar( c ); } -void ExpressionParser::handleColon( const QChar &c ) +void ExpressionParser::handleColon( const TQChar &c ) { if( m_state <= ExpectField && !m_string.isEmpty() ) { m_element.field = m_string; - m_string = QString::null; + m_string = TQString::null; m_state = ExpectMod; } else handleChar( c ); } -void ExpressionParser::handleMod( const QChar &c ) +void ExpressionParser::handleMod( const TQChar &c ) { if( m_state == ExpectMod ) { @@ -112,7 +112,7 @@ void ExpressionParser::handleMod( const QChar &c ) handleChar( c ); } -void ExpressionParser::handleQuote( const QChar& ) +void ExpressionParser::handleQuote( const TQChar& ) { if( m_inQuote ) { @@ -128,7 +128,7 @@ void ExpressionParser::handleQuote( const QChar& ) } } -void ExpressionParser::handleChar( const QChar &c ) +void ExpressionParser::handleChar( const TQChar &c ) { m_string += c; if( m_state <= ExpectField ) @@ -161,7 +161,7 @@ void ExpressionParser::finishedToken() else finishedOrGroup(); - m_string = QString::null; + m_string = TQString::null; m_state = ExpectMinus; } } @@ -172,7 +172,7 @@ void ExpressionParser::finishedElement() finishedOrGroup(); m_inOrGroup = m_haveGroup = false; m_element.text = m_string; - m_string = QString::null; + m_string = TQString::null; if( !m_element.text.isEmpty() || !m_element.field.isEmpty() ) m_or.append( m_element ); diff --git a/amarok/src/expression.h b/amarok/src/expression.h index e24e7806..380264dd 100644 --- a/amarok/src/expression.h +++ b/amarok/src/expression.h @@ -20,49 +20,49 @@ #ifndef AMAROK_EXPRESSION_H #define AMAROK_EXPRESSION_H -#include -#include +#include +#include struct expression_element { - QString field; - QString text; + TQString field; + TQString text; bool negate: 1; enum { Contains, Less, More } match: 2; expression_element(): negate( false ), match( Contains ) { } }; -typedef QValueVector or_list; +typedef TQValueVector or_list; -typedef QValueVector ParsedExpression; +typedef TQValueVector ParsedExpression; class ExpressionParser { public: - ExpressionParser( const QString &expression ); + ExpressionParser( const TQString &expression ); ParsedExpression parse(); - static ParsedExpression parse( const QString &expression ); + static ParsedExpression parse( const TQString &expression ); - static bool isAdvancedExpression( const QString &expression ); + static bool isAdvancedExpression( const TQString &expression ); private: - void parseChar( const QChar &c ); - void handleSpace( const QChar &c ); - void handleMinus( const QChar &c ); - void handleColon( const QChar &c ); - void handleMod( const QChar &c ); - void handleQuote( const QChar &c ); - void handleChar( const QChar &c ); + void parseChar( const TQChar &c ); + void handleSpace( const TQChar &c ); + void handleMinus( const TQChar &c ); + void handleColon( const TQChar &c ); + void handleMod( const TQChar &c ); + void handleQuote( const TQChar &c ); + void handleChar( const TQChar &c ); void finishedToken(); void finishedElement(); void finishedOrGroup(); - const QString &m_expression; + const TQString &m_expression; enum State { ExpectMinus, ExpectField, ExpectMod, ExpectText }; int m_state; bool m_haveGroup; bool m_inQuote; bool m_inOrGroup; - QString m_string; + TQString m_string; expression_element m_element; or_list m_or; ParsedExpression m_parsed; diff --git a/amarok/src/filebrowser.cpp b/amarok/src/filebrowser.cpp index 20e47f86..4c640850 100644 --- a/amarok/src/filebrowser.cpp +++ b/amarok/src/filebrowser.cpp @@ -54,19 +54,19 @@ #include "statusbar.h" #include "tagdialog.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include //BEGIN Constructor/destructor FileBrowser::FileBrowser( const char * name, Medium * medium ) - : QVBox( 0, name ) + : TQVBox( 0, name ) { KActionCollection *actionCollection; SearchPane *searchPane; @@ -77,14 +77,14 @@ FileBrowser::FileBrowser( const char * name, Medium * medium ) // so if a medium object not passed in, keep earlier behavior if (!medium) { m_medium = 0; - location = new KURL( Amarok::config( "Filebrowser" )->readPathEntry( "Location", QDir::homeDirPath() ) ); + location = new KURL( Amarok::config( "Filebrowser" )->readPathEntry( "Location", TQDir::homeDirPath() ) ); KFileItem *currentFolder = new KFileItem( KFileItem::Unknown, KFileItem::Unknown, *location ); //KIO sucks, NetAccess::exists puts up a dialog and has annoying error message boxes //if there is a problem so there is no point in using it anyways. //so... setting the diroperator to ~ is the least sucky option if ( !location->isLocalFile() || !currentFolder->isReadable() ) { delete location; - location = new KURL( QDir::homeDirPath() ) ; + location = new KURL( TQDir::homeDirPath() ) ; } } else{ @@ -93,7 +93,7 @@ FileBrowser::FileBrowser( const char * name, Medium * medium ) } KActionCollection* ac = new KActionCollection( this ); - KStdAction::selectAll( this, SLOT( selectAll() ), ac, "filebrowser_select_all" ); + KStdAction::selectAll( this, TQT_SLOT( selectAll() ), ac, "filebrowser_select_all" ); KToolBar *toolbar = new Browser::ToolBar( this ); @@ -104,22 +104,22 @@ FileBrowser::FileBrowser( const char * name, Medium * medium ) searchToolBar->setStretchableWidget( m_filter ); - connect( button, SIGNAL(clicked()), m_filter, SLOT(clear()) ); + connect( button, TQT_SIGNAL(clicked()), m_filter, TQT_SLOT(clear()) ); - QToolTip::add( button, i18n( "Clear search field" ) ); - QToolTip::add( m_filter, i18n( "Enter space-separated terms to search in the directory-listing" ) ); + TQToolTip::add( button, i18n( "Clear search field" ) ); + TQToolTip::add( m_filter, i18n( "Enter space-separated terms to search in the directory-listing" ) ); } { //Directory Listing - QVBox *container; QHBox *box; + TQVBox *container; TQHBox *box; - container = new QVBox( this ); + container = new TQVBox( this ); container->setFrameStyle( m_filter->frameStyle() ); container->setMargin( 3 ); container->setSpacing( 2 ); container->setBackgroundMode( Qt::PaletteBase ); - box = new QHBox( container ); + box = new TQHBox( container ); box->setMargin( 3 ); box->setBackgroundMode( Qt::PaletteBase ); @@ -145,7 +145,7 @@ FileBrowser::FileBrowser( const char * name, Medium * medium ) m_dir->setOnlyDoubleClickSelectsFiles( true ); //Amarok type settings m_dir->readConfig( Amarok::config( "Filebrowser" ) ); m_dir->setView( KFile::Default ); //will set userconfigured view, will load URL - m_dir->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding ); + m_dir->setSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Expanding ); m_dir->setAcceptDrops( true ); //Automatically open folder after hovering above it...probably a good thing //but easily disabled by commenting this line out @@ -153,8 +153,8 @@ FileBrowser::FileBrowser( const char * name, Medium * medium ) //TODO: Find out a way to fix this? //m_dir->setDropOptions( KFileView::AutoOpenDirs ); - static_cast(m_dir->viewWidget())->setFrameStyle( QFrame::NoFrame ); - static_cast(m_dir->viewWidget())->setSpacing( 1 ); + static_cast(m_dir->viewWidget())->setFrameStyle( TQFrame::NoFrame ); + static_cast(m_dir->viewWidget())->setSpacing( 1 ); actionCollection = m_dir->actionCollection(); @@ -164,7 +164,7 @@ FileBrowser::FileBrowser( const char * name, Medium * medium ) } { - QPopupMenu* const menu = static_cast(actionCollection->action("popupMenu"))->popupMenu(); + TQPopupMenu* const menu = static_cast(actionCollection->action("popupMenu"))->popupMenu(); menu->clear(); menu->insertItem( SmallIconSet( Amarok::icon( "files" ) ), i18n( "&Load" ), MakePlaylist ); @@ -193,8 +193,8 @@ FileBrowser::FileBrowser( const char * name, Medium * medium ) menu->setItemEnabled( BurnCd, K3bExporter::isAvailable() ); - connect( menu, SIGNAL(aboutToShow()), SLOT(prepareContextMenu()) ); - connect( menu, SIGNAL(activated( int )), SLOT(contextMenuActivated( int )) ); + connect( menu, TQT_SIGNAL(aboutToShow()), TQT_SLOT(prepareContextMenu()) ); + connect( menu, TQT_SIGNAL(activated( int )), TQT_SLOT(contextMenuActivated( int )) ); } { @@ -242,24 +242,24 @@ FileBrowser::FileBrowser( const char * name, Medium * medium ) KAction *gotoCurrent = new KAction( i18n("Go To Current Track Folder"), Amarok::icon( "music" ), 0, - this, SLOT( gotoCurrentFolder() ), actionCollection ); + this, TQT_SLOT( gotoCurrentFolder() ), actionCollection ); gotoCurrent->plug( toolbar ); - disconnect( actionCollection->action( "up" ), SIGNAL( activated() ), m_dir, SLOT( cdUp() ) ); - connect( actionCollection->action( "up" ), SIGNAL( activated() ), m_dir, SLOT( myCdUp() ) ); - disconnect( actionCollection->action( "home" ), SIGNAL( activated() ), m_dir, SLOT( home() ) ); - connect( actionCollection->action( "home" ), SIGNAL( activated() ), m_dir, SLOT( myHome() ) ); + disconnect( actionCollection->action( "up" ), TQT_SIGNAL( activated() ), m_dir, TQT_SLOT( cdUp() ) ); + connect( actionCollection->action( "up" ), TQT_SIGNAL( activated() ), m_dir, TQT_SLOT( myCdUp() ) ); + disconnect( actionCollection->action( "home" ), TQT_SIGNAL( activated() ), m_dir, TQT_SLOT( home() ) ); + connect( actionCollection->action( "home" ), TQT_SIGNAL( activated() ), m_dir, TQT_SLOT( myHome() ) ); } - connect( m_filter, SIGNAL(textChanged( const QString& )), SLOT(setFilter( const QString& )) ); - connect( m_combo, SIGNAL(urlActivated( const KURL& )), SLOT(setUrl( const KURL& )) ); - connect( m_combo, SIGNAL(returnPressed( const QString& )), SLOT(setUrl( const QString& )) ); - connect( m_dir, SIGNAL(viewChanged( KFileView* )), SLOT(slotViewChanged( KFileView* )) ); - connect( m_dir, SIGNAL(fileSelected( const KFileItem* )), SLOT(activate( const KFileItem* )) ); - connect( m_dir, SIGNAL(urlEntered( const KURL& )), SLOT(urlChanged( const KURL& )) ); - connect( m_dir, SIGNAL(urlEntered( const KURL& )), searchPane, SLOT(urlChanged( const KURL& )) ); - connect( m_dir, SIGNAL(dropped( const KFileItem*, QDropEvent*, const KURL::List& )), - SLOT(dropped( const KFileItem*, QDropEvent*, const KURL::List& )) ); + connect( m_filter, TQT_SIGNAL(textChanged( const TQString& )), TQT_SLOT(setFilter( const TQString& )) ); + connect( m_combo, TQT_SIGNAL(urlActivated( const KURL& )), TQT_SLOT(setUrl( const KURL& )) ); + connect( m_combo, TQT_SIGNAL(returnPressed( const TQString& )), TQT_SLOT(setUrl( const TQString& )) ); + connect( m_dir, TQT_SIGNAL(viewChanged( KFileView* )), TQT_SLOT(slotViewChanged( KFileView* )) ); + connect( m_dir, TQT_SIGNAL(fileSelected( const KFileItem* )), TQT_SLOT(activate( const KFileItem* )) ); + connect( m_dir, TQT_SIGNAL(urlEntered( const KURL& )), TQT_SLOT(urlChanged( const KURL& )) ); + connect( m_dir, TQT_SIGNAL(urlEntered( const KURL& )), searchPane, TQT_SLOT(urlChanged( const KURL& )) ); + connect( m_dir, TQT_SIGNAL(dropped( const KFileItem*, TQDropEvent*, const KURL::List& )), + TQT_SLOT(dropped( const KFileItem*, TQDropEvent*, const KURL::List& )) ); setSpacing( 4 ); setFocusProxy( m_dir ); //so the dirOperator is focused when we get focus events @@ -286,19 +286,19 @@ void FileBrowser::setUrl( const KURL &url ) if (!m_medium) m_dir->setURL( url, true ); else { - QString urlpath = url.isLocalFile() ? url.path() : url.prettyURL(); + TQString urlpath = url.isLocalFile() ? url.path() : url.prettyURL(); KURL newURL( urlpath.prepend( m_medium->mountPoint() ).remove("..") ); //debug() << "set-url-kurl: changing to: " << newURL.path() << endl; m_dir->setURL( newURL, true ); } } -void FileBrowser::setUrl( const QString &url ) +void FileBrowser::setUrl( const TQString &url ) { if (!m_medium) m_dir->setURL( KURL(url), true ); else{ - KURL newURL( QString(url).prepend( m_medium->mountPoint() ).remove("..") ); + KURL newURL( TQString(url).prepend( m_medium->mountPoint() ).remove("..") ); //debug() << "set-url-qstring: changing to: " << newURL.path() << endl; m_dir->setURL( newURL, true ); } @@ -317,12 +317,12 @@ KURL::List FileBrowser::selectedItems() void FileBrowser::playlistFromURLs( const KURL::List &urls ) { - QString suggestion; - if( urls.count() == 1 && QFileInfo( urls.first().path() ).isDir() ) + TQString suggestion; + if( urls.count() == 1 && TQFileInfo( urls.first().path() ).isDir() ) suggestion = urls.first().fileName(); else suggestion = i18n( "Untitled" ); - const QString path = PlaylistDialog::getSaveFileName( suggestion ); + const TQString path = PlaylistDialog::getSaveFileName( suggestion ); if( path.isEmpty() ) return; @@ -340,15 +340,15 @@ void FileBrowser::playlistFromURLs( const KURL::List &urls ) //BEGIN Public Slots void -FileBrowser::setFilter( const QString &text ) +FileBrowser::setFilter( const TQString &text ) { if ( text.isEmpty() ) m_dir->clearFilter(); else { - QString filter; + TQString filter; - const QStringList terms = QStringList::split( ' ', text ); + const TQStringList terms = TQStringList::split( ' ', text ); foreach( terms ) { filter += '*'; filter += *it; @@ -362,7 +362,7 @@ FileBrowser::setFilter( const QString &text ) } void -FileBrowser::dropped( const KFileItem* /*item*/, QDropEvent* event, const KURL::List &urls){ +FileBrowser::dropped( const KFileItem* /*item*/, TQDropEvent* event, const KURL::List &urls){ //Do nothing right now event->ignore(); //Run into const problems iterating over the list, so copy it to a malleable one @@ -389,14 +389,14 @@ FileBrowser::urlChanged( const KURL &u ) { //the DirOperator's URL has changed - QString url = u.isLocalFile() ? u.path() : u.prettyURL(); + TQString url = u.isLocalFile() ? u.path() : u.prettyURL(); if( m_medium ){ //remove the leading mountPoint value url.remove( 0, m_medium->mountPoint().length() ); } - QStringList urls = m_combo->urls(); + TQStringList urls = m_combo->urls(); urls.remove( url ); urls.prepend( url ); @@ -524,19 +524,19 @@ FileBrowser::selectAll() } #include -#include -#include +#include +#include class KURLView : public KListView { public: - KURLView( QWidget *parent ) : KListView( parent ) + KURLView( TQWidget *parent ) : KListView( parent ) { - reinterpret_cast(header())->hide(); - addColumn( QString() ); + reinterpret_cast(header())->hide(); + addColumn( TQString() ); setResizeMode( KListView::LastColumn ); setDragEnabled( true ); - setSelectionMode( QListView::Extended ); + setSelectionMode( TQListView::Extended ); } class Item : public KListViewItem { @@ -545,9 +545,9 @@ public: KURL m_url; }; - virtual QDragObject *dragObject() + virtual TQDragObject *dragObject() { - QPtrList items = selectedItems(); + TQPtrList items = selectedItems(); KURL::List urls; for( Item *item = static_cast( items.first() ); item; item = static_cast( items.next() ) ) @@ -556,16 +556,16 @@ public: return new KURLDrag( urls, this ); } - virtual void viewportPaintEvent( QPaintEvent *e ) + virtual void viewportPaintEvent( TQPaintEvent *e ) { KListView::viewportPaintEvent( e ); if ( childCount() == 0 ) { - QPainter p( viewport() ); + TQPainter p( viewport() ); if ( m_text.isEmpty() ) { //TODO Perhaps it's time to put this in some header, as we use it in three places now - QSimpleRichText t( i18n( + TQSimpleRichText t( i18n( "
" "Enter a search term above; you can use wildcards like * and ?" "
" ), font() ); @@ -577,40 +577,40 @@ public: p.setBrush( colorGroup().background() ); p.drawRoundRect( 15, 15, w, h, (8*200)/w, (8*200)/h ); - t.draw( &p, 20, 20, QRect(), colorGroup() ); + t.draw( &p, 20, 20, TQRect(), colorGroup() ); } else { - p.setPen( palette().color( QPalette::Disabled, QColorGroup::Text ) ); + p.setPen( palette().color( TQPalette::Disabled, TQColorGroup::Text ) ); p.drawText( rect(), Qt::AlignCenter | Qt::WordBreak, m_text ); } } } - void unsetText() { setText( QString::null ); } - void setText( const QString &text ) { m_text = text; viewport()->update(); } + void unsetText() { setText( TQString::null ); } + void setText( const TQString &text ) { m_text = text; viewport()->update(); } private: - QString m_text; + TQString m_text; }; SearchPane::SearchPane( FileBrowser *parent ) - : QVBox( parent ) + : TQVBox( parent ) , m_lineEdit( 0 ) , m_listView( 0 ) , m_lister( 0 ) { - QFrame *container = new QVBox( this, "container" ); + TQFrame *container = new TQVBox( this, "container" ); container->hide(); { - QFrame *box = new QHBox( container ); + TQFrame *box = new TQHBox( container ); box->setMargin( 5 ); box->setBackgroundMode( Qt::PaletteBase ); m_lineEdit = new ClickLineEdit( i18n("Search here..."), box ); - connect( m_lineEdit, SIGNAL(textChanged( const QString& )), SLOT(searchTextChanged( const QString& )) ); + connect( m_lineEdit, TQT_SIGNAL(textChanged( const TQString& )), TQT_SLOT(searchTextChanged( const TQString& )) ); m_listView = new KURLView( container ); @@ -618,18 +618,18 @@ SearchPane::SearchPane( FileBrowser *parent ) container->setMargin( 5 ); container->setBackgroundMode( Qt::PaletteBase ); - m_listView->setFrameStyle( QFrame::NoFrame ); - connect( m_listView, SIGNAL(executed( QListViewItem* )), SLOT(activate( QListViewItem* )) ); + m_listView->setFrameStyle( TQFrame::NoFrame ); + connect( m_listView, TQT_SIGNAL(executed( TQListViewItem* )), TQT_SLOT(activate( TQListViewItem* )) ); } KPushButton *button = new KPushButton( KGuiItem( i18n("&Show Search Panel"), "find" ), this ); button->setToggleButton( true ); - connect( button, SIGNAL(toggled( bool )), SLOT(toggle( bool )) ); + connect( button, TQT_SIGNAL(toggled( bool )), TQT_SLOT(toggle( bool )) ); m_lister = new MyDirLister( true /*delay mimetypes*/ ); insertChild( m_lister ); - connect( m_lister, SIGNAL(newItems( const KFileItemList& )), SLOT(searchMatches( const KFileItemList& )) ); - connect( m_lister, SIGNAL(completed()), SLOT(searchComplete()) ); + connect( m_lister, TQT_SIGNAL(newItems( const KFileItemList& )), TQT_SLOT(searchMatches( const KFileItemList& )) ); + connect( m_lister, TQT_SIGNAL(completed()), TQT_SLOT(searchComplete()) ); } void @@ -638,7 +638,7 @@ SearchPane::toggle( bool toggled ) if ( toggled ) m_lineEdit->setFocus(); - static_cast(child("container"))->setShown( toggled ); + static_cast(child("container"))->setShown( toggled ); } void @@ -648,7 +648,7 @@ SearchPane::urlChanged( const KURL& ) } void -SearchPane::searchTextChanged( const QString &text ) +SearchPane::searchTextChanged( const TQString &text ) { //TODO if user changes search directory then we need to update the search too @@ -661,7 +661,7 @@ SearchPane::searchTextChanged( const QString &text ) return; } - m_filter = QRegExp( text.contains( "*" ) ? text : '*'+text+'*', false, true ); + m_filter = TQRegExp( text.contains( "*" ) ? text : '*'+text+'*', false, true ); m_lister->openURL( searchURL() ); @@ -686,7 +686,7 @@ SearchPane::searchComplete() //connected to KDirLister::complete() //TODO fix crappy KDElibs - QTimer::singleShot( 0, this, SLOT(_searchComplete()) ); + TQTimer::singleShot( 0, this, TQT_SLOT(_searchComplete()) ); } void @@ -702,7 +702,7 @@ SearchPane::_searchComplete() } void -SearchPane::activate( QListViewItem *item ) +SearchPane::activate( TQListViewItem *item ) { Playlist::instance()->insertMedia( static_cast(item)->m_url, Playlist::DirectPlay ); } diff --git a/amarok/src/filebrowser.h b/amarok/src/filebrowser.h index bd4f7be2..8fe4805a 100644 --- a/amarok/src/filebrowser.h +++ b/amarok/src/filebrowser.h @@ -24,13 +24,13 @@ #ifndef FILESELECTOR_WIDGET_H #define FILESELECTOR_WIDGET_H -#include //baseclass +#include //baseclass #include //some inline functions #include //baseclass #include //stack allocated class ClickLineEdit; -class QTimer; +class TQTimer; class KActionCollection; class KFileItem; class KFileView; @@ -62,9 +62,9 @@ public: public slots: void setUrl( const KURL &url ); - void setUrl( const QString &url ); - void setFilter( const QString& ); - void dropped( const KFileItem*, QDropEvent*, const KURL::List& ); + void setUrl( const TQString &url ); + void setFilter( const TQString& ); + void dropped( const KFileItem*, TQDropEvent*, const KURL::List& ); private slots: void activate( const KFileItem* ); @@ -88,12 +88,12 @@ private: #include //KFileItemList -#include +#include class KDirLister; class KURLView; -class QLineEdit; -class QListViewItem; +class TQLineEdit; +class TQListViewItem; ///@author Max Howell ///@short Widget for recursive searching of current FileBrowser location @@ -108,19 +108,19 @@ public: private slots: void toggle( bool ); void urlChanged( const KURL& ); - void searchTextChanged( const QString &text ); + void searchTextChanged( const TQString &text ); void searchMatches( const KFileItemList& ); void searchComplete(); void _searchComplete(); - void activate( QListViewItem* ); + void activate( TQListViewItem* ); private: KURL searchURL() const { return static_cast(parentWidget())->url(); } - QLineEdit *m_lineEdit; + TQLineEdit *m_lineEdit; KURLView *m_listView; KDirLister *m_lister; - QRegExp m_filter; + TQRegExp m_filter; KURL::List m_dirs; }; diff --git a/amarok/src/firstrunwizard.ui.h b/amarok/src/firstrunwizard.ui.h index ea684319..b64fe005 100644 --- a/amarok/src/firstrunwizard.ui.h +++ b/amarok/src/firstrunwizard.ui.h @@ -17,14 +17,14 @@ #include #include #include -#include +#include namespace Amarok { - extern QPixmap getPNG( const QString& ); - extern QPixmap getJPG( const QString& ); + extern TQPixmap getPNG( const TQString& ); + extern TQPixmap getJPG( const TQString& ); - extern KConfig *config( const QString& ); + extern KConfig *config( const TQString& ); } void @@ -40,10 +40,10 @@ FirstRunWizard::init() WizardPageLayout_2->addWidget( m_folderSetup = new CollectionSetup( WizardPage_2 ) ); - text4->disconnect( SIGNAL(linkClicked( const QString& )) ); - connect( text4, SIGNAL(linkClicked( const QString& )), SLOT(invokeHandbook()) ); - dbActiveLabel->disconnect( SIGNAL(linkClicked( const QString& )) ); - connect( dbActiveLabel, SIGNAL(linkClicked( const QString& )), SLOT(openLink( const QString &)) ); + text4->disconnect( TQT_SIGNAL(linkClicked( const TQString& )) ); + connect( text4, TQT_SIGNAL(linkClicked( const TQString& )), TQT_SLOT(invokeHandbook()) ); + dbActiveLabel->disconnect( TQT_SIGNAL(linkClicked( const TQString& )) ); + connect( dbActiveLabel, TQT_SIGNAL(linkClicked( const TQString& )), TQT_SLOT(openLink( const TQString &)) ); setFinishEnabled ( WizardPage_4, true ); #if !defined(USE_MYSQL) && !defined(USE_POSTGRESQL) removePage(WizardPage_3); @@ -52,9 +52,9 @@ FirstRunWizard::init() } void -FirstRunWizard::showPage( QWidget *w ) //virtual +FirstRunWizard::showPage( TQWidget *w ) //virtual { - QWizard::showPage( w ); + TQWizard::showPage( w ); cancelButton()->setText( w == WizardPage ? i18n("&Skip") : i18n("&Cancel") ); } @@ -63,7 +63,7 @@ inline void FirstRunWizard::invokeHandbook() //SLOT { // Show handbook - kapp->invokeHelp( QString::null, QString::null, 0 ); + kapp->invokeHelp( TQString::null, TQString::null, 0 ); } void @@ -73,7 +73,7 @@ FirstRunWizard::writeCollectionConfig() } void -FirstRunWizard::openLink(const QString& s) +FirstRunWizard::openLink(const TQString& s) { Amarok::invokeBrowser(s); } diff --git a/amarok/src/hintlineedit.cpp b/amarok/src/hintlineedit.cpp index 3d29b76a..a98a38f6 100644 --- a/amarok/src/hintlineedit.cpp +++ b/amarok/src/hintlineedit.cpp @@ -1,26 +1,26 @@ #include -#include -#include -#include +#include +#include +#include -HintLineEdit::HintLineEdit( const QString &hint, const QString &text, QWidget *parent, const char *name ) +HintLineEdit::HintLineEdit( const TQString &hint, const TQString &text, TQWidget *parent, const char *name ) : KLineEdit( text, 0, name ) - , m_vbox( new QVBox( parent ) ) + , m_vbox( new TQVBox( parent ) ) { init(); m_hint->setText( hint ); } -HintLineEdit::HintLineEdit( const QString &text, QWidget *parent, const char *name ) +HintLineEdit::HintLineEdit( const TQString &text, TQWidget *parent, const char *name ) : KLineEdit( text, 0, name ) - , m_vbox( new QVBox( parent ) ) + , m_vbox( new TQVBox( parent ) ) { init(); } -HintLineEdit::HintLineEdit( QWidget *parent, const char *name ) +HintLineEdit::HintLineEdit( TQWidget *parent, const char *name ) : KLineEdit( 0, name ) - , m_vbox( new QVBox( parent ) ) + , m_vbox( new TQVBox( parent ) ) { init(); } @@ -28,28 +28,28 @@ HintLineEdit::HintLineEdit( QWidget *parent, const char *name ) void HintLineEdit::init() { - reparent( m_vbox, 0, QPoint(0,0), true ); - m_hint = new QLabel( m_vbox ); + reparent( m_vbox, 0, TQPoint(0,0), true ); + m_hint = new TQLabel( m_vbox ); //m_hint->setBuddy( this ); m_hint->setFocusPolicy( NoFocus ); - QFont font; + TQFont font; font.setPointSize( font.pointSize() - 2); m_hint->setFont( font ); } HintLineEdit::~HintLineEdit() { - reparent( 0, 0, QPoint(0,0), false ); + reparent( 0, 0, TQPoint(0,0), false ); delete m_vbox; } void -HintLineEdit::setHint( const QString &hint ) +HintLineEdit::setHint( const TQString &hint ) { m_hint->setText( hint ); } -QObject * +TQObject * HintLineEdit::parent() { return m_vbox->parent(); diff --git a/amarok/src/hintlineedit.h b/amarok/src/hintlineedit.h index 9e3c666e..851a4fb8 100644 --- a/amarok/src/hintlineedit.h +++ b/amarok/src/hintlineedit.h @@ -3,25 +3,25 @@ #include //baseclass -class QVBox; -class QLabel; -class QWidget; +class TQVBox; +class TQLabel; +class TQWidget; class HintLineEdit : public KLineEdit { Q_OBJECT public: - HintLineEdit( const QString &hint, const QString &text, QWidget *parent = 0, const char *name = 0 ); - HintLineEdit( const QString &text, QWidget *parent = 0, const char *name = 0 ); - HintLineEdit( QWidget *parent = 0, const char *name = 0 ); + HintLineEdit( const TQString &hint, const TQString &text, TQWidget *parent = 0, const char *name = 0 ); + HintLineEdit( const TQString &text, TQWidget *parent = 0, const char *name = 0 ); + HintLineEdit( TQWidget *parent = 0, const char *name = 0 ); virtual ~HintLineEdit(); - virtual QObject *parent(); - virtual void setHint( const QString &hint ); + virtual TQObject *parent(); + virtual void setHint( const TQString &hint ); private: void init(); - QVBox *m_vbox; - QLabel *m_hint; + TQVBox *m_vbox; + TQLabel *m_hint; }; #endif diff --git a/amarok/src/htmlview.cpp b/amarok/src/htmlview.cpp index ff3ffa44..015c4952 100644 --- a/amarok/src/htmlview.cpp +++ b/amarok/src/htmlview.cpp @@ -10,9 +10,9 @@ #include "htmlview.h" #include "playlist.h" //appendMedia() -#include -#include // External CSS opening -#include // External CSS opening +#include +#include // External CSS opening +#include // External CSS opening #include //kapp #include @@ -27,7 +27,7 @@ KTempFile *HTMLView::m_headerGradientImage = 0; KTempFile *HTMLView::m_shadowGradientImage = 0; int HTMLView::m_instances = 0; -HTMLView::HTMLView( QWidget *parentWidget, const char *widgetname, const bool DNDEnabled, const bool JScriptEnabled ) +HTMLView::HTMLView( TQWidget *parentWidget, const char *widgetname, const bool DNDEnabled, const bool JScriptEnabled ) : KHTMLPart( parentWidget, widgetname ) { m_instances++; @@ -39,8 +39,8 @@ HTMLView::HTMLView( QWidget *parentWidget, const char *widgetname, const bool DN KActionCollection* ac = actionCollection(); ac->setAutoConnectShortcuts( true ); - m_copy = KStdAction::copy( this, SLOT( copyText() ), ac, "htmlview_copy" ); - m_selectAll = KStdAction::selectAll( this, SLOT( selectAll() ), ac, "htmlview_select_all" ); + m_copy = KStdAction::copy( this, TQT_SLOT( copyText() ), ac, "htmlview_copy" ); + m_selectAll = KStdAction::selectAll( this, TQT_SLOT( selectAll() ), ac, "htmlview_select_all" ); { KPopupMenu m; m_copy->plug( &m ); @@ -50,7 +50,7 @@ HTMLView::HTMLView( QWidget *parentWidget, const char *widgetname, const bool DN m_selectAll->unplug( &m ); } - connect( this, SIGNAL( selectionChanged() ), SLOT( enableCopyAction() ) ); + connect( this, TQT_SIGNAL( selectionChanged() ), TQT_SLOT( enableCopyAction() ) ); enableCopyAction(); } @@ -80,11 +80,11 @@ HTMLView::selectAll() void HTMLView::copyText() { - QString text = selectedText(); + TQString text = selectedText(); // Copy both to clipboard and X11-selection - QApplication::clipboard()->setText( text, QClipboard::Clipboard ); - QApplication::clipboard()->setText( text, QClipboard::Selection ); + TQApplication::clipboard()->setText( text, QClipboard::Clipboard ); + TQApplication::clipboard()->setText( text, QClipboard::Selection ); } void HTMLView::paletteChange() { @@ -97,39 +97,39 @@ void HTMLView::paletteChange() { QString HTMLView::loadStyleSheet() { - QString themeName = AmarokConfig::contextBrowserStyleSheet().latin1(); - const QString file = kapp->dirs()->findResource( "data","amarok/themes/" + themeName + "/stylesheet.css" ); + TQString themeName = AmarokConfig::contextBrowserStyleSheet().latin1(); + const TQString file = kapp->dirs()->findResource( "data","amarok/themes/" + themeName + "/stylesheet.css" ); - QString styleSheet; - if ( themeName != "Default" && QFile::exists( file ) ) + TQString styleSheet; + if ( themeName != "Default" && TQFile::exists( file ) ) { - const QString CSSLocation = kapp->dirs()->findResource( "data","amarok/themes/" + themeName + "/stylesheet.css" ); - QFile ExternalCSS( CSSLocation ); + const TQString CSSLocation = kapp->dirs()->findResource( "data","amarok/themes/" + themeName + "/stylesheet.css" ); + TQFile ExternalCSS( CSSLocation ); if ( !ExternalCSS.open( IO_ReadOnly ) ) - return QString(); //FIXME: should actually return the default style sheet, then + return TQString(); //FIXME: should actually return the default style sheet, then - const QString pxSize = QString::number( ContextBrowser::instance()->fontMetrics().height() - 4 ); - const QString fontFamily = AmarokConfig::useCustomFonts() ? + const TQString pxSize = TQString::number( ContextBrowser::instance()->fontMetrics().height() - 4 ); + const TQString fontFamily = AmarokConfig::useCustomFonts() ? AmarokConfig::contextBrowserFont().family() : - QApplication::font().family(); - const QString text = ContextBrowser::instance()->colorGroup().text().name(); - const QString link = ContextBrowser::instance()->colorGroup().link().name(); - const QString fg = ContextBrowser::instance()->colorGroup().highlightedText().name(); - const QString bg = ContextBrowser::instance()->colorGroup().highlight().name(); - const QString base = ContextBrowser::instance()->colorGroup().base().name(); - const QColor bgColor = ContextBrowser::instance()->colorGroup().highlight(); - QColor gradientColor = bgColor; + TQApplication::font().family(); + const TQString text = ContextBrowser::instance()->colorGroup().text().name(); + const TQString link = ContextBrowser::instance()->colorGroup().link().name(); + const TQString fg = ContextBrowser::instance()->colorGroup().highlightedText().name(); + const TQString bg = ContextBrowser::instance()->colorGroup().highlight().name(); + const TQString base = ContextBrowser::instance()->colorGroup().base().name(); + const TQColor bgColor = ContextBrowser::instance()->colorGroup().highlight(); + TQColor gradientColor = bgColor; //we have to set the color for body due to a KHTML bug //KHTML sets the base color but not the text color - styleSheet = QString( "body { margin: 8px; font-size: %1px; color: %2; background-color: %3; font-family: %4; }" ) + styleSheet = TQString( "body { margin: 8px; font-size: %1px; color: %2; background-color: %3; font-family: %4; }" ) .arg( pxSize ) .arg( text ) .arg( AmarokConfig::schemeAmarok() ? fg : gradientColor.name() ) .arg( fontFamily ); - QTextStream eCSSts( &ExternalCSS ); - QString tmpCSS = eCSSts.read(); + TQTextStream eCSSts( &ExternalCSS ); + TQString tmpCSS = eCSSts.read(); ExternalCSS.close(); tmpCSS.replace( "./", KURL::fromPathOrURL( CSSLocation ).directory( false ) ); @@ -150,32 +150,32 @@ HTMLView::loadStyleSheet() else { int pxSize = ContextBrowser::instance()->fontMetrics().height() - 4; - const QString fontFamily = AmarokConfig::useCustomFonts() ? AmarokConfig::contextBrowserFont().family() : QApplication::font().family(); - const QString text = ContextBrowser::instance()->colorGroup().text().name(); - const QString link = ContextBrowser::instance()->colorGroup().link().name(); - const QString fg = ContextBrowser::instance()->colorGroup().highlightedText().name(); - const QString bg = ContextBrowser::instance()->colorGroup().highlight().name(); - const QColor baseColor = ContextBrowser::instance()->colorGroup().base(); - const QColor bgColor = ContextBrowser::instance()->colorGroup().highlight(); - const QColor gradientColor = bgColor; + const TQString fontFamily = AmarokConfig::useCustomFonts() ? AmarokConfig::contextBrowserFont().family() : TQApplication::font().family(); + const TQString text = ContextBrowser::instance()->colorGroup().text().name(); + const TQString link = ContextBrowser::instance()->colorGroup().link().name(); + const TQString fg = ContextBrowser::instance()->colorGroup().highlightedText().name(); + const TQString bg = ContextBrowser::instance()->colorGroup().highlight().name(); + const TQColor baseColor = ContextBrowser::instance()->colorGroup().base(); + const TQColor bgColor = ContextBrowser::instance()->colorGroup().highlight(); + const TQColor gradientColor = bgColor; if ( !m_bgGradientImage ) { m_bgGradientImage = new KTempFile( locateLocal( "tmp", "gradient" ), ".png", 0600 ); - QImage image = KImageEffect::gradient( QSize( 600, 1 ), gradientColor, gradientColor.light( 130 ), KImageEffect::PipeCrossGradient ); + TQImage image = KImageEffect::gradient( TQSize( 600, 1 ), gradientColor, gradientColor.light( 130 ), KImageEffect::PipeCrossGradient ); image.save( m_bgGradientImage->file(), "PNG" ); m_bgGradientImage->close(); } if ( !m_headerGradientImage ) { m_headerGradientImage = new KTempFile( locateLocal( "tmp", "gradient_header" ), ".png", 0600 ); - QImage imageH = KImageEffect::unbalancedGradient( QSize( 1, 10 ), bgColor, gradientColor.light( 130 ), KImageEffect::VerticalGradient, 100, -100 ); + TQImage imageH = KImageEffect::unbalancedGradient( TQSize( 1, 10 ), bgColor, gradientColor.light( 130 ), KImageEffect::VerticalGradient, 100, -100 ); imageH.copy( 0, 1, 1, 9 ).save( m_headerGradientImage->file(), "PNG" ); m_headerGradientImage->close(); } if ( !m_shadowGradientImage ) { m_shadowGradientImage = new KTempFile( locateLocal( "tmp", "gradient_shadow" ), ".png", 0600 ); - QImage imageS = KImageEffect::unbalancedGradient( QSize( 1, 10 ), baseColor, Qt::gray, KImageEffect::VerticalGradient, 100, -100 ); + TQImage imageS = KImageEffect::unbalancedGradient( TQSize( 1, 10 ), baseColor, Qt::gray, KImageEffect::VerticalGradient, 100, -100 ); imageS.save( m_shadowGradientImage->file(), "PNG" ); m_shadowGradientImage->close(); } @@ -187,7 +187,7 @@ HTMLView::loadStyleSheet() //we have to set the color for body due to a KHTML bug //KHTML sets the base color but not the text color - styleSheet = QString( "body { margin: 4px; font-size: %1px; color: %2; background-color: %3; background-image: url( %4 ); background-repeat: repeat; font-family: %5; }" ) + styleSheet = TQString( "body { margin: 4px; font-size: %1px; color: %2; background-color: %3; background-image: url( %4 ); background-repeat: repeat; font-family: %5; }" ) .arg( pxSize ) .arg( text ) .arg( AmarokConfig::schemeAmarok() ? fg : gradientColor.name() ) @@ -195,96 +195,96 @@ HTMLView::loadStyleSheet() .arg( fontFamily ); //text attributes - styleSheet += QString( "h1 { font-size: %1px; }" ).arg( pxSize + 8 ); - styleSheet += QString( "h2 { font-size: %1px; }" ).arg( pxSize + 6 ); - styleSheet += QString( "h3 { font-size: %1px; }" ).arg( pxSize + 4 ); - styleSheet += QString( "h4 { font-size: %1px; }" ).arg( pxSize + 3 ); - styleSheet += QString( "h5 { font-size: %1px; }" ).arg( pxSize + 2 ); - styleSheet += QString( "h6 { font-size: %1px; }" ).arg( pxSize + 1 ); - styleSheet += QString( "a { font-size: %1px; color: %2; }" ).arg( pxSize ).arg( text ); - styleSheet += QString( ".info { display: block; margin-left: 4px; font-weight: normal; }" ); - - styleSheet += QString( ".song a { display: block; padding: 1px 2px; font-weight: normal; text-decoration: none; }" ); - styleSheet += QString( ".song a:hover { color: %1; background-color: %2; }" ).arg( fg ).arg( bg ); - styleSheet += QString( ".song-title { font-weight: bold; }" ); - styleSheet += QString( ".song-place { font-size: %1px; font-weight: bold; }" ).arg( pxSize + 3 ); + styleSheet += TQString( "h1 { font-size: %1px; }" ).arg( pxSize + 8 ); + styleSheet += TQString( "h2 { font-size: %1px; }" ).arg( pxSize + 6 ); + styleSheet += TQString( "h3 { font-size: %1px; }" ).arg( pxSize + 4 ); + styleSheet += TQString( "h4 { font-size: %1px; }" ).arg( pxSize + 3 ); + styleSheet += TQString( "h5 { font-size: %1px; }" ).arg( pxSize + 2 ); + styleSheet += TQString( "h6 { font-size: %1px; }" ).arg( pxSize + 1 ); + styleSheet += TQString( "a { font-size: %1px; color: %2; }" ).arg( pxSize ).arg( text ); + styleSheet += TQString( ".info { display: block; margin-left: 4px; font-weight: normal; }" ); + + styleSheet += TQString( ".song a { display: block; padding: 1px 2px; font-weight: normal; text-decoration: none; }" ); + styleSheet += TQString( ".song a:hover { color: %1; background-color: %2; }" ).arg( fg ).arg( bg ); + styleSheet += TQString( ".song-title { font-weight: bold; }" ); + styleSheet += TQString( ".song-place { font-size: %1px; font-weight: bold; }" ).arg( pxSize + 3 ); //box: the base container for every block (border hilighted on hover, 'A' without underlining) - styleSheet += QString( ".box { border: solid %1 1px; text-align: left; margin-bottom: 10px; }" ).arg( bg ); - styleSheet += QString( ".box a { text-decoration: none; }" ); - styleSheet += QString( ".box:hover { border: solid %1 1px; }" ).arg( text ); + styleSheet += TQString( ".box { border: solid %1 1px; text-align: left; margin-bottom: 10px; }" ).arg( bg ); + styleSheet += TQString( ".box a { text-decoration: none; }" ); + styleSheet += TQString( ".box:hover { border: solid %1 1px; }" ).arg( text ); //box contents: header, body, rows and alternate-rows - styleSheet += QString( ".box-header { color: %1; background-color: %2; background-image: url( %4 ); background-repeat: repeat-x; font-size: %3px; font-weight: bold; padding: 1px 0.5em; border-bottom: 1px solid #000; }" ) + styleSheet += TQString( ".box-header { color: %1; background-color: %2; background-image: url( %4 ); background-repeat: repeat-x; font-size: %3px; font-weight: bold; padding: 1px 0.5em; border-bottom: 1px solid #000; }" ) .arg( fg ) .arg( bg ) .arg( pxSize + 2 ) .arg( m_headerGradientImage->name() ); - styleSheet += QString( ".box-body { padding: 2px; background-color: %1; background-image: url( %2 ); background-repeat: repeat-x; font-size:%3px; }" ) + styleSheet += TQString( ".box-body { padding: 2px; background-color: %1; background-image: url( %2 ); background-repeat: repeat-x; font-size:%3px; }" ) .arg( ContextBrowser::instance()->colorGroup().base().name() ) .arg( m_shadowGradientImage->name() ) .arg( pxSize ); //"Related Artists" related styles - styleSheet += QString( ".box-header-nav { color: %1; background-color: %2; font-size: %3px; font-weight: bold; padding: 1px 0.5em; border-bottom: 1px solid #000; text-align: right; }" ) + styleSheet += TQString( ".box-header-nav { color: %1; background-color: %2; font-size: %3px; font-weight: bold; padding: 1px 0.5em; border-bottom: 1px solid #000; text-align: right; }" ) .arg( fg ) .arg( bg ) .arg( pxSize ); //"Albums by ..." related styles - styleSheet += QString( ".album-header:hover { color: %1; background-color: %2; cursor: pointer; }" ).arg( fg ).arg( bg ); - styleSheet += QString( ".album-header:hover a { color: %1; }" ).arg( fg ); - styleSheet += QString( ".album-body { background-color: %1; border-bottom: solid %2 1px; border-top: solid %3 1px; }" ).arg( ContextBrowser::instance()->colorGroup().base().name() ).arg( bg ).arg( bg ); - styleSheet += QString( ".album-title { font-weight: bold; }" ); - styleSheet += QString( ".album-info { float:right; padding-right:4px; font-size: %1px }" ).arg( pxSize ); - styleSheet += QString( ".album-length { float:right; padding-right:4px; font-size: %1px; clear:right; }" ).arg( pxSize ); - styleSheet += QString( ".album-image { padding-right: 4px; }" ); - styleSheet += QString( ".album-song a { display: block; padding: 1px 2px; font-weight: normal; text-decoration: none; }" ); - styleSheet += QString( ".album-song a:hover { color: %1; background-color: %2; }" ).arg( fg ).arg( bg ); - styleSheet += QString( ".album-song-trackno { font-weight: bold; }" ); - - styleSheet += QString( ".disc-separator { color: %1; border-bottom: 1px solid %2; }" ).arg( bg ).arg( bg ); - styleSheet += QString( ".disc-separator a { display: block; padding: 1px 2px; font-weight: normal; text-decoration: none; }" ); - styleSheet += QString( ".disc-separator a:hover { color: %1; background-color: %2; }" ).arg( fg ).arg( bg ); - - styleSheet += QString( ".button { width: 100%; }" ); + styleSheet += TQString( ".album-header:hover { color: %1; background-color: %2; cursor: pointer; }" ).arg( fg ).arg( bg ); + styleSheet += TQString( ".album-header:hover a { color: %1; }" ).arg( fg ); + styleSheet += TQString( ".album-body { background-color: %1; border-bottom: solid %2 1px; border-top: solid %3 1px; }" ).arg( ContextBrowser::instance()->colorGroup().base().name() ).arg( bg ).arg( bg ); + styleSheet += TQString( ".album-title { font-weight: bold; }" ); + styleSheet += TQString( ".album-info { float:right; padding-right:4px; font-size: %1px }" ).arg( pxSize ); + styleSheet += TQString( ".album-length { float:right; padding-right:4px; font-size: %1px; clear:right; }" ).arg( pxSize ); + styleSheet += TQString( ".album-image { padding-right: 4px; }" ); + styleSheet += TQString( ".album-song a { display: block; padding: 1px 2px; font-weight: normal; text-decoration: none; }" ); + styleSheet += TQString( ".album-song a:hover { color: %1; background-color: %2; }" ).arg( fg ).arg( bg ); + styleSheet += TQString( ".album-song-trackno { font-weight: bold; }" ); + + styleSheet += TQString( ".disc-separator { color: %1; border-bottom: 1px solid %2; }" ).arg( bg ).arg( bg ); + styleSheet += TQString( ".disc-separator a { display: block; padding: 1px 2px; font-weight: normal; text-decoration: none; }" ); + styleSheet += TQString( ".disc-separator a:hover { color: %1; background-color: %2; }" ).arg( fg ).arg( bg ); + + styleSheet += TQString( ".button { width: 100%; }" ); //boxes used to display score (sb: score box) - styleSheet += QString( ".sbtext { text-align: right; padding: 0px 4px; }" ); - styleSheet += QString( ".sbinner { height: 8px; background-color: %1; border: solid %2 1px; }" ) + styleSheet += TQString( ".sbtext { text-align: right; padding: 0px 4px; }" ); + styleSheet += TQString( ".sbinner { height: 8px; background-color: %1; border: solid %2 1px; }" ) .arg( ContextBrowser::instance()->colorGroup().highlight().name() ) .arg( ContextBrowser::instance()->colorGroup().highlightedText().name() ); - styleSheet += QString( ".sbouter { width: 52px; height: 10px; background-color: %1; border: solid %2 1px; }" ) + styleSheet += TQString( ".sbouter { width: 52px; height: 10px; background-color: %1; border: solid %2 1px; }" ) .arg( ContextBrowser::instance()->colorGroup().base().dark( 120 ).name() ) .arg( ContextBrowser::instance()->colorGroup().highlight().name() ); - styleSheet += QString( ".ratingBox { padding: 0px 4px; }" ); - styleSheet += QString( ".ratingStar { height: 0.9em; }" ); + styleSheet += TQString( ".ratingBox { padding: 0px 4px; }" ); + styleSheet += TQString( ".ratingStar { height: 0.9em; }" ); - styleSheet += QString( ".statsBox { border-left: solid %1 1px; }" ) + styleSheet += TQString( ".statsBox { border-left: solid %1 1px; }" ) .arg( ContextBrowser::instance()->colorGroup().base().dark( 120 ).name() ); - styleSheet += QString( "#current_box-header-album { font-weight: normal; }" ); - styleSheet += QString( "#current_box-information-td { text-align: right; vertical-align: bottom; padding: 3px; }" ); - styleSheet += QString( "#current_box-largecover-td { text-align: left; width: 100px; padding: 0; vertical-align: bottom; }" ); - styleSheet += QString( "#current_box-largecover-image { padding: 4px; vertical-align: bottom; }" ); + styleSheet += TQString( "#current_box-header-album { font-weight: normal; }" ); + styleSheet += TQString( "#current_box-information-td { text-align: right; vertical-align: bottom; padding: 3px; }" ); + styleSheet += TQString( "#current_box-largecover-td { text-align: left; width: 100px; padding: 0; vertical-align: bottom; }" ); + styleSheet += TQString( "#current_box-largecover-image { padding: 4px; vertical-align: bottom; }" ); - styleSheet += QString( "#wiki_box-body a { color: %1; }" ).arg( link ); - styleSheet += QString( "#wiki_box-body a:hover { text-decoration: underline; }" ); + styleSheet += TQString( "#wiki_box-body a { color: %1; }" ).arg( link ); + styleSheet += TQString( "#wiki_box-body a:hover { text-decoration: underline; }" ); //labels in tag dialog styleSheet += ".label a:hover { font-weight: bold; }"; - styleSheet += QString( ".label.size1 { font-size: %1px; }" ).arg( pxSize ); - styleSheet += QString( ".label.size2 { font-size: %1px; }" ).arg( pxSize + 1 ); - styleSheet += QString( ".label.size3 { font-size: %1px; }" ).arg( pxSize + 2 ); - styleSheet += QString( ".label.size4 { font-size: %1px; }" ).arg( pxSize + 3 ); - styleSheet += QString( ".label.size5 { font-size: %1px; }" ).arg( pxSize + 4); - styleSheet += QString( ".label.size6 { font-size: %1px; }" ).arg( pxSize + 5 ); - styleSheet += QString( ".label.size7 { font-size: %1px; }" ).arg( pxSize + 6 ); - styleSheet += QString( ".label.size8 { font-size: %1px; }" ).arg( pxSize + 7 ); - styleSheet += QString( ".label.size9 { font-size: %1px; }" ).arg( pxSize + 8 ); - styleSheet += QString( ".label.size10 { font-size: %1px; }" ).arg( pxSize + 9 ); + styleSheet += TQString( ".label.size1 { font-size: %1px; }" ).arg( pxSize ); + styleSheet += TQString( ".label.size2 { font-size: %1px; }" ).arg( pxSize + 1 ); + styleSheet += TQString( ".label.size3 { font-size: %1px; }" ).arg( pxSize + 2 ); + styleSheet += TQString( ".label.size4 { font-size: %1px; }" ).arg( pxSize + 3 ); + styleSheet += TQString( ".label.size5 { font-size: %1px; }" ).arg( pxSize + 4); + styleSheet += TQString( ".label.size6 { font-size: %1px; }" ).arg( pxSize + 5 ); + styleSheet += TQString( ".label.size7 { font-size: %1px; }" ).arg( pxSize + 6 ); + styleSheet += TQString( ".label.size8 { font-size: %1px; }" ).arg( pxSize + 7 ); + styleSheet += TQString( ".label.size9 { font-size: %1px; }" ).arg( pxSize + 8 ); + styleSheet += TQString( ".label.size10 { font-size: %1px; }" ).arg( pxSize + 9 ); } return styleSheet; @@ -292,7 +292,7 @@ HTMLView::loadStyleSheet() void -HTMLView::set( const QString& data ) +HTMLView::set( const TQString& data ) { begin(); setUserStyleSheet( loadStyleSheet() ); diff --git a/amarok/src/htmlview.h b/amarok/src/htmlview.h index b64dfcd8..6115ca68 100644 --- a/amarok/src/htmlview.h +++ b/amarok/src/htmlview.h @@ -18,12 +18,12 @@ class HTMLView : public KHTMLPart Q_OBJECT public: - HTMLView( QWidget *parentWidget = 0, const char *widgetname = 0, const bool DNDEnabled = false, const bool JScriptEnabled = true ); + HTMLView( TQWidget *parentWidget = 0, const char *widgetname = 0, const bool DNDEnabled = false, const bool JScriptEnabled = true ); ~HTMLView(); - static QString loadStyleSheet(); + static TQString loadStyleSheet(); static void openURLRequest(const KURL &url ); - void set( const QString& data ); + void set( const TQString& data ); static void paletteChange(); private: diff --git a/amarok/src/iconloader.cpp b/amarok/src/iconloader.cpp index 9dea3659..25aa8938 100644 --- a/amarok/src/iconloader.cpp +++ b/amarok/src/iconloader.cpp @@ -20,17 +20,17 @@ #include "amarok.h" #include "amarokconfig.h" -#include +#include QString -Amarok::icon( const QString& name ) //declared in amarok.h +Amarok::icon( const TQString& name ) //declared in amarok.h { // We map our Amarok icon theme names to system icons, instead of using the same // naming scheme. This has two advantages: // 1. Our icons can have simpler and more meaningful names // 2. We can map several of our icons to one system icon, if necessary - static QMap iconMap; + static TQMap iconMap; if( iconMap.empty() ) { iconMap["add_lyrics"] = "edit_add"; @@ -102,7 +102,7 @@ Amarok::icon( const QString& name ) //declared in amarok.h iconMap["zoom"] = "find"; } - static QMap amarokMap; + static TQMap amarokMap; if( amarokMap.empty() ) { amarokMap["queue_track"] = "fastforward"; amarokMap["dequeue_track"] = "rewind"; @@ -113,8 +113,8 @@ Amarok::icon( const QString& name ) //declared in amarok.h if( AmarokConfig::useCustomIconTheme() ) { if( amarokMap.contains( name ) ) - return QString( "amarok_" ) + amarokMap[name]; - return QString( "amarok_" ) + name; + return TQString( "amarok_" ) + amarokMap[name]; + return TQString( "amarok_" ) + name; } else return iconMap[name]; diff --git a/amarok/src/k3bexporter.cpp b/amarok/src/k3bexporter.cpp index d9dba557..19d0ab74 100644 --- a/amarok/src/k3bexporter.cpp +++ b/amarok/src/k3bexporter.cpp @@ -24,8 +24,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -44,8 +44,8 @@ void K3bExporter::exportTracks( const KURL::List &urls, int openmode ) return; DCOPClient *client = DCOPClient::mainClient(); - QCString appId, appObj; - QByteArray data; + TQCString appId, appObj; + TQByteArray data; if( openmode == -1 ) //ask to open a data or an audio cd project @@ -69,17 +69,17 @@ void K3bExporter::exportSelectedTracks( int openmode ) Playlist::instance()->burnSelectedTracks( openmode ); } -void K3bExporter::exportAlbum( const QString &album, int openmode ) +void K3bExporter::exportAlbum( const TQString &album, int openmode ) { - exportAlbum( QString::null, album, openmode ); + exportAlbum( TQString::null, album, openmode ); } -void K3bExporter::exportAlbum( const QString &artist, const QString &album, int openmode ) +void K3bExporter::exportAlbum( const TQString &artist, const TQString &album, int openmode ) { - QString albumId = QString::number( CollectionDB::instance()->albumID( album, false, false, true ) ); - QString artistId; + TQString albumId = TQString::number( CollectionDB::instance()->albumID( album, false, false, true ) ); + TQString artistId; if( !artist.isNull() ) - artistId = QString::number( CollectionDB::instance()->artistID( artist, false, false, true ) ); + artistId = TQString::number( CollectionDB::instance()->artistID( artist, false, false, true ) ); QueryBuilder qb; qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL ); @@ -89,7 +89,7 @@ void K3bExporter::exportAlbum( const QString &artist, const QString &album, int qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valDiscNumber ); qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valTrack ); - QStringList values( qb.run() ); + TQStringList values( qb.run() ); if( !values.isEmpty() ) { @@ -102,9 +102,9 @@ void K3bExporter::exportAlbum( const QString &artist, const QString &album, int } } -void K3bExporter::exportArtist( const QString &artist, int openmode ) +void K3bExporter::exportArtist( const TQString &artist, int openmode ) { - const QString artistId = QString::number( CollectionDB::instance()->artistID( artist, false, false, true ) ); + const TQString artistId = TQString::number( CollectionDB::instance()->artistID( artist, false, false, true ) ); QueryBuilder qb; qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL ); @@ -113,7 +113,7 @@ void K3bExporter::exportArtist( const QString &artist, int openmode ) qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valDiscNumber ); qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valTrack ); - QStringList values( qb.run() ); + TQStringList values( qb.run() ); if( !values.isEmpty() ) { @@ -126,9 +126,9 @@ void K3bExporter::exportArtist( const QString &artist, int openmode ) } } -void K3bExporter::exportComposer( const QString &composer, int openmode ) +void K3bExporter::exportComposer( const TQString &composer, int openmode ) { - const QString composerId = QString::number( CollectionDB::instance()->composerID( composer, false, false, true ) ); + const TQString composerId = TQString::number( CollectionDB::instance()->composerID( composer, false, false, true ) ); QueryBuilder qb; qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL ); @@ -137,7 +137,7 @@ void K3bExporter::exportComposer( const QString &composer, int openmode ) qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valDiscNumber ); qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valTrack ); - QStringList values( qb.run() ); + TQStringList values( qb.run() ); if( !values.isEmpty() ) { @@ -152,7 +152,7 @@ void K3bExporter::exportComposer( const QString &composer, int openmode ) void K3bExporter::exportViaCmdLine( const KURL::List &urls, int openmode ) { - QCString cmdOption; + TQCString cmdOption; switch( openmode ) { case AudioCD: @@ -183,10 +183,10 @@ void K3bExporter::exportViaCmdLine( const KURL::List &urls, int openmode ) void K3bExporter::exportViaDCOP( const KURL::List &urls, DCOPRef &ref, int openmode ) { - QValueList projectList; + TQValueList projectList; DCOPReply projectListReply = ref.call("projects()"); - if( !projectListReply.get >(projectList, "QValueList") ) { + if( !projectListReply.get >(projectList, "TQValueList") ) { DCOPErrorMessage(); return; } @@ -207,7 +207,7 @@ void K3bExporter::DCOPErrorMessage() bool K3bExporter::startNewK3bProject( DCOPRef &ref, int openmode ) { - QCString request; + TQCString request; //K3bOpenMode mode = openMode(); switch( openmode ) { diff --git a/amarok/src/k3bexporter.h b/amarok/src/k3bexporter.h index e9a2e24a..5e709f78 100644 --- a/amarok/src/k3bexporter.h +++ b/amarok/src/k3bexporter.h @@ -61,28 +61,28 @@ public: * @param openmode The mode of the album * @param album The album to export */ - void exportAlbum( const QString &album, int openmode=-1 ); + void exportAlbum( const TQString &album, int openmode=-1 ); /** * Exports the album @p album by artist @ artist to K3B. The mode @p openmode will be used * @param openmode The mode of the album * @param album The album to export */ - void exportAlbum( const QString &artist, const QString &album, int openmode=-1 ); + void exportAlbum( const TQString &artist, const TQString &album, int openmode=-1 ); /** * Exports all tracks of the artist @p artist to K3B. The mode @p openmode will be used * @param openmode The mode of the album * @param artist The artists which tracks to export */ - void exportArtist( const QString &artist, int openmode=-1 ); + void exportArtist( const TQString &artist, int openmode=-1 ); /** * Exports all tracks of the composer @p composer to K3B. The mode @p openmode will be used * @param openmode The mode of the album * @param artist The artists which tracks to export */ - void exportComposer( const QString &artist, int openmode=-1 ); + void exportComposer( const TQString &artist, int openmode=-1 ); /** * @return the static instance of K3bExporter diff --git a/amarok/src/kbookmarkhandler.cpp b/amarok/src/kbookmarkhandler.cpp index ce32858c..0157e901 100644 --- a/amarok/src/kbookmarkhandler.cpp +++ b/amarok/src/kbookmarkhandler.cpp @@ -27,10 +27,10 @@ #include KBookmarkHandler::KBookmarkHandler( KDirOperator *parent, KPopupMenu* rootmenu ) - : QObject( parent, "KBookmarkHandler" ) + : TQObject( parent, "KBookmarkHandler" ) , KBookmarkOwner() { - const QString file = Amarok::saveLocation() + "fileBrowserBookmarks.xml"; + const TQString file = Amarok::saveLocation() + "fileBrowserBookmarks.xml"; KBookmarkManager *manager = KBookmarkManager::managerForFile( file, false ); manager->setUpdate( true ); @@ -46,7 +46,7 @@ KBookmarkHandler::currentURL() const } void -KBookmarkHandler::openBookmarkURL( const QString &url ) +KBookmarkHandler::openBookmarkURL( const TQString &url ) { static_cast(parent())->setURL( KURL(url), true ); } diff --git a/amarok/src/kbookmarkhandler.h b/amarok/src/kbookmarkhandler.h index 2abb4833..86a44eff 100644 --- a/amarok/src/kbookmarkhandler.h +++ b/amarok/src/kbookmarkhandler.h @@ -21,19 +21,19 @@ #define _KBOOKMARKHANDLER_H_ #include -#include +#include class KDirOperator; class KPopupMenu; -class KBookmarkHandler : public QObject, public KBookmarkOwner +class KBookmarkHandler : public TQObject, public KBookmarkOwner { public: KBookmarkHandler( KDirOperator *parent, KPopupMenu* ); /// KBookmarkOwner interface: - virtual void openBookmarkURL( const QString &url ); - virtual QString currentURL() const; + virtual void openBookmarkURL( const TQString &url ); + virtual TQString currentURL() const; }; #endif // _KBOOKMARKHANDLER_H_ diff --git a/amarok/src/konquisidebar/universalamarok.cpp b/amarok/src/konquisidebar/universalamarok.cpp index ff704ea4..9883b108 100644 --- a/amarok/src/konquisidebar/universalamarok.cpp +++ b/amarok/src/konquisidebar/universalamarok.cpp @@ -22,41 +22,41 @@ #include "amarokdcopiface_stub.h" -#include +#include #include #include -#include -#include +#include +#include #include #include -#include -#include +#include +#include #include #include #include #include -#include -#include +#include +#include #include #include -#include +#include #include #include #include #define HTML_FILE KGlobal::dirs()->saveLocation( "data", "amarok/", true ) + "contextbrowser.html" -amarokWidget::amarokWidget( QWidget * parent, const char * name, WFlags f ) - : QVBox(parent, name, f) +amarokWidget::amarokWidget( TQWidget * parent, const char * name, WFlags f ) + : TQVBox(parent, name, f) { setAcceptDrops(true); } -void amarokWidget::dragEnterEvent(QDragEnterEvent* event) +void amarokWidget::dragEnterEvent(TQDragEnterEvent* event) { event->accept( KURLDrag::canDecode(event) ); } -void amarokWidget::dropEvent(QDropEvent* event) +void amarokWidget::dropEvent(TQDropEvent* event) { KURL::List urlList; if( KURLDrag::decode(event, urlList) ) @@ -68,15 +68,15 @@ void amarokWidget::dropEvent(QDropEvent* event) } } -bool amarokWidget::eventFilter( QObject *, QEvent *e ) +bool amarokWidget::eventFilter( TQObject *, TQEvent *e ) { - if(e->type() < QEvent::DragEnter || e->type() > QEvent::Drop ) + if(e->type() < TQEvent::DragEnter || e->type() > TQEvent::Drop ) return false; - QApplication::sendEvent(this, e); + TQApplication::sendEvent(this, e); return true; } -UniversalAmarok::UniversalAmarok(KInstance *inst,QObject *parent,QWidget *widgetParent, QString &desktopName, const char* name): +UniversalAmarok::UniversalAmarok(KInstance *inst,TQObject *parent,TQWidget *widgetParent, TQString &desktopName, const char* name): KonqSidebarPlugin(inst,parent,widgetParent,desktopName,name) { KGlobal::iconLoader()->addAppDir( "amarok" ); @@ -84,9 +84,9 @@ UniversalAmarok::UniversalAmarok(KInstance *inst,QObject *parent,QWidget *widget // widgetParent->resize(580,300); KToolBar *topBar = new KToolBar( widget, "Topbar" ); topBar->setIconSize(16); - topBar->insertButton( "today", 0, SIGNAL( clicked() ), this, SLOT( currentTrack() ) ); - topBar->insertButton( "document", 0, SIGNAL( clicked() ), this, SLOT( lyrics() ) ); - topBar->insertButton( "personal", 0, SIGNAL( clicked() ), this, SLOT( wiki() ) ); + topBar->insertButton( "today", 0, TQT_SIGNAL( clicked() ), this, TQT_SLOT( currentTrack() ) ); + topBar->insertButton( "document", 0, TQT_SIGNAL( clicked() ), this, TQT_SLOT( lyrics() ) ); + topBar->insertButton( "personal", 0, TQT_SIGNAL( clicked() ), this, TQT_SLOT( wiki() ) ); browser = new KHTMLPart(widget, "widget-browser"); //browser=new KHTMLPart(widget); @@ -105,32 +105,32 @@ UniversalAmarok::UniversalAmarok(KInstance *inst,QObject *parent,QWidget *widget KToolBar* toolBar=new KToolBar(widget, "PlayerControls"); toolBar->setIconSize(16); - toolBar->insertButton( "player_start",0, SIGNAL( clicked() ), this, SLOT( sendPrev() ) ); - toolBar->insertButton( "player_play", 0, SIGNAL( clicked() ), this, SLOT( sendPlay() ) ); - toolBar->insertButton( "player_pause",0, SIGNAL( clicked() ), this, SLOT( sendPause() ) ); - toolBar->insertButton( "player_stop", 0, SIGNAL( clicked() ), this, SLOT( sendStop() ) ); - toolBar->insertButton( "player_end", 0, SIGNAL( clicked() ), this, SLOT( sendNext() ) ); + toolBar->insertButton( "player_start",0, TQT_SIGNAL( clicked() ), this, TQT_SLOT( sendPrev() ) ); + toolBar->insertButton( "player_play", 0, TQT_SIGNAL( clicked() ), this, TQT_SLOT( sendPlay() ) ); + toolBar->insertButton( "player_pause",0, TQT_SIGNAL( clicked() ), this, TQT_SLOT( sendPause() ) ); + toolBar->insertButton( "player_stop", 0, TQT_SIGNAL( clicked() ), this, TQT_SLOT( sendStop() ) ); + toolBar->insertButton( "player_end", 0, TQT_SIGNAL( clicked() ), this, TQT_SLOT( sendNext() ) ); toolBar->insertSeparator(); - toolBar->insertButton( "arts", 0, SIGNAL( clicked() ), this, SLOT( sendMute() ) ); + toolBar->insertButton( "arts", 0, TQT_SIGNAL( clicked() ), this, TQT_SLOT( sendMute() ) ); - vol_slider = new QSlider(0,100,1,0,Qt::Horizontal, toolBar,"volume"); + vol_slider = new TQSlider(0,100,1,0,Qt::Horizontal, toolBar,"volume"); vol_slider->setLineStep(2); - connect(vol_slider, SIGNAL( valueChanged(int) ), this, SLOT(volChanged(int ) ) ); + connect(vol_slider, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT(volChanged(int ) ) ); toolBar->insertWidget(1,2, vol_slider); - fileInfo = new QFileInfo(HTML_FILE); - QTimer *t = new QTimer( this ); + fileInfo = new TQFileInfo(HTML_FILE); + TQTimer *t = new TQTimer( this ); - connect( t, SIGNAL(timeout()), SLOT(updateStatus() ) ); + connect( t, TQT_SIGNAL(timeout()), TQT_SLOT(updateStatus() ) ); t->start( 2000, false ); kdDebug() << "Connecting widget signal" << endl; - connect( widget, SIGNAL( emitURL( const KURL &)), - this, SLOT( openURLRequest( const KURL &) ) ); - connect( browser->browserExtension(), SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ), - this, SLOT( openURLRequest( const KURL & ) ) ); + connect( widget, TQT_SIGNAL( emitURL( const KURL &)), + this, TQT_SLOT( openURLRequest( const KURL &) ) ); + connect( browser->browserExtension(), TQT_SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ), + this, TQT_SLOT( openURLRequest( const KURL & ) ) ); widget->show(); } @@ -151,7 +151,7 @@ UniversalAmarok::~UniversalAmarok() extern "C" { - KDE_EXPORT void* create_konqsidebar_universalamarok(KInstance *instance,QObject *par,QWidget *widp,QString &desktopname,const char *name) + KDE_EXPORT void* create_konqsidebar_universalamarok(KInstance *instance,TQObject *par,TQWidget *widp,TQString &desktopname,const char *name) { KGlobal::locale()->insertCatalogue( "amarok" ); return new UniversalAmarok(instance,par,widp,desktopname,name); @@ -161,7 +161,7 @@ extern "C" // FIXME: Is this referenced from anywhere ??! extern "C" { - KDE_EXPORT bool add_konqsidebar_universalamarok(QString* fn, QString* param, QMap *map) + KDE_EXPORT bool add_konqsidebar_universalamarok(TQString* fn, TQString* param, TQMap *map) { Q_UNUSED(param); @@ -180,23 +180,23 @@ extern "C" /*! \fn UniversalAmarok::updateBrowser() */ -void UniversalAmarok::updateBrowser(const QString& file) +void UniversalAmarok::updateBrowser(const TQString& file) { - if (! (QFile::exists(file) ) ) + if (! (TQFile::exists(file) ) ) { showIntroduction(); return; } - QString text; - QFile f_file(file); + TQString text; + TQFile f_file(file); if( f_file.open(IO_ReadOnly) ) { - QTextStream stream( &f_file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); - QString line; + TQTextStream stream( &f_file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); + TQString line; while ( !stream.atEnd() ) { line = stream.readLine(); // line of text excluding '\n' - text += QString("\n") + line; + text += TQString("\n") + line; } f_file.close(); text=text.replace("begin(); @@ -226,7 +226,7 @@ void UniversalAmarok::updateStatus() /*! \fn UniversalAmarok::getCurrentPlaying() */ -QString UniversalAmarok::getCurrentPlaying() +TQString UniversalAmarok::getCurrentPlaying() { return playerStub->nowPlaying(); } @@ -258,7 +258,7 @@ void UniversalAmarok::checkForAmarok() void UniversalAmarok::noAmarokRunning() { - QString m_HTMLSource=""; + TQString m_HTMLSource=""; m_HTMLSource.append( "" "
" @@ -296,7 +296,7 @@ void UniversalAmarok::volChanged(int vol) void UniversalAmarok::showIntroduction() { - QString m_HTMLSource=""; + TQString m_HTMLSource=""; m_HTMLSource.append( "" "
" diff --git a/amarok/src/konquisidebar/universalamarok.h b/amarok/src/konquisidebar/universalamarok.h index 6227cb11..131f5b59 100644 --- a/amarok/src/konquisidebar/universalamarok.h +++ b/amarok/src/konquisidebar/universalamarok.h @@ -23,8 +23,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include "amarokdcopiface_stub.h" @@ -35,19 +35,19 @@ class universalamarokwidget; class DCOPClient; -class QFileInfo; -class QDateTime; +class TQFileInfo; +class TQDateTime; class amarokWidget : public QVBox { Q_OBJECT public: - amarokWidget( QWidget * parent = 0, const char * name = 0, WFlags f = 0 ); + amarokWidget( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 ); protected: - virtual void dragEnterEvent ( QDragEnterEvent * ); - virtual void dropEvent(QDropEvent*); - bool eventFilter( QObject *o, QEvent *e ); + virtual void dragEnterEvent ( TQDragEnterEvent * ); + virtual void dropEvent(TQDropEvent*); + bool eventFilter( TQObject *o, TQEvent *e ); signals: void emitURL( const KURL &); @@ -58,30 +58,30 @@ class UniversalAmarok : public KonqSidebarPlugin { Q_OBJECT public: - UniversalAmarok(KInstance *inst,QObject *parent,QWidget *widgetParent, QString &desktopName, const char* name=0); + UniversalAmarok(KInstance *inst,TQObject *parent,TQWidget *widgetParent, TQString &desktopName, const char* name=0); ~UniversalAmarok(); - virtual QWidget *getWidget(){return (QWidget*)widget;} - virtual void *provides(const QString &) {return 0;} + virtual TQWidget *getWidget(){return (TQWidget*)widget;} + virtual void *provides(const TQString &) {return 0;} virtual void handleURL(const KURL& /*url*/) {} - QString getCurrentPlaying(); + TQString getCurrentPlaying(); void showIntroduction(); private: amarokWidget* widget; KHTMLPart* browser; - QString amarokPlaying; + TQString amarokPlaying; DCOPClient* amarokDCOP; - QFileInfo* fileInfo; - QDateTime fileDT; - QSlider* vol_slider; + TQFileInfo* fileInfo; + TQDateTime fileDT; + TQSlider* vol_slider; AmarokPlayerInterface_stub *playerStub; AmarokPlaylistInterface_stub *playlistStub; AmarokContextBrowserInterface_stub *contextStub; public slots: - void updateBrowser(const QString&); + void updateBrowser(const TQString&); void updateStatus(); void sendPrev() { checkForAmarok(); playerStub->prev(); } void sendPlay() { checkForAmarok(); playerStub->play(); } diff --git a/amarok/src/ktrm.cpp b/amarok/src/ktrm.cpp index cd102376..ad158539 100644 --- a/amarok/src/ktrm.cpp +++ b/amarok/src/ktrm.cpp @@ -32,12 +32,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #if HAVE_TUNEPIMP @@ -67,7 +67,7 @@ class KTRMRequestHandler public: static KTRMRequestHandler *instance() { - static QMutex mutex; + static TQMutex mutex; mutex.lock(); static KTRMRequestHandler handler; mutex.unlock(); @@ -79,9 +79,9 @@ public: int id; if(!m_fileMap.contains(lookup->file())) { #if HAVE_TUNEPIMP >= 4 - id = tp_AddFile(m_pimp, QFile::encodeName(lookup->file()), 0); + id = tp_AddFile(m_pimp, TQFile::encodeName(lookup->file()), 0); #else - id = tp_AddFile(m_pimp, QFile::encodeName(lookup->file())); + id = tp_AddFile(m_pimp, TQFile::encodeName(lookup->file())); #endif m_fileMap.insert(lookup->file(), id); } @@ -154,18 +154,18 @@ protected: KProtocolManager::reparseConfiguration(); if(KProtocolManager::useProxy()) { - QString noProxiesFor = KProtocolManager::noProxyFor(); - QStringList noProxies = QStringList::split(QRegExp("[',''\t'' ']"), noProxiesFor); + TQString noProxiesFor = KProtocolManager::noProxyFor(); + TQStringList noProxies = TQStringList::split(TQRegExp("[',''\t'' ']"), noProxiesFor); bool useProxy = true; char server[255]; short port; tp_GetServer(m_pimp, server, 255, &port); - QString tunepimpHost = QString(server); - QString tunepimpHostWithPort = (tunepimpHost + ":%1").arg(port); + TQString tunepimpHost = TQString(server); + TQString tunepimpHostWithPort = (tunepimpHost + ":%1").arg(port); - for(QStringList::ConstIterator it = noProxies.constBegin(); it != noProxies.constEnd(); ++it) { - QString normalizedHost = KNetwork::KResolver::normalizeDomain(*it); + for(TQStringList::ConstIterator it = noProxies.constBegin(); it != noProxies.constEnd(); ++it) { + TQString normalizedHost = KNetwork::KResolver::normalizeDomain(*it); if(normalizedHost == tunepimpHost || tunepimpHost.endsWith('.' + normalizedHost)) { useProxy = false; @@ -199,9 +199,9 @@ protected: private: tunepimp_t m_pimp; - QMap m_lookupMap; - QMap m_fileMap; - mutable QMutex m_lookupMapMutex; + TQMap m_lookupMap; + TQMap m_fileMap; + mutable TQMutex m_lookupMapMutex; }; @@ -221,7 +221,7 @@ public: }; KTRMEvent(int fileId, Status status) : - QCustomEvent(id), + TQCustomEvent(id), m_fileId(fileId), m_status(status) {} @@ -256,25 +256,25 @@ public: } protected: - KTRMEventHandler() : QObject() {} + KTRMEventHandler() : TQObject() {} static KTRMEventHandler *instance() { - static QMutex mutex; + static TQMutex mutex; mutex.lock(); static KTRMEventHandler handler; mutex.unlock(); return &handler; } - virtual void customEvent(QCustomEvent *event) + virtual void customEvent(TQCustomEvent *event) { if(!event->type() == KTRMEvent::id) return; KTRMEvent *e = static_cast(event); - static QMutex mutex; + static TQMutex mutex; mutex.lock(); if(!KTRMRequestHandler::instance()->lookupMapContains(e->fileId())) { @@ -368,9 +368,9 @@ class KTRMResult::KTRMResultPrivate { public: KTRMResultPrivate() : track(0), year(0), relevance(0) {} - QString title; - QString artist; - QString album; + TQString title; + TQString artist; + TQString album; int track; int year; double relevance; @@ -417,30 +417,30 @@ KTRMResult::~KTRMResult() #endif } -QString KTRMResult::title() const +TQString KTRMResult::title() const { #if HAVE_TUNEPIMP return d->title; #else - return QString(); + return TQString(); #endif } -QString KTRMResult::artist() const +TQString KTRMResult::artist() const { #if HAVE_TUNEPIMP return d->artist; #else - return QString(); + return TQString(); #endif } -QString KTRMResult::album() const +TQString KTRMResult::album() const { #if HAVE_TUNEPIMP return d->album; #else - return QString(); + return TQString(); #endif } @@ -522,8 +522,8 @@ class KTRMLookup::KTRMLookupPrivate public: KTRMLookupPrivate() : fileId(-1), autoDelete(false) {} - QString file; - QString errorString; + TQString file; + TQString errorString; KTRMResultList results; int fileId; bool autoDelete; @@ -533,8 +533,8 @@ public: // KTRMLookup public methods //////////////////////////////////////////////////////////////////////////////// -KTRMLookup::KTRMLookup(const QString &file, bool autoDelete) - : QObject() +KTRMLookup::KTRMLookup(const TQString &file, bool autoDelete) + : TQObject() { #if HAVE_TUNEPIMP d = new KTRMLookupPrivate; @@ -555,12 +555,12 @@ KTRMLookup::~KTRMLookup() #endif } -QString KTRMLookup::file() const +TQString KTRMLookup::file() const { #if HAVE_TUNEPIMP return d->file; #else - return QString(); + return TQString(); #endif } @@ -587,9 +587,9 @@ void KTRMLookup::recognized() KTRMResult result; - result.d->title = QString::fromUtf8(metaData->track); - result.d->artist = QString::fromUtf8(metaData->artist); - result.d->album = QString::fromUtf8(metaData->album); + result.d->title = TQString::fromUtf8(metaData->track); + result.d->artist = TQString::fromUtf8(metaData->artist); + result.d->album = TQString::fromUtf8(metaData->album); result.d->track = metaData->trackNum; result.d->year = metaData->releaseYear; @@ -648,12 +648,12 @@ void KTRMLookup::collision() tr_Lock(track); int resultCount = tr_GetNumResults(track); - QStringList strList = QStringList::split ( '/', d->file ); + TQStringList strList = TQStringList::split ( '/', d->file ); metadata_t *mdata = md_New(); - strList.append( QString::fromUtf8(mdata->track) ); - strList.append( QString::fromUtf8(mdata->artist) ); - strList.append( QString::fromUtf8(mdata->album) ); + strList.append( TQString::fromUtf8(mdata->track) ); + strList.append( TQString::fromUtf8(mdata->artist) ); + strList.append( TQString::fromUtf8(mdata->album) ); md_Clear(mdata); if(resultCount > 0) { @@ -680,14 +680,14 @@ void KTRMLookup::collision() for(int i = 0; i < resultCount; i++) { KTRMResult result; - result.d->title = QString::fromUtf8(tracks[i]->name); + result.d->title = TQString::fromUtf8(tracks[i]->name); #if HAVE_TUNEPIMP >= 4 - result.d->artist = QString::fromUtf8(tracks[i]->artist.name); - result.d->album = QString::fromUtf8(tracks[i]->album.name); + result.d->artist = TQString::fromUtf8(tracks[i]->artist.name); + result.d->album = TQString::fromUtf8(tracks[i]->album.name); result.d->year = tracks[i]->album.releaseYear; #else - result.d->artist = QString::fromUtf8(tracks[i]->artist->name); - result.d->album = QString::fromUtf8(tracks[i]->album->name); + result.d->artist = TQString::fromUtf8(tracks[i]->artist->name); + result.d->album = TQString::fromUtf8(tracks[i]->album->name); result.d->year = tracks[i]->album->releaseYear; #endif result.d->track = tracks[i]->trackNum; @@ -731,12 +731,12 @@ void KTRMLookup::puidGenerated() tp_ReleaseTrack(KTRMRequestHandler::instance()->tunePimp(), track); d->results.clear(); - KIO::Job *job = KIO::storedGet( QString( "http://musicbrainz.org/ws/1/track/?type=xml&puid=%1" ).arg( puid ) , false, false ); + KIO::Job *job = KIO::storedGet( TQString( "http://musicbrainz.org/ws/1/track/?type=xml&puid=%1" ).arg( puid ) , false, false ); Amarok::StatusBar::instance()->newProgressOperation( job ) .setDescription( i18n( "MusicBrainz Lookup" ) ); - connect( job, SIGNAL( result( KIO::Job* ) ), SLOT( lookupResult( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), TQT_SLOT( lookupResult( KIO::Job* ) ) ); #endif } @@ -751,10 +751,10 @@ void KTRMLookup::lookupResult( KIO::Job* job ) return; } KIO::StoredTransferJob* const storedJob = static_cast( job ); - QString xml = QString::fromUtf8( storedJob->data().data(), storedJob->data().size() ); + TQString xml = TQString::fromUtf8( storedJob->data().data(), storedJob->data().size() ); - QDomDocument doc; - QDomElement e; + TQDomDocument doc; + TQDomElement e; if( !doc.setContent( xml ) ) { warning() << "[MusicBrainzLookup] Invalid XML" << endl; @@ -765,24 +765,24 @@ void KTRMLookup::lookupResult( KIO::Job* job ) e = doc.namedItem( "metadata" ).toElement().namedItem( "track-list" ).toElement(); - QStringList strList = QStringList::split ( '/', d->file ); + TQStringList strList = TQStringList::split ( '/', d->file ); - QDomNode n = e.namedItem("track"); + TQDomNode n = e.namedItem("track"); for( ; !n.isNull(); n = n.nextSibling() ) { - QDomElement track = n.toElement(); + TQDomElement track = n.toElement(); KTRMResult result; result.d->title = track.namedItem( "title" ).toElement().text(); result.d->artist = track.namedItem( "artist" ).toElement().namedItem( "name" ).toElement().text(); - QDomNode releaseNode = track.namedItem("release-list").toElement().namedItem("release"); + TQDomNode releaseNode = track.namedItem("release-list").toElement().namedItem("release"); for( ; !releaseNode.isNull(); releaseNode = releaseNode.nextSibling() ) { KTRMResult tmpResult( result ); - QDomElement release = releaseNode.toElement(); + TQDomElement release = releaseNode.toElement(); tmpResult.d->album = release.namedItem( "title" ).toElement().text(); - QDomNode tracklistN = release.namedItem( "track-list" ); + TQDomNode tracklistN = release.namedItem( "track-list" ); if ( !tracklistN.isNull() ) { - QDomElement tracklist = tracklistN.toElement(); + TQDomElement tracklist = tracklistN.toElement(); if ( !tracklist.attribute( "offset" ).isEmpty() ) tmpResult.d->track = tracklist.attribute( "offset" ).toInt() + 1; } @@ -845,25 +845,25 @@ void KTRMLookup::finished() //////////////////////////////////////////////////////////////////////////////// // Helper Functions used for sorting MusicBrainz results //////////////////////////////////////////////////////////////////////////////// -double stringSimilarity(QStringList &l, QString &s) +double stringSimilarity(TQStringList &l, TQString &s) { double max = 0, current = 0; - for ( QStringList::Iterator it = l.begin(); it != l.end(); ++it ) { + for ( TQStringList::Iterator it = l.begin(); it != l.end(); ++it ) { if( max < (current = stringSimilarity((*it),s))) max = current; } return max; } -double stringSimilarity(QString s1, QString s2) +double stringSimilarity(TQString s1, TQString s2) { - s1.remove( QRegExp("[\\s\\t\\r\\n]") ); - s2.remove( QRegExp("[\\s\\t\\r\\n]") ); + s1.remove( TQRegExp("[\\s\\t\\r\\n]") ); + s2.remove( TQRegExp("[\\s\\t\\r\\n]") ); double nCommon = 0; int p1 = 0, p2 = 0, x1 = 0, x2 = 0; int l1 = s1.length(), l2 = s2.length(), l3 = l1 + l2; - QChar c1 = 0, c2 = 0; + TQChar c1 = 0, c2 = 0; while(p1 < l1 && p2 < l2) { c1 = s1.at(p1); c2 = s2.at(p2); diff --git a/amarok/src/ktrm.h b/amarok/src/ktrm.h index 4ebe09ee..6de3daaa 100644 --- a/amarok/src/ktrm.h +++ b/amarok/src/ktrm.h @@ -27,10 +27,10 @@ #ifndef KTRM_H #define KTRM_H -#include -#include -#include -#include +#include +#include +#include +#include /** * This represents a potential match for a TRM lookup. KTRMResultList is @@ -52,17 +52,17 @@ public: /** * Returns the title of the track for the potential match. */ - QString title() const; + TQString title() const; /** * Returns the artist name of the track for the potential match. */ - QString artist() const; + TQString artist() const; /** * Returns the album name of the track for the potential match. */ - QString album() const; + TQString album() const; /** * Returns the track number of the track for the potential match. @@ -106,7 +106,7 @@ private: KTRMResultPrivate *d; }; -typedef QValueList KTRMResultList; +typedef TQValueList KTRMResultList; /** * An abstraction for libtunepimp's TRM based lookup and file recognition. @@ -124,7 +124,7 @@ class KTRMLookup : public QObject Q_OBJECT signals: - void sigResult( KTRMResultList, QString ); + void sigResult( KTRMResultList, TQString ); protected slots: virtual void lookupResult( KIO::Job* ); @@ -134,14 +134,14 @@ public: * Creates and starts a lookup for \a file. If \a autoDelete is set to * true the lookup will delete itself when it has finished. */ - KTRMLookup(const QString &file, bool autoDelete = false); + KTRMLookup(const TQString &file, bool autoDelete = false); virtual ~KTRMLookup(); /** * Returns the file name that was specified in the constructor. */ - QString file() const; + TQString file() const; /** * Returns the TunePimp file ID for the file. This is of no use to the @@ -220,7 +220,7 @@ private: /** * Helper Functions used for sorting MusicBrainz results */ -double stringSimilarity(QString s1, QString s2); -double stringSimilarity(QStringList &l, QString &s); +double stringSimilarity(TQString s1, TQString s2); +double stringSimilarity(TQStringList &l, TQString &s); #endif /*KTRM_H*/ diff --git a/amarok/src/lastfm.cpp b/amarok/src/lastfm.cpp index c35c76f6..0f57049f 100644 --- a/amarok/src/lastfm.cpp +++ b/amarok/src/lastfm.cpp @@ -24,11 +24,11 @@ #include "lastfm.h" #include "statusbar.h" //showError() -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -50,34 +50,34 @@ using namespace LastFm; // AmarokHttp is a hack written so that lastfm code could easily use something proxy aware. // DO NOT use this class for anything else, use KIO directly instead. //////////////////////////////////////////////////////////////////////////////// -AmarokHttp::AmarokHttp ( const QString& hostname, Q_UINT16 port, - QObject* parent ) - : QObject( parent ), +AmarokHttp::AmarokHttp ( const TQString& hostname, Q_UINT16 port, + TQObject* parent ) + : TQObject( parent ), m_hostname( hostname ), m_port( port ) {} int -AmarokHttp::get ( const QString & path ) +AmarokHttp::get ( const TQString & path ) { - QString uri = QString( "http://%1:%2/%3" ) + TQString uri = TQString( "http://%1:%2/%3" ) .arg( m_hostname ) .arg( m_port ) .arg( path ); m_done = false; - m_error = QHttp::NoError; - m_state = QHttp::Connecting; + m_error = TQHttp::NoError; + m_state = TQHttp::Connecting; KIO::TransferJob *job = KIO::get(uri, true, false); - connect(job, SIGNAL(data(KIO::Job*, const QByteArray&)), - this, SLOT(slotData(KIO::Job*, const QByteArray&))); - connect(job, SIGNAL(result(KIO::Job*)), - this, SLOT(slotResult(KIO::Job*))); + connect(job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)), + this, TQT_SLOT(slotData(KIO::Job*, const TQByteArray&))); + connect(job, TQT_SIGNAL(result(KIO::Job*)), + this, TQT_SLOT(slotResult(KIO::Job*))); return 0; } -QHttp::State +TQHttp::State AmarokHttp::state() const { return m_state; @@ -89,14 +89,14 @@ AmarokHttp::readAll () return m_result; } -QHttp::Error +TQHttp::Error AmarokHttp::error() { return m_error; } void -AmarokHttp::slotData(KIO::Job*, const QByteArray& data) +AmarokHttp::slotData(KIO::Job*, const TQByteArray& data) { if( data.size() == 0 ) { return; @@ -113,14 +113,14 @@ void AmarokHttp::slotResult(KIO::Job* job) { bool err = job->error(); - if( err || m_error != QHttp::NoError ) { - m_error = QHttp::UnknownError; + if( err || m_error != TQHttp::NoError ) { + m_error = TQHttp::UnknownError; } else { - m_error = QHttp::NoError; + m_error = TQHttp::NoError; } m_done = true; - m_state = QHttp::Unconnected; + m_state = TQHttp::Unconnected; emit( requestFinished( 0, err ) ); } @@ -133,18 +133,18 @@ AmarokHttp::slotResult(KIO::Job* job) Controller *Controller::s_instance = 0; Controller::Controller() - : QObject( EngineController::instance(), "lastfmController" ) + : TQObject( EngineController::instance(), "lastfmController" ) , m_service( 0 ) { KActionCollection* ac = Amarok::actionCollection(); m_actionList.append( new KAction( i18n( "Ban" ), Amarok::icon( "remove" ), - KKey( Qt::CTRL | Qt::Key_B ), this, SLOT( ban() ), ac, "ban" ) ); + KKey( Qt::CTRL | Qt::Key_B ), this, TQT_SLOT( ban() ), ac, "ban" ) ); m_actionList.append( new KAction( i18n( "Love" ), Amarok::icon( "love" ), - KKey( Qt::CTRL | Qt::Key_L ), this, SLOT( love() ), ac, "love" ) ); + KKey( Qt::CTRL | Qt::Key_L ), this, TQT_SLOT( love() ), ac, "love" ) ); m_actionList.append( new KAction( i18n( "Skip" ), Amarok::icon( "next" ), - KKey( Qt::CTRL | Qt::Key_K ), this, SLOT( skip() ), ac, "skip" ) ); + KKey( Qt::CTRL | Qt::Key_K ), this, TQT_SLOT( skip() ), ac, "skip" ) ); setActionsEnabled( false ); } @@ -158,7 +158,7 @@ Controller::instance() KURL -Controller::getNewProxy( QString genreUrl, bool useProxy ) +Controller::getNewProxy( TQString genreUrl, bool useProxy ) { DEBUG_BLOCK @@ -173,8 +173,8 @@ Controller::getNewProxy( QString genreUrl, bool useProxy ) if( checkCredentials() ) { - QString user = AmarokConfig::scrobblerUsername(); - QString pass = AmarokConfig::scrobblerPassword(); + TQString user = AmarokConfig::scrobblerUsername(); + TQString pass = AmarokConfig::scrobblerPassword(); if( !user.isEmpty() && !pass.isEmpty() && service->handshake( user, pass ) ) @@ -201,7 +201,7 @@ Controller::getNewProxy( QString genreUrl, bool useProxy ) } int -Controller::changeStation( QString url ) +Controller::changeStation( TQString url ) { if (isPlaying()) { WebService* service = getService(); @@ -238,7 +238,7 @@ Controller::checkCredentials() //static { LoginDialog dialog( 0 ); dialog.setCaption( "last.fm" ); - return dialog.exec() == QDialog::Accepted; + return dialog.exec() == TQDialog::Accepted; } return true; } @@ -247,10 +247,10 @@ Controller::checkCredentials() //static QString Controller::createCustomStation() //static { - QString token; + TQString token; CustomStationDialog dialog( 0 ); - if( dialog.exec() == QDialog::Accepted ) + if( dialog.exec() == TQDialog::Accepted ) { token = dialog.text(); } @@ -296,14 +296,14 @@ Controller::setActionsEnabled( bool enable ) /// return a translatable description of the station we are connected to QString -Controller::stationDescription( QString url ) +Controller::stationDescription( TQString url ) { if( url.isEmpty() && instance() && instance()->isPlaying() ) url = instance()->getService()->currentStation(); - if( url.isEmpty() ) return QString(); + if( url.isEmpty() ) return TQString(); - QStringList elements = QStringList::split( "/", url ); + TQStringList elements = TQStringList::split( "/", url ); /// TAG RADIOS // eg: lastfm://globaltag/rock @@ -327,11 +327,11 @@ Controller::stationDescription( QString url ) // eg: lastfm://artistnames/genesis,pink floyd,queen // turn "genesis,pink floyd,queen" into "Genesis, Pink Floyd, Queen" - QString artists = elements[2]; + TQString artists = elements[2]; artists.replace( ",", ", " ); - const QStringList words = QStringList::split( " ", QString( artists ).remove( "," ) ); + const TQStringList words = TQStringList::split( " ", TQString( artists ).remove( "," ) ); foreach( words ) { - QString capitalized = *it; + TQString capitalized = *it; capitalized.replace( 0, 1, (*it)[0].upper() ); artists.replace( *it, capitalized ); } @@ -382,8 +382,8 @@ Controller::stationDescription( QString url ) // CLASS WebService //////////////////////////////////////////////////////////////////////////////// -WebService::WebService( QObject* parent, bool useProxy ) - : QObject( parent, "lastfmParent" ) +WebService::WebService( TQObject* parent, bool useProxy ) + : TQObject( parent, "lastfmParent" ) , m_useProxy( useProxy ) , m_deletionUnsafe( false ) , m_wasCanceled( false ) @@ -406,7 +406,7 @@ WebService::cancel() { void WebService::readProxy() //SLOT { - QString line; + TQString line; while( m_server->readln( line ) != -1 ) { debug() << line << endl; @@ -418,7 +418,7 @@ WebService::readProxy() //SLOT bool -WebService::handshake( const QString& username, const QString& password ) +WebService::handshake( const TQString& username, const TQString& password ) { DEBUG_BLOCK @@ -427,11 +427,11 @@ WebService::handshake( const QString& username, const QString& password ) AmarokHttp http( "ws.audioscrobbler.com", 80 ); - const QString path = - QString( "/radio/handshake.php?version=%1&platform=%2&username=%3&passwordmd5=%4&debug=%5" ) + const TQString path = + TQString( "/radio/handshake.php?version=%1&platform=%2&username=%3&passwordmd5=%4&debug=%5" ) .arg( APP_VERSION ) //Muesli-approved: Amarok version, and Amarok-as-platform - .arg( QString("Amarok") ) - .arg( QString( QUrl( username ).encodedPathAndQuery() ) ) + .arg( TQString("Amarok") ) + .arg( TQString( TQUrl( username ).encodedPathAndQuery() ) ) .arg( KMD5( m_password.utf8() ).hexDigest() ) .arg( "0" ); @@ -442,15 +442,15 @@ WebService::handshake( const QString& username, const QString& password ) m_deletionUnsafe = true; do kapp->processEvents(); - while( http.state() != QHttp::Unconnected ); + while( http.state() != TQHttp::Unconnected ); m_deletionUnsafe = false; if (this->wasCanceled()) return false; - if ( http.error() != QHttp::NoError ) + if ( http.error() != TQHttp::NoError ) return false; - const QString result( QDeepCopy( http.readAll() ) ); + const TQString result( TQDeepCopy( http.readAll() ) ); debug() << "result: " << result << endl; @@ -458,7 +458,7 @@ WebService::handshake( const QString& username, const QString& password ) m_baseHost = parameter( "base_url", result ); m_basePath = parameter( "base_path", result ); m_subscriber = parameter( "subscriber", result ) == "1"; - m_streamUrl = QUrl( parameter( "stream_url", result ) ); + m_streamUrl = TQUrl( parameter( "stream_url", result ) ); // bool banned = parameter( "banned", result ) == "1"; if ( m_session.lower() == "failed" ) { @@ -478,13 +478,13 @@ WebService::handshake( const QString& username, const QString& password ) debug() << "Proxy server using port: " << port << endl; delete socket; - m_proxyUrl = QString( "http://localhost:%1/lastfm.mp3" ).arg( port ); + m_proxyUrl = TQString( "http://localhost:%1/lastfm.mp3" ).arg( port ); m_server = new Amarok::ProcIO(); m_server->setComm( KProcess::Communication( KProcess::AllOutput ) ); *m_server << "amarok_proxy.rb"; *m_server << "--lastfm"; - *m_server << QString::number( port ); + *m_server << TQString::number( port ); *m_server << m_streamUrl.toString(); *m_server << AmarokConfig::soundSystem(); *m_server << Amarok::proxyForUrl( m_streamUrl.toString() ); @@ -494,7 +494,7 @@ WebService::handshake( const QString& username, const QString& password ) return false; } - QString line; + TQString line; m_deletionUnsafe = true; while( true ) { kapp->processEvents(); @@ -505,8 +505,8 @@ WebService::handshake( const QString& username, const QString& password ) if (this->wasCanceled()) return false; - connect( m_server, SIGNAL( readReady( KProcIO* ) ), this, SLOT( readProxy() ) ); - connect( m_server, SIGNAL( processExited( KProcess* ) ), Controller::instance(), SLOT( playbackStopped() ) ); + connect( m_server, TQT_SIGNAL( readReady( KProcIO* ) ), this, TQT_SLOT( readProxy() ) ); + connect( m_server, TQT_SIGNAL( processExited( KProcess* ) ), Controller::instance(), TQT_SLOT( playbackStopped() ) ); } else m_proxyUrl = m_streamUrl.toString(); @@ -516,31 +516,31 @@ WebService::handshake( const QString& username, const QString& password ) bool -WebService::changeStation( QString url ) +WebService::changeStation( TQString url ) { debug() << "Changing station:" << url << endl; AmarokHttp http( m_baseHost, 80 ); - http.get( QString( m_basePath + "/adjust.php?session=%1&url=%2&debug=0" ) + http.get( TQString( m_basePath + "/adjust.php?session=%1&url=%2&debug=0" ) .arg( m_session ) .arg( url ) ); m_deletionUnsafe = true; do kapp->processEvents(); - while( http.state() != QHttp::Unconnected ); + while( http.state() != TQHttp::Unconnected ); m_deletionUnsafe = false; if (this->wasCanceled()) return false; - if ( http.error() != QHttp::NoError ) + if ( http.error() != TQHttp::NoError ) { showError( E_OTHER ); // default error return false; } - const QString result( QDeepCopy( http.readAll() ) ); + const TQString result( TQDeepCopy( http.readAll() ) ); const int errCode = parameter( "error", result ).toInt(); if ( errCode ) @@ -549,14 +549,14 @@ WebService::changeStation( QString url ) return false; } - const QString _url = parameter( "url", result ); + const TQString _url = parameter( "url", result ); if ( _url.startsWith( "lastfm://" ) ) { m_station = _url; // parse it in stationDescription emit stationChanged( _url, m_station ); } else - emit stationChanged( _url, QString::null ); + emit stationChanged( _url, TQString::null ); return true; } @@ -565,9 +565,9 @@ void WebService::requestMetaData() //SLOT { AmarokHttp *http = new AmarokHttp( m_baseHost, 80, this ); - connect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( metaDataFinished( int, bool ) ) ); + connect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( metaDataFinished( int, bool ) ) ); - http->get( QString( m_basePath + "/np.php?session=%1&debug=%2" ) + http->get( TQString( m_basePath + "/np.php?session=%1&debug=%2" ) .arg( m_session ) .arg( "0" ) ); } @@ -582,7 +582,7 @@ WebService::metaDataFinished( int /*id*/, bool error ) //SLOT http->deleteLater(); if( error ) return; - const QString result( http->readAll() ); + const TQString result( http->readAll() ); debug() << result << endl; int errCode = parameter( "error", result ).toInt(); @@ -599,11 +599,11 @@ WebService::metaDataFinished( int /*id*/, bool error ) //SLOT m_metaBundle.setLength( parameter( "trackduration", result ).toInt() ); Bundle lastFmStuff; - QString imageUrl = parameter( "albumcover_medium", result ); + TQString imageUrl = parameter( "albumcover_medium", result ); if( imageUrl == "http://static.last.fm/coverart/" || imageUrl == "http://static.last.fm/depth/catalogue/no_album_large.gif" ) - imageUrl = QString::null; + imageUrl = TQString::null; lastFmStuff.setImageUrl ( CollectionDB::instance()->notAvailCover( true ) ); lastFmStuff.setArtistUrl( parameter( "artist_url", result ) ); @@ -621,7 +621,7 @@ WebService::metaDataFinished( int /*id*/, bool error ) //SLOT } KIO::Job* job = KIO::storedGet( u, true, false ); - connect( job, SIGNAL( result( KIO::Job* ) ), this, SLOT( fetchImageFinished( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), this, TQT_SLOT( fetchImageFinished( KIO::Job* ) ) ); } @@ -631,10 +631,10 @@ WebService::fetchImageFinished( KIO::Job* job ) //SLOT DEBUG_BLOCK if( job->error() == 0 ) { - const QString path = Amarok::saveLocation() + "lastfm_image.png"; + const TQString path = Amarok::saveLocation() + "lastfm_image.png"; const int size = AmarokConfig::coverPreviewSize(); - QImage img( static_cast( job )->data() ); + TQImage img( static_cast( job )->data() ); img.smoothScale( size, size ).save( path, "PNG" ); m_metaBundle.lastFmBundle()->setImageUrl( CollectionDB::makeShadowedImage( path, false ) ); @@ -652,11 +652,11 @@ WebService::enableScrobbling( bool enabled ) //SLOT debug() << "Disabling Scrobbling!" << endl; AmarokHttp *http = new AmarokHttp( m_baseHost, 80, this ); - connect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( enableScrobblingFinished( int, bool ) ) ); + connect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( enableScrobblingFinished( int, bool ) ) ); - http->get( QString( m_basePath + "/control.php?session=%1&command=%2&debug=%3" ) + http->get( TQString( m_basePath + "/control.php?session=%1&command=%2&debug=%3" ) .arg( m_session ) - .arg( enabled ? QString( "rtp" ) : QString( "nortp" ) ) + .arg( enabled ? TQString( "rtp" ) : TQString( "nortp" ) ) .arg( "0" ) ); } @@ -676,9 +676,9 @@ void WebService::love() //SLOT { AmarokHttp *http = new AmarokHttp( m_baseHost, 80, this ); - connect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( loveFinished( int, bool ) ) ); + connect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( loveFinished( int, bool ) ) ); - http->get( QString( m_basePath + "/control.php?session=%1&command=love&debug=%2" ) + http->get( TQString( m_basePath + "/control.php?session=%1&command=love&debug=%2" ) .arg( m_session ) .arg( "0" ) ); Amarok::StatusBar::instance()->shortMessage( i18n("love, as in affection", "Loving song...") ); @@ -689,9 +689,9 @@ void WebService::skip() //SLOT { AmarokHttp *http = new AmarokHttp( m_baseHost, 80, this ); - connect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( skipFinished( int, bool ) ) ); + connect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( skipFinished( int, bool ) ) ); - http->get( QString( m_basePath + "/control.php?session=%1&command=skip&debug=%2" ) + http->get( TQString( m_basePath + "/control.php?session=%1&command=skip&debug=%2" ) .arg( m_session ) .arg( "0" ) ); Amarok::StatusBar::instance()->shortMessage( i18n("Skipping song...") ); @@ -702,9 +702,9 @@ void WebService::ban() //SLOT { AmarokHttp *http = new AmarokHttp( m_baseHost, 80, this ); - connect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( banFinished( int, bool ) ) ); + connect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( banFinished( int, bool ) ) ); - http->get( QString( m_basePath + "/control.php?session=%1&command=ban&debug=%2" ) + http->get( TQString( m_basePath + "/control.php?session=%1&command=ban&debug=%2" ) .arg( m_session ) .arg( "0" ) ); Amarok::StatusBar::instance()->shortMessage( i18n("Ban, as in dislike", "Banning song...") ); @@ -754,16 +754,16 @@ WebService::banFinished( int /*id*/, bool error ) //SLOT void -WebService::friends( QString username ) +WebService::friends( TQString username ) { if ( username.isEmpty() ) username = m_username; AmarokHttp *http = new AmarokHttp( m_baseHost, 80, this ); - connect( http, SIGNAL( requestFinished( bool ) ), this, SLOT( friendsFinished( bool ) ) ); + connect( http, TQT_SIGNAL( requestFinished( bool ) ), this, TQT_SLOT( friendsFinished( bool ) ) ); - http->get( QString( "/1.0/user/%1/friends.xml" ) - .arg( QString( QUrl( username ).encodedPathAndQuery() ) ) ); + http->get( TQString( "/1.0/user/%1/friends.xml" ) + .arg( TQString( TQUrl( username ).encodedPathAndQuery() ) ) ); } @@ -774,18 +774,18 @@ WebService::friendsFinished( int /*id*/, bool error ) //SLOT http->deleteLater(); if( error ) return; - QDomDocument document; + TQDomDocument document; document.setContent( http->readAll() ); if ( document.elementsByTagName( "friends" ).length() == 0 ) { - emit friendsResult( QString( "" ), QStringList() ); + emit friendsResult( TQString( "" ), TQStringList() ); return; } - QStringList friends; - QString user = document.elementsByTagName( "friends" ).item( 0 ).attributes().namedItem( "user" ).nodeValue(); - QDomNodeList values = document.elementsByTagName( "user" ); + TQStringList friends; + TQString user = document.elementsByTagName( "friends" ).item( 0 ).attributes().namedItem( "user" ).nodeValue(); + TQDomNodeList values = document.elementsByTagName( "user" ); for ( uint i = 0; i < values.count(); i++ ) { friends << values.item( i ).attributes().namedItem( "username" ).nodeValue(); @@ -796,16 +796,16 @@ WebService::friendsFinished( int /*id*/, bool error ) //SLOT void -WebService::neighbours( QString username ) +WebService::neighbours( TQString username ) { if ( username.isEmpty() ) username = m_username; AmarokHttp *http = new AmarokHttp( m_baseHost, 80, this ); - connect( http, SIGNAL( requestFinished( bool ) ), this, SLOT( neighboursFinished( bool ) ) ); + connect( http, TQT_SIGNAL( requestFinished( bool ) ), this, TQT_SLOT( neighboursFinished( bool ) ) ); - http->get( QString( "/1.0/user/%1/neighbours.xml" ) - .arg( QString( QUrl( username ).encodedPathAndQuery() ) ) ); + http->get( TQString( "/1.0/user/%1/neighbours.xml" ) + .arg( TQString( TQUrl( username ).encodedPathAndQuery() ) ) ); } @@ -816,18 +816,18 @@ WebService::neighboursFinished( int /*id*/, bool error ) //SLOT http->deleteLater(); if( error ) return; - QDomDocument document; + TQDomDocument document; document.setContent( http->readAll() ); if ( document.elementsByTagName( "neighbours" ).length() == 0 ) { - emit friendsResult( QString( "" ), QStringList() ); + emit friendsResult( TQString( "" ), TQStringList() ); return; } - QStringList neighbours; - QString user = document.elementsByTagName( "neighbours" ).item( 0 ).attributes().namedItem( "user" ).nodeValue(); - QDomNodeList values = document.elementsByTagName( "user" ); + TQStringList neighbours; + TQString user = document.elementsByTagName( "neighbours" ).item( 0 ).attributes().namedItem( "user" ).nodeValue(); + TQDomNodeList values = document.elementsByTagName( "user" ); for ( uint i = 0; i < values.count(); i++ ) { neighbours << values.item( i ).attributes().namedItem( "username" ).nodeValue(); @@ -838,16 +838,16 @@ WebService::neighboursFinished( int /*id*/, bool error ) //SLOT void -WebService::userTags( QString username ) +WebService::userTags( TQString username ) { if ( username.isEmpty() ) username = m_username; AmarokHttp *http = new AmarokHttp( m_baseHost, 80, this ); - connect( http, SIGNAL( requestFinished( bool ) ), this, SLOT( userTagsFinished( bool ) ) ); + connect( http, TQT_SIGNAL( requestFinished( bool ) ), this, TQT_SLOT( userTagsFinished( bool ) ) ); - http->get( QString( "/1.0/user/%1/tags.xml?debug=%2" ) - .arg( QString( QUrl( username ).encodedPathAndQuery() ) ) ); + http->get( TQString( "/1.0/user/%1/tags.xml?debug=%2" ) + .arg( TQString( TQUrl( username ).encodedPathAndQuery() ) ) ); } @@ -858,21 +858,21 @@ WebService::userTagsFinished( int /*id*/, bool error ) //SLOT http->deleteLater(); if( error ) return; - QDomDocument document; + TQDomDocument document; document.setContent( http->readAll() ); if ( document.elementsByTagName( "toptags" ).length() == 0 ) { - emit userTagsResult( QString(), QStringList() ); + emit userTagsResult( TQString(), TQStringList() ); return; } - QStringList tags; - QDomNodeList values = document.elementsByTagName( "tag" ); - QString user = document.elementsByTagName( "toptags" ).item( 0 ).attributes().namedItem( "user" ).nodeValue(); + TQStringList tags; + TQDomNodeList values = document.elementsByTagName( "tag" ); + TQString user = document.elementsByTagName( "toptags" ).item( 0 ).attributes().namedItem( "user" ).nodeValue(); for ( uint i = 0; i < values.count(); i++ ) { - QDomNode item = values.item( i ).namedItem( "name" ); + TQDomNode item = values.item( i ).namedItem( "name" ); tags << item.toElement().text(); } emit userTagsResult( user, tags ); @@ -880,16 +880,16 @@ WebService::userTagsFinished( int /*id*/, bool error ) //SLOT void -WebService::recentTracks( QString username ) +WebService::recentTracks( TQString username ) { if ( username.isEmpty() ) username = m_username; AmarokHttp *http = new AmarokHttp( m_baseHost, 80, this ); - connect( http, SIGNAL( requestFinished( bool ) ), this, SLOT( recentTracksFinished( bool ) ) ); + connect( http, TQT_SIGNAL( requestFinished( bool ) ), this, TQT_SLOT( recentTracksFinished( bool ) ) ); - http->get( QString( "/1.0/user/%1/recenttracks.xml" ) - .arg( QString( QUrl( username ).encodedPathAndQuery() ) ) ); + http->get( TQString( "/1.0/user/%1/recenttracks.xml" ) + .arg( TQString( TQUrl( username ).encodedPathAndQuery() ) ) ); } @@ -900,21 +900,21 @@ WebService::recentTracksFinished( int /*id*/, bool error ) //SLOT http->deleteLater(); if( error ) return; - QValueList< QPair > songs; - QDomDocument document; + TQValueList< QPair > songs; + TQDomDocument document; document.setContent( http->readAll() ); if ( document.elementsByTagName( "recenttracks" ).length() == 0 ) { - emit recentTracksResult( QString(), songs ); + emit recentTracksResult( TQString(), songs ); return; } - QDomNodeList values = document.elementsByTagName( "track" ); - QString user = document.elementsByTagName( "recenttracks" ).item( 0 ).attributes().namedItem( "user" ).nodeValue(); + TQDomNodeList values = document.elementsByTagName( "track" ); + TQString user = document.elementsByTagName( "recenttracks" ).item( 0 ).attributes().namedItem( "user" ).nodeValue(); for ( uint i = 0; i < values.count(); i++ ) { - QPair song; + QPair song; song.first = values.item( i ).namedItem( "artist" ).toElement().text(); song.second = values.item( i ).namedItem( "name" ).toElement().text(); @@ -925,43 +925,43 @@ WebService::recentTracksFinished( int /*id*/, bool error ) //SLOT void -WebService::recommend( int type, QString username, QString artist, QString token ) +WebService::recommend( int type, TQString username, TQString artist, TQString token ) { - QString modeToken = ""; + TQString modeToken = ""; switch ( type ) { case 0: - modeToken = QString( "artist_name=%1" ).arg( QString( QUrl( artist ).encodedPathAndQuery() ) ); + modeToken = TQString( "artist_name=%1" ).arg( TQString( TQUrl( artist ).encodedPathAndQuery() ) ); break; case 1: - modeToken = QString( "album_artist=%1&album_name=%2" ) - .arg( QString( QUrl( artist ).encodedPathAndQuery() ) ) - .arg( QString( QUrl( token ).encodedPathAndQuery() ) ); + modeToken = TQString( "album_artist=%1&album_name=%2" ) + .arg( TQString( TQUrl( artist ).encodedPathAndQuery() ) ) + .arg( TQString( TQUrl( token ).encodedPathAndQuery() ) ); break; case 2: - modeToken = QString( "track_artist=%1&track_name=%2" ) - .arg( QString( QUrl( artist ).encodedPathAndQuery() ) ) - .arg( QString( QUrl( token ).encodedPathAndQuery() ) ); + modeToken = TQString( "track_artist=%1&track_name=%2" ) + .arg( TQString( TQUrl( artist ).encodedPathAndQuery() ) ) + .arg( TQString( TQUrl( token ).encodedPathAndQuery() ) ); break; } - QHttp *http = new QHttp( "wsdev.audioscrobbler.com", 80, this ); - connect( http, SIGNAL( requestFinished( bool ) ), this, SLOT( recommendFinished( bool ) ) ); + TQHttp *http = new TQHttp( "wsdev.audioscrobbler.com", 80, this ); + connect( http, TQT_SIGNAL( requestFinished( bool ) ), this, TQT_SLOT( recommendFinished( bool ) ) ); - uint currentTime = QDateTime::currentDateTime( Qt::UTC ).toTime_t(); - QString challenge = QString::number( currentTime ); + uint currentTime = TQDateTime::currentDateTime( Qt::UTC ).toTime_t(); + TQString challenge = TQString::number( currentTime ); - QCString md5pass = KMD5( KMD5( m_password.utf8() ).hexDigest() + currentTime ).hexDigest(); + TQCString md5pass = KMD5( KMD5( m_password.utf8() ).hexDigest() + currentTime ).hexDigest(); - token = QString( "user=%1&auth=%2&nonce=%3recipient=%4" ) - .arg( QString( QUrl( currentUsername() ).encodedPathAndQuery() ) ) - .arg( QString( QUrl( md5pass ).encodedPathAndQuery() ) ) - .arg( QString( QUrl( challenge ).encodedPathAndQuery() ) ) - .arg( QString( QUrl( username ).encodedPathAndQuery() ) ); + token = TQString( "user=%1&auth=%2&nonce=%3recipient=%4" ) + .arg( TQString( TQUrl( currentUsername() ).encodedPathAndQuery() ) ) + .arg( TQString( TQUrl( md5pass ).encodedPathAndQuery() ) ) + .arg( TQString( TQUrl( challenge ).encodedPathAndQuery() ) ) + .arg( TQString( TQUrl( username ).encodedPathAndQuery() ) ); - QHttpRequestHeader header( "POST", "/1.0/rw/recommend.php?" + token.utf8() ); + TQHttpRequestHeader header( "POST", "/1.0/rw/recommend.php?" + token.utf8() ); header.setValue( "Host", "wsdev.audioscrobbler.com" ); header.setContentType( "application/x-www-form-urlencoded" ); http->request( header, modeToken.utf8() ); @@ -979,37 +979,37 @@ WebService::recommendFinished( int /*id*/, bool /*error*/ ) //SLOT QString -WebService::parameter( const QString keyName, const QString data ) const +WebService::parameter( const TQString keyName, const TQString data ) const { - QStringList list = QStringList::split( '\n', data ); + TQStringList list = TQStringList::split( '\n', data ); for ( uint i = 0; i < list.size(); i++ ) { - QStringList values = QStringList::split( '=', list[i] ); + TQStringList values = TQStringList::split( '=', list[i] ); if ( values[0] == keyName ) { values.remove( values.at(0) ); - return QString::fromUtf8( values.join( "=" ).ascii() ); + return TQString::fromUtf8( values.join( "=" ).ascii() ); } } - return QString( "" ); + return TQString( "" ); } QStringList -WebService::parameterArray( const QString keyName, const QString data ) const +WebService::parameterArray( const TQString keyName, const TQString data ) const { - QStringList result; - QStringList list = QStringList::split( '\n', data ); + TQStringList result; + TQStringList list = TQStringList::split( '\n', data ); for ( uint i = 0; i < list.size(); i++ ) { - QStringList values = QStringList::split( '=', list[i] ); + TQStringList values = TQStringList::split( '=', list[i] ); if ( values[0].startsWith( keyName ) ) { values.remove( values.at(0) ); - result.append( QString::fromUtf8( values.join( "=" ).ascii() ) ); + result.append( TQString::fromUtf8( values.join( "=" ).ascii() ) ); } } @@ -1018,18 +1018,18 @@ WebService::parameterArray( const QString keyName, const QString data ) const QStringList -WebService::parameterKeys( const QString keyName, const QString data ) const +WebService::parameterKeys( const TQString keyName, const TQString data ) const { - QStringList result; - QStringList list = QStringList::split( '\n', data ); + TQStringList result; + TQStringList list = TQStringList::split( '\n', data ); for ( uint i = 0; i < list.size(); i++ ) { - QStringList values = QStringList::split( '=', list[i] ); + TQStringList values = TQStringList::split( '=', list[i] ); if ( values[0].startsWith( keyName ) ) { - values = QStringList::split( '[', values[0] ); - values = QStringList::split( ']', values[1] ); + values = TQStringList::split( '[', values[0] ); + values = TQStringList::split( ']', values[1] ); result.append( values[0] ); } } @@ -1039,7 +1039,7 @@ WebService::parameterKeys( const QString keyName, const QString data ) const } void -WebService::showError( int code, QString message ) +WebService::showError( int code, TQString message ) { switch ( code ) { @@ -1084,29 +1084,29 @@ Bundle::Bundle( const Bundle& lhs ) {} void Bundle::detach() { - m_imageUrl = QDeepCopy(m_imageUrl); - m_albumUrl = QDeepCopy(m_albumUrl); - m_artistUrl = QDeepCopy(m_artistUrl); - m_titleUrl = QDeepCopy(m_titleUrl); + m_imageUrl = TQDeepCopy(m_imageUrl); + m_albumUrl = TQDeepCopy(m_albumUrl); + m_artistUrl = TQDeepCopy(m_artistUrl); + m_titleUrl = TQDeepCopy(m_titleUrl); } //////////////////////////////////////////////////////////////////////////////// // CLASS LastFm::LoginDialog //////////////////////////////////////////////////////////////////////////////// -LoginDialog::LoginDialog( QWidget *parent ) - : KDialogBase( parent, "LastfmLogin", true, QString::null, Ok|Cancel) +LoginDialog::LoginDialog( TQWidget *parent ) + : KDialogBase( parent, "LastfmLogin", true, TQString::null, Ok|Cancel) { makeGridMainWidget( 1, Qt::Horizontal ); - new QLabel( i18n( "To use last.fm with Amarok, you need a last.fm profile." ), mainWidget() ); + new TQLabel( i18n( "To use last.fm with Amarok, you need a last.fm profile." ), mainWidget() ); makeGridMainWidget( 2, Qt::Horizontal ); - QLabel *nameLabel = new QLabel( i18n("&Username:"), mainWidget() ); + TQLabel *nameLabel = new TQLabel( i18n("&Username:"), mainWidget() ); m_userLineEdit = new KLineEdit( mainWidget() ); nameLabel->setBuddy( m_userLineEdit ); - QLabel *passLabel = new QLabel( i18n("&Password:"), mainWidget() ); + TQLabel *passLabel = new TQLabel( i18n("&Password:"), mainWidget() ); m_passLineEdit = new KLineEdit( mainWidget() ); - m_passLineEdit->setEchoMode( QLineEdit::Password ); + m_passLineEdit->setEchoMode( TQLineEdit::Password ); passLabel->setBuddy( m_passLineEdit ); m_userLineEdit->setFocus(); @@ -1125,12 +1125,12 @@ void LoginDialog::slotOk() //////////////////////////////////////////////////////////////////////////////// // CLASS LastFm::CustomStationDialog //////////////////////////////////////////////////////////////////////////////// -CustomStationDialog::CustomStationDialog( QWidget *parent ) +CustomStationDialog::CustomStationDialog( TQWidget *parent ) : KDialogBase( parent, "LastfmCustomStation", true, i18n( "Create Custom Station" ) , Ok|Cancel) { makeVBoxMainWidget(); - new QLabel( i18n( "Enter the name of a band or artist you like:" ), mainWidget() ); + new TQLabel( i18n( "Enter the name of a band or artist you like:" ), mainWidget() ); m_edit = new KLineEdit( mainWidget(), "CustomStationEdit" ); m_edit->setFocus(); diff --git a/amarok/src/lastfm.h b/amarok/src/lastfm.h index 1948b2d6..5046da64 100644 --- a/amarok/src/lastfm.h +++ b/amarok/src/lastfm.h @@ -19,11 +19,11 @@ #include "metabundle.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include @@ -31,8 +31,8 @@ class KLineEdit; class KAction; class KProcIO; class KURL; -class QSocket; -class QTimer; +class TQSocket; +class TQTimer; namespace KIO { class Job; } @@ -43,27 +43,27 @@ class AmarokHttp : public QObject Q_OBJECT public: - AmarokHttp ( const QString & hostname, Q_UINT16 port = 80, QObject* parent = 0 ); - int get ( const QString & path ); - QHttp::State state() const; - QByteArray readAll (); - QHttp::Error error(); + AmarokHttp ( const TQString & hostname, Q_UINT16 port = 80, TQObject* parent = 0 ); + int get ( const TQString & path ); + TQHttp::State state() const; + TQByteArray readAll (); + TQHttp::Error error(); signals: void requestFinished ( int id, bool error ); protected slots: - void slotData(KIO::Job*, const QByteArray& ); + void slotData(KIO::Job*, const TQByteArray& ); void slotResult(KIO::Job*); protected: - QString m_hostname; + TQString m_hostname; Q_UINT16 m_port; - QString m_path; - QHttp::State m_state; - QHttp::Error m_error; + TQString m_path; + TQHttp::State m_state; + TQHttp::Error m_error; bool m_done; - QByteArray m_result; + TQByteArray m_result; }; @@ -78,16 +78,16 @@ namespace LastFm public: static Controller* instance(); - KURL getNewProxy( QString genreUrl, bool useProxy ); - int changeStation ( QString url ); + KURL getNewProxy( TQString genreUrl, bool useProxy ); + int changeStation ( TQString url ); bool isPlaying() const { return m_service != 0; } WebService* getService() const { return m_service; } - QString getGenreUrl() const { return m_genreUrl; } + TQString getGenreUrl() const { return m_genreUrl; } static bool checkCredentials(); - static QString createCustomStation(); - static QString stationDescription( QString url = QString::null ); // necessary for translation + static TQString createCustomStation(); + static TQString stationDescription( TQString url = TQString::null ); // necessary for translation public slots: void playbackStopped(); @@ -100,9 +100,9 @@ namespace LastFm void setActionsEnabled( bool enable ); static Controller *s_instance; - QPtrList m_actionList; + TQPtrList m_actionList; - QString m_genreUrl; + TQString m_genreUrl; WebService* m_service; }; @@ -113,45 +113,45 @@ namespace LastFm public: enum DataType { Artist, Album, Track }; - WebService( QObject* parent, bool useProxy ); + WebService( TQObject* parent, bool useProxy ); ~WebService(); - bool handshake( const QString& username, const QString& password ); + bool handshake( const TQString& username, const TQString& password ); - bool changeStation( QString url ); - QString currentUsername() const { return m_username; } - QString currentPassword() const { return m_password; } - QString currentStation() const { return m_station; } - QString session() const { return m_session; } - QUrl streamUrl() const { return m_streamUrl; } + bool changeStation( TQString url ); + TQString currentUsername() const { return m_username; } + TQString currentPassword() const { return m_password; } + TQString currentStation() const { return m_station; } + TQString session() const { return m_session; } + TQUrl streamUrl() const { return m_streamUrl; } - void friends( QString username ); - void neighbours( QString username ); + void friends( TQString username ); + void neighbours( TQString username ); - void recentTracks( QString username ); - void userTags( QString username ); + void recentTracks( TQString username ); + void userTags( TQString username ); - void recommend( int type, QString username, QString artist, QString token = QString() ); + void recommend( int type, TQString username, TQString artist, TQString token = TQString() ); - void recommendArtist( QString username, QString artist ) + void recommendArtist( TQString username, TQString artist ) { recommend( WebService::Artist, username, artist ); } - void recommendAlbum( QString username, QString artist, QString album ) + void recommendAlbum( TQString username, TQString artist, TQString album ) { recommend( WebService::Album, username, artist, album ); } - void recommendTrack( QString username, QString artist, QString track ) + void recommendTrack( TQString username, TQString artist, TQString track ) { recommend( WebService::Track, username, artist, track ); } /** Verify with server that a supplied user/pass combo is valid. Password should be MD5 hashed. **/ - void verifyUser( const QString& user, const QString& pass ); + void verifyUser( const TQString& user, const TQString& pass ); bool cancel(); bool wasCanceled() const { return m_wasCanceled; } - QString proxyUrl() { return m_proxyUrl; } + TQString proxyUrl() { return m_proxyUrl; } public slots: void requestMetaData(); @@ -165,7 +165,7 @@ namespace LastFm void actionStarted(); void actionFinished(); - void stationChanged( QString url, QString name ); + void stationChanged( TQString url, TQString name ); void songQueued(); void metaDataResult( const MetaBundle &bundle ); @@ -175,36 +175,36 @@ namespace LastFm void skipDone(); void banDone(); - void friendsResult( const QString& username, const QStringList& friends ); - void neighboursResult( const QString& username, const QStringList& friends ); + void friendsResult( const TQString& username, const TQStringList& friends ); + void neighboursResult( const TQString& username, const TQStringList& friends ); - void recentTracksResult( const QString& username, QValueList< QPair > songs ); - void userTagsResult( const QString& username, const QStringList& tags ); + void recentTracksResult( const TQString& username, TQValueList< QPair > songs ); + void userTagsResult( const TQString& username, const TQStringList& tags ); private: enum errorCode { E_NOCONTENT = 1, E_NOMEMBERS = 2, E_NOFANS = 3, E_NOAVAIL = 4, E_NOSUBSCRIBER = 5, E_NONEIGHBOURS = 6, E_NOSTOPPED = 7, E_OTHER = 0 }; - void showError( int code, QString message = QString::null ); + void showError( int code, TQString message = TQString::null ); bool m_useProxy; - QString parameter( const QString keyName, const QString data ) const; - QStringList parameterArray( const QString keyName, const QString data ) const; - QStringList parameterKeys( const QString keyName, const QString data ) const; - - QString m_username; // login username - QString m_password; // login password - QString m_station; // the url of the station - QString m_session; // session id that last.fm provides - QString m_baseHost; // who are we connecting to? - QString m_basePath; // where are we connecting to! - QUrl m_streamUrl; // last.fm webserver for direct connection (proxy connects to this) + TQString parameter( const TQString keyName, const TQString data ) const; + TQStringList parameterArray( const TQString keyName, const TQString data ) const; + TQStringList parameterKeys( const TQString keyName, const TQString data ) const; + + TQString m_username; // login username + TQString m_password; // login password + TQString m_station; // the url of the station + TQString m_session; // session id that last.fm provides + TQString m_baseHost; // who are we connecting to? + TQString m_basePath; // where are we connecting to! + TQUrl m_streamUrl; // last.fm webserver for direct connection (proxy connects to this) bool m_subscriber; // self explanatory KProcIO* m_server; - QString m_proxyUrl; + TQString m_proxyUrl; MetaBundle m_metaBundle; bool m_deletionUnsafe; @@ -234,33 +234,33 @@ namespace LastFm public: Bundle() {}; Bundle( const Bundle& bundle); - QString imageUrl() const { return m_imageUrl; } - void setImageUrl( const QString& imageUrl ) { m_imageUrl = imageUrl; } + TQString imageUrl() const { return m_imageUrl; } + void setImageUrl( const TQString& imageUrl ) { m_imageUrl = imageUrl; } - QString artistUrl() const { return m_artistUrl; } - void setArtistUrl( const QString& theValue ) { m_artistUrl = theValue; } + TQString artistUrl() const { return m_artistUrl; } + void setArtistUrl( const TQString& theValue ) { m_artistUrl = theValue; } - QString albumUrl() const { return m_albumUrl; } - void setAlbumUrl( const QString& theValue ) { m_albumUrl = theValue; } + TQString albumUrl() const { return m_albumUrl; } + void setAlbumUrl( const TQString& theValue ) { m_albumUrl = theValue; } - QString titleUrl() const { return m_titleUrl; } - void setTitleUrl( const QString& theValue ) { m_titleUrl = theValue; } + TQString titleUrl() const { return m_titleUrl; } + void setTitleUrl( const TQString& theValue ) { m_titleUrl = theValue; } - void detach(); // for being able to apply QDeepCopy<> + void detach(); // for being able to apply TQDeepCopy<> private: - QString m_imageUrl; - QString m_albumUrl; - QString m_artistUrl; - QString m_titleUrl; + TQString m_imageUrl; + TQString m_albumUrl; + TQString m_artistUrl; + TQString m_titleUrl; }; - // We must implement this because QServerSocket has one pure virtual method. + // We must implement this because TQServerSocket has one pure virtual method. // It's just used for finding a free port. class MyServerSocket : public QServerSocket { public: - MyServerSocket() : QServerSocket( Q_UINT16( 0 ) ) {} + MyServerSocket() : TQServerSocket( Q_UINT16( 0 ) ) {} private: void newConnection( int ) {} @@ -272,7 +272,7 @@ namespace LastFm Q_OBJECT public: - LoginDialog( QWidget *parent ); + LoginDialog( TQWidget *parent ); protected slots: void slotOk(); @@ -288,9 +288,9 @@ namespace LastFm Q_OBJECT public: - CustomStationDialog( QWidget *parent ); + CustomStationDialog( TQWidget *parent ); - QString text() const; + TQString text() const; private: KLineEdit *m_edit; diff --git a/amarok/src/loader/loader.cpp b/amarok/src/loader/loader.cpp index a17584be..ec4b7b17 100644 --- a/amarok/src/loader/loader.cpp +++ b/amarok/src/loader/loader.cpp @@ -18,10 +18,10 @@ #include #include #include "loader.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -37,9 +37,9 @@ int main( int argc, char *argv[] ) { //NOTE this list doesn't include argv[0] ("amarok") - QStringList args; + TQStringList args; for( int i = 1; i < argc; i++ ) - args += QString::fromLocal8Bit(argv[i]); + args += TQString::fromLocal8Bit(argv[i]); const bool isRunning = amarokIsRunning(); @@ -50,26 +50,26 @@ main( int argc, char *argv[] ) { // These arguments cannot be passed to Amarok, or Amarok will exit // after processing them. - QStringList longs; longs + TQStringList longs; longs << "-help" << "-help-qt" << "-help-kde" << "-help-all" << "-author" << "-version" << "-license" << "-v"; // both --arg and -arg are valid { - QStringList longlongs; + TQStringList longlongs; foreach( longs ) - longlongs += QChar('-') + *it; + longlongs += TQChar('-') + *it; longs += longlongs; } foreach( args ) { - const QString arg = *it; + const TQString arg = *it; foreach( longs ) if( arg == *it ) { // this argument cannot be passed to the running amarokapp // or KCmdLineArgs would exit the application - QProcess proc( QString("amarokapp") ); + TQProcess proc( TQString("amarokapp") ); proc.setCommunication( 0 ); //show everything proc.addArgument( arg ); proc.start(); @@ -87,7 +87,7 @@ main( int argc, char *argv[] ) } if ( isRunning ) { - QStringList dcop_args; + TQStringList dcop_args; dcop_args << "dcop" << "amarok" << "player" << "transferCliArgs" << "["; // We transmit our DESKTOP_STARTUP_ID, so amarokapp can stop the startup animation @@ -95,12 +95,12 @@ main( int argc, char *argv[] ) // relative URLs should be interpreted correctly by amarokapp // so we need to pass the current working directory - dcop_args << "--cwd" << QDir::currentDirPath(); + dcop_args << "--cwd" << TQDir::currentDirPath(); dcop_args += args; dcop_args += "]"; - QProcess proc( dcop_args ); + TQProcess proc( dcop_args ); proc.start(); while( proc.isRunning() ) ::usleep( 100 ); @@ -118,7 +118,7 @@ main( int argc, char *argv[] ) bool amarokIsRunning() { - QProcess proc( QString( "dcop" ) ); + TQProcess proc( TQString( "dcop" ) ); proc.start(); while( proc.isRunning() ) ::usleep( 100 ); @@ -134,28 +134,28 @@ amarokIsRunning() static int _argc = 0; -Loader::Loader( QStringList args ) - : QApplication( _argc, 0 ) +Loader::Loader( TQStringList args ) + : TQApplication( _argc, 0 ) , m_counter( 0 ) , m_splash( 0 ) { // we transmit the startup_id, so amarokapp can stop the startup animation - //FIXME QCString str( ::getenv( "DESKTOP_STARTUP_ID" ) ); + //FIXME TQCString str( ::getenv( "DESKTOP_STARTUP_ID" ) ); - if( !QApplication::isSessionRestored()) + if( !TQApplication::isSessionRestored()) { KInstance instance("amarok"); // KGlobal::dirs() crashes without if( isSplashEnabled() ) { - m_splash = new KSplashScreen( QPixmap( KStandardDirs().findResource("data", "amarok/images/splash_screen.jpg"))); + m_splash = new KSplashScreen( TQPixmap( KStandardDirs().findResource("data", "amarok/images/splash_screen.jpg"))); m_splash->show(); } } args.prepend( "amarokapp" ); - m_proc = new QProcess( args, this ); - m_proc->setCommunication( QProcess::Stdout ); + m_proc = new TQProcess( args, this ); + m_proc->setCommunication( TQProcess::Stdout ); std::cout << "Amarok: [Loader] Starting amarokapp..\n"; std::cout << "Amarok: [Loader] Don't run gdb, valgrind, etc. against this binary! Use amarokapp.\n"; @@ -164,11 +164,11 @@ Loader::Loader( QStringList args ) { delete m_splash; // hide the splash - QMessageBox::critical( 0, "Amarok", + TQMessageBox::critical( 0, "Amarok", "Amarok could not be started!\n" //FIXME this needs to be translated "This may be because the amarokapp binary is not in your PATH.\n" "Try locating and running amarokapp from a terminal.", - QMessageBox::Ok, 0 ); + TQMessageBox::Ok, 0 ); std::exit( 1 ); //event-loop is not yet being processed } @@ -178,14 +178,14 @@ Loader::Loader( QStringList args ) Loader::~Loader() { - // must be deleted before QApplication closes our Xserver connection - // thus we cannot make it a child of the QApplication and must + // must be deleted before TQApplication closes our Xserver connection + // thus we cannot make it a child of the TQApplication and must // delete it manually delete m_splash; } void -Loader::timerEvent( QTimerEvent* ) +Loader::timerEvent( TQTimerEvent* ) { if( m_proc->isRunning() ) { @@ -195,19 +195,19 @@ Loader::timerEvent( QTimerEvent* ) while( m_proc->canReadLineStdout() ) if( m_proc->readLineStdout() == "STARTUP" ) - QApplication::exit( 0 ); + TQApplication::exit( 0 ); } else if( !m_proc->normalExit() ) { // no reason to show messagebox, as amarokapp should start drkonqi std::cerr << "Amarok: [Loader] amarokapp probably crashed!\n"; - QApplication::exit( 3 ); + TQApplication::exit( 3 ); } else // if we get here, then either we didn't receive STARTUP through // the pipe, or amarokapp exited normally before the STARTUP was // written to stdout (possibly possible) - QApplication::exit( 0 ); + TQApplication::exit( 0 ); } bool @@ -215,16 +215,16 @@ isSplashEnabled() { //determine whether splash-screen is enabled in amarokrc (void)KGlobal::config(); // the kubuntu special directory is not present without this - QStringList dirs = KGlobal::dirs()->findAllResources( "config", "amarokrc" ); + TQStringList dirs = KGlobal::dirs()->findAllResources( "config", "amarokrc" ); - for( QStringList::iterator path = dirs.begin(); + for( TQStringList::iterator path = dirs.begin(); path != dirs.end(); ++path ) { - QFile file( *path ); + TQFile file( *path ); if ( file.open( IO_ReadOnly ) ) { - QString line; + TQString line; while( file.readLine( line, 2000 ) != -1 ) if ( line.contains( "Show Splashscreen" ) ) { diff --git a/amarok/src/loader/loader.h b/amarok/src/loader/loader.h index e379dc7d..c8ce05d0 100644 --- a/amarok/src/loader/loader.h +++ b/amarok/src/loader/loader.h @@ -18,23 +18,23 @@ #ifndef LOADER_H #define LOADER_H -#include +#include -class QProcess; -class QStringList; +class TQProcess; +class TQStringList; class Loader : public QApplication { public: - Loader( QStringList ); + Loader( TQStringList ); ~Loader(); private: - virtual void timerEvent( QTimerEvent* ); + virtual void timerEvent( TQTimerEvent* ); - QProcess *m_proc; + TQProcess *m_proc; int m_counter; - QWidget *m_splash; + TQWidget *m_splash; static const int INTERVAL = 10; //ms }; @@ -43,6 +43,6 @@ static bool isSplashEnabled(); static bool amarokIsRunning(); #define foreach( x ) \ - for( QStringList::ConstIterator it = x.begin(), end = x.end(); it != end; ++it ) + for( TQStringList::ConstIterator it = x.begin(), end = x.end(); it != end; ++it ) #endif diff --git a/amarok/src/magnatunebrowser/magnatunealbumdownloader.cpp b/amarok/src/magnatunebrowser/magnatunealbumdownloader.cpp index 974c85bd..cb43a7d9 100644 --- a/amarok/src/magnatunebrowser/magnatunealbumdownloader.cpp +++ b/amarok/src/magnatunebrowser/magnatunealbumdownloader.cpp @@ -51,14 +51,14 @@ void MagnatuneAlbumDownloader::downloadAlbum( MagnatuneDownloadInfo * info ) m_albumDownloadJob = KIO::file_copy( downloadUrl, KURL( m_tempDir.name() + m_currentAlbumFileName ), -1, true, false, false ); - connect( m_albumDownloadJob, SIGNAL( result( KIO::Job* ) ), SLOT( albumDownloadComplete( KIO::Job* ) ) ); + connect( m_albumDownloadJob, TQT_SIGNAL( result( KIO::Job* ) ), TQT_SLOT( albumDownloadComplete( KIO::Job* ) ) ); Amarok::StatusBar::instance() ->newProgressOperation( m_albumDownloadJob ) .setDescription( i18n( "Downloading album" ) ) - .setAbortSlot( this, SLOT( albumDownloadAborted() ) ); + .setAbortSlot( this, TQT_SLOT( albumDownloadAborted() ) ); } -void MagnatuneAlbumDownloader::downloadCover( QString albumCoverUrlString, QString fileName ) +void MagnatuneAlbumDownloader::downloadCover( TQString albumCoverUrlString, TQString fileName ) { KURL downloadUrl( albumCoverUrlString ); @@ -66,11 +66,11 @@ void MagnatuneAlbumDownloader::downloadCover( QString albumCoverUrlString, QStri m_albumDownloadJob = KIO::file_copy( downloadUrl, KURL( m_tempDir.name() + fileName ), -1, true, false, false ); - connect( m_albumDownloadJob, SIGNAL( result( KIO::Job* ) ), SLOT( coverDownloadComplete( KIO::Job* ) ) ); + connect( m_albumDownloadJob, TQT_SIGNAL( result( KIO::Job* ) ), TQT_SLOT( coverDownloadComplete( KIO::Job* ) ) ); Amarok::StatusBar::instance() ->newProgressOperation( m_albumDownloadJob ) .setDescription( i18n( "Downloading album cover" ) ) - .setAbortSlot( this, SLOT( coverDownloadAborted() ) ); + .setAbortSlot( this, TQT_SLOT( coverDownloadAborted() ) ); } @@ -90,7 +90,7 @@ void MagnatuneAlbumDownloader::albumDownloadComplete( KIO::Job * downloadJob ) //ok, now we have the .zip file downloaded. All we need is to unpack it to the desired location and add it to the collection. - QString unzipString = "unzip "+ KProcess::quote( m_tempDir.name() + m_currentAlbumFileName) + " -d " +KProcess::quote( m_currentAlbumUnpackLocation ) + " &"; + TQString unzipString = "unzip "+ KProcess::quote( m_tempDir.name() + m_currentAlbumFileName) + " -d " +KProcess::quote( m_currentAlbumUnpackLocation ) + " &"; debug() << "unpacking: " << unzipString << endl; @@ -106,8 +106,8 @@ void MagnatuneAlbumDownloader::albumDownloadComplete( KIO::Job * downloadJob ) MagnatuneAlbum album = MagnatuneDatabaseHandler::instance()->getAlbumById( m_currentAlbumId ); MagnatuneArtist artist = MagnatuneDatabaseHandler::instance()->getArtistById( album.getArtistId() ); - QString finalAlbumPath = m_currentAlbumUnpackLocation + "/" + artist.getName() + "/" + album.getName(); - QString coverUrlString = album.getCoverURL(); + TQString finalAlbumPath = m_currentAlbumUnpackLocation + "/" + artist.getName() + "/" + album.getName(); + TQString coverUrlString = album.getCoverURL(); @@ -117,11 +117,11 @@ void MagnatuneAlbumDownloader::albumDownloadComplete( KIO::Job * downloadJob ) m_albumDownloadJob = KIO::file_copy( downloadUrl, KURL( finalAlbumPath + "/cover.jpg" ), -1, true, false, false ); - connect( m_albumDownloadJob, SIGNAL( result( KIO::Job* ) ), SLOT( coverAddComplete( KIO::Job* ) ) ); + connect( m_albumDownloadJob, TQT_SIGNAL( result( KIO::Job* ) ), TQT_SLOT( coverAddComplete( KIO::Job* ) ) ); Amarok::StatusBar::instance() ->newProgressOperation( m_albumDownloadJob ) .setDescription( i18n( "Adding album cover to collection" ) ) - .setAbortSlot( this, SLOT( coverAddAborted() ) ); + .setAbortSlot( this, TQT_SLOT( coverAddAborted() ) ); } else { diff --git a/amarok/src/magnatunebrowser/magnatunealbumdownloader.h b/amarok/src/magnatunebrowser/magnatunealbumdownloader.h index c247b70a..3ca0b802 100644 --- a/amarok/src/magnatunebrowser/magnatunealbumdownloader.h +++ b/amarok/src/magnatunebrowser/magnatunealbumdownloader.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include /** @@ -41,7 +41,7 @@ public: ~MagnatuneAlbumDownloader(); - void downloadCover( QString albumCoverUrlString, QString fileName ); + void downloadCover( TQString albumCoverUrlString, TQString fileName ); signals: @@ -50,7 +50,7 @@ signals: * @param success true is download completed, false if download was cancelled. */ void downloadComplete(bool success); - void coverDownloadCompleted(QString coverFileName); + void coverDownloadCompleted(TQString coverFileName); public slots: /** @@ -62,8 +62,8 @@ public slots: protected: KIO::FileCopyJob * m_albumDownloadJob; - QString m_currentAlbumUnpackLocation; - QString m_currentAlbumFileName; + TQString m_currentAlbumUnpackLocation; + TQString m_currentAlbumFileName; int m_currentAlbumId; KTempDir m_tempDir; diff --git a/amarok/src/magnatunebrowser/magnatuneartistinfobox.cpp b/amarok/src/magnatunebrowser/magnatuneartistinfobox.cpp index 5bee5752..da56aba1 100644 --- a/amarok/src/magnatunebrowser/magnatuneartistinfobox.cpp +++ b/amarok/src/magnatunebrowser/magnatuneartistinfobox.cpp @@ -23,9 +23,9 @@ #include -#include +#include -MagnatuneArtistInfoBox::MagnatuneArtistInfoBox( QWidget *parentWidget, const char *widgetname ) +MagnatuneArtistInfoBox::MagnatuneArtistInfoBox( TQWidget *parentWidget, const char *widgetname ) : KHTMLPart( parentWidget, widgetname ) {} @@ -39,12 +39,12 @@ MagnatuneArtistInfoBox::displayArtistInfo( KURL url ) debug() << "displayArtistInfo started" << endl; // first get the entire artist html page - QString tempFile; - QString orgHtml; + TQString tempFile; + TQString orgHtml; m_infoDownloadJob = KIO::storedGet( url, false, false ); Amarok::StatusBar::instance() ->newProgressOperation( m_infoDownloadJob ).setDescription( i18n( "Fetching Artist Info" ) ); - connect( m_infoDownloadJob, SIGNAL( result( KIO::Job* ) ), SLOT( infoDownloadComplete( KIO::Job* ) ) ); + connect( m_infoDownloadJob, TQT_SIGNAL( result( KIO::Job* ) ), TQT_SLOT( infoDownloadComplete( KIO::Job* ) ) ); return true; @@ -54,9 +54,9 @@ bool MagnatuneArtistInfoBox::displayAlbumInfo( MagnatuneAlbum *album ) { const MagnatuneArtist artist = MagnatuneDatabaseHandler::instance()->getArtistById( album->getArtistId() ); - const QString artistName = artist.getName(); + const TQString artistName = artist.getName(); - QString infoHtml = ""; infoHtml += "
"; @@ -68,7 +68,7 @@ MagnatuneArtistInfoBox::displayAlbumInfo( MagnatuneAlbum *album ) "\" align=\"middle\" border=\"1\">"; infoHtml += "

Genre: " + album->getMp3Genre(); - infoHtml += "
Release Year: " + QString::number( album->getLaunchDate().year() ); + infoHtml += "
Release Year: " + TQString::number( album->getLaunchDate().year() ); infoHtml += "

From Magnatune.com
"; infoHtml += ""; @@ -94,9 +94,9 @@ MagnatuneArtistInfoBox::infoDownloadComplete( KIO::Job * downLoadJob ) return ; //not the right job, so let's ignore it KIO::StoredTransferJob* const storedJob = static_cast( downLoadJob ); - QString info = QString( storedJob->data() ); + TQString info = TQString( storedJob->data() ); - QString trimmedInfo = extractArtistInfo( info ); + TQString trimmedInfo = extractArtistInfo( info ); //debug() << "html: " << trimmedInfo << endl; @@ -109,10 +109,10 @@ MagnatuneArtistInfoBox::infoDownloadComplete( KIO::Job * downLoadJob ) } -QString -MagnatuneArtistInfoBox::extractArtistInfo( QString artistPage ) +TQString +MagnatuneArtistInfoBox::extractArtistInfo( TQString artistPage ) { - QString trimmedHtml; + TQString trimmedHtml; int sectionStart = artistPage.find( "" ); @@ -133,7 +133,7 @@ MagnatuneArtistInfoBox::extractArtistInfo( QString artistPage ) } - QString infoHtml = ""; infoHtml += trimmedHtml; diff --git a/amarok/src/magnatunebrowser/magnatuneartistinfobox.h b/amarok/src/magnatunebrowser/magnatuneartistinfobox.h index 99c3a850..f730f317 100644 --- a/amarok/src/magnatunebrowser/magnatuneartistinfobox.h +++ b/amarok/src/magnatunebrowser/magnatuneartistinfobox.h @@ -44,7 +44,7 @@ public: * @param widgetname The name of this widget * @return New MagnatuneArtistInfoBox object */ - MagnatuneArtistInfoBox( QWidget *parentWidget, const char *widgetname ); + MagnatuneArtistInfoBox( TQWidget *parentWidget, const char *widgetname ); /** * Destructor @@ -78,7 +78,7 @@ protected: * @param artistPage The artist url * @return A string containing the artist info as html. */ - QString extractArtistInfo( QString artistPage ); + TQString extractArtistInfo( TQString artistPage ); /** * Helper method to reset the scrollbars when loading a new album diff --git a/amarok/src/magnatunebrowser/magnatunebrowser.cpp b/amarok/src/magnatunebrowser/magnatunebrowser.cpp index 3a8ff599..57bfc3f3 100644 --- a/amarok/src/magnatunebrowser/magnatunebrowser.cpp +++ b/amarok/src/magnatunebrowser/magnatunebrowser.cpp @@ -29,38 +29,38 @@ Boston, MA 02110-1301, USA. #include //multiTabBar icons #include -#include -#include -#include +#include +#include +#include MagnatuneBrowser *MagnatuneBrowser::s_instance = 0; MagnatuneBrowser::MagnatuneBrowser( const char *name ) - : QVBox( 0, name ) + : TQVBox( 0, name ) { DEBUG_BLOCK initTopPanel( ); - QSplitter *spliter = new QSplitter( Qt::Vertical, this ); + TQSplitter *spliter = new TQSplitter( Qt::Vertical, this ); debug() << "Magnatune browser starting..." << endl; m_listView = new MagnatuneListView( spliter ); - m_popupMenu = new QPopupMenu( spliter, "MagnatuneMenu" ); + m_popupMenu = new TQPopupMenu( spliter, "MagnatuneMenu" ); m_artistInfobox = new MagnatuneArtistInfoBox( spliter, "ArtistInfoBox" ); initBottomPanel(); - //connect (m_listView, SIGNAL(executed(KListViewItem *)), this, SLOT(itemExecuted(KListViewItem *))); - connect( m_listView, SIGNAL( doubleClicked( QListViewItem * ) ), - this, SLOT( itemExecuted( QListViewItem * ) ) ); - connect( m_listView, SIGNAL( selectionChanged( QListViewItem * ) ), - this, SLOT( selectionChanged( QListViewItem * ) ) ); - connect( m_listView, SIGNAL( rightButtonClicked ( QListViewItem *, const QPoint &, int ) ), - this, SLOT( showPopupMenu( QListViewItem *, const QPoint &, int ) ) ); - connect( m_popupMenu, SIGNAL( aboutToShow() ), - this, SLOT( menuAboutToShow() ) ); + //connect (m_listView, TQT_SIGNAL(executed(KListViewItem *)), this, TQT_SLOT(itemExecuted(KListViewItem *))); + connect( m_listView, TQT_SIGNAL( doubleClicked( TQListViewItem * ) ), + this, TQT_SLOT( itemExecuted( TQListViewItem * ) ) ); + connect( m_listView, TQT_SIGNAL( selectionChanged( TQListViewItem * ) ), + this, TQT_SLOT( selectionChanged( TQListViewItem * ) ) ); + connect( m_listView, TQT_SIGNAL( rightButtonClicked ( TQListViewItem *, const TQPoint &, int ) ), + this, TQT_SLOT( showPopupMenu( TQListViewItem *, const TQPoint &, int ) ) ); + connect( m_popupMenu, TQT_SIGNAL( aboutToShow() ), + this, TQT_SLOT( menuAboutToShow() ) ); m_currentInfoUrl = ""; @@ -73,7 +73,7 @@ MagnatuneBrowser::MagnatuneBrowser( const char *name ) } -void MagnatuneBrowser::itemExecuted( QListViewItem * item ) +void MagnatuneBrowser::itemExecuted( TQListViewItem * item ) { DEBUG_BLOCK; switch ( item->depth() ) @@ -100,7 +100,7 @@ void MagnatuneBrowser::addTrackToPlaylist( MagnatuneTrack *item ) if ( !item ) return ; // sanity check debug() << "Magnatune browser: adding single track" << endl; - QString url = item->getHifiURL(); + TQString url = item->getHifiURL(); Playlist * playlist = Playlist::instance(); playlist->insertMedia( KURL( url ) ); } @@ -130,7 +130,7 @@ void MagnatuneBrowser::addArtistToPlaylist( MagnatuneArtist *item ) addAlbumToPlaylist( &( *it ) ); } -void MagnatuneBrowser::selectionChanged( QListViewItem *item ) +void MagnatuneBrowser::selectionChanged( TQListViewItem *item ) { if ( !item ) return ; // sanity check @@ -190,7 +190,7 @@ void MagnatuneBrowser::selectionChanged( QListViewItem *item ) } } -void MagnatuneBrowser::showPopupMenu( QListViewItem * item, const QPoint & pos, int /*column*/ ) +void MagnatuneBrowser::showPopupMenu( TQListViewItem * item, const TQPoint & pos, int /*column*/ ) { if ( !item ) return ; @@ -199,7 +199,7 @@ void MagnatuneBrowser::showPopupMenu( QListViewItem * item, const QPoint & pos, void MagnatuneBrowser::addSelectionToPlaylist( ) { - QListViewItem * selectedItem = m_listView->selectedItem(); + TQListViewItem * selectedItem = m_listView->selectedItem(); switch ( selectedItem->depth() ) { @@ -218,22 +218,22 @@ void MagnatuneBrowser::menuAboutToShow( ) { m_popupMenu->clear(); - QListViewItem *selectedItem = m_listView->selectedItem(); + TQListViewItem *selectedItem = m_listView->selectedItem(); if ( !selectedItem ) return ; switch ( selectedItem->depth() ) { case 0: - m_popupMenu->insertItem( i18n( "Add artist to playlist" ), this, SLOT( addSelectionToPlaylist() ) ); + m_popupMenu->insertItem( i18n( "Add artist to playlist" ), this, TQT_SLOT( addSelectionToPlaylist() ) ); break; case 1: - m_popupMenu->insertItem( i18n( "Add album to playlist" ), this, SLOT( addSelectionToPlaylist() ) ); - m_popupMenu->insertItem( i18n( "Purchase album" ), this, SLOT( purchaseSelectedAlbum() ) ); + m_popupMenu->insertItem( i18n( "Add album to playlist" ), this, TQT_SLOT( addSelectionToPlaylist() ) ); + m_popupMenu->insertItem( i18n( "Purchase album" ), this, TQT_SLOT( purchaseSelectedAlbum() ) ); break; case 2: - m_popupMenu->insertItem( i18n( "Add track to playlist" ), this, SLOT( addSelectionToPlaylist() ) ); - m_popupMenu->insertItem( i18n( "Purchase album" ), this, SLOT( purchaseAlbumContainingSelectedTrack() ) ); + m_popupMenu->insertItem( i18n( "Add track to playlist" ), this, TQT_SLOT( addSelectionToPlaylist() ) ); + m_popupMenu->insertItem( i18n( "Purchase album" ), this, TQT_SLOT( purchaseAlbumContainingSelectedTrack() ) ); } } @@ -258,7 +258,7 @@ void MagnatuneBrowser::purchaseSelectedAlbum( ) { m_purchaseHandler = new MagnatunePurchaseHandler(); m_purchaseHandler->setParent( this ); - connect( m_purchaseHandler, SIGNAL( purchaseCompleted( bool ) ), this, SLOT( purchaseCompleted( bool ) ) ); + connect( m_purchaseHandler, TQT_SIGNAL( purchaseCompleted( bool ) ), this, TQT_SLOT( purchaseCompleted( bool ) ) ); } MagnatuneListViewAlbumItem *selectedAlbum = dynamic_cast( m_listView->selectedItem() ); @@ -273,7 +273,7 @@ void MagnatuneBrowser::purchaseAlbumContainingSelectedTrack( ) { m_purchaseHandler = new MagnatunePurchaseHandler(); m_purchaseHandler->setParent( this ); - connect( m_purchaseHandler, SIGNAL( purchaseCompleted( bool ) ), this, SLOT( purchaseCompleted( bool ) ) ); + connect( m_purchaseHandler, TQT_SIGNAL( purchaseCompleted( bool ) ), this, TQT_SLOT( purchaseCompleted( bool ) ) ); } MagnatuneListViewTrackItem *selectedTrack = dynamic_cast( m_listView->selectedItem() ); @@ -288,52 +288,52 @@ void MagnatuneBrowser::purchaseAlbumContainingSelectedTrack( ) void MagnatuneBrowser::initTopPanel( ) { - m_topPanel = new QHBox( this, "topPanel", 0 ); + m_topPanel = new TQHBox( this, "topPanel", 0 ); m_topPanel->setMaximumHeight( 24 ); m_topPanel->setSpacing( 2 ); m_topPanel->setMargin( 2 ); - new QLabel ( i18n( "Genre: " ), m_topPanel, "genreLabel", 0 ); + new TQLabel ( i18n( "Genre: " ), m_topPanel, "genreLabel", 0 ); - m_genreComboBox = new QComboBox( false, m_topPanel, "genreComboBox" ); + m_genreComboBox = new TQComboBox( false, m_topPanel, "genreComboBox" ); updateGenreBox(); - m_advancedFeaturesButton = new QPushButton( i18n( "Redownload" ), m_topPanel, "advancedButton" ); - connect( m_advancedFeaturesButton, SIGNAL( clicked() ), this, SLOT( processRedownload() ) ); + m_advancedFeaturesButton = new TQPushButton( i18n( "Redownload" ), m_topPanel, "advancedButton" ); + connect( m_advancedFeaturesButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( processRedownload() ) ); - connect( m_genreComboBox, SIGNAL( activated ( int ) ), this, SLOT( genreChanged() ) ); + connect( m_genreComboBox, TQT_SIGNAL( activated ( int ) ), this, TQT_SLOT( genreChanged() ) ); } void MagnatuneBrowser::initBottomPanel() { - m_bottomPanel = new QVBox( this, "bottomPanel", 0 ); + m_bottomPanel = new TQVBox( this, "bottomPanel", 0 ); m_bottomPanel->setMaximumHeight( 54 ); m_bottomPanel->setSpacing( 2 ); m_bottomPanel->setMargin( 2 ); - QHBox *hBox = new QHBox( m_bottomPanel, "bottomHBox", 0 ); + TQHBox *hBox = new TQHBox( m_bottomPanel, "bottomHBox", 0 ); hBox->setMaximumHeight( 24 ); hBox->setSpacing( 2 ); //hBox->setMargin( 2 ); - m_purchaseAlbumButton = new QPushButton( i18n( "Purchase Album" ), m_bottomPanel, "purchaseButton" ); + m_purchaseAlbumButton = new TQPushButton( i18n( "Purchase Album" ), m_bottomPanel, "purchaseButton" ); m_purchaseAlbumButton->setIconSet( SmallIconSet( Amarok::icon( "download" ) ) ); m_purchaseAlbumButton->setEnabled( false ); m_purchaseAlbumButton->setMaximumHeight( 24 ); - m_updateListButton = new QPushButton( i18n( "Update" ), hBox, "updateButton" ); + m_updateListButton = new TQPushButton( i18n( "Update" ), hBox, "updateButton" ); m_updateListButton->setIconSet( SmallIconSet( Amarok::icon( "rescan" ) ) ); - m_showInfoToggleButton = new QPushButton( i18n( "Show Info" ) , hBox, "showInfoCheckbox" ); + m_showInfoToggleButton = new TQPushButton( i18n( "Show Info" ) , hBox, "showInfoCheckbox" ); m_showInfoToggleButton->setToggleButton( true ); m_showInfoToggleButton->setIconSet( SmallIconSet( Amarok::icon( "info" ) ) ); m_showInfoToggleButton->setOn( true ); m_isInfoShown = true; - connect( m_showInfoToggleButton, SIGNAL( toggled( bool ) ), this, SLOT( showInfo( bool ) ) ); - connect( m_updateListButton, SIGNAL( clicked() ), this, SLOT( updateButtonClicked() ) ); - connect( m_purchaseAlbumButton, SIGNAL( clicked() ) , this, SLOT( purchaseButtonClicked() ) ); + connect( m_showInfoToggleButton, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( showInfo( bool ) ) ); + connect( m_updateListButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( updateButtonClicked() ) ); + connect( m_purchaseAlbumButton, TQT_SIGNAL( clicked() ) , this, TQT_SLOT( purchaseButtonClicked() ) ); } void MagnatuneBrowser::updateButtonClicked() @@ -349,9 +349,9 @@ bool MagnatuneBrowser::updateMagnatuneList() m_listDownloadJob = KIO::storedGet( KURL( "http://magnatune.com/info/album_info.xml" ), false, false ); Amarok::StatusBar::instance() ->newProgressOperation( m_listDownloadJob ) .setDescription( i18n( "Downloading Magnatune.com Database" ) ) - .setAbortSlot( this, SLOT( listDownloadCancelled() ) ); + .setAbortSlot( this, TQT_SLOT( listDownloadCancelled() ) ); - connect( m_listDownloadJob, SIGNAL( result( KIO::Job* ) ), SLOT( listDownloadComplete( KIO::Job* ) ) ); + connect( m_listDownloadJob, TQT_SIGNAL( result( KIO::Job* ) ), TQT_SLOT( listDownloadComplete( KIO::Job* ) ) ); return true; } @@ -372,22 +372,22 @@ void MagnatuneBrowser::listDownloadComplete( KIO::Job * downLoadJob ) KIO::StoredTransferJob* const storedJob = static_cast( downLoadJob ); - QString list = QString( storedJob->data() ); + TQString list = TQString( storedJob->data() ); KTempFile tfile; m_tempFileName = tfile.name(); - QFile file( m_tempFileName ); + TQFile file( m_tempFileName ); if ( file.open( IO_WriteOnly ) ) { - QTextStream stream( &file ); + TQTextStream stream( &file ); stream << list; file.close(); } MagnatuneXmlParser * parser = new MagnatuneXmlParser( m_tempFileName ); - connect( parser, SIGNAL( doneParsing() ), SLOT( doneParsing() ) ); + connect( parser, TQT_SIGNAL( doneParsing() ), TQT_SLOT( doneParsing() ) ); ThreadManager::instance() ->queueJob( parser ); } @@ -423,7 +423,7 @@ void MagnatuneBrowser::updateList() { DEBUG_BLOCK - const QString genre = m_genreComboBox->currentText(); + const TQString genre = m_genreComboBox->currentText(); MagnatuneArtistList artists; artists = MagnatuneDatabaseHandler::instance() ->getArtistsByGenre( genre ); @@ -449,14 +449,14 @@ void MagnatuneBrowser::doneParsing() updateList(); updateGenreBox( ); updateList(); // stupid stupid hack.... - if( !QFile::remove( m_tempFileName ) ) + if( !TQFile::remove( m_tempFileName ) ) debug() << "Couldn't remove temp file at " << m_tempFileName << endl; - m_tempFileName = QString(); + m_tempFileName = TQString(); } void MagnatuneBrowser::updateGenreBox() { - const QStringList genres = MagnatuneDatabaseHandler::instance() ->getAlbumGenres(); + const TQStringList genres = MagnatuneDatabaseHandler::instance() ->getAlbumGenres(); m_genreComboBox->clear(); m_genreComboBox->insertItem ( "All" , 0 ); // should not be i18n'ed as it is diff --git a/amarok/src/magnatunebrowser/magnatunebrowser.h b/amarok/src/magnatunebrowser/magnatunebrowser.h index 1a374308..4f730902 100644 --- a/amarok/src/magnatunebrowser/magnatunebrowser.h +++ b/amarok/src/magnatunebrowser/magnatunebrowser.h @@ -33,12 +33,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include @@ -104,14 +104,14 @@ private slots: * item in the list view. Ads item to playlist. * @param item The item that was double clicked */ - void itemExecuted( QListViewItem * item); + void itemExecuted( TQListViewItem * item); /** * Slot for recieving notification when a new item in the list is selected. * Adds the corrosponding artist or album info to the info view (if visible) * @param item The selected item */ - void selectionChanged( QListViewItem * item); + void selectionChanged( TQListViewItem * item); /** * Slot for recieving notifications about right clicks in the list view. @@ -120,7 +120,7 @@ private slots: * @param pos The position of the cursor at the time of thre right click * @param column The column of the item that was right clicked (unused) */ - void showPopupMenu( QListViewItem * item, const QPoint & pos, int column ); + void showPopupMenu( TQListViewItem * item, const TQPoint & pos, int column ); /** * Slot for recieving notification that the update button has been clicked. @@ -227,24 +227,24 @@ private: MagnatuneListView *m_listView; MagnatuneArtistInfoBox *m_artistInfobox; - QString m_currentInfoUrl; - QPopupMenu *m_popupMenu; + TQString m_currentInfoUrl; + TQPopupMenu *m_popupMenu; MagnatunePurchaseHandler *m_purchaseHandler; MagnatuneRedownloadHandler *m_redownloadHandler; - QHBox *m_topPanel; - QVBox *m_bottomPanel; - QPushButton *m_advancedFeaturesButton; - QPushButton *m_updateListButton; - QPushButton *m_purchaseAlbumButton; - QPushButton *m_showInfoToggleButton; + TQHBox *m_topPanel; + TQVBox *m_bottomPanel; + TQPushButton *m_advancedFeaturesButton; + TQPushButton *m_updateListButton; + TQPushButton *m_purchaseAlbumButton; + TQPushButton *m_showInfoToggleButton; - QComboBox *m_genreComboBox; + TQComboBox *m_genreComboBox; bool m_isInfoShown; bool m_purchaseInProgress; bool m_polished; - QString m_tempFileName; + TQString m_tempFileName; KIO::TransferJob * m_listDownloadJob; }; diff --git a/amarok/src/magnatunebrowser/magnatunedatabasehandler.cpp b/amarok/src/magnatunebrowser/magnatunedatabasehandler.cpp index 48a52599..e66700bc 100644 --- a/amarok/src/magnatunebrowser/magnatunedatabasehandler.cpp +++ b/amarok/src/magnatunebrowser/magnatunedatabasehandler.cpp @@ -48,19 +48,19 @@ MagnatuneDatabaseHandler::createDatabase( ) //Get database instance CollectionDB *db = CollectionDB::instance(); - QString tracksAutoIncrement = ""; - QString albumsAutoIncrement = ""; - QString artistAutoIncrement = ""; + TQString tracksAutoIncrement = ""; + TQString albumsAutoIncrement = ""; + TQString artistAutoIncrement = ""; if ( db->getDbConnectionType() == DbConnection::postgresql ) { - db->query( QString( "CREATE SEQUENCE magnatune_track_seq;" ) ); - db->query( QString( "CREATE SEQUENCE magnatune_album_seq;" ) ); - db->query( QString( "CREATE SEQUENCE magnatune_artist_seq;" ) ); + db->query( TQString( "CREATE SEQUENCE magnatune_track_seq;" ) ); + db->query( TQString( "CREATE SEQUENCE magnatune_album_seq;" ) ); + db->query( TQString( "CREATE SEQUENCE magnatune_artist_seq;" ) ); - tracksAutoIncrement = QString( "DEFAULT nextval('magnatune_track_seq')" ); - albumsAutoIncrement = QString( "DEFAULT nextval('magnatune_album_seq')" ); - artistAutoIncrement = QString( "DEFAULT nextval('magnatune_artist_seq')" ); + tracksAutoIncrement = TQString( "DEFAULT nextval('magnatune_track_seq')" ); + albumsAutoIncrement = TQString( "DEFAULT nextval('magnatune_album_seq')" ); + artistAutoIncrement = TQString( "DEFAULT nextval('magnatune_artist_seq')" ); } else if ( db->getDbConnectionType() == DbConnection::mysql ) @@ -72,7 +72,7 @@ MagnatuneDatabaseHandler::createDatabase( ) } // create table containing tracks - QString queryString = "CREATE TABLE magnatune_tracks (" + TQString queryString = "CREATE TABLE magnatune_tracks (" "id INTEGER PRIMARY KEY " + tracksAutoIncrement + ',' + "name " + db->textColumnType() + ',' + "track_number INTEGER," @@ -85,7 +85,7 @@ MagnatuneDatabaseHandler::createDatabase( ) debug() << "Creating mangnatune_tracks: " << queryString << endl; - QStringList result = db->query( queryString ); + TQStringList result = db->query( queryString ); //Create album table queryString = "CREATE TABLE magnatune_albums (" @@ -121,31 +121,31 @@ void MagnatuneDatabaseHandler::destroyDatabase( ) { CollectionDB *db = CollectionDB::instance(); - QStringList result = db->query( "DROP TABLE magnatune_tracks;" ); + TQStringList result = db->query( "DROP TABLE magnatune_tracks;" ); result = db->query( "DROP TABLE magnatune_albums;" ); result = db->query( "DROP TABLE magnatune_artists;" ); if ( db->getDbConnectionType() == DbConnection::postgresql ) { - db->query( QString( "DROP SEQUENCE magnatune_track_seq;" ) ); - db->query( QString( "DROP SEQUENCE magnatune_album_seq;" ) ); - db->query( QString( "DROP SEQUENCE magnatune_artist_seq;" ) ); + db->query( TQString( "DROP SEQUENCE magnatune_track_seq;" ) ); + db->query( TQString( "DROP SEQUENCE magnatune_album_seq;" ) ); + db->query( TQString( "DROP SEQUENCE magnatune_artist_seq;" ) ); } } int MagnatuneDatabaseHandler::insertTrack( MagnatuneTrack *track, int albumId, int artistId ) { - QString numberString; + TQString numberString; CollectionDB *db = CollectionDB::instance(); - QString queryString = "INSERT INTO magnatune_tracks ( name, track_number, length, " + TQString queryString = "INSERT INTO magnatune_tracks ( name, track_number, length, " "album_id, artist_id, preview_lofi, preview_hifi ) VALUES ( '" + db->escapeString( track->getName() ) + "', " - + QString::number( track->getTrackNumber() ) + ", " - + QString::number( track->getDuration() ) + ", " - + QString::number( albumId ) + ", " - + QString::number( artistId ) + ", '" + + TQString::number( track->getTrackNumber() ) + ", " + + TQString::number( track->getDuration() ) + ", " + + TQString::number( albumId ) + ", " + + TQString::number( artistId ) + ", '" + db->escapeString( track->getLofiURL() ) + "', '" + db->escapeString( track->getHifiURL() ) + "' );"; @@ -158,13 +158,13 @@ MagnatuneDatabaseHandler::insertTrack( MagnatuneTrack *track, int albumId, int a int MagnatuneDatabaseHandler::insertAlbum( MagnatuneAlbum *album, int artistId ) { - QString queryString; + TQString queryString; CollectionDB *db = CollectionDB::instance(); queryString = "INSERT INTO magnatune_albums ( name, year, artist_id, " "genre, album_code, cover_url ) VALUES ( '" + db->escapeString( db->escapeString( album->getName() ) ) + "', " - + QString::number( album->getLaunchDate().year() ) + ", " - + QString::number( artistId ) + ", '" + + TQString::number( album->getLaunchDate().year() ) + ", " + + TQString::number( artistId ) + ", '" + db->escapeString( album->getMp3Genre() ) + "', '" + album->getAlbumCode() + "', '" + db->escapeString( album->getCoverURL() ) + "' );"; @@ -179,7 +179,7 @@ MagnatuneDatabaseHandler::insertAlbum( MagnatuneAlbum *album, int artistId ) int MagnatuneDatabaseHandler::insertArtist( MagnatuneArtist *artist ) { - QString queryString; + TQString queryString; CollectionDB *db = CollectionDB::instance(); queryString = "INSERT INTO magnatune_artists ( name, artist_page, description, " "photo_url ) VALUES ( '" @@ -195,48 +195,48 @@ MagnatuneDatabaseHandler::insertArtist( MagnatuneArtist *artist ) int -MagnatuneDatabaseHandler::getArtistIdByExactName( QString name ) +MagnatuneDatabaseHandler::getArtistIdByExactName( TQString name ) { CollectionDB *db = CollectionDB::instance(); - QString queryString = "SELECT id from magnatune_artists WHERE name='" + db->escapeString( name ) + "';"; - QStringList result = db->query( queryString ); + TQString queryString = "SELECT id from magnatune_artists WHERE name='" + db->escapeString( name ) + "';"; + TQStringList result = db->query( queryString ); //debug() << "Looking for id of artist " << name << ":" << endl; if ( result.size() < 1 ) return -1; int artistId = result.first().toInt(); - //debug() << " Found: " << QString::number( artistId ) << ":" << endl; + //debug() << " Found: " << TQString::number( artistId ) << ":" << endl; return artistId; } -int MagnatuneDatabaseHandler::getAlbumIdByAlbumCode( QString albumcode ) +int MagnatuneDatabaseHandler::getAlbumIdByAlbumCode( TQString albumcode ) { CollectionDB *db = CollectionDB::instance(); - QString queryString = "SELECT id from magnatune_albums WHERE album_code='" + db->escapeString( albumcode ) + "';"; - QStringList result = db->query( queryString ); + TQString queryString = "SELECT id from magnatune_albums WHERE album_code='" + db->escapeString( albumcode ) + "';"; + TQStringList result = db->query( queryString ); //debug() << "Looking for id of album " << albumcode << ":" << endl; if ( result.size() < 1 ) return -1; int albumId = result.first().toInt(); - //debug() << " Found: " << QString::number( albumId ) << ":" << endl; + //debug() << " Found: " << TQString::number( albumId ) << ":" << endl; return albumId; } MagnatuneArtistList -MagnatuneDatabaseHandler::getArtistsByGenre( QString genre ) +MagnatuneDatabaseHandler::getArtistsByGenre( TQString genre ) { - QString genreSql = ""; + TQString genreSql = ""; if ( genre != "All" ) { @@ -245,7 +245,7 @@ MagnatuneDatabaseHandler::getArtistsByGenre( QString genre ) CollectionDB *db = CollectionDB::instance(); - QString queryString; + TQString queryString; queryString = "SELECT DISTINCT magnatune_artists.id, " "magnatune_artists.name, magnatune_artists.artist_page, " "magnatune_artists.description, magnatune_artists.photo_url " @@ -253,7 +253,7 @@ MagnatuneDatabaseHandler::getArtistsByGenre( QString genre ) "WHERE " + genreSql + "magnatune_albums.artist_id " "= magnatune_artists.id;"; - QStringList result = db->query( queryString ); + TQStringList result = db->query( queryString ); debug() << "Looking for artist in genre: " << genre << endl; @@ -287,10 +287,10 @@ MagnatuneDatabaseHandler::getArtistsByGenre( QString genre ) } MagnatuneAlbumList -MagnatuneDatabaseHandler::getAlbumsByArtistId( int id, QString genre ) +MagnatuneDatabaseHandler::getAlbumsByArtistId( int id, TQString genre ) { - QString genreSqlString; + TQString genreSqlString; if ( genre.isEmpty() ) { @@ -303,19 +303,19 @@ MagnatuneDatabaseHandler::getAlbumsByArtistId( int id, QString genre ) CollectionDB *db = CollectionDB::instance(); - QString queryString; + TQString queryString; queryString = "SELECT DISTINCT id, " "name, year, " "artist_id, genre, " "album_code, cover_url " "FROM magnatune_albums " - "WHERE artist_id = '" + QString::number( id ) + '\''; + "WHERE artist_id = '" + TQString::number( id ) + '\''; queryString += genreSqlString; queryString += ';'; - QStringList result = db->query( queryString ); + TQStringList result = db->query( queryString ); MagnatuneAlbumList list; @@ -333,7 +333,7 @@ MagnatuneDatabaseHandler::getAlbumsByArtistId( int id, QString genre ) album.setName( result.front() ); result.pop_front(); - album.setLaunchDate( QDate( result.front().toInt(), 1, 1 ) ); + album.setLaunchDate( TQDate( result.front().toInt(), 1, 1 ) ); result.pop_front(); album.setArtistId( result.front().toInt() ); @@ -362,16 +362,16 @@ MagnatuneDatabaseHandler::getTracksByAlbumId( int id ) CollectionDB *db = CollectionDB::instance(); - QString queryString; + TQString queryString; queryString = "SELECT DISTINCT id, " "name, track_number, " "length, album_id, " "artist_id, preview_lofi, " "preview_hifi " "FROM magnatune_tracks " - "WHERE album_id = '" + QString::number( id ) + "';"; + "WHERE album_id = '" + TQString::number( id ) + "';"; - QStringList result = db->query( queryString ); + TQStringList result = db->query( queryString ); MagnatuneTrackList list; @@ -418,13 +418,13 @@ MagnatuneDatabaseHandler::getTracksByAlbumId( int id ) } -QStringList +TQStringList MagnatuneDatabaseHandler::getAlbumGenres( ) { CollectionDB *db = CollectionDB::instance(); - QString queryString; + TQString queryString; queryString = "SELECT DISTINCT genre " "FROM magnatune_albums " "ORDER BY genre;"; @@ -438,7 +438,7 @@ MagnatuneDatabaseHandler::begin( ) CollectionDB *db = CollectionDB::instance(); - QString queryString = "BEGIN;"; + TQString queryString = "BEGIN;"; db->query( queryString ); } @@ -447,7 +447,7 @@ void MagnatuneDatabaseHandler::commit( ) { CollectionDB *db = CollectionDB::instance(); - QString queryString = "COMMIT;"; + TQString queryString = "COMMIT;"; db->query( queryString ); @@ -459,14 +459,14 @@ MagnatuneDatabaseHandler::getArtistById( int id ) CollectionDB *db = CollectionDB::instance(); - QString queryString; + TQString queryString; queryString = "SELECT id, " "name, artist_page, " "description, photo_url " "FROM magnatune_artists " - "WHERE id = '" + QString::number( id ) + "';"; + "WHERE id = '" + TQString::number( id ) + "';"; - QStringList result = db->query( queryString ); + TQStringList result = db->query( queryString ); MagnatuneArtist artist; @@ -501,15 +501,15 @@ MagnatuneDatabaseHandler::getAlbumById( int id ) CollectionDB *db = CollectionDB::instance(); - QString queryString; + TQString queryString; queryString = "SELECT id, " "name, year, " "artist_id, genre, " "album_code, cover_url " "FROM magnatune_albums " - "WHERE id = '" + QString::number( id ) + "';"; + "WHERE id = '" + TQString::number( id ) + "';"; - QStringList result = db->query( queryString ); + TQStringList result = db->query( queryString ); MagnatuneAlbum album; @@ -522,7 +522,7 @@ MagnatuneDatabaseHandler::getAlbumById( int id ) album.setName( result.front() ); result.pop_front(); - album.setLaunchDate( QDate( result.front().toInt(), 1, 1 ) ); + album.setLaunchDate( TQDate( result.front().toInt(), 1, 1 ) ); result.pop_front(); album.setArtistId( result.front().toInt() ); diff --git a/amarok/src/magnatunebrowser/magnatunedatabasehandler.h b/amarok/src/magnatunebrowser/magnatunedatabasehandler.h index 76d8e98c..f9af8e7c 100644 --- a/amarok/src/magnatunebrowser/magnatunedatabasehandler.h +++ b/amarok/src/magnatunebrowser/magnatunedatabasehandler.h @@ -23,7 +23,7 @@ #include "collectiondb.h" #include "magnatunetypes.h" -#include +#include /** @@ -84,7 +84,7 @@ public: * @param name artist name to retrieve * @return id of artist. -1 if no artist is found */ - int getArtistIdByExactName(QString name); + int getArtistIdByExactName(TQString name); /** @@ -92,7 +92,7 @@ public: * @param albumcode The album code. * @return The id of the album, -1 if not foud. */ - int getAlbumIdByAlbumCode( QString albumcode ); + int getAlbumIdByAlbumCode( TQString albumcode ); /** * Returns all artist that has albums in a given genre. If an artist has both a Rock @@ -100,7 +100,7 @@ public: * @param genre the genre * @return A list of artist in the genre */ - MagnatuneArtistList getArtistsByGenre(QString genre); + MagnatuneArtistList getArtistsByGenre(TQString genre); /** * Returns the artist with a given id @@ -122,7 +122,7 @@ public: * @param genre Limits the albums to a specific genre. Use "All" to get all albums * @return List of albums. empty if none are found */ - MagnatuneAlbumList getAlbumsByArtistId(int id, QString genre); + MagnatuneAlbumList getAlbumsByArtistId(int id, TQString genre); /** * Retrieves all tracks on a given album @@ -142,7 +142,7 @@ public: * Retrieves a list of all genres present in the databse * @return A list of genres */ - QStringList getAlbumGenres(); + TQStringList getAlbumGenres(); /** * Begins a database transaction. Must be followed by a later call to commit() diff --git a/amarok/src/magnatunebrowser/magnatunedownloaddialog.cpp b/amarok/src/magnatunebrowser/magnatunedownloaddialog.cpp index 2c13f56c..6959139e 100644 --- a/amarok/src/magnatunebrowser/magnatunedownloaddialog.cpp +++ b/amarok/src/magnatunebrowser/magnatunedownloaddialog.cpp @@ -24,12 +24,12 @@ Boston, MA 02110-1301, USA. #include #include -#include -#include -#include +#include +#include +#include -MagnatuneDownloadDialog::MagnatuneDownloadDialog( QWidget *parent, const char *name, bool modal, WFlags fl ) +MagnatuneDownloadDialog::MagnatuneDownloadDialog( TQWidget *parent, const char *name, bool modal, WFlags fl ) : MagnatuneDownloadDialogBase( parent, name, modal, fl ) { downloadTargetURLRequester->fileDialog() ->setMode( KFile::Directory ); diff --git a/amarok/src/magnatunebrowser/magnatunedownloaddialog.h b/amarok/src/magnatunebrowser/magnatunedownloaddialog.h index 726900d2..6ecba1fc 100644 --- a/amarok/src/magnatunebrowser/magnatunedownloaddialog.h +++ b/amarok/src/magnatunebrowser/magnatunedownloaddialog.h @@ -23,7 +23,7 @@ #include "magnatunedownloaddialogbase.h" #include "magnatunedownloadinfo.h" -#include +#include /** @@ -38,12 +38,12 @@ class MagnatuneDownloadDialog : public MagnatuneDownloadDialogBase public: /** * Overridden constructor. - * @param parent Pointer to the parent QWidget. + * @param parent Pointer to the parent TQWidget. * @param name Name of this widget. * @param modal Sets modal state. * @param fl Additional dialog flags. */ - MagnatuneDownloadDialog( QWidget* parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 ); + MagnatuneDownloadDialog( TQWidget* parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 ); /** * Destructor diff --git a/amarok/src/magnatunebrowser/magnatunedownloadinfo.cpp b/amarok/src/magnatunebrowser/magnatunedownloadinfo.cpp index 7671ce27..828c1cf3 100644 --- a/amarok/src/magnatunebrowser/magnatunedownloadinfo.cpp +++ b/amarok/src/magnatunebrowser/magnatunedownloadinfo.cpp @@ -23,11 +23,11 @@ #include "debug.h" -#include +#include MagnatuneDownloadInfo::MagnatuneDownloadInfo() { - m_selectedDownloadFormat = QString::null; + m_selectedDownloadFormat = TQString::null; m_albumId = -1; } @@ -35,14 +35,14 @@ MagnatuneDownloadInfo::MagnatuneDownloadInfo() MagnatuneDownloadInfo::~MagnatuneDownloadInfo() {} -bool MagnatuneDownloadInfo::initFromFile( QString downloadInfoFileName ) +bool MagnatuneDownloadInfo::initFromFile( TQString downloadInfoFileName ) { - QString xml; + TQString xml; - QFile file( downloadInfoFileName ); + TQFile file( downloadInfoFileName ); if ( file.open( IO_ReadOnly ) ) { - QTextStream stream( &file ); + TQTextStream stream( &file ); while ( !stream.atEnd() ) { xml += (stream.readLine() + '\n'); @@ -58,7 +58,7 @@ bool MagnatuneDownloadInfo::initFromFile( QString downloadInfoFileName ) return initFromString( xml ); } -bool MagnatuneDownloadInfo::initFromString( QString downloadInfoString ) +bool MagnatuneDownloadInfo::initFromString( TQString downloadInfoString ) { //complete overkill to do a full SAX2 parser for this at the moment... I think.... @@ -197,17 +197,17 @@ bool MagnatuneDownloadInfo::initFromString( QString downloadInfoString ) return true; } -QString MagnatuneDownloadInfo::getUserName( ) +TQString MagnatuneDownloadInfo::getUserName( ) { return m_userName; } -QString MagnatuneDownloadInfo::getPassword( ) +TQString MagnatuneDownloadInfo::getPassword( ) { return m_password; } -QString MagnatuneDownloadInfo::getDownloadMessage( ) +TQString MagnatuneDownloadInfo::getDownloadMessage( ) { return m_downloadMessage; } @@ -217,7 +217,7 @@ DownloadFormatMap MagnatuneDownloadInfo::getFormatMap() return m_downloadFormats; } -void MagnatuneDownloadInfo::setFormatSelection( QString selectedFormat ) +void MagnatuneDownloadInfo::setFormatSelection( TQString selectedFormat ) { m_selectedDownloadFormat = selectedFormat; } @@ -229,7 +229,7 @@ bool MagnatuneDownloadInfo::isReadyForDownload( ) KURL MagnatuneDownloadInfo::getCompleteDownloadUrl( ) { - QString url = m_downloadFormats[ m_selectedDownloadFormat ]; + TQString url = m_downloadFormats[ m_selectedDownloadFormat ]; KURL downloadUrl(url); downloadUrl.setUser(m_userName); downloadUrl.setPass(m_password); @@ -237,12 +237,12 @@ KURL MagnatuneDownloadInfo::getCompleteDownloadUrl( ) return downloadUrl; } -void MagnatuneDownloadInfo::setUnpackUrl( QString unpackUrl ) +void MagnatuneDownloadInfo::setUnpackUrl( TQString unpackUrl ) { m_unpackUrl = unpackUrl; } -QString MagnatuneDownloadInfo::getUnpackLocation( ) +TQString MagnatuneDownloadInfo::getUnpackLocation( ) { return m_unpackUrl; } diff --git a/amarok/src/magnatunebrowser/magnatunedownloadinfo.h b/amarok/src/magnatunebrowser/magnatunedownloadinfo.h index 3e22d709..50fa4016 100644 --- a/amarok/src/magnatunebrowser/magnatunedownloadinfo.h +++ b/amarok/src/magnatunebrowser/magnatunedownloadinfo.h @@ -23,11 +23,11 @@ #include -#include -#include +#include +#include -typedef QMap DownloadFormatMap; +typedef TQMap DownloadFormatMap; /** Class for parsing and storing the info from a download xml file or string @@ -39,37 +39,37 @@ public: MagnatuneDownloadInfo(); ~MagnatuneDownloadInfo(); - bool initFromString( QString downloadInfoString ); - bool initFromFile( QString downloadInfoFileName ); + bool initFromString( TQString downloadInfoString ); + bool initFromFile( TQString downloadInfoFileName ); DownloadFormatMap getFormatMap(); - QString getUserName(); - QString getPassword(); - QString getDownloadMessage(); + TQString getUserName(); + TQString getPassword(); + TQString getDownloadMessage(); int getAlbumId(); - void setFormatSelection(QString selectedFormat); - void setUnpackUrl(QString unpackUrl); + void setFormatSelection(TQString selectedFormat); + void setUnpackUrl(TQString unpackUrl); void setAlbumId(int id); bool isReadyForDownload(); KURL getCompleteDownloadUrl(); - QString getUnpackLocation(); + TQString getUnpackLocation(); protected: DownloadFormatMap m_downloadFormats; - QString m_userName; - QString m_password; - QString m_downloadMessage; + TQString m_userName; + TQString m_password; + TQString m_downloadMessage; int m_albumId; //the following members are for storing the user selections regarding a download - QString m_unpackUrl; - QString m_selectedDownloadFormat; + TQString m_unpackUrl; + TQString m_selectedDownloadFormat; }; diff --git a/amarok/src/magnatunebrowser/magnatunelistview.cpp b/amarok/src/magnatunebrowser/magnatunelistview.cpp index cf4bef3c..3ea8a167 100644 --- a/amarok/src/magnatunebrowser/magnatunelistview.cpp +++ b/amarok/src/magnatunebrowser/magnatunelistview.cpp @@ -24,9 +24,9 @@ #include #include -#include +#include -MagnatuneListView::MagnatuneListView( QWidget * parent ) +MagnatuneListView::MagnatuneListView( TQWidget * parent ) : KListView( parent ) { @@ -34,8 +34,8 @@ MagnatuneListView::MagnatuneListView( QWidget * parent ) addColumn( i18n( "Artist/Album/Track" ) ); addColumn( i18n( "Duration" ) ); - setColumnWidthMode( 0, QListView::Maximum ); - setResizeMode( QListView::LastColumn ); + setColumnWidthMode( 0, TQListView::Maximum ); + setResizeMode( TQListView::LastColumn ); setShowSortIndicator ( true ); diff --git a/amarok/src/magnatunebrowser/magnatunelistview.h b/amarok/src/magnatunebrowser/magnatunelistview.h index cb716215..2a7f7391 100644 --- a/amarok/src/magnatunebrowser/magnatunelistview.h +++ b/amarok/src/magnatunebrowser/magnatunelistview.h @@ -34,7 +34,7 @@ A specialized KListView that provides drag and drop functionality class MagnatuneListView : public KListView { public: - MagnatuneListView(QWidget * parent); + MagnatuneListView(TQWidget * parent); ~MagnatuneListView(); diff --git a/amarok/src/magnatunebrowser/magnatunelistviewitems.cpp b/amarok/src/magnatunebrowser/magnatunelistviewitems.cpp index 48992884..8ce1046c 100644 --- a/amarok/src/magnatunebrowser/magnatunelistviewitems.cpp +++ b/amarok/src/magnatunebrowser/magnatunelistviewitems.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include @@ -146,7 +146,7 @@ MagnatuneListViewTrackItem::MagnatuneListViewTrackItem( MagnatuneTrack track, KL { int trackNumber = track.getTrackNumber(); - QString trackNumberString = QString::number( trackNumber ); + TQString trackNumberString = TQString::number( trackNumber ); if (trackNumber < 10) trackNumberString = '0' + trackNumberString; @@ -154,9 +154,9 @@ MagnatuneListViewTrackItem::MagnatuneListViewTrackItem( MagnatuneTrack track, KL KListViewItem::setText( 0, trackNumberString + " - " + track.getName() ); - debug() << "track duration: " << QString::number( track.getDuration() ) << endl; + debug() << "track duration: " << TQString::number( track.getDuration() ) << endl; - QTime duration; + TQTime duration; duration = duration.addSecs(track.getDuration()); if (duration.hour() == 0) diff --git a/amarok/src/magnatunebrowser/magnatunepurchasedialog.cpp b/amarok/src/magnatunebrowser/magnatunepurchasedialog.cpp index 440f405e..aeaa6843 100644 --- a/amarok/src/magnatunebrowser/magnatunepurchasedialog.cpp +++ b/amarok/src/magnatunebrowser/magnatunepurchasedialog.cpp @@ -21,15 +21,15 @@ #include "magnatunedatabasehandler.h" #include "magnatunepurchasedialog.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -MagnatunePurchaseDialog::MagnatunePurchaseDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) +MagnatunePurchaseDialog::MagnatunePurchaseDialog( TQWidget* parent, const char* name, bool modal, WFlags fl ) : magnatunePurchaseDialogBase( parent, name, modal, fl ) {} @@ -45,7 +45,7 @@ void MagnatunePurchaseDialog::setAlbum( const MagnatuneAlbum &album ) MagnatuneArtist artist = MagnatuneDatabaseHandler::instance()->getArtistById( album.getArtistId() ); artistEdit->setText( artist.getName() ); genresEdit->setText( album.getMp3Genre() ); - launchDateEdit->setText( QString::number( album.getLaunchDate().year() ) ); + launchDateEdit->setText( TQString::number( album.getLaunchDate().year() ) ); m_albumCode = album.getAlbumCode(); @@ -85,49 +85,49 @@ bool MagnatunePurchaseDialog::verifyEntries( ) // check all the entries for validity //cc number: - QString ccString = ccEdit->text(); + TQString ccString = ccEdit->text(); ccString.stripWhiteSpace (); - QRegExp ccExp( "^[\\d]{10,20}$" ); + TQRegExp ccExp( "^[\\d]{10,20}$" ); if ( !ccExp.exactMatch( ccString ) ) { - QMessageBox::information( this, "Invalid credit card number", + TQMessageBox::information( this, "Invalid credit card number", "The credit card number entered does not appear to be valid\n" ); return false; } //email - QString emailString = emailEdit->text(); + TQString emailString = emailEdit->text(); emailString.stripWhiteSpace (); - QRegExp emailExp( "^\\S+@\\S+\\.\\S+$" ); + TQRegExp emailExp( "^\\S+@\\S+\\.\\S+$" ); if ( !emailExp.exactMatch( emailString ) ) { - QMessageBox::information( this, "Invalid email", + TQMessageBox::information( this, "Invalid email", "The email address entered does not appear to be valid\n" ); return false; } //month - QString monthString = expMonthEdit->text(); + TQString monthString = expMonthEdit->text(); monthString.stripWhiteSpace (); - QRegExp monthExp( "^\\d{2}$" ); + TQRegExp monthExp( "^\\d{2}$" ); if ( !monthExp.exactMatch( monthString ) ) { - QMessageBox::information( this, "Invalid expiration month", + TQMessageBox::information( this, "Invalid expiration month", "The credit card expiration month does not appear to be valid\n" ); return false; } //month - QString yearString = expYearEdit->text(); + TQString yearString = expYearEdit->text(); yearString.stripWhiteSpace (); - QRegExp yearExp( "^\\d{2}$" ); + TQRegExp yearExp( "^\\d{2}$" ); if ( !yearExp.exactMatch( yearString ) ) { - QMessageBox::information( this, "Invalid expiration month", + TQMessageBox::information( this, "Invalid expiration month", "The credit card expiration year does not appear to be valid\n" ); return false; } @@ -140,9 +140,9 @@ bool MagnatunePurchaseDialog::verifyEntries( ) } -void MagnatunePurchaseDialog::setCover( QString coverFile ) +void MagnatunePurchaseDialog::setCover( TQString coverFile ) { - coverPixmapLabel->setPixmap( QPixmap( coverFile ) ); + coverPixmapLabel->setPixmap( TQPixmap( coverFile ) ); } diff --git a/amarok/src/magnatunebrowser/magnatunepurchasedialog.h b/amarok/src/magnatunebrowser/magnatunepurchasedialog.h index d87941c3..a10af868 100644 --- a/amarok/src/magnatunebrowser/magnatunepurchasedialog.h +++ b/amarok/src/magnatunebrowser/magnatunepurchasedialog.h @@ -31,12 +31,12 @@ public: /** * Overridden constructor. - * @param parent Pointer to the parent QWidget. + * @param parent Pointer to the parent TQWidget. * @param name Name of this widget. * @param modal Sets modal state. * @param fl Additional dialog flags. */ - MagnatunePurchaseDialog( QWidget* parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 ); + MagnatunePurchaseDialog( TQWidget* parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 ); /** * Destructor @@ -55,7 +55,7 @@ public: * Loads image into the cover label. * @param coverFile image file to load. */ - void setCover( QString coverFile ); + void setCover( TQString coverFile ); signals: @@ -71,7 +71,7 @@ signals: * @param albumCode The album code of the album. * @param amount The amount to pay (in us $) */ - void makePurchase( QString ccNumber, QString expYear, QString expMonth, QString name, QString email, QString albumCode, int amount ); + void makePurchase( TQString ccNumber, TQString expYear, TQString expMonth, TQString name, TQString email, TQString albumCode, int amount ); /** * Signal emitted if purchase operation is cancelled @@ -84,7 +84,7 @@ public slots: private: /*$PRIVATE_FUNCTIONS$*/ - QString m_albumCode; + TQString m_albumCode; /** * Helper function to verify that all entries are valid. diff --git a/amarok/src/magnatunebrowser/magnatunepurchasehandler.cpp b/amarok/src/magnatunebrowser/magnatunepurchasehandler.cpp index 6c04147d..fbfed0ba 100644 --- a/amarok/src/magnatunebrowser/magnatunepurchasehandler.cpp +++ b/amarok/src/magnatunebrowser/magnatunepurchasehandler.cpp @@ -25,12 +25,12 @@ Boston, MA 02110-1301, USA. #include -#include -#include -#include +#include +#include +#include MagnatunePurchaseHandler::MagnatunePurchaseHandler() - : QObject() + : TQObject() { m_downloadDialog = 0; @@ -55,12 +55,12 @@ void MagnatunePurchaseHandler::purchaseAlbum( const MagnatuneAlbum &album ) //Then we can show it on the purchase dialog as well as put it in the //same directory as the album. - QString albumCoverUrlString = album.getCoverURL(); + TQString albumCoverUrlString = album.getCoverURL(); if ( m_albumDownloader == 0 ) { m_albumDownloader = new MagnatuneAlbumDownloader(); - connect( m_albumDownloader, SIGNAL( coverDownloadCompleted( QString ) ), this, SLOT( showPurchaseDialog( QString ) ) ); + connect( m_albumDownloader, TQT_SIGNAL( coverDownloadCompleted( TQString ) ), this, TQT_SLOT( showPurchaseDialog( TQString ) ) ); } m_currentAlbumCoverName = album.getName() + " - cover.jpg"; @@ -70,7 +70,7 @@ void MagnatunePurchaseHandler::purchaseAlbum( const MagnatuneAlbum &album ) } -void MagnatunePurchaseHandler::showPurchaseDialog( QString coverTempLocation ) +void MagnatunePurchaseHandler::showPurchaseDialog( TQString coverTempLocation ) { if ( m_albumDownloader != 0 ) @@ -83,8 +83,8 @@ void MagnatunePurchaseHandler::showPurchaseDialog( QString coverTempLocation ) { m_purchaseDialog = new MagnatunePurchaseDialog( m_parent, "PurchaseDialog", true, 0 ); - connect( m_purchaseDialog, SIGNAL( makePurchase( QString, QString, QString, QString, QString, QString, int ) ), this, SLOT( processPayment( QString, QString, QString, QString, QString, QString, int ) ) ); - connect ( m_purchaseDialog, SIGNAL( cancelled() ), this, SLOT( albumPurchaseCancelled() ) ); + connect( m_purchaseDialog, TQT_SIGNAL( makePurchase( TQString, TQString, TQString, TQString, TQString, TQString, int ) ), this, TQT_SLOT( processPayment( TQString, TQString, TQString, TQString, TQString, TQString, int ) ) ); + connect ( m_purchaseDialog, TQT_SIGNAL( cancelled() ), this, TQT_SLOT( albumPurchaseCancelled() ) ); } @@ -101,20 +101,20 @@ void MagnatunePurchaseHandler::showPurchaseDialog( QString coverTempLocation ) } } -void MagnatunePurchaseHandler::processPayment( QString ccNumber, QString expYear, QString expMonth, QString name, QString email, QString albumCode, int amount ) +void MagnatunePurchaseHandler::processPayment( TQString ccNumber, TQString expYear, TQString expMonth, TQString name, TQString email, TQString albumCode, int amount ) { - QString amountString; + TQString amountString; amountString.setNum( amount, 10 ); - QString purchaseURL = "https://magnatune.com/buy/buy_dl_cc_xml?cc=" + ccNumber + "&mm=" + expMonth + "&yy=" + expYear + "&sku=" + albumCode + "&name=" + name + "&email=" + email + "&id=amarok&amount=" + amountString; + TQString purchaseURL = "https://magnatune.com/buy/buy_dl_cc_xml?cc=" + ccNumber + "&mm=" + expMonth + "&yy=" + expYear + "&sku=" + albumCode + "&name=" + name + "&email=" + email + "&id=amarok&amount=" + amountString; - QString debugPurchaseURL = "https://magnatune.com/buy/buy_dl_cc_xml?cc=**********&mm=**&yy=**&sku=" + albumCode + "&name=" + name + "&email=********&id=amarok&amount=" + amountString; + TQString debugPurchaseURL = "https://magnatune.com/buy/buy_dl_cc_xml?cc=**********&mm=**&yy=**&sku=" + albumCode + "&name=" + name + "&email=********&id=amarok&amount=" + amountString; debug() << "purchase url : " << debugPurchaseURL << endl; m_resultDownloadJob = KIO::storedGet( KURL( purchaseURL ), false, false ); Amarok::StatusBar::instance() ->newProgressOperation( m_resultDownloadJob ).setDescription( i18n( "Processing Payment" ) ); - connect( m_resultDownloadJob, SIGNAL( result( KIO::Job* ) ), SLOT( xmlDownloadComplete( KIO::Job* ) ) ); + connect( m_resultDownloadJob, TQT_SIGNAL( result( KIO::Job* ) ), TQT_SLOT( xmlDownloadComplete( KIO::Job* ) ) ); } @@ -133,7 +133,7 @@ void MagnatunePurchaseHandler::xmlDownloadComplete( KIO::Job * downloadJob ) return ; //not the right job, so let's ignore it KIO::StoredTransferJob* const storedJob = static_cast( downloadJob ); - QString resultXml = QString( storedJob->data() ); + TQString resultXml = TQString( storedJob->data() ); debug() << endl << endl << "result: " << resultXml << endl << endl; @@ -141,13 +141,13 @@ void MagnatunePurchaseHandler::xmlDownloadComplete( KIO::Job * downloadJob ) if ( m_albumDownloader == 0 ) { m_albumDownloader = new MagnatuneAlbumDownloader(); - connect( m_albumDownloader, SIGNAL( downloadComplete( bool ) ), this, SLOT( albumDownloadComplete( bool ) ) ); + connect( m_albumDownloader, TQT_SIGNAL( downloadComplete( bool ) ), this, TQT_SLOT( albumDownloadComplete( bool ) ) ); } if ( m_downloadDialog == 0 ) { m_downloadDialog = new MagnatuneDownloadDialog( m_parent, "downloaddialog", true, 0 ); - connect( m_downloadDialog, SIGNAL( downloadAlbum( MagnatuneDownloadInfo * ) ), m_albumDownloader, SLOT( downloadAlbum( MagnatuneDownloadInfo * ) ) ); + connect( m_downloadDialog, TQT_SIGNAL( downloadAlbum( MagnatuneDownloadInfo * ) ), m_albumDownloader, TQT_SLOT( downloadAlbum( MagnatuneDownloadInfo * ) ) ); } @@ -171,23 +171,23 @@ void MagnatunePurchaseHandler::xmlDownloadComplete( KIO::Job * downloadJob ) else { - QMessageBox::information( m_parent, "Could not process payment", + TQMessageBox::information( m_parent, "Could not process payment", "There seems to be an error in the information entered (check the credit card number), please try again\n" ); m_purchaseDialog->setEnabled( true ); } } -void MagnatunePurchaseHandler::setParent( QWidget * parent ) +void MagnatunePurchaseHandler::setParent( TQWidget * parent ) { m_parent = parent; } -void MagnatunePurchaseHandler::saveDownloadInfo( QString infoXml ) +void MagnatunePurchaseHandler::saveDownloadInfo( TQString infoXml ) { - QDir purchaseDir( Amarok::saveLocation( "magnatune.com/purchases/" ) ); + TQDir purchaseDir( Amarok::saveLocation( "magnatune.com/purchases/" ) ); debug() << "magnatune save location" << purchaseDir.absPath() << endl; @@ -199,10 +199,10 @@ void MagnatunePurchaseHandler::saveDownloadInfo( QString infoXml ) //Create file name MagnatuneArtist artist = MagnatuneDatabaseHandler::instance() ->getArtistById( m_currentAlbum.getArtistId() ); - QString artistName = artist.getName(); - QString fileName = artistName + " - " + m_currentAlbum.getName(); + TQString artistName = artist.getName(); + TQString fileName = artistName + " - " + m_currentAlbum.getName(); - QFile file( purchaseDir.absPath() + "/" + fileName ); + TQFile file( purchaseDir.absPath() + "/" + fileName ); //Skip if file already exists if ( file.exists () ) @@ -211,7 +211,7 @@ void MagnatunePurchaseHandler::saveDownloadInfo( QString infoXml ) //write info if ( file.open( IO_WriteOnly ) ) { - QTextStream stream( &file ); + TQTextStream stream( &file ); stream << infoXml << "\n"; file.close(); } diff --git a/amarok/src/magnatunebrowser/magnatunepurchasehandler.h b/amarok/src/magnatunebrowser/magnatunepurchasehandler.h index a1bf10b9..9889c66f 100644 --- a/amarok/src/magnatunebrowser/magnatunepurchasehandler.h +++ b/amarok/src/magnatunebrowser/magnatunepurchasehandler.h @@ -20,7 +20,7 @@ #ifndef MAGNATUNEPURCHASEHANDLER_H #define MAGNATUNEPURCHASEHANDLER_H -#include +#include #include #include @@ -42,7 +42,7 @@ public: MagnatunePurchaseHandler(); ~MagnatunePurchaseHandler(); - void setParent( QWidget * parent ); + void setParent( TQWidget * parent ); /** * Starts a purchase operation * @param album The album to purchase @@ -58,14 +58,14 @@ private: //need a parent to pass to any dialogs we spawn - QWidget * m_parent; + TQWidget * m_parent; MagnatunePurchaseDialog * m_purchaseDialog; MagnatuneDownloadDialog * m_downloadDialog; MagnatuneAlbumDownloader * m_albumDownloader; MagnatuneAlbum m_currentAlbum; - QString m_currentAlbumCoverName; + TQString m_currentAlbumCoverName; - bool parseDownloadXml( QString xml ); + bool parseDownloadXml( TQString xml ); /** * This function saves the xml download info received from Magnatune.com after a @@ -76,19 +76,19 @@ private: * is genereated from the artist and album names. * @param infoXml The info to store. */ - void saveDownloadInfo(QString infoXml); + void saveDownloadInfo(TQString infoXml); protected slots: - void showPurchaseDialog( QString coverTempLocation ); + void showPurchaseDialog( TQString coverTempLocation ); void xmlDownloadComplete( KIO::Job* downLoadJob ); void albumDownloadComplete(bool success); void albumPurchaseCancelled(); public slots: - void processPayment( QString ccNumber, QString expYear, QString expMonth, QString name, QString email, QString albumCode, int amount ); + void processPayment( TQString ccNumber, TQString expYear, TQString expMonth, TQString name, TQString email, TQString albumCode, int amount ); diff --git a/amarok/src/magnatunebrowser/magnatuneredownloaddialog.cpp b/amarok/src/magnatunebrowser/magnatuneredownloaddialog.cpp index fc9f5aa4..5d7c1417 100644 --- a/amarok/src/magnatunebrowser/magnatuneredownloaddialog.cpp +++ b/amarok/src/magnatunebrowser/magnatuneredownloaddialog.cpp @@ -20,26 +20,26 @@ #include "magnatuneredownloaddialog.h" -#include +#include #include -MagnatuneRedownloadDialog::MagnatuneRedownloadDialog(QWidget* parent, const char* name, bool modal, WFlags fl) +MagnatuneRedownloadDialog::MagnatuneRedownloadDialog(TQWidget* parent, const char* name, bool modal, WFlags fl) : magnatuneReDownloadDialogBase(parent,name, modal,fl) { redownloadButton->setEnabled ( false ); - redownloadListView->setColumnWidthMode( 0, QListView::Manual ); - redownloadListView->setResizeMode( QListView::LastColumn ); + redownloadListView->setColumnWidthMode( 0, TQListView::Manual ); + redownloadListView->setResizeMode( TQListView::LastColumn ); } MagnatuneRedownloadDialog::~MagnatuneRedownloadDialog() { } -void MagnatuneRedownloadDialog::setRedownloadItems( QStringList items ) +void MagnatuneRedownloadDialog::setRedownloadItems( TQStringList items ) { - for ( QStringList::Iterator it = items.begin(); it != items.end(); ++it ) { + for ( TQStringList::Iterator it = items.begin(); it != items.end(); ++it ) { new KListViewItem(redownloadListView, (*it)); } diff --git a/amarok/src/magnatunebrowser/magnatuneredownloaddialog.h b/amarok/src/magnatunebrowser/magnatuneredownloaddialog.h index aaf51fd9..b42e61a1 100644 --- a/amarok/src/magnatunebrowser/magnatuneredownloaddialog.h +++ b/amarok/src/magnatunebrowser/magnatuneredownloaddialog.h @@ -23,22 +23,22 @@ #include "magnatuneredownloaddialogbase.h" -#include +#include class MagnatuneRedownloadDialog : public magnatuneReDownloadDialogBase { Q_OBJECT public: - MagnatuneRedownloadDialog( QWidget* parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 ); + MagnatuneRedownloadDialog( TQWidget* parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 ); ~MagnatuneRedownloadDialog(); /*$PUBLIC_FUNCTIONS$*/ - void setRedownloadItems(QStringList items); + void setRedownloadItems(TQStringList items); signals: - void redownload(QString downloadInfoFileName); + void redownload(TQString downloadInfoFileName); void cancelled(); public slots: diff --git a/amarok/src/magnatunebrowser/magnatuneredownloadhandler.cpp b/amarok/src/magnatunebrowser/magnatuneredownloadhandler.cpp index a64819bf..d801267e 100644 --- a/amarok/src/magnatunebrowser/magnatuneredownloadhandler.cpp +++ b/amarok/src/magnatunebrowser/magnatuneredownloadhandler.cpp @@ -24,13 +24,13 @@ #include "debug.h" -#include "qdir.h" -#include "qmessagebox.h" +#include "tqdir.h" +#include "tqmessagebox.h" #include -MagnatuneRedownloadHandler::MagnatuneRedownloadHandler(QWidget * parent) +MagnatuneRedownloadHandler::MagnatuneRedownloadHandler(TQWidget * parent) { m_parent = parent; m_redownloadDialog = 0; @@ -46,20 +46,20 @@ MagnatuneRedownloadHandler::~MagnatuneRedownloadHandler() void MagnatuneRedownloadHandler::showRedownloadDialog( ) { - QStringList previousDownloads = GetPurchaseList(); + TQStringList previousDownloads = GetPurchaseList(); if (previousDownloads.isEmpty()) { //No previously purchased track information found. No more to do here... - QMessageBox::information( m_parent, i18n( "No purchases found!" ) , + TQMessageBox::information( m_parent, i18n( "No purchases found!" ) , i18n( "No previous purchases have been found. Nothing to redownload..." ) + "\n" ); return; } if (m_redownloadDialog == 0) { m_redownloadDialog = new MagnatuneRedownloadDialog( m_parent ); - connect( m_redownloadDialog, SIGNAL( redownload( QString) ), this, SLOT( redownload( QString ) ) ); - connect( m_redownloadDialog, SIGNAL(cancelled() ), this, SLOT( selectionDialogCancelled() )); + connect( m_redownloadDialog, TQT_SIGNAL( redownload( TQString) ), this, TQT_SLOT( redownload( TQString ) ) ); + connect( m_redownloadDialog, TQT_SIGNAL(cancelled() ), this, TQT_SLOT( selectionDialogCancelled() )); } @@ -69,18 +69,18 @@ void MagnatuneRedownloadHandler::showRedownloadDialog( ) } -QStringList MagnatuneRedownloadHandler::GetPurchaseList( ) +TQStringList MagnatuneRedownloadHandler::GetPurchaseList( ) { - QDir purchaseInfoDir( Amarok::saveLocation( "magnatune.com/purchases/" ) ); + TQDir purchaseInfoDir( Amarok::saveLocation( "magnatune.com/purchases/" ) ); - purchaseInfoDir.setFilter( QDir::Files); - purchaseInfoDir.setSorting( QDir::Name ); + purchaseInfoDir.setFilter( TQDir::Files); + purchaseInfoDir.setSorting( TQDir::Name ); - const QFileInfoList *list = purchaseInfoDir.entryInfoList(); - QFileInfoListIterator it( *list ); - QFileInfo *fi; + const TQFileInfoList *list = purchaseInfoDir.entryInfoList(); + TQFileInfoListIterator it( *list ); + TQFileInfo *fi; - QStringList returnList; + TQStringList returnList; while ( (fi = it.current()) != 0 ) { returnList.append(fi->fileName()); @@ -91,24 +91,24 @@ QStringList MagnatuneRedownloadHandler::GetPurchaseList( ) } -void MagnatuneRedownloadHandler::redownload( QString storedInfoFileName ) +void MagnatuneRedownloadHandler::redownload( TQString storedInfoFileName ) { - QDir purchaseInfoDir( Amarok::saveLocation( "magnatune.com/purchases/" ) ); - QString absFileName = purchaseInfoDir.absPath() + '/' + storedInfoFileName; + TQDir purchaseInfoDir( Amarok::saveLocation( "magnatune.com/purchases/" ) ); + TQString absFileName = purchaseInfoDir.absPath() + '/' + storedInfoFileName; debug() << "Redownload file: " << absFileName << endl; if ( m_albumDownloader == 0 ) { m_albumDownloader = new MagnatuneAlbumDownloader(); - connect( m_albumDownloader, SIGNAL( downloadComplete( bool ) ), this, SLOT( albumDownloadComplete( bool ) ) ); + connect( m_albumDownloader, TQT_SIGNAL( downloadComplete( bool ) ), this, TQT_SLOT( albumDownloadComplete( bool ) ) ); } if (m_downloadDialog == 0) { m_downloadDialog = new MagnatuneDownloadDialog(m_parent); - connect( m_downloadDialog, SIGNAL( downloadAlbum( MagnatuneDownloadInfo * ) ), m_albumDownloader, SLOT( downloadAlbum( MagnatuneDownloadInfo * ) ) ); + connect( m_downloadDialog, TQT_SIGNAL( downloadAlbum( MagnatuneDownloadInfo * ) ), m_albumDownloader, TQT_SLOT( downloadAlbum( MagnatuneDownloadInfo * ) ) ); } @@ -123,7 +123,7 @@ void MagnatuneRedownloadHandler::redownload( QString storedInfoFileName ) else { - QMessageBox::information( m_parent, i18n( "Could not re-download album" ), + TQMessageBox::information( m_parent, i18n( "Could not re-download album" ), i18n( "There seems to be a problem with the selected redownload info file." ) + "\n" ); } diff --git a/amarok/src/magnatunebrowser/magnatuneredownloadhandler.h b/amarok/src/magnatunebrowser/magnatuneredownloadhandler.h index d7328895..8d981047 100644 --- a/amarok/src/magnatunebrowser/magnatuneredownloadhandler.h +++ b/amarok/src/magnatunebrowser/magnatuneredownloadhandler.h @@ -25,7 +25,7 @@ #include "magnatunedownloadinfo.h" #include "magnatuneredownloaddialog.h" -#include +#include /** This class handles the redownloading of previously purchased albums @@ -33,10 +33,10 @@ This class handles the redownloading of previously purchased albums @author Nikolaj Hald Nielsen */ -class MagnatuneRedownloadHandler : public QObject { +class MagnatuneRedownloadHandler : public TQObject { Q_OBJECT public: - MagnatuneRedownloadHandler(QWidget * parent); + MagnatuneRedownloadHandler(TQWidget * parent); ~MagnatuneRedownloadHandler(); @@ -51,15 +51,15 @@ signals: protected: - QWidget * m_parent; - QStringList GetPurchaseList( ); + TQWidget * m_parent; + TQStringList GetPurchaseList( ); MagnatuneRedownloadDialog * m_redownloadDialog; MagnatuneDownloadDialog * m_downloadDialog; MagnatuneAlbumDownloader * m_albumDownloader; protected slots: - void redownload(QString storedInfoFileName); + void redownload(TQString storedInfoFileName); void selectionDialogCancelled(); void albumDownloadComplete( bool success ); diff --git a/amarok/src/magnatunebrowser/magnatunetypes.cpp b/amarok/src/magnatunebrowser/magnatunetypes.cpp index eac3b6b0..4705cf05 100644 --- a/amarok/src/magnatunebrowser/magnatunetypes.cpp +++ b/amarok/src/magnatunebrowser/magnatunetypes.cpp @@ -39,42 +39,42 @@ int MagnatuneArtist::getId( ) const return m_id; } -void MagnatuneArtist::setName( QString name ) +void MagnatuneArtist::setName( TQString name ) { m_name = name; } -QString MagnatuneArtist::getName( ) const +TQString MagnatuneArtist::getName( ) const { return m_name; } -void MagnatuneArtist::setDescription( QString description ) +void MagnatuneArtist::setDescription( TQString description ) { m_description = description; } -QString MagnatuneArtist::getDescription( ) const +TQString MagnatuneArtist::getDescription( ) const { return m_description; } -void MagnatuneArtist::setPhotoURL( QString photoURL ) +void MagnatuneArtist::setPhotoURL( TQString photoURL ) { m_photoURL = photoURL; } -QString MagnatuneArtist::getPhotoURL( ) const +TQString MagnatuneArtist::getPhotoURL( ) const { return m_photoURL; } -void MagnatuneArtist::setHomeURL( QString homeURL ) +void MagnatuneArtist::setHomeURL( TQString homeURL ) { m_homeURL = homeURL; } -QString MagnatuneArtist::getHomeURL( ) const +TQString MagnatuneArtist::getHomeURL( ) const { return m_homeURL; } @@ -115,62 +115,62 @@ int MagnatuneAlbum::getArtistId( ) const } -void MagnatuneAlbum::setName( QString name ) +void MagnatuneAlbum::setName( TQString name ) { m_name = name; } -QString MagnatuneAlbum::getName( ) const +TQString MagnatuneAlbum::getName( ) const { return m_name; } -void MagnatuneAlbum::setCoverURL( QString coverURL ) +void MagnatuneAlbum::setCoverURL( TQString coverURL ) { m_coverURL = coverURL; } -QString MagnatuneAlbum::getCoverURL( ) const +TQString MagnatuneAlbum::getCoverURL( ) const { return m_coverURL; } -void MagnatuneAlbum::setLaunchDate( QDate launchDate ) +void MagnatuneAlbum::setLaunchDate( TQDate launchDate ) { m_launchDate = launchDate; } -QDate MagnatuneAlbum::getLaunchDate( ) const +TQDate MagnatuneAlbum::getLaunchDate( ) const { return m_launchDate; } -void MagnatuneAlbum::setAlbumCode( QString albumCode ) +void MagnatuneAlbum::setAlbumCode( TQString albumCode ) { m_albumCode = albumCode; } -QString MagnatuneAlbum::getAlbumCode( ) const +TQString MagnatuneAlbum::getAlbumCode( ) const { return m_albumCode; } -void MagnatuneAlbum::setMp3Genre( QString mp3Genre ) +void MagnatuneAlbum::setMp3Genre( TQString mp3Genre ) { m_mp3Genre = mp3Genre; } -QString MagnatuneAlbum::getMp3Genre( ) const +TQString MagnatuneAlbum::getMp3Genre( ) const { return m_mp3Genre; } -void MagnatuneAlbum::setMagnatuneGenres( QString magnatuneGenres ) +void MagnatuneAlbum::setMagnatuneGenres( TQString magnatuneGenres ) { m_magnatuneGenres = magnatuneGenres; } -QString MagnatuneAlbum::getMagnatuneGenres( ) const +TQString MagnatuneAlbum::getMagnatuneGenres( ) const { return m_magnatuneGenres; } @@ -226,12 +226,12 @@ int MagnatuneTrack::getAlbumId( ) const -void MagnatuneTrack::setName( QString name ) +void MagnatuneTrack::setName( TQString name ) { m_name = name; } -QString MagnatuneTrack::getName( ) const +TQString MagnatuneTrack::getName( ) const { return m_name; } @@ -256,22 +256,22 @@ int MagnatuneTrack::getDuration( ) const return m_duration; } -void MagnatuneTrack::setHifiURL( QString hifiURL ) +void MagnatuneTrack::setHifiURL( TQString hifiURL ) { m_hifiURL = hifiURL; } -QString MagnatuneTrack::getHifiURL( ) const +TQString MagnatuneTrack::getHifiURL( ) const { return m_hifiURL; } -void MagnatuneTrack::setLofiURL( QString lofiURL ) +void MagnatuneTrack::setLofiURL( TQString lofiURL ) { m_lofiURL = lofiURL; } -QString MagnatuneTrack::getLofiURL( ) const +TQString MagnatuneTrack::getLofiURL( ) const { return m_lofiURL; } diff --git a/amarok/src/magnatunebrowser/magnatunetypes.h b/amarok/src/magnatunebrowser/magnatunetypes.h index d11bef8e..fd87944b 100644 --- a/amarok/src/magnatunebrowser/magnatunetypes.h +++ b/amarok/src/magnatunebrowser/magnatunetypes.h @@ -21,9 +21,9 @@ #define MAGNATUNETYPES_H -#include -#include -#include +#include +#include +#include @@ -32,11 +32,11 @@ class MagnatuneArtist private: int m_id; - QString m_name; - QString m_genre; - QString m_description; - QString m_photoURL; - QString m_homeURL; + TQString m_name; + TQString m_genre; + TQString m_description; + TQString m_photoURL; + TQString m_homeURL; public: MagnatuneArtist(); @@ -44,17 +44,17 @@ public: void setId( int id ); int getId() const; - void setName( QString name ); - QString getName() const; + void setName( TQString name ); + TQString getName() const; - void setDescription( QString description ); - QString getDescription() const; + void setDescription( TQString description ); + TQString getDescription() const; - void setPhotoURL( QString photoURL ); - QString getPhotoURL() const; + void setPhotoURL( TQString photoURL ); + TQString getPhotoURL() const; - void setHomeURL( QString homeURL ); - QString getHomeURL() const; + void setHomeURL( TQString homeURL ); + TQString getHomeURL() const; }; @@ -62,12 +62,12 @@ class MagnatuneAlbum { private: int m_id; - QString m_name; - QString m_coverURL; - QDate m_launchDate; - QString m_albumCode; - QString m_mp3Genre; - QString m_magnatuneGenres; + TQString m_name; + TQString m_coverURL; + TQDate m_launchDate; + TQString m_albumCode; + TQString m_mp3Genre; + TQString m_magnatuneGenres; int m_artistId; public: @@ -76,23 +76,23 @@ public: void setId( int id ); int getId() const; - void setName( QString name ); - QString getName() const; + void setName( TQString name ); + TQString getName() const; - void setCoverURL( QString coverURL ); - QString getCoverURL() const; + void setCoverURL( TQString coverURL ); + TQString getCoverURL() const; - void setLaunchDate( QDate launchDate ); - QDate getLaunchDate() const; + void setLaunchDate( TQDate launchDate ); + TQDate getLaunchDate() const; - void setAlbumCode( QString albumCode ); - QString getAlbumCode() const; + void setAlbumCode( TQString albumCode ); + TQString getAlbumCode() const; - void setMp3Genre( QString mp3Genre ); - QString getMp3Genre() const; + void setMp3Genre( TQString mp3Genre ); + TQString getMp3Genre() const; - void setMagnatuneGenres( QString magnatuneGenres ); - QString getMagnatuneGenres() const; + void setMagnatuneGenres( TQString magnatuneGenres ); + TQString getMagnatuneGenres() const; void setArtistId( int artistId ); int getArtistId() const; @@ -104,11 +104,11 @@ class MagnatuneTrack { private: int m_id; - QString m_name; + TQString m_name; int m_trackNumber; int m_duration; - QString m_hifiURL; - QString m_lofiURL; + TQString m_hifiURL; + TQString m_lofiURL; int m_albumId; int m_artistId; @@ -118,8 +118,8 @@ public: void setId( int id ); int getId() const; - void setName( QString name ); - QString getName() const; + void setName( TQString name ); + TQString getName() const; void setTrackNumber( int trackNumber ); int getTrackNumber() const; @@ -127,11 +127,11 @@ public: void setDuration( int duration ); int getDuration() const; - void setHifiURL( QString hifiURL ); - QString getHifiURL() const; + void setHifiURL( TQString hifiURL ); + TQString getHifiURL() const; - void setLofiURL( QString lofiURL ); - QString getLofiURL() const; + void setLofiURL( TQString lofiURL ); + TQString getLofiURL() const; void setAlbumId( int albumId ); int getAlbumId() const; @@ -140,8 +140,8 @@ public: int getArtistId() const; }; -typedef QValueList MagnatuneArtistList; -typedef QValueList MagnatuneAlbumList; -typedef QValueList MagnatuneTrackList; +typedef TQValueList MagnatuneArtistList; +typedef TQValueList MagnatuneAlbumList; +typedef TQValueList MagnatuneTrackList; #endif diff --git a/amarok/src/magnatunebrowser/magnatunexmlparser.cpp b/amarok/src/magnatunebrowser/magnatunexmlparser.cpp index bff65ab7..ea17966c 100644 --- a/amarok/src/magnatunebrowser/magnatunexmlparser.cpp +++ b/amarok/src/magnatunebrowser/magnatunexmlparser.cpp @@ -24,7 +24,7 @@ #include "statusbar.h" -MagnatuneXmlParser::MagnatuneXmlParser( QString filename ) +MagnatuneXmlParser::MagnatuneXmlParser( TQString filename ) : ThreadManager::Job( "MagnatuneXmlParser" ) { m_currentArtist = ""; @@ -56,15 +56,15 @@ MagnatuneXmlParser::completeJob( ) } void -MagnatuneXmlParser::readConfigFile( QString filename ) +MagnatuneXmlParser::readConfigFile( TQString filename ) { m_nNumberOfTracks = 0; m_nNumberOfAlbums = 0; m_nNumberOfArtists = 0; - QDomDocument doc( "config" ); + TQDomDocument doc( "config" ); - QFile file( filename ); + TQFile file( filename ); if ( !file.open( IO_ReadOnly ) ) return ; if ( !doc.setContent( &file ) ) @@ -79,7 +79,7 @@ MagnatuneXmlParser::readConfigFile( QString filename ) MagnatuneDatabaseHandler::instance() ->createDatabase(); //run through all the elements - QDomElement docElem = doc.documentElement(); + TQDomElement docElem = doc.documentElement(); MagnatuneDatabaseHandler::instance() ->begin(); //start transaction (MAJOR speedup!!) @@ -91,9 +91,9 @@ MagnatuneXmlParser::readConfigFile( QString filename ) void -MagnatuneXmlParser::parseElement( QDomElement e ) +MagnatuneXmlParser::parseElement( TQDomElement e ) { - QString sElementName = e.tagName(); + TQString sElementName = e.tagName(); sElementName == "Album" ? parseAlbum( e ) : @@ -102,9 +102,9 @@ MagnatuneXmlParser::parseElement( QDomElement e ) void -MagnatuneXmlParser::parseChildren( QDomElement e ) +MagnatuneXmlParser::parseChildren( TQDomElement e ) { - QDomNode n = e.firstChild(); + TQDomNode n = e.firstChild(); while ( !n.isNull() ) { @@ -116,15 +116,15 @@ MagnatuneXmlParser::parseChildren( QDomElement e ) } void -MagnatuneXmlParser::parseAlbum( QDomElement e ) +MagnatuneXmlParser::parseAlbum( TQDomElement e ) { m_pCurrentAlbum = new MagnatuneAlbum(); m_pCurrentArtist = new MagnatuneArtist(); - QString sElementName; + TQString sElementName; - QDomNode n = e.firstChild(); - QDomElement childElement; + TQDomNode n = e.firstChild(); + TQDomElement childElement; while ( !n.isNull() ) { @@ -132,7 +132,7 @@ MagnatuneXmlParser::parseAlbum( QDomElement e ) { childElement = n.toElement(); - QString sElementName = childElement.tagName(); + TQString sElementName = childElement.tagName(); if ( sElementName == "albumname" ) @@ -148,8 +148,8 @@ MagnatuneXmlParser::parseAlbum( QDomElement e ) else if ( sElementName == "launchdate" ) { - QString dateString = childElement.text(); - QDate date = QDate::fromString( dateString, Qt::ISODate ); + TQString dateString = childElement.text(); + TQDate date = TQDate::fromString( dateString, Qt::ISODate ); m_pCurrentAlbum->setLaunchDate( date ); } @@ -223,21 +223,21 @@ MagnatuneXmlParser::parseAlbum( QDomElement e ) void -MagnatuneXmlParser::parseTrack( QDomElement e ) +MagnatuneXmlParser::parseTrack( TQDomElement e ) { - QString trackName; - QString trackNumber; - QString streamingUrl; + TQString trackName; + TQString trackNumber; + TQString streamingUrl; - QString sElementName; - QDomElement childElement; + TQString sElementName; + TQDomElement childElement; MagnatuneTrack currentTrack; - QDomNode n = e.firstChild(); + TQDomNode n = e.firstChild(); while ( !n.isNull() ) { @@ -247,7 +247,7 @@ MagnatuneXmlParser::parseTrack( QDomElement e ) childElement = n.toElement(); - QString sElementName = childElement.tagName(); + TQString sElementName = childElement.tagName(); if ( sElementName == "trackname" ) diff --git a/amarok/src/magnatunebrowser/magnatunexmlparser.h b/amarok/src/magnatunebrowser/magnatunexmlparser.h index 9a03b820..d8f3bc8e 100644 --- a/amarok/src/magnatunebrowser/magnatunexmlparser.h +++ b/amarok/src/magnatunebrowser/magnatunexmlparser.h @@ -24,9 +24,9 @@ #include "magnatunetypes.h" #include "threadmanager.h" -#include -#include -#include +#include +#include +#include /** @@ -45,7 +45,7 @@ public: * @param fileName The file to parse * @return Pointer to new object */ - MagnatuneXmlParser( QString fileName ); + MagnatuneXmlParser( TQString fileName ); /** * The function that starts the actual work. Inherited fromThreadManager::Job @@ -69,7 +69,7 @@ public: * Reads, and starts parsing, file. Should not be used directly. * @param filename The file to read */ - void readConfigFile( QString filename ); + void readConfigFile( TQString filename ); signals: @@ -80,38 +80,38 @@ signals: private: - QString m_currentArtist; - QString m_currentArtistGenre; + TQString m_currentArtist; + TQString m_currentArtistGenre; /** * Parses a DOM element * @param e The element to parse */ - void parseElement( QDomElement e ); + void parseElement( TQDomElement e ); /** * Parses all children of a DOM element * @param e The element whose children is to be parsed */ - void parseChildren( QDomElement e ); + void parseChildren( TQDomElement e ); /** * Parse a DOM element representing an album * @param e The album element to parse */ - void parseAlbum( QDomElement e ); + void parseAlbum( TQDomElement e ); /** * Parse a DOM element representing a track * @param e The track element to parse */ - void parseTrack( QDomElement e ); + void parseTrack( TQDomElement e ); MagnatuneAlbum *m_pCurrentAlbum; MagnatuneArtist *m_pCurrentArtist; MagnatuneTrackList m_currentAlbumTracksList; - QString m_sFileName; + TQString m_sFileName; int m_nNumberOfTracks; int m_nNumberOfAlbums; diff --git a/amarok/src/mediabrowser.cpp b/amarok/src/mediabrowser.cpp index 4916784f..ff1b0eb8 100644 --- a/amarok/src/mediabrowser.cpp +++ b/amarok/src/mediabrowser.cpp @@ -40,22 +40,22 @@ #include "transferdialog.h" #include "browserToolBar.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include //QToolTip::add() +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include //TQToolTip::add() #include //kapp #include @@ -83,21 +83,21 @@ MediaBrowser *MediaBrowser::s_instance = 0; -QPixmap *MediaItem::s_pixUnknown = 0; -QPixmap *MediaItem::s_pixArtist = 0; -QPixmap *MediaItem::s_pixAlbum = 0; -QPixmap *MediaItem::s_pixFile = 0; -QPixmap *MediaItem::s_pixTrack = 0; -QPixmap *MediaItem::s_pixPodcast = 0; -QPixmap *MediaItem::s_pixPlaylist = 0; -QPixmap *MediaItem::s_pixInvisible = 0; -QPixmap *MediaItem::s_pixStale = 0; -QPixmap *MediaItem::s_pixOrphaned = 0; -QPixmap *MediaItem::s_pixDirectory = 0; -QPixmap *MediaItem::s_pixRootItem = 0; -QPixmap *MediaItem::s_pixTransferFailed = 0; -QPixmap *MediaItem::s_pixTransferBegin = 0; -QPixmap *MediaItem::s_pixTransferEnd = 0; +TQPixmap *MediaItem::s_pixUnknown = 0; +TQPixmap *MediaItem::s_pixArtist = 0; +TQPixmap *MediaItem::s_pixAlbum = 0; +TQPixmap *MediaItem::s_pixFile = 0; +TQPixmap *MediaItem::s_pixTrack = 0; +TQPixmap *MediaItem::s_pixPodcast = 0; +TQPixmap *MediaItem::s_pixPlaylist = 0; +TQPixmap *MediaItem::s_pixInvisible = 0; +TQPixmap *MediaItem::s_pixStale = 0; +TQPixmap *MediaItem::s_pixOrphaned = 0; +TQPixmap *MediaItem::s_pixDirectory = 0; +TQPixmap *MediaItem::s_pixRootItem = 0; +TQPixmap *MediaItem::s_pixTransferFailed = 0; +TQPixmap *MediaItem::s_pixTransferBegin = 0; +TQPixmap *MediaItem::s_pixTransferEnd = 0; bool MediaBrowser::isAvailable() //static { @@ -110,19 +110,19 @@ bool MediaBrowser::isAvailable() //static //return MediaBrowser::instance()->m_haveDevices; } -class SpaceLabel : public QLabel { +class SpaceLabel : public TQLabel { public: - SpaceLabel(QWidget *parent) - : QLabel(parent) + SpaceLabel(TQWidget *parent) + : TQLabel(parent) { m_total = m_used = m_scheduled = 0; setBackgroundMode(Qt::NoBackground); } - void paintEvent(QPaintEvent *e) + void paintEvent(TQPaintEvent *e) { - QPainter p(this); - p.fillRect(e->rect(), colorGroup().brush(QColorGroup::Background)); + TQPainter p(this); + p.fillRect(e->rect(), colorGroup().brush(TQColorGroup::Background)); if(m_total > 0) { @@ -131,20 +131,20 @@ class SpaceLabel : public QLabel { if(m_used > 0) { - QColor blueish(70,120,255); + TQColor blueish(70,120,255); if(e->rect().left() < used) { int right = used; if(e->rect().right() < right) right = e->rect().right(); p.fillRect(e->rect().left(), e->rect().top(), - used, e->rect().bottom()+1, QBrush(blueish, Qt::SolidPattern)); + used, e->rect().bottom()+1, TQBrush(blueish, Qt::SolidPattern)); } } if(m_scheduled > 0) { - QColor sched(70, 230, 120); + TQColor sched(70, 230, 120); if(m_used + m_scheduled > m_total - m_total/200) { sched.setRgb( 255, 120, 120 ); @@ -155,20 +155,20 @@ class SpaceLabel : public QLabel { int right = e->rect().right(); if(scheduled < right) right = scheduled; - p.fillRect(left, e->rect().top(), right, e->rect().bottom()+1, QBrush(sched, Qt::SolidPattern)); + p.fillRect(left, e->rect().top(), right, e->rect().bottom()+1, TQBrush(sched, Qt::SolidPattern)); } if(m_used + m_scheduled < m_total) { - QColor grey(180, 180, 180); + TQColor grey(180, 180, 180); int left = e->rect().left(); if(scheduled > left) left = scheduled; int right = e->rect().right(); - p.fillRect(left, e->rect().top(), right, e->rect().bottom()+1, colorGroup().brush(QColorGroup::Background)); + p.fillRect(left, e->rect().top(), right, e->rect().bottom()+1, colorGroup().brush(TQColorGroup::Background)); } } - QLabel::paintEvent(e); + TQLabel::paintEvent(e); } KIO::filesize_t m_total; @@ -195,7 +195,7 @@ class DummyMediaDevice : public MediaDevice { if( !silent ) { - //QString msg = i18n( "Sorry, you do not have a supported portable music player." ); + //TQString msg = i18n( "Sorry, you do not have a supported portable music player." ); //Amarok::StatusBar::instance()->longMessage( msg, KDE::StatusBar::Sorry ); } return false; @@ -208,8 +208,8 @@ class DummyMediaDevice : public MediaDevice MediaBrowser::MediaBrowser( const char *name ) - : QVBox( 0, name ) - , m_timer( new QTimer( this ) ) + : TQVBox( 0, name ) + , m_timer( new TQTimer( this ) ) , m_currentDevice( m_devices.end() ) , m_waitForTranscode( false ) , m_quitting( false ) @@ -218,12 +218,12 @@ MediaBrowser::MediaBrowser( const char *name ) // preload pixmaps used in browser KIconLoader iconLoader; - MediaItem::s_pixUnknown = new QPixmap(iconLoader.loadIcon( Amarok::icon( "unknown" ), KIcon::Toolbar, KIcon::SizeSmall )); - MediaItem::s_pixTrack = new QPixmap(iconLoader.loadIcon( Amarok::icon( "playlist" ), KIcon::Toolbar, KIcon::SizeSmall )); - MediaItem::s_pixFile = new QPixmap(iconLoader.loadIcon( Amarok::icon( "sound" ), KIcon::Toolbar, KIcon::SizeSmall ) ); - MediaItem::s_pixPodcast = new QPixmap(iconLoader.loadIcon( Amarok::icon( "podcast" ), KIcon::Toolbar, KIcon::SizeSmall ) ); - MediaItem::s_pixPlaylist = new QPixmap(iconLoader.loadIcon( Amarok::icon( "playlist" ), KIcon::Toolbar, KIcon::SizeSmall ) ); - MediaItem::s_pixRootItem = new QPixmap(iconLoader.loadIcon( Amarok::icon( "files2" ), KIcon::Toolbar, KIcon::SizeSmall ) ); + MediaItem::s_pixUnknown = new TQPixmap(iconLoader.loadIcon( Amarok::icon( "unknown" ), KIcon::Toolbar, KIcon::SizeSmall )); + MediaItem::s_pixTrack = new TQPixmap(iconLoader.loadIcon( Amarok::icon( "playlist" ), KIcon::Toolbar, KIcon::SizeSmall )); + MediaItem::s_pixFile = new TQPixmap(iconLoader.loadIcon( Amarok::icon( "sound" ), KIcon::Toolbar, KIcon::SizeSmall ) ); + MediaItem::s_pixPodcast = new TQPixmap(iconLoader.loadIcon( Amarok::icon( "podcast" ), KIcon::Toolbar, KIcon::SizeSmall ) ); + MediaItem::s_pixPlaylist = new TQPixmap(iconLoader.loadIcon( Amarok::icon( "playlist" ), KIcon::Toolbar, KIcon::SizeSmall ) ); + MediaItem::s_pixRootItem = new TQPixmap(iconLoader.loadIcon( Amarok::icon( "files2" ), KIcon::Toolbar, KIcon::SizeSmall ) ); // history // favorites // collection @@ -232,15 +232,15 @@ MediaBrowser::MediaBrowser( const char *name ) // player_playlist_2 // cancel // sound - MediaItem::s_pixArtist = new QPixmap(iconLoader.loadIcon( Amarok::icon( "personal" ), KIcon::Toolbar, KIcon::SizeSmall ) ); - MediaItem::s_pixAlbum = new QPixmap(iconLoader.loadIcon( Amarok::icon( "cdrom_unmount" ), KIcon::Toolbar, KIcon::SizeSmall ) ); - MediaItem::s_pixInvisible = new QPixmap(iconLoader.loadIcon( Amarok::icon( "cancel" ), KIcon::Toolbar, KIcon::SizeSmall ) ); - MediaItem::s_pixStale = new QPixmap(iconLoader.loadIcon( Amarok::icon( "cancel" ), KIcon::Toolbar, KIcon::SizeSmall ) ); - MediaItem::s_pixOrphaned = new QPixmap(iconLoader.loadIcon( Amarok::icon( "cancel" ), KIcon::Toolbar, KIcon::SizeSmall ) ); - MediaItem::s_pixDirectory = new QPixmap(iconLoader.loadIcon( Amarok::icon( "folder" ), KIcon::Toolbar, KIcon::SizeSmall ) ); - MediaItem::s_pixTransferBegin = new QPixmap(iconLoader.loadIcon( Amarok::icon( "play" ), KIcon::Toolbar, KIcon::SizeSmall ) ); - MediaItem::s_pixTransferEnd = new QPixmap(iconLoader.loadIcon( Amarok::icon( "stop" ), KIcon::Toolbar, KIcon::SizeSmall ) ); - MediaItem::s_pixTransferFailed = new QPixmap(iconLoader.loadIcon( Amarok::icon( "cancel" ), KIcon::Toolbar, KIcon::SizeSmall ) ); + MediaItem::s_pixArtist = new TQPixmap(iconLoader.loadIcon( Amarok::icon( "personal" ), KIcon::Toolbar, KIcon::SizeSmall ) ); + MediaItem::s_pixAlbum = new TQPixmap(iconLoader.loadIcon( Amarok::icon( "cdrom_unmount" ), KIcon::Toolbar, KIcon::SizeSmall ) ); + MediaItem::s_pixInvisible = new TQPixmap(iconLoader.loadIcon( Amarok::icon( "cancel" ), KIcon::Toolbar, KIcon::SizeSmall ) ); + MediaItem::s_pixStale = new TQPixmap(iconLoader.loadIcon( Amarok::icon( "cancel" ), KIcon::Toolbar, KIcon::SizeSmall ) ); + MediaItem::s_pixOrphaned = new TQPixmap(iconLoader.loadIcon( Amarok::icon( "cancel" ), KIcon::Toolbar, KIcon::SizeSmall ) ); + MediaItem::s_pixDirectory = new TQPixmap(iconLoader.loadIcon( Amarok::icon( "folder" ), KIcon::Toolbar, KIcon::SizeSmall ) ); + MediaItem::s_pixTransferBegin = new TQPixmap(iconLoader.loadIcon( Amarok::icon( "play" ), KIcon::Toolbar, KIcon::SizeSmall ) ); + MediaItem::s_pixTransferEnd = new TQPixmap(iconLoader.loadIcon( Amarok::icon( "stop" ), KIcon::Toolbar, KIcon::SizeSmall ) ); + MediaItem::s_pixTransferFailed = new TQPixmap(iconLoader.loadIcon( Amarok::icon( "cancel" ), KIcon::Toolbar, KIcon::SizeSmall ) ); setSpacing( 4 ); @@ -248,24 +248,24 @@ MediaBrowser::MediaBrowser( const char *name ) m_toolbar->setIconText( KToolBar::IconTextRight, false ); m_toolbar->insertButton( "connect_creating", CONNECT, true, i18n("Connect") ); - QToolTip::add( m_toolbar->getButton(CONNECT), i18n( "Connect media device" ) ); + TQToolTip::add( m_toolbar->getButton(CONNECT), i18n( "Connect media device" ) ); m_toolbar->insertButton( "player_eject", DISCONNECT, true, i18n("Disconnect") ); - QToolTip::add( m_toolbar->getButton(DISCONNECT), i18n( "Disconnect media device" ) ); + TQToolTip::add( m_toolbar->getButton(DISCONNECT), i18n( "Disconnect media device" ) ); m_toolbar->insertButton( "rebuild", TRANSFER, true, i18n("Transfer") ); - QToolTip::add( m_toolbar->getButton(TRANSFER), i18n( "Transfer tracks to media device" ) ); + TQToolTip::add( m_toolbar->getButton(TRANSFER), i18n( "Transfer tracks to media device" ) ); m_toolbar->insertLineSeparator(); // m_toolbar->setIconText( KToolBar::IconTextRight, true ); - m_toolbar->insertButton( Amarok::icon( "add_playlist" ), CUSTOM, SIGNAL( clicked() ), this, SLOT( customClicked() ), true, "custom" ); - QToolTip::add( m_toolbar->getButton(TRANSFER), i18n( "Transfer tracks to media device" ) ); + m_toolbar->insertButton( Amarok::icon( "add_playlist" ), CUSTOM, TQT_SIGNAL( clicked() ), this, TQT_SLOT( customClicked() ), true, "custom" ); + TQToolTip::add( m_toolbar->getButton(TRANSFER), i18n( "Transfer tracks to media device" ) ); m_toolbar->setIconText( KToolBar::IconOnly, false ); m_toolbar->insertButton( Amarok::icon( "configure" ), CONFIGURE, true, i18n("Configure") ); - QToolTip::add( m_toolbar->getButton(CONFIGURE), i18n( "Configure device" ) ); + TQToolTip::add( m_toolbar->getButton(CONFIGURE), i18n( "Configure device" ) ); m_deviceCombo = new KComboBox( this ); @@ -277,27 +277,27 @@ MediaBrowser::MediaBrowser( const char *name ) m_searchEdit = new ClickLineEdit( i18n( "Enter search terms here" ), searchToolBar ); KPushButton *filterButton = new KPushButton("...", searchToolBar, "filter"); searchToolBar->setStretchableWidget( m_searchEdit ); - m_searchEdit->setFrame( QFrame::Sunken ); + m_searchEdit->setFrame( TQFrame::Sunken ); - connect( button, SIGNAL( clicked() ), m_searchEdit, SLOT( clear() ) ); - connect( filterButton, SIGNAL( clicked() ), SLOT( slotEditFilter() ) ); + connect( button, TQT_SIGNAL( clicked() ), m_searchEdit, TQT_SLOT( clear() ) ); + connect( filterButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotEditFilter() ) ); - QToolTip::add( button, i18n( "Clear filter" ) ); - QToolTip::add( m_searchEdit, i18n( "Enter space-separated terms to search" ) ); - QToolTip::add( filterButton, i18n( "Click to edit filter" ) ); + TQToolTip::add( button, i18n( "Clear filter" ) ); + TQToolTip::add( m_searchEdit, i18n( "Enter space-separated terms to search" ) ); + TQToolTip::add( filterButton, i18n( "Click to edit filter" ) ); } // - connect( m_timer, SIGNAL( timeout() ), SLOT( slotSetFilter() ) ); - connect( m_searchEdit, SIGNAL( textChanged( const QString& ) ), SLOT( slotSetFilterTimeout() ) ); - connect( m_searchEdit, SIGNAL( returnPressed() ), SLOT( slotSetFilter() ) ); + connect( m_timer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotSetFilter() ) ); + connect( m_searchEdit, TQT_SIGNAL( textChanged( const TQString& ) ), TQT_SLOT( slotSetFilterTimeout() ) ); + connect( m_searchEdit, TQT_SIGNAL( returnPressed() ), TQT_SLOT( slotSetFilter() ) ); // connect to device manager - connect( MediaDeviceManager::instance(), SIGNAL( mediumAdded(const Medium *, QString) ), - SLOT( mediumAdded(const Medium *, QString) ) ); - connect( MediaDeviceManager::instance(), SIGNAL( mediumChanged(const Medium *, QString) ), - SLOT( mediumChanged(const Medium *, QString) ) ); - connect( MediaDeviceManager::instance(), SIGNAL( mediumRemoved(const Medium *, QString) ), - SLOT( mediumRemoved(const Medium *, QString) ) ); + connect( MediaDeviceManager::instance(), TQT_SIGNAL( mediumAdded(const Medium *, TQString) ), + TQT_SLOT( mediumAdded(const Medium *, TQString) ) ); + connect( MediaDeviceManager::instance(), TQT_SIGNAL( mediumChanged(const Medium *, TQString) ), + TQT_SLOT( mediumChanged(const Medium *, TQString) ) ); + connect( MediaDeviceManager::instance(), TQT_SIGNAL( mediumRemoved(const Medium *, TQString) ), + TQT_SLOT( mediumRemoved(const Medium *, TQString) ) ); // we always have a dummy device @@ -308,14 +308,14 @@ MediaBrowser::MediaBrowser( const char *name ) // query available device plugins m_plugins = PluginManager::query( "[X-KDE-Amarok-plugintype] == 'mediadevice'" ); for( KTrader::OfferList::ConstIterator it = m_plugins.begin(); it != m_plugins.end(); ++it ) { - // Save name properties in QMap for lookup + // Save name properties in TQMap for lookup m_pluginName[(*it)->name()] = (*it)->property( "X-KDE-Amarok-name" ).toString(); m_pluginAmarokName[(*it)->property( "X-KDE-Amarok-name" ).toString()] = (*it)->name(); } - m_views = new QVBox( this ); + m_views = new TQVBox( this ); m_queue = new MediaQueue( this ); - m_progressBox = new QHBox( this ); + m_progressBox = new TQHBox( this ); m_progress = new KProgress( m_progressBox ); m_cancelButton = new KPushButton( SmallIconSet( Amarok::icon( "cancel" ) ), i18n("Cancel"), m_progressBox ); @@ -335,15 +335,15 @@ MediaBrowser::MediaBrowser( const char *name ) updateStats(); - QMap mmap = MediaDeviceManager::instance()->getMediumMap(); + TQMap mmap = MediaDeviceManager::instance()->getMediumMap(); bool newflag = false; //This deals with auto-detectable ALL devices! - for( QMap::Iterator it = mmap.begin(); + for( TQMap::Iterator it = mmap.begin(); it != mmap.end(); it++ ) { - QString handler = Amarok::config( "MediaBrowser" )->readEntry( (*it)->id() ); + TQString handler = Amarok::config( "MediaBrowser" )->readEntry( (*it)->id() ); //debug() << "[MediaBrowser] (*it)->id() = " << (*it)->id() << ", handler = " << handler << endl; if( handler.isEmpty() ) { @@ -363,21 +363,21 @@ MediaBrowser::MediaBrowser( const char *name ) "Go to the \"Media Devices\" pane of the configuration\n" "dialog to choose a plugin for these devices.") ); - connect( m_toolbar->getButton(CONNECT), SIGNAL( clicked() ), SLOT( connectClicked() ) ); - connect( m_toolbar->getButton(DISCONNECT), SIGNAL( clicked() ), SLOT( disconnectClicked() ) ); - connect( m_toolbar->getButton(TRANSFER), SIGNAL( clicked() ), SLOT( transferClicked() ) ); - connect( m_toolbar->getButton(CONFIGURE), SIGNAL( clicked() ), SLOT( config() ) ); + connect( m_toolbar->getButton(CONNECT), TQT_SIGNAL( clicked() ), TQT_SLOT( connectClicked() ) ); + connect( m_toolbar->getButton(DISCONNECT), TQT_SIGNAL( clicked() ), TQT_SLOT( disconnectClicked() ) ); + connect( m_toolbar->getButton(TRANSFER), TQT_SIGNAL( clicked() ), TQT_SLOT( transferClicked() ) ); + connect( m_toolbar->getButton(CONFIGURE), TQT_SIGNAL( clicked() ), TQT_SLOT( config() ) ); - connect( m_deviceCombo, SIGNAL( activated( int ) ), SLOT( activateDevice( int ) ) ); + connect( m_deviceCombo, TQT_SIGNAL( activated( int ) ), TQT_SLOT( activateDevice( int ) ) ); - connect( m_cancelButton, SIGNAL( clicked() ), SLOT( cancelClicked() ) ); - connect( pApp, SIGNAL( prepareToQuit() ), SLOT( prepareToQuit() ) ); - connect( CollectionDB::instance(), SIGNAL( tagsChanged( const MetaBundle& ) ), - SLOT( tagsChanged( const MetaBundle& ) ) ); + connect( m_cancelButton, TQT_SIGNAL( clicked() ), TQT_SLOT( cancelClicked() ) ); + connect( pApp, TQT_SIGNAL( prepareToQuit() ), TQT_SLOT( prepareToQuit() ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( tagsChanged( const MetaBundle& ) ), + TQT_SLOT( tagsChanged( const MetaBundle& ) ) ); m_haveDevices = false; - QMap savedDevices = Amarok::config( "MediaBrowser" )->entryMap( "MediaBrowser" ); - for( QMap::Iterator it = savedDevices.begin(); + TQMap savedDevices = Amarok::config( "MediaBrowser" )->entryMap( "MediaBrowser" ); + for( TQMap::Iterator it = savedDevices.begin(); it != savedDevices.end(); ++it ) { @@ -393,7 +393,7 @@ MediaBrowser::MediaBrowser( const char *name ) bool MediaBrowser::blockQuit() const { - for( QValueList::const_iterator it = m_devices.begin(); + for( TQValueList::const_iterator it = m_devices.begin(); it != m_devices.end(); ++it ) { @@ -423,7 +423,7 @@ MediaBrowser::tagsChanged( const MetaBundle &bundle ) // it's an item on the transfer queue item->setBundle( new MetaBundle( bundle ) ); - QString text = item->bundle()->prettyTitle(); + TQString text = item->bundle()->prettyTitle(); if( text.isEmpty() || (!item->bundle()->isValidMedia() && !item->bundle()->podcastBundle()) ) text = item->bundle()->url().prettyURL(); if( !item->m_playlistName.isNull() ) @@ -442,13 +442,13 @@ MediaBrowser::tagsChanged( const MetaBundle &bundle ) bool MediaBrowser::getBundle( const KURL &url, MetaBundle *bundle ) const { - QMutexLocker locker( &m_itemMapMutex ); + TQMutexLocker locker( &m_itemMapMutex ); ItemMap::const_iterator it = m_itemMap.find( url.url() ); if( it == m_itemMap.end() ) return false; if( bundle ) - *bundle = QDeepCopy( *(*it)->bundle() ); + *bundle = TQDeepCopy( *(*it)->bundle() ); return true; } @@ -467,7 +467,7 @@ MediaBrowser::getProxyUrl( const KURL& daapUrl ) const MediaDevice * MediaBrowser::currentDevice() const { - QValueList::const_iterator current = m_currentDevice; + TQValueList::const_iterator current = m_currentDevice; if( current != m_devices.constEnd() ) { return *m_currentDevice; @@ -477,9 +477,9 @@ MediaBrowser::currentDevice() const } MediaDevice * -MediaBrowser::deviceFromId( const QString &id ) const +MediaBrowser::deviceFromId( const TQString &id ) const { - for( QValueList::const_iterator it = m_devices.constBegin(); + for( TQValueList::const_iterator it = m_devices.constBegin(); it != m_devices.end(); it++ ) { @@ -494,7 +494,7 @@ void MediaBrowser::activateDevice( const MediaDevice *dev ) { int index = 0; - for( QValueList::iterator it = m_devices.begin(); + for( TQValueList::iterator it = m_devices.begin(); it != m_devices.end(); it++ ) { @@ -517,7 +517,7 @@ MediaBrowser::activateDevice( int index, bool skipDummy ) m_toolbar->show(); } - for( QValueList::iterator it = m_devices.begin(); + for( TQValueList::iterator it = m_devices.begin(); it != m_devices.end(); it++ ) { @@ -584,7 +584,7 @@ MediaBrowser::removeDevice( MediaDevice *device ) debug() << "remove device: type=" << device->deviceType() << endl; - for( QValueList::iterator it = m_devices.begin(); + for( TQValueList::iterator it = m_devices.begin(); it != m_devices.end(); it++ ) { @@ -621,13 +621,13 @@ MediaBrowser::updateDevices() { m_deviceCombo->clear(); uint i = 0; - for( QValueList::iterator it = m_devices.begin(); + for( TQValueList::iterator it = m_devices.begin(); it != m_devices.end(); it++ ) { if( m_devices.count() > 1 && dynamic_cast(*it) ) continue; - QString name = (*it)->name(); + TQString name = (*it)->name(); if( !(*it)->deviceNode().isEmpty() ) { name = i18n( "%1 at %2" ).arg( name, (*it)->deviceNode() ); @@ -651,13 +651,13 @@ MediaBrowser::updateDevices() QStringList MediaBrowser::deviceNames() const { - QStringList list; + TQStringList list; - for( QValueList::const_iterator it = m_devices.constBegin(); + for( TQValueList::const_iterator it = m_devices.constBegin(); it != m_devices.constEnd(); it++ ) { - QString name = (*it)->name(); + TQString name = (*it)->name(); list << name; } @@ -665,10 +665,10 @@ MediaBrowser::deviceNames() const } bool -MediaBrowser::deviceSwitch( const QString &name ) +MediaBrowser::deviceSwitch( const TQString &name ) { int index = 0; - for( QValueList::iterator it = m_devices.begin(); + for( TQValueList::iterator it = m_devices.begin(); it != m_devices.end(); it++ ) { @@ -684,7 +684,7 @@ MediaBrowser::deviceSwitch( const QString &name ) } void -MediaBrowser::transcodingFinished( const QString &src, const QString &dst ) +MediaBrowser::transcodingFinished( const TQString &src, const TQString &dst ) { KURL srcJob = KURL::fromPathOrURL( m_transcodeSrc ); KURL srcResult = KURL::fromPathOrURL( src ); @@ -703,7 +703,7 @@ MediaBrowser::transcodingFinished( const QString &src, const QString &dst ) } KURL -MediaBrowser::transcode( const KURL &src, const QString &filetype ) +MediaBrowser::transcode( const KURL &src, const TQString &filetype ) { const ScriptManager* const sm = ScriptManager::instance(); @@ -718,7 +718,7 @@ MediaBrowser::transcode( const KURL &src, const QString &filetype ) m_transcodedUrl = KURL(); ScriptManager::instance()->notifyTranscode( src.url(), filetype ); - while( m_waitForTranscode && sm->transcodeScriptRunning() != QString::null ) + while( m_waitForTranscode && sm->transcodeScriptRunning() != TQString::null ) { usleep( 10000 ); kapp->processEvents( 100 ); @@ -744,7 +744,7 @@ MediaBrowser::slotSetFilter() //SLOT } void -MediaBrowser::slotSetFilter( const QString &text ) +MediaBrowser::slotSetFilter( const TQString &text ) { m_searchEdit->setText( text ); slotSetFilter(); @@ -754,7 +754,7 @@ void MediaBrowser::slotEditFilter() { EditFilterDialog *fd = new EditFilterDialog( this, true, m_searchEdit->text() ); - connect( fd, SIGNAL(filterChanged(const QString &)), SLOT(slotSetFilter(const QString &)) ); + connect( fd, TQT_SIGNAL(filterChanged(const TQString &)), TQT_SLOT(slotSetFilter(const TQString &)) ); if( fd->exec() ) m_searchEdit->setText( fd->filter() ); delete fd; @@ -765,7 +765,7 @@ MediaBrowser::prepareToQuit() { m_waitForTranscode = false; m_quitting = true; - for( QValueList::iterator it = m_devices.begin(); + for( TQValueList::iterator it = m_devices.begin(); it != m_devices.end(); ++it ) { @@ -789,25 +789,25 @@ MediaBrowser::~MediaBrowser() } -MediaItem::MediaItem( QListView* parent ) +MediaItem::MediaItem( TQListView* parent ) : KListViewItem( parent ) { init(); } -MediaItem::MediaItem( QListViewItem* parent ) +MediaItem::MediaItem( TQListViewItem* parent ) : KListViewItem( parent ) { init(); } -MediaItem::MediaItem( QListView* parent, QListViewItem* after ) +MediaItem::MediaItem( TQListView* parent, TQListViewItem* after ) : KListViewItem( parent, after ) { init(); } -MediaItem::MediaItem( QListViewItem* parent, QListViewItem* after ) +MediaItem::MediaItem( TQListViewItem* parent, TQListViewItem* after ) : KListViewItem( parent, after ) { init(); @@ -824,7 +824,7 @@ MediaItem::init() m_bundle=0; m_order=0; m_type=UNKNOWN; - m_playlistName = QString::null; + m_playlistName = TQString::null; m_device=0; m_flags=0; setExpandable( false ); @@ -838,7 +838,7 @@ MediaItem::setBundle( MetaBundle *bundle ) MediaBrowser::instance()->m_itemMapMutex.lock(); if( m_bundle ) { - QString itemUrl = url().url(); + TQString itemUrl = url().url(); MediaBrowser::ItemMap::iterator it = MediaBrowser::instance()->m_itemMap.find( itemUrl ); if( it != MediaBrowser::instance()->m_itemMap.end() && *it == this ) MediaBrowser::instance()->m_itemMap.remove( itemUrl ); @@ -848,7 +848,7 @@ MediaItem::setBundle( MetaBundle *bundle ) if( m_bundle ) { - QString itemUrl = url().url(); + TQString itemUrl = url().url(); MediaBrowser::ItemMap::iterator it = MediaBrowser::instance()->m_itemMap.find( itemUrl ); if( it == MediaBrowser::instance()->m_itemMap.end() ) MediaBrowser::instance()->m_itemMap[itemUrl] = this; @@ -856,7 +856,7 @@ MediaItem::setBundle( MetaBundle *bundle ) MediaBrowser::instance()->m_itemMapMutex.unlock(); } -void MediaItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align ) +void MediaItem::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align ) { switch( type() ) { @@ -866,7 +866,7 @@ void MediaItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int w case ORPHANEDROOT: case STALEROOT: { - QFont font( p->font() ); + TQFont font( p->font() ); font.setBold( true ); p->setFont( font ); } @@ -1012,15 +1012,15 @@ MediaItem::setFailed( bool failed ) else if( m_type == PLAYLIST ) setPixmap(0, *s_pixPlaylist); else - setPixmap(0, QPixmap() ); + setPixmap(0, TQPixmap() ); } } MediaItem * MediaItem::lastChild() const { - QListViewItem *last = 0; - for( QListViewItem *it = firstChild(); + TQListViewItem *last = 0; + for( TQListViewItem *it = firstChild(); it; it = it->nextSibling() ) { @@ -1063,7 +1063,7 @@ MediaItem::isLeafItem() const } MediaItem * -MediaItem::findItem( const QString &key, const MediaItem *after ) const +MediaItem::findItem( const TQString &key, const MediaItem *after ) const { MediaItem *it = 0; if( after ) @@ -1082,17 +1082,17 @@ MediaItem::findItem( const QString &key, const MediaItem *after ) const } int -MediaItem::compare( QListViewItem *i, int col, bool ascending ) const +MediaItem::compare( TQListViewItem *i, int col, bool ascending ) const { MediaItem *item = dynamic_cast(i); if(item && col==0 && item->m_order != m_order) return m_order-item->m_order; else if( item && item->type() == MediaItem::ARTIST ) { - QString key1 = key( col, ascending ); + TQString key1 = key( col, ascending ); if( key1.startsWith( "the ", false ) ) key1 = key1.mid( 4 ); - QString key2 = i->key( col, ascending ); + TQString key2 = i->key( col, ascending ); if( key2.startsWith( "the ", false ) ) key2 = key2.mid( 4 ); @@ -1105,19 +1105,19 @@ MediaItem::compare( QListViewItem *i, int col, bool ascending ) const class MediaItemTip : public QToolTip { public: - MediaItemTip( QListView *listview ) - : QToolTip( listview->viewport() ) + MediaItemTip( TQListView *listview ) + : TQToolTip( listview->viewport() ) , m_view( listview ) {} virtual ~MediaItemTip() {} protected: - virtual void maybeTip( const QPoint &p ) + virtual void maybeTip( const TQPoint &p ) { MediaItem *i = dynamic_cast(m_view->itemAt( m_view->viewportToContents( p ) ) ); if( !i ) return; - QString text; + TQString text; switch( i->type() ) { case MediaItem::TRACK: @@ -1126,13 +1126,13 @@ class MediaItemTip : public QToolTip if( b ) { if( b->track() ) - text = QString( "%1 - %2 (%3)" ) - .arg( QString::number(b->track()), b->title(), b->prettyLength() ); + text = TQString( "%1 - %2 (%3)" ) + .arg( TQString::number(b->track()), b->title(), b->prettyLength() ); if( !b->genre().isEmpty() ) { if( !text.isEmpty() ) text += "
"; - text += QString( "Genre: %1" ) + text += TQString( "Genre: %1" ) .arg( b->genre() ); } } @@ -1167,17 +1167,17 @@ class MediaItemTip : public QToolTip tip( m_view->itemRect( i ), text ); } - QListView *m_view; + TQListView *m_view; }; -MediaView::MediaView( QWidget* parent, MediaDevice *device ) +MediaView::MediaView( TQWidget* parent, MediaDevice *device ) : KListView( parent ) , m_parent( parent ) , m_device( device ) { hide(); - setSelectionMode( QListView::Extended ); + setSelectionMode( TQListView::Extended ); setItemsMovable( false ); setShowSortIndicator( true ); setFullWidth( true ); @@ -1192,28 +1192,28 @@ MediaView::MediaView( QWidget* parent, MediaDevice *device ) addColumn( i18n( "Remote Media" ) ); KActionCollection* ac = new KActionCollection( this ); - KStdAction::selectAll( this, SLOT( selectAll() ), ac, "mediabrowser_select_all" ); + KStdAction::selectAll( this, TQT_SLOT( selectAll() ), ac, "mediabrowser_select_all" ); - connect( this, SIGNAL( contextMenuRequested( QListViewItem*, const QPoint&, int ) ), - this, SLOT( rmbPressed( QListViewItem*, const QPoint&, int ) ) ); + connect( this, TQT_SIGNAL( contextMenuRequested( TQListViewItem*, const TQPoint&, int ) ), + this, TQT_SLOT( rmbPressed( TQListViewItem*, const TQPoint&, int ) ) ); - connect( this, SIGNAL( itemRenamed( QListViewItem* ) ), - this, SLOT( renameItem( QListViewItem* ) ) ); + connect( this, TQT_SIGNAL( itemRenamed( TQListViewItem* ) ), + this, TQT_SLOT( renameItem( TQListViewItem* ) ) ); - connect( this, SIGNAL( expanded( QListViewItem* ) ), - this, SLOT( slotExpand( QListViewItem* ) ) ); + connect( this, TQT_SIGNAL( expanded( TQListViewItem* ) ), + this, TQT_SLOT( slotExpand( TQListViewItem* ) ) ); - connect( this, SIGNAL( returnPressed( QListViewItem* ) ), - this, SLOT( invokeItem( QListViewItem* ) ) ); + connect( this, TQT_SIGNAL( returnPressed( TQListViewItem* ) ), + this, TQT_SLOT( invokeItem( TQListViewItem* ) ) ); - connect( this, SIGNAL( doubleClicked( QListViewItem*, const QPoint&, int ) ), - this, SLOT( invokeItem( QListViewItem*, const QPoint &, int ) ) ); + connect( this, TQT_SIGNAL( doubleClicked( TQListViewItem*, const TQPoint&, int ) ), + this, TQT_SLOT( invokeItem( TQListViewItem*, const TQPoint &, int ) ) ); m_toolTip = new MediaItemTip( this ); } void -MediaView::keyPressEvent( QKeyEvent *e ) +MediaView::keyPressEvent( TQKeyEvent *e ) { if( e->key() == Key_Delete ) m_device->deleteFromDevice(); @@ -1222,12 +1222,12 @@ MediaView::keyPressEvent( QKeyEvent *e ) } void -MediaView::invokeItem( QListViewItem* i, const QPoint& point, int column ) //SLOT +MediaView::invokeItem( TQListViewItem* i, const TQPoint& point, int column ) //SLOT { if( column == -1 ) return; - QPoint p = mapFromGlobal( point ); + TQPoint p = mapFromGlobal( point ); if ( p.x() > header()->sectionPos( header()->mapToIndex( 0 ) ) + treeStepSize() * ( i->depth() + ( rootIsDecorated() ? 1 : 0) ) + itemMargin() || p.x() < header()->sectionPos( header()->mapToIndex( 0 ) ) ) invokeItem( i ); @@ -1235,7 +1235,7 @@ MediaView::invokeItem( QListViewItem* i, const QPoint& point, int column ) //SLO void -MediaView::invokeItem( QListViewItem *i ) +MediaView::invokeItem( TQListViewItem *i ) { MediaItem *item = dynamic_cast( i ); if( !item ) @@ -1246,13 +1246,13 @@ MediaView::invokeItem( QListViewItem *i ) } void -MediaView::renameItem( QListViewItem *item ) +MediaView::renameItem( TQListViewItem *item ) { m_device->renameItem( item ); } void -MediaView::slotExpand( QListViewItem *item ) +MediaView::slotExpand( TQListViewItem *item ) { m_device->expandItem( item ); } @@ -1264,7 +1264,7 @@ MediaView::~MediaView() } -QDragObject * +TQDragObject * MediaView::dragObject() { KURL::List urls = nodeBuildDragList( 0 ); @@ -1273,7 +1273,7 @@ MediaView::dragObject() KURLDrag* ud = new KURLDrag( urls, viewport() ); md->addDragObject( ud ); md->setPixmap( CollectionDB::createDragPixmap( urls ), - QPoint( CollectionDB::DRAGPIXMAP_OFFSET_X, CollectionDB::DRAGPIXMAP_OFFSET_Y ) ); + TQPoint( CollectionDB::DRAGPIXMAP_OFFSET_X, CollectionDB::DRAGPIXMAP_OFFSET_Y ) ); return md; } @@ -1317,11 +1317,11 @@ MediaView::nodeBuildDragList( MediaItem* item, int flags ) } int -MediaView::getSelectedLeaves( MediaItem *parent, QPtrList *list, int flags ) +MediaView::getSelectedLeaves( MediaItem *parent, TQPtrList *list, int flags ) { int numFiles = 0; if( !list ) - list = new QPtrList; + list = new TQPtrList; MediaItem *it; if( !parent ) @@ -1368,14 +1368,14 @@ MediaView::getSelectedLeaves( MediaItem *parent, QPtrList *list, int bool -MediaView::acceptDrag( QDropEvent *e ) const +MediaView::acceptDrag( TQDropEvent *e ) const { if( e->source() == MediaBrowser::queue()->viewport() ) return false; - QString data; - QCString subtype; - QTextDrag::decode( e, data, subtype ); + TQString data; + TQCString subtype; + TQTextDrag::decode( e, data, subtype ); return e->source() == viewport() || subtype == "amarok-sql" @@ -1383,25 +1383,25 @@ MediaView::acceptDrag( QDropEvent *e ) const } void -MediaView::contentsDropEvent( QDropEvent *e ) +MediaView::contentsDropEvent( TQDropEvent *e ) { cleanDropVisualizer(); cleanItemHighlighter(); if(e->source() == viewport()) { - const QPoint p = contentsToViewport( e->pos() ); + const TQPoint p = contentsToViewport( e->pos() ); MediaItem *item = dynamic_cast(itemAt( p )); if( !item && MediaBrowser::instance()->currentDevice()->m_type != "generic-mediadevice" ) return; - QPtrList items; + TQPtrList items; if( !item || item->type() == MediaItem::DIRECTORY || item->type() == MediaItem::TRACK ) { - QPtrList items; + TQPtrList items; getSelectedLeaves( 0, &items ); m_device->addToDirectory( item, items ); } @@ -1435,14 +1435,14 @@ MediaView::contentsDropEvent( QDropEvent *e ) } else if( item->type() == MediaItem::PLAYLISTSROOT ) { - QPtrList items; + TQPtrList items; getSelectedLeaves( 0, &items ); - QString base( i18n("New Playlist") ); - QString name = base; + TQString base( i18n("New Playlist") ); + TQString name = base; int i=1; while( item->findItem(name) ) { - QString num; + TQString num; num.setNum(i); name = base + ' ' + num; i++; @@ -1454,16 +1454,16 @@ MediaView::contentsDropEvent( QDropEvent *e ) } else { - QString data; - QCString subtype; - QTextDrag::decode( e, data, subtype ); + TQString data; + TQCString subtype; + TQTextDrag::decode( e, data, subtype ); KURL::List list; if( subtype == "amarok-sql" ) { - QString playlist = data.section( "\n", 0, 0 ); - QString query = data.section( "\n", 1 ); - QStringList values = CollectionDB::instance()->query( query ); + TQString playlist = data.section( "\n", 0, 0 ); + TQString query = data.section( "\n", 1 ); + TQStringList values = CollectionDB::instance()->query( query ); list = CollectionDB::instance()->URLsFromSqlDrag( values ); MediaBrowser::queue()->addURLs( list, playlist ); } @@ -1475,7 +1475,7 @@ MediaView::contentsDropEvent( QDropEvent *e ) } void -MediaView::viewportPaintEvent( QPaintEvent *e ) +MediaView::viewportPaintEvent( TQPaintEvent *e ) { KListView::viewportPaintEvent( e ); @@ -1483,15 +1483,15 @@ MediaView::viewportPaintEvent( QPaintEvent *e ) if ( !MediaBrowser::instance()->currentDevice() || !MediaBrowser::instance()->currentDevice()->isConnected() ) { - QPainter p( viewport() ); + TQPainter p( viewport() ); - QSimpleRichText t( i18n( + TQSimpleRichText t( i18n( "
" "

Media Device Browser

" "Configure your media device and then " "click the Connect button to access your media device. " "Drag and drop files to enqueue them for transfer." - "
" ), QApplication::font() ); + "
" ), TQApplication::font() ); t.setWidth( width() - 50 ); @@ -1500,13 +1500,13 @@ MediaView::viewportPaintEvent( QPaintEvent *e ) p.setBrush( colorGroup().background() ); p.drawRoundRect( 15, 15, w, h, (8*200)/w, (8*200)/h ); - t.draw( &p, 20, 20, QRect(), colorGroup() ); + t.draw( &p, 20, 20, TQRect(), colorGroup() ); } MediaBrowser::instance()->updateButtons(); } void -MediaView::rmbPressed( QListViewItem *item, const QPoint &p, int i ) +MediaView::rmbPressed( TQListViewItem *item, const TQPoint &p, int i ) { if( m_device->isConnected() ) m_device->rmbPressed( item, p, i ); @@ -1516,7 +1516,7 @@ MediaItem * MediaView::newDirectory( MediaItem *parent ) { bool ok; - const QString name = KInputDialog::getText(i18n("Add Directory"), i18n("Directory Name:"), QString::null, &ok, this); + const TQString name = KInputDialog::getText(i18n("Add Directory"), i18n("Directory Name:"), TQString::null, &ok, this); if( ok && !name.isEmpty() ) { @@ -1527,12 +1527,12 @@ MediaView::newDirectory( MediaItem *parent ) } void -MediaBrowser::mediumAdded( const Medium *medium, QString /*name*/, bool /*constructing*/ ) +MediaBrowser::mediumAdded( const Medium *medium, TQString /*name*/, bool /*constructing*/ ) { debug() << "mediumAdded: " << (medium? medium->properties():"null") << endl; if( medium ) { - QString handler = Amarok::config( "MediaBrowser" )->readEntry( medium->id() ); + TQString handler = Amarok::config( "MediaBrowser" )->readEntry( medium->id() ); if( handler.isEmpty() ) { //Some people complained about the dialog, boohoo @@ -1556,7 +1556,7 @@ MediaBrowser::mediumAdded( const Medium *medium, QString /*name*/, bool /*constr } void -MediaBrowser::pluginSelected( const Medium *medium, const QString plugin ) +MediaBrowser::pluginSelected( const Medium *medium, const TQString plugin ) { DEBUG_BLOCK if( !plugin.isEmpty() ) @@ -1565,7 +1565,7 @@ MediaBrowser::pluginSelected( const Medium *medium, const QString plugin ) Amarok::config( "MediaBrowser" )->writeEntry( medium->id(), plugin ); bool success = true; - for( QValueList::iterator it = m_devices.begin(); + for( TQValueList::iterator it = m_devices.begin(); it != m_devices.end(); it++ ) { @@ -1610,11 +1610,11 @@ MediaBrowser::showPluginManager() } void -MediaBrowser::mediumChanged( const Medium *medium, QString /*name*/ ) +MediaBrowser::mediumChanged( const Medium *medium, TQString /*name*/ ) { if( medium ) { - for( QValueList::iterator it = m_devices.begin(); + for( TQValueList::iterator it = m_devices.begin(); it != m_devices.end(); it++ ) { @@ -1641,11 +1641,11 @@ MediaBrowser::mediumChanged( const Medium *medium, QString /*name*/ ) } void -MediaBrowser::mediumRemoved( const Medium *medium, QString name ) +MediaBrowser::mediumRemoved( const Medium *medium, TQString name ) { if( medium ) { - for( QValueList::iterator it = m_devices.begin(); + for( TQValueList::iterator it = m_devices.begin(); it != m_devices.end(); it++ ) { @@ -1670,14 +1670,14 @@ MediaBrowser::mediumRemoved( const Medium *medium, QString name ) } MediaDevice * -MediaBrowser::loadDevicePlugin( const QString &deviceType ) +MediaBrowser::loadDevicePlugin( const TQString &deviceType ) { DEBUG_BLOCK if( deviceType == "ignore" ) return 0; - QString query = "[X-KDE-Amarok-plugintype] == 'mediadevice' and [X-KDE-Amarok-name] == '%1'"; + TQString query = "[X-KDE-Amarok-plugintype] == 'mediadevice' and [X-KDE-Amarok-name] == '%1'"; Amarok::Plugin *plugin = PluginManager::createFromQuery( query.arg( deviceType ) ); if( plugin ) @@ -1765,7 +1765,7 @@ MediaBrowser::configSelectPlugin( int index ) *m_currentDevice = new DummyMediaDevice(); if( AmarokConfig::deviceType() != "dummy-mediadevice" ) { - QString msg = i18n( "The requested media device could not be loaded" ); + TQString msg = i18n( "The requested media device could not be loaded" ); Amarok::StatusBar::instance()->shortMessage( msg ); } } @@ -1836,7 +1836,7 @@ MediaBrowser::updateStats() KIO::filesize_t queued = m_queue->totalSize(); - QString text = i18n( "1 track in queue", "%n tracks in queue", m_queue->childCount() ); + TQString text = i18n( "1 track in queue", "%n tracks in queue", m_queue->childCount() ); if(m_queue->childCount() > 0) { text += i18n(" (%1)").arg( KIO::convertSize( queued ) ); @@ -1859,15 +1859,15 @@ MediaBrowser::updateStats() } m_stats->setText(text); - QToolTip::add( m_stats, text ); + TQToolTip::add( m_stats, text ); } bool -MediaView::setFilter( const QString &filter, MediaItem *parent ) +MediaView::setFilter( const TQString &filter, MediaItem *parent ) { bool advanced = ExpressionParser::isAdvancedExpression( filter ); - QValueList defaultColumns; + TQValueList defaultColumns; defaultColumns << MetaBundle::Album; defaultColumns << MetaBundle::Title; defaultColumns << MetaBundle::Artist; @@ -1910,8 +1910,8 @@ MediaView::setFilter( const QString &filter, MediaItem *parent ) else if(it->type()==MediaItem::DIRECTORY) { bool match = true; - QStringList list = QStringList::split( " ", filter ); - for( QStringList::iterator i = list.begin(); + TQStringList list = TQStringList::split( " ", filter ); + for( TQStringList::iterator i = list.begin(); i != list.end(); ++i ) { @@ -2009,9 +2009,9 @@ MediaDevice::loadConfig() } QString -MediaDevice::configString( const QString &name, const QString &defValue ) +MediaDevice::configString( const TQString &name, const TQString &defValue ) { - QString configName = "MediaDevice"; + TQString configName = "MediaDevice"; if( !uniqueId().isEmpty() ) configName += '_' + uniqueId(); KConfig *config = Amarok::config( configName ); @@ -2019,9 +2019,9 @@ MediaDevice::configString( const QString &name, const QString &defValue ) } void -MediaDevice::setConfigString( const QString &name, const QString &value ) +MediaDevice::setConfigString( const TQString &name, const TQString &value ) { - QString configName = "MediaDevice"; + TQString configName = "MediaDevice"; if( !uniqueId().isEmpty() ) configName += '_' + uniqueId(); KConfig *config = Amarok::config( configName ); @@ -2029,9 +2029,9 @@ MediaDevice::setConfigString( const QString &name, const QString &value ) } bool -MediaDevice::configBool( const QString &name, bool defValue ) +MediaDevice::configBool( const TQString &name, bool defValue ) { - QString configName = "MediaDevice"; + TQString configName = "MediaDevice"; if( !uniqueId().isEmpty() ) configName += '_' + uniqueId(); KConfig *config = Amarok::config( configName ); @@ -2039,9 +2039,9 @@ MediaDevice::configBool( const QString &name, bool defValue ) } void -MediaDevice::setConfigBool( const QString &name, bool value ) +MediaDevice::setConfigBool( const TQString &name, bool value ) { - QString configName = "MediaDevice"; + TQString configName = "MediaDevice"; if( !uniqueId().isEmpty() ) configName += '_' + uniqueId(); KConfig *config = Amarok::config( configName ); @@ -2074,7 +2074,7 @@ MediaDevice::updateRootItems() } void -MediaQueue::syncPlaylist( const QString &name, const QString &query, bool loading ) +MediaQueue::syncPlaylist( const TQString &name, const TQString &query, bool loading ) { MediaItem* item = new MediaItem( this, lastItem() ); item->setType( MediaItem::PLAYLIST ); @@ -2090,7 +2090,7 @@ MediaQueue::syncPlaylist( const QString &name, const QString &query, bool loadin } void -MediaQueue::syncPlaylist( const QString &name, const KURL &url, bool loading ) +MediaQueue::syncPlaylist( const TQString &name, const KURL &url, bool loading ) { MediaItem* item = new MediaItem( this, lastItem() ); item->setType( MediaItem::PLAYLIST ); @@ -2105,7 +2105,7 @@ MediaQueue::syncPlaylist( const QString &name, const KURL &url, bool loading ) } BundleList -MediaDevice::bundlesToSync( const QString &name, const KURL &url ) +MediaDevice::bundlesToSync( const TQString &name, const KURL &url ) { BundleList bundles; if( !PlaylistFile::isPlaylistFile( url ) ) @@ -2134,19 +2134,19 @@ MediaDevice::bundlesToSync( const QString &name, const KURL &url ) } BundleList -MediaDevice::bundlesToSync( const QString &name, const QString &query ) +MediaDevice::bundlesToSync( const TQString &name, const TQString &query ) { - const QStringList values = CollectionDB::instance()->query( query ); + const TQStringList values = CollectionDB::instance()->query( query ); BundleList bundles; - for( for_iterators( QStringList, values ); it != end; ++it ) + for( for_iterators( TQStringList, values ); it != end; ++it ) bundles += CollectionDB::instance()->bundleFromQuery( &it ); preparePlaylistForSync( name, bundles ); return bundles; } void -MediaDevice::preparePlaylistForSync( const QString &name, const BundleList &bundles ) +MediaDevice::preparePlaylistForSync( const TQString &name, const BundleList &bundles ) { if( ! m_playlistItem ) // might be syncing a new playlist from the playlist browser return; @@ -2209,7 +2209,7 @@ MediaDevice::isInBundleList( const BundleList &bundles, const MetaBundle &b ) } bool -MediaDevice::isOnOtherPlaylist( const QString &playlistToAvoid, const MetaBundle &bundle ) +MediaDevice::isOnOtherPlaylist( const TQString &playlistToAvoid, const MetaBundle &bundle ) { for( MediaItem *it = static_cast(m_playlistItem->firstChild()); it; @@ -2242,13 +2242,13 @@ MediaDevice::isOnPlaylist( const MediaItem &playlist, const MetaBundle &bundle ) } void -MediaQueue::addURL( const KURL& url2, MetaBundle *bundle, const QString &playlistName ) +MediaQueue::addURL( const KURL& url2, MetaBundle *bundle, const TQString &playlistName ) { KURL url = Amarok::mostLocalURL( url2 ); if( PlaylistFile::isPlaylistFile( url ) ) { - QString name = url.path().section( "/", -1 ).section( ".", 0, -2 ).replace( "_", " " ); + TQString name = url.path().section( "/", -1 ).section( ".", 0, -2 ).replace( "_", " " ); PlaylistFile playlist( url.path() ); if( playlist.isError() ) @@ -2278,7 +2278,7 @@ MediaQueue::addURL( const KURL& url2, MetaBundle *bundle, const QString &playlis } return; } - else if( url.protocol() == "file" && QFileInfo( url.path() ).isDir() ) + else if( url.protocol() == "file" && TQFileInfo( url.path() ).isDir() ) { KURL::List urls = Amarok::recursiveUrlExpand( url ); foreachType( KURL::List, urls ) @@ -2314,7 +2314,7 @@ MediaQueue::addURL( const KURL& url2, MetaBundle *bundle, const QString &playlis } item->m_playlistName = playlistName; - QString text = item->bundle()->prettyTitle(); + TQString text = item->bundle()->prettyTitle(); if( text.isEmpty() || (!item->bundle()->isValidMedia() && !item->bundle()->podcastBundle()) ) text = item->bundle()->url().prettyURL(); if( !item->m_playlistName.isNull() ) @@ -2345,10 +2345,10 @@ MediaQueue::addURL( const KURL &url, MediaItem *item ) { item->setType( MediaItem::PODCASTITEM ); } - QString text = item->bundle()->prettyTitle(); + TQString text = item->bundle()->prettyTitle(); if( text.isEmpty() || (!item->bundle()->isValidMedia() && !item->bundle()->podcastBundle()) ) text = item->bundle()->url().prettyURL(); - if( item->m_playlistName != QString::null ) + if( item->m_playlistName != TQString::null ) { text += " (" + item->m_playlistName + ')'; } @@ -2362,7 +2362,7 @@ MediaQueue::addURL( const KURL &url, MediaItem *item ) } void -MediaQueue::addURLs( const KURL::List urls, const QString &playlistName ) +MediaQueue::addURLs( const KURL::List urls, const TQString &playlistName ) { KURL::List::ConstIterator it = urls.begin(); for ( ; it != urls.end(); ++it ) @@ -2391,30 +2391,30 @@ MediaDevice::copyTrackFromDevice( MediaItem *item ) debug() << "copyTrackFromDevice: not copying " << item->url() << ": not implemented" << endl; } -QDragObject * +TQDragObject * MediaQueue::dragObject() { KURL::List urls; - for( QListViewItem *it = firstChild(); it; it = it->nextSibling() ) + for( TQListViewItem *it = firstChild(); it; it = it->nextSibling() ) { if( it->isVisible() && it->isSelected() && dynamic_cast(it) ) urls += static_cast(it)->url(); } KMultipleDrag *md = new KMultipleDrag( viewport() ); - QDragObject *d = KListView::dragObject(); + TQDragObject *d = KListView::dragObject(); KURLDrag* urldrag = new KURLDrag( urls, viewport() ); md->addDragObject( d ); md->addDragObject( urldrag ); md->setPixmap( CollectionDB::createDragPixmap( urls ), - QPoint( CollectionDB::DRAGPIXMAP_OFFSET_X, CollectionDB::DRAGPIXMAP_OFFSET_Y ) ); + TQPoint( CollectionDB::DRAGPIXMAP_OFFSET_X, CollectionDB::DRAGPIXMAP_OFFSET_Y ) ); return md; } QString -MediaDevice::replaceVariables( const QString &cmd ) +MediaDevice::replaceVariables( const TQString &cmd ) { - QString result = cmd; + TQString result = cmd; result.replace( "%d", deviceNode() ); result.replace( "%m", mountPoint() ); return result; @@ -2425,7 +2425,7 @@ int MediaDevice::runPreConnectCommand() if( m_preconnectcmd.isEmpty() ) return 0; - QString cmd = replaceVariables( m_preconnectcmd ); + TQString cmd = replaceVariables( m_preconnectcmd ); debug() << "running pre-connect command: [" << cmd << "]" << endl; int e=sysCall(cmd); @@ -2438,7 +2438,7 @@ int MediaDevice::runPostDisconnectCommand() if( m_postdisconnectcmd.isEmpty() ) return 0; - QString cmd = replaceVariables( m_postdisconnectcmd ); + TQString cmd = replaceVariables( m_postdisconnectcmd ); debug() << "running post-disconnect command: [" << cmd << "]" << endl; int e=sysCall(cmd); debug() << "post-disconnect: e=" << e << endl; @@ -2446,7 +2446,7 @@ int MediaDevice::runPostDisconnectCommand() return e; } -int MediaDevice::sysCall( const QString &command ) +int MediaDevice::sysCall( const TQString &command ) { if ( sysProc->isRunning() ) return -1; @@ -2475,8 +2475,8 @@ MediaDevice::kioCopyTrack( const KURL &src, const KURL &dst ) false /* overwrite */, false /* resume */, false /* show progress */ ); - connect( job, SIGNAL( result( KIO::Job * ) ), - this, SLOT( fileTransferred( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), + this, TQT_SLOT( fileTransferred( KIO::Job * ) ) ); bool tryToRemove = false; while ( m_wait ) @@ -2520,7 +2520,7 @@ MediaDevice::kioCopyTrack( const KURL &src, const KURL &dst ) if( tryToRemove ) { - QFile::remove( dst.path() ); + TQFile::remove( dst.path() ); return false; } @@ -2680,7 +2680,7 @@ MediaDevice::connectDevice( bool silent ) // delete podcasts already played if( m_autoDeletePodcasts && m_podcastItem ) { - QPtrList list; + TQPtrList list; //NOTE we assume that currentItem is the main target int numFiles = m_view->getSelectedLeaves( m_podcastItem, &list, MediaView::OnlyPlayed ); @@ -2708,7 +2708,7 @@ MediaDevice::connectDevice( bool silent ) synchronizeDevice(); - QTimer::singleShot( 1500, m_parent->m_progressBox, SLOT(hide()) ); + TQTimer::singleShot( 1500, m_parent->m_progressBox, TQT_SLOT(hide()) ); m_parent->queue()->computeSize(); m_parent->updateStats(); } @@ -2807,10 +2807,10 @@ MediaDevice::syncStatsFromDevice( MediaItem *root ) } // increase Amarok playcount - QString url = CollectionDB::instance()->getURL( *bundle ); - if( url != QString::null ) + TQString url = CollectionDB::instance()->getURL( *bundle ); + if( url != TQString::null ) { - QDateTime t = it->playTime(); + TQDateTime t = it->playTime(); CollectionDB::instance()->addSongPercentage( url, 100, "mediadevice", t.isValid() ? &t : 0 ); debug() << "played " << url << endl; } @@ -2819,9 +2819,9 @@ MediaDevice::syncStatsFromDevice( MediaItem *root ) if( it->ratingChanged() ) { // copy rating from media device to Amarok - QString url = CollectionDB::instance()->getURL( *bundle ); + TQString url = CollectionDB::instance()->getURL( *bundle ); debug() << "rating changed " << url << ": " << it->rating()/10 << endl; - if( url != QString::null ) + if( url != TQString::null ) { CollectionDB::instance()->setSongRating( url, it->rating()/10 ); it->setRating( it->rating() ); // prevent setting it again next time @@ -2859,7 +2859,7 @@ MediaDevice::syncStatsFromDevice( MediaItem *root ) } void -MediaItem::syncStatsFromPath( const QString &url ) +MediaItem::syncStatsFromPath( const TQString &url ) { if( url.isEmpty() ) return; @@ -2871,7 +2871,7 @@ MediaItem::syncStatsFromPath( const QString &url ) int playcount = CollectionDB::instance()->getPlayCount( url ); if( playcount > played() ) setPlayCount( playcount ); - QDateTime lastplay = CollectionDB::instance()->getLastPlay( url ); + TQDateTime lastplay = CollectionDB::instance()->getLastPlay( url ); if( lastplay > playTime() ) setLastPlayed( lastplay.toTime_t() ); } @@ -2895,7 +2895,7 @@ MediaDevice::syncStatsToDevice( MediaItem *root ) if( !it->parent() || static_cast( it->parent() )->type() != MediaItem::PLAYLIST ) { const MetaBundle *bundle = it->bundle(); - QString url = CollectionDB::instance()->getURL( *bundle ); + TQString url = CollectionDB::instance()->getURL( *bundle ); it->syncStatsFromPath( url ); } break; @@ -2985,7 +2985,7 @@ MediaDevice::transferFiles() if( bundles.count() > 1 ) setProgress( progress(), MediaBrowser::instance()->m_progress->totalSteps() + bundles.count() - 1 ); - QString playlist = transferredItem->m_playlistName; + TQString playlist = transferredItem->m_playlistName; for( BundleList::const_iterator it = bundles.begin(); it != bundles.end(); ++it ) @@ -3010,7 +3010,7 @@ MediaDevice::transferFiles() { if( m_transcode && ( !isPlayable( *bundle ) || m_transcodeAlways ) ) { - QString preferred = supportedFiletypes().isEmpty() ? "mp3" : supportedFiletypes().first(); + TQString preferred = supportedFiletypes().isEmpty() ? "mp3" : supportedFiletypes().first(); debug() << "transcoding " << bundle->url() << " to " << preferred << endl; KURL transcoded = MediaBrowser::instance()->transcode( bundle->url(), preferred ); if( isCanceled() ) @@ -3041,7 +3041,7 @@ MediaDevice::transferFiles() //to make sure it ends up with the correct extension //in the generic mediadevice. KURL localUrl = transcodedBundle->podcastBundle()->localUrl(); - QString filename = QFileInfo( localUrl.path() ).baseName() + '.' + preferred; + TQString filename = TQFileInfo( localUrl.path() ).baseName() + '.' + preferred; localUrl.setFileName( filename ); transcodedBundle->podcastBundle()->setLocalURL( localUrl ); } @@ -3080,7 +3080,7 @@ MediaDevice::transferFiles() if( transcoding ) { if( m_transcodeRemove ) - QFile( bundle->url().path() ).remove(); + TQFile( bundle->url().path() ).remove(); delete bundle; bundle = 0; @@ -3102,12 +3102,12 @@ MediaDevice::transferFiles() MediaItem *pl = m_playlistItem->findItem( playlist ); if( !pl ) { - QPtrList items; + TQPtrList items; pl = newPlaylist( playlist, m_playlistItem, items ); } if( pl ) { - QPtrList items; + TQPtrList items; items.append( item ); addToPlaylist( pl, pl->lastChild(), items ); } @@ -3138,7 +3138,7 @@ MediaDevice::transferFiles() unlockDevice(); fileTransferFinished(); - QString msg; + TQString msg; if( unplayable.count() > 0 ) { msg = i18n( "One track not playable on media device", @@ -3169,7 +3169,7 @@ MediaDevice::transferFiles() if( unplayable.count() + existing.count() > 0 ) { - QString longMsg = i18n( "The following tracks were not transferred: "); + TQString longMsg = i18n( "The following tracks were not transferred: "); for( KURL::List::Iterator it = existing.begin(); it != existing.end(); it++ ) @@ -3245,7 +3245,7 @@ MediaDevice::deleteFromDevice(MediaItem *item, int flags ) m_deleting = true; - QPtrList list; + TQPtrList list; //NOTE we assume that currentItem is the main target int numFiles = m_view->getSelectedLeaves(item, &list, MediaView::OnlySelected | ((flags & OnlyPlayed) ? MediaView::OnlyPlayed : MediaView::None) ); @@ -3257,7 +3257,7 @@ MediaDevice::deleteFromDevice(MediaItem *item, int flags ) "

You have selected %n tracks to be irreversibly deleted.", numFiles ), - QString::null, + TQString::null, KGuiItem(i18n("&Delete"),"editdelete") ); if ( button != KMessageBox::Continue ) @@ -3329,7 +3329,7 @@ MediaDevice::deleteFromDevice(MediaItem *item, int flags ) if(!isTransferring()) { - QTimer::singleShot( 1500, m_parent->m_progressBox, SLOT(hide()) ); + TQTimer::singleShot( 1500, m_parent->m_progressBox, TQT_SLOT(hide()) ); } if( m_deferredDisconnect ) @@ -3371,14 +3371,14 @@ MediaDevice::purgeEmptyItems( MediaItem *root ) } void -MediaQueue::save( const QString &path ) +MediaQueue::save( const TQString &path ) { - QFile file( path ); + TQFile file( path ); if( !file.open( IO_WriteOnly ) ) return; - QDomDocument newdoc; - QDomElement transferlist = newdoc.createElement( "playlist" ); + TQDomDocument newdoc; + TQDomElement transferlist = newdoc.createElement( "playlist" ); transferlist.setAttribute( "product", "Amarok" ); transferlist.setAttribute( "version", APP_VERSION ); newdoc.appendChild( transferlist ); @@ -3387,13 +3387,13 @@ MediaQueue::save( const QString &path ) item; item = static_cast( item->nextSibling() ) ) { - QDomElement i = newdoc.createElement("item"); + TQDomElement i = newdoc.createElement("item"); i.setAttribute("url", item->url().url()); if( item->bundle() ) { - QDomElement attr = newdoc.createElement( "Title" ); - QDomText t = newdoc.createTextNode( item->bundle()->title() ); + TQDomElement attr = newdoc.createElement( "Title" ); + TQDomText t = newdoc.createTextNode( item->bundle()->title() ); attr.appendChild( t ); i.appendChild( attr ); @@ -3408,7 +3408,7 @@ MediaQueue::save( const QString &path ) i.appendChild( attr ); attr = newdoc.createElement( "Year" ); - t = newdoc.createTextNode( QString::number( item->bundle()->year() ) ); + t = newdoc.createTextNode( TQString::number( item->bundle()->year() ) ); attr.appendChild( t ); i.appendChild( attr ); @@ -3423,7 +3423,7 @@ MediaQueue::save( const QString &path ) i.appendChild( attr ); attr = newdoc.createElement( "Track" ); - t = newdoc.createTextNode( QString::number( item->bundle()->track() ) ); + t = newdoc.createTextNode( TQString::number( item->bundle()->track() ) ); attr.appendChild( t ); i.appendChild( attr ); } @@ -3437,8 +3437,8 @@ MediaQueue::save( const QString &path ) && item->bundle()->podcastBundle()) { PodcastEpisodeBundle *peb = item->bundle()->podcastBundle(); - QDomElement attr = newdoc.createElement( "PodcastDescription" ); - QDomText t = newdoc.createTextNode( peb->description() ); + TQDomElement attr = newdoc.createElement( "PodcastDescription" ); + TQDomText t = newdoc.createTextNode( peb->description() ); attr.appendChild( t ); i.appendChild( attr ); @@ -3458,7 +3458,7 @@ MediaQueue::save( const QString &path ) i.appendChild( attr ); } - if(item->m_playlistName != QString::null) + if(item->m_playlistName != TQString::null) { i.setAttribute( "playlist", item->m_playlistName ); } @@ -3473,28 +3473,28 @@ MediaQueue::save( const QString &path ) transferlist.appendChild( i ); } - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); stream << "\n"; stream << newdoc.toString(); } void -MediaQueue::load( const QString& filename ) +MediaQueue::load( const TQString& filename ) { - QFile file( filename ); + TQFile file( filename ); if( !file.open( IO_ReadOnly ) ) { return; } clearItems(); - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); - QDomDocument d; - QString er; + TQDomDocument d; + TQString er; int l, c; if( !d.setContent( stream.read(), &er, &l, &c ) ) { // return error values Amarok::StatusBar::instance()->longMessageThreadSafe( i18n( @@ -3506,13 +3506,13 @@ MediaQueue::load( const QString& filename ) return; } - QValueList nodes; - const QString ITEM( "item" ); //so we don't construct this QString all the time - for( QDomNode n = d.namedItem( "playlist" ).firstChild(); !n.isNull(); n = n.nextSibling() ) + TQValueList nodes; + const TQString ITEM( "item" ); //so we don't construct this TQString all the time + for( TQDomNode n = d.namedItem( "playlist" ).firstChild(); !n.isNull(); n = n.nextSibling() ) { if( n.nodeName() != ITEM ) continue; - QDomElement elem = n.toElement(); + TQDomElement elem = n.toElement(); if( !elem.isNull() ) nodes += n; @@ -3527,7 +3527,7 @@ MediaQueue::load( const QString& filename ) if( url.isLocalFile() ) peb.setLocalURL( url ); MetaBundle *bundle = new MetaBundle( url ); - for(QDomNode node = elem.firstChild(); + for(TQDomNode node = elem.firstChild(); !node.isNull(); node = node.nextSibling()) { @@ -3561,11 +3561,11 @@ MediaQueue::load( const QString& filename ) bundle->setPodcastBundle( peb ); } - QString playlist = elem.attribute( "playlist" ); - QString playlistdata = elem.attribute( "playlistdata" ); + TQString playlist = elem.attribute( "playlist" ); + TQString playlistdata = elem.attribute( "playlistdata" ); if( !playlistdata.isEmpty() ) { - QString smart = elem.attribute( "smartplaylist" ); + TQString smart = elem.attribute( "smartplaylist" ); if( smart.isEmpty() ) syncPlaylist( playlist, KURL::fromPathOrURL( playlistdata ), true ); else @@ -3584,7 +3584,7 @@ MediaDevice::isPlayable( const MetaBundle &bundle ) if( supportedFiletypes().isEmpty() ) return true; - QString type = bundle.url().path().section( ".", -1 ).lower(); + TQString type = bundle.url().path().section( ".", -1 ).lower(); return supportedFiletypes().contains( type ); } @@ -3594,7 +3594,7 @@ MediaDevice::isPreferredFormat( const MetaBundle &bundle ) if( supportedFiletypes().isEmpty() ) return true; - QString type = bundle.url().path().section( ".", -1 ).lower(); + TQString type = bundle.url().path().section( ".", -1 ).lower(); return ( type == supportedFiletypes().first() ); } @@ -3603,7 +3603,7 @@ MediaQueue::MediaQueue(MediaBrowser *parent) : KListView( parent ), m_parent( parent ) { setFixedHeight( 200 ); - setSelectionMode( QListView::Extended ); + setSelectionMode( TQListView::Extended ); setItemsMovable( true ); setDragEnabled( true ); setShowSortIndicator( false ); @@ -3619,20 +3619,20 @@ MediaQueue::MediaQueue(MediaBrowser *parent) itemCountChanged(); KActionCollection* ac = new KActionCollection( this ); - KStdAction::selectAll( this, SLOT( selectAll() ), ac, "MediaQueue" ); + KStdAction::selectAll( this, TQT_SLOT( selectAll() ), ac, "MediaQueue" ); - connect( this, SIGNAL( contextMenuRequested( QListViewItem*, const QPoint&, int ) ), - SLOT( slotShowContextMenu( QListViewItem*, const QPoint&, int ) ) ); - connect( this, SIGNAL( dropped(QDropEvent*, QListViewItem*, QListViewItem*) ), - SLOT( slotDropped(QDropEvent*, QListViewItem*, QListViewItem*) ) ); + connect( this, TQT_SIGNAL( contextMenuRequested( TQListViewItem*, const TQPoint&, int ) ), + TQT_SLOT( slotShowContextMenu( TQListViewItem*, const TQPoint&, int ) ) ); + connect( this, TQT_SIGNAL( dropped(TQDropEvent*, TQListViewItem*, TQListViewItem*) ), + TQT_SLOT( slotDropped(TQDropEvent*, TQListViewItem*, TQListViewItem*) ) ); } bool -MediaQueue::acceptDrag( QDropEvent *e ) const +MediaQueue::acceptDrag( TQDropEvent *e ) const { - QString data; - QCString subtype; - QTextDrag::decode( e, data, subtype ); + TQString data; + TQCString subtype; + TQTextDrag::decode( e, data, subtype ); return e->source() == viewport() || subtype == "amarok-sql" @@ -3640,20 +3640,20 @@ MediaQueue::acceptDrag( QDropEvent *e ) const } void -MediaQueue::slotDropped( QDropEvent* e, QListViewItem* parent, QListViewItem* after) +MediaQueue::slotDropped( TQDropEvent* e, TQListViewItem* parent, TQListViewItem* after) { if( e->source() != viewport() ) { - QString data; - QCString subtype; - QTextDrag::decode( e, data, subtype ); + TQString data; + TQCString subtype; + TQTextDrag::decode( e, data, subtype ); KURL::List list; if( subtype == "amarok-sql" ) { - QString playlist = data.section( "\n", 0, 0 ); - QString query = data.section( "\n", 1 ); - QStringList values = CollectionDB::instance()->query( query ); + TQString playlist = data.section( "\n", 0, 0 ); + TQString query = data.section( "\n", 1 ); + TQStringList values = CollectionDB::instance()->query( query ); list = CollectionDB::instance()->URLsFromSqlDrag( values ); addURLs( list, playlist ); } @@ -3662,22 +3662,22 @@ MediaQueue::slotDropped( QDropEvent* e, QListViewItem* parent, QListViewItem* af addURLs( list ); } } - else if( QListViewItem *i = currentItem() ) + else if( TQListViewItem *i = currentItem() ) { moveItem( i, parent, after ); } } void -MediaQueue::dropProxyEvent( QDropEvent *e ) +MediaQueue::dropProxyEvent( TQDropEvent *e ) { slotDropped( e, 0, 0 ); } MediaItem* -MediaQueue::findPath( QString path ) +MediaQueue::findPath( TQString path ) { - for( QListViewItem *item = firstChild(); + for( TQListViewItem *item = firstChild(); item; item = item->nextSibling()) { @@ -3692,7 +3692,7 @@ void MediaQueue::computeSize() const { m_totalSize = 0; - for( QListViewItem *it = firstChild(); + for( TQListViewItem *it = firstChild(); it; it = it->nextSibling()) { @@ -3735,9 +3735,9 @@ MediaQueue::subtractItemFromSize( const MediaItem *item, bool unconditionally ) void MediaQueue::removeSelected() { - QPtrList selected = selectedItems(); + TQPtrList selected = selectedItems(); - for( QListViewItem *item = selected.first(); item; item = selected.next() ) + for( TQListViewItem *item = selected.first(); item; item = selected.next() ) { if( !(static_cast(item)->flags() & MediaItem::Transferring) ) { @@ -3756,7 +3756,7 @@ MediaQueue::removeSelected() } void -MediaQueue::keyPressEvent( QKeyEvent *e ) +MediaQueue::keyPressEvent( TQKeyEvent *e ) { if( e->key() == Key_Delete ) removeSelected(); @@ -3774,7 +3774,7 @@ MediaQueue::itemCountChanged() } void -MediaQueue::slotShowContextMenu( QListViewItem* item, const QPoint& point, int ) +MediaQueue::slotShowContextMenu( TQListViewItem* item, const TQPoint& point, int ) { if( !childCount() ) return; diff --git a/amarok/src/mediabrowser.h b/amarok/src/mediabrowser.h index 31eef055..d8837dea 100644 --- a/amarok/src/mediabrowser.h +++ b/amarok/src/mediabrowser.h @@ -15,9 +15,9 @@ #include "plugin/plugin.h" //baseclass #include "pluginmanager.h" -#include -#include //baseclass -#include +#include +#include //baseclass +#include #include //baseclass #include //stack allocated @@ -39,17 +39,17 @@ class KProgress; class KPushButton; class KShellProcess; -class QDragObject; -class QLabel; -class QPalette; +class TQDragObject; +class TQLabel; +class TQPalette; class LIBAMAROK_EXPORT MediaItem : public KListViewItem { public: - MediaItem( QListView* parent ); - MediaItem( QListViewItem* parent ); - MediaItem( QListView* parent, QListViewItem* after ); - MediaItem( QListViewItem* parent, QListViewItem* after ); + MediaItem( TQListView* parent ); + MediaItem( TQListViewItem* parent ); + MediaItem( TQListView* parent, TQListViewItem* after ); + MediaItem( TQListViewItem* parent, TQListViewItem* after ); void init(); virtual ~MediaItem(); @@ -68,13 +68,13 @@ class LIBAMAROK_EXPORT MediaItem : public KListViewItem void setType( Type type ); void setFailed( bool failed=true ); Type type() const { return m_type; } - MediaItem *findItem(const QString &key, const MediaItem *after=0) const; - const QString &data() const { return m_data; } - void setData( const QString &data ) { m_data = data; } + MediaItem *findItem(const TQString &key, const MediaItem *after=0) const; + const TQString &data() const { return m_data; } + void setData( const TQString &data ) { m_data = data; } virtual bool isLeafItem() const; // A leaf node of the tree virtual bool isFileBacked() const; // Should the file be deleted of the device when removed - virtual QDateTime playTime() const { return QDateTime(); } + virtual TQDateTime playTime() const { return TQDateTime(); } virtual int played() const { return 0; } virtual int recentlyPlayed() const { return 0; } // no of times played on device since last sync virtual void setPlayCount( int ) {} @@ -82,41 +82,41 @@ class LIBAMAROK_EXPORT MediaItem : public KListViewItem virtual void setRating( int /*rating*/ ) {} virtual bool ratingChanged() const { return false; } virtual void setLastPlayed( uint ) {} - virtual void syncStatsFromPath( const QString &path ); + virtual void syncStatsFromPath( const TQString &path ); virtual long size() const; virtual MediaDevice *device() const { return m_device; } virtual bool listened() const { return m_listened; } virtual void setListened( bool listened=true ) { m_listened = listened; } - int compare( QListViewItem *i, int col, bool ascending ) const; + int compare( TQListViewItem *i, int col, bool ascending ) const; int flags() const { return m_flags; } - void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align ); + void paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align ); //attributes: int m_order; Type m_type; - QString m_playlistName; - QString m_data; + TQString m_playlistName; + TQString m_data; MediaDevice *m_device; int m_flags; bool m_listened; - static QPixmap *s_pixUnknown; - static QPixmap *s_pixRootItem; - static QPixmap *s_pixFile; - static QPixmap *s_pixArtist; - static QPixmap *s_pixAlbum; - static QPixmap *s_pixPlaylist; - static QPixmap *s_pixPodcast; - static QPixmap *s_pixTrack; - static QPixmap *s_pixInvisible; - static QPixmap *s_pixStale; - static QPixmap *s_pixOrphaned; - static QPixmap *s_pixDirectory; - static QPixmap *s_pixTransferFailed; - static QPixmap *s_pixTransferBegin; - static QPixmap *s_pixTransferEnd; + static TQPixmap *s_pixUnknown; + static TQPixmap *s_pixRootItem; + static TQPixmap *s_pixFile; + static TQPixmap *s_pixArtist; + static TQPixmap *s_pixAlbum; + static TQPixmap *s_pixPlaylist; + static TQPixmap *s_pixPodcast; + static TQPixmap *s_pixTrack; + static TQPixmap *s_pixInvisible; + static TQPixmap *s_pixStale; + static TQPixmap *s_pixOrphaned; + static TQPixmap *s_pixDirectory; + static TQPixmap *s_pixTransferFailed; + static TQPixmap *s_pixTransferBegin; + static TQPixmap *s_pixTransferEnd; private: mutable MetaBundle *m_bundle; @@ -128,7 +128,7 @@ class MediaQueue : public KListView, public DropProxyTarget public: MediaQueue(MediaBrowser *parent); - MediaItem *findPath( QString path ); + MediaItem *findPath( TQString path ); KIO::filesize_t totalSize() const; // total size of items to transfer in KB void computeSize() const; // compute total size of items to transfer in KB @@ -138,31 +138,31 @@ class MediaQueue : public KListView, public DropProxyTarget void removeSelected(); void clearItems(); - void load( const QString &path ); - void save( const QString &path ); - void syncPlaylist( const QString &playlistName, const QString &sql, bool loading=false ); - void syncPlaylist( const QString &playlistName, const KURL &url, bool loading=false ); - void addURL( const KURL& url, MetaBundle *bundle=NULL, const QString &playlistName=QString::null ); + void load( const TQString &path ); + void save( const TQString &path ); + void syncPlaylist( const TQString &playlistName, const TQString &sql, bool loading=false ); + void syncPlaylist( const TQString &playlistName, const KURL &url, bool loading=false ); + void addURL( const KURL& url, MetaBundle *bundle=NULL, const TQString &playlistName=TQString::null ); void addURL( const KURL& url, MediaItem *item ); - void addURLs( const KURL::List urls, const QString &playlistName=QString::null ); + void addURLs( const KURL::List urls, const TQString &playlistName=TQString::null ); void URLsAdded(); // call after finishing adding single urls - void dropProxyEvent( QDropEvent *e ); + void dropProxyEvent( TQDropEvent *e ); // Reimplemented from KListView - bool acceptDrag( QDropEvent *e ) const; - QDragObject *dragObject(); + bool acceptDrag( TQDropEvent *e ) const; + TQDragObject *dragObject(); public slots: void itemCountChanged(); private slots: - void selectAll() {QListView::selectAll(true); } - void slotShowContextMenu( QListViewItem* item, const QPoint& point, int ); - void slotDropped (QDropEvent* e, QListViewItem* parent, QListViewItem* after); + void selectAll() {TQListView::selectAll(true); } + void slotShowContextMenu( TQListViewItem* item, const TQPoint& point, int ); + void slotDropped (TQDropEvent* e, TQListViewItem* parent, TQListViewItem* after); private: - void keyPressEvent( QKeyEvent *e ); + void keyPressEvent( TQKeyEvent *e ); MediaBrowser *m_parent; mutable KIO::filesize_t m_totalSize; }; @@ -189,14 +189,14 @@ class MediaBrowser : public QVBox virtual ~MediaBrowser(); bool blockQuit() const; MediaDevice *currentDevice() const; - MediaDevice *deviceFromId( const QString &id ) const; - QStringList deviceNames() const; - bool deviceSwitch( const QString &name ); + MediaDevice *deviceFromId( const TQString &id ) const; + TQStringList deviceNames() const; + bool deviceSwitch( const TQString &name ); - QString getInternalPluginName ( const QString string ) { return m_pluginName[string]; } - QString getDisplayPluginName ( const QString string ) { return m_pluginAmarokName[string]; } + TQString getInternalPluginName ( const TQString string ) { return m_pluginName[string]; } + TQString getDisplayPluginName ( const TQString string ) { return m_pluginAmarokName[string]; } const KTrader::OfferList &getPlugins() { return m_plugins; } - void transcodingFinished( const QString &src, const QString &dst ); + void transcodingFinished( const TQString &src, const TQString &dst ); bool isTranscoding() const { return m_waitForTranscode; } void updateStats(); void updateButtons(); @@ -217,14 +217,14 @@ class MediaBrowser : public QVBox private slots: void slotSetFilterTimeout(); void slotSetFilter(); - void slotSetFilter( const QString &filter ); + void slotSetFilter( const TQString &filter ); void slotEditFilter(); - void mediumAdded( const Medium *, QString , bool constructing = false); - void mediumChanged( const Medium *, QString ); - void mediumRemoved( const Medium *, QString ); + void mediumAdded( const Medium *, TQString , bool constructing = false); + void mediumChanged( const Medium *, TQString ); + void mediumRemoved( const Medium *, TQString ); void activateDevice( const MediaDevice *device ); void activateDevice( int index, bool skipDummy = true ); - void pluginSelected( const Medium *, const QString ); + void pluginSelected( const Medium *, const TQString ); void showPluginManager(); void cancelClicked(); void connectClicked(); @@ -232,43 +232,43 @@ class MediaBrowser : public QVBox void customClicked(); void configSelectPlugin( int index ); bool config(); // false if canceled by user - KURL transcode( const KURL &src, const QString &filetype ); + KURL transcode( const KURL &src, const TQString &filetype ); void tagsChanged( const MetaBundle &bundle ); void prepareToQuit(); private: - MediaDevice *loadDevicePlugin( const QString &deviceName ); + MediaDevice *loadDevicePlugin( const TQString &deviceName ); void unloadDevicePlugin( MediaDevice *device ); KLineEdit* m_searchEdit; - QTimer *m_timer; + TQTimer *m_timer; LIBAMAROK_EXPORT static MediaBrowser *s_instance; - QValueList m_devices; - QValueList::iterator m_currentDevice; + TQValueList m_devices; + TQValueList::iterator m_currentDevice; - QMap m_pluginName; - QMap m_pluginAmarokName; + TQMap m_pluginName; + TQMap m_pluginAmarokName; void addDevice( MediaDevice *device ); void removeDevice( MediaDevice *device ); MediaQueue* m_queue; bool m_waitForTranscode; KURL m_transcodedUrl; - QString m_transcodeSrc; + TQString m_transcodeSrc; SpaceLabel* m_stats; - QHBox* m_progressBox; + TQHBox* m_progressBox; KProgress* m_progress; - QVBox* m_views; + TQVBox* m_views; KPushButton* m_cancelButton; //KPushButton* m_playlistButton; - QVBox* m_configBox; + TQVBox* m_configBox; KComboBox* m_configPluginCombo; KComboBox* m_deviceCombo; Browser::ToolBar*m_toolbar; - typedef QMap ItemMap; - mutable QMutex m_itemMapMutex; + typedef TQMap ItemMap; + mutable TQMutex m_itemMapMutex; ItemMap m_itemMap; KTrader::OfferList m_plugins; bool m_haveDevices; @@ -289,30 +289,30 @@ class MediaView : public KListView OnlyPlayed = 2 }; - MediaView( QWidget *parent, MediaDevice *device ); + MediaView( TQWidget *parent, MediaDevice *device ); virtual ~MediaView(); LIBAMAROK_EXPORT KURL::List nodeBuildDragList( MediaItem* item, int flags=OnlySelected ); - int getSelectedLeaves(MediaItem *parent, QPtrList *list, int flags=OnlySelected ); + int getSelectedLeaves(MediaItem *parent, TQPtrList *list, int flags=OnlySelected ); LIBAMAROK_EXPORT MediaItem *newDirectory( MediaItem* parent ); - bool setFilter( const QString &filter, MediaItem *parent=NULL ); + bool setFilter( const TQString &filter, MediaItem *parent=NULL ); private slots: - void rmbPressed( QListViewItem*, const QPoint&, int ); - void renameItem( QListViewItem *item ); - void slotExpand( QListViewItem* ); - void selectAll() { QListView::selectAll(true); } - void invokeItem( QListViewItem*, const QPoint &, int column ); - void invokeItem( QListViewItem* ); + void rmbPressed( TQListViewItem*, const TQPoint&, int ); + void renameItem( TQListViewItem *item ); + void slotExpand( TQListViewItem* ); + void selectAll() { TQListView::selectAll(true); } + void invokeItem( TQListViewItem*, const TQPoint &, int column ); + void invokeItem( TQListViewItem* ); private: - void keyPressEvent( QKeyEvent *e ); + void keyPressEvent( TQKeyEvent *e ); // Reimplemented from KListView - void contentsDropEvent( QDropEvent *e ); - void viewportPaintEvent( QPaintEvent* ); - bool acceptDrag( QDropEvent *e ) const; - QDragObject *dragObject(); + void contentsDropEvent( TQDropEvent *e ); + void viewportPaintEvent( TQPaintEvent* ); + bool acceptDrag( TQDropEvent *e ) const; + TQDragObject *dragObject(); - QWidget *m_parent; + TQWidget *m_parent; MediaDevice *m_device; MediaItemTip *m_toolTip; }; @@ -322,7 +322,7 @@ class MediaView : public KListView all items are stored in a hierarchy of MediaItems, when items are manipulated the MediaItems have to be updated accordingly */ -class LIBAMAROK_EXPORT MediaDevice : public QObject, public Amarok::Plugin +class LIBAMAROK_EXPORT MediaDevice : public TQObject, public Amarok::Plugin { Q_OBJECT friend class DeviceConfigureDialog; @@ -351,13 +351,13 @@ class LIBAMAROK_EXPORT MediaDevice : public QObject, public Amarok::Plugin */ virtual KAction *customAction() { return 0; } - virtual void rmbPressed( QListViewItem *item, const QPoint &point, int ) { (void)item; (void) point; } + virtual void rmbPressed( TQListViewItem *item, const TQPoint &point, int ) { (void)item; (void) point; } /** * @return list of filetypes playable on this device * (empty list is interpreted as all types are good) */ - virtual QStringList supportedFiletypes() { return QStringList(); } + virtual TQStringList supportedFiletypes() { return TQStringList(); } /** * @param bundle describes track that should be checked @@ -382,7 +382,7 @@ class LIBAMAROK_EXPORT MediaDevice : public QObject, public Amarok::Plugin * @param after insert following this item * @param items tracks to add to playlist */ - virtual void addToPlaylist(MediaItem *playlist, MediaItem *after, QPtrList items) { Q_UNUSED(playlist); Q_UNUSED(after); Q_UNUSED(items); } + virtual void addToPlaylist(MediaItem *playlist, MediaItem *after, TQPtrList items) { Q_UNUSED(playlist); Q_UNUSED(after); Q_UNUSED(items); } /** * Create a new playlist @@ -391,14 +391,14 @@ class LIBAMAROK_EXPORT MediaDevice : public QObject, public Amarok::Plugin * @param items tracks to add to the new playlist * @return the newly created playlist */ - virtual MediaItem *newPlaylist(const QString &name, MediaItem *parent, QPtrList items) { Q_UNUSED(name); Q_UNUSED(parent); Q_UNUSED(items); return 0; } + virtual MediaItem *newPlaylist(const TQString &name, MediaItem *parent, TQPtrList items) { Q_UNUSED(name); Q_UNUSED(parent); Q_UNUSED(items); return 0; } /** * Move items to a directory * @param directory new parent of dropped items * @param items tracks to add to the directory */ - virtual void addToDirectory( MediaItem *directory, QPtrList items ) { Q_UNUSED(directory); Q_UNUSED(items); } + virtual void addToDirectory( MediaItem *directory, TQPtrList items ) { Q_UNUSED(directory); Q_UNUSED(items); } /** * Create a new directory @@ -407,7 +407,7 @@ class LIBAMAROK_EXPORT MediaDevice : public QObject, public Amarok::Plugin * @param items tracks to add to the new directory * @return the newly created directory */ - virtual MediaItem *newDirectory( const QString &name, MediaItem *parent ) { Q_UNUSED(name); Q_UNUSED(parent); return 0; } + virtual MediaItem *newDirectory( const TQString &name, MediaItem *parent ) { Q_UNUSED(name); Q_UNUSED(parent); return 0; } /** * Notify device of changed tags @@ -440,20 +440,20 @@ class LIBAMAROK_EXPORT MediaDevice : public QObject, public Amarok::Plugin */ virtual bool needsManualConfig() { return true; } - virtual void addConfigElements( QWidget * /*parent*/ ) {} - virtual void removeConfigElements( QWidget * /*parent*/ ) {} + virtual void addConfigElements( TQWidget * /*parent*/ ) {} + virtual void removeConfigElements( TQWidget * /*parent*/ ) {} virtual void applyConfig() {} virtual void loadConfig(); - QString configString( const QString &name, const QString &defValue = QString::null ); - void setConfigString( const QString &name, const QString &value ); - bool configBool( const QString &name, bool defValue=false ); - void setConfigBool( const QString &name, bool value ); + TQString configString( const TQString &name, const TQString &defValue = TQString::null ); + void setConfigString( const TQString &name, const TQString &value ); + bool configBool( const TQString &name, bool defValue=false ); + void setConfigBool( const TQString &name, bool value ); void setRequireMount( const bool b ) { m_requireMount = b; } bool hasMountPoint() { return m_hasMountPoint; } - void setDeviceType( const QString &type ) { m_type = type; } - QString deviceType() { return m_type; } + void setDeviceType( const TQString &type ) { m_type = type; } + TQString deviceType() { return m_type; } virtual bool autoConnect() { return false; } virtual bool asynchronousTransfer() { return false; } bool isTransferring() { return m_transferring; } @@ -469,44 +469,44 @@ class LIBAMAROK_EXPORT MediaDevice : public QObject, public Amarok::Plugin /** * @return a unique identifier that is constant across sessions */ - QString uniqueId() const { return m_medium.id(); } + TQString uniqueId() const { return m_medium.id(); } /** * @return the name for the device that should be presented to the user */ - QString name() const { return m_name; } + TQString name() const { return m_name; } /** * @return the device node */ - QString deviceNode() const { return m_medium.deviceNode(); } + TQString deviceNode() const { return m_medium.deviceNode(); } /* * @return the device mount point (or empty if non-applicable or unknown) */ - QString mountPoint() const { return m_medium.mountPoint(); } + TQString mountPoint() const { return m_medium.mountPoint(); } - QString getTransferDir() { return m_transferDir; } + TQString getTransferDir() { return m_transferDir; } Medium &getMedium() { return m_medium; } void setSpacesToUnderscores( bool yesno ) { m_spacesToUnderscores = yesno; setConfigBool( "spacesToUnderscores", yesno); } bool getSpacesToUnderscores() { return m_spacesToUnderscores; } - void setFirstSort( QString text ) { m_firstSort = text; + void setFirstSort( TQString text ) { m_firstSort = text; setConfigString( "firstGrouping", text ); } - void setSecondSort( QString text ) { m_secondSort = text; + void setSecondSort( TQString text ) { m_secondSort = text; setConfigString( "secondGrouping", text ); } - void setThirdSort( QString text ) { m_thirdSort = text; + void setThirdSort( TQString text ) { m_thirdSort = text; setConfigString( "thirdGrouping", text ); } virtual KURL getProxyUrl( const KURL& /*url*/) { return KURL(); } virtual void customClicked() { return; } - BundleList bundlesToSync( const QString &playlistName, const QString &sql ); - BundleList bundlesToSync( const QString &playlistName, const KURL &url ); - void preparePlaylistForSync( const QString &playlistName, const BundleList &bundles ); - bool isOnOtherPlaylist( const QString &playlistToAvoid, const MetaBundle &bundle ); + BundleList bundlesToSync( const TQString &playlistName, const TQString &sql ); + BundleList bundlesToSync( const TQString &playlistName, const KURL &url ); + void preparePlaylistForSync( const TQString &playlistName, const BundleList &bundles ); + bool isOnOtherPlaylist( const TQString &playlistToAvoid, const MetaBundle &bundle ); bool isOnPlaylist( const MediaItem &playlist, const MetaBundle &bundle ); bool isInBundleList( const BundleList &bundles, const MetaBundle &bundle ); bool bundleMatch( const MetaBundle &b1, const MetaBundle &b2 ); @@ -514,8 +514,8 @@ class LIBAMAROK_EXPORT MediaDevice : public QObject, public Amarok::Plugin public slots: void abortTransfer(); void transferFiles(); - virtual void renameItem( QListViewItem *item ) {(void)item; } - virtual void expandItem( QListViewItem *item ) {(void)item; } + virtual void renameItem( TQListViewItem *item ) {(void)item; } + virtual void expandItem( TQListViewItem *item ) {(void)item; } bool connectDevice( bool silent=false ); bool disconnectDevice( bool postdisconnecthook=true ); void scheduleDisconnect() { m_scheduledDisconnect = true; } @@ -525,10 +525,10 @@ class LIBAMAROK_EXPORT MediaDevice : public QObject, public Amarok::Plugin void fileTransferFinished(); private: - int sysCall(const QString & command); + int sysCall(const TQString & command); int runPreConnectCommand(); int runPostDisconnectCommand(); - QString replaceVariables( const QString &cmd ); // replace %m with mount point and %d with device node + TQString replaceVariables( const TQString &cmd ); // replace %m with mount point and %d with device node /** * Find a particular track @@ -612,12 +612,12 @@ class LIBAMAROK_EXPORT MediaDevice : public QObject, public Amarok::Plugin bool kioCopyTrack( const KURL &src, const KURL &dst ); - QString m_name; + TQString m_name; bool m_hasMountPoint; - QString m_preconnectcmd; - QString m_postdisconnectcmd; + TQString m_preconnectcmd; + TQString m_postdisconnectcmd; bool m_autoDeletePodcasts; bool m_syncStats; @@ -629,10 +629,10 @@ class LIBAMAROK_EXPORT MediaDevice : public QObject, public Amarok::Plugin MediaBrowser *m_parent; MediaView *m_view; Medium m_medium; - QString m_transferDir; - QString m_firstSort; - QString m_secondSort; - QString m_thirdSort; + TQString m_transferDir; + TQString m_firstSort; + TQString m_secondSort; + TQString m_thirdSort; bool m_wait; bool m_waitForDeletion; bool m_copyFailed; @@ -648,7 +648,7 @@ class LIBAMAROK_EXPORT MediaDevice : public QObject, public Amarok::Plugin bool m_configure; bool m_customButton; - QString m_type; + TQString m_type; // root listview items MediaItem *m_playlistItem; @@ -661,7 +661,7 @@ class LIBAMAROK_EXPORT MediaDevice : public QObject, public Amarok::Plugin MediaItem *m_orphanedItem; // stow away all items below m_rootItems when device is not current - QPtrList m_rootItems; + TQPtrList m_rootItems; }; diff --git a/amarok/src/mediadevice/daap/daapclient.cpp b/amarok/src/mediadevice/daap/daapclient.cpp index 1a08c893..ace95233 100644 --- a/amarok/src/mediadevice/daap/daapclient.cpp +++ b/amarok/src/mediadevice/daap/daapclient.cpp @@ -30,13 +30,13 @@ #include "statusbar/statusbar.h" #include "tagdialog.h" -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -90,10 +90,10 @@ DEBUG_BLOCK i18n("Share My Music") ); m_broadcastButton->setToggle( true ); - QToolTip::add( customButton, i18n( "List music from a remote host" ) ); - QToolTip::add( m_broadcastButton, i18n( "If this button is checked, then your music will be exported to the network" ) ); + TQToolTip::add( customButton, i18n( "List music from a remote host" ) ); + TQToolTip::add( m_broadcastButton, i18n( "If this button is checked, then your music will be exported to the network" ) ); - connect( m_broadcastButton, SIGNAL( toggled(int) ), SLOT( broadcastButtonToggled() ) ); + connect( m_broadcastButton, TQT_SIGNAL( toggled(int) ), TQT_SLOT( broadcastButtonToggled() ) ); MediaBrowser::instance()->insertChild( this ); } @@ -139,20 +139,20 @@ DaapClient::openDevice(bool /* silent=false */) { m_browser = new DNSSD::ServiceBrowser("_daap._tcp"); m_browser->setName("daapServiceBrowser"); - connect( m_browser, SIGNAL( serviceAdded( DNSSD::RemoteService::Ptr ) ), - this, SLOT( foundDaap ( DNSSD::RemoteService::Ptr ) ) ); - connect( m_browser, SIGNAL( serviceRemoved( DNSSD::RemoteService::Ptr ) ), - this, SLOT( serverOffline ( DNSSD::RemoteService::Ptr ) ) ); + connect( m_browser, TQT_SIGNAL( serviceAdded( DNSSD::RemoteService::Ptr ) ), + this, TQT_SLOT( foundDaap ( DNSSD::RemoteService::Ptr ) ) ); + connect( m_browser, TQT_SIGNAL( serviceRemoved( DNSSD::RemoteService::Ptr ) ), + this, TQT_SLOT( serverOffline ( DNSSD::RemoteService::Ptr ) ) ); m_browser->startBrowse(); } #endif - QStringList sl = AmarokConfig::manuallyAddedServers(); + TQStringList sl = AmarokConfig::manuallyAddedServers(); foreach( sl ) { - QStringList current = QStringList::split(":", (*it) ); - QString host = current.first(); + TQStringList current = TQStringList::split(":", (*it) ); + TQString host = current.first(); Q_UINT16 port = current.last().toInt(); - QString ip = resolve( host ); + TQString ip = resolve( host ); if( ip != "0" ) { newHost( host, host, ip, port ); @@ -169,8 +169,8 @@ bool DaapClient::closeDevice() { m_view->clear(); - QObjectList* readers = queryList( "Daap::Reader"); - QObject* itRead; + TQObjectList* readers = queryList( "Daap::Reader"); + TQObject* itRead; for( itRead = readers->first(); itRead; itRead = readers->next() ) { static_cast(itRead)->logoutRequest(); @@ -223,7 +223,7 @@ DaapClient::deleteItemFromDevice( MediaItem* /*item*/, int /*flags*/ ) } void -DaapClient::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) +DaapClient::rmbPressed( TQListViewItem* qitem, const TQPoint& point, int ) { DEBUG_BLOCK @@ -246,7 +246,7 @@ DaapClient::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) menu.insertItem( SmallIconSet( "remove" ), i18n("&Remove Computer"), REMOVE ); } { - QStringList sl = m_serverItemMap.keys(); + TQStringList sl = m_serverItemMap.keys(); foreach( sl ) { debug() << (*it) << endl; @@ -299,7 +299,7 @@ DaapClient::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) case REMOVE: if( sitem ) { - QStringList mas = AmarokConfig::manuallyAddedServers(); + TQStringList mas = AmarokConfig::manuallyAddedServers(); mas.remove( sitem->key() ); AmarokConfig::setManuallyAddedServers( mas ); delete sitem; @@ -318,7 +318,7 @@ DaapClient::downloadSongs( KURL::List urls ) KURL::List realStreamUrls; KURL::List::Iterator it; for( it = urls.begin(); it != urls.end(); ++it ) - realStreamUrls << Daap::Proxy::realStreamUrl( (*it), getSession( (*it).host() + ':' + QString::number( (*it).port() ) ) ); + realStreamUrls << Daap::Proxy::realStreamUrl( (*it), getSession( (*it).host() + ':' + TQString::number( (*it).port() ) ) ); ThreadManager::instance()->queueJob( new DaapDownloader( realStreamUrls ) ); } @@ -327,7 +327,7 @@ DaapClient::serverOffline( DNSSD::RemoteService::Ptr service ) { #if DNSSD_SUPPORT DEBUG_BLOCK - QString key = serverKey( service.data() ); + TQString key = serverKey( service.data() ); if( m_serverItemMap.contains( key ) ) { ServerItem* removeMe = m_serverItemMap[ key ]; @@ -359,7 +359,7 @@ DaapClient::foundDaap( DNSSD::RemoteService::Ptr service ) #if DNSSD_SUPPORT DEBUG_BLOCK - connect( service, SIGNAL( resolved( bool ) ), this, SLOT( resolvedDaap( bool ) ) ); + connect( service, TQT_SIGNAL( resolved( bool ) ), this, TQT_SLOT( resolvedDaap( bool ) ) ); service->resolveAsync(); #endif } @@ -373,7 +373,7 @@ DaapClient::resolvedDaap( bool success ) if( !success || !service ) return; debug() << service->serviceName() << ' ' << service->hostName() << ' ' << service->domain() << ' ' << service->type() << endl; - QString ip = resolve( service->hostName() ); + TQString ip = resolve( service->hostName() ); if( ip == "0" || m_serverItemMap.contains(serverKey( service )) ) //same server from multiple interfaces return; @@ -382,7 +382,7 @@ DaapClient::resolvedDaap( bool success ) } void -DaapClient::createTree( const QString& /*host*/, Daap::SongList bundles ) +DaapClient::createTree( const TQString& /*host*/, Daap::SongList bundles ) { DEBUG_BLOCK const Daap::Reader* callback = dynamic_cast(sender()); @@ -393,14 +393,14 @@ DaapClient::createTree( const QString& /*host*/, Daap::SongList bundles ) } { - const QString hostKey = callback->name(); + const TQString hostKey = callback->name(); ServerInfo* si = new ServerInfo(); si->sessionId = callback->sessionId(); m_servers[ hostKey ] = si; } ServerItem* root = callback->rootMediaItem(); - QStringList artists = bundles.keys(); + TQStringList artists = bundles.keys(); foreach( artists ) { MediaItem* parentArtist = new MediaItem( root ); @@ -409,8 +409,8 @@ DaapClient::createTree( const QString& /*host*/, Daap::SongList bundles ) parentArtist->setText( 0, (*albumMap.begin()).getFirst()->artist() ); //map was made case insensitively //just get the displayed-case from //the first track - QStringList albums = albumMap.keys(); - for ( QStringList::Iterator itAlbum = albums.begin(); itAlbum != albums.end(); ++itAlbum ) + TQStringList albums = albumMap.keys(); + for ( TQStringList::Iterator itAlbum = albums.begin(); itAlbum != albums.end(); ++itAlbum ) { MediaItem* parentAlbum = new MediaItem( parentArtist ); parentAlbum->setType( MediaItem::ALBUM ); @@ -441,7 +441,7 @@ DaapClient::createTree( const QString& /*host*/, Daap::SongList bundles ) } int -DaapClient::incRevision( const QString& host ) +DaapClient::incRevision( const TQString& host ) { if( m_servers.contains(host) ) { @@ -453,7 +453,7 @@ DaapClient::incRevision( const QString& host ) } int -DaapClient::getSession( const QString& host ) +DaapClient::getSession( const TQString& host ) { if( m_servers.contains(host) ) return m_servers[host]->sessionId; @@ -468,11 +468,11 @@ DaapClient::customClicked() { public: - AddHostDialog( QWidget *parent ) + AddHostDialog( TQWidget *parent ) : KDialogBase( parent, "DaapAddHostDialog", true, i18n( "Add Computer" ) , Ok|Cancel) { m_base = new AddHostBase( this, "DaapAddHostBase" ); - m_base->m_downloadPixmap->setPixmap( QPixmap( KGlobal::iconLoader()->iconPath( Amarok::icon( "download" ), -KIcon::SizeEnormous ) ) ); + m_base->m_downloadPixmap->setPixmap( TQPixmap( KGlobal::iconLoader()->iconPath( Amarok::icon( "download" ), -KIcon::SizeEnormous ) ) ); m_base->m_hostName->setFocus(); setMainWidget( m_base ); } @@ -480,16 +480,16 @@ DaapClient::customClicked() }; AddHostDialog dialog( 0 ); - if( dialog.exec() == QDialog::Accepted ) { - QString ip = resolve( dialog.m_base->m_hostName->text() ); + if( dialog.exec() == TQDialog::Accepted ) { + TQString ip = resolve( dialog.m_base->m_hostName->text() ); if( ip == "0" ) Amarok::StatusBar::instance()->shortMessage( i18n("Could not resolve %1.").arg( dialog.m_base->m_hostName->text() ) ); else { - QString key = ServerItem::key( dialog.m_base->m_hostName->text(), dialog.m_base->m_portInput->value() ); + TQString key = ServerItem::key( dialog.m_base->m_hostName->text(), dialog.m_base->m_portInput->value() ); if( !AmarokConfig::manuallyAddedServers().contains( key ) ) { - QStringList mas = AmarokConfig::manuallyAddedServers(); + TQStringList mas = AmarokConfig::manuallyAddedServers(); mas.append( key ); AmarokConfig::setManuallyAddedServers( mas ); } @@ -499,7 +499,7 @@ DaapClient::customClicked() } ServerItem* -DaapClient::newHost( const QString& serviceName, const QString& host, const QString& ip, const Q_INT16 port ) +DaapClient::newHost( const TQString& serviceName, const TQString& host, const TQString& ip, const Q_INT16 port ) { if( ip.isEmpty() ) return 0; @@ -512,7 +512,7 @@ DaapClient::passwordPrompt() class PasswordDialog : public KDialogBase { public: - PasswordDialog( QWidget *parent ) + PasswordDialog( TQWidget *parent ) : KDialogBase( parent, "PasswordDialog", true, i18n( "Password Required" ) , Ok|Cancel) { makeHBoxMainWidget(); @@ -522,17 +522,17 @@ DaapClient::passwordPrompt() ok.setToolTip( i18n("Login to the music share with the password given.") ); setButtonOK( ok ); - QLabel* passIcon = new QLabel( mainWidget(), "passicon" ); - passIcon->setPixmap( QPixmap( KGlobal::iconLoader()->iconPath( "password", -KIcon::SizeHuge ) ) ); - QHBox* loginArea = new QHBox( mainWidget(), "passhbox" ); - new QLabel( i18n( "Password:"), loginArea, "passlabel" ); + TQLabel* passIcon = new TQLabel( mainWidget(), "passicon" ); + passIcon->setPixmap( TQPixmap( KGlobal::iconLoader()->iconPath( "password", -KIcon::SizeHuge ) ) ); + TQHBox* loginArea = new TQHBox( mainWidget(), "passhbox" ); + new TQLabel( i18n( "Password:"), loginArea, "passlabel" ); m_input = new KPasswordEdit( loginArea, "passedit" ); m_input->setFocus(); } KPasswordEdit* m_input; }; - Daap::Reader* callback = dynamic_cast( const_cast( sender() ) ); + Daap::Reader* callback = dynamic_cast( const_cast( sender() ) ); if (!callback) { debug() << "No callback!" << endl; return; @@ -540,14 +540,14 @@ DaapClient::passwordPrompt() ServerItem* root = callback->rootMediaItem(); PasswordDialog dialog( 0 ); - if( dialog.exec() == QDialog::Accepted ) + if( dialog.exec() == TQDialog::Accepted ) { - Daap::Reader* reader = new Daap::Reader( callback->host(), callback->port(), root, QString( dialog.m_input->password() ), this, callback->name() ); + Daap::Reader* reader = new Daap::Reader( callback->host(), callback->port(), root, TQString( dialog.m_input->password() ), this, callback->name() ); root->setReader( reader ); - connect( reader, SIGNAL( daapBundles( const QString&, Daap::SongList ) ), - this, SLOT( createTree( const QString&, Daap::SongList ) ) ); - connect( reader, SIGNAL( passwordRequired() ), this, SLOT( passwordPrompt() ) ); - connect( reader, SIGNAL( httpError( const QString& ) ), root, SLOT( httpError( const QString& ) ) ); + connect( reader, TQT_SIGNAL( daapBundles( const TQString&, Daap::SongList ) ), + this, TQT_SLOT( createTree( const TQString&, Daap::SongList ) ) ); + connect( reader, TQT_SIGNAL( passwordRequired() ), this, TQT_SLOT( passwordPrompt() ) ); + connect( reader, TQT_SIGNAL( httpError( const TQString& ) ), root, TQT_SLOT( httpError( const TQString& ) ) ); reader->loginRequest(); } else @@ -560,7 +560,7 @@ DaapClient::passwordPrompt() } QString -DaapClient::resolve( const QString& hostname ) +DaapClient::resolve( const TQString& hostname ) { KNetwork::KResolver resolver( hostname ); resolver.setFamily( KNetwork::KResolver::KnownFamily ); //A druidic incantation from Thiago. Works around a KResolver bug #132851 @@ -573,7 +573,7 @@ DaapClient::resolve( const QString& hostname ) << resolver.errorString( results.error() ) << ")" << endl; if( !results.empty() ) { - QString ip = results[0].address().asInet().ipAddress().toString(); + TQString ip = results[0].address().asInet().ipAddress().toString(); debug() << "ip found is " << ip << endl; return ip; } @@ -592,7 +592,7 @@ DaapClient::trackExistsInCollection( MetaBundle *bundle ) qb.addReturnFunctionValue( QueryBuilder::funcCount, QueryBuilder::tabSong, QueryBuilder::valURL ); - QStringList values = qb.run(); + TQStringList values = qb.run(); return ( values[0].toInt() > 0 ); } @@ -601,20 +601,20 @@ DaapClient::trackExistsInCollection( MetaBundle *bundle ) /// Configuration Dialog Extension void -DaapClient::addConfigElements( QWidget * parent ) +DaapClient::addConfigElements( TQWidget * parent ) { - m_broadcastServerCheckBox = new QCheckBox( "Broadcast my music", parent ); + m_broadcastServerCheckBox = new TQCheckBox( "Broadcast my music", parent ); m_broadcastServerCheckBox->setChecked( m_broadcastServer ); - m_removeDuplicatesCheckBox = new QCheckBox( "Hide songs in my collection", parent ); + m_removeDuplicatesCheckBox = new TQCheckBox( "Hide songs in my collection", parent ); m_removeDuplicatesCheckBox->setChecked( m_removeDuplicates ); - QToolTip::add( m_removeDuplicatesCheckBox, i18n( "Enabling this may reduce connection times" ) ); + TQToolTip::add( m_removeDuplicatesCheckBox, i18n( "Enabling this may reduce connection times" ) ); } void -DaapClient::removeConfigElements( QWidget * /* parent */ ) +DaapClient::removeConfigElements( TQWidget * /* parent */ ) { if( m_broadcastServerCheckBox != 0 ) delete m_broadcastServerCheckBox; @@ -680,7 +680,7 @@ DEBUG_BLOCK // CLASS ServerItem //////////////////////////////////////////////////////////////////////////////// -ServerItem::ServerItem( QListView* parent, DaapClient* client, const QString& ip, Q_UINT16 port, const QString& title, const QString& host ) +ServerItem::ServerItem( TQListView* parent, DaapClient* client, const TQString& ip, Q_UINT16 port, const TQString& title, const TQString& host ) : MediaItem( parent ) , m_daapClient( client ) , m_reader( 0 ) @@ -689,8 +689,8 @@ ServerItem::ServerItem( QListView* parent, DaapClient* client, const QString& ip , m_title( title ) , m_host( host ) , m_loaded( false ) - , m_loading1( new QPixmap( locate("data", "amarok/images/loading1.png" ) ) ) - , m_loading2( new QPixmap( locate("data", "amarok/images/loading2.png" ) ) ) + , m_loading1( new TQPixmap( locate("data", "amarok/images/loading1.png" ) ) ) + , m_loading2( new TQPixmap( locate("data", "amarok/images/loading2.png" ) ) ) { setText( 0, title ); setType( MediaItem::DIRECTORY ); @@ -710,8 +710,8 @@ ServerItem::reset() m_loaded = 0; - QListViewItem *c = firstChild(); - QListViewItem *n; + TQListViewItem *c = firstChild(); + TQListViewItem *n; while( c ) { n = c->nextSibling(); delete c; @@ -733,18 +733,18 @@ ServerItem::setOpen( bool o ) //starts loading animation m_iconCounter = 1; startAnimation(); - connect( &m_animationTimer, SIGNAL(timeout()), this, SLOT(slotAnimation()) ); + connect( &m_animationTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotAnimation()) ); setText( 0, i18n( "Loading %1").arg( text( 0 ) ) ); Daap::Reader* reader = new Daap::Reader( m_ip, m_port, this, - QString::null, m_daapClient, ( m_ip + ":3689" ).ascii() ); + TQString::null, m_daapClient, ( m_ip + ":3689" ).ascii() ); setReader ( reader ); - connect( reader, SIGNAL( daapBundles( const QString&, Daap::SongList ) ), - m_daapClient, SLOT( createTree( const QString&, Daap::SongList ) ) ); - connect( reader, SIGNAL( passwordRequired() ), m_daapClient, SLOT( passwordPrompt() ) ); - connect( reader, SIGNAL( httpError( const QString& ) ), this, SLOT( httpError( const QString& ) ) ); + connect( reader, TQT_SIGNAL( daapBundles( const TQString&, Daap::SongList ) ), + m_daapClient, TQT_SLOT( createTree( const TQString&, Daap::SongList ) ) ); + connect( reader, TQT_SIGNAL( passwordRequired() ), m_daapClient, TQT_SLOT( passwordPrompt() ) ); + connect( reader, TQT_SIGNAL( httpError( const TQString& ) ), this, TQT_SLOT( httpError( const TQString& ) ) ); reader->loginRequest(); m_loaded = true; } @@ -777,7 +777,7 @@ ServerItem::slotAnimation() } void -ServerItem::httpError( const QString& errorString ) +ServerItem::httpError( const TQString& errorString ) { stopAnimation(); resetTitle(); @@ -805,16 +805,16 @@ DaapDownloader::doJob() { DEBUG_BLOCK KURL::List::iterator urlIt = m_urls.begin(); - Daap::ContentFetcher* http = new Daap::ContentFetcher( (*urlIt).host(), (*urlIt).port(), QString(), this ); - connect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( downloadFinished( int, bool ) ) ); - connect( http, SIGNAL( dataReadProgress( int, int ) ), this, SLOT( dataReadProgress( int, int ) ) ); - connect( http, SIGNAL( httpError( const QString& ) ), this, SLOT( downloadFailed( const QString& ) ) ); + Daap::ContentFetcher* http = new Daap::ContentFetcher( (*urlIt).host(), (*urlIt).port(), TQString(), this ); + connect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( downloadFinished( int, bool ) ) ); + connect( http, TQT_SIGNAL( dataReadProgress( int, int ) ), this, TQT_SLOT( dataReadProgress( int, int ) ) ); + connect( http, TQT_SIGNAL( httpError( const TQString& ) ), this, TQT_SLOT( downloadFailed( const TQString& ) ) ); while( !isAborted() && !m_errorOccured && urlIt != m_urls.end() ) { m_ready = false; debug() << "downloading " << (*urlIt).path() << endl; setProgressTotalSteps( 100 ); - KTempFile* tempNewFile = new KTempFile( QString(), '.' + QFileInfo( (*urlIt).path() ).extension() ); + KTempFile* tempNewFile = new KTempFile( TQString(), '.' + TQFileInfo( (*urlIt).path() ).extension() ); tempNewFile->setAutoDelete( true ); m_tempFileList.append( tempNewFile ); http->getDaap( (*urlIt).path() + (*urlIt).query(), tempNewFile->file() ); @@ -847,13 +847,13 @@ DaapDownloader::completeJob() DEBUG_BLOCK KURL path; KURL::List tempUrlList; - for( QValueList::Iterator itTemps = m_tempFileList.begin(); itTemps != m_tempFileList.end(); ++itTemps ) + for( TQValueList::Iterator itTemps = m_tempFileList.begin(); itTemps != m_tempFileList.end(); ++itTemps ) { path.setPath( (*itTemps)->name() ); tempUrlList << path; } CollectionView::instance()->organizeFiles( tempUrlList, i18n( "Copy Files To Collection" ), false ); - for( QValueList::Iterator itTemps = m_tempFileList.begin(); itTemps != m_tempFileList.end(); ++itTemps ) + for( TQValueList::Iterator itTemps = m_tempFileList.begin(); itTemps != m_tempFileList.end(); ++itTemps ) delete (*itTemps); //autodelete is true, so file is unlinked now m_tempFileList.clear(); } @@ -865,7 +865,7 @@ DaapDownloader::dataReadProgress( int done, int total ) } void -DaapDownloader::downloadFailed( const QString & error ) +DaapDownloader::downloadFailed( const TQString & error ) { // Amarok::StatusBar::instance()->longMessageThreadSafe( i18n( "An error occured while downloading from remote music server." ), Amarok::StatusBar::Error ); DEBUG_BLOCK diff --git a/amarok/src/mediadevice/daap/daapclient.h b/amarok/src/mediadevice/daap/daapclient.h index c3475de7..15dfe24c 100644 --- a/amarok/src/mediadevice/daap/daapclient.h +++ b/amarok/src/mediadevice/daap/daapclient.h @@ -45,9 +45,9 @@ class DaapServer; class KURL; -class QCheckBox; -class QString; -class QTimer; +class TQCheckBox; +class TQString; +class TQTimer; class DaapClient : public MediaDevice { @@ -65,14 +65,14 @@ class DaapClient : public MediaDevice bool isConnected(); virtual bool needsManualConfig() { return true; } - virtual void addConfigElements ( QWidget * /*parent*/ ); - virtual void removeConfigElements( QWidget * /*parent*/ ); + virtual void addConfigElements ( TQWidget * /*parent*/ ); + virtual void removeConfigElements( TQWidget * /*parent*/ ); virtual void applyConfig(); virtual void loadConfig(); - int incRevision( const QString& host ); - int getSession( const QString& host ); + int incRevision( const TQString& host ); + int getSession( const TQString& host ); KURL getProxyUrl( const KURL& url ); void customClicked(); bool autoConnect() { return true; } @@ -82,7 +82,7 @@ class DaapClient : public MediaDevice protected: bool getCapacity( KIO::filesize_t *total, KIO::filesize_t *available ); - void rmbPressed( QListViewItem* qitem, const QPoint& point, int ); + void rmbPressed( TQListViewItem* qitem, const TQPoint& point, int ); bool lockDevice( bool tryOnly = false ); void unlockDevice(); bool openDevice( bool silent=false ); @@ -96,27 +96,27 @@ class DaapClient : public MediaDevice void serverOffline( DNSSD::RemoteService::Ptr ); void foundDaap( DNSSD::RemoteService::Ptr ); void resolvedDaap( bool ); - void createTree( const QString& host, Daap::SongList bundles ); + void createTree( const TQString& host, Daap::SongList bundles ); void broadcastButtonToggled(); private: - ServerItem* newHost( const QString& serviceName, const QString& host, const QString& ip, const Q_INT16 port ); + ServerItem* newHost( const TQString& serviceName, const TQString& host, const TQString& ip, const Q_INT16 port ); void downloadSongs( KURL::List urls ); - QString resolve( const QString& hostname ); + TQString resolve( const TQString& hostname ); #if DNSSD_SUPPORT - QString serverKey( const DNSSD::RemoteService* service ) const; + TQString serverKey( const DNSSD::RemoteService* service ) const; DNSSD::ServiceBrowser* m_browser; #endif /// @return true if track is already in the local collection const bool trackExistsInCollection( MetaBundle *bundle ); bool m_connected; - QMap m_servers; - QMap m_serverItemMap; + TQMap m_servers; + TQMap m_serverItemMap; DaapServer *m_sharingServer; - QCheckBox *m_broadcastServerCheckBox; - QCheckBox *m_removeDuplicatesCheckBox; + TQCheckBox *m_broadcastServerCheckBox; + TQCheckBox *m_removeDuplicatesCheckBox; bool m_broadcastServer; bool m_removeDuplicates; KToolBarButton *m_broadcastButton; @@ -125,12 +125,12 @@ class DaapClient : public MediaDevice bool m_hideMusicOwned; }; -class ServerItem : public QObject, public MediaItem +class ServerItem : public TQObject, public MediaItem { Q_OBJECT public: - ServerItem( QListView* parent, DaapClient* client, const QString& ip, Q_UINT16 port, const QString& title, const QString& host ); + ServerItem( TQListView* parent, DaapClient* client, const TQString& ip, Q_UINT16 port, const TQString& title, const TQString& host ); ~ServerItem(); void setOpen( bool o ); void resetTitle() { setText( 0, m_title ); } @@ -141,25 +141,25 @@ class ServerItem : public QObject, public MediaItem void startAnimation(); void stopAnimation(); - QString key() const { return key( m_host, m_port ); } + TQString key() const { return key( m_host, m_port ); } void reset(); - static QString key( const QString& host, Q_UINT16 port ) { return host + ':' + QString::number( port ); } + static TQString key( const TQString& host, Q_UINT16 port ) { return host + ':' + TQString::number( port ); } public slots: - void httpError( const QString& ); + void httpError( const TQString& ); private slots: void slotAnimation(); private: DaapClient *m_daapClient; Daap::Reader *m_reader; - const QString m_ip; + const TQString m_ip; const Q_UINT16 m_port; - const QString m_title; - const QString m_host; + const TQString m_title; + const TQString m_host; bool m_loaded; - QPixmap *m_loading1, *m_loading2; //icons for loading animation - QTimer m_animationTimer; + TQPixmap *m_loading1, *m_loading2; //icons for loading animation + TQTimer m_animationTimer; uint m_iconCounter; static const int ANIMATION_INTERVAL = 250; @@ -178,11 +178,11 @@ public: private slots: void downloadFinished( int id, bool error ); void dataReadProgress( int done, int total ); - void downloadFailed( const QString &error ); + void downloadFailed( const TQString &error ); private: KURL::List m_urls; - QValueList m_tempFileList; + TQValueList m_tempFileList; bool m_ready; bool m_successful; bool m_errorOccured; diff --git a/amarok/src/mediadevice/daap/daapreader/authentication/contentfetcher.cpp b/amarok/src/mediadevice/daap/daapreader/authentication/contentfetcher.cpp index ced4c825..56b8874e 100644 --- a/amarok/src/mediadevice/daap/daapreader/authentication/contentfetcher.cpp +++ b/amarok/src/mediadevice/daap/daapreader/authentication/contentfetcher.cpp @@ -15,10 +15,10 @@ #include "debug.h" #include "hasher.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -26,14 +26,14 @@ using namespace Daap; int ContentFetcher::s_requestId = 10; -ContentFetcher::ContentFetcher( const QString & hostname, Q_UINT16 port, const QString& password, QObject * parent, const char * name ) - : QHttp(hostname, port, parent, name) +ContentFetcher::ContentFetcher( const TQString & hostname, Q_UINT16 port, const TQString& password, TQObject * parent, const char * name ) + : TQHttp(hostname, port, parent, name) , m_hostname( hostname ) , m_port( port ) , m_selfDestruct( false ) { - connect( this, SIGNAL( stateChanged( int ) ), this , SLOT( checkForErrors( int ) ) ); - QCString pass = password.utf8(); + connect( this, TQT_SIGNAL( stateChanged( int ) ), this , TQT_SLOT( checkForErrors( int ) ) ); + TQCString pass = password.utf8(); if( !password.isNull() ) { m_authorize = "Basic " + KCodecs::base64Encode( "none:" + pass ); @@ -43,20 +43,20 @@ ContentFetcher::ContentFetcher( const QString & hostname, Q_UINT16 port, const Q ContentFetcher::~ContentFetcher() { } -QDataStream& +TQDataStream& ContentFetcher::results() { - QBuffer* bytes = new QBuffer( readAll() ); - QIODevice* stream = KFilterDev::device( bytes, "application/x-gzip", false ); + TQBuffer* bytes = new TQBuffer( readAll() ); + TQIODevice* stream = KFilterDev::device( bytes, "application/x-gzip", false ); stream->open( IO_ReadOnly ); - QDataStream* ds = new QDataStream( stream ); + TQDataStream* ds = new TQDataStream( stream ); return *ds; } void -ContentFetcher::getDaap( const QString & command, QIODevice* musicFile /*= 0*/ ) +ContentFetcher::getDaap( const TQString & command, TQIODevice* musicFile /*= 0*/ ) { - QHttpRequestHeader header( "GET", command ); + TQHttpRequestHeader header( "GET", command ); char hash[33] = {0}; GenerateHash(3, reinterpret_cast(command.ascii()), 2, reinterpret_cast(hash), 0 /*s_requestId*/); @@ -65,8 +65,8 @@ ContentFetcher::getDaap( const QString & command, QIODevice* musicFile /*= 0*/ ) header.setValue( "Authorization", m_authorize ); } - header.setValue( "Host", m_hostname + QString::number( m_port ) ); - header.setValue( "Client-DAAP-Request-ID", "0"/*QString::number( s_requestId )*/ ); + header.setValue( "Host", m_hostname + TQString::number( m_port ) ); + header.setValue( "Client-DAAP-Request-ID", "0"/*TQString::number( s_requestId )*/ ); header.setValue( "Client-DAAP-Access-Index", "2" ); header.setValue( "Client-DAAP-Validation", hash ); header.setValue( "Client-DAAP-Version", "3.0" ); @@ -78,7 +78,7 @@ ContentFetcher::getDaap( const QString & command, QIODevice* musicFile /*= 0*/ ) } /** - * QHttp enjoys forgetting to emit a requestFinished when there's an error + * TQHttp enjoys forgetting to emit a requestFinished when there's an error * This gets around that. */ void diff --git a/amarok/src/mediadevice/daap/daapreader/authentication/contentfetcher.h b/amarok/src/mediadevice/daap/daapreader/authentication/contentfetcher.h index bf299a1f..9869063d 100644 --- a/amarok/src/mediadevice/daap/daapreader/authentication/contentfetcher.h +++ b/amarok/src/mediadevice/daap/daapreader/authentication/contentfetcher.h @@ -13,10 +13,10 @@ #ifndef DAAPCONTENTFETCHER_H #define DAAPCONTENTFETCHER_H -#include +#include -class QDataStream; -class QFile; +class TQDataStream; +class TQFile; namespace Daap { @@ -30,22 +30,22 @@ class ContentFetcher : public QHttp Q_OBJECT public: - ContentFetcher( const QString & hostname, Q_UINT16 port, const QString& password, QObject * parent = 0, const char * name = 0 ); + ContentFetcher( const TQString & hostname, Q_UINT16 port, const TQString& password, TQObject * parent = 0, const char * name = 0 ); ~ContentFetcher(); - void getDaap( const QString & command, QIODevice* musicFile = 0 ); - QDataStream& results(); + void getDaap( const TQString & command, TQIODevice* musicFile = 0 ); + TQDataStream& results(); private slots: void checkForErrors( int state ); signals: - void httpError( const QString& ); + void httpError( const TQString& ); private: - QString m_hostname; + TQString m_hostname; Q_UINT16 m_port; - QCString m_authorize; + TQCString m_authorize; bool m_selfDestruct; static int s_requestId; //! Apple needs this for some reason }; diff --git a/amarok/src/mediadevice/daap/daapreader/reader.cpp b/amarok/src/mediadevice/daap/daapreader/reader.cpp index 1fbbf9a3..16d86979 100644 --- a/amarok/src/mediadevice/daap/daapreader/reader.cpp +++ b/amarok/src/mediadevice/daap/daapreader/reader.cpp @@ -17,19 +17,19 @@ #include "metabundle.h" #include "qstringx.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include using namespace Daap; -QMap Reader::s_codes; +TQMap Reader::s_codes; -Reader::Reader(const QString& host, Q_UINT16 port, ServerItem* root, const QString& password, QObject* parent, const char* name) - : QObject(parent, name) +Reader::Reader(const TQString& host, Q_UINT16 port, ServerItem* root, const TQString& password, TQObject* parent, const char* name) + : TQObject(parent, name) , m_host( host ) , m_port( port ) , m_sessionId( -1 ) @@ -162,15 +162,15 @@ void Reader::logoutRequest() { ContentFetcher* http = new ContentFetcher( m_host, m_port, m_password, this, "readerLogoutHttp" ); - connect( http, SIGNAL( httpError( const QString& ) ), this, SLOT( fetchingError( const QString& ) ) ); - connect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( logoutRequest( int, bool ) ) ); + connect( http, TQT_SIGNAL( httpError( const TQString& ) ), this, TQT_SLOT( fetchingError( const TQString& ) ) ); + connect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( logoutRequest( int, bool ) ) ); http->getDaap( "/logout?" + m_loginString ); } void Reader::logoutRequest( int, bool ) { - const_cast(sender())->deleteLater(); + const_cast(sender())->deleteLater(); deleteLater(); } @@ -179,26 +179,26 @@ Reader::loginRequest() { DEBUG_BLOCK ContentFetcher* http = new ContentFetcher( m_host, m_port, m_password, this, "readerHttp"); - connect( http, SIGNAL( httpError( const QString& ) ), this, SLOT( fetchingError( const QString& ) ) ); - connect( http, SIGNAL( responseHeaderReceived( const QHttpResponseHeader & ) ) - , this, SLOT( loginHeaderReceived( const QHttpResponseHeader & ) ) ); + connect( http, TQT_SIGNAL( httpError( const TQString& ) ), this, TQT_SLOT( fetchingError( const TQString& ) ) ); + connect( http, TQT_SIGNAL( responseHeaderReceived( const TQHttpResponseHeader & ) ) + , this, TQT_SLOT( loginHeaderReceived( const TQHttpResponseHeader & ) ) ); http->getDaap( "/login" ); } void -Reader::loginHeaderReceived( const QHttpResponseHeader & resp ) +Reader::loginHeaderReceived( const TQHttpResponseHeader & resp ) { DEBUG_BLOCK ContentFetcher* http = (ContentFetcher*) sender(); - disconnect( http, SIGNAL( responseHeaderReceived( const QHttpResponseHeader & ) ) - , this, SLOT( loginHeaderReceived( const QHttpResponseHeader & ) ) ); + disconnect( http, TQT_SIGNAL( responseHeaderReceived( const TQHttpResponseHeader & ) ) + , this, TQT_SLOT( loginHeaderReceived( const TQHttpResponseHeader & ) ) ); if( resp.statusCode() == 401 /*authorization required*/) { emit passwordRequired(); http->deleteLater(); return; } - connect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( loginFinished( int, bool ) ) ); + connect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( loginFinished( int, bool ) ) ); } @@ -207,7 +207,7 @@ Reader::loginFinished( int /* id */, bool error ) { DEBUG_BLOCK ContentFetcher* http = (ContentFetcher*) sender(); - disconnect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( loginFinished( int, bool ) ) ); + disconnect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( loginFinished( int, bool ) ) ); if( error ) { http->deleteLater(); @@ -216,8 +216,8 @@ Reader::loginFinished( int /* id */, bool error ) Map loginResults = parse( http->results() , 0 ,true ); m_sessionId = loginResults["mlog"].asList()[0].asMap()["mlid"].asList()[0].asInt(); - m_loginString = "session-id=" + QString::number( m_sessionId ); - connect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( updateFinished( int, bool ) ) ); + m_loginString = "session-id=" + TQString::number( m_sessionId ); + connect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( updateFinished( int, bool ) ) ); http->getDaap( "/update?" + m_loginString ); } @@ -226,7 +226,7 @@ Reader::updateFinished( int /*id*/, bool error ) { DEBUG_BLOCK ContentFetcher* http = (ContentFetcher*) sender(); - disconnect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( updateFinished( int, bool ) ) ); + disconnect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( updateFinished( int, bool ) ) ); if( error ) { http->deleteLater(); @@ -236,9 +236,9 @@ Reader::updateFinished( int /*id*/, bool error ) Map updateResults = parse( http->results(), 0, true ); m_loginString = m_loginString + "&revision-number=" + - QString::number( updateResults["mupd"].asList()[0].asMap()["musr"].asList()[0].asInt() ); + TQString::number( updateResults["mupd"].asList()[0].asMap()["musr"].asList()[0].asInt() ); - connect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( databaseIdFinished( int, bool ) ) ); + connect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( databaseIdFinished( int, bool ) ) ); http->getDaap( "/databases?" + m_loginString ); } @@ -247,7 +247,7 @@ void Reader::databaseIdFinished( int /*id*/, bool error ) { ContentFetcher* http = (ContentFetcher*) sender(); - disconnect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( databaseIdFinished( int, bool ) ) ); + disconnect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( databaseIdFinished( int, bool ) ) ); if( error ) { http->deleteLater(); @@ -255,9 +255,9 @@ Reader::databaseIdFinished( int /*id*/, bool error ) } Map dbIdResults = parse( http->results(), 0, true ); - m_databaseId = QString::number( dbIdResults["avdb"].asList()[0].asMap()["mlcl"].asList()[0].asMap()["mlit"].asList()[0].asMap()["miid"].asList()[0].asInt() ); - connect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( songListFinished( int, bool ) ) ); - http->getDaap( QString("/databases/%1/items?type=music&meta=dmap.itemid,dmap.itemname,daap.songformat,daap.songartist,daap.songalbum,daap.songtime,daap.songtracknumber,daap.songcomment,daap.songyear,daap.songgenre&%2") + m_databaseId = TQString::number( dbIdResults["avdb"].asList()[0].asMap()["mlcl"].asList()[0].asMap()["mlit"].asList()[0].asMap()["miid"].asList()[0].asInt() ); + connect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( songListFinished( int, bool ) ) ); + http->getDaap( TQString("/databases/%1/items?type=music&meta=dmap.itemid,dmap.itemname,daap.songformat,daap.songartist,daap.songalbum,daap.songtime,daap.songtracknumber,daap.songcomment,daap.songyear,daap.songgenre&%2") .arg( m_databaseId, m_loginString ) ); } @@ -266,7 +266,7 @@ void Reader::songListFinished( int /*id*/, bool error ) { ContentFetcher* http = (ContentFetcher*) sender(); - disconnect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( songListFinished( int, bool ) ) ); + disconnect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( songListFinished( int, bool ) ) ); if( error ) { http->deleteLater(); @@ -276,28 +276,28 @@ Reader::songListFinished( int /*id*/, bool error ) Map songResults = parse( http->results(), 0, true ); SongList result; - QValueList songList; + TQValueList songList; songList = songResults["adbs"].asList()[0].asMap()["mlcl"].asList()[0].asMap()["mlit"].asList(); debug() << "songList.count() = " << songList.count() << endl; - QValueList::iterator it; + TQValueList::iterator it; for( it = songList.begin(); it != songList.end(); ++it ) { MetaBundle* bundle = new MetaBundle(); bundle->setTitle( (*it).asMap()["minm"].asList()[0].toString() ); //input url: daap://host:port/databaseId/music.ext bundle->setUrl( Amarok::QStringx("daap://%1:%2/%3/%4.%5").args( - QStringList() << m_host - << QString::number( m_port ) + TQStringList() << m_host + << TQString::number( m_port ) << m_databaseId - << QString::number( (*it).asMap()["miid"].asList()[0].asInt() ) + << TQString::number( (*it).asMap()["miid"].asList()[0].asInt() ) << (*it).asMap()["asfm"].asList()[0].asString() ) ); bundle->setLength( (*it).asMap()["astm"].asList()[0].toInt()/1000 ); bundle->setTrack( (*it).asMap()["astn"].asList()[0].toInt() ); - QString album = (*it).asMap()["asal"].asList()[0].toString(); + TQString album = (*it).asMap()["asal"].asList()[0].toString(); bundle->setAlbum( album ); - QString artist = (*it).asMap()["asar"].asList()[0].toString(); + TQString artist = (*it).asMap()["asar"].asList()[0].toString(); bundle->setArtist( artist ); result[ artist.lower() ][ album.lower() ].append(bundle); @@ -310,7 +310,7 @@ Reader::songListFinished( int /*id*/, bool error ) } Q_UINT32 -Reader::getTagAndLength( QDataStream &raw, char tag[5] ) +Reader::getTagAndLength( TQDataStream &raw, char tag[5] ) { tag[4] = 0; raw.readRawBytes(tag, 4); @@ -320,7 +320,7 @@ Reader::getTagAndLength( QDataStream &raw, char tag[5] ) } Map -Reader::parse( QDataStream &raw, uint containerLength, bool first ) +Reader::parse( TQDataStream &raw, uint containerLength, bool first ) { //DEBUG_BLOCK /* http://daap.sourceforge.net/docs/index.html @@ -347,39 +347,39 @@ Reader::parse( QDataStream &raw, uint containerLength, bool first ) case CHAR: { Q_INT8 charData; raw >> charData; DEBUGTAG( charData ) - addElement( childMap, tag, QVariant( static_cast(charData) ) ); + addElement( childMap, tag, TQVariant( static_cast(charData) ) ); } break; case SHORT: { Q_INT16 shortData; raw >> shortData; DEBUGTAG( shortData ) - addElement( childMap, tag, QVariant( static_cast(shortData) ) ); + addElement( childMap, tag, TQVariant( static_cast(shortData) ) ); } break; case LONG: { Q_INT32 longData; raw >> longData; DEBUGTAG( longData ) - addElement( childMap, tag, QVariant( longData ) ); + addElement( childMap, tag, TQVariant( longData ) ); } break; case LONGLONG: { Q_INT64 longlongData; raw >> longlongData; DEBUGTAG( longlongData ) - addElement( childMap, tag, QVariant( longlongData ) ); + addElement( childMap, tag, TQVariant( longlongData ) ); } break; case STRING: { - QByteArray stringData(tagLength); - raw.readRawBytes( stringData.data(), tagLength ); DEBUGTAG( QString::fromUtf8( stringData, tagLength ) ) - addElement( childMap, tag, QVariant( QString::fromUtf8( stringData, tagLength ) ) ); + TQByteArray stringData(tagLength); + raw.readRawBytes( stringData.data(), tagLength ); DEBUGTAG( TQString::fromUtf8( stringData, tagLength ) ) + addElement( childMap, tag, TQVariant( TQString::fromUtf8( stringData, tagLength ) ) ); } break; case DATE: { Q_INT64 dateData; - QDateTime date; + TQDateTime date; raw >> dateData; DEBUGTAG( dateData ) date.setTime_t(dateData); - addElement( childMap, tag, QVariant( date ) ); + addElement( childMap, tag, TQVariant( date ) ); } break; case DVERSION: { @@ -387,14 +387,14 @@ Reader::parse( QDataStream &raw, uint containerLength, bool first ) Q_INT8 minor; Q_INT8 patchLevel; raw >> major >> minor >> patchLevel; DEBUGTAG( patchLevel ) - QString version("%1.%2.%3"); + TQString version("%1.%2.%3"); version.arg(major, minor, patchLevel); - addElement( childMap, tag, QVariant(version) ); + addElement( childMap, tag, TQVariant(version) ); } break; case CONTAINER: { DEBUGTAG( 11 ) - addElement( childMap, tag, QVariant( parse( raw, tagLength ) ) ); + addElement( childMap, tag, TQVariant( parse( raw, tagLength ) ) ); } break; default: @@ -407,18 +407,18 @@ Reader::parse( QDataStream &raw, uint containerLength, bool first ) } void -Reader::addElement( Map &parentMap, char* tag, QVariant element ) +Reader::addElement( Map &parentMap, char* tag, TQVariant element ) { if( !parentMap.contains( tag ) ) - parentMap[tag] = QVariant( QValueList() ); + parentMap[tag] = TQVariant( TQValueList() ); parentMap[tag].asList().append(element); } void -Reader::fetchingError( const QString& error ) +Reader::fetchingError( const TQString& error ) { - const_cast< QObject* >( sender() )->deleteLater(); + const_cast< TQObject* >( sender() )->deleteLater(); emit httpError( error ); } #include "reader.moc" diff --git a/amarok/src/mediadevice/daap/daapreader/reader.h b/amarok/src/mediadevice/daap/daapreader/reader.h index 8b9f533b..473c53c7 100644 --- a/amarok/src/mediadevice/daap/daapreader/reader.h +++ b/amarok/src/mediadevice/daap/daapreader/reader.h @@ -13,36 +13,36 @@ #ifndef DAAPREADER_H #define DAAPREADER_H -#include +#include #include -class QString; +class TQString; template -class QPtrList; +class TQPtrList; class MetaBundle; class ServerItem; -class QHttpResponseHeader; +class TQHttpResponseHeader; namespace Daap { - typedef QMap Map; + typedef TQMap Map; - typedef QPtrList< MetaBundle > TrackList; - typedef QMap< QString, TrackList > AlbumList; - typedef QMap< QString, AlbumList > SongList; + typedef TQPtrList< MetaBundle > TrackList; + typedef TQMap< TQString, TrackList > AlbumList; + typedef TQMap< TQString, AlbumList > SongList; -//typedef QMap > > SongList; +//typedef TQMap > > SongList; enum ContentTypes { INVALID = 0, CHAR = 1, SHORT = 2, LONG = 5, LONGLONG = 7, STRING = 9, DATE = 10, DVERSION = 11, CONTAINER = 12 }; struct Code { Code() : type(INVALID) { } - Code( const QString& nName, ContentTypes nType ) : name( nName ), type( nType ) { } + Code( const TQString& nName, ContentTypes nType ) : name( nName ), type( nType ) { } ~Code() { } - QString name; + TQString name; ContentTypes type; }; @@ -57,31 +57,31 @@ namespace Daap Q_OBJECT public: - Reader( const QString& host, Q_UINT16 port, ServerItem* root, - const QString& password, QObject* parent, const char* name ); + Reader( const TQString& host, Q_UINT16 port, ServerItem* root, + const TQString& password, TQObject* parent, const char* name ); ~Reader(); - //QPtrList getSongList(); + //TQPtrList getSongList(); enum Options { SESSION_ID = 1, SERVER_VERSION = 2 }; void loginRequest(); void logoutRequest(); ServerItem* rootMediaItem() const { return m_root; } int sessionId() const { return m_sessionId; } - QString host() const { return m_host; } + TQString host() const { return m_host; } Q_UINT16 port() const { return m_port; } public slots: void logoutRequest(int, bool ); - void loginHeaderReceived( const QHttpResponseHeader& resp ); + void loginHeaderReceived( const TQHttpResponseHeader& resp ); void loginFinished( int id , bool error ); void updateFinished( int id , bool error ); void databaseIdFinished( int id , bool error ); void songListFinished( int id, bool error ); - void fetchingError( const QString& error ); + void fetchingError( const TQString& error ); signals: - void daapBundles( const QString& host, Daap::SongList bundles ); - void httpError( const QString& ); + void daapBundles( const TQString& host, Daap::SongList bundles ); + void httpError( const TQString& ); void passwordRequired(); private: @@ -90,19 +90,19 @@ namespace Daap * @param raw stream of DAAP reply * @param containerLength length of the container (or entire result) being analyzed */ - static Map parse( QDataStream &raw, uint containerLength, bool first = false ); - static void addElement( Map &parentMap, char* tag, QVariant element ); //! supporter function for parse - static Q_UINT32 getTagAndLength( QDataStream &raw, char tag[5] ); + static Map parse( TQDataStream &raw, uint containerLength, bool first = false ); + static void addElement( Map &parentMap, char* tag, TQVariant element ); //! supporter function for parse + static Q_UINT32 getTagAndLength( TQDataStream &raw, char tag[5] ); - static QMap s_codes; + static TQMap s_codes; - QString m_host; + TQString m_host; Q_UINT16 m_port; - QString m_loginString; - QString m_databaseId; + TQString m_loginString; + TQString m_databaseId; int m_sessionId; ServerItem* m_root; - QString m_password; + TQString m_password; }; diff --git a/amarok/src/mediadevice/daap/daapserver.cpp b/amarok/src/mediadevice/daap/daapserver.cpp index 6b9cd8de..9a1b9b23 100644 --- a/amarok/src/mediadevice/daap/daapserver.cpp +++ b/amarok/src/mediadevice/daap/daapserver.cpp @@ -21,8 +21,8 @@ #if DNSSD_SUPPORT #include #endif -DaapServer::DaapServer(QObject* parent, char* name) - : QObject( parent, name ) +DaapServer::DaapServer(TQObject* parent, char* name) + : TQObject( parent, name ) , m_service( 0 ) { DEBUG_BLOCK @@ -38,7 +38,7 @@ DaapServer::DaapServer(QObject* parent, char* name) return; } - connect( m_server, SIGNAL( readReady( KProcIO* ) ), this, SLOT( readSql() ) ); + connect( m_server, TQT_SIGNAL( readReady( KProcIO* ) ), this, TQT_SLOT( readSql() ) ); } DaapServer::~DaapServer() @@ -52,9 +52,9 @@ DaapServer::~DaapServer() void DaapServer::readSql() { - static const QCString sqlPrefix = "SQL QUERY: "; - static const QCString serverStartPrefix = "SERVER STARTING: "; - QString line; + static const TQCString sqlPrefix = "SQL QUERY: "; + static const TQCString serverStartPrefix = "SERVER STARTING: "; + TQString line; while( m_server->readln( line ) != -1 ) { if( line.startsWith( sqlPrefix ) ) diff --git a/amarok/src/mediadevice/daap/daapserver.h b/amarok/src/mediadevice/daap/daapserver.h index 1f1d0773..594d478e 100644 --- a/amarok/src/mediadevice/daap/daapserver.h +++ b/amarok/src/mediadevice/daap/daapserver.h @@ -24,7 +24,7 @@ class DaapServer : public QObject Q_OBJECT public: - DaapServer(QObject* parent, char* name); + DaapServer(TQObject* parent, char* name); ~DaapServer(); public slots: void readSql(); diff --git a/amarok/src/mediadevice/daap/proxy.cpp b/amarok/src/mediadevice/daap/proxy.cpp index 9ab3885d..b1095cd4 100644 --- a/amarok/src/mediadevice/daap/proxy.cpp +++ b/amarok/src/mediadevice/daap/proxy.cpp @@ -24,20 +24,20 @@ using namespace Daap; //input url: daap://host:port/databaseId/music.ext /* bundle->setUrl( Amarok::QStringx("http://%1:3689/databases/%2/items/%3.%4?%5").args( - QStringList() << m_host + TQStringList() << m_host << m_databaseId - << QString::number( (*it).asMap()["miid"].asList()[0].asInt() ) + << TQString::number( (*it).asMap()["miid"].asList()[0].asInt() ) << (*it).asMap()["asfm"].asList()[0].asString() << m_loginString ) ); */ Proxy::Proxy(KURL stream, DaapClient* client, const char* name) - : QObject(client, name) + : TQObject(client, name) , m_proxy( new Amarok::ProcIO() ) { DEBUG_BLOCK //find the request id and increment it - const QString hostKey = stream.host() + ':' + QString::number(stream.port()); + const TQString hostKey = stream.host() + ':' + TQString::number(stream.port()); const int revisionId = client->incRevision( hostKey ); const int sessionId = client->getSession( hostKey ); //compose URL @@ -56,16 +56,16 @@ Proxy::Proxy(KURL stream, DaapClient* client, const char* name) const int port = socket->port(); debug() << "Proxy server using port: " << port << endl; delete socket; - m_proxyUrl = KURL( QString("http://localhost:%1/daap.mp3").arg( port ) ); + m_proxyUrl = KURL( TQString("http://localhost:%1/daap.mp3").arg( port ) ); //start proxy m_proxy->setComm( KProcess::Communication( KProcess::AllOutput ) ); *m_proxy << "amarok_proxy.rb"; *m_proxy << "--daap"; - *m_proxy << QString::number( port ); + *m_proxy << TQString::number( port ); *m_proxy << realStream.url(); *m_proxy << AmarokConfig::soundSystem(); *m_proxy << hash; - *m_proxy << QString::number( revisionId ); + *m_proxy << TQString::number( revisionId ); *m_proxy << Amarok::proxyForUrl( realStream.url() ); if( !m_proxy->start( KProcIO::NotifyOnExit, true ) ) { @@ -73,15 +73,15 @@ Proxy::Proxy(KURL stream, DaapClient* client, const char* name) return; } - QString line; + TQString line; while( true ) { kapp->processEvents(); m_proxy->readln( line ); if( line == "AMAROK_PROXY: startup" ) break; } - debug() << "started amarok_proxy.rb --daap " << QString::number( port ) << ' ' << realStream.url() << ' ' << AmarokConfig::soundSystem() << ' ' << hash << ' ' << revisionId << endl; - connect( m_proxy, SIGNAL( processExited( KProcess* ) ), this, SLOT( playbackStopped() ) ); - connect( m_proxy, SIGNAL( readReady( KProcIO* ) ), this, SLOT( readProxy() ) ); + debug() << "started amarok_proxy.rb --daap " << TQString::number( port ) << ' ' << realStream.url() << ' ' << AmarokConfig::soundSystem() << ' ' << hash << ' ' << revisionId << endl; + connect( m_proxy, TQT_SIGNAL( processExited( KProcess* ) ), this, TQT_SLOT( playbackStopped() ) ); + connect( m_proxy, TQT_SIGNAL( readReady( KProcIO* ) ), this, TQT_SLOT( readProxy() ) ); } Proxy::~Proxy() @@ -98,7 +98,7 @@ Proxy::playbackStopped() void Proxy::readProxy() { - QString line; + TQString line; while( m_proxy->readln( line ) != -1 ) { @@ -113,7 +113,7 @@ KURL Proxy::realStreamUrl( KURL fakeStream, int sessionId ) realStream.setHost(fakeStream.host()); realStream.setPort(fakeStream.port()); realStream.setPath( "/databases" + fakeStream.directory() + "/items/" + fakeStream.fileName() ); - realStream.setQuery( QString("?session-id=") + QString::number(sessionId) ); + realStream.setQuery( TQString("?session-id=") + TQString::number(sessionId) ); return realStream; } diff --git a/amarok/src/mediadevice/daap/proxy.h b/amarok/src/mediadevice/daap/proxy.h index 9757871a..02b37158 100644 --- a/amarok/src/mediadevice/daap/proxy.h +++ b/amarok/src/mediadevice/daap/proxy.h @@ -13,8 +13,8 @@ #ifndef DAAPPROXY_H #define DAAPPROXY_H -#include -#include +#include +#include class DaapClient; namespace Daap { @@ -38,12 +38,12 @@ namespace Daap { Amarok::ProcIO* m_proxy; }; - // We must implement this because QServerSocket has one pure virtual method. + // We must implement this because TQServerSocket has one pure virtual method. // It's just used for finding a free port. class MyServerSocket : public QServerSocket { public: - MyServerSocket() : QServerSocket( Q_UINT16( 0 ) ) {} + MyServerSocket() : TQServerSocket( Q_UINT16( 0 ) ) {} private: void newConnection( int ) {} diff --git a/amarok/src/mediadevice/generic/genericmediadevice.cpp b/amarok/src/mediadevice/generic/genericmediadevice.cpp index 9a27b12e..79056bde 100644 --- a/amarok/src/mediadevice/generic/genericmediadevice.cpp +++ b/amarok/src/mediadevice/generic/genericmediadevice.cpp @@ -53,17 +53,17 @@ AMAROK_EXPORT_PLUGIN( GenericMediaDevice ) #include //usleep() -#include -#include +#include +#include #include -#include +#include -#include -#include -#include +#include +#include +#include -typedef QPtrList MediaFileList; -typedef QPtrListIterator MediaFileListIterator; +typedef TQPtrList MediaFileList; +typedef TQPtrListIterator MediaFileListIterator; /** * GenericMediaItem Class @@ -72,17 +72,17 @@ typedef QPtrListIterator MediaFileListIterator; class GenericMediaItem : public MediaItem { public: - GenericMediaItem( QListView *parent, QListViewItem *after = 0 ) + GenericMediaItem( TQListView *parent, TQListViewItem *after = 0 ) : MediaItem( parent, after ) { } - GenericMediaItem( QListViewItem *parent, QListViewItem *after = 0 ) + GenericMediaItem( TQListViewItem *parent, TQListViewItem *after = 0 ) : MediaItem( parent, after ) { } // List directories first, always int - compare( QListViewItem *i, int col, bool ascending ) const + compare( TQListViewItem *i, int col, bool ascending ) const { #define i static_cast(i) switch( type() ) @@ -108,7 +108,7 @@ class GenericMediaItem : public MediaItem class GenericMediaFile { public: - GenericMediaFile( GenericMediaFile *parent, QString basename, GenericMediaDevice *device ) + GenericMediaFile( GenericMediaFile *parent, TQString basename, GenericMediaDevice *device ) : m_parent( parent ) , m_device( device ) { @@ -193,12 +193,12 @@ class GenericMediaFile //always follow this function with setNamesFromBase() void - setBaseName( QString &name ) { m_baseName = name; } + setBaseName( TQString &name ) { m_baseName = name; } void - setNamesFromBase( const QString &name = QString::null ) + setNamesFromBase( const TQString &name = TQString::null ) { - if( name != QString::null ) + if( name != TQString::null ) m_baseName = name; if( m_parent ) m_fullName = m_parent->getFullName() + '/' + m_baseName; @@ -241,8 +241,8 @@ class GenericMediaFile } private: - QString m_fullName; - QString m_baseName; + TQString m_fullName; + TQString m_baseName; GenericMediaFile *m_parent; MediaFileList *m_children; GenericMediaItem *m_viewItem; @@ -253,7 +253,7 @@ class GenericMediaFile QString GenericMediaDevice::fileName( const MetaBundle &bundle ) { - QString result = cleanPath( bundle.artist() ); + TQString result = cleanPath( bundle.artist() ); if( !result.isEmpty() ) { @@ -299,18 +299,18 @@ GenericMediaDevice::GenericMediaDevice() m_ignoreThePrefix = false; m_asciiTextOnly = false; - m_songLocation = QString::null; - m_podcastLocation = QString::null; + m_songLocation = TQString::null; + m_podcastLocation = TQString::null; m_supportedFileTypes.clear(); m_configDialog = 0; - connect( m_dirLister, SIGNAL( newItems(const KFileItemList &) ), this, SLOT( newItems(const KFileItemList &) ) ); - connect( m_dirLister, SIGNAL( completed() ), this, SLOT( dirListerCompleted() ) ); - connect( m_dirLister, SIGNAL( clear() ), this, SLOT( dirListerClear() ) ); - connect( m_dirLister, SIGNAL( clear(const KURL &) ), this, SLOT( dirListerClear(const KURL &) ) ); - connect( m_dirLister, SIGNAL( deleteItem(KFileItem *) ), this, SLOT( dirListerDeleteItem(KFileItem *) ) ); + connect( m_dirLister, TQT_SIGNAL( newItems(const KFileItemList &) ), this, TQT_SLOT( newItems(const KFileItemList &) ) ); + connect( m_dirLister, TQT_SIGNAL( completed() ), this, TQT_SLOT( dirListerCompleted() ) ); + connect( m_dirLister, TQT_SIGNAL( clear() ), this, TQT_SLOT( dirListerClear() ) ); + connect( m_dirLister, TQT_SIGNAL( clear(const KURL &) ), this, TQT_SLOT( dirListerClear(const KURL &) ) ); + connect( m_dirLister, TQT_SIGNAL( deleteItem(KFileItem *) ), this, TQT_SLOT( dirListerDeleteItem(KFileItem *) ) ); } void @@ -332,7 +332,7 @@ GenericMediaDevice::applyConfig() m_supportedFileTypes.clear(); for( uint i = 0; i < m_configDialog->m_supportedListBox->count(); i++ ) { - QString currentText = m_configDialog->m_supportedListBox->item( i )->text(); + TQString currentText = m_configDialog->m_supportedListBox->item( i )->text(); if( currentText == m_configDialog->m_convertComboBox->currentText() ) m_supportedFileTypes.prepend( currentText ); @@ -373,7 +373,7 @@ GenericMediaDevice::loadConfig() m_songLocation = configString( "songLocation", "/%artist/%album/%title.%filetype" ); m_podcastLocation = configString( "podcastLocation", "/podcasts/" ); - m_supportedFileTypes = QStringList::split( ", ", configString( "supportedFiletypes", "mp3"), true); + m_supportedFileTypes = TQStringList::split( ", ", configString( "supportedFiletypes", "mp3"), true); } bool @@ -399,11 +399,11 @@ GenericMediaDevice::openDevice( bool /*silent*/ ) true : false; m_connected = true; KURL tempurl = KURL::fromPathOrURL( m_medium.mountPoint() ); - QString newMountPoint = tempurl.isLocalFile() ? tempurl.path( -1 ) : tempurl.prettyURL( -1 ); //no trailing slash + TQString newMountPoint = tempurl.isLocalFile() ? tempurl.path( -1 ) : tempurl.prettyURL( -1 ); //no trailing slash m_transferDir = newMountPoint; m_initialFile = new GenericMediaFile( 0, newMountPoint, this ); listDir( newMountPoint ); - connect( this, SIGNAL( startTransfer() ), MediaBrowser::instance(), SLOT( transferClicked() ) ); + connect( this, TQT_SIGNAL( startTransfer() ), MediaBrowser::instance(), TQT_SLOT( transferClicked() ) ); return true; } @@ -426,7 +426,7 @@ GenericMediaDevice::closeDevice() //SLOT /// Renaming void -GenericMediaDevice::renameItem( QListViewItem *item ) // SLOT +GenericMediaDevice::renameItem( TQListViewItem *item ) // SLOT { if( !item ) @@ -434,8 +434,8 @@ GenericMediaDevice::renameItem( QListViewItem *item ) // SLOT #define item static_cast(item) - QString src = m_mim[item]->getFullName(); - QString dst = m_mim[item]->getParent()->getFullName() + '/' + item->text(0); + TQString src = m_mim[item]->getFullName(); + TQString dst = m_mim[item]->getParent()->getFullName() + '/' + item->text(0); debug() << "Renaming: " << src << " to: " << dst << endl; @@ -464,15 +464,15 @@ GenericMediaDevice::renameItem( QListViewItem *item ) // SLOT /// Creating a directory MediaItem * -GenericMediaDevice::newDirectory( const QString &name, MediaItem *parent ) +GenericMediaDevice::newDirectory( const TQString &name, MediaItem *parent ) { if( !m_connected || name.isEmpty() ) return 0; #define parent static_cast(parent) - QString fullName = m_mim[parent]->getFullName(); - QString cleanedName = cleanPath( name ); - QString fullPath = fullName + '/' + cleanedName; + TQString fullName = m_mim[parent]->getFullName(); + TQString cleanedName = cleanPath( name ); + TQString fullPath = fullName + '/' + cleanedName; debug() << "Creating directory: " << fullPath << endl; const KURL url( fullPath ); @@ -490,7 +490,7 @@ GenericMediaDevice::newDirectory( const QString &name, MediaItem *parent ) } void -GenericMediaDevice::addToDirectory( MediaItem *directory, QPtrList items ) +GenericMediaDevice::addToDirectory( MediaItem *directory, TQPtrList items ) { if( items.isEmpty() ) return; @@ -506,11 +506,11 @@ GenericMediaDevice::addToDirectory( MediaItem *directory, QPtrList it dropDir = m_mim[directory]; } - for( QPtrListIterator it(items); *it; ++it ) + for( TQPtrListIterator it(items); *it; ++it ) { GenericMediaItem *currItem = static_cast(*it); - QString src = m_mim[currItem]->getFullName(); - QString dst = dropDir->getFullName() + '/' + currItem->text(0); + TQString src = m_mim[currItem]->getFullName(); + TQString dst = dropDir->getFullName() + '/' + currItem->text(0); debug() << "Moving: " << src << " to: " << dst << endl; const KURL srcurl(src); @@ -531,12 +531,12 @@ GenericMediaDevice::addToDirectory( MediaItem *directory, QPtrList it /// Uploading QString -GenericMediaDevice::buildDestination( const QString &format, const MetaBundle &mb ) +GenericMediaDevice::buildDestination( const TQString &format, const MetaBundle &mb ) { bool isCompilation = mb.compilation() == MetaBundle::CompilationYes; - QMap args; - QString artist = mb.artist(); - QString albumartist = artist; + TQMap args; + TQString artist = mb.artist(); + TQString albumartist = artist; if( isCompilation ) albumartist = i18n( "Various Artists" ); args["theartist"] = cleanPath( artist ); @@ -558,21 +558,21 @@ GenericMediaDevice::buildDestination( const QString &format, const MetaBundle &m args["albumartist"] = albumartist; args["initial"] = albumartist.mid( 0, 1 ).upper(); args["filetype"] = mb.url().pathOrURL().section( ".", -1 ).lower(); - QString track; + TQString track; if ( mb.track() ) track.sprintf( "%02d", mb.track() ); args["track"] = track; Amarok::QStringx formatx( format ); - QString result = formatx.namedOptArgs( args ); + TQString result = formatx.namedOptArgs( args ); if( !result.startsWith( "/" ) ) result.prepend( "/" ); - return result.replace( QRegExp( "/\\.*" ), "/" ); + return result.replace( TQRegExp( "/\\.*" ), "/" ); } void -GenericMediaDevice::checkAndBuildLocation( const QString& location ) +GenericMediaDevice::checkAndBuildLocation( const TQString& location ) { // check for every directory from the mount point to the location // whether they exist or not. @@ -593,8 +593,8 @@ GenericMediaDevice::checkAndBuildLocation( const QString& location ) i++ ) { - QString firstpart = location.section( '/', 0, i-1 ); - QString secondpart = cleanPath( location.section( '/', i, i ) ); + TQString firstpart = location.section( '/', 0, i-1 ); + TQString secondpart = cleanPath( location.section( '/', i, i ) ); KURL url = KURL::fromPathOrURL( firstpart + '/' + secondpart ); if( !KIO::NetAccess::exists( url, false, m_parent ) ) @@ -612,18 +612,18 @@ GenericMediaDevice::checkAndBuildLocation( const QString& location ) QString GenericMediaDevice::buildPodcastDestination( const PodcastEpisodeBundle *bundle ) { - QString location = m_podcastLocation.endsWith("/") ? m_podcastLocation : m_podcastLocation + '/'; + TQString location = m_podcastLocation.endsWith("/") ? m_podcastLocation : m_podcastLocation + '/'; // get info about the PodcastChannel - QString parentUrl = bundle->parent().url(); - QString sql = "SELECT title,parent FROM podcastchannels WHERE url='" + CollectionDB::instance()->escapeString( parentUrl ) + "';"; - QStringList values = CollectionDB::instance()->query( sql ); - QString channelTitle; + TQString parentUrl = bundle->parent().url(); + TQString sql = "SELECT title,parent FROM podcastchannels WHERE url='" + CollectionDB::instance()->escapeString( parentUrl ) + "';"; + TQStringList values = CollectionDB::instance()->query( sql ); + TQString channelTitle; int parent = 0; channelTitle = values.first(); parent = values.last().toInt(); // Put the file in a directory tree like in the playlistbrowser sql = "SELECT name,parent FROM podcastfolders WHERE id=%1;"; - QString name; + TQString name; while ( parent > 0 ) { values = CollectionDB::instance()->query( sql.arg( parent ) ); @@ -642,7 +642,7 @@ GenericMediaDevice::copyTrackToDevice( const MetaBundle& bundle ) if( !m_connected ) return 0; // use different naming schemes for differen kinds of tracks - QString path = m_transferDir; + TQString path = m_transferDir; debug() << "bundle exists: " << bundle.podcastBundle() << endl; if( bundle.podcastBundle() ) path += buildPodcastDestination( bundle.podcastBundle() ); @@ -676,13 +676,13 @@ GenericMediaDevice::copyTrackToDevice( const MetaBundle& bundle ) MediaItem * GenericMediaDevice::trackExists( const MetaBundle& bundle ) { - QString key; - QString path = buildDestination( m_songLocation, bundle); + TQString key; + TQString path = buildDestination( m_songLocation, bundle); KURL url( path ); - QStringList directories = QStringList::split( "/", url.directory(1,1), false ); + TQStringList directories = TQStringList::split( "/", url.directory(1,1), false ); - QListViewItem *it = view()->firstChild(); - for( QStringList::Iterator directory = directories.begin(); + TQListViewItem *it = view()->firstChild(); + for( TQStringList::Iterator directory = directories.begin(); directory != directories.end(); directory++ ) { @@ -732,7 +732,7 @@ GenericMediaDevice::deleteItemFromDevice( MediaItem *item, int /*flags*/ ) #define item static_cast(item) - QString path = m_mim[item]->getFullName(); + TQString path = m_mim[item]->getFullName(); debug() << "Deleting path: " << path << endl; if ( !KIO::NetAccess::del( KURL::fromPathOrURL(path), m_view )) @@ -763,7 +763,7 @@ GenericMediaDevice::deleteItemFromDevice( MediaItem *item, int /*flags*/ ) /// Directory Reading void -GenericMediaDevice::expandItem( QListViewItem *item ) // SLOT +GenericMediaDevice::expandItem( TQListViewItem *item ) // SLOT { if( !item || !item->isExpandable() ) return; @@ -780,7 +780,7 @@ GenericMediaDevice::expandItem( QListViewItem *item ) // SLOT } void -GenericMediaDevice::listDir( const QString &dir ) +GenericMediaDevice::listDir( const TQString &dir ) { m_dirListerComplete = false; if( m_mfm[dir]->getListed() ) @@ -793,7 +793,7 @@ GenericMediaDevice::listDir( const QString &dir ) } void -GenericMediaDevice::refreshDir( const QString &dir ) +GenericMediaDevice::refreshDir( const TQString &dir ) { m_dirListerComplete = false; m_dirLister->updateDirectory( KURL::fromPathOrURL(dir) ); @@ -802,7 +802,7 @@ GenericMediaDevice::refreshDir( const QString &dir ) void GenericMediaDevice::newItems( const KFileItemList &items ) { - QPtrListIterator it( items ); + TQPtrListIterator it( items ); KFileItem *kfi; while ( (kfi = it.current()) != 0 ) { ++it; @@ -826,14 +826,14 @@ GenericMediaDevice::dirListerClear() m_mim.clear(); KURL tempurl = KURL::fromPathOrURL( m_medium.mountPoint() ); - QString newMountPoint = tempurl.isLocalFile() ? tempurl.path( -1 ) : tempurl.prettyURL( -1 ); //no trailing slash + TQString newMountPoint = tempurl.isLocalFile() ? tempurl.path( -1 ) : tempurl.prettyURL( -1 ); //no trailing slash m_initialFile = new GenericMediaFile( 0, newMountPoint, this ); } void GenericMediaDevice::dirListerClear( const KURL &url ) { - QString directory = url.pathOrURL(); + TQString directory = url.pathOrURL(); GenericMediaFile *vmf = m_mfm[directory]; if( vmf ) vmf->deleteAll( false ); @@ -842,7 +842,7 @@ GenericMediaDevice::dirListerClear( const KURL &url ) void GenericMediaDevice::dirListerDeleteItem( KFileItem *fileitem ) { - QString filename = fileitem->url().pathOrURL(); + TQString filename = fileitem->url().pathOrURL(); GenericMediaFile *vmf = m_mfm[filename]; if( vmf ) vmf->deleteAll( true ); @@ -851,10 +851,10 @@ GenericMediaDevice::dirListerDeleteItem( KFileItem *fileitem ) int GenericMediaDevice::addTrackToList( int type, KURL url, int /*size*/ ) { - QString path = url.isLocalFile() ? url.path( -1 ) : url.prettyURL( -1 ); //no trailing slash + TQString path = url.isLocalFile() ? url.path( -1 ) : url.prettyURL( -1 ); //no trailing slash int index = path.findRev( '/', -1 ); - QString baseName = path.right( path.length() - index - 1 ); - QString parentName = path.left( index ); + TQString baseName = path.right( path.length() - index - 1 ); + TQString parentName = path.left( index ); GenericMediaFile* parent = m_mfm[parentName]; GenericMediaFile* newItem = new GenericMediaFile( parent, baseName, this ); @@ -891,8 +891,8 @@ GenericMediaDevice::getCapacity( KIO::filesize_t *total, KIO::filesize_t *availa KDiskFreeSp* kdf = new KDiskFreeSp( m_parent, "generic_kdf" ); kdf->readDF( m_medium.mountPoint() ); - connect(kdf, SIGNAL(foundMountPoint( const QString &, unsigned long, unsigned long, unsigned long )), - SLOT(foundMountPoint( const QString &, unsigned long, unsigned long, unsigned long ))); + connect(kdf, TQT_SIGNAL(foundMountPoint( const TQString &, unsigned long, unsigned long, unsigned long )), + TQT_SLOT(foundMountPoint( const TQString &, unsigned long, unsigned long, unsigned long ))); int count = 0; @@ -916,7 +916,7 @@ GenericMediaDevice::getCapacity( KIO::filesize_t *total, KIO::filesize_t *availa } void -GenericMediaDevice::foundMountPoint( const QString & mountPoint, unsigned long kBSize, unsigned long /*kBUsed*/, unsigned long kBAvail ) +GenericMediaDevice::foundMountPoint( const TQString & mountPoint, unsigned long kBSize, unsigned long /*kBUsed*/, unsigned long kBAvail ) { if ( mountPoint == m_medium.mountPoint() ){ m_kBSize = kBSize; @@ -927,7 +927,7 @@ GenericMediaDevice::foundMountPoint( const QString & mountPoint, unsigned long k /// Helper functions void -GenericMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) +GenericMediaDevice::rmbPressed( TQListViewItem* qitem, const TQPoint& point, int ) { enum Actions { APPEND, LOAD, QUEUE, DOWNLOAD, @@ -1033,16 +1033,16 @@ GenericMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) } -QString GenericMediaDevice::cleanPath( const QString &component ) +TQString GenericMediaDevice::cleanPath( const TQString &component ) { - QString result = Amarok::cleanPath( component ); + TQString result = Amarok::cleanPath( component ); if( m_asciiTextOnly ) result = Amarok::asciiPath( result ); result.simplifyWhiteSpace(); if( m_spacesToUnderscores ) - result.replace( QRegExp( "\\s" ), "_" ); + result.replace( TQRegExp( "\\s" ), "_" ); if( m_actuallyVfat || m_vfatTextOnly ) result = Amarok::vfatPath( result ); @@ -1055,7 +1055,7 @@ QString GenericMediaDevice::cleanPath( const QString &component ) bool GenericMediaDevice::isPlayable( const MetaBundle& bundle ) { - for( QStringList::Iterator it = m_supportedFileTypes.begin(); it != m_supportedFileTypes.end() ; it++ ) + for( TQStringList::Iterator it = m_supportedFileTypes.begin(); it != m_supportedFileTypes.end() ; it++ ) { if( bundle.type().lower() == (*it).lower() ) return true; @@ -1072,7 +1072,7 @@ bool GenericMediaDevice::isPreferredFormat( const MetaBundle &bundle ) /// Configuration Dialog Extension -void GenericMediaDevice::addConfigElements( QWidget * parent ) +void GenericMediaDevice::addConfigElements( TQWidget * parent ) { m_configDialog = new GenericMediaDeviceConfigDialog( parent ); @@ -1080,7 +1080,7 @@ void GenericMediaDevice::addConfigElements( QWidget * parent ) } -void GenericMediaDevice::removeConfigElements( QWidget * /* parent */ ) +void GenericMediaDevice::removeConfigElements( TQWidget * /* parent */ ) { if( m_configDialog != 0 ) delete m_configDialog; diff --git a/amarok/src/mediadevice/generic/genericmediadevice.h b/amarok/src/mediadevice/generic/genericmediadevice.h index ab034273..4ea9665f 100644 --- a/amarok/src/mediadevice/generic/genericmediadevice.h +++ b/amarok/src/mediadevice/generic/genericmediadevice.h @@ -26,17 +26,17 @@ #include #include -#include +#include class GenericMediaItem; class GenericMediaFile; class GenericMediaDeviceConfigDialog; class PodcastEpisodeBundle; -class QStringList; +class TQStringList; -typedef QMap MediaFileMap; -typedef QMap MediaItemMap; +typedef TQMap MediaFileMap; +typedef TQMap MediaItemMap; class GenericMediaDevice : public MediaDevice { @@ -51,15 +51,15 @@ class GenericMediaDevice : public MediaDevice bool isConnected() { return m_connected; } - void rmbPressed( QListViewItem* qitem, const QPoint& point, int ); + void rmbPressed( TQListViewItem* qitem, const TQPoint& point, int ); - QStringList supportedFiletypes() { return m_supportedFileTypes; } + TQStringList supportedFiletypes() { return m_supportedFileTypes; } bool isPlayable( const MetaBundle& bundle ); bool isPreferredFormat( const MetaBundle &bundle ); bool needsManualConfig() { return false; } - void addConfigElements( QWidget * parent ); - void removeConfigElements( QWidget * /* parent */); + void addConfigElements( TQWidget * parent ); + void removeConfigElements( TQWidget * /* parent */); void applyConfig(); void loadConfig(); @@ -74,18 +74,18 @@ class GenericMediaDevice : public MediaDevice MediaItem *copyTrackToDevice( const MetaBundle& bundle ); int deleteItemFromDevice( MediaItem *item, int flags=DeleteTrack ); - MediaItem *newDirectory( const QString &name, MediaItem *parent ); - void addToDirectory( MediaItem *directory, QPtrList items ); + MediaItem *newDirectory( const TQString &name, MediaItem *parent ); + void addToDirectory( MediaItem *directory, TQPtrList items ); bool getCapacity( KIO::filesize_t *total, KIO::filesize_t *available ); - QString fileName( const MetaBundle & ); + TQString fileName( const MetaBundle & ); //methods not implemented/needed bool lockDevice( bool ) { return true; } void unlockDevice() {} void synchronizeDevice() {} - void addToPlaylist( MediaItem *, MediaItem *, QPtrList ) {} - MediaItem *newPlaylist( const QString &, MediaItem *, QPtrList ) { return 0; } + void addToPlaylist( MediaItem *, MediaItem *, TQPtrList ) {} + MediaItem *newPlaylist( const TQString &, MediaItem *, TQPtrList ) { return 0; } signals: @@ -93,10 +93,10 @@ class GenericMediaDevice : public MediaDevice protected slots: - void renameItem( QListViewItem *item ); - void expandItem( QListViewItem *item ); - void foundMountPoint( const QString & mountPoint, unsigned long kBSize, unsigned long kBUsed, unsigned long kBAvail ); - void refreshDir( const QString &dir ); + void renameItem( TQListViewItem *item ); + void expandItem( TQListViewItem *item ); + void foundMountPoint( const TQString & mountPoint, unsigned long kBSize, unsigned long kBUsed, unsigned long kBAvail ); + void refreshDir( const TQString &dir ); void newItems( const KFileItemList &items ); void dirListerCompleted(); @@ -110,18 +110,18 @@ class GenericMediaDevice : public MediaDevice MediaItem *trackExists( const MetaBundle& ); - QString buildDestination( const QString &format, const MetaBundle &mb ); - QString buildPodcastDestination( const PodcastEpisodeBundle *bundle ); - void checkAndBuildLocation( const QString& location ); + TQString buildDestination( const TQString &format, const MetaBundle &mb ); + TQString buildPodcastDestination( const PodcastEpisodeBundle *bundle ); + void checkAndBuildLocation( const TQString& location ); KURL::List getSelectedItems(); void downloadSelectedItems(); - void copyTrackSortHelper( const MetaBundle& bundle, QString& sort, QString& base ); + void copyTrackSortHelper( const MetaBundle& bundle, TQString& sort, TQString& base ); - void listDir( const QString &dir ); + void listDir( const TQString &dir ); int addTrackToList( int type, KURL name, int size=0 ); - QString cleanPath( const QString &component ); + TQString cleanPath( const TQString &component ); GenericMediaFile *m_initialFile; @@ -137,9 +137,9 @@ class GenericMediaDevice : public MediaDevice MediaFileMap m_mfm; MediaItemMap m_mim; - QStringList m_supportedFileTypes; - QString m_songLocation; - QString m_podcastLocation; + TQStringList m_supportedFileTypes; + TQString m_songLocation; + TQString m_podcastLocation; bool m_asciiTextOnly; bool m_vfatTextOnly; bool m_ignoreThePrefix; diff --git a/amarok/src/mediadevice/generic/genericmediadeviceconfigdialog.ui.h b/amarok/src/mediadevice/generic/genericmediadeviceconfigdialog.ui.h index 8d266f56..192d4fa0 100644 --- a/amarok/src/mediadevice/generic/genericmediadeviceconfigdialog.ui.h +++ b/amarok/src/mediadevice/generic/genericmediadeviceconfigdialog.ui.h @@ -26,17 +26,17 @@ void GenericMediaDeviceConfigDialog::addSupportedButtonClicked( int id ) { - QPopupMenu *unsupported = m_addSupportedButton->popup(); - QComboBox *convert = m_convertComboBox; - QListBox *supported = m_supportedListBox; + TQPopupMenu *unsupported = m_addSupportedButton->popup(); + TQComboBox *convert = m_convertComboBox; + TQListBox *supported = m_supportedListBox; - QString text = unsupported->text( id ); + TQString text = unsupported->text( id ); if( text.startsWith( "&" ) ) supported->insertItem( text.right( text.length() - 1 ) ); else supported->insertItem( text ); - QString temp = convert->currentText(); + TQString temp = convert->currentText(); convert->insertItem( unsupported->text( id ) ); unsupported->removeItem( id ); @@ -51,10 +51,10 @@ GenericMediaDeviceConfigDialog::addSupportedButtonClicked( int id ) void GenericMediaDeviceConfigDialog::removeSupportedButtonClicked() { - QStringList unsupported; + TQStringList unsupported; - QComboBox *convert = m_convertComboBox; - QListBox *supported = m_supportedListBox; + TQComboBox *convert = m_convertComboBox; + TQListBox *supported = m_supportedListBox; for( uint i = 0; i < m_addSupportedButton->popup()->count(); i++ ) { @@ -64,11 +64,11 @@ GenericMediaDeviceConfigDialog::removeSupportedButtonClicked() for( uint i = 0; i < supported->count() ; /* nothing */) { - QListBoxItem *item = supported->item( i ); + TQListBoxItem *item = supported->item( i ); if( item->isSelected() ) { - QString temp; + TQString temp; unsupported.append( item->text() ); @@ -102,7 +102,7 @@ GenericMediaDeviceConfigDialog::removeSupportedButtonClicked() unsupported.sort(); m_addSupportedButton->popup()->clear(); - for( QStringList::Iterator it = unsupported.begin(); it != unsupported.end(); it++ ) + for( TQStringList::Iterator it = unsupported.begin(); it != unsupported.end(); it++ ) { m_addSupportedButton->popup()->insertItem( *it ); } @@ -110,7 +110,7 @@ GenericMediaDeviceConfigDialog::removeSupportedButtonClicked() void -GenericMediaDeviceConfigDialog::supportedListBoxDoubleClicked( QListBoxItem* item ) +GenericMediaDeviceConfigDialog::supportedListBoxDoubleClicked( TQListBoxItem* item ) { m_convertComboBox->setCurrentText( item->text() ); } @@ -119,18 +119,18 @@ GenericMediaDeviceConfigDialog::supportedListBoxDoubleClicked( QListBoxItem* ite void -GenericMediaDeviceConfigDialog::updateConfigDialogLists( const QStringList & supportedFileTypes ) +GenericMediaDeviceConfigDialog::updateConfigDialogLists( const TQStringList & supportedFileTypes ) { - QStringList allTypes; + TQStringList allTypes; allTypes << "mp3" << "ogg" << "wma" << "mp4" << "aac" << "m4a" << "ac3"; allTypes << "wav" << "flac" << "asf" << "asx" << "mpg" << "mp4v" << "mpeg"; allTypes << "aa" << "3gp" << "mp2" << "ape" << "mpc"; - QStringList unsupported; - QComboBox *convert = m_convertComboBox; - QListBox *supported = m_supportedListBox; + TQStringList unsupported; + TQComboBox *convert = m_convertComboBox; + TQListBox *supported = m_supportedListBox; - for( QStringList::Iterator it = allTypes.begin(); it != allTypes.end(); it++ ) + for( TQStringList::Iterator it = allTypes.begin(); it != allTypes.end(); it++ ) { if( supportedFileTypes.contains( *it ) ) { @@ -148,7 +148,7 @@ GenericMediaDeviceConfigDialog::updateConfigDialogLists( const QStringList & sup m_addSupportedButton->popup()->clear(); - for( QStringList::Iterator it = unsupported.begin(); it != unsupported.end(); it++ ) + for( TQStringList::Iterator it = unsupported.begin(); it != unsupported.end(); it++ ) { m_addSupportedButton->popup()->insertItem( *it ); } @@ -157,12 +157,12 @@ GenericMediaDeviceConfigDialog::updateConfigDialogLists( const QStringList & sup } QString -GenericMediaDeviceConfigDialog::buildDestination( const QString &format, const MetaBundle &mb ) const +GenericMediaDeviceConfigDialog::buildDestination( const TQString &format, const MetaBundle &mb ) const { bool isCompilation = mb.compilation() > 0; - QMap args; - QString artist = mb.artist(); - QString albumartist = artist; + TQMap args; + TQString artist = mb.artist(); + TQString albumartist = artist; if( isCompilation ) albumartist = i18n( "Various Artists" ); args["theartist"] = cleanPath( artist ); @@ -184,30 +184,30 @@ GenericMediaDeviceConfigDialog::buildDestination( const QString &format, const M args["albumartist"] = albumartist; args["initial"] = albumartist.mid( 0, 1 ).upper(); args["filetype"] = mb.url().path().section( ".", -1 ).lower(); - QString track; + TQString track; if ( mb.track() ) track.sprintf( "%02d", mb.track() ); args["track"] = track; Amarok::QStringx formatx( format ); - QString result = m_device->mountPoint().append( formatx.namedOptArgs( args ) ); - QString tail = result.mid( m_device->mountPoint().length() ); + TQString result = m_device->mountPoint().append( formatx.namedOptArgs( args ) ); + TQString tail = result.mid( m_device->mountPoint().length() ); if( !tail.startsWith( "/" ) ) tail.prepend( "/" ); - return m_device->mountPoint() + tail.replace( QRegExp( "/\\.*" ), "/" ); + return m_device->mountPoint() + tail.replace( TQRegExp( "/\\.*" ), "/" ); } -QString GenericMediaDeviceConfigDialog::cleanPath( const QString &component ) const +TQString GenericMediaDeviceConfigDialog::cleanPath( const TQString &component ) const { - QString result = Amarok::cleanPath( component ); + TQString result = Amarok::cleanPath( component ); if( m_asciiCheck->isChecked() ) result = Amarok::asciiPath( result ); result.simplifyWhiteSpace(); if( m_spaceCheck->isChecked() ) - result.replace( QRegExp( "\\s" ), "_" ); + result.replace( TQRegExp( "\\s" ), "_" ); if( m_device->m_actuallyVfat || m_vfatCheck->isChecked() ) result = Amarok::vfatPath( result ); @@ -224,7 +224,7 @@ GenericMediaDeviceConfigDialog::updatePreviewLabel() } void -GenericMediaDeviceConfigDialog::updatePreviewLabel( const QString& format) +GenericMediaDeviceConfigDialog::updatePreviewLabel( const TQString& format) { m_previewLabel->setText( buildDestination( format , *m_previewBundle ) ); } @@ -248,7 +248,7 @@ GenericMediaDeviceConfigDialog::setDevice( GenericMediaDevice* device ) QString GenericMediaDeviceConfigDialog::buildFormatTip() const { - QMap args; + TQMap args; for( int i = 0; i < MetaBundle::NUM_COLUMNS; i++ ) { if( i == MetaBundle::Score || i == MetaBundle::PlayCount || i == MetaBundle::LastPlayed ) @@ -263,14 +263,14 @@ GenericMediaDeviceConfigDialog::buildFormatTip() const args["filetype"] = i18n( "File Extension of Source" ); args["track"] = i18n( "Track Number" ); - QString tooltip = i18n( "

Custom Format String

" ); + TQString tooltip = i18n( "

Custom Format String

" ); tooltip += i18n( "You can use the following tokens:" ); tooltip += "
    "; - for( QMap::iterator it = args.begin(); + for( TQMap::iterator it = args.begin(); it != args.end(); ++it ) { - tooltip += QString( "
  • %1 - %2" ).arg( it.data(), "%" + it.key() ); + tooltip += TQString( "
  • %1 - %2" ).arg( it.data(), "%" + it.key() ); } tooltip += "
"; @@ -304,14 +304,14 @@ GenericMediaDeviceConfigDialog::init() m_previewBundle->setUrl( "/some%20directory/some%20file.mp3" ); m_previewBundle->setYear( 2006 ); - m_formatHelp->setText( QString( "%2" ). + m_formatHelp->setText( TQString( "%2" ). arg( Amarok::escapeHTMLAttr( buildFormatTip() ), i18n( "(Help)" ) ) ); - m_unsupportedMenu = new QPopupMenu( m_addSupportedButton, "unsupported" ); + m_unsupportedMenu = new TQPopupMenu( m_addSupportedButton, "unsupported" ); m_addSupportedButton->setPopup( m_unsupportedMenu ); - connect( m_unsupportedMenu, SIGNAL( activated( int ) ), this, SLOT( addSupportedButtonClicked( int ) ) ); + connect( m_unsupportedMenu, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( addSupportedButtonClicked( int ) ) ); } diff --git a/amarok/src/mediadevice/ifp/ifpmediadevice.cpp b/amarok/src/mediadevice/ifp/ifpmediadevice.cpp index daa529a5..7f5f101b 100644 --- a/amarok/src/mediadevice/ifp/ifpmediadevice.cpp +++ b/amarok/src/mediadevice/ifp/ifpmediadevice.cpp @@ -41,13 +41,13 @@ AMAROK_EXPORT_PLUGIN( IfpMediaDevice ) #include //downloadSelectedItems() #include //downloadSelectedItems() -#include -#include -#include +#include +#include +#include namespace Amarok { - extern KConfig *config( const QString& ); - extern QString cleanPath( const QString&, bool ); + extern KConfig *config( const TQString& ); + extern TQString cleanPath( const TQString&, bool ); } /** @@ -57,29 +57,29 @@ namespace Amarok { class IfpMediaItem : public MediaItem { public: - IfpMediaItem( QListView *parent, QListViewItem *after = 0 ) + IfpMediaItem( TQListView *parent, TQListViewItem *after = 0 ) : MediaItem( parent, after ) {} - IfpMediaItem( QListViewItem *parent, QListViewItem *after = 0 ) + IfpMediaItem( TQListViewItem *parent, TQListViewItem *after = 0 ) : MediaItem( parent, after ) {} void - setEncodedName( QString &name ) + setEncodedName( TQString &name ) { - m_encodedName = QFile::encodeName( name ); + m_encodedName = TQFile::encodeName( name ); } void - setEncodedName( QCString &name ) { m_encodedName = name; } + setEncodedName( TQCString &name ) { m_encodedName = name; } QCString encodedName() { return m_encodedName; } // List directories first, always int - compare( QListViewItem *i, int col, bool ascending ) const + compare( TQListViewItem *i, int col, bool ascending ) const { #define i static_cast(i) switch( type() ) @@ -100,7 +100,7 @@ class IfpMediaItem : public MediaItem private: bool m_dir; - QCString m_encodedName; + TQCString m_encodedName; }; @@ -143,7 +143,7 @@ IfpMediaDevice::~IfpMediaDevice() } bool -IfpMediaDevice::checkResult( int result, QString message ) +IfpMediaDevice::checkResult( int result, TQString message ) { if( result == 0 ) return true; @@ -162,7 +162,7 @@ IfpMediaDevice::openDevice( bool /*silent*/ ) m_dh = (usb_dev_handle*)ifp_find_device(); - QString genericError = i18n( "Could not connect to iFP device" ); + TQString genericError = i18n( "Could not connect to iFP device" ); if( m_dh == NULL ) { @@ -209,7 +209,7 @@ IfpMediaDevice::openDevice( bool /*silent*/ ) char info[20]; ifp_model( &m_ifpdev, info, 20 ); - m_transferDir = QString(info); + m_transferDir = TQString(info); debug() << "Successfully connected to: " << info << endl; listDir( "" ); @@ -253,18 +253,18 @@ IfpMediaDevice::runTransferDialog() /// Renaming void -IfpMediaDevice::renameItem( QListViewItem *item ) // SLOT +IfpMediaDevice::renameItem( TQListViewItem *item ) // SLOT { if( !item ) return; #define item static_cast(item) - QCString src = QFile::encodeName( getFullPath( item, false ) ); + TQCString src = TQFile::encodeName( getFullPath( item, false ) ); src.append( item->encodedName() ); - //the rename line edit has already changed the QListViewItem text - QCString dest = QFile::encodeName( getFullPath( item ) ); + //the rename line edit has already changed the TQListViewItem text + TQCString dest = TQFile::encodeName( getFullPath( item ) ); debug() << "Renaming " << src << " to: " << dest << endl; @@ -278,13 +278,13 @@ IfpMediaDevice::renameItem( QListViewItem *item ) // SLOT /// Creating a directory MediaItem * -IfpMediaDevice::newDirectory( const QString &name, MediaItem *parent ) +IfpMediaDevice::newDirectory( const TQString &name, MediaItem *parent ) { if( !m_connected || name.isEmpty() ) return 0; - QString cleanedName = cleanPath( name ); + TQString cleanedName = cleanPath( name ); - const QCString dirPath = QFile::encodeName( getFullPath( parent ) + "\\" + cleanedName ); + const TQCString dirPath = TQFile::encodeName( getFullPath( parent ) + "\\" + cleanedName ); debug() << "Creating directory: " << dirPath << endl; int err = ifp_mkdir( &m_ifpdev, dirPath ); @@ -297,10 +297,10 @@ IfpMediaDevice::newDirectory( const QString &name, MediaItem *parent ) } MediaItem * -IfpMediaDevice::newDirectoryRecursive( const QString &name, MediaItem *parent ) +IfpMediaDevice::newDirectoryRecursive( const TQString &name, MediaItem *parent ) { - QStringList folders = QStringList::split( '\\', name ); - QString progress = ""; + TQStringList folders = TQStringList::split( '\\', name ); + TQString progress = ""; if( parent ) progress += getFullPath( parent ) + "\\"; @@ -311,7 +311,7 @@ IfpMediaDevice::newDirectoryRecursive( const QString &name, MediaItem *parent ) { debug() << "Checking folder: " << progress << endl; progress += *it; - const QCString dirPath = QFile::encodeName( progress ); + const TQCString dirPath = TQFile::encodeName( progress ); if( ifp_exists( &m_ifpdev, dirPath ) == IFP_DIR ) { @@ -335,9 +335,9 @@ IfpMediaDevice::newDirectoryRecursive( const QString &name, MediaItem *parent ) } MediaItem * -IfpMediaDevice::findChildItem( const QString &name, MediaItem *parent ) +IfpMediaDevice::findChildItem( const TQString &name, MediaItem *parent ) { - QListViewItem *child; + TQListViewItem *child; parent ? child = parent->firstChild(): @@ -353,15 +353,15 @@ IfpMediaDevice::findChildItem( const QString &name, MediaItem *parent ) } void -IfpMediaDevice::addToDirectory( MediaItem *directory, QPtrList items ) +IfpMediaDevice::addToDirectory( MediaItem *directory, TQPtrList items ) { if( !directory || items.isEmpty() ) return; m_tmpParent = directory; - for( QPtrListIterator it(items); *it; ++it ) + for( TQPtrListIterator it(items); *it; ++it ) { - QCString src = QFile::encodeName( getFullPath( *it ) ); - QCString dest = QFile::encodeName( getFullPath( directory ) + "\\" + (*it)->text(0) ); + TQCString src = TQFile::encodeName( getFullPath( *it ) ); + TQCString dest = TQFile::encodeName( getFullPath( directory ) + "\\" + (*it)->text(0) ); debug() << "Moving: " << src << " to: " << dest << endl; int err = ifp_rename( &m_ifpdev, src, dest ); @@ -381,9 +381,9 @@ IfpMediaDevice::copyTrackToDevice( const MetaBundle& bundle ) if( !m_connected ) return 0; m_transferring = true; - const QCString src = QFile::encodeName( bundle.url().path() ); + const TQCString src = TQFile::encodeName( bundle.url().path() ); - QString directory = "\\"; //root + TQString directory = "\\"; //root bool cleverFilename = false; bool addFileToView = true; if( m_firstSort != i18n("None") ) @@ -404,20 +404,20 @@ IfpMediaDevice::copyTrackToDevice( const MetaBundle& bundle ) m_tmpParent = newDirectoryRecursive( directory, 0 ); // recursively create folders as required. - QString newFilename; + TQString newFilename; // we don't put this in cleanPath because of remote directory delimiters - const QString title = bundle.title().replace( '\\', '-' ); + const TQString title = bundle.title().replace( '\\', '-' ); if( cleverFilename && !title.isEmpty() ) { if( bundle.track() > 0 ) - newFilename = cleanPath( QString::number(bundle.track()) + " - " + title ) + '.' + bundle.type(); + newFilename = cleanPath( TQString::number(bundle.track()) + " - " + title ) + '.' + bundle.type(); else newFilename = cleanPath( title ) + '.' + bundle.type(); } else newFilename = cleanPath( bundle.prettyTitle() ) + '.' + bundle.type(); - const QCString dest = QFile::encodeName( cleanPath(directory + newFilename) ); + const TQCString dest = TQFile::encodeName( cleanPath(directory + newFilename) ); kapp->processEvents( 100 ); int result = uploadTrack( src, dest ); @@ -433,7 +433,7 @@ IfpMediaDevice::copyTrackToDevice( const MetaBundle& bundle ) /// File transfer methods int -IfpMediaDevice::uploadTrack( const QCString& src, const QCString& dest ) +IfpMediaDevice::uploadTrack( const TQCString& src, const TQCString& dest ) { debug() << "Transferring " << src << " to: " << dest << endl; @@ -441,7 +441,7 @@ IfpMediaDevice::uploadTrack( const QCString& src, const QCString& dest ) } int -IfpMediaDevice::downloadTrack( const QCString& src, const QCString& dest ) +IfpMediaDevice::downloadTrack( const TQCString& src, const TQCString& dest ) { debug() << "Downloading " << src << " to: " << dest << endl; @@ -452,8 +452,8 @@ void IfpMediaDevice::downloadSelectedItems() { // KConfig *config = Amarok::config( "MediaDevice" ); -// QString save = config->readEntry( "DownloadLocation", QString::null ); //restore the save directory - QString save = QString::null; +// TQString save = config->readEntry( "DownloadLocation", TQString::null ); //restore the save directory + TQString save = TQString::null; KURLRequesterDlg dialog( save, 0, 0 ); dialog.setCaption( kapp->makeStdCaption( i18n( "Choose a Download Directory" ) ) ); @@ -469,11 +469,11 @@ IfpMediaDevice::downloadSelectedItems() // if( save != destDir.path() ) // config->writeEntry( "DownloadLocation", destDir.path() ); - QListViewItemIterator it( m_view, QListViewItemIterator::Selected ); + TQListViewItemIterator it( m_view, TQListViewItemIterator::Selected ); for( ; it.current(); ++it ) { - QCString dest = QFile::encodeName( destDir.path() + (*it)->text(0) ); - QCString src = QFile::encodeName( getFullPath( *it ) ); + TQCString dest = TQFile::encodeName( destDir.path() + (*it)->text(0) ); + TQCString src = TQFile::encodeName( getFullPath( *it ) ); downloadTrack( src, dest ); } @@ -515,9 +515,9 @@ IfpMediaDevice::deleteItemFromDevice( MediaItem *item, int /*flags*/ ) { if( !item || !m_connected ) return -1; - QString path = getFullPath( item ); + TQString path = getFullPath( item ); - QCString encodedPath = QFile::encodeName( path ); + TQCString encodedPath = TQFile::encodeName( path ); int err; int count = 0; @@ -545,7 +545,7 @@ IfpMediaDevice::deleteItemFromDevice( MediaItem *item, int /*flags*/ ) /// Directory Reading void -IfpMediaDevice::expandItem( QListViewItem *item ) // SLOT +IfpMediaDevice::expandItem( TQListViewItem *item ) // SLOT { if( !item || !item->isExpandable() || m_transferring ) return; @@ -554,16 +554,16 @@ IfpMediaDevice::expandItem( QListViewItem *item ) // SLOT m_tmpParent = item; - QString path = getFullPath( item ); + TQString path = getFullPath( item ); listDir( path ); m_tmpParent = 0; } void -IfpMediaDevice::listDir( const QString &dir ) +IfpMediaDevice::listDir( const TQString &dir ) { - int err = ifp_list_dirs( &m_ifpdev, QFile::encodeName( dir ), listDirCallback, this ); + int err = ifp_list_dirs( &m_ifpdev, TQFile::encodeName( dir ), listDirCallback, this ); checkResult( err, i18n("Cannot enter directory: '%1'").arg(dir) ); } @@ -571,12 +571,12 @@ IfpMediaDevice::listDir( const QString &dir ) int IfpMediaDevice::listDirCallback( void *pData, int type, const char *name, int size ) { - QString qName = QFile::decodeName( name ); + TQString qName = TQFile::decodeName( name ); return static_cast(pData)->addTrackToList( type, qName, size ); } int -IfpMediaDevice::addTrackToList( int type, QString name, int /*size*/ ) +IfpMediaDevice::addTrackToList( int type, TQString name, int /*size*/ ) { m_tmpParent ? m_last = new IfpMediaItem( m_tmpParent ): @@ -620,15 +620,15 @@ IfpMediaDevice::getCapacity( KIO::filesize_t *total, KIO::filesize_t *available /// Helper functions QString -IfpMediaDevice::getFullPath( const QListViewItem *item, const bool getFilename ) +IfpMediaDevice::getFullPath( const TQListViewItem *item, const bool getFilename ) { - if( !item ) return QString(); + if( !item ) return TQString(); - QString path; + TQString path; if( getFilename ) path = item->text(0); - QListViewItem *parent = item->parent(); + TQListViewItem *parent = item->parent(); while( parent ) { path.prepend( "\\" ); @@ -642,7 +642,7 @@ IfpMediaDevice::getFullPath( const QListViewItem *item, const bool getFilename ) void -IfpMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) +IfpMediaDevice::rmbPressed( TQListViewItem* qitem, const TQPoint& point, int ) { enum Actions { DOWNLOAD, DIRECTORY, RENAME, DELETE }; @@ -695,16 +695,16 @@ IfpMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) } } -QString IfpMediaDevice::cleanPath( const QString &component ) +TQString IfpMediaDevice::cleanPath( const TQString &component ) { - QString result = Amarok::asciiPath( component ); + TQString result = Amarok::asciiPath( component ); result.simplifyWhiteSpace(); result.remove( "?" ).replace( "*", " " ).replace( ":", " " ); // if( m_spacesToUnderscores ) -// result.replace( QRegExp( "\\s" ), "_" ); +// result.replace( TQRegExp( "\\s" ), "_" ); result.replace( "/", "-" ); diff --git a/amarok/src/mediadevice/ifp/ifpmediadevice.h b/amarok/src/mediadevice/ifp/ifpmediadevice.h index d2721dd6..ff2330a6 100644 --- a/amarok/src/mediadevice/ifp/ifpmediadevice.h +++ b/amarok/src/mediadevice/ifp/ifpmediadevice.h @@ -26,7 +26,7 @@ extern "C" { #include -#include +#include class IfpMediaItem; class TransferDialog; @@ -41,7 +41,7 @@ class IfpMediaDevice : public MediaDevice virtual ~IfpMediaDevice(); bool isConnected() { return m_connected; } - void rmbPressed( QListViewItem* qitem, const QPoint& point, int ); + void rmbPressed( TQListViewItem* qitem, const TQPoint& point, int ); bool hasTransferDialog() { return true; } void runTransferDialog(); TransferDialog *getTransferDialog() { return m_td; } @@ -57,12 +57,12 @@ class IfpMediaDevice : public MediaDevice MediaItem *copyTrackToDevice( const MetaBundle& bundle); int deleteItemFromDevice( MediaItem *item, int flags=DeleteTrack ); bool getCapacity( KIO::filesize_t *total, KIO::filesize_t *available ); - MediaItem *newDirectory( const QString &name, MediaItem *parent ); - void addToDirectory( MediaItem *directory, QPtrList items ); + MediaItem *newDirectory( const TQString &name, MediaItem *parent ); + void addToDirectory( MediaItem *directory, TQPtrList items ); protected slots: - void renameItem( QListViewItem *item ); - void expandItem( QListViewItem *item ); + void renameItem( TQListViewItem *item ); + void expandItem( TQListViewItem *item ); private: enum Error { ERR_ACCESS_DENIED, ERR_CANNOT_RENAME, ERR_DISK_FULL, ERR_COULD_NOT_WRITE }; @@ -70,28 +70,28 @@ class IfpMediaDevice : public MediaDevice // Too expensive to implement on a non-database device MediaItem *trackExists( const MetaBundle& ) { return 0; } - bool checkResult( int result, QString message ); + bool checkResult( int result, TQString message ); // file transfer - MediaItem *newDirectoryRecursive( const QString &name, MediaItem *parent ); - int uploadTrack( const QCString& src, const QCString& dest ); + MediaItem *newDirectoryRecursive( const TQString &name, MediaItem *parent ); + int uploadTrack( const TQCString& src, const TQCString& dest ); void downloadSelectedItems(); - int downloadTrack( const QCString& src, const QCString& dest ); + int downloadTrack( const TQCString& src, const TQCString& dest ); // listDir - void listDir( const QString &dir ); + void listDir( const TQString &dir ); static int listDirCallback( void *pData, int type, const char *name, int size ); - int addTrackToList( int type, QString name, int size=0 ); + int addTrackToList( int type, TQString name, int size=0 ); // miscellaneous methods static int filetransferCallback( void *pData, struct ifp_transfer_status *progress ); int setProgressInfo( struct ifp_transfer_status *progress ); // Will iterate over parents and add directory name to the item. // getFilename = false will return only parent structure, as opposed to returning the filename as well - QString getFullPath( const QListViewItem *item, const bool getFilename = true ); - QString cleanPath( const QString &component ); + TQString getFullPath( const TQListViewItem *item, const bool getFilename = true ); + TQString cleanPath( const TQString &component ); - MediaItem *findChildItem( const QString &name, MediaItem *parent ); + MediaItem *findChildItem( const TQString &name, MediaItem *parent ); // IFP device struct usb_device *m_dev; @@ -102,7 +102,7 @@ class IfpMediaDevice : public MediaDevice IfpMediaItem *m_last; //used to specify new IfpMediaItem parent. Make sure it is restored to 0 (m_listview) - QListViewItem *m_tmpParent; + TQListViewItem *m_tmpParent; TransferDialog *m_td; }; diff --git a/amarok/src/mediadevice/ipod/ipodmediadevice.cpp b/amarok/src/mediadevice/ipod/ipodmediadevice.cpp index 0d09a1f7..ab54cf88 100644 --- a/amarok/src/mediadevice/ipod/ipodmediadevice.cpp +++ b/amarok/src/mediadevice/ipod/ipodmediadevice.cpp @@ -51,14 +51,14 @@ AMAROK_EXPORT_PLUGIN( IpodMediaDevice ) #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef HAVE_STATVFS #include @@ -78,21 +78,21 @@ AMAROK_EXPORT_PLUGIN( IpodMediaDevice ) struct PodcastInfo { // per show - QString url; - QString description; - QDateTime date; - QString author; + TQString url; + TQString description; + TQDateTime date; + TQString author; bool listened; // per channel - QString rss; + TQString rss; PodcastInfo() { listened = false; } }; -class TrackList : public QPtrList +class TrackList : public TQPtrList { - int compareItems ( QPtrCollection::Item track1, QPtrCollection::Item track2 ) + int compareItems ( TQPtrCollection::Item track1, TQPtrCollection::Item track2 ) { Itdb_Track *t1 = (Itdb_Track *)track1; Itdb_Track *t2 = (Itdb_Track *)track2; @@ -107,16 +107,16 @@ class TrackList : public QPtrList class IpodMediaItem : public MediaItem { public: - IpodMediaItem( QListView *parent, MediaDevice *dev ) + IpodMediaItem( TQListView *parent, MediaDevice *dev ) : MediaItem( parent ) { init( dev ); } - IpodMediaItem( QListViewItem *parent, MediaDevice *dev ) + IpodMediaItem( TQListViewItem *parent, MediaDevice *dev ) : MediaItem( parent ) { init( dev ); } - IpodMediaItem( QListView *parent, QListViewItem *after, MediaDevice *dev ) + IpodMediaItem( TQListView *parent, TQListViewItem *after, MediaDevice *dev ) : MediaItem( parent, after ) { init( dev ); } - IpodMediaItem( QListViewItem *parent, QListViewItem *after, MediaDevice *dev ) + IpodMediaItem( TQListViewItem *parent, TQListViewItem *after, MediaDevice *dev ) : MediaItem( parent, after ) { init( dev ); } virtual ~IpodMediaItem() { delete m_podcastInfo; } @@ -129,16 +129,16 @@ class IpodMediaItem : public MediaItem m_podcastInfo = 0; } - void bundleFromTrack( Itdb_Track *track, const QString& path ) + void bundleFromTrack( Itdb_Track *track, const TQString& path ) { MetaBundle *bundle = new MetaBundle(); - bundle->setArtist ( QString::fromUtf8( track->artist ) ); - bundle->setComposer ( QString::fromUtf8( track->composer ) ); - bundle->setAlbum ( QString::fromUtf8( track->album ) ); - bundle->setTitle ( QString::fromUtf8( track->title ) ); - bundle->setComment ( QString::fromUtf8( track->comment ) ); - bundle->setGenre ( QString::fromUtf8( track->genre ) ); + bundle->setArtist ( TQString::fromUtf8( track->artist ) ); + bundle->setComposer ( TQString::fromUtf8( track->composer ) ); + bundle->setAlbum ( TQString::fromUtf8( track->album ) ); + bundle->setTitle ( TQString::fromUtf8( track->title ) ); + bundle->setComment ( TQString::fromUtf8( track->comment ) ); + bundle->setGenre ( TQString::fromUtf8( track->genre ) ); bundle->setYear ( track->year ); bundle->setTrack ( track->track_nr ); bundle->setDiscNumber( track->cd_nr ); @@ -149,18 +149,18 @@ class IpodMediaItem : public MediaItem bundle->setPath ( path ); bundle->setFilesize ( track->size ); - QString rss( track->podcastrss ); - QString url( track->podcasturl ); - QString desc( track->description ); - QString subtitle( track->subtitle ); - QDateTime date; + TQString rss( track->podcastrss ); + TQString url( track->podcasturl ); + TQString desc( track->description ); + TQString subtitle( track->subtitle ); + TQDateTime date; date.setTime_t( itdb_time_mac_to_host( track->time_released) ); if( !rss.isEmpty() || !url.isEmpty() ) { PodcastEpisodeBundle peb( KURL::fromPathOrURL(url), KURL::fromPathOrURL(rss), - track->title, track->artist, desc, date.toString(Qt::ISODate), QString::null /*type*/, - bundle->length(), QString::null /*guid*/, track->playcount<=0 ); + track->title, track->artist, desc, date.toString(Qt::ISODate), TQString::null /*type*/, + bundle->length(), TQString::null /*guid*/, track->playcount<=0 ); bundle->setPodcastBundle( peb ); } @@ -212,9 +212,9 @@ class IpodMediaItem : public MediaItem } } - QDateTime playTime() const + TQDateTime playTime() const { - QDateTime t; + TQDateTime t; if( m_track ) t.setTime_t( itdb_time_mac_to_host( m_track->time_played ) ); return t; @@ -283,7 +283,7 @@ IpodMediaDevice::IpodMediaDevice() m_customAction->setEnabled( false ); am->setDelayed( false ); KPopupMenu *menu = am->popupMenu(); - connect( menu, SIGNAL(activated(int)), SLOT(slotIpodAction(int)) ); + connect( menu, TQT_SIGNAL(activated(int)), TQT_SLOT(slotIpodAction(int)) ); menu->insertItem( i18n( "Stale and Orphaned" ), CHECK_INTEGRITY ); menu->insertItem( i18n( "Update Artwork" ), UPDATE_ARTWORK ); @@ -309,14 +309,14 @@ IpodMediaDevice::IpodMediaDevice() { infoFound = true; gen = new KPopupMenu( ipodGen ); - connect( gen, SIGNAL(activated(int)), SLOT(slotIpodAction(int)) ); + connect( gen, TQT_SIGNAL(activated(int)), TQT_SLOT(slotIpodAction(int)) ); ipodGen->insertItem( itdb_info_get_ipod_generation_string( info->ipod_generation), gen ); } if( info->capacity > 0.f ) gen->insertItem( i18n( "%1 GB %2 (x%3)" ) - .arg( QString::number( info->capacity ), + .arg( TQString::number( info->capacity ), itdb_info_get_ipod_model_name_string( info->ipod_model ), info->model_number ), index ); @@ -364,8 +364,8 @@ IpodMediaDevice::slotIpodAction( int id ) } // try to make sure that the Device directory exists - QDir dir; - QString realPath; + TQDir dir; + TQString realPath; if(!pathExists( itunesDir(), &realPath) ) { dir.setPath(realPath); @@ -390,7 +390,7 @@ IpodMediaDevice::slotIpodAction( int id ) //FIXME: update i18n files for next message Amarok::StatusBar::instance()->shortMessage( i18n( "Unable to set iPod model to %1 GB %2 (x%3)" ) - .arg( QString::number( table[index].capacity ), + .arg( TQString::number( table[index].capacity ), itdb_info_get_ipod_model_name_string( table[index].ipod_model ), table[index].model_number ) ); } @@ -398,7 +398,7 @@ IpodMediaDevice::slotIpodAction( int id ) { Amarok::StatusBar::instance()->shortMessage( i18n( "Setting iPod model to %1 GB %2 (x%3)" ) - .arg( QString::number( table[index].capacity ), + .arg( TQString::number( table[index].capacity ), itdb_info_get_ipod_model_name_string( table[index].ipod_model ), table[index].model_number ) ); } @@ -430,7 +430,7 @@ IpodMediaDevice::isConnected() } MediaItem * -IpodMediaDevice::insertTrackIntoDB( const QString &pathname, +IpodMediaDevice::insertTrackIntoDB( const TQString &pathname, const MetaBundle &metaBundle, const MetaBundle &propertiesBundle, const PodcastInfo *podcastInfo ) { @@ -438,7 +438,7 @@ IpodMediaDevice::insertTrackIntoDB( const QString &pathname, } MediaItem * -IpodMediaDevice::updateTrackInDB( IpodMediaItem *item, const QString &pathname, +IpodMediaDevice::updateTrackInDB( IpodMediaItem *item, const TQString &pathname, const MetaBundle &metaBundle, const MetaBundle &propertiesBundle, const PodcastInfo *podcastInfo ) { @@ -456,7 +456,7 @@ IpodMediaDevice::updateTrackInDB( IpodMediaItem *item, const QString &pathname, return 0; } - QString type = pathname.section('.', -1).lower(); + TQString type = pathname.section('.', -1).lower(); track->ipod_path = g_strdup( ipodPath(pathname).latin1() ); debug() << "on iPod: " << track->ipod_path << ", podcast=" << podcastInfo << endl; @@ -499,7 +499,7 @@ IpodMediaDevice::updateTrackInDB( IpodMediaItem *item, const QString &pathname, audiobook = true; track->filetype = g_strdup( "audible" ); - TagLib::Audible::File f( QFile::encodeName( propertiesBundle.url().path() ) ); + TagLib::Audible::File f( TQFile::encodeName( propertiesBundle.url().path() ) ); TagLib::Audible::Tag *t = f.getAudibleTag(); if( t ) track->drm_userid = t->userID(); @@ -514,7 +514,7 @@ IpodMediaDevice::updateTrackInDB( IpodMediaItem *item, const QString &pathname, } - QString genre = metaBundle.genre(); + TQString genre = metaBundle.genre(); if( genre.startsWith("audiobook", false) ) audiobook = true; if( audiobook ) @@ -543,7 +543,7 @@ IpodMediaDevice::updateTrackInDB( IpodMediaItem *item, const QString &pathname, QueryBuilder qb; qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valCreateDate ); qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valURL, metaBundle.url().path() ); - QStringList values = qb.run(); + TQStringList values = qb.run(); //Add to track info if present if ( values.count() ) { @@ -564,8 +564,8 @@ IpodMediaDevice::updateTrackInDB( IpodMediaItem *item, const QString &pathname, : ITDB_MEDIATYPE_PODCAST; track->flag4 = 0x01; // also show description on iPod - QString plaindesc = podcastInfo->description; - plaindesc.replace( QRegExp("<[^>]*>"), "" ); + TQString plaindesc = podcastInfo->description; + plaindesc.replace( TQRegExp("<[^>]*>"), "" ); track->description = g_strdup( plaindesc.utf8() ); track->subtitle = g_strdup( plaindesc.utf8() ); track->podcasturl = g_strdup( podcastInfo->url.utf8() ); @@ -590,7 +590,7 @@ IpodMediaDevice::updateTrackInDB( IpodMediaItem *item, const QString &pathname, if( m_supportsArtwork ) { - QString image; + TQString image; if( metaBundle.podcastBundle() ) { PodcastChannelBundle pcb; @@ -602,7 +602,7 @@ IpodMediaDevice::updateTrackInDB( IpodMediaItem *item, const QString &pathname, if( !image.endsWith( "@nocover.png" ) ) { debug() << "adding image " << image << " to " << metaBundle.artist() << ":" << metaBundle.album() << endl; - itdb_track_set_thumbnails( track, g_strdup( QFile::encodeName(image) ) ); + itdb_track_set_thumbnails( track, g_strdup( TQFile::encodeName(image) ) ); } } @@ -661,13 +661,13 @@ IpodMediaDevice::copyTrackToDevice(const MetaBundle &bundle) KURL url = determineURLOnDevice(bundle); // check if path exists and make it if needed - QFileInfo finfo( url.path() ); - QDir dir = finfo.dir(); + TQFileInfo finfo( url.path() ); + TQDir dir = finfo.dir(); while ( !dir.exists() ) { - QString path = dir.absPath(); - QDir parentdir; - QDir create; + TQString path = dir.absPath(); + TQDir parentdir; + TQDir create; do { create.setPath(path); @@ -747,7 +747,7 @@ IpodMediaDevice::trackExists( const MetaBundle& bundle ) } MediaItem * -IpodMediaDevice::newPlaylist(const QString &name, MediaItem *parent, QPtrList items) +IpodMediaDevice::newPlaylist(const TQString &name, MediaItem *parent, TQPtrList items) { m_dbChanged = true; IpodMediaItem *item = new IpodMediaItem(parent, this); @@ -761,7 +761,7 @@ IpodMediaDevice::newPlaylist(const QString &name, MediaItem *parent, QPtrList items) +IpodMediaDevice::addToPlaylist(MediaItem *mlist, MediaItem *after, TQPtrList items) { IpodMediaItem *list = dynamic_cast(mlist); if(!list) @@ -830,7 +830,7 @@ IpodMediaDevice::addToPlaylist(MediaItem *mlist, MediaItem *after, QPtrListsetType(MediaItem::PLAYLISTITEM); add->m_track = it->m_track; add->bundleFromTrack( add->m_track, realPath(add->m_track->ipod_path) ); - add->setText(0, QString::fromUtf8(it->m_track->artist) + " - " + QString::fromUtf8(it->m_track->title) ); + add->setText(0, TQString::fromUtf8(it->m_track->artist) + " - " + TQString::fromUtf8(it->m_track->title) ); add->m_order = order; order++; } @@ -983,11 +983,11 @@ IpodMediaDevice::deleteItemFromDevice(MediaItem *mediaitem, int flags ) bool IpodMediaDevice::createLockFile( bool silent ) { - QString lockFilePath; + TQString lockFilePath; pathExists( itunesDir( "iTunes:iTunesLock" ), &lockFilePath ); - m_lockFile = new QFile( lockFilePath ); - QString msg; + m_lockFile = new TQFile( lockFilePath ); + TQString msg; bool ok = true; if( m_lockFile->exists() ) { @@ -999,7 +999,7 @@ IpodMediaDevice::createLockFile( bool silent ) if( !silent ) { if( KMessageBox::warningContinueCancel( m_parent, msg, i18n( "Remove iTunes Lock File?" ), - KGuiItem(i18n("&Remove"), "editdelete"), QString::null, KMessageBox::Dangerous ) + KGuiItem(i18n("&Remove"), "editdelete"), TQString::null, KMessageBox::Dangerous ) == KMessageBox::Continue ) { msg = i18n( "Media Device: removing lockfile %1 failed: %2. " ) @@ -1034,7 +1034,7 @@ IpodMediaDevice::createLockFile( bool silent ) bool IpodMediaDevice::initializeIpod() { - QDir dir( mountPoint() ); + TQDir dir( mountPoint() ); if( !dir.exists() ) { Amarok::StatusBar::instance()->longMessage( @@ -1053,7 +1053,7 @@ IpodMediaDevice::initializeIpod() // in order to get directories right detectModel(); - itdb_set_mountpoint(m_itdb, QFile::encodeName(mountPoint())); + itdb_set_mountpoint(m_itdb, TQFile::encodeName(mountPoint())); Itdb_Playlist *mpl = itdb_playlist_new("iPod", false); itdb_playlist_set_mpl(mpl); @@ -1062,7 +1062,7 @@ IpodMediaDevice::initializeIpod() itdb_playlist_add(m_itdb, podcasts, -1); itdb_playlist_add(m_itdb, mpl, 0); - QString realPath; + TQString realPath; if(!pathExists( itunesDir(), &realPath) ) { dir.setPath(realPath); @@ -1127,8 +1127,8 @@ IpodMediaDevice::openDevice( bool silent ) ++mountiter ) { canInitialize = false; - QString devicenode = (*mountiter)->mountedFrom(); - QString mountpoint = (*mountiter)->mountPoint(); + TQString devicenode = (*mountiter)->mountedFrom(); + TQString mountpoint = (*mountiter)->mountPoint(); if( mountpoint.startsWith( "/proc" ) || mountpoint.startsWith( "/sys" ) || @@ -1151,7 +1151,7 @@ IpodMediaDevice::openDevice( bool silent ) } GError *err = 0; - m_itdb = itdb_parse(QFile::encodeName(mountpoint), &err); + m_itdb = itdb_parse(TQFile::encodeName(mountpoint), &err); if( err ) { g_error_free(err); @@ -1184,7 +1184,7 @@ IpodMediaDevice::openDevice( bool silent ) if( !m_itdb && canInitialize ) { - QString msg = i18n( "Media Device: could not find iTunesDB on device mounted at %1. " + TQString msg = i18n( "Media Device: could not find iTunesDB on device mounted at %1. " "Should I try to initialize your iPod?" ).arg( mountPoint() ); if( !silent @@ -1224,12 +1224,12 @@ IpodMediaDevice::openDevice( bool silent ) for( int i=0; i < itdb_musicdirs_number(m_itdb); i++) { - QString real; - QString ipod; + TQString real; + TQString ipod; ipod.sprintf( itunesDir( "Music:f%02d" ).latin1(), i ); if(!pathExists( ipod, &real ) ) { - QDir dir( real ); + TQDir dir( real ); dir.mkdir( real ); dir.setPath( real ); if( !dir.exists() ) @@ -1364,7 +1364,7 @@ IpodMediaDevice::detectModel() #endif } if( modelString ) - m_name = QString( "iPod %1" ).arg( QString::fromUtf8( modelString ) ); + m_name = TQString( "iPod %1" ).arg( TQString::fromUtf8( modelString ) ); if( m_needsFirewireGuid ) { @@ -1452,11 +1452,11 @@ IpodMediaDevice::updateArtwork() if( !m_supportsArtwork ) return; - QPtrList items; + TQPtrList items; m_view->getSelectedLeaves( 0, &items, false ); int updateCount = 0; - for( QPtrList::iterator it = items.begin(); + for( TQPtrList::iterator it = items.begin(); it != items.end(); it++ ) { @@ -1465,7 +1465,7 @@ IpodMediaDevice::updateArtwork() continue; const MetaBundle *bundle = i->bundle(); - QString image; + TQString image; if( i->m_podcastInfo && !i->m_podcastInfo->rss.isEmpty() ) { PodcastChannelBundle pcb; @@ -1478,7 +1478,7 @@ IpodMediaDevice::updateArtwork() { debug() << "adding image " << image << " to " << bundle->artist() << ":" << bundle->album() << endl; - itdb_track_set_thumbnails( i->m_track, g_strdup( QFile::encodeName(image) ) ); + itdb_track_set_thumbnails( i->m_track, g_strdup( TQFile::encodeName(image) ) ); ++updateCount; } } @@ -1516,22 +1516,22 @@ IpodMediaDevice::checkIntegrity() addPlaylistToView( playlist ); } - QString musicpath; + TQString musicpath; if (!pathExists( itunesDir( "Music" ), &musicpath )) return false; - QDir dir( musicpath, QString::null, QDir::Unsorted, QDir::Dirs ); + TQDir dir( musicpath, TQString::null, TQDir::Unsorted, TQDir::Dirs ); for(unsigned i=0; isetBundle( bundle ); - QString title = bundle->artist() + " - " + bundle->title(); + TQString title = bundle->artist() + " - " + bundle->title(); item->setText(0, title); } } @@ -1589,7 +1589,7 @@ IpodMediaDevice::closeDevice() //SLOT } void -IpodMediaDevice::renameItem( QListViewItem *i ) // SLOT +IpodMediaDevice::renameItem( TQListViewItem *i ) // SLOT { IpodMediaItem *item = dynamic_cast(i); if(!item) @@ -1641,14 +1641,14 @@ IpodMediaDevice::addTrackToView(Itdb_Track *track, IpodMediaItem *item, bool che else item = new IpodMediaItem(m_staleItem, this); item->setType(MediaItem::STALE); - QString title = QString::fromUtf8(track->artist) + " - " - + QString::fromUtf8(track->title); + TQString title = TQString::fromUtf8(track->artist) + " - " + + TQString::fromUtf8(track->title); item->setText( 0, title ); item->m_track = track; } else { - m_files.insert( QString(track->ipod_path).lower(), track ); + m_files.insert( TQString(track->ipod_path).lower(), track ); } } @@ -1657,11 +1657,11 @@ IpodMediaDevice::addTrackToView(Itdb_Track *track, IpodMediaItem *item, bool che { visible = true; - QString artistName; + TQString artistName; if( track->compilation ) artistName = i18n( "Various Artists" ); else - artistName = QString::fromUtf8(track->artist); + artistName = TQString::fromUtf8(track->artist); IpodMediaItem *artist = getArtist(artistName); if(!artist) @@ -1673,7 +1673,7 @@ IpodMediaDevice::addTrackToView(Itdb_Track *track, IpodMediaItem *item, bool che artist->m_order = -1; } - QString albumName(QString::fromUtf8(track->album)); + TQString albumName(TQString::fromUtf8(track->album)); MediaItem *album = artist->findItem(albumName); if(!album) { @@ -1688,9 +1688,9 @@ IpodMediaDevice::addTrackToView(Itdb_Track *track, IpodMediaItem *item, bool che { item = new IpodMediaItem( album, this ); } - QString titleName = QString::fromUtf8(track->title); + TQString titleName = TQString::fromUtf8(track->title); if( track->compilation ) - item->setText( 0, QString::fromUtf8(track->artist) + i18n( " - " ) + titleName ); + item->setText( 0, TQString::fromUtf8(track->artist) + i18n( " - " ) + titleName ); else item->setText( 0, titleName ); item->setType( MediaItem::TRACK ); @@ -1703,7 +1703,7 @@ IpodMediaDevice::addTrackToView(Itdb_Track *track, IpodMediaItem *item, bool che { visible = true; - QString channelName(QString::fromUtf8(track->album)); + TQString channelName(TQString::fromUtf8(track->album)); IpodMediaItem *channel = dynamic_cast(m_podcastItem->findItem(channelName)); if(!channel) { @@ -1717,16 +1717,16 @@ IpodMediaDevice::addTrackToView(Itdb_Track *track, IpodMediaItem *item, bool che channel->insertItem( item ); else item = new IpodMediaItem( channel, this ); - item->setText( 0, QString::fromUtf8(track->title) ); + item->setText( 0, TQString::fromUtf8(track->title) ); item->setType( MediaItem::PODCASTITEM ); item->m_track = track; item->bundleFromTrack( track, realPath(track->ipod_path) ); PodcastInfo *info = new PodcastInfo; item->m_podcastInfo = info; - info->url = QString::fromUtf8( track->podcasturl ); - info->rss = QString::fromUtf8( track->podcastrss ); - info->description = QString::fromUtf8( track->description ); + info->url = TQString::fromUtf8( track->podcasturl ); + info->rss = TQString::fromUtf8( track->podcastrss ); + info->description = TQString::fromUtf8( track->description ); info->date.setTime_t( itdb_time_mac_to_host( track->time_released) ); if( !info->rss.isEmpty() && channel->m_podcastInfo->rss.isEmpty() ) @@ -1742,8 +1742,8 @@ IpodMediaDevice::addTrackToView(Itdb_Track *track, IpodMediaItem *item, bool che m_invisibleItem->insertItem( item ); else item = new IpodMediaItem(m_invisibleItem, this); - QString title = QString::fromUtf8(track->artist) + " - " - + QString::fromUtf8(track->title); + TQString title = TQString::fromUtf8(track->artist) + " - " + + TQString::fromUtf8(track->title); item->setText( 0, title ); item->setType( MediaItem::INVISIBLE ); item->m_track = track; @@ -1776,7 +1776,7 @@ IpodMediaDevice::addPlaylistToView( Itdb_Playlist *pl ) debug() << "playlist " << pl->name << " is a smart playlist" << endl; } - QString name( QString::fromUtf8(pl->name) ); + TQString name( TQString::fromUtf8(pl->name) ); IpodMediaItem *playlist = dynamic_cast(m_playlistItem->findItem(name)); if( !playlist ) { @@ -1792,8 +1792,8 @@ IpodMediaDevice::addPlaylistToView( Itdb_Playlist *pl ) { Itdb_Track *track = (Itdb_Track *)cur->data; IpodMediaItem *item = new IpodMediaItem(playlist, this); - QString title = QString::fromUtf8(track->artist) + " - " - + QString::fromUtf8(track->title); + TQString title = TQString::fromUtf8(track->artist) + " - " + + TQString::fromUtf8(track->title); item->setText( 0, title ); item->setType( MediaItem::PLAYLISTITEM ); item->m_playlist = pl; @@ -1807,9 +1807,9 @@ IpodMediaDevice::addPlaylistToView( Itdb_Playlist *pl ) } QString -IpodMediaDevice::itunesDir(const QString &p) const +IpodMediaDevice::itunesDir(const TQString &p) const { - QString base( ":iPod_Control" ); + TQString base( ":iPod_Control" ); if( m_isMobile ) base = ":iTunes:iTunes_Control"; else if( m_isIPhone ) @@ -1823,38 +1823,38 @@ IpodMediaDevice::itunesDir(const QString &p) const QString IpodMediaDevice::realPath(const char *ipodPath) { - QString path; + TQString path; if(m_itdb) { - path = QFile::decodeName(itdb_get_mountpoint(m_itdb)); - path.append(QString(ipodPath).replace(':', "/")); + path = TQFile::decodeName(itdb_get_mountpoint(m_itdb)); + path.append(TQString(ipodPath).replace(':', "/")); } return path; } QString -IpodMediaDevice::ipodPath(const QString &realPath) +IpodMediaDevice::ipodPath(const TQString &realPath) { if(m_itdb) { - QString mp = QFile::decodeName(itdb_get_mountpoint(m_itdb)); + TQString mp = TQFile::decodeName(itdb_get_mountpoint(m_itdb)); if(realPath.startsWith(mp)) { - QString path = realPath; + TQString path = realPath; path = path.mid(mp.length()); path = path.replace('/', ":"); return path; } } - return QString(); + return TQString(); } class IpodWriteDBJob : public ThreadManager::DependentJob { public: - IpodWriteDBJob( QObject *parent, Itdb_iTunesDB *itdb, bool isShuffle, bool *resultPtr ) + IpodWriteDBJob( TQObject *parent, Itdb_iTunesDB *itdb, bool isShuffle, bool *resultPtr ) : ThreadManager::DependentJob( parent, "IpodWriteDBJob" ) , m_itdb( itdb ) , m_isShuffle( isShuffle ) @@ -1995,7 +1995,7 @@ IpodMediaDevice::writeITunesDB( bool threaded ) IpodMediaItem * -IpodMediaDevice::getArtist(const QString &artist) +IpodMediaDevice::getArtist(const TQString &artist) { for(IpodMediaItem *it = dynamic_cast(m_view->firstChild()); it; @@ -2009,7 +2009,7 @@ IpodMediaDevice::getArtist(const QString &artist) } IpodMediaItem * -IpodMediaDevice::getAlbum(const QString &artist, const QString &album) +IpodMediaDevice::getAlbum(const TQString &artist, const TQString &album) { IpodMediaItem *item = getArtist(artist); if(item) @@ -2019,7 +2019,7 @@ IpodMediaDevice::getAlbum(const QString &artist, const QString &album) } IpodMediaItem * -IpodMediaDevice::getTrack(const QString &artist, const QString &album, const QString &title, +IpodMediaDevice::getTrack(const TQString &artist, const TQString &album, const TQString &title, int discNumber, int trackNumber, const PodcastEpisodeBundle *peb) { IpodMediaItem *item = getAlbum(artist, album); @@ -2038,7 +2038,7 @@ IpodMediaDevice::getTrack(const QString &artist, const QString &album, const QSt item = getAlbum( i18n( "Various Artists" ), album ); if( item ) { - QString t = artist + i18n(" - ") + title; + TQString t = artist + i18n(" - ") + title; for( IpodMediaItem *track = dynamic_cast(item->findItem(t)); track; track = dynamic_cast(item->findItem(t, track)) ) @@ -2073,9 +2073,9 @@ IpodMediaDevice::getTrack(const QString &artist, const QString &album, const QSt IpodMediaItem * IpodMediaDevice::getTrack( const Itdb_Track *itrack ) { - QString artist = QString::fromUtf8( itrack->artist ); - QString album = QString::fromUtf8( itrack->album ); - QString title = QString::fromUtf8( itrack->title ); + TQString artist = TQString::fromUtf8( itrack->artist ); + TQString album = TQString::fromUtf8( itrack->album ); + TQString title = TQString::fromUtf8( itrack->title ); IpodMediaItem *item = getAlbum( artist, album ); if(item) @@ -2092,7 +2092,7 @@ IpodMediaDevice::getTrack( const Itdb_Track *itrack ) item = getAlbum( i18n( "Various Artists" ), album ); if( item ) { - QString t = artist + i18n(" - ") + title; + TQString t = artist + i18n(" - ") + title; for( IpodMediaItem *track = dynamic_cast(item->findItem(t)); track; track = dynamic_cast(item->findItem(t, track)) ) @@ -2130,25 +2130,25 @@ IpodMediaDevice::determineURLOnDevice(const MetaBundle &bundle) return KURL(); } - QString local = bundle.filename(); - QString type = local.section('.', -1).lower(); + TQString local = bundle.filename(); + TQString type = local.section('.', -1).lower(); - QString trackpath; - QString realpath; + TQString trackpath; + TQString realpath; do { int num = std::rand() % 1000000; int music_dirs = itdb_musicdirs_number(m_itdb) > 1 ? itdb_musicdirs_number(m_itdb) : 20; int dir = num % music_dirs; - QString dirname; + TQString dirname; dirname.sprintf( "%s:Music:f%02d", itunesDir().latin1(), dir ); if( !pathExists( dirname ) ) { - QString realdir = realPath(dirname.latin1()); - QDir qdir( realdir ); + TQString realdir = realPath(dirname.latin1()); + TQDir qdir( realdir ); qdir.mkdir( realdir ); } - QString filename; + TQString filename; filename.sprintf( ":kpod%07d.%s", num, type.latin1() ); trackpath = dirname + filename; } @@ -2203,12 +2203,12 @@ IpodMediaDevice::getCapacity( KIO::filesize_t *total, KIO::filesize_t *available return false; #ifdef HAVE_STATVFS - QString path; + TQString path; if ( !pathExists( itunesDir(), &path ) ) return false; struct statvfs buf; - if(statvfs(QFile::encodeName(path), &buf) != 0) + if(statvfs(TQFile::encodeName(path), &buf) != 0) { *total = 0; *available = 0; @@ -2225,7 +2225,7 @@ IpodMediaDevice::getCapacity( KIO::filesize_t *total, KIO::filesize_t *available } void -IpodMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) +IpodMediaDevice::rmbPressed( TQListViewItem* qitem, const TQPoint& point, int ) { MediaItem *item = dynamic_cast(qitem); bool locked = m_mutex.locked(); @@ -2377,7 +2377,7 @@ IpodMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) break; case COPY_TO_COLLECTION: { - QPtrList items; + TQPtrList items; m_view->getSelectedLeaves( 0, &items ); KURL::List urls; @@ -2433,15 +2433,15 @@ IpodMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) case CREATE_PLAYLIST: case MAKE_PLAYLIST: { - QPtrList items; + TQPtrList items; if( id == MAKE_PLAYLIST ) m_view->getSelectedLeaves( 0, &items ); - QString base(i18n("New Playlist")); - QString name = base; + TQString base(i18n("New Playlist")); + TQString name = base; int i=1; while(m_playlistItem->findItem(name)) { - QString num; + TQString num; num.setNum(i); name = base + ' ' + num; i++; @@ -2476,9 +2476,9 @@ IpodMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) } else { - QPtrList items; + TQPtrList items; m_view->getSelectedLeaves( 0, &items ); - for( QPtrList::iterator it = items.begin(); + for( TQPtrList::iterator it = items.begin(); it != items.end(); it++ ) { @@ -2523,8 +2523,8 @@ IpodMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) default: if( playlistsMenu && id >= FIRST_PLAYLIST ) { - QString name = playlistsMenu->text(id); - if( name != QString::null ) + TQString name = playlistsMenu->text(id); + if( name != TQString::null ) { MediaItem *list = m_playlistItem->findItem(name); if(list) @@ -2534,7 +2534,7 @@ IpodMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) it; it = dynamic_cast(it->nextSibling())) after = it; - QPtrList items; + TQPtrList items; m_view->getSelectedLeaves( 0, &items ); addToPlaylist( list, after, items ); } @@ -2554,7 +2554,7 @@ IpodMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) QStringList IpodMediaDevice::supportedFiletypes() { - QStringList list; + TQStringList list; list << "mp3"; list << "m4a"; list << "m4b"; @@ -2590,21 +2590,21 @@ IpodMediaDevice::supportedFiletypes() } void -IpodMediaDevice::addConfigElements( QWidget *parent ) +IpodMediaDevice::addConfigElements( TQWidget *parent ) { - m_autoDeletePodcastsCheck = new QCheckBox( parent ); + m_autoDeletePodcastsCheck = new TQCheckBox( parent ); m_autoDeletePodcastsCheck->setText( i18n( "&Automatically delete podcasts" ) ); - QToolTip::add( m_autoDeletePodcastsCheck, i18n( "Automatically delete podcast shows already played when connecting device" ) ); + TQToolTip::add( m_autoDeletePodcastsCheck, i18n( "Automatically delete podcast shows already played when connecting device" ) ); m_autoDeletePodcastsCheck->setChecked( m_autoDeletePodcasts ); - m_syncStatsCheck = new QCheckBox( parent ); + m_syncStatsCheck = new TQCheckBox( parent ); m_syncStatsCheck->setText( i18n( "&Synchronize with Amarok statistics" ) ); - QToolTip::add( m_syncStatsCheck, i18n( "Synchronize with Amarok statistics and submit tracks played to last.fm" ) ); + TQToolTip::add( m_syncStatsCheck, i18n( "Synchronize with Amarok statistics and submit tracks played to last.fm" ) ); m_syncStatsCheck->setChecked( m_syncStats ); } void -IpodMediaDevice::removeConfigElements( QWidget * /*parent*/ ) +IpodMediaDevice::removeConfigElements( TQWidget * /*parent*/ ) { delete m_syncStatsCheck; m_syncStatsCheck = 0; @@ -2635,15 +2635,15 @@ IpodMediaDevice::loadConfig() } bool -IpodMediaDevice::pathExists( const QString &ipodPath, QString *realPath ) +IpodMediaDevice::pathExists( const TQString &ipodPath, TQString *realPath ) { - QDir curDir( mountPoint() ); - curDir.setFilter(curDir.filter() | QDir::Hidden); - QString curPath = mountPoint(); - QStringList components = QStringList::split( ":", ipodPath ); + TQDir curDir( mountPoint() ); + curDir.setFilter(curDir.filter() | TQDir::Hidden); + TQString curPath = mountPoint(); + TQStringList components = TQStringList::split( ":", ipodPath ); bool found = false; - QStringList::iterator it = components.begin(); + TQStringList::iterator it = components.begin(); for( ; it != components.end(); ++it ) { found = false; @@ -2689,8 +2689,8 @@ IpodMediaDevice::deleteFile( const KURL &url ) debug() << "deleting " << url.prettyURL() << endl; m_waitForDeletion = true; KIO::Job *job = KIO::file_delete( url, false ); - connect( job, SIGNAL( result( KIO::Job * ) ), - this, SLOT( fileDeleted( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), + this, TQT_SLOT( fileDeleted( KIO::Job * ) ) ); do { kapp->processEvents( 100 ); diff --git a/amarok/src/mediadevice/ipod/ipodmediadevice.h b/amarok/src/mediadevice/ipod/ipodmediadevice.h index bb38fea8..7f994c91 100644 --- a/amarok/src/mediadevice/ipod/ipodmediadevice.h +++ b/amarok/src/mediadevice/ipod/ipodmediadevice.h @@ -32,16 +32,16 @@ extern "C" { #include "mediabrowser.h" -#include -#include -#include +#include +#include +#include #include -class QCheckBox; -class QLabel; -class QLineEdit; -class QFile; +class TQCheckBox; +class TQLabel; +class TQLineEdit; +class TQFile; class KAction; @@ -59,12 +59,12 @@ class IpodMediaDevice : public MediaDevice virtual ~IpodMediaDevice(); virtual bool autoConnect() { return m_autoConnect; } virtual bool asynchronousTransfer() { return false; /* kernel buffer flushes freeze Amarok */ } - QStringList supportedFiletypes(); + TQStringList supportedFiletypes(); bool isConnected(); - virtual void addConfigElements( QWidget *parent ); - virtual void removeConfigElements( QWidget *parent ); + virtual void addConfigElements( TQWidget *parent ); + virtual void removeConfigElements( TQWidget *parent ); virtual void applyConfig(); virtual void loadConfig(); virtual MediaItem*tagsChanged( MediaItem *item, const MetaBundle &bundle ); @@ -89,11 +89,11 @@ class IpodMediaDevice : public MediaDevice * @param podcastInfo PodcastInfo of track if it is a podcast, 0 otherwise * @return If successful, the created MediaItem in the media device view, else 0 */ - virtual MediaItem *insertTrackIntoDB( const QString &pathname, + virtual MediaItem *insertTrackIntoDB( const TQString &pathname, const MetaBundle &metaBundle, const MetaBundle &propertiesBundle, const PodcastInfo *podcastInfo ); - virtual MediaItem *updateTrackInDB( IpodMediaItem *item, const QString &pathname, + virtual MediaItem *updateTrackInDB( IpodMediaItem *item, const TQString &pathname, const MetaBundle &metaBundle, const MetaBundle &propertiesBundle, const PodcastInfo *podcastInfo ); @@ -107,15 +107,15 @@ class IpodMediaDevice : public MediaDevice void synchronizeDevice(); int deleteItemFromDevice( MediaItem *item, int flags=DeleteTrack ); virtual void deleteFile( const KURL &url ); - void addToPlaylist( MediaItem *list, MediaItem *after, QPtrList items ); - MediaItem *newPlaylist( const QString &name, MediaItem *list, QPtrList items ); + void addToPlaylist( MediaItem *list, MediaItem *after, TQPtrList items ); + MediaItem *newPlaylist( const TQString &name, MediaItem *list, TQPtrList items ); bool getCapacity( KIO::filesize_t *total, KIO::filesize_t *available ); - void rmbPressed( QListViewItem* qitem, const QPoint& point, int ); + void rmbPressed( TQListViewItem* qitem, const TQPoint& point, int ); bool checkIntegrity(); void updateArtwork(); protected slots: - void renameItem( QListViewItem *item ); + void renameItem( TQListViewItem *item ); virtual void fileDeleted( KIO::Job *job ); private: @@ -127,15 +127,15 @@ class IpodMediaDevice : public MediaDevice void addPlaylistToView( Itdb_Playlist *playlist ); void playlistFromItem( IpodMediaItem *item ); - QString itunesDir( const QString &path = QString::null ) const; - QString realPath( const char *ipodPath ); - QString ipodPath( const QString &realPath ); - bool pathExists( const QString &ipodPath, QString *realPath=0 ); + TQString itunesDir( const TQString &path = TQString::null ) const; + TQString realPath( const char *ipodPath ); + TQString ipodPath( const TQString &realPath ); + bool pathExists( const TQString &ipodPath, TQString *realPath=0 ); // ipod database Itdb_iTunesDB *m_itdb; Itdb_Playlist *m_masterPlaylist; - QDict m_files; + TQDict m_files; // podcasts Itdb_Playlist* m_podcastPlaylist; @@ -149,10 +149,10 @@ class IpodMediaDevice : public MediaDevice bool m_needsFirewireGuid; bool m_autoConnect; - IpodMediaItem *getArtist( const QString &artist ); - IpodMediaItem *getAlbum( const QString &artist, const QString &album ); - IpodMediaItem *getTrack( const QString &artist, const QString &album, - const QString &title, + IpodMediaItem *getArtist( const TQString &artist ); + IpodMediaItem *getAlbum( const TQString &artist, const TQString &album ); + IpodMediaItem *getTrack( const TQString &artist, const TQString &album, + const TQString &title, int discNumber = -1, int trackNumber = -1, const PodcastEpisodeBundle *peb = 0 ); IpodMediaItem *getTrack( const Itdb_Track *itrack ); @@ -161,10 +161,10 @@ class IpodMediaDevice : public MediaDevice bool m_dbChanged; - QCheckBox *m_syncStatsCheck; - QCheckBox *m_autoDeletePodcastsCheck; - QFile *m_lockFile; - QMutex m_mutex; + TQCheckBox *m_syncStatsCheck; + TQCheckBox *m_autoDeletePodcastsCheck; + TQFile *m_lockFile; + TQMutex m_mutex; KAction *m_customAction; enum { CHECK_INTEGRITY, UPDATE_ARTWORK, SET_IPOD_MODEL }; diff --git a/amarok/src/mediadevice/mtp/mtpmediadevice.cpp b/amarok/src/mediadevice/mtp/mtpmediadevice.cpp index ca015273..42de70c3 100644 --- a/amarok/src/mediadevice/mtp/mtpmediadevice.cpp +++ b/amarok/src/mediadevice/mtp/mtpmediadevice.cpp @@ -45,13 +45,13 @@ AMAROK_EXPORT_PLUGIN( MtpMediaDevice ) #include // Qt -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /** * MtpMediaDevice Class @@ -75,8 +75,8 @@ MtpMediaDevice::MtpMediaDevice() : MediaDevice() KToolBarButton *customButton = MediaBrowser::instance()->getToolBar()->getButton( MediaBrowser::CUSTOM ); customButton->setText( i18n("Special device functions") ); - QToolTip::remove( customButton ); - QToolTip::add( customButton, i18n( "Special functions of your device" ) ); + TQToolTip::remove( customButton ); + TQToolTip::add( customButton, i18n( "Special functions of your device" ) ); mtpFileTypes[LIBMTP_FILETYPE_WAV] = "wav"; mtpFileTypes[LIBMTP_FILETYPE_MP3] = "mp3"; @@ -108,7 +108,7 @@ MtpMediaDevice::MtpMediaDevice() : MediaDevice() mtpFileTypes[LIBMTP_FILETYPE_HTML] = "html"; mtpFileTypes[LIBMTP_FILETYPE_UNKNOWN] = "unknown"; - m_newTracks = new QPtrList; + m_newTracks = new TQPtrList; } void @@ -161,7 +161,7 @@ MediaItem { DEBUG_BLOCK - QString genericError = i18n( "Could not send track" ); + TQString genericError = i18n( "Could not send track" ); LIBMTP_track_t *trackmeta = LIBMTP_new_track_t(); trackmeta->item_id = 0; @@ -188,7 +188,7 @@ MediaItem // fallback to checking the extension (e.g. .wma, .ogg, etc) debug() << "No filetype found by Amarok filetype" << endl; - const QString extension = bundle.url().path().section( ".", -1 ).lower(); + const TQString extension = bundle.url().path().section( ".", -1 ).lower(); int libmtp_type = m_supportedFiles.findIndex( extension ); if( libmtp_type >= 0 ) @@ -248,8 +248,8 @@ MediaItem if( bundle.year() > 0 ) { - QString date; - QTextOStream( &date ) << bundle.year() << "0101T0000.0"; + TQString date; + TQTextOStream( &date ) << bundle.year() << "0101T0000.0"; trackmeta->date = qstrdup( date.utf8() ); } else @@ -334,14 +334,14 @@ MediaItem * device and set it as the cover art. */ void -MtpMediaDevice::sendAlbumArt( QPtrList *items ) +MtpMediaDevice::sendAlbumArt( TQPtrList *items ) { - QString image; + TQString image; image = CollectionDB::instance()->albumImage(items->first()->bundle()->artist(), items->first()->bundle()->album(), false, 100); if( ! image.endsWith( "@nocover.png" ) ) { debug() << "image " << image << " found for " << items->first()->bundle()->album() << endl; - QByteArray *imagedata = getSupportedImage( image ); + TQByteArray *imagedata = getSupportedImage( image ); if( imagedata == 0 ) { debug() << "Cannot generate a supported image format" << endl; @@ -400,7 +400,7 @@ MtpMediaDevice::getDefaultParentId( void ) * supported on the device */ QByteArray -*MtpMediaDevice::getSupportedImage( QString path ) +*MtpMediaDevice::getSupportedImage( TQString path ) { if( m_format == 0 ) return 0; @@ -408,12 +408,12 @@ QByteArray debug() << "Will convert image to " << m_format << endl; // open image - const QImage original( path ); + const TQImage original( path ); // save as new image - QImage newformat( original ); - QByteArray *newimage = new QByteArray(); - QBuffer buffer( *newimage ); + TQImage newformat( original ); + TQByteArray *newimage = new TQByteArray(); + TQBuffer buffer( *newimage ); buffer.open( IO_WriteOnly ); if( newformat.save( &buffer, m_format.ascii() ) ) { @@ -427,7 +427,7 @@ QByteArray * Update cover art for a number of tracks */ void -MtpMediaDevice::updateAlbumArt( QPtrList *items ) +MtpMediaDevice::updateAlbumArt( TQPtrList *items ) { DEBUG_BLOCK @@ -437,7 +437,7 @@ MtpMediaDevice::updateAlbumArt( QPtrList *items ) setCanceled( false ); kapp->processEvents( 100 ); - QMap< QString, QPtrList > albumList; + TQMap< TQString, TQPtrList > albumList; for( MtpMediaItem *it = dynamic_cast(items->first()); it && !(m_canceled); it = dynamic_cast(items->next()) ) { @@ -454,7 +454,7 @@ MtpMediaDevice::updateAlbumArt( QPtrList *items ) int i = 0; setProgress( i, albumList.count() ); kapp->processEvents( 100 ); - QMap< QString, QPtrList >::Iterator it; + TQMap< TQString, TQPtrList >::Iterator it; for( it = albumList.begin(); it != albumList.end(); ++it ) { sendAlbumArt( &it.data() ); @@ -469,12 +469,12 @@ MtpMediaDevice::updateAlbumArt( QPtrList *items ) * Retrieve existing or create new album object. */ LIBMTP_album_t -*MtpMediaDevice::getOrCreateAlbum( QPtrList *items )//uint32_t track_id, const MetaBundle &bundle ) +*MtpMediaDevice::getOrCreateAlbum( TQPtrList *items )//uint32_t track_id, const MetaBundle &bundle ) { LIBMTP_album_t *album_object = 0; uint32_t albumid = 0; int ret; - QMap::Iterator it; + TQMap::Iterator it; for( it = m_idToAlbum.begin(); it != m_idToAlbum.end(); ++it ) { if( it.data()->album() == items->first()->bundle()->album() ) @@ -548,29 +548,29 @@ LIBMTP_album_t uint32_t MtpMediaDevice::checkFolderStructure( const MetaBundle &bundle, bool create ) { - QString artist = bundle.artist(); + TQString artist = bundle.artist(); if( artist.isEmpty() ) artist = i18n( "Unknown Artist" ); if( bundle.compilation() == MetaBundle::CompilationYes ) artist = i18n( "Various Artists" ); - QString album = bundle.album(); + TQString album = bundle.album(); if( album.isEmpty() ) album = i18n( "Unknown Album" ); - QString genre = bundle.genre(); + TQString genre = bundle.genre(); if( genre.isEmpty() ) genre = i18n( "Unknown Genre" ); m_critical_mutex.lock(); uint32_t parent_id = getDefaultParentId(); - QStringList folders = QStringList::split( "/", m_folderStructure ); // use slash as a dir separator - QString completePath; - for( QStringList::Iterator it = folders.begin(); it != folders.end(); ++it ) + TQStringList folders = TQStringList::split( "/", m_folderStructure ); // use slash as a dir separator + TQString completePath; + for( TQStringList::Iterator it = folders.begin(); it != folders.end(); ++it ) { if( (*it).isEmpty() ) continue; // substitute %a , %b , %g - (*it).replace( QRegExp( "%a" ), artist ) - .replace( QRegExp( "%b" ), album ) - .replace( QRegExp( "%g" ), genre ); + (*it).replace( TQRegExp( "%a" ), artist ) + .replace( TQRegExp( "%b" ), album ) + .replace( TQRegExp( "%g" ), genre ); // check if it exists uint32_t check_folder = subfolderNameToID( (*it).utf8(), m_folders, parent_id ); // create if not exists (if requested) @@ -675,13 +675,13 @@ MtpMediaDevice::folderNameToID( char *name, LIBMTP_folder_t *folderlist ) int MtpMediaDevice::downloadSelectedItemsToCollection() { - QPtrList items; + TQPtrList items; m_view->getSelectedLeaves( 0, &items ); - KTempDir tempdir( QString::null ); + KTempDir tempdir( TQString::null ); tempdir.setAutoDelete( true ); KURL::List urls; - QString genericError = i18n( "Could not copy track from device." ); + TQString genericError = i18n( "Could not copy track from device." ); int total,progress; total = items.count(); @@ -695,7 +695,7 @@ MtpMediaDevice::downloadSelectedItemsToCollection() { if( it->type() == MediaItem::TRACK ) { - QString filename = tempdir.name() + it->bundle()->filename(); + TQString filename = tempdir.name() + it->bundle()->filename(); int ret = LIBMTP_Get_Track_To_File( m_device, it->track()->id(), filename.utf8(), progressCallback, this @@ -756,7 +756,7 @@ MediaItem } } uint32_t folderId = checkFolderStructure( bundle, false ); - MediaItem *file = m_fileNameToItem[ QString( "%1/%2" ).arg( folderId ).arg( bundle.filename() ) ]; + MediaItem *file = m_fileNameToItem[ TQString( "%1/%2" ).arg( folderId ).arg( bundle.filename() ) ]; if( file != 0 ) return file; return 0; @@ -766,7 +766,7 @@ MediaItem * Create a new playlist */ MtpMediaItem -*MtpMediaDevice::newPlaylist( const QString &name, MediaItem *parent, QPtrList items ) +*MtpMediaDevice::newPlaylist( const TQString &name, MediaItem *parent, TQPtrList items ) { DEBUG_BLOCK MtpMediaItem *item = new MtpMediaItem( parent, this ); @@ -786,7 +786,7 @@ MtpMediaItem * Add an item to a playlist */ void -MtpMediaDevice::addToPlaylist( MediaItem *mlist, MediaItem *after, QPtrList items ) +MtpMediaDevice::addToPlaylist( MediaItem *mlist, MediaItem *after, TQPtrList items ) { DEBUG_BLOCK MtpMediaItem *list = dynamic_cast( mlist ); @@ -871,7 +871,7 @@ MtpMediaDevice::addToPlaylist( MediaItem *mlist, MediaItem *after, QPtrList( item ); @@ -909,7 +909,7 @@ MtpMediaDevice::playlistFromItem( MtpMediaItem *item ) metadata->no_tracks = 0; } - QString genericError = i18n( "Could not save playlist." ); + TQString genericError = i18n( "Could not save playlist." ); if( item->playlist()->id() == 0 ) { @@ -1028,7 +1028,7 @@ MtpMediaDevice::deleteObject( MtpMediaItem *deleteItem ) else object_id = deleteItem->track()->id(); - QString genericError = i18n( "Could not delete item" ); + TQString genericError = i18n( "Could not delete item" ); debug() << "delete this id : " << object_id << endl; @@ -1050,7 +1050,7 @@ MtpMediaDevice::deleteObject( MtpMediaItem *deleteItem ) // clear cached filename if( deleteItem->type() == MediaItem::TRACK ) - m_fileNameToItem.remove( QString( "%1/%2" ).arg( deleteItem->track()->folderId() ).arg( deleteItem->bundle()->filename() ) ); + m_fileNameToItem.remove( TQString( "%1/%2" ).arg( deleteItem->track()->folderId() ).arg( deleteItem->bundle()->filename() ) ); // remove from the media view delete deleteItem; kapp->processEvents( 100 ); @@ -1092,7 +1092,7 @@ MtpMediaDevice::openDevice( bool silent ) return true; - QString genericError = i18n( "Could not connect to MTP Device" ); + TQString genericError = i18n( "Could not connect to MTP Device" ); m_critical_mutex.lock(); LIBMTP_Init(); @@ -1110,12 +1110,12 @@ MtpMediaDevice::openDevice( bool silent ) } connect( - m_view, SIGNAL( itemRenamed( QListViewItem*, const QString&, int ) ), - this, SLOT( playlistRenamed( QListViewItem*, const QString&, int ) ) + m_view, TQT_SIGNAL( itemRenamed( TQListViewItem*, const TQString&, int ) ), + this, TQT_SLOT( playlistRenamed( TQListViewItem*, const TQString&, int ) ) ); - QString modelname = QString( LIBMTP_Get_Modelname( m_device ) ); - QString ownername = QString( LIBMTP_Get_Friendlyname( m_device ) ); + TQString modelname = TQString( LIBMTP_Get_Modelname( m_device ) ); + TQString ownername = TQString( LIBMTP_Get_Friendlyname( m_device ) ); m_name = modelname; if(! ownername.isEmpty() ) m_name += " (" + ownername + ')'; @@ -1223,12 +1223,12 @@ MtpMediaDevice::getCapacity( KIO::filesize_t *total, KIO::filesize_t *available void MtpMediaDevice::customClicked() { - QString Information; + TQString Information; if( isConnected() ) { - QString batteryLevel; - QString secureTime; - QString supportedFiles; + TQString batteryLevel; + TQString secureTime; + TQString supportedFiles; uint8_t maxbattlevel; uint8_t currbattlevel; @@ -1241,7 +1241,7 @@ MtpMediaDevice::customClicked() m_critical_mutex.unlock(); batteryLevel = i18n("Battery level: ") - + QString::number( (int) ( (float) currbattlevel / (float) maxbattlevel * 100.0 ) ) + + TQString::number( (int) ( (float) currbattlevel / (float) maxbattlevel * 100.0 ) ) + '%'; secureTime = i18n("Secure time: ") + sectime; supportedFiles = i18n("Supported file types: ") @@ -1284,7 +1284,7 @@ MtpMediaDevice::setDisconnected() * Handle clicking of the right mouse button */ void -MtpMediaDevice::rmbPressed( QListViewItem *qitem, const QPoint &point, int ) +MtpMediaDevice::rmbPressed( TQListViewItem *qitem, const TQPoint &point, int ) { enum Actions {RENAME, DOWNLOAD, DELETE, MAKE_PLAYLIST, UPDATE_ALBUM_ART}; @@ -1316,9 +1316,9 @@ MtpMediaDevice::rmbPressed( QListViewItem *qitem, const QPoint &point, int ) { case MAKE_PLAYLIST: { - QPtrList items; + TQPtrList items; m_view->getSelectedLeaves( 0, &items ); - QString name = i18n( "New Playlist" ); + TQString name = i18n( "New Playlist" ); newPlaylist( name, m_playlistItem, items ); } break; @@ -1336,7 +1336,7 @@ MtpMediaDevice::rmbPressed( QListViewItem *qitem, const QPoint &point, int ) break; case UPDATE_ALBUM_ART: { - QPtrList *items = new QPtrList; + TQPtrList *items = new TQPtrList; m_view->getSelectedLeaves( 0, items ); if( items->count() > 100 ) @@ -1346,7 +1346,7 @@ MtpMediaDevice::rmbPressed( QListViewItem *qitem, const QPoint &point, int ) "

You are updating cover art for %n tracks. This may take some time.", items->count() ), - QString::null ); + TQString::null ); if( button != KMessageBox::Continue ) return; @@ -1363,15 +1363,15 @@ MtpMediaDevice::rmbPressed( QListViewItem *qitem, const QPoint &point, int ) * Add gui elements to the device configuration */ void -MtpMediaDevice::addConfigElements( QWidget *parent ) +MtpMediaDevice::addConfigElements( TQWidget *parent ) { - m_folderLabel = new QLabel( parent ); + m_folderLabel = new TQLabel( parent ); m_folderLabel->setText( i18n( "Folder structure:" ) ); - m_folderStructureBox = new QLineEdit( parent ); + m_folderStructureBox = new TQLineEdit( parent ); m_folderStructureBox->setText( m_folderStructure ); - QToolTip::add( m_folderStructureBox, + TQToolTip::add( m_folderStructureBox, i18n( "Files copied to the device will be placed in this folder." ) + '\n' + i18n( "/ is used as folder separator." ) + '\n' + i18n( "%a will be replaced with the artist name, ") @@ -1384,7 +1384,7 @@ MtpMediaDevice::addConfigElements( QWidget *parent ) * Remove gui elements from the device configuration */ void -MtpMediaDevice::removeConfigElements( QWidget *parent) +MtpMediaDevice::removeConfigElements( TQWidget *parent) { Q_UNUSED(parent) @@ -1420,7 +1420,7 @@ MtpMediaDevice::loadConfig() MtpMediaItem *MtpMediaDevice::addTrackToView( MtpTrack *track, MtpMediaItem *item ) { - QString artistName = track->bundle()->artist(); + TQString artistName = track->bundle()->artist(); MtpMediaItem *artist = dynamic_cast( m_view->findItem( artistName, 0 ) ); if( !artist ) @@ -1431,7 +1431,7 @@ MtpMediaItem artist->setType( MediaItem::ARTIST ); } - QString albumName = track->bundle()->album(); + TQString albumName = track->bundle()->album(); MtpMediaItem *album = dynamic_cast( artist->findItem( albumName ) ); if( !album ) { @@ -1447,14 +1447,14 @@ MtpMediaItem { item = new MtpMediaItem( album ); item->m_device = this; - QString titleName = track->bundle()->title(); + TQString titleName = track->bundle()->title(); item->setTrack( track ); item->m_order = track->bundle()->track(); item->setText( 0, titleName ); item->setType( MediaItem::TRACK ); item->setBundle( track->bundle() ); item->track()->setId( track->id() ); - m_fileNameToItem[ QString( "%1/%2" ).arg( track->folderId() ).arg( track->bundle()->filename() ) ] = item; + m_fileNameToItem[ TQString( "%1/%2" ).arg( track->folderId() ).arg( track->bundle()->filename() ) ] = item; m_idToTrack[ track->id() ] = track; } return item; @@ -1472,7 +1472,7 @@ MtpMediaDevice::readMtpMusic() m_critical_mutex.lock(); - QString genericError = i18n( "Could not get music from MTP Device" ); + TQString genericError = i18n( "Could not get music from MTP Device" ); int total = 100; int progress = 0; @@ -1541,7 +1541,7 @@ MtpMediaDevice::readPlaylists() while( playlists != 0 ) { MtpMediaItem *playlist = new MtpMediaItem( m_playlistItem, this ); - playlist->setText( 0, QString::fromUtf8( playlists->name ) ); + playlist->setText( 0, TQString::fromUtf8( playlists->name ) ); playlist->setType( MediaItem::PLAYLIST ); playlist->setPlaylist( new MtpPlaylist() ); playlist->playlist()->setId( playlists->playlist_id ); @@ -1618,15 +1618,15 @@ MtpTrack::readMetaData( LIBMTP_track_t *track ) MetaBundle *bundle = new MetaBundle(); if( track->genre != 0 ) - bundle->setGenre( AtomicString( QString::fromUtf8( track->genre ) ) ); + bundle->setGenre( AtomicString( TQString::fromUtf8( track->genre ) ) ); if( track->artist != 0 ) - bundle->setArtist( AtomicString( QString::fromUtf8( track->artist ) ) ); + bundle->setArtist( AtomicString( TQString::fromUtf8( track->artist ) ) ); if( track->album != 0 ) - bundle->setAlbum( AtomicString( QString::fromUtf8( track->album ) ) ); + bundle->setAlbum( AtomicString( TQString::fromUtf8( track->album ) ) ); if( track->title != 0 ) - bundle->setTitle( AtomicString( QString::fromUtf8( track->title ) ) ); + bundle->setTitle( AtomicString( TQString::fromUtf8( track->title ) ) ); if( track->filename != 0 ) - bundle->setPath( AtomicString( QString::fromUtf8( track->filename ) ) ); + bundle->setPath( AtomicString( TQString::fromUtf8( track->filename ) ) ); // translate codecs to file types if( track->filetype == LIBMTP_FILETYPE_MP3 ) @@ -1639,7 +1639,7 @@ MtpTrack::readMetaData( LIBMTP_track_t *track ) bundle->setFileType( MetaBundle::other ); if( track->date != 0 ) - bundle->setYear( QString( QString::fromUtf8( track->date ) ).mid( 0, 4 ).toUInt() ); + bundle->setYear( TQString( TQString::fromUtf8( track->date ) ).mid( 0, 4 ).toUInt() ); if( track->tracknumber > 0 ) bundle->setTrack( track->tracknumber ); if( track->duration > 0 ) @@ -1665,5 +1665,5 @@ MtpTrack::setBundle( MetaBundle &bundle ) MtpAlbum::MtpAlbum( LIBMTP_album_t *album ) { m_id = album->album_id; - m_album = QString::fromUtf8( album->name ); + m_album = TQString::fromUtf8( album->name ); } diff --git a/amarok/src/mediadevice/mtp/mtpmediadevice.h b/amarok/src/mediadevice/mtp/mtpmediadevice.h index 3f60a89a..57e81114 100644 --- a/amarok/src/mediadevice/mtp/mtpmediadevice.h +++ b/amarok/src/mediadevice/mtp/mtpmediadevice.h @@ -27,8 +27,8 @@ #include "mediabrowser.h" -#include -#include +#include +#include #include @@ -81,23 +81,23 @@ class MtpAlbum { public: u_int32_t id() const { return m_id; } void setId( int id ) { m_id = id; } - QString album() const { return m_album; } + TQString album() const { return m_album; } private: u_int32_t m_id; - QString m_album; + TQString m_album; }; class MtpMediaItem : public MediaItem { public: - MtpMediaItem( QListView *parent, QListViewItem *after = 0 ) + MtpMediaItem( TQListView *parent, TQListViewItem *after = 0 ) : MediaItem( parent, after ) {} - MtpMediaItem( QListViewItem *parent, QListViewItem *after = 0 ) + MtpMediaItem( TQListViewItem *parent, TQListViewItem *after = 0 ) : MediaItem( parent, after ) {} - MtpMediaItem( QListView *parent, MediaDevice *dev ) + MtpMediaItem( TQListView *parent, MediaDevice *dev ) : MediaItem( parent ) { init( dev ); } - MtpMediaItem( QListViewItem *parent, MediaDevice *dev ) + MtpMediaItem( TQListViewItem *parent, MediaDevice *dev ) : MediaItem( parent ) { init( dev ); } void init( MediaDevice *dev ) @@ -115,7 +115,7 @@ class MtpMediaItem : public MediaItem MtpTrack *track() { return m_track; } void setPlaylist( MtpPlaylist *playlist ) { m_playlist = playlist; } MtpPlaylist *playlist() { return m_playlist; } - QString filename() { return m_track->bundle()->url().path(); } + TQString filename() { return m_track->bundle()->url().path(); } private: MtpTrack *m_track; @@ -133,14 +133,14 @@ class MtpMediaDevice : public MediaDevice bool isConnected(); LIBMTP_mtpdevice_t *current_device(); void setDisconnected(); - virtual void rmbPressed( QListViewItem *qitem, const QPoint &point, int arg1 ); + virtual void rmbPressed( TQListViewItem *qitem, const TQPoint &point, int arg1 ); virtual void init( MediaBrowser* parent ); - virtual QStringList supportedFiletypes(); + virtual TQStringList supportedFiletypes(); void setFolders( LIBMTP_folder_t *folders ); void cancelTransfer(); void customClicked(); - virtual void addConfigElements( QWidget *parent ); - virtual void removeConfigElements( QWidget *parent ); + virtual void addConfigElements( TQWidget *parent ); + virtual void removeConfigElements( TQWidget *parent ); virtual void applyConfig(); virtual void loadConfig(); static int progressCallback( uint64_t const sent, uint64_t const total, void const * const data ); @@ -158,13 +158,13 @@ class MtpMediaDevice : public MediaDevice void synchronizeDevice(); int deleteItemFromDevice( MediaItem *mediaitem, int flags=DeleteTrack ); - void addToPlaylist( MediaItem *list, MediaItem *after, QPtrList items ); - MtpMediaItem *newPlaylist( const QString &name, MediaItem *list, QPtrList items ); + void addToPlaylist( MediaItem *list, MediaItem *after, TQPtrList items ); + MtpMediaItem *newPlaylist( const TQString &name, MediaItem *list, TQPtrList items ); bool getCapacity( KIO::filesize_t *total, KIO::filesize_t *available ); virtual void updateRootItems() {}; private slots: - void playlistRenamed( QListViewItem *item, const QString &, int ); + void playlistRenamed( TQListViewItem *item, const TQString &, int ); private: MtpMediaItem *addTrackToView(MtpTrack *track, MtpMediaItem *item=0 ); @@ -181,25 +181,25 @@ class MtpMediaDevice : public MediaDevice void readPlaylists( void ); void readAlbums( void ); void playlistFromItem( MtpMediaItem *item); - QByteArray *getSupportedImage( QString path ); - void sendAlbumArt( QPtrList *items ); - void updateAlbumArt( QPtrList *items ); - LIBMTP_album_t *getOrCreateAlbum( QPtrList *items ); + TQByteArray *getSupportedImage( TQString path ); + void sendAlbumArt( TQPtrList *items ); + void updateAlbumArt( TQPtrList *items ); + LIBMTP_album_t *getOrCreateAlbum( TQPtrList *items ); LIBMTP_mtpdevice_t *m_device; - QMutex m_mutex; - QMutex m_critical_mutex; + TQMutex m_mutex; + TQMutex m_critical_mutex; LIBMTP_folder_t *m_folders; uint32_t m_default_parent_folder; - QString m_folderStructure; - QLineEdit *m_folderStructureBox; - QLabel *m_folderLabel; - QStringList m_supportedFiles; - QPtrList *m_newTracks; - QMap mtpFileTypes; - QMap m_idToTrack; - QMap m_fileNameToItem; - QMap m_idToAlbum; - QString m_format; + TQString m_folderStructure; + TQLineEdit *m_folderStructureBox; + TQLabel *m_folderLabel; + TQStringList m_supportedFiles; + TQPtrList *m_newTracks; + TQMap mtpFileTypes; + TQMap m_idToTrack; + TQMap m_fileNameToItem; + TQMap m_idToAlbum; + TQString m_format; }; #endif diff --git a/amarok/src/mediadevice/njb/njbmediadevice.cpp b/amarok/src/mediadevice/njb/njbmediadevice.cpp index 07d0dfec..d2125937 100644 --- a/amarok/src/mediadevice/njb/njbmediadevice.cpp +++ b/amarok/src/mediadevice/njb/njbmediadevice.cpp @@ -53,11 +53,11 @@ AMAROK_EXPORT_PLUGIN( NjbMediaDevice ) // Qt -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include // posix #include @@ -65,7 +65,7 @@ AMAROK_EXPORT_PLUGIN( NjbMediaDevice ) #include #include -namespace Amarok { extern KConfig *config( const QString& ); } +namespace Amarok { extern KConfig *config( const TQString& ); } njb_t *NjbMediaDevice::m_njb = 0; // This function has NOT handled the request, so other functions may be called // upon to do so @@ -77,7 +77,7 @@ const int NJB_HANDLED = -1; NjbMediaDevice::NjbMediaDevice(): MediaDevice() { - // listAmarokPlayLists = new QListView(); + // listAmarokPlayLists = new TQListView(); m_name = i18n("NJB Media device"); m_njb = 0; m_connected = false; @@ -88,8 +88,8 @@ NjbMediaDevice::NjbMediaDevice(): MediaDevice() NJB_Set_Debug(0); // or try DD_SUBTRACE KToolBarButton* customButton = MediaBrowser::instance()->getToolBar()->getButton( MediaBrowser::CUSTOM ); customButton->setText( i18n("Special device functions") ); - QToolTip::remove( customButton ); - QToolTip::add( customButton, i18n( "Special functions of your jukebox" ) ); + TQToolTip::remove( customButton ); + TQToolTip::add( customButton, i18n( "Special functions of your jukebox" ) ); } @@ -200,7 +200,7 @@ NjbMediaDevice::openDevice(bool) if( m_njb ) return true; - QString genericError = i18n( "Could not connect to Nomad device" ); + TQString genericError = i18n( "Could not connect to Nomad device" ); NJB_Set_Unicode( NJB_UC_UTF8 ); // I assume that UTF-8 is fine with everyone... int n; @@ -222,8 +222,8 @@ NjbMediaDevice::openDevice(bool) return false; } - QString deviceName = NJB_Get_Device_Name( m_njb, 1 ); - QString owner = NJB_Get_Owner_String( m_njb ); + TQString deviceName = NJB_Get_Device_Name( m_njb, 1 ); + TQString owner = NJB_Get_Owner_String( m_njb ); m_name = deviceName + " (Owned by " + owner + ')'; @@ -288,7 +288,7 @@ NjbMediaDevice::deleteItemFromDevice(MediaItem* item, int flags ) if( isCanceled() ) break; - expandItem( dynamic_cast(item) ); + expandItem( dynamic_cast(item) ); for( MediaItem *it = dynamic_cast( item->firstChild() ); it ; it = next ) { @@ -335,7 +335,7 @@ int NjbMediaDevice::downloadSelectedItems() { /* Copied from ifpmediadevice */ - QString save = QString::null; + TQString save = TQString::null; KURLRequesterDlg dialog( save, 0, 0 ); dialog.setCaption( kapp->makeStdCaption( i18n( "Choose a Download Directory" ) ) ); @@ -347,10 +347,10 @@ NjbMediaDevice::downloadSelectedItems() return -1; destDir.adjustPath( 1 ); //add trailing slash - QDir dir; - QString path; + TQDir dir; + TQString path; - QPtrList items; + TQPtrList items; m_view->getSelectedLeaves( 0, &items ); int result = 0; @@ -377,12 +377,12 @@ NjbMediaDevice::downloadToCollection() { // We will first download all files into a temp dir, and then call move to collection. - QPtrList items; + TQPtrList items; m_view->getSelectedLeaves( 0, &items ); - KTempDir tempdir( QString::null ); // Default prefix is fine with us + KTempDir tempdir( TQString::null ); // Default prefix is fine with us tempdir.setAutoDelete( true ); // We don't need it once the work is done. - QString path = tempdir.name(), filepath; + TQString path = tempdir.name(), filepath; KURL::List urls; for( MediaItem *it = items.first(); it && !(m_canceled); it = items.next() ) { @@ -393,7 +393,7 @@ NjbMediaDevice::downloadToCollection() debug() << "Dynamic cast to NJB media item failed. " << endl; return -1; } - QString track_id; + TQString track_id; track_id.setNum( auxItem->track()->id() ); filepath = path + auxItem->bundle()->url().path(); @@ -493,7 +493,7 @@ NjbMediaDevice::copyTrackFromDevice( MediaItem *item ) NjbTrack *track((*it)); - QString filename = item->bundle()->directory() + track->bundle()->filename(); + TQString filename = item->bundle()->directory() + track->bundle()->filename(); if( NJB_Get_Track( m_njb, track->id(), track->bundle()->filesize(), filename.utf8(), progressCallback, this) != NJB_SUCCESS ) { @@ -510,7 +510,7 @@ NjbMediaDevice::copyTrackFromDevice( MediaItem *item ) } MediaItem* -NjbMediaDevice::newPlaylist(const QString& name, MediaItem* parent, QPtrList< MediaItem > items) +NjbMediaDevice::newPlaylist(const TQString& name, MediaItem* parent, TQPtrList< MediaItem > items) { DEBUG_BLOCK @@ -556,7 +556,7 @@ NjbMediaDevice::newPlaylist(const QString& name, MediaItem* parent, QPtrList< Me QStringList NjbMediaDevice::supportedFiletypes() { - QStringList supportedFiles; + TQStringList supportedFiles; supportedFiles << "mp3"; supportedFiles << "wav"; supportedFiles << "wma"; @@ -570,13 +570,13 @@ NjbMediaDevice::getTransferDialog() } void -NjbMediaDevice::addConfigElements(QWidget* arg1) +NjbMediaDevice::addConfigElements(TQWidget* arg1) { MediaDevice::addConfigElements(arg1); } void -NjbMediaDevice::addToPlaylist(MediaItem* playlist, MediaItem* after, QPtrList< MediaItem > items) +NjbMediaDevice::addToPlaylist(MediaItem* playlist, MediaItem* after, TQPtrList< MediaItem > items) { MediaDevice::addToPlaylist(playlist, after, items); } @@ -606,7 +606,7 @@ NjbMediaDevice::loadConfig() } void -NjbMediaDevice::removeConfigElements(QWidget* arg1) +NjbMediaDevice::removeConfigElements(TQWidget* arg1) { MediaDevice::removeConfigElements(arg1); } @@ -627,7 +627,7 @@ NjbMediaDevice::trackExists( const MetaBundle & bundle ) } void -NjbMediaDevice::rmbPressed(QListViewItem* qitem, const QPoint& point, int ) +NjbMediaDevice::rmbPressed(TQListViewItem* qitem, const TQPoint& point, int ) { enum Actions { DOWNLOAD, DOWNLOAD_TO_COLLECTION, RENAME, DELETE}; @@ -645,7 +645,7 @@ NjbMediaDevice::rmbPressed(QListViewItem* qitem, const QPoint& point, int ) int id = menu.exec( point ); MediaItem *i; - QPtrList items; + TQPtrList items; switch( id ) { case DOWNLOAD: @@ -755,7 +755,7 @@ NjbMediaDevice::readJukeboxMusic( void ) NjbMediaItem * NjbMediaDevice::addTrackToView( NjbTrack *track, NjbMediaItem *item ) { - QString artistName = track->bundle()->artist(); + TQString artistName = track->bundle()->artist(); NjbMediaItem *artist = dynamic_cast( m_view->findItem( artistName, 0 ) ); if(!artist) @@ -766,7 +766,7 @@ NjbMediaDevice::addTrackToView( NjbTrack *track, NjbMediaItem *item ) artist->setType( MediaItem::ARTIST ); } - QString albumName = track->bundle()->album(); + TQString albumName = track->bundle()->album(); NjbMediaItem *album = dynamic_cast( artist->findItem( albumName ) ); if(!album) { @@ -782,7 +782,7 @@ NjbMediaDevice::addTrackToView( NjbTrack *track, NjbMediaItem *item ) { item = new NjbMediaItem( album ); item->m_device = this; - QString titleName = track->bundle()->title(); + TQString titleName = track->bundle()->title(); item->setTrack( track ); item->setText( 0, titleName ); @@ -801,7 +801,7 @@ NjbMediaDevice::theNjb() } void -NjbMediaDevice::expandItem( QListViewItem *item ) +NjbMediaDevice::expandItem( TQListViewItem *item ) { DEBUG_BLOCK // First clear the item's children to repopulate. @@ -831,7 +831,7 @@ NjbMediaDevice::expandItem( QListViewItem *item ) } NjbMediaItem* -NjbMediaDevice::addAlbums(const QString &artist, NjbMediaItem *item) +NjbMediaDevice::addAlbums(const TQString &artist, NjbMediaItem *item) { for( trackValueList::iterator it = trackList.begin(); it != trackList.end(); it++ ) { @@ -849,7 +849,7 @@ NjbMediaDevice::addAlbums(const QString &artist, NjbMediaItem *item) } NjbMediaItem* -NjbMediaDevice::addTracks(const QString &artist, const QString &album, NjbMediaItem *item) +NjbMediaDevice::addTracks(const TQString &artist, const TQString &album, NjbMediaItem *item) { for( trackValueList::iterator it = trackList.begin(); it != trackList.end(); it++ ) { @@ -884,11 +884,11 @@ NjbMediaDevice::addArtist( NjbTrack *track ) void NjbMediaDevice::customClicked() { - QString Information; - QString tracksFound; - QString powerStatus; - QString batteryLevel; - QString batteryCharging; + TQString Information; + TQString tracksFound; + TQString powerStatus; + TQString batteryLevel; + TQString batteryCharging; if( m_connected ) { @@ -896,7 +896,7 @@ NjbMediaDevice::customClicked() "%n tracks found on device ", trackList.size() ); powerStatus = ( (NJB_Get_Auxpower( m_njb ) == 1) ? i18n("On auxiliary power") : i18n("On main power") ); batteryCharging = ( (NJB_Get_Battery_Charging( m_njb ) == 1) ? i18n("Battery charging") : i18n("Battery not charging") ); - batteryLevel = (i18n("Battery level: ") + QString::number( NJB_Get_Battery_Level( m_njb ) ) ); + batteryLevel = (i18n("Battery level: ") + TQString::number( NJB_Get_Battery_Level( m_njb ) ) ); Information = ( i18n("Player Information for ") + m_name +'\n' + i18n("Power status: ") + powerStatus + '\n' + diff --git a/amarok/src/mediadevice/njb/njbmediadevice.h b/amarok/src/mediadevice/njb/njbmediadevice.h index 277c96cf..ba2a32e8 100644 --- a/amarok/src/mediadevice/njb/njbmediadevice.h +++ b/amarok/src/mediadevice/njb/njbmediadevice.h @@ -29,15 +29,15 @@ #include #include -#include -#include +#include +#include #include "playlist.h" #include "track.h" -#include -#include -#include +#include +#include +#include // kde #include @@ -64,10 +64,10 @@ extern trackValueList* theTracks; class NjbMediaItem : public MediaItem { public: - NjbMediaItem( QListView *parent, QListViewItem *after = 0 ) : MediaItem( parent, after ) + NjbMediaItem( TQListView *parent, TQListViewItem *after = 0 ) : MediaItem( parent, after ) {} - NjbMediaItem( QListViewItem *parent, QListViewItem *after = 0 ) : MediaItem( parent, after ) + NjbMediaItem( TQListViewItem *parent, TQListViewItem *after = 0 ) : MediaItem( parent, after ) {} ~NjbMediaItem() @@ -77,7 +77,7 @@ class NjbMediaItem : public MediaItem void setTrack( NjbTrack *track ) { m_track = track; m_track->addItem(this); } NjbTrack *track() { return m_track; } - QString filename() { return m_track->bundle()->url().path(); } + TQString filename() { return m_track->bundle()->url().path(); } private: NjbTrack *m_track; }; @@ -97,30 +97,30 @@ class NjbMediaDevice : public MediaDevice // virtual bool needsManualConfig(); - virtual MediaItem* newPlaylist(const QString& name, MediaItem* parent, QPtrList< MediaItem > items); + virtual MediaItem* newPlaylist(const TQString& name, MediaItem* parent, TQPtrList< MediaItem > items); // virtual MediaItem* tagsChanged(MediaItem* item, const MetaBundle& changed); - virtual QStringList supportedFiletypes(); + virtual TQStringList supportedFiletypes(); virtual bool hasTransferDialog() { return true; } virtual TransferDialog* getTransferDialog(); - virtual void addConfigElements(QWidget* arg1); - virtual void addToDirectory(MediaItem* directory, QPtrList< MediaItem > items) { Q_UNUSED(directory) Q_UNUSED(items) } - virtual void addToPlaylist(MediaItem* playlist, MediaItem* after, QPtrList< MediaItem > items); + virtual void addConfigElements(TQWidget* arg1); + virtual void addToDirectory(MediaItem* directory, TQPtrList< MediaItem > items) { Q_UNUSED(directory) Q_UNUSED(items) } + virtual void addToPlaylist(MediaItem* playlist, MediaItem* after, TQPtrList< MediaItem > items); virtual void applyConfig(); virtual void init(MediaBrowser* parent); virtual void loadConfig(); - virtual void removeConfigElements(QWidget* arg1); - virtual void rmbPressed(QListViewItem* qitem, const QPoint& point, int arg1); + virtual void removeConfigElements(TQWidget* arg1); + virtual void rmbPressed(TQListViewItem* qitem, const TQPoint& point, int arg1); virtual void runTransferDialog(); virtual void customClicked(); - void setDeviceType(const QString& type); + void setDeviceType(const TQString& type); void setSpacesToUnderscores(bool yesno); static njb_t *theNjb(); public slots: - void expandItem( QListViewItem *item ); + void expandItem( TQListViewItem *item ); protected: @@ -159,15 +159,15 @@ class NjbMediaDevice : public MediaDevice void clearItems(); NjbMediaItem *addTrackToView(NjbTrack *track, NjbMediaItem *item=0); - NjbMediaItem* addAlbums( const QString &artist, NjbMediaItem *item ); - NjbMediaItem* addTracks( const QString &artist, const QString &track, NjbMediaItem *item ); + NjbMediaItem* addAlbums( const TQString &artist, NjbMediaItem *item ); + NjbMediaItem* addTracks( const TQString &artist, const TQString &track, NjbMediaItem *item ); NjbMediaItem* addTrack( NjbTrack *track ); NjbMediaItem* addArtist( NjbTrack *track ); TransferDialog *m_td; - QListView *listAmarokPlayLists; - QString devNode; - QString m_errMsg; + TQListView *listAmarokPlayLists; + TQString devNode; + TQString m_errMsg; bool m_connected; // Replaces m_captured from the original code. njb_t njbs[NJB_MAX_DEVICES]; @@ -177,7 +177,7 @@ class NjbMediaDevice : public MediaDevice int m_libcount; bool m_busy; unsigned m_progressStart; - QString m_progressMessage; + TQString m_progressMessage; NjbMediaItem *m_artistItem; NjbMediaItem *m_albumItem; NjbMediaItem *m_allTracksItem; diff --git a/amarok/src/mediadevice/njb/playlist.cpp b/amarok/src/mediadevice/njb/playlist.cpp index dd2cd3bb..d679ce06 100644 --- a/amarok/src/mediadevice/njb/playlist.cpp +++ b/amarok/src/mediadevice/njb/playlist.cpp @@ -113,9 +113,9 @@ NjbPlaylist::setPlaylist( njb_playlist_t* _newlist ) } QString -NjbPlaylist::unescapefilename( const QString& _in ) +NjbPlaylist::unescapefilename( const TQString& _in ) { - QString result = _in; + TQString result = _in; result.replace("%2f","/"); @@ -123,9 +123,9 @@ NjbPlaylist::unescapefilename( const QString& _in ) } QString -NjbPlaylist::escapefilename( const QString& _in ) +NjbPlaylist::escapefilename( const TQString& _in ) { - QString result = _in; + TQString result = _in; result.replace("/","%2f"); @@ -133,9 +133,9 @@ NjbPlaylist::escapefilename( const QString& _in ) } int -NjbPlaylist::setName( const QString& fileName) +NjbPlaylist::setName( const TQString& fileName) { - QString playlistName = fileName; + TQString playlistName = fileName; if( fileName.right( 4) == ".m3u") playlistName.truncate( playlistName.length() - 4); @@ -176,7 +176,7 @@ NjbPlaylist::setName( const QString& fileName) int -NjbPlaylist::addTrack( const QString& fileName) +NjbPlaylist::addTrack( const TQString& fileName) { debug() << __PRETTY_FUNCTION__ << " filename=" << fileName << endl; /* @@ -243,7 +243,7 @@ NjbPlaylist::update( void) QStringList NjbPlaylist::trackNames( void ) const { - QStringList result; + TQStringList result; /* // find tracks in trackList by their ID MetaBundle bundle; @@ -263,7 +263,7 @@ NjbPlaylist::trackNames( void ) const } bool -NjbPlaylist::operator==(const QString& name) const +NjbPlaylist::operator==(const TQString& name) const { return escapefilename(m_playlist->name) == name; } diff --git a/amarok/src/mediadevice/njb/playlist.h b/amarok/src/mediadevice/njb/playlist.h index d419cb60..4a9d6da8 100644 --- a/amarok/src/mediadevice/njb/playlist.h +++ b/amarok/src/mediadevice/njb/playlist.h @@ -23,7 +23,7 @@ #include // Qt -#include +#include class NjbPlaylist { @@ -33,14 +33,14 @@ class NjbPlaylist { NjbPlaylist(const NjbPlaylist& _copy); ~NjbPlaylist( void); - QStringList trackNames( void) const; + TQStringList trackNames( void) const; void operator=(const NjbPlaylist& _copy); - bool operator==(const QString& name) const; + bool operator==(const TQString& name) const; bool operator==(const NjbPlaylist& rval) const; - QString getName(void) const; + TQString getName(void) const; - int setName( const QString& fileName); - int addTrack( const QString& fileName); + int setName( const TQString& fileName); + int addTrack( const TQString& fileName); int update( void); u_int32_t getId(void) const { return m_playlist->plid; } @@ -48,14 +48,14 @@ class NjbPlaylist { protected: void setPlaylist( njb_playlist_t* _newlist ); - static QString unescapefilename( const QString& ); - static QString escapefilename( const QString& ); + static TQString unescapefilename( const TQString& ); + static TQString escapefilename( const TQString& ); private: njb_playlist_t* m_playlist; }; -class playlistValueList: public QValueList +class playlistValueList: public TQValueList { public: int readFromDevice( void); diff --git a/amarok/src/mediadevice/njb/track.cpp b/amarok/src/mediadevice/njb/track.cpp index e1545516..24a24534 100644 --- a/amarok/src/mediadevice/njb/track.cpp +++ b/amarok/src/mediadevice/njb/track.cpp @@ -23,8 +23,8 @@ static const char* rcsid __attribute__((unused)) = #include "track.h" #include "njbmediadevice.h" -#include -#include +#include +#include #include @@ -64,8 +64,8 @@ NjbTrack::NjbTrack( njb_songid_t* song) frame = NJB_Songid_Findframe( song, FR_ARTIST ); if( frame ) { - QString artist = QString::fromUtf8( frame->data.strval ); - artist.replace( QRegExp( "/" ), "-" ); + TQString artist = TQString::fromUtf8( frame->data.strval ); + artist.replace( TQRegExp( "/" ), "-" ); bundle->setArtist( artist ); } else @@ -74,8 +74,8 @@ NjbTrack::NjbTrack( njb_songid_t* song) frame = NJB_Songid_Findframe( song, FR_ALBUM ); if( frame) { - QString album = QString::fromUtf8( frame->data.strval ); - album.replace( QRegExp( "/" ), "-" ); + TQString album = TQString::fromUtf8( frame->data.strval ); + album.replace( TQRegExp( "/" ), "-" ); bundle->setAlbum( album ); } else @@ -84,8 +84,8 @@ NjbTrack::NjbTrack( njb_songid_t* song) frame = NJB_Songid_Findframe( song, FR_TITLE); if( frame ) { - QString title = QString::fromUtf8( frame->data.strval ); - title.replace( QRegExp( "/"), "-"); + TQString title = TQString::fromUtf8( frame->data.strval ); + title.replace( TQRegExp( "/"), "-"); bundle->setTitle( title ); } else @@ -103,18 +103,18 @@ NjbTrack::NjbTrack( njb_songid_t* song) bundle->setTrack( frame->data.u_int32_val ); break; case NJB_TYPE_STRING: - bundle->setTrack( QString::fromUtf8(frame->data.strval).toUInt() ); + bundle->setTrack( TQString::fromUtf8(frame->data.strval).toUInt() ); break; default: bundle->setTrack( 0 ); } } - QString codec; + TQString codec; frame = NJB_Songid_Findframe( song, FR_CODEC); if( frame ) { - codec = QCString( frame->data.strval).lower(); + codec = TQCString( frame->data.strval).lower(); if( codec == "mp3" ) bundle->setFileType( MetaBundle::mp3 ); else if (codec == "wma" ) @@ -129,11 +129,11 @@ NjbTrack::NjbTrack( njb_songid_t* song) } frame = NJB_Songid_Findframe( song, FR_FNAME ); - QString filename; + TQString filename; if( frame ) { //bundle->setUrl( KURL( frame->data.strval ) ); - filename = QString::fromUtf8( frame->data.strval ); + filename = TQString::fromUtf8( frame->data.strval ); } if( filename.isEmpty() ) @@ -156,7 +156,7 @@ NjbTrack::NjbTrack( njb_songid_t* song) bundle->setYear( frame->data.u_int32_val ); break; case NJB_TYPE_STRING: - bundle->setYear( QString::fromUtf8( frame->data.strval ).toInt() ); + bundle->setYear( TQString::fromUtf8( frame->data.strval ).toInt() ); break; default: bundle->setYear( 0 ); @@ -228,7 +228,7 @@ NjbTrack::removeItem( const NjbMediaItem *item ) /* ------------------------------------------------------------------------ */ trackValueList::iterator -trackValueList::findTrackByName( const QString& _filename ) +trackValueList::findTrackByName( const TQString& _filename ) { trackValueList::iterator it; for( it = begin(); it != end(); it++) diff --git a/amarok/src/mediadevice/njb/track.h b/amarok/src/mediadevice/njb/track.h index fc6db0d9..1046375a 100644 --- a/amarok/src/mediadevice/njb/track.h +++ b/amarok/src/mediadevice/njb/track.h @@ -21,7 +21,7 @@ // qt -#include +#include // libnjb #include @@ -55,14 +55,14 @@ class NjbTrack { private: unsigned int m_id; MetaBundle m_bundle; - QPtrList ItemList; + TQPtrList ItemList; }; -class trackValueList: public QValueList +class trackValueList: public TQValueList { public: - trackValueList::iterator findTrackByName( const QString& ); - trackValueList::const_iterator findTrackByName( const QString& ) const; + trackValueList::iterator findTrackByName( const TQString& ); + trackValueList::const_iterator findTrackByName( const TQString& ) const; trackValueList::iterator findTrackById( unsigned ); trackValueList::const_iterator findTrackById( unsigned ) const; diff --git a/amarok/src/mediadevice/riokarma/riokarmamediadevice.cpp b/amarok/src/mediadevice/riokarma/riokarmamediadevice.cpp index 361da74c..c0556612 100644 --- a/amarok/src/mediadevice/riokarma/riokarmamediadevice.cpp +++ b/amarok/src/mediadevice/riokarma/riokarmamediadevice.cpp @@ -36,9 +36,9 @@ AMAROK_EXPORT_PLUGIN( RioKarmaMediaDevice ) #include // Qt -#include -#include -#include +#include +#include +#include /** @@ -77,7 +77,7 @@ RioKarmaMediaDevice::isConnected() QStringList RioKarmaMediaDevice::supportedFiletypes() { - QStringList supportedFiles; + TQStringList supportedFiles; supportedFiles << "mp3"; supportedFiles << "ogg"; supportedFiles << "wma"; @@ -93,7 +93,7 @@ MediaItem { DEBUG_BLOCK - QString genericError = i18n( "Could not send track" ); + TQString genericError = i18n( "Could not send track" ); if( m_fileNameToItem[ bundle.filename() ] != 0 ) { @@ -165,7 +165,7 @@ MediaItem * @note Playlists not implemented yet... :-) */ RioKarmaMediaItem -*RioKarmaMediaDevice::newPlaylist( const QString &name, MediaItem *parent, QPtrList items ) +*RioKarmaMediaDevice::newPlaylist( const TQString &name, MediaItem *parent, TQPtrList items ) { Q_UNUSED( name ); Q_UNUSED( parent ); @@ -178,7 +178,7 @@ RioKarmaMediaItem * @note Playlists not implemented yet... :-) */ void -RioKarmaMediaDevice::addToPlaylist( MediaItem *mlist, MediaItem *after, QPtrList items ) +RioKarmaMediaDevice::addToPlaylist( MediaItem *mlist, MediaItem *after, TQPtrList items ) { Q_UNUSED( mlist ); Q_UNUSED( after ); @@ -284,7 +284,7 @@ RioKarmaMediaDevice::openDevice( bool silent ) Q_UNUSED( silent ); - QDir dir( mountPoint() ); + TQDir dir( mountPoint() ); if( !dir.exists() ) { Amarok::StatusBar::instance()->longMessage( @@ -296,7 +296,7 @@ RioKarmaMediaDevice::openDevice( bool silent ) if( m_rio >= 0 ) return true; - QString genericError = i18n( "Could not connect to Rio Karma" ); + TQString genericError = i18n( "Could not connect to Rio Karma" ); char *mount = qstrdup( mountPoint().utf8() ); m_rio = lk_karma_connect( mount ); @@ -382,7 +382,7 @@ RioKarmaMediaDevice::setDisconnected() * Handle clicking of the right mouse button */ void -RioKarmaMediaDevice::rmbPressed( QListViewItem *qitem, const QPoint &point, int ) +RioKarmaMediaDevice::rmbPressed( TQListViewItem *qitem, const TQPoint &point, int ) { enum Actions {DELETE}; @@ -411,7 +411,7 @@ RioKarmaMediaDevice::rmbPressed( QListViewItem *qitem, const QPoint &point, int RioKarmaMediaItem *RioKarmaMediaDevice::addTrackToView( RioKarmaTrack *track, RioKarmaMediaItem *item ) { - QString artistName = track->bundle()->artist(); + TQString artistName = track->bundle()->artist(); RioKarmaMediaItem *artist = dynamic_cast( m_view->findItem( artistName, 0 ) ); if( !artist ) @@ -422,7 +422,7 @@ RioKarmaMediaItem artist->setType( MediaItem::ARTIST ); } - QString albumName = track->bundle()->album(); + TQString albumName = track->bundle()->album(); RioKarmaMediaItem *album = dynamic_cast( artist->findItem( albumName ) ); if( !album ) { @@ -438,7 +438,7 @@ RioKarmaMediaItem { item = new RioKarmaMediaItem( album ); item->m_device = this; - QString titleName = track->bundle()->title(); + TQString titleName = track->bundle()->title(); item->setTrack( track ); item->m_order = track->bundle()->track(); item->setText( 0, titleName ); @@ -462,7 +462,7 @@ RioKarmaMediaDevice::readKarmaMusic() clearItems(); - QString genericError = i18n( "Could not get music from Rio Karma" ); + TQString genericError = i18n( "Could not get music from Rio Karma" ); int total = 100; int progress = 0; @@ -556,13 +556,13 @@ RioKarmaTrack::readMetaData() { MetaBundle *bundle = new MetaBundle(); - bundle->setGenre( AtomicString( QString::fromUtf8( lk_properties_get_property( m_id, "genre" ) ) ) ); - bundle->setArtist( AtomicString( QString::fromUtf8( lk_properties_get_property( m_id, "artist" ) ) ) ); - bundle->setAlbum( AtomicString( QString::fromUtf8( lk_properties_get_property( m_id, "source" ) ) ) ); - bundle->setTitle( AtomicString( QString::fromUtf8( lk_properties_get_property( m_id, "title" ) ) ) ); + bundle->setGenre( AtomicString( TQString::fromUtf8( lk_properties_get_property( m_id, "genre" ) ) ) ); + bundle->setArtist( AtomicString( TQString::fromUtf8( lk_properties_get_property( m_id, "artist" ) ) ) ); + bundle->setAlbum( AtomicString( TQString::fromUtf8( lk_properties_get_property( m_id, "source" ) ) ) ); + bundle->setTitle( AtomicString( TQString::fromUtf8( lk_properties_get_property( m_id, "title" ) ) ) ); // translate codecs to file types - QString codec = QCString( lk_properties_get_property( m_id, "codec" ) ); + TQString codec = TQCString( lk_properties_get_property( m_id, "codec" ) ); if( codec == "mp3" ) bundle->setFileType( MetaBundle::mp3 ); else if( codec == "wma" ) @@ -574,9 +574,9 @@ RioKarmaTrack::readMetaData() else bundle->setFileType( MetaBundle::other ); - bundle->setYear( QString( lk_properties_get_property( m_id, "year" ) ).toUInt() ); - bundle->setTrack( QString( lk_properties_get_property( m_id, "tracknr" ) ).toUInt() ); - bundle->setLength( QString( lk_properties_get_property( m_id, "duration" ) ).toUInt() ); + bundle->setYear( TQString( lk_properties_get_property( m_id, "year" ) ).toUInt() ); + bundle->setTrack( TQString( lk_properties_get_property( m_id, "tracknr" ) ).toUInt() ); + bundle->setLength( TQString( lk_properties_get_property( m_id, "duration" ) ).toUInt() ); this->setBundle( *bundle ); } diff --git a/amarok/src/mediadevice/riokarma/riokarmamediadevice.h b/amarok/src/mediadevice/riokarma/riokarmamediadevice.h index 237ab84e..42669448 100644 --- a/amarok/src/mediadevice/riokarma/riokarmamediadevice.h +++ b/amarok/src/mediadevice/riokarma/riokarmamediadevice.h @@ -22,8 +22,8 @@ #include "mediabrowser.h" -#include -#include +#include +#include #include "libkarma/lkarma.h" @@ -48,16 +48,16 @@ class RioKarmaTrack { private: unsigned int m_id; MetaBundle m_bundle; - QPtrList m_itemList; + TQPtrList m_itemList; }; class RioKarmaMediaItem : public MediaItem { public: - RioKarmaMediaItem( QListView *parent, QListViewItem *after = 0 ) : MediaItem( parent, after ) + RioKarmaMediaItem( TQListView *parent, TQListViewItem *after = 0 ) : MediaItem( parent, after ) {} - RioKarmaMediaItem( QListViewItem *parent, QListViewItem *after = 0 ) : MediaItem( parent, after ) + RioKarmaMediaItem( TQListViewItem *parent, TQListViewItem *after = 0 ) : MediaItem( parent, after ) {} ~RioKarmaMediaItem() { @@ -65,7 +65,7 @@ class RioKarmaMediaItem : public MediaItem } void setTrack( RioKarmaTrack *track ) { m_track = track; m_track->addItem( this ); } RioKarmaTrack *track() { return m_track; } - QString filename() { return m_track->bundle()->url().path(); } + TQString filename() { return m_track->bundle()->url().path(); } private: RioKarmaTrack *m_track; }; @@ -81,9 +81,9 @@ class RioKarmaMediaDevice : public MediaDevice bool isConnected(); int current_id(); void setDisconnected(); - virtual void rmbPressed( QListViewItem *qitem, const QPoint &point, int arg1 ); + virtual void rmbPressed( TQListViewItem *qitem, const TQPoint &point, int arg1 ); virtual void init( MediaBrowser *parent ); - virtual QStringList supportedFiletypes(); + virtual TQStringList supportedFiletypes(); protected: MediaItem* trackExists( const MetaBundle &bundle ); @@ -97,8 +97,8 @@ class RioKarmaMediaDevice : public MediaDevice void synchronizeDevice(); int deleteItemFromDevice( MediaItem *item, int flags=DeleteTrack ); - void addToPlaylist( MediaItem *list, MediaItem *after, QPtrList items ); - RioKarmaMediaItem *newPlaylist( const QString &name, MediaItem *list, QPtrList items ); + void addToPlaylist( MediaItem *list, MediaItem *after, TQPtrList items ); + RioKarmaMediaItem *newPlaylist( const TQString &name, MediaItem *list, TQPtrList items ); bool getCapacity( KIO::filesize_t *total, KIO::filesize_t *available ); virtual void updateRootItems() {}; @@ -108,8 +108,8 @@ class RioKarmaMediaDevice : public MediaDevice void clearItems(); int deleteRioTrack( RioKarmaMediaItem *trackItem ); int m_rio; - QMutex m_mutex; - QMap m_fileNameToItem; + TQMutex m_mutex; + TQMap m_fileNameToItem; }; diff --git a/amarok/src/mediadevicemanager.cpp b/amarok/src/mediadevicemanager.cpp index 21bfb79a..48bfbb06 100644 --- a/amarok/src/mediadevicemanager.cpp +++ b/amarok/src/mediadevicemanager.cpp @@ -18,8 +18,8 @@ #include "mediadevicemanager.h" #include "medium.h" -#include -#include +#include +#include #include #include @@ -36,9 +36,9 @@ MediaDeviceManager* MediaDeviceManager::instance() MediaDeviceManager::MediaDeviceManager() { DEBUG_BLOCK - connect( DeviceManager::instance(), SIGNAL( mediumAdded( const Medium*, QString ) ), SLOT( slotMediumAdded( const Medium*, QString ) ) ); - connect( DeviceManager::instance(), SIGNAL( mediumChanged( const Medium*, QString ) ), SLOT( slotMediumChanged( const Medium*, QString ) ) ); - connect( DeviceManager::instance(), SIGNAL( mediumRemoved( const Medium*, QString ) ), SLOT( slotMediumRemoved( const Medium*, QString ) ) ); + connect( DeviceManager::instance(), TQT_SIGNAL( mediumAdded( const Medium*, TQString ) ), TQT_SLOT( slotMediumAdded( const Medium*, TQString ) ) ); + connect( DeviceManager::instance(), TQT_SIGNAL( mediumChanged( const Medium*, TQString ) ), TQT_SLOT( slotMediumChanged( const Medium*, TQString ) ) ); + connect( DeviceManager::instance(), TQT_SIGNAL( mediumRemoved( const Medium*, TQString ) ), TQT_SLOT( slotMediumRemoved( const Medium*, TQString ) ) ); Medium::List mediums = DeviceManager::instance()->getDeviceList(); foreachType( Medium::List, mediums ) { @@ -47,14 +47,14 @@ MediaDeviceManager::MediaDeviceManager() if( !mediums.count() ) { debug() << "DeviceManager didn't return any devices, we are probably running on a non-KDE system. Trying to reinit media devices later" << endl; - QTimer::singleShot( 4000, this, SLOT( reinitDevices() ) ); + TQTimer::singleShot( 4000, this, TQT_SLOT( reinitDevices() ) ); } //load manual devices - QStringList manualDevices; + TQStringList manualDevices; KConfig *config = Amarok::config( "MediaBrowser" ); - QMap savedDevices = config->entryMap( "MediaBrowser" ); - QMap::Iterator qit; - QString curr, currMountPoint, currName; + TQMap savedDevices = config->entryMap( "MediaBrowser" ); + TQMap::Iterator qit; + TQString curr, currMountPoint, currName; for( qit = savedDevices.begin(); qit != savedDevices.end(); ++qit ) { //only handle manual devices, autodetected devices should be added on the fly @@ -68,17 +68,17 @@ MediaDeviceManager::MediaDeviceManager() manualDevices.append( qit.key() ); //id manualDevices.append( currName ); //name manualDevices.append( currName ); //label - manualDevices.append( QString::null ); //userLabel + manualDevices.append( TQString::null ); //userLabel manualDevices.append( "unknown" ); //mountable? - manualDevices.append( QString::null ); //device node + manualDevices.append( TQString::null ); //device node manualDevices.append( currMountPoint ); //mountPoint manualDevices.append( "manual" ); //fsType manualDevices.append( "unknown" ); //mounted - manualDevices.append( QString::null ); //baseURL - manualDevices.append( QString::null ); //MIMEtype - manualDevices.append( QString::null ); //iconName + manualDevices.append( TQString::null ); //baseURL + manualDevices.append( TQString::null ); //MIMEtype + manualDevices.append( TQString::null ); //iconName manualDevices.append( "false" ); //encrypted - manualDevices.append( QString::null ); //clearDeviceUdi + manualDevices.append( TQString::null ); //clearDeviceUdi manualDevices.append( "---" ); //separator } } @@ -109,7 +109,7 @@ MediaDeviceManager::removeManualDevice( Medium* removed ) m_mediumMap.remove( removed->name() ); } -void MediaDeviceManager::slotMediumAdded( const Medium *m, QString id) +void MediaDeviceManager::slotMediumAdded( const Medium *m, TQString id) { DEBUG_BLOCK if ( m ) @@ -131,13 +131,13 @@ void MediaDeviceManager::slotMediumAdded( const Medium *m, QString id) } } -void MediaDeviceManager::slotMediumChanged( const Medium *m, QString id ) +void MediaDeviceManager::slotMediumChanged( const Medium *m, TQString id ) { //nothing to do here emit mediumChanged( m, id); } -void MediaDeviceManager::slotMediumRemoved( const Medium* , QString id ) +void MediaDeviceManager::slotMediumRemoved( const Medium* , TQString id ) { DEBUG_BLOCK Medium* removedMedium = 0; @@ -157,7 +157,7 @@ void MediaDeviceManager::slotMediumRemoved( const Medium* , QString id ) delete removedMedium; } -Medium* MediaDeviceManager::getDevice( QString name ) +Medium* MediaDeviceManager::getDevice( TQString name ) { return DeviceManager::instance()->getDevice( name ); } diff --git a/amarok/src/mediadevicemanager.h b/amarok/src/mediadevicemanager.h index 4915b898..507ce7cb 100644 --- a/amarok/src/mediadevicemanager.h +++ b/amarok/src/mediadevicemanager.h @@ -17,11 +17,11 @@ #include "medium.h" -#include +#include #include -typedef QMap MediumMap; +typedef TQMap MediumMap; class MediaDeviceManager : public QObject { @@ -36,7 +36,7 @@ class MediaDeviceManager : public QObject ~MediaDeviceManager(); static MediaDeviceManager *instance(); - Medium* getDevice( QString name ); + Medium* getDevice( TQString name ); MediumMap getMediumMap() { return m_mediumMap; } void addManualDevice( Medium* added ); @@ -44,14 +44,14 @@ class MediaDeviceManager : public QObject signals: - void mediumAdded( const Medium*, QString ); - void mediumChanged( const Medium*, QString ); - void mediumRemoved( const Medium*, QString ); + void mediumAdded( const Medium*, TQString ); + void mediumChanged( const Medium*, TQString ); + void mediumRemoved( const Medium*, TQString ); public slots: - void slotMediumAdded( const Medium*, QString ); - void slotMediumChanged( const Medium*, QString ); - void slotMediumRemoved( const Medium*, QString ); + void slotMediumAdded( const Medium*, TQString ); + void slotMediumChanged( const Medium*, TQString ); + void slotMediumRemoved( const Medium*, TQString ); private slots: void reinitDevices(); diff --git a/amarok/src/medium.cpp b/amarok/src/medium.cpp index cafb9b98..b69a2eb6 100644 --- a/amarok/src/medium.cpp +++ b/amarok/src/medium.cpp @@ -22,26 +22,26 @@ #include #include -const QString Medium::SEPARATOR = "---"; +const TQString Medium::SEPARATOR = "---"; -Medium::Medium(const QString &id, const QString &name) +Medium::Medium(const TQString &id, const TQString &name) { m_properties+= "false"; /* AUTODETECTED */ m_properties+= id; /* ID */ m_properties+= name; /* NAME */ m_properties+= name; /* LABEL */ - m_properties+= QString::null; /* USER_LABEL */ + m_properties+= TQString::null; /* USER_LABEL */ m_properties+= "false"; /* MOUNTABLE */ - m_properties+= QString::null; /* DEVICE_NODE */ - m_properties+= QString::null; /* MOUNT_POINT */ - m_properties+= QString::null; /* FS_TYPE */ + m_properties+= TQString::null; /* DEVICE_NODE */ + m_properties+= TQString::null; /* MOUNT_POINT */ + m_properties+= TQString::null; /* FS_TYPE */ m_properties+= "false"; /* MOUNTED */ - m_properties+= QString::null; /* BASE_URL */ - m_properties+= QString::null; /* MIME_TYPE */ - m_properties+= QString::null; /* ICON_NAME */ + m_properties+= TQString::null; /* BASE_URL */ + m_properties+= TQString::null; /* MIME_TYPE */ + m_properties+= TQString::null; /* ICON_NAME */ m_properties+= "false"; /* ENCRYPTED */ - m_properties+= QString::null; /* CLEAR_DEVICE_UDI */ + m_properties+= TQString::null; /* CLEAR_DEVICE_UDI */ loadUserLabel(); } @@ -66,25 +66,25 @@ Medium::Medium(const Medium *medium) Medium::Medium() { - m_properties+= QString::null; /* AUTODETECTED */ - m_properties+= QString::null; /* ID */ - m_properties+= QString::null; /* NAME */ - m_properties+= QString::null; /* LABEL */ - m_properties+= QString::null; /* USER_LABEL */ - - m_properties+= QString::null; /* MOUNTABLE */ - m_properties+= QString::null; /* DEVICE_NODE */ - m_properties+= QString::null; /* MOUNT_POINT */ - m_properties+= QString::null; /* FS_TYPE */ - m_properties+= QString::null; /* MOUNTED */ - m_properties+= QString::null; /* BASE_URL */ - m_properties+= QString::null; /* MIME_TYPE */ - m_properties+= QString::null; /* ICON_NAME */ - m_properties+= QString::null; /* ENCRYPTED */ - m_properties+= QString::null; /* CLEAR_DEVICE_UDI */ + m_properties+= TQString::null; /* AUTODETECTED */ + m_properties+= TQString::null; /* ID */ + m_properties+= TQString::null; /* NAME */ + m_properties+= TQString::null; /* LABEL */ + m_properties+= TQString::null; /* USER_LABEL */ + + m_properties+= TQString::null; /* MOUNTABLE */ + m_properties+= TQString::null; /* DEVICE_NODE */ + m_properties+= TQString::null; /* MOUNT_POINT */ + m_properties+= TQString::null; /* FS_TYPE */ + m_properties+= TQString::null; /* MOUNTED */ + m_properties+= TQString::null; /* BASE_URL */ + m_properties+= TQString::null; /* MIME_TYPE */ + m_properties+= TQString::null; /* ICON_NAME */ + m_properties+= TQString::null; /* ENCRYPTED */ + m_properties+= TQString::null; /* CLEAR_DEVICE_UDI */ } -const Medium Medium::create(const QStringList &properties) +const Medium Medium::create(const TQStringList &properties) { Medium m; @@ -111,22 +111,22 @@ const Medium Medium::create(const QStringList &properties) return m; } -Medium::List Medium::createList(const QStringList &properties) +Medium::List Medium::createList(const TQStringList &properties) { List l; if ( properties.size() % (PROPERTIES_COUNT+1) == 0 ) { int media_count = properties.size()/(PROPERTIES_COUNT+1); - QStringList props = properties; + TQStringList props = properties; for(int i=0; i -#include +#include +#include #include class LIBAMAROK_EXPORT Medium { public: - typedef QValueList List; + typedef TQValueList List; static const uint AUTODETECTED = 0; static const uint ID = 1; @@ -46,59 +46,59 @@ public: static const uint ENCRYPTED = 13; static const uint CLEAR_DEVICE_UDI = 14; static const uint PROPERTIES_COUNT = 15; - static const QString SEPARATOR; + static const TQString SEPARATOR; Medium(); Medium(const Medium *medium); - Medium(const QString &id, const QString &name); - static const Medium create(const QStringList &properties); - static List createList(const QStringList &properties); + Medium(const TQString &id, const TQString &name); + static const Medium create(const TQStringList &properties); + static List createList(const TQStringList &properties); - const QStringList &properties() const { return m_properties; }; + const TQStringList &properties() const { return m_properties; }; bool isAutodetected() const { return m_properties[AUTODETECTED]=="true"; }; - QString id() const { return m_properties[ID]; }; - QString name() const { return m_properties[NAME]; }; - QString label() const { return m_properties[LABEL]; }; - QString userLabel() const { return m_properties[USER_LABEL]; }; + TQString id() const { return m_properties[ID]; }; + TQString name() const { return m_properties[NAME]; }; + TQString label() const { return m_properties[LABEL]; }; + TQString userLabel() const { return m_properties[USER_LABEL]; }; bool isMountable() const { return m_properties[MOUNTABLE]=="true"; }; - QString deviceNode() const { return m_properties[DEVICE_NODE]; }; - QString mountPoint() const { return m_properties[MOUNT_POINT]; }; - QString fsType() const { return m_properties[FS_TYPE]; }; + TQString deviceNode() const { return m_properties[DEVICE_NODE]; }; + TQString mountPoint() const { return m_properties[MOUNT_POINT]; }; + TQString fsType() const { return m_properties[FS_TYPE]; }; bool isMounted() const { return m_properties[MOUNTED]=="true"; }; - QString baseURL() const { return m_properties[BASE_URL]; }; - QString mimeType() const { return m_properties[MIME_TYPE]; }; - QString iconName() const { return m_properties[ICON_NAME]; }; + TQString baseURL() const { return m_properties[BASE_URL]; }; + TQString mimeType() const { return m_properties[MIME_TYPE]; }; + TQString iconName() const { return m_properties[ICON_NAME]; }; bool isEncrypted() const { return m_properties[ENCRYPTED]=="true"; }; - QString clearDeviceUdi() const { return m_properties[CLEAR_DEVICE_UDI]; }; + TQString clearDeviceUdi() const { return m_properties[CLEAR_DEVICE_UDI]; }; bool needMounting() const; KURL prettyBaseURL() const; - QString prettyLabel() const; + TQString prettyLabel() const; void setAutodetected(bool autodetected); - void setId(const QString &id); - void setMountPoint(const QString &mountPoint); - void setName(const QString &name); - void setLabel(const QString &label); - void setUserLabel(const QString &label); - void setFsType(const QString &type); + void setId(const TQString &id); + void setMountPoint(const TQString &mountPoint); + void setName(const TQString &name); + void setLabel(const TQString &label); + void setUserLabel(const TQString &label); + void setFsType(const TQString &type); bool mountableState(bool mounted); - void mountableState(const QString &deviceNode, - const QString &mountPoint, - const QString &fsType, bool mounted); - void unmountableState(const QString &baseURL = QString::null); + void mountableState(const TQString &deviceNode, + const TQString &mountPoint, + const TQString &fsType, bool mounted); + void unmountableState(const TQString &baseURL = TQString::null); - void setMimeType(const QString &mimeType); - void setIconName(const QString &iconName); + void setMimeType(const TQString &mimeType); + void setIconName(const TQString &iconName); private: void loadUserLabel(); - QStringList m_properties; + TQStringList m_properties; -friend class QValueListNode; +friend class TQValueListNode; }; #endif diff --git a/amarok/src/mediumpluginmanager.cpp b/amarok/src/mediumpluginmanager.cpp index 0e427121..5d167acf 100644 --- a/amarok/src/mediumpluginmanager.cpp +++ b/amarok/src/mediumpluginmanager.cpp @@ -23,12 +23,12 @@ #include "pluginmanager.h" #include "statusbar.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -42,33 +42,33 @@ using Amarok::escapeHTML; using Amarok::escapeHTMLAttr; -typedef QMap MediumMap; +typedef TQMap MediumMap; MediumPluginManagerDialog::MediumPluginManagerDialog() - : KDialogBase( Amarok::mainWindow(), "mediumpluginmanagerdialog", false, QString::null, Ok|Cancel, Ok ) + : KDialogBase( Amarok::mainWindow(), "mediumpluginmanagerdialog", false, TQString::null, Ok|Cancel, Ok ) { kapp->setTopWidget( this ); setCaption( kapp->makeStdCaption( i18n( "Manage Devices and Plugins" ) ) ); - QVBox* vbox = makeVBoxMainWidget(); + TQVBox* vbox = makeVBoxMainWidget(); vbox->setSpacing( KDialog::spacingHint() ); - vbox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); + vbox->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ) ); - m_location = new QGroupBox( 1, Qt::Vertical, i18n( "Devices" ), vbox ); - m_location->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) ); - m_devicesBox = new QVBox( m_location ); - m_devicesBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); + m_location = new TQGroupBox( 1, Qt::Vertical, i18n( "Devices" ), vbox ); + m_location->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Preferred ) ); + m_devicesBox = new TQVBox( m_location ); + m_devicesBox->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ) ); m_manager = new MediumPluginManager( m_devicesBox ); - QHBox *hbox = new QHBox( vbox ); + TQHBox *hbox = new TQHBox( vbox ); KPushButton *detectDevices = new KPushButton( i18n( "Autodetect Devices" ), hbox); - detectDevices->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - connect( detectDevices, SIGNAL( clicked() ), m_manager, SLOT( redetectDevices() ) ); + detectDevices->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ) ); + connect( detectDevices, TQT_SIGNAL( clicked() ), m_manager, TQT_SLOT( redetectDevices() ) ); KPushButton *addButton = new KPushButton( i18n( "Add Device..." ), hbox ); - addButton->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - connect( addButton, SIGNAL( clicked() ), m_manager, SLOT( newDevice() ) ); + addButton->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ) ); + connect( addButton, TQT_SIGNAL( clicked() ), m_manager, TQT_SLOT( newDevice() ) ); } MediumPluginManagerDialog::~MediumPluginManagerDialog() @@ -83,12 +83,12 @@ MediumPluginManagerDialog::slotOk() KDialogBase::slotOk(); } -MediumPluginManager::MediumPluginManager( QWidget *widget, const bool nographics ) +MediumPluginManager::MediumPluginManager( TQWidget *widget, const bool nographics ) : m_widget( widget ) { detectDevices( false, nographics ); - connect( this, SIGNAL( selectedPlugin( const Medium*, const QString ) ), MediaBrowser::instance(), SLOT( pluginSelected( const Medium*, const QString ) ) ); + connect( this, TQT_SIGNAL( selectedPlugin( const Medium*, const TQString ) ), MediaBrowser::instance(), TQT_SLOT( pluginSelected( const Medium*, const TQString ) ) ); } MediumPluginManager::~MediumPluginManager() @@ -154,7 +154,7 @@ MediumPluginManager::detectDevices( const bool redetect, const bool nographics ) MediaDeviceConfig *dev = new MediaDeviceConfig( *it, this, nographics, m_widget ); m_deviceList.append( dev ); - connect( dev, SIGNAL(deleteMedium(Medium *)), SLOT(deleteMedium(Medium *)) ); + connect( dev, TQT_SIGNAL(deleteMedium(Medium *)), TQT_SLOT(deleteMedium(Medium *)) ); foundNew = true; } @@ -229,7 +229,7 @@ MediumPluginManager::newDevice() { DEBUG_BLOCK ManualDeviceAdder* mda = new ManualDeviceAdder( this ); - if( mda->exec() == QDialog::Accepted && mda->successful() ) + if( mda->exec() == TQDialog::Accepted && mda->successful() ) { if( !Amarok::config( "MediaBrowser" )->readEntry( mda->getMedium()->id() ).isNull() ) { @@ -253,7 +253,7 @@ MediumPluginManager::newDevice() ///////////////////////////////////////////////////////////////////// ManualDeviceAdder::ManualDeviceAdder( MediumPluginManager* mpm ) -: KDialogBase( Amarok::mainWindow(), "manualdeviceadder", true, QString::null, Ok|Cancel, Ok ) +: KDialogBase( Amarok::mainWindow(), "manualdeviceadder", true, TQString::null, Ok|Cancel, Ok ) { m_mpm = mpm; m_successful = false; @@ -262,12 +262,12 @@ ManualDeviceAdder::ManualDeviceAdder( MediumPluginManager* mpm ) kapp->setTopWidget( this ); setCaption( kapp->makeStdCaption( i18n( "Add New Device") ) ); - QHBox* hbox = makeHBoxMainWidget(); + TQHBox* hbox = makeHBoxMainWidget(); hbox->setSpacing( KDialog::spacingHint() ); - QVBox* vbox1 = new QVBox( hbox ); + TQVBox* vbox1 = new TQVBox( hbox ); - new QLabel( i18n( "Select the plugin to use with this device:"), vbox1 ); + new TQLabel( i18n( "Select the plugin to use with this device:"), vbox1 ); m_mdaCombo = new KComboBox( false, vbox1, "m_mdacombo" ); m_mdaCombo->insertItem( i18n( "Do not handle" ) ); for( KTrader::OfferList::ConstIterator it = MediaBrowser::instance()->getPlugins().begin(); @@ -275,23 +275,23 @@ ManualDeviceAdder::ManualDeviceAdder( MediumPluginManager* mpm ) ++it ) m_mdaCombo->insertItem( (*it)->name() ); - new QLabel( "", vbox1 ); - QLabel* nameLabel = new QLabel( vbox1 ); + new TQLabel( "", vbox1 ); + TQLabel* nameLabel = new TQLabel( vbox1 ); nameLabel->setText( i18n( "Enter a &name for this device (required):" ) ); - m_mdaName = new HintLineEdit( QString::null, vbox1); + m_mdaName = new HintLineEdit( TQString::null, vbox1); nameLabel->setBuddy( m_mdaName ); m_mdaName->setHint( i18n( "Example: My_Ipod" ) ); - QToolTip::add( m_mdaName, i18n( "Enter a name for the device. The name must be unique across all devices, including autodetected devices. It must not contain the pipe ( | ) character." ) ); + TQToolTip::add( m_mdaName, i18n( "Enter a name for the device. The name must be unique across all devices, including autodetected devices. It must not contain the pipe ( | ) character." ) ); - new QLabel( "", vbox1 ); - QLabel* mpLabel = new QLabel( vbox1 ); + new TQLabel( "", vbox1 ); + TQLabel* mpLabel = new TQLabel( vbox1 ); mpLabel->setText( i18n( "Enter the &mount point of the device, if applicable:" ) ); - m_mdaMountPoint = new HintLineEdit( QString::null, vbox1); + m_mdaMountPoint = new HintLineEdit( TQString::null, vbox1); mpLabel->setBuddy( m_mdaMountPoint ); m_mdaMountPoint->setHint( i18n( "Example: /mnt/ipod" ) ); - QToolTip::add( m_mdaMountPoint, i18n( "Enter the device's mount point. Some devices (such as iRiver iFP devices) may not have a mount point and this can be ignored. All other devices (iPods, UMS/VFAT devices) should enter the mount point here." ) ); + TQToolTip::add( m_mdaMountPoint, i18n( "Enter the device's mount point. Some devices (such as iRiver iFP devices) may not have a mount point and this can be ignored. All other devices (iPods, UMS/VFAT devices) should enter the mount point here." ) ); - connect( m_mdaCombo, SIGNAL( activated(const QString&) ), this, SLOT( comboChanged(const QString&) ) ); + connect( m_mdaCombo, TQT_SIGNAL( activated(const TQString&) ), this, TQT_SLOT( comboChanged(const TQString&) ) ); } ManualDeviceAdder::~ManualDeviceAdder() @@ -326,7 +326,7 @@ ManualDeviceAdder::slotOk() } void -ManualDeviceAdder::comboChanged( const QString &string ) +ManualDeviceAdder::comboChanged( const TQString &string ) { //best thing to do here would be to find out if the plugin selected //has m_hasMountPoint set to false...but any way to do this @@ -337,7 +337,7 @@ ManualDeviceAdder::comboChanged( const QString &string ) MediaBrowser::instance()->getInternalPluginName( string ) == "njb-mediadevice" ) { m_comboOldText = m_mdaMountPoint->text(); - m_mdaMountPoint->setText( QString::null ); + m_mdaMountPoint->setText( TQString::null ); m_mdaMountPoint->setEnabled(false); } else if( m_mdaMountPoint->isEnabled() == false ) @@ -366,7 +366,7 @@ ManualDeviceAdder::getMedium( bool recreate ) if( m_mdaMountPoint->text().isNull() && m_mdaName->text().isNull() ) return NULL; - QString id = "manual|" + m_mdaName->text() + '|' + + TQString id = "manual|" + m_mdaName->text() + '|' + ( m_mdaMountPoint->text().isNull() || m_mdaMountPoint->isEnabled() == false ? "(null)" : m_mdaMountPoint->text() ); @@ -376,8 +376,8 @@ ManualDeviceAdder::getMedium( bool recreate ) return m_newMed; } -MediaDeviceConfig::MediaDeviceConfig( Medium *medium, MediumPluginManager *mgr, const bool nographics, QWidget *parent, const char *name ) -: QHBox( parent, name ) +MediaDeviceConfig::MediaDeviceConfig( Medium *medium, MediumPluginManager *mgr, const bool nographics, TQWidget *parent, const char *name ) +: TQHBox( parent, name ) , m_manager( mgr ) , m_medium( medium ) , m_configButton( 0 ) @@ -392,12 +392,12 @@ MediaDeviceConfig::MediaDeviceConfig( Medium *medium, MediumPluginManager *mgr, if( !m_oldPlugin.isEmpty() ) m_new = false; - setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); + setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ) ); setSpacing( 5 ); - const QString labelTextNone = i18n( "(none)" ); - QString row = "

"; - QString table; + const TQString labelTextNone = i18n( "(none)" ); + TQString row = ""; + TQString table; table += row.arg( escapeHTML( i18n( "Autodetected:" ) ), escapeHTML( medium->isAutodetected() ? i18n("Yes") : i18n("No") ) ); table += row.arg( escapeHTML( i18n( "ID:" ) ), @@ -415,15 +415,15 @@ MediaDeviceConfig::MediaDeviceConfig( Medium *medium, MediumPluginManager *mgr, table += row.arg( escapeHTML( i18n( "Mime Type:" ) ), escapeHTML( medium->mimeType().isEmpty() ? labelTextNone : medium->mimeType() ) ); - QString title = escapeHTML( i18n( "Device information for %1").arg(medium->name() ) ); - QString details = QString( "%1
" "
\n" - "\n" - "\n" + QString::number(it.data().getTrackNumber()) + " \n" + "\n" + "\n" + TQString::number(it.data().getTrackNumber()) + " \n" "\n" + escapeHTML( it.data().getTitle() ) + "\n" "\n" + i18n(" – ") + @@ -2382,10 +2382,10 @@ void CurrentTrackJob::showCurrentArtistHeader( const MetaBundle ¤tTrack ) } -void CurrentTrackJob::showRelatedArtists( const QString &artist, const QStringList &relArtists ) +void CurrentTrackJob::showRelatedArtists( const TQString &artist, const TQStringList &relArtists ) { // - m_HTMLSource.append( QString( + m_HTMLSource.append( TQString( "
\n" "\n" "\n"+ escapeHTML( values[i + 2] ) + "\n" @@ -2470,16 +2470,16 @@ void CurrentTrackJob::showSuggestedSongs( const QStringList &relArtists ) } void -CurrentTrackJob::showSongsWithLabel( const QString &label ) +CurrentTrackJob::showSongsWithLabel( const TQString &label ) { QueryBuilder qb; - QStringList values; + TQStringList values; qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL ); qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valTitle ); qb.addReturnValue( QueryBuilder::tabArtist, QueryBuilder::valName ); qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valScore ); qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valRating ); - qb.addMatch( QueryBuilder::tabLabels, QueryBuilder::valType, QString::number( CollectionDB::typeUser ) ); + qb.addMatch( QueryBuilder::tabLabels, QueryBuilder::valType, TQString::number( CollectionDB::typeUser ) ); qb.addMatch( QueryBuilder::tabLabels, QueryBuilder::valName, label ); qb.sortByFavorite(); qb.setOptions( QueryBuilder::optRandomize ); @@ -2499,7 +2499,7 @@ CurrentTrackJob::showSongsWithLabel( const QString &label ) for ( uint i = 0; i < values.count(); i += 5 ) m_HTMLSource.append( - "
\n" "\n" "\n"+ escapeHTML( values[i + 2] ) + "\n" @@ -2524,13 +2524,13 @@ CurrentTrackJob::showUserLabels( const MetaBundle ¤tTrack ) QueryBuilder qb; qb.addReturnValue( QueryBuilder::tabLabels, QueryBuilder::valName, true ); qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valURL, currentTrack.url().path() ); - qb.addMatch( QueryBuilder::tabLabels, QueryBuilder::valType, QString::number( CollectionDB::typeUser ) ); + qb.addMatch( QueryBuilder::tabLabels, QueryBuilder::valType, TQString::number( CollectionDB::typeUser ) ); qb.setLimit( 0, 10 ); qb.sortBy( QueryBuilder::tabLabels, QueryBuilder::valName, false ); qb.buildQuery(); - QStringList values = qb.run(); + TQStringList values = qb.run(); - QString title; + TQString title; if ( currentTrack.title().isEmpty() ) title = currentTrack.veryNiceTitle(); else @@ -2564,11 +2564,11 @@ CurrentTrackJob::showUserLabels( const MetaBundle ¤tTrack ) m_HTMLSource.append( "\n" ); } -void CurrentTrackJob::showArtistsFaves( const QString &artist, uint artist_id ) +void CurrentTrackJob::showArtistsFaves( const TQString &artist, uint artist_id ) { - QString artistName = artist.isEmpty() ? escapeHTML( i18n( "This Artist" ) ) : escapeHTML( artist ); + TQString artistName = artist.isEmpty() ? escapeHTML( i18n( "This Artist" ) ) : escapeHTML( artist ); QueryBuilder qb; - QStringList values; + TQStringList values; qb.clear(); qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valTitle ); @@ -2576,7 +2576,7 @@ void CurrentTrackJob::showArtistsFaves( const QString &artist, uint artist_id ) qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valScore ); qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valRating ); qb.addNumericFilter( QueryBuilder::tabStats, QueryBuilder::valPlayCounter, "0", QueryBuilder::modeGreater ); - qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, QString::number( artist_id ) ); + qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, TQString::number( artist_id ) ); qb.sortByFavorite(); qb.setLimit( 0, 10 ); values = qb.run(); @@ -2595,7 +2595,7 @@ void CurrentTrackJob::showArtistsFaves( const QString &artist, uint artist_id ) for ( uint i = 0; i < values.count(); i += 4 ) m_HTMLSource.append( - "
\n" "\n" "\n" + escapeHTML( values[i] ) + "\n" @@ -2616,18 +2616,18 @@ void CurrentTrackJob::showArtistsFaves( const QString &artist, uint artist_id ) } } -void CurrentTrackJob::showArtistsAlbums( const QString &artist, uint artist_id, uint album_id ) +void CurrentTrackJob::showArtistsAlbums( const TQString &artist, uint artist_id, uint album_id ) { DEBUG_BLOCK - QString artistName = artist.isEmpty() ? escapeHTML( i18n( "This Artist" ) ) : escapeHTML( artist ); + TQString artistName = artist.isEmpty() ? escapeHTML( i18n( "This Artist" ) ) : escapeHTML( artist ); QueryBuilder qb; - QStringList values; + TQStringList values; // qb.clear(); qb.addReturnValue( QueryBuilder::tabAlbum, QueryBuilder::valName ); qb.addReturnValue( QueryBuilder::tabAlbum, QueryBuilder::valID ); qb.addReturnFunctionValue( QueryBuilder::funcMax, QueryBuilder::tabYear, QueryBuilder::valName ); - qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, QString::number( artist_id ) ); + qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, TQString::number( artist_id ) ); qb.groupBy( QueryBuilder::tabAlbum, QueryBuilder::valName ); qb.groupBy( QueryBuilder::tabAlbum, QueryBuilder::valID ); qb.sortByFunction( QueryBuilder::funcMax, QueryBuilder::tabYear, QueryBuilder::valName, true ); @@ -2649,7 +2649,7 @@ void CurrentTrackJob::showArtistsAlbums( const QString &artist, uint artist_id, uint vectorPlace = 0; // find album of the current track (if it exists) - while ( vectorPlace < values.count() && values[ vectorPlace+1 ] != QString::number( album_id ) ) + while ( vectorPlace < values.count() && values[ vectorPlace+1 ] != TQString::number( album_id ) ) vectorPlace += 3; for ( uint i = 0; i < values.count(); i += 3 ) { @@ -2661,36 +2661,36 @@ void CurrentTrackJob::showArtistsAlbums( const QString &artist, uint artist_id, qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valLength ); qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valDiscNumber ); qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valAlbumID, values[ i + 1 ] ); - qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, QString::number( artist_id ) ); + qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, TQString::number( artist_id ) ); qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valDiscNumber ); qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valTrack ); qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valTitle ); qb.setOptions( QueryBuilder::optNoCompilations ); - QStringList albumValues = qb.run(); + TQStringList albumValues = qb.run(); usleep( 10000 ); - QString albumYear; + TQString albumYear; if ( !albumValues.isEmpty() ) { albumYear = albumValues[ 3 ]; for ( uint j = 0; j < albumValues.count(); j += qb.countReturnValues() ) if ( albumValues[j + 3] != albumYear || albumYear == "0" ) { - albumYear = QString::null; + albumYear = TQString::null; break; } } uint i_albumLength = 0; for ( uint j = 0; j < albumValues.count(); j += qb.countReturnValues() ) - i_albumLength += QString(albumValues[j + 4]).toInt(); + i_albumLength += TQString(albumValues[j + 4]).toInt(); - QString albumLength = ( i_albumLength==0 ? i18n( "Unknown" ) : MetaBundle::prettyTime( i_albumLength, true ) ); - QString albumImage = ContextBrowser::getEncodedImage( CollectionDB::instance()->albumImage( artist, values[ i ], true, 50 ) ); - QString albumImageTitleAttr = albumImageTooltip( albumImage, 50 ); + TQString albumLength = ( i_albumLength==0 ? i18n( "Unknown" ) : MetaBundle::prettyTime( i_albumLength, true ) ); + TQString albumImage = ContextBrowser::getEncodedImage( CollectionDB::instance()->albumImage( artist, values[ i ], true, 50 ) ); + TQString albumImageTitleAttr = albumImageTooltip( albumImage, 50 ); m_HTMLSource.append( QStringx ( - "
\n" "
\n" "\n" @@ -2711,14 +2711,14 @@ void CurrentTrackJob::showArtistsAlbums( const QString &artist, uint artist_id, "
\n" "
\n" "
\n" ) - .args( QStringList() + .args( TQStringList() << values[ i + 1 ] << escapeHTMLAttr( artist ) // artist name << escapeHTMLAttr( values[ i ].isEmpty() ? i18n( "Unknown" ) : values[ i ] ) // album.name << albumImageTitleAttr << escapeHTMLAttr( albumImage ) << i18n( "Single", "%n Tracks", albumValues.count() / qb.countReturnValues() ) - << QString::number( artist_id ) + << TQString::number( artist_id ) << values[ i + 1 ] //album.id << escapeHTML( values[ i ].isEmpty() ? i18n( "Unknown" ) : values[ i ] ) << albumYear @@ -2726,11 +2726,11 @@ void CurrentTrackJob::showArtistsAlbums( const QString &artist, uint artist_id, << ( i!=vectorPlace ? "none" : "block" ) /* shows it if it's the current track album */ << values[ i + 1 ] ) ); - QString discNumber; + TQString discNumber; if ( !albumValues.isEmpty() ) for ( uint j = 0; j < albumValues.count(); j += qb.countReturnValues() ) { - QString newDiscNumber = albumValues[ j + 5 ].stripWhiteSpace(); + TQString newDiscNumber = albumValues[ j + 5 ].stripWhiteSpace(); if( discNumber != newDiscNumber && newDiscNumber.toInt() > 0) { discNumber = newDiscNumber; @@ -2740,13 +2740,13 @@ void CurrentTrackJob::showArtistsAlbums( const QString &artist, uint artist_id, "%4" "\n" "
\n" ) - .args( QStringList() - << QString::number( artist_id ) + .args( TQStringList() + << TQString::number( artist_id ) << values[ i + 1 ] //album.id << escapeHTMLAttr( discNumber ) << i18n( "Disc %1" ).arg( discNumber ) ) ); } - QString track = albumValues[j + 2].stripWhiteSpace(); + TQString track = albumValues[j + 2].stripWhiteSpace(); if( track.length() > 0 ) { if( track.length() == 1 ) track.prepend( "0" ); @@ -2754,9 +2754,9 @@ void CurrentTrackJob::showArtistsAlbums( const QString &artist, uint artist_id, track = "\n" + track + " \n"; } - QString length; + TQString length; if( albumValues[j + 4] != "0" ) - length = "(" + MetaBundle::prettyTime( QString(albumValues[j + 4]).toInt(), true ) + ")\n"; + length = "(" + MetaBundle::prettyTime( TQString(albumValues[j + 4]).toInt(), true ) + ")\n"; bool current = false; if( i==vectorPlace && albumValues[j + 2].toInt() == m_currentTrack.track() && discNumber.toInt() == m_currentTrack.discNumber() ) @@ -2783,16 +2783,16 @@ void CurrentTrackJob::showArtistsAlbums( const QString &artist, uint artist_id, // } -void CurrentTrackJob::showArtistsCompilations( const QString &artist, uint artist_id, uint album_id ) +void CurrentTrackJob::showArtistsCompilations( const TQString &artist, uint artist_id, uint album_id ) { - QString artistName = artist.isEmpty() ? escapeHTML( i18n( "This Artist" ) ) : escapeHTML( artist ); + TQString artistName = artist.isEmpty() ? escapeHTML( i18n( "This Artist" ) ) : escapeHTML( artist ); QueryBuilder qb; - QStringList values; + TQStringList values; // qb.clear(); qb.addReturnValue( QueryBuilder::tabAlbum, QueryBuilder::valName ); qb.addReturnValue( QueryBuilder::tabAlbum, QueryBuilder::valID ); - qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, QString::number( artist_id ) ); + qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, TQString::number( artist_id ) ); qb.sortBy( QueryBuilder::tabYear, QueryBuilder::valName, true ); qb.sortBy( QueryBuilder::tabAlbum, QueryBuilder::valName, true ); qb.setOptions( QueryBuilder::optRemoveDuplicates ); @@ -2813,7 +2813,7 @@ void CurrentTrackJob::showArtistsCompilations( const QString &artist, uint artis uint vectorPlace = 0; // find album of the current track (if it exists) - while ( vectorPlace < values.count() && values[ vectorPlace+1 ] != QString::number( album_id ) ) + while ( vectorPlace < values.count() && values[ vectorPlace+1 ] != TQString::number( album_id ) ) vectorPlace += 2; for ( uint i = 0; i < values.count(); i += 2 ) { @@ -2829,31 +2829,31 @@ void CurrentTrackJob::showArtistsCompilations( const QString &artist, uint artis qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valDiscNumber ); qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valTrack ); qb.setOptions( QueryBuilder::optOnlyCompilations ); - QStringList albumValues = qb.run(); + TQStringList albumValues = qb.run(); usleep( 10000 ); - QString albumYear; + TQString albumYear; if ( !albumValues.isEmpty() ) { albumYear = albumValues[ 3 ]; for ( uint j = 0; j < albumValues.count(); j += qb.countReturnValues() ) if ( albumValues[j + 3] != albumYear || albumYear == "0" ) { - albumYear = QString::null; + albumYear = TQString::null; break; } } uint i_albumLength = 0; for ( uint j = 0; j < albumValues.count(); j += qb.countReturnValues() ) - i_albumLength += QString(albumValues[j + 4]).toInt(); + i_albumLength += TQString(albumValues[j + 4]).toInt(); - QString albumLength = ( i_albumLength==0 ? i18n( "Unknown" ) : MetaBundle::prettyTime( i_albumLength, true ) ); - QString albumImage = ContextBrowser::getEncodedImage( CollectionDB::instance()->albumImage( artist, values[ i ], true, 50 ) ); - QString albumImageTitleAttr = albumImageTooltip( albumImage, 50 ); + TQString albumLength = ( i_albumLength==0 ? i18n( "Unknown" ) : MetaBundle::prettyTime( i_albumLength, true ) ); + TQString albumImage = ContextBrowser::getEncodedImage( CollectionDB::instance()->albumImage( artist, values[ i ], true, 50 ) ); + TQString albumImageTitleAttr = albumImageTooltip( albumImage, 50 ); m_HTMLSource.append( QStringx ( - "
\n" "
\n" "\n" @@ -2874,7 +2874,7 @@ void CurrentTrackJob::showArtistsCompilations( const QString &artist, uint artis "
\n" "
\n" "
\n" ) - .args( QStringList() + .args( TQStringList() << values[ i + 1 ] << escapeHTMLAttr( values[ i ].isEmpty() ? i18n( "Unknown" ) : values[ i ] ) // album.name << albumImageTitleAttr @@ -2887,11 +2887,11 @@ void CurrentTrackJob::showArtistsCompilations( const QString &artist, uint artis << ( i!=vectorPlace ? "none" : "block" ) /* shows it if it's the current track album */ << values[ i + 1 ] ) ); - QString discNumber; + TQString discNumber; if ( !albumValues.isEmpty() ) for ( uint j = 0; j < albumValues.count(); j += qb.countReturnValues() ) { - QString newDiscNumber = albumValues[ j + 6 ].stripWhiteSpace(); + TQString newDiscNumber = albumValues[ j + 6 ].stripWhiteSpace(); if( discNumber != newDiscNumber && newDiscNumber.toInt() > 0) { discNumber = newDiscNumber; @@ -2901,13 +2901,13 @@ void CurrentTrackJob::showArtistsCompilations( const QString &artist, uint artis "%3" "\n" "
\n" ) - .args( QStringList() + .args( TQStringList() << values[ i + 1 ] //album.id << escapeHTMLAttr( discNumber ) << i18n( "Disc %1" ).arg( discNumber ) ) ); } - QString track = albumValues[j + 2].stripWhiteSpace(); + TQString track = albumValues[j + 2].stripWhiteSpace(); if( track.length() > 0 ) { if( track.length() == 1 ) track.prepend( "0" ); @@ -2915,12 +2915,12 @@ void CurrentTrackJob::showArtistsCompilations( const QString &artist, uint artis track = "\n" + track + " \n"; } - QString length; + TQString length; if( albumValues[j + 4] != "0" ) - length = "(" + MetaBundle::prettyTime( QString(albumValues[j + 4]).toInt(), true ) + ")\n"; + length = "(" + MetaBundle::prettyTime( TQString(albumValues[j + 4]).toInt(), true ) + ")\n"; - QString tracktitle_formated; - QString tracktitle; + TQString tracktitle_formated; + TQString tracktitle; tracktitle = escapeHTML( i18n("%1 - %2").arg( albumValues[j + 5], albumValues[j] ) ); tracktitle_formated = "\n"; if( i==vectorPlace && albumValues[j + 2].toInt() == m_currentTrack.track() && discNumber.toInt() == m_currentTrack.discNumber() ) @@ -2955,7 +2955,7 @@ void CurrentTrackJob::showArtistsCompilations( const QString &artist, uint artis // } -QString CurrentTrackJob::statsHTML( int score, int rating, bool statsbox ) //static +TQString CurrentTrackJob::statsHTML( int score, int rating, bool statsbox ) //static { if( !AmarokConfig::useScores() && !AmarokConfig::useRatings() ) return ""; @@ -2965,24 +2965,24 @@ QString CurrentTrackJob::statsHTML( int score, int rating, bool statsbox ) //sta if ( rating > 10 ) rating = 10; - QString table = QString( "%2
\n" ) + TQString table = TQString( "%2
\n" ) .arg( statsbox ? "class='statsBox'" : "" ); - QString contents; + TQString contents; if( AmarokConfig::useScores() ) - contents += QString( "
\n" + QString::number( score ) + "
\n" + TQString::number( score ) + "\n" "
\n" "
\n" + + TQString::number( score / 2 ) + "px;'>
\n" "\n" "
\n"; if( rating ) @@ -2990,30 +2990,30 @@ QString CurrentTrackJob::statsHTML( int score, int rating, bool statsbox ) //sta bool half = rating%2; contents += "\n"; - QImageIO fullStarIO; + TQImageIO fullStarIO; fullStarIO.setImage( StarManager::instance()->getStarImage( half ? rating/2 + 1 : rating/2 ) ); fullStarIO.setFormat( "PNG" ); - QBuffer fullStarBuf; + TQBuffer fullStarBuf; fullStarBuf.open( IO_WriteOnly ); fullStarIO.setIODevice( &fullStarBuf ); fullStarIO.write(); fullStarBuf.close(); - QCString fullStar = KCodecs::base64Encode( fullStarBuf.buffer(), true ); + TQCString fullStar = KCodecs::base64Encode( fullStarBuf.buffer(), true ); - const QString img = "\n"; + const TQString img = "\n"; for( int i = 0, n = rating / 2; i < n; ++i ) contents += img.arg( "data:image/png;base64," + fullStar ); if( rating % 2 ) { - QImageIO halfStarIO; + TQImageIO halfStarIO; halfStarIO.setImage( StarManager::instance()->getHalfStarImage( half ? rating/2 + 1 : rating/2 ) ); halfStarIO.setFormat( "PNG" ); - QBuffer halfStarBuf; + TQBuffer halfStarBuf; halfStarBuf.open( IO_WriteOnly ); halfStarIO.setIODevice( &halfStarBuf ); halfStarIO.write(); halfStarBuf.close(); - QCString halfStar = KCodecs::base64Encode( halfStarBuf.buffer(), true ); + TQCString halfStar = KCodecs::base64Encode( halfStarBuf.buffer(), true ); contents += img.arg( "data:image/png;base64," + halfStar ); } contents += "\n"; @@ -3073,14 +3073,14 @@ bool CurrentTrackJob::doJob() } } - QString artist; + TQString artist; if( b->m_browseArtists ) { artist = b->m_artist; if( artist == m_currentTrack.artist() ) { b->m_browseArtists = false; - b->m_artist = QString::null; + b->m_artist = TQString::null; b->m_contextBackHistory.clear(); b->m_contextBackHistory.push_back( "current://track" ); } @@ -3091,7 +3091,7 @@ bool CurrentTrackJob::doJob() const uint artist_id = CollectionDB::instance()->artistID( artist ); const uint album_id = CollectionDB::instance()->albumID ( m_currentTrack.album() ); QueryBuilder qb; - QStringList values; + TQStringList values; if( b->m_browseArtists ) showBrowseArtistHeader( artist ); else if( b->m_browseLabels ) @@ -3110,7 +3110,7 @@ bool CurrentTrackJob::doJob() if( ContextBrowser::instance()->m_showRelated || ContextBrowser::instance()->m_showSuggested ) { - QStringList relArtists = CollectionDB::instance()->similarArtists( artist, 10 ); + TQStringList relArtists = CollectionDB::instance()->similarArtists( artist, 10 ); if ( !relArtists.isEmpty() ) { if( ContextBrowser::instance()->m_showRelated ) @@ -3121,7 +3121,7 @@ bool CurrentTrackJob::doJob() } } - QString artistName = artist.isEmpty() ? i18n( "This Artist" ) : artist ; + TQString artistName = artist.isEmpty() ? i18n( "This Artist" ) : artist ; if ( !artist.isEmpty() ) { if( ContextBrowser::instance()->m_showFaves ) @@ -3146,7 +3146,7 @@ void ContextBrowser::showIntroduction() } // Do we have to rebuild the page? I don't care - m_HTMLSource = QString::null; + m_HTMLSource = TQString::null; m_HTMLSource.append( "\n" "
\n" @@ -3207,20 +3207,20 @@ void ContextBrowser::showScanning() } QString -ContextBrowser::getEncodedImage( const QString &imageUrl ) +ContextBrowser::getEncodedImage( const TQString &imageUrl ) { // Embed cover image in html (encoded string), to get around khtml's caching //debug() << "Encoding imageUrl: " << imageUrl << endl; qApp->lock(); - const QImage img( imageUrl, "PNG" ); + const TQImage img( imageUrl, "PNG" ); qApp->unlock(); - QByteArray ba; - QBuffer buffer( ba ); + TQByteArray ba; + TQBuffer buffer( ba ); buffer.open( IO_WriteOnly ); qApp->lock(); img.save( &buffer, "PNG" ); // writes image into ba in PNG format qApp->unlock(); - const QString coverImage = QString( "data:image/png;base64,%1" ).arg( KCodecs::base64Encode( ba ) ); + const TQString coverImage = TQString( "data:image/png;base64,%1" ).arg( KCodecs::base64Encode( ba ) ); //debug() << "Encoded imageUrl: " << coverImage << endl; return coverImage; } @@ -3229,7 +3229,7 @@ ContextBrowser::getEncodedImage( const QString &imageUrl ) // Lyrics-Tab ////////////////////////////////////////////////////////////////////////////////////////// -void ContextBrowser::showLyrics( const QString &url ) +void ContextBrowser::showLyrics( const TQString &url ) { #if 0 if( BrowserBar::instance()->currentBrowser() != this ) @@ -3250,11 +3250,11 @@ void ContextBrowser::showLyrics( const QString &url ) } if ( !m_dirtyLyricsPage ) return; - QString lyrics = CollectionDB::instance()->getLyrics( EngineController::instance()->bundle().url().path() ); + TQString lyrics = CollectionDB::instance()->getLyrics( EngineController::instance()->bundle().url().path() ); // don't rely on caching for streams const bool cached = !lyrics.isEmpty() && !EngineController::engine()->isStream(); - QString title = EngineController::instance()->bundle().title(); - QString artist = EngineController::instance()->bundle().artist(); + TQString title = EngineController::instance()->bundle().title(); + TQString artist = EngineController::instance()->bundle().artist(); if( title.contains("PREVIEW: buy it at www.magnatune.com", true) >= 1 ) title = title.remove(" (PREVIEW: buy it at www.magnatune.com)"); @@ -3265,7 +3265,7 @@ void ContextBrowser::showLyrics( const QString &url ) /* If title is empty, try to use pretty title. The fact that it often (but not always) has artist name together, can be bad, but at least the user will hopefully get nice suggestions. */ - QString prettyTitle = EngineController::instance()->bundle().prettyTitle(); + TQString prettyTitle = EngineController::instance()->bundle().prettyTitle(); int h = prettyTitle.find( '-' ); if ( h != -1 ) { @@ -3281,20 +3281,20 @@ void ContextBrowser::showLyrics( const QString &url ) } } - m_lyricSearchUrl = QString( "http://www.google.com/search?ie=UTF-8&q=lyrics+%1+%2" ) + m_lyricSearchUrl = TQString( "http://www.google.com/search?ie=UTF-8&q=lyrics+%1+%2" ) .arg( KURL::encode_string_no_slash( '"' + artist + '"', 106 /*utf-8*/ ), KURL::encode_string_no_slash( '"' + title + '"', 106 /*utf-8*/ ) ); m_lyricsToolBar->getButton( LYRICS_BROWSER )->setEnabled(false); if( ( !cached || url == "reload" ) && !ScriptManager::instance()->lyricsScriptRunning() ) { - const QStringList scripts = ScriptManager::instance()->lyricsScripts(); + const TQStringList scripts = ScriptManager::instance()->lyricsScripts(); lyrics = i18n( "Sorry, no lyrics script running.") + "
\n" + "
\n"+ i18n( "Available Lyrics Scripts:" ) + "
\n"; foreach ( scripts ) { - lyrics += QString( "%2
\n" ).arg( *it, *it ); + lyrics += TQString( "%2
\n" ).arg( *it, *it ); } lyrics += "
\n" + i18n( "Click on one of the scripts to run it, or use the Script Manager, to be able" " to see all the scripts, and download new ones from the Web." ); @@ -3303,7 +3303,7 @@ void ContextBrowser::showLyrics( const QString &url ) i18n( "Run Script Manager..." ) + "'>

\n"; - m_HTMLSource = QString ( + m_HTMLSource = TQString ( "\n" "
\n" "
\n" @@ -3331,7 +3331,7 @@ void ContextBrowser::showLyrics( const QString &url ) } else { - m_HTMLSource = QString ( + m_HTMLSource = TQString ( "\n" "
\n" "
\n" @@ -3358,10 +3358,10 @@ void ContextBrowser::showLyrics( const QString &url ) void -ContextBrowser::lyricsResult( QCString cXmlDoc, bool cached ) //SLOT +ContextBrowser::lyricsResult( TQCString cXmlDoc, bool cached ) //SLOT { - QDomDocument doc; - QString xmldoc = QString::fromUtf8( cXmlDoc ); + TQDomDocument doc; + TQString xmldoc = TQString::fromUtf8( cXmlDoc ); if( !doc.setContent( xmldoc ) ) { m_HTMLSource=""; @@ -3387,9 +3387,9 @@ ContextBrowser::lyricsResult( QCString cXmlDoc, bool cached ) //SLOT return; } - QString lyrics; + TQString lyrics; - QDomElement el = doc.documentElement(); + TQDomElement el = doc.documentElement(); m_lyricCurrentUrl = el.attribute( "page_url" ); ScriptManager* const sm = ScriptManager::instance(); @@ -3402,7 +3402,7 @@ ContextBrowser::lyricsResult( QCString cXmlDoc, bool cached ) //SLOT m_lyricAddUrl.replace( "MAGIC_ARTIST", KURL::encode_string_no_slash( EngineController::instance()->bundle().artist() ) ); m_lyricAddUrl.replace( "MAGIC_TITLE", KURL::encode_string_no_slash( EngineController::instance()->bundle().title() ) ); m_lyricAddUrl.replace( "MAGIC_ALBUM", KURL::encode_string_no_slash( EngineController::instance()->bundle().album() ) ); - m_lyricAddUrl.replace( "MAGIC_YEAR", KURL::encode_string_no_slash( QString::number( EngineController::instance()->bundle().year() ) ) ); + m_lyricAddUrl.replace( "MAGIC_YEAR", KURL::encode_string_no_slash( TQString::number( EngineController::instance()->bundle().year() ) ) ); } else m_lyricAddUrl = el.attribute( "add_url" ); @@ -3411,7 +3411,7 @@ ContextBrowser::lyricsResult( QCString cXmlDoc, bool cached ) //SLOT { - const QDomNodeList l = doc.elementsByTagName( "suggestion" ); + const TQDomNodeList l = doc.elementsByTagName( "suggestion" ); if( l.length() ==0 ) { @@ -3421,25 +3421,25 @@ ContextBrowser::lyricsResult( QCString cXmlDoc, bool cached ) //SLOT { lyrics = i18n( "Lyrics for track not found, here are some suggestions:" ) + "

\n"; for( uint i = 0; i < l.length(); ++i ) { - const QString url = l.item( i ).toElement().attribute( "url" ); - const QString artist = l.item( i ).toElement().attribute( "artist" ); - const QString title = l.item( i ).toElement().attribute( "title" ); + const TQString url = l.item( i ).toElement().attribute( "url" ); + const TQString artist = l.item( i ).toElement().attribute( "artist" ); + const TQString title = l.item( i ).toElement().attribute( "title" ); lyrics += "\n" + i18n("%1 - %2").arg( artist, title ); lyrics += "
\n"; } } lyrics += i18n( "

You can search for the lyrics on the Web.

" ) - .arg( QString( m_lyricSearchUrl ).replace( QRegExp( "^http:" ), "externalurl:" ) ); + .arg( TQString( m_lyricSearchUrl ).replace( TQRegExp( "^http:" ), "externalurl:" ) ); } else { lyrics = el.text(); lyrics.replace( "\n", "
\n" ); // Plaintext -> HTML - const QString title = el.attribute( "title" ); - const QString artist = el.attribute( "artist" ); - const QString site = el.attribute( "site" ).isEmpty() ? spec.readEntry( "site" ) : el.attribute( "site" ); - const QString site_url = el.attribute( "site_url" ).isEmpty() ? spec.readEntry( "site_url" ) : el.attribute( "site_url" ); + const TQString title = el.attribute( "title" ); + const TQString artist = el.attribute( "artist" ); + const TQString site = el.attribute( "site" ).isEmpty() ? spec.readEntry( "site" ) : el.attribute( "site" ); + const TQString site_url = el.attribute( "site_url" ).isEmpty() ? spec.readEntry( "site_url" ) : el.attribute( "site_url" ); lyrics.prepend( "\n" + title + "
\n" + artist+ "

\n" ); @@ -3497,12 +3497,12 @@ ContextBrowser::lyricsEditToggle() //SLOT m_lyricsBeingEditedUrl = EngineController::instance()->bundle().url().path(); m_lyricsBeingEditedArtist = EngineController::instance()->bundle().artist(); m_lyricsBeingEditedTitle = EngineController::instance()->bundle().title(); - QString xml = CollectionDB::instance()->getLyrics( m_lyricsBeingEditedUrl ), lyrics; - QDomDocument doc; + TQString xml = CollectionDB::instance()->getLyrics( m_lyricsBeingEditedUrl ), lyrics; + TQDomDocument doc; if( doc.setContent( xml ) ) lyrics = doc.documentElement().text(); else - lyrics = QString::null; + lyrics = TQString::null; m_lyricsTextEdit->setText( lyrics ); m_lyricsPage->hide(); m_lyricsTextEdit->show(); @@ -3511,11 +3511,11 @@ ContextBrowser::lyricsEditToggle() //SLOT { m_lyricsTextEdit->hide(); - QDomDocument doc; - QDomElement e = doc.createElement( "lyrics" ); + TQDomDocument doc; + TQDomElement e = doc.createElement( "lyrics" ); e.setAttribute( "artist", m_lyricsBeingEditedArtist ); e.setAttribute( "title", m_lyricsBeingEditedTitle ); - QDomText t = doc.createTextNode( m_lyricsTextEdit->text() ); + TQDomText t = doc.createTextNode( m_lyricsTextEdit->text() ); e.appendChild( t ); doc.appendChild( e ); CollectionDB::instance()->setLyrics( m_lyricsBeingEditedUrl, doc.toString(), CollectionDB::instance()->uniqueIdFromUrl( KURL( m_lyricsBeingEditedUrl) ) ); @@ -3539,7 +3539,7 @@ ContextBrowser::lyricsRefresh() //SLOT } void -ContextBrowser::lyricsSearchText(QString const &text) //SLOT +ContextBrowser::lyricsSearchText(TQString const &text) //SLOT { m_lyricsPage->findText( text, 0 ); lyricsSearchTextNext(); @@ -3620,7 +3620,7 @@ void ContextBrowser::wikiConfigChanged( int /*activeItem*/ ) // SLOT { // keep in sync with localeList in wikiConfig - QString text = m_wikiLocaleCombo->currentText(); + TQString text = m_wikiLocaleCombo->currentText(); m_wikiLocaleEdit->setEnabled( text == i18n("Other...") ); @@ -3661,7 +3661,7 @@ ContextBrowser::wikiConfigApply() // SLOT void ContextBrowser::wikiConfig() // SLOT { - QStringList localeList; + TQStringList localeList; localeList << i18n( "English" ) << i18n( "German" ) @@ -3691,30 +3691,30 @@ ContextBrowser::wikiConfig() // SLOT m_wikiConfigDialog = new KDialogBase( this, 0, true, 0, KDialogBase::Ok|KDialogBase::Apply|KDialogBase::Cancel ); kapp->setTopWidget( m_wikiConfigDialog ); m_wikiConfigDialog->setCaption( kapp->makeStdCaption( i18n( "Wikipedia Locale" ) ) ); - QVBox *box = m_wikiConfigDialog->makeVBoxMainWidget(); + TQVBox *box = m_wikiConfigDialog->makeVBoxMainWidget(); - m_wikiLocaleCombo = new QComboBox( box ); + m_wikiLocaleCombo = new TQComboBox( box ); m_wikiLocaleCombo->insertStringList( localeList ); - QHBox *hbox = new QHBox( box ); - QLabel *otherLabel = new QLabel( i18n( "Locale: " ), hbox ); - m_wikiLocaleEdit = new QLineEdit( "en", hbox ); + TQHBox *hbox = new TQHBox( box ); + TQLabel *otherLabel = new TQLabel( i18n( "Locale: " ), hbox ); + m_wikiLocaleEdit = new TQLineEdit( "en", hbox ); otherLabel->setBuddy( m_wikiLocaleEdit ); - QToolTip::add( m_wikiLocaleEdit, i18n( "2-letter language code for your Wikipedia locale" ) ); + TQToolTip::add( m_wikiLocaleEdit, i18n( "2-letter language code for your Wikipedia locale" ) ); - connect( m_wikiLocaleCombo, SIGNAL( activated(int) ), SLOT( wikiConfigChanged(int) ) ); - connect( m_wikiConfigDialog, SIGNAL( applyClicked() ), SLOT( wikiConfigApply() ) ); + connect( m_wikiLocaleCombo, TQT_SIGNAL( activated(int) ), TQT_SLOT( wikiConfigChanged(int) ) ); + connect( m_wikiConfigDialog, TQT_SIGNAL( applyClicked() ), TQT_SLOT( wikiConfigApply() ) ); m_wikiLocaleEdit->setText( wikiLocale() ); m_wikiLocaleCombo->setCurrentItem( index ); wikiConfigChanged( index ); // a little redundant, but saves ugly code, and ensures the lineedit enabled status is correct - m_wikiConfigDialog->setInitialSize( QSize( 240, 100 ) ); + m_wikiConfigDialog->setInitialSize( TQSize( 240, 100 ) ); const int result = m_wikiConfigDialog->exec(); - if( result == QDialog::Accepted ) + if( result == TQDialog::Accepted ) wikiConfigApply(); delete m_wikiConfigDialog; @@ -3724,25 +3724,25 @@ QString ContextBrowser::wikiLocale() { if( s_wikiLocale.isEmpty() ) - return QString( "en" ); + return TQString( "en" ); return s_wikiLocale; } void -ContextBrowser::setWikiLocale( const QString &locale ) +ContextBrowser::setWikiLocale( const TQString &locale ) { AmarokConfig::setWikipediaLocale( locale ); s_wikiLocale = locale; } QString -ContextBrowser::wikiURL( const QString &item ) +ContextBrowser::wikiURL( const TQString &item ) { // add any special characters to be replaced here - QString wStr = QString(item).replace( "/", " " ); + TQString wStr = TQString(item).replace( "/", " " ); - return QString( "http://%1.wikipedia.org/wiki/" ).arg( wikiLocale() ) + return TQString( "http://%1.wikipedia.org/wiki/" ).arg( wikiLocale() ) + KURL::encode_string_no_slash( wStr, 106 /*utf-8*/ ); } @@ -3754,7 +3754,7 @@ ContextBrowser::reloadWikipedia() } void -ContextBrowser::showWikipediaEntry( const QString &entry, bool replaceHistory ) +ContextBrowser::showWikipediaEntry( const TQString &entry, bool replaceHistory ) { m_wikiCurrentEntry = entry; showWikipedia( wikiURL( entry ), false, replaceHistory ); @@ -3765,40 +3765,40 @@ ContextBrowser::showLabelsDialog() { DEBUG_BLOCK KURL currentUrl = EngineController::instance()->bundle().url(); - QStringList allLabels = CollectionDB::instance()->labelList(); - QStringList trackLabels = CollectionDB::instance()->getLabels( currentUrl.path(), CollectionDB::typeUser ); + TQStringList allLabels = CollectionDB::instance()->labelList(); + TQStringList trackLabels = CollectionDB::instance()->getLabels( currentUrl.path(), CollectionDB::typeUser ); debug() << "Showing add label dialog" << endl; - KDialogBase *dialog = new KDialogBase( this, 0, false, QString::null, KDialogBase::Ok|KDialogBase::Cancel ); + KDialogBase *dialog = new KDialogBase( this, 0, false, TQString::null, KDialogBase::Ok|KDialogBase::Cancel ); dialog->makeVBoxMainWidget(); - QLabel *labelText = new QLabel( i18n( + TQLabel *labelText = new TQLabel( i18n( "

Add a new label in the field below and press Enter, or choose labels from the list

"), dialog->mainWidget() ); m_addLabelEdit = new ClickLineEdit( i18n( "Add new label" ), dialog->mainWidget() ); m_addLabelEdit->installEventFilter( this ); - m_addLabelEdit->setFrame( QFrame::Sunken ); - QToolTip::add( m_addLabelEdit, i18n( "Enter a new label and press Return to add it" ) ); + m_addLabelEdit->setFrame( TQFrame::Sunken ); + TQToolTip::add( m_addLabelEdit, i18n( "Enter a new label and press Return to add it" ) ); dialog->setFocusProxy( m_addLabelEdit ); labelText->setBuddy( m_addLabelEdit ); - m_labelListView = new QListView( dialog->mainWidget() ); + m_labelListView = new TQListView( dialog->mainWidget() ); m_labelListView->addColumn( i18n( "Label" ) ); - m_labelListView->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); - m_labelListView->setColumnWidthMode( 0, QListView::Maximum ); + m_labelListView->setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ); + m_labelListView->setColumnWidthMode( 0, TQListView::Maximum ); foreach( allLabels ) { - QCheckListItem *item = new QCheckListItem( m_labelListView, *it, QCheckListItem::CheckBox ); + TQCheckListItem *item = new TQCheckListItem( m_labelListView, *it, TQCheckListItem::CheckBox ); item->setOn( trackLabels.contains( *it ) ); } - if( dialog->exec() == QDialog::Accepted ) + if( dialog->exec() == TQDialog::Accepted ) { debug() << "Dialog closed, updating labels" << endl; - QStringList newTrackLabels; - QListViewItemIterator iter( m_labelListView ); + TQStringList newTrackLabels; + TQListViewItemIterator iter( m_labelListView ); while( iter.current() ) { - QCheckListItem *item = static_cast( iter.current() ); + TQCheckListItem *item = static_cast( iter.current() ); if( item->isOn() ) newTrackLabels.append( item->text() ); iter++; @@ -3821,12 +3821,12 @@ ContextBrowser::showLabelsDialog() } bool -ContextBrowser::eventFilter( QObject *o, QEvent *e ) +ContextBrowser::eventFilter( TQObject *o, TQEvent *e ) { switch( e->type() ) { - case 6/*QEvent::KeyPress*/: - #define e static_cast(e) + case 6/*TQEvent::KeyPress*/: + #define e static_cast(e) if( o == m_addLabelEdit ) //the add label lineedit { @@ -3835,9 +3835,9 @@ ContextBrowser::eventFilter( QObject *o, QEvent *e ) case Key_Return: case Key_Enter: { - QCheckListItem *item = new QCheckListItem( m_labelListView, m_addLabelEdit->text(), QCheckListItem::CheckBox ); + TQCheckListItem *item = new TQCheckListItem( m_labelListView, m_addLabelEdit->text(), TQCheckListItem::CheckBox ); item->setOn( true ); - m_addLabelEdit->setText( QString() ); + m_addLabelEdit->setText( TQString() ); return true; } @@ -3866,7 +3866,7 @@ ContextBrowser::eventFilter( QObject *o, QEvent *e ) return KTabWidget::eventFilter( o, e ); } -void ContextBrowser::showWikipedia( const QString &url, bool fromHistory, bool replaceHistory ) +void ContextBrowser::showWikipedia( const TQString &url, bool fromHistory, bool replaceHistory ) { #if 0 if( BrowserBar::instance()->currentBrowser() != this ) @@ -3909,7 +3909,7 @@ void ContextBrowser::showWikipedia( const QString &url, bool fromHistory, bool r if ( url.isEmpty() ) { - QString tmpWikiStr; + TQString tmpWikiStr; if ( (EngineController::instance()->bundle().url().protocol() == "lastfm") || (EngineController::instance()->bundle().url().protocol() == "daap") || @@ -3970,7 +3970,7 @@ void ContextBrowser::showWikipedia( const QString &url, bool fromHistory, bool r m_wikiForwardPopup->clear(); // Populate button menus with URLs from the history - QStringList::ConstIterator it; + TQStringList::ConstIterator it; uint count; // Reverse iterate over both lists count = m_wikiBackHistory.count()-1; @@ -3993,7 +3993,7 @@ void ContextBrowser::showWikipedia( const QString &url, bool fromHistory, bool r Amarok::StatusBar::instance()->newProgressOperation( m_wikiJob ) .setDescription( i18n( "Fetching Wikipedia Information" ) ); - connect( m_wikiJob, SIGNAL( result( KIO::Job* ) ), SLOT( wikiResult( KIO::Job* ) ) ); + connect( m_wikiJob, TQT_SIGNAL( result( KIO::Job* ) ), TQT_SLOT( wikiResult( KIO::Job* ) ) ); } @@ -4008,7 +4008,7 @@ ContextBrowser::wikiHistoryBack() //SLOT m_wikiBackHistory.pop_back(); m_dirtyWikiPage = true; - m_wikiCurrentEntry = QString::null; + m_wikiCurrentEntry = TQString::null; showWikipedia( m_wikiBackHistory.last(), true ); } @@ -4024,7 +4024,7 @@ ContextBrowser::wikiHistoryForward() //SLOT m_wikiForwardHistory.pop_back(); m_dirtyWikiPage = true; - m_wikiCurrentEntry = QString::null; + m_wikiCurrentEntry = TQString::null; showWikipedia( m_wikiBackHistory.last(), true ); } @@ -4042,7 +4042,7 @@ ContextBrowser::wikiBackPopupActivated( int id ) //SLOT } while( id >= 0 ); m_dirtyWikiPage = true; - m_wikiCurrentEntry = QString::null; + m_wikiCurrentEntry = TQString::null; showWikipedia( m_wikiBackHistory.last(), true ); } @@ -4060,7 +4060,7 @@ ContextBrowser::wikiForwardPopupActivated( int id ) //SLOT } while( id >= 0 ); m_dirtyWikiPage = true; - m_wikiCurrentEntry = QString::null; + m_wikiCurrentEntry = TQString::null; showWikipedia( m_wikiBackHistory.last(), true ); } @@ -4129,14 +4129,14 @@ ContextBrowser::wikiResult( KIO::Job* job ) //SLOT return; //not the right job, so let's ignore it KIO::StoredTransferJob* const storedJob = static_cast( job ); - m_wiki = QString( storedJob->data() ); + m_wiki = TQString( storedJob->data() ); // Enable the Open in a Brower button, Disabled while loading, guz it would open wikipedia main page. m_wikiToolBar->setItemEnabled( WIKI_BROWSER, true ); // FIXME: Get a safer Regexp here, to match only inside of at least. if ( m_wiki.contains( "charset=utf-8" ) ) { - m_wiki = QString::fromUtf8( storedJob->data().data(), storedJob->data().size() ); + m_wiki = TQString::fromUtf8( storedJob->data().data(), storedJob->data().size() ); } if( m_wiki.find( "var wgArticleId = 0" ) != -1 ) @@ -4168,7 +4168,7 @@ ContextBrowser::wikiResult( KIO::Job* job ) //SLOT m_wiki.replace( "\n", " " ); m_wiki.replace( "\t", " " ); - m_wikiLanguages = QString::null; + m_wikiLanguages = TQString::null; // Get the available language list if ( m_wiki.find("
") != -1 ) { @@ -4177,13 +4177,13 @@ ContextBrowser::wikiResult( KIO::Job* job ) //SLOT m_wikiLanguages = m_wikiLanguages.mid( 0, m_wikiLanguages.find( "
" ) ); } - QString copyright; - QString copyrightMark = "
  • "; + TQString copyright; + TQString copyrightMark = "
  • "; if ( m_wiki.find( copyrightMark ) != -1 ) { copyright = m_wiki.mid( m_wiki.find(copyrightMark) + copyrightMark.length() ); copyright = copyright.mid( 0, copyright.find( "
  • " ) ); - copyright.replace( "
    ", QString::null ); + copyright.replace( "
    ", TQString::null ); //only one br at the beginning copyright.prepend( "
    " ); } @@ -4194,36 +4194,36 @@ ContextBrowser::wikiResult( KIO::Job* job ) //SLOT // Adding back license information m_wiki += copyright; m_wiki.append( "
    " ); - m_wiki.replace( QRegExp("

    [^<]*

    "), QString::null ); + m_wiki.replace( TQRegExp("

    [^<]*

    "), TQString::null ); - m_wiki.replace( QRegExp( "]*>[^<]*<[^>]*>[^<]*<[^>]*>[^<]*" ), QString::null ); + m_wiki.replace( TQRegExp( "]*>[^<]*<[^>]*>[^<]*<[^>]*>[^<]*" ), TQString::null ); - m_wiki.replace( QRegExp( "]*>([^<]*)" ), "\\1" ); + m_wiki.replace( TQRegExp( "]*>([^<]*)" ), "\\1" ); // Remove anything inside of a class called urlexpansion, as it's pointless for us - m_wiki.replace( QRegExp( "[^(]*[(][^)]*[)]" ), QString::null ); + m_wiki.replace( TQRegExp( "[^(]*[(][^)]*[)]" ), TQString::null ); // Remove hidden table rows as well - QRegExp hidden( "
    %1%2
    %1%2
    %2
    " ).arg( title, table ); + TQString title = escapeHTML( i18n( "Device information for %1").arg(medium->name() ) ); + TQString details = TQString( "%1
    " "%2
    " ).arg( title, table ); - (void)new QLabel( i18n("Name: "), this ); - (void)new QLabel( medium->name(), this ); + (void)new TQLabel( i18n("Name: "), this ); + (void)new TQLabel( medium->name(), this ); (void)new KActiveLabel( i18n( "(Details)" ) .arg( Amarok::escapeHTMLAttr( details ) ), this ); - (void)new QLabel( i18n("Plugin:"), this ); + (void)new TQLabel( i18n("Plugin:"), this ); m_pluginCombo = new KComboBox( false, this ); m_pluginCombo->insertItem( i18n( "Do not handle" ) ); @@ -435,17 +435,17 @@ MediaDeviceConfig::MediaDeviceConfig( Medium *medium, MediumPluginManager *mgr, m_pluginCombo->setCurrentItem( (*it)->name() ); } - m_configButton = new KPushButton( SmallIconSet( Amarok::icon( "configure" ) ), QString::null, this ); - connect( m_configButton, SIGNAL(clicked()), SLOT(configureDevice()) ); + m_configButton = new KPushButton( SmallIconSet( Amarok::icon( "configure" ) ), TQString::null, this ); + connect( m_configButton, TQT_SIGNAL(clicked()), TQT_SLOT(configureDevice()) ); m_configButton->setEnabled( !m_new && m_pluginCombo->currentText() != i18n( "Do not handle" ) ); - QToolTip::add( m_configButton, i18n( "Configure device settings" ) ); + TQToolTip::add( m_configButton, i18n( "Configure device settings" ) ); m_removeButton = new KPushButton( i18n( "Remove" ), this ); - connect( m_removeButton, SIGNAL(clicked()), SLOT(deleteDevice()) ); - QToolTip::add( m_removeButton, i18n( "Remove entries corresponding to this device from configuration file" ) ); + connect( m_removeButton, TQT_SIGNAL(clicked()), TQT_SLOT(deleteDevice()) ); + TQToolTip::add( m_removeButton, i18n( "Remove entries corresponding to this device from configuration file" ) ); - connect( m_pluginCombo, SIGNAL(activated(const QString&)), m_manager, SLOT(slotChanged()) ); - connect( this, SIGNAL(changed()), m_manager, SLOT(slotChanged()) ); + connect( m_pluginCombo, TQT_SIGNAL(activated(const TQString&)), m_manager, TQT_SLOT(slotChanged()) ); + connect( this, TQT_SIGNAL(changed()), m_manager, TQT_SLOT(slotChanged()) ); if( !nographics ) show(); @@ -480,18 +480,18 @@ MediaDeviceConfig::oldPlugin() } void -MediaDeviceConfig::setOldPlugin( const QString &oldPlugin ) +MediaDeviceConfig::setOldPlugin( const TQString &oldPlugin ) { m_oldPlugin = oldPlugin; } -QButton * +TQButton * MediaDeviceConfig::configButton() { return m_configButton; } -QButton * +TQButton * MediaDeviceConfig::removeButton() { return m_removeButton; diff --git a/amarok/src/mediumpluginmanager.h b/amarok/src/mediumpluginmanager.h index bcbe03f5..bc7d8ca5 100644 --- a/amarok/src/mediumpluginmanager.h +++ b/amarok/src/mediumpluginmanager.h @@ -16,25 +16,25 @@ #include "hintlineedit.h" #include "plugin/pluginconfig.h" -#include -#include -#include +#include +#include +#include #include #include #include -class QButton; -class QGroupBox; -class QLabel; -class QSignalMapper; -class QVBox; +class TQButton; +class TQGroupBox; +class TQLabel; +class TQSignalMapper; +class TQVBox; class KComboBox; class KLineEdit; class Medium; class MediumPluginManager; -typedef QMap DeletedMap; +typedef TQMap DeletedMap; /** @author Jeff Mitchell @@ -46,14 +46,14 @@ class MediaDeviceConfig : public QHBox Q_OBJECT public: - MediaDeviceConfig( Medium *medium, MediumPluginManager *mgr, const bool nographics=false, QWidget *parent=0, const char *name=0 ); + MediaDeviceConfig( Medium *medium, MediumPluginManager *mgr, const bool nographics=false, TQWidget *parent=0, const char *name=0 ); ~MediaDeviceConfig(); - QString oldPlugin(); - void setOldPlugin( const QString &oldPlugin ); - QString plugin(); + TQString oldPlugin(); + void setOldPlugin( const TQString &oldPlugin ); + TQString plugin(); KComboBox *pluginCombo(); - QButton *configButton(); - QButton *removeButton(); + TQButton *configButton(); + TQButton *removeButton(); Medium *medium(); bool isNew(); @@ -68,14 +68,14 @@ class MediaDeviceConfig : public QHBox protected: MediumPluginManager *m_manager; Medium *m_medium; - QString m_oldPlugin; + TQString m_oldPlugin; KComboBox * m_pluginCombo; - QButton *m_configButton; - QButton *m_removeButton; + TQButton *m_configButton; + TQButton *m_removeButton; bool m_new; }; -typedef QValueList DeviceList; +typedef TQValueList DeviceList; class MediumPluginManager : public QObject { @@ -86,13 +86,13 @@ class MediumPluginManager : public QObject public: //nographics only for the initial run of detectDevices...pass in //directly to detectDevices after - MediumPluginManager( QWidget *widget, const bool nographics=false ); + MediumPluginManager( TQWidget *widget, const bool nographics=false ); ~MediumPluginManager(); void finished(); bool hasChanged(); signals: - void selectedPlugin( const Medium*, const QString ); + void selectedPlugin( const Medium*, const TQString ); void changed(); public slots: @@ -105,7 +105,7 @@ class MediumPluginManager : public QObject bool detectDevices( bool redetect=false, bool nographics=false ); DeletedMap m_deletedMap; DeviceList m_deviceList; - QWidget *m_widget; + TQWidget *m_widget; bool m_hasChanged; }; @@ -123,8 +123,8 @@ class MediumPluginManagerDialog : public KDialogBase private: - QVBox *m_devicesBox; - QGroupBox *m_location; + TQVBox *m_devicesBox; + TQGroupBox *m_location; MediumPluginManager *m_manager; }; @@ -137,18 +137,18 @@ class ManualDeviceAdder : public KDialogBase ~ManualDeviceAdder(); bool successful() const { return m_successful; } Medium* getMedium( bool recreate = false ); - QString getPlugin() const { return m_selectedPlugin; } + TQString getPlugin() const { return m_selectedPlugin; } private slots: void slotCancel(); void slotOk(); - void comboChanged( const QString & ); + void comboChanged( const TQString & ); private: MediumPluginManager* m_mpm; bool m_successful; - QString m_comboOldText; - QString m_selectedPlugin; + TQString m_comboOldText; + TQString m_selectedPlugin; Medium *m_newMed; KComboBox* m_mdaCombo; diff --git a/amarok/src/metabundle.cpp b/amarok/src/metabundle.cpp index 00fd42c5..be71b78e 100644 --- a/amarok/src/metabundle.cpp +++ b/amarok/src/metabundle.cpp @@ -28,8 +28,8 @@ #include #include #include -#include -#include //decodePath() +#include +#include //decodePath() #include #include #include //used to load genre list @@ -80,7 +80,7 @@ MetaBundle::EmbeddedImage::EmbeddedImage( const TagLib::ByteVector& data, const m_data.duplicate( data.data(), data.size() ); } -const QCString &MetaBundle::EmbeddedImage::hash() const +const TQCString &MetaBundle::EmbeddedImage::hash() const { if( m_hash.isEmpty() ) { m_hash = KMD5( m_data ).hexDigest(); @@ -88,9 +88,9 @@ const QCString &MetaBundle::EmbeddedImage::hash() const return m_hash; } -bool MetaBundle::EmbeddedImage::save( const QDir& dir ) const +bool MetaBundle::EmbeddedImage::save( const TQDir& dir ) const { - QFile file( dir.filePath( hash() ) ); + TQFile file( dir.filePath( hash() ) ); if( file.open( IO_WriteOnly | IO_Raw ) ) { const Q_LONG s = file.writeBlock( m_data.data(), m_data.size() ); @@ -105,14 +105,14 @@ bool MetaBundle::EmbeddedImage::save( const QDir& dir ) const } /// These are untranslated and used for storing/retrieving XML playlist -const QString &MetaBundle::exactColumnName( int c ) //static +const TQString &MetaBundle::exactColumnName( int c ) //static { // construct static qstrings to avoid constructing them all the time - static QString columns[] = { + static TQString columns[] = { "Filename", "Title", "Artist", "AlbumArtist", "Composer", "Year", "Album", "DiscNumber", "Track", "BPM", "Genre", "Comment", "Directory", "Type", "Length", "Bitrate", "SampleRate", "Score", "Rating", "PlayCount", "LastPlayed", "Mood", "Filesize" }; - static QString error( "ERROR" ); + static TQString error( "ERROR" ); if ( c >= 0 && c < NUM_COLUMNS ) return columns[c]; @@ -120,7 +120,7 @@ const QString &MetaBundle::exactColumnName( int c ) //static return error; } -const QString MetaBundle::prettyColumnName( int index ) //static +const TQString MetaBundle::prettyColumnName( int index ) //static { switch( index ) { @@ -151,7 +151,7 @@ const QString MetaBundle::prettyColumnName( int index ) //static return "This is a bug."; } -int MetaBundle::columnIndex( const QString &name ) +int MetaBundle::columnIndex( const TQString &name ) { for( int i = 0; i < NUM_COLUMNS; ++i ) if( exactColumnName( i ).lower() == name.lower() ) @@ -160,7 +160,7 @@ int MetaBundle::columnIndex( const QString &name ) } MetaBundle::MetaBundle() - : m_uniqueId( QString::null ) + : m_uniqueId( TQString::null ) , m_year( Undetermined ) , m_discNumber( Undetermined ) , m_track( Undetermined ) @@ -181,8 +181,8 @@ MetaBundle::MetaBundle() , m_notCompilation( false ) , m_safeToSave( false ) , m_waitingOnKIO( 0 ) - , m_tempSavePath( QString::null ) - , m_origRenamedSavePath( QString::null ) + , m_tempSavePath( TQString::null ) + , m_origRenamedSavePath( TQString::null ) , m_tempSaveDigest( 0 ) , m_saveFileref( 0 ) , m_podcastBundle( 0 ) @@ -195,7 +195,7 @@ MetaBundle::MetaBundle() MetaBundle::MetaBundle( const KURL &url, bool noCache, TagLib::AudioProperties::ReadStyle readStyle, EmbeddedImageList* images ) : m_url( url ) - , m_uniqueId( QString::null ) + , m_uniqueId( TQString::null ) , m_year( Undetermined ) , m_discNumber( Undetermined ) , m_track( Undetermined ) @@ -210,14 +210,14 @@ MetaBundle::MetaBundle( const KURL &url, bool noCache, TagLib::AudioProperties:: , m_filesize( Undetermined ) , m_moodbar( 0 ) , m_type( other ) - , m_exists( isFile() && QFile::exists( url.path() ) ) + , m_exists( isFile() && TQFile::exists( url.path() ) ) , m_isValidMedia( false ) , m_isCompilation( false ) , m_notCompilation( false ) , m_safeToSave( false ) , m_waitingOnKIO( 0 ) - , m_tempSavePath( QString::null ) - , m_origRenamedSavePath( QString::null ) + , m_tempSavePath( TQString::null ) + , m_origRenamedSavePath( TQString::null ) , m_tempSaveDigest( 0 ) , m_saveFileref( 0 ) , m_podcastBundle( 0 ) @@ -242,17 +242,17 @@ MetaBundle::MetaBundle( const KURL &url, bool noCache, TagLib::AudioProperties:: } //StreamProvider ctor -MetaBundle::MetaBundle( const QString& title, - const QString& streamUrl, +MetaBundle::MetaBundle( const TQString& title, + const TQString& streamUrl, const int bitrate, - const QString& genre, - const QString& streamName, + const TQString& genre, + const TQString& streamName, const KURL& url ) : m_url ( url ) , m_genre ( genre ) , m_streamName( streamName ) , m_streamUrl ( streamUrl ) - , m_uniqueId( QString::null ) + , m_uniqueId( TQString::null ) , m_year( 0 ) , m_discNumber( 0 ) , m_track( 0 ) @@ -273,8 +273,8 @@ MetaBundle::MetaBundle( const QString& title, , m_notCompilation( false ) , m_safeToSave( false ) , m_waitingOnKIO( 0 ) - , m_tempSavePath( QString::null ) - , m_origRenamedSavePath( QString::null ) + , m_tempSavePath( TQString::null ) + , m_origRenamedSavePath( TQString::null ) , m_tempSaveDigest( 0 ) , m_saveFileref( 0 ) , m_podcastBundle( 0 ) @@ -381,7 +381,7 @@ MetaBundle::operator=( const MetaBundle& bundle ) bool MetaBundle::checkExists() { - m_exists = !isFile() || QFile::exists( url().path() ); + m_exists = !isFile() || TQFile::exists( url().path() ); return m_exists; } @@ -447,11 +447,11 @@ MetaBundle::init( const KFileMetaInfo& info ) m_title = itemtitle.isValid() ? itemtitle.string() : prettyTitle( m_url.fileName() ); const KFileMetaInfoItem itemid = info.item( "Unique ID" ); - m_uniqueId = itemid.isValid() ? itemid.string() : QString::null; + m_uniqueId = itemid.isValid() ? itemid.string() : TQString::null; // because whoever designed KMetaInfoItem is a donkey #define makeSane( x ) if( x == "---" ) x = null; - QString null; + TQString null; makeSane( m_artist ); makeSane( m_album ); makeSane( m_comment ); @@ -473,7 +473,7 @@ MetaBundle::embeddedImages( MetaBundle::EmbeddedImageList& images ) const { if ( isFile() ) { - TagLib::FileRef fileref = TagLib::FileRef( QFile::encodeName( url().path() ), false ); + TagLib::FileRef fileref = TagLib::FileRef( TQFile::encodeName( url().path() ), false ); if ( !fileref.isNull() ) { if ( TagLib::MPEG::File *file = dynamic_cast( fileref.file() ) ) { if ( file->ID3v2Tag() ) @@ -497,16 +497,16 @@ MetaBundle::readTags( TagLib::AudioProperties::ReadStyle readStyle, EmbeddedImag if( !isFile() ) return; - const QString path = url().path(); + const TQString path = url().path(); TagLib::FileRef fileref; TagLib::Tag *tag = 0; - fileref = TagLib::FileRef( QFile::encodeName( path ), true, readStyle ); + fileref = TagLib::FileRef( TQFile::encodeName( path ), true, readStyle ); if( !fileref.isNull() ) { setUniqueId( readUniqueId( &fileref ) ); - m_filesize = QFile( path ).size(); + m_filesize = TQFile( path ).size(); tag = fileref.tag(); if ( tag ) @@ -528,8 +528,8 @@ MetaBundle::readTags( TagLib::AudioProperties::ReadStyle readStyle, EmbeddedImag /* As mpeg implementation on TagLib uses a Tag class that's not defined on the headers, we have to cast the files, not the tags! */ - QString disc; - QString compilation; + TQString disc; + TQString compilation; if ( TagLib::MPEG::File *file = dynamic_cast( fileref.file() ) ) { m_type = mp3; @@ -602,9 +602,9 @@ MetaBundle::readTags( TagLib::AudioProperties::ReadStyle readStyle, EmbeddedImag if( mp4tag ) { setComposer( TStringToQString( mp4tag->composer() ) ); - setBpm( QString::number( mp4tag->bpm() ).toFloat() ); - disc = QString::number( mp4tag->disk() ); - compilation = QString::number( mp4tag->compilation() ); + setBpm( TQString::number( mp4tag->bpm() ).toFloat() ); + disc = TQString::number( mp4tag->disk() ); + compilation = TQString::number( mp4tag->compilation() ); if ( images && mp4tag->cover().size() ) { images->push_back( EmbeddedImage( mp4tag->cover(), "" ) ); } @@ -638,7 +638,7 @@ MetaBundle::readTags( TagLib::AudioProperties::ReadStyle readStyle, EmbeddedImag //FIXME disabled for beta4 as it's simpler to not got 100 bug reports //else if( KMimeType::findByUrl( m_url )->is( "audio" ) ) - // init( KFileMetaInfo( m_url, QString::null, KFileMetaInfo::Everything ) ); + // init( KFileMetaInfo( m_url, TQString::null, KFileMetaInfo::Everything ) ); } void MetaBundle::updateFilesize() @@ -649,8 +649,8 @@ void MetaBundle::updateFilesize() return; } - const QString path = url().path(); - m_filesize = QFile( path ).size(); + const TQString path = url().path(); + m_filesize = TQFile( path ).size(); } float MetaBundle::score( bool ensureCached ) const @@ -733,10 +733,10 @@ void MetaBundle::copyFrom( const PodcastEpisodeBundle &peb ) if( !pcb.title().isEmpty() ) setAlbum( pcb.title() ); } - setGenre( QString ( "Podcast" ) ); + setGenre( TQString ( "Podcast" ) ); } -void MetaBundle::setExactText( int column, const QString &newText ) +void MetaBundle::setExactText( int column, const TQString &newText ) { switch( column ) { @@ -764,7 +764,7 @@ void MetaBundle::setExactText( int column, const QString &newText ) } } -QString MetaBundle::exactText( int column, bool ensureCached ) const +TQString MetaBundle::exactText( int column, bool ensureCached ) const { switch( column ) { @@ -773,33 +773,33 @@ QString MetaBundle::exactText( int column, bool ensureCached ) const case Artist: return artist(); case AlbumArtist: return albumArtist(); case Composer: return composer(); - case Year: return QString::number( year() ); + case Year: return TQString::number( year() ); case Album: return album(); - case DiscNumber: return QString::number( discNumber() ); - case Track: return QString::number( track() ); - case Bpm: return QString::number( bpm() ); + case DiscNumber: return TQString::number( discNumber() ); + case Track: return TQString::number( track() ); + case Bpm: return TQString::number( bpm() ); case Genre: return genre(); case Comment: return comment(); case Directory: return directory(); - case Type: return QString::number( fileType() ); - case Length: return QString::number( length() ); - case Bitrate: return QString::number( bitrate() ); - case SampleRate: return QString::number( sampleRate() ); - case Score: return QString::number( score( ensureCached ) ); - case Rating: return QString::number( rating( ensureCached ) ); - case PlayCount: return QString::number( playCount( ensureCached ) ); - case LastPlayed: return QString::number( lastPlay( ensureCached ) ); - case Filesize: return QString::number( filesize() ); - case Mood: return QString(); + case Type: return TQString::number( fileType() ); + case Length: return TQString::number( length() ); + case Bitrate: return TQString::number( bitrate() ); + case SampleRate: return TQString::number( sampleRate() ); + case Score: return TQString::number( score( ensureCached ) ); + case Rating: return TQString::number( rating( ensureCached ) ); + case PlayCount: return TQString::number( playCount( ensureCached ) ); + case LastPlayed: return TQString::number( lastPlay( ensureCached ) ); + case Filesize: return TQString::number( filesize() ); + case Mood: return TQString(); default: warning() << "Tried to get the text of a nonexistent column! [" << column << endl; } - return QString(); //shouldn't happen + return TQString(); //shouldn't happen } -QString MetaBundle::prettyText( int column ) const +TQString MetaBundle::prettyText( int column ) const { - QString text; + TQString text; switch( column ) { case Filename: text = isFile() ? MetaBundle::prettyTitle(filename()) : url().prettyURL(); break; @@ -807,27 +807,27 @@ QString MetaBundle::prettyText( int column ) const case Artist: text = artist(); break; case AlbumArtist: text = albumArtist(); break; case Composer: text = composer(); break; - case Year: text = year() ? QString::number( year() ) : QString::null; break; + case Year: text = year() ? TQString::number( year() ) : TQString::null; break; case Album: text = album(); break; - case DiscNumber: text = discNumber() ? QString::number( discNumber() ) : QString::null; break; - case Bpm: text = bpm() ? QString::number( bpm() ) : QString::null; break; - case Track: text = track() ? QString::number( track() ) : QString::null; break; + case DiscNumber: text = discNumber() ? TQString::number( discNumber() ) : TQString::null; break; + case Bpm: text = bpm() ? TQString::number( bpm() ) : TQString::null; break; + case Track: text = track() ? TQString::number( track() ) : TQString::null; break; case Genre: text = genre(); break; case Comment: text = comment(); break; - case Directory: text = url().isEmpty() ? QString() : directory(); break; - case Type: text = url().isEmpty() ? QString() : type(); break; + case Directory: text = url().isEmpty() ? TQString() : directory(); break; + case Type: text = url().isEmpty() ? TQString() : type(); break; case Length: text = prettyLength( length(), true ); break; case Bitrate: text = prettyBitrate( bitrate() ); break; case SampleRate: text = prettySampleRate(); break; - case Score: text = QString::number( static_cast( score() ) ); break; + case Score: text = TQString::number( static_cast( score() ) ); break; case Rating: text = prettyRating(); break; - case PlayCount: text = QString::number( playCount() ); break; + case PlayCount: text = TQString::number( playCount() ); break; case LastPlayed: text = Amarok::verboseTimeSince( lastPlay() ); break; case Filesize: text = prettyFilesize(); break; case Mood: text = moodbar_const().state() == Moodbar::JobRunning ? i18n( "Calculating..." ) : moodbar_const().state() == Moodbar::JobQueued ? i18n( "Queued..." ) - : QString::null; + : TQString::null; break; default: warning() << "Tried to get the text of a nonexistent column!" << endl; break; } @@ -835,9 +835,9 @@ QString MetaBundle::prettyText( int column ) const return text.stripWhiteSpace(); } -bool MetaBundle::matchesSimpleExpression( const QString &expression, const QValueList &columns ) const +bool MetaBundle::matchesSimpleExpression( const TQString &expression, const TQValueList &columns ) const { - const QStringList terms = QStringList::split( ' ', expression.lower() ); + const TQStringList terms = TQStringList::split( ' ', expression.lower() ); bool matches = true; for( uint x = 0; matches && x < terms.count(); ++x ) { @@ -851,7 +851,7 @@ bool MetaBundle::matchesSimpleExpression( const QString &expression, const QValu return matches; } -void MetaBundle::reactToChanges( const QValueList& columns) +void MetaBundle::reactToChanges( const TQValueList& columns) { // mark search dirty if we need to for (uint i = 0; !m_isSearchDirty && i < columns.count(); i++) @@ -859,7 +859,7 @@ void MetaBundle::reactToChanges( const QValueList& columns) m_isSearchDirty = true; } -bool MetaBundle::matchesFast(const QStringList &terms, ColumnMask columnMask) const +bool MetaBundle::matchesFast(const TQStringList &terms, ColumnMask columnMask) const { // simple search for rating, last played, etc. makes no sense and it hurts us a // lot if we have to fetch it from the db. so zero them out @@ -898,12 +898,12 @@ bool MetaBundle::matchesFast(const QStringList &terms, ColumnMask columnMask) co } -bool MetaBundle::matchesExpression( const QString &expression, const QValueList &defaultColumns ) const +bool MetaBundle::matchesExpression( const TQString &expression, const TQValueList &defaultColumns ) const { return matchesParsedExpression( ExpressionParser::parse( expression ), defaultColumns ); } -bool MetaBundle::matchesParsedExpression( const ParsedExpression &data, const QValueList &defaults ) const +bool MetaBundle::matchesParsedExpression( const ParsedExpression &data, const TQValueList &defaults ) const { for( uint i = 0, n = data.count(); i < n; ++i ) //check each part for matchiness { @@ -914,7 +914,7 @@ bool MetaBundle::matchesParsedExpression( const ParsedExpression &data, const QV int column = -1; if( !e.field.isEmpty() ) { - QString field = e.field.lower(); + TQString field = e.field.lower(); column = columnIndex( field ); if( column == -1 ) { @@ -934,7 +934,7 @@ bool MetaBundle::matchesParsedExpression( const ParsedExpression &data, const QV } if( column >= 0 ) //a field was specified and it exists { - QString q = e.text, v = prettyText( column ).lower(), w = q.lower(); + TQString q = e.text, v = prettyText( column ).lower(), w = q.lower(); //q = query, v = contents of the field, w = match against it bool condition; //whether it matches, not taking e.negateation into account @@ -959,11 +959,11 @@ bool MetaBundle::matchesParsedExpression( const ParsedExpression &data, const QV if( column == Filesize ) { - v = QString::number( filesize() ); + v = TQString::number( filesize() ); if( w.endsWith( "m" ) ) - w = QString::number( w.left( w.length()-1 ).toLong() * 1024 * 1024 ); + w = TQString::number( w.left( w.length()-1 ).toLong() * 1024 * 1024 ); else if( w.endsWith( "k" ) ) - w = QString::number( w.left( w.length()-1 ).toLong() * 1024 ); + w = TQString::number( w.left( w.length()-1 ).toLong() * 1024 ); } if( e.match == expression_element::More ) @@ -1041,7 +1041,7 @@ bool MetaBundle::matchesParsedExpression( const ParsedExpression &data, const QV QString MetaBundle::prettyTitle() const { - QString s = artist(); + TQString s = artist(); //NOTE this gets regressed often, please be careful! // whatever you do, handle the stream case, streams have no artist but have an excellent title @@ -1061,7 +1061,7 @@ MetaBundle::prettyTitle() const QString MetaBundle::veryNiceTitle() const { - QString s; + TQString s; //NOTE I'm not sure, but the notes and FIXME's in the prettyTitle function should be fixed now. // If not then they do apply to this function also! if( !title().isEmpty() ) @@ -1079,9 +1079,9 @@ MetaBundle::veryNiceTitle() const } QString -MetaBundle::prettyTitle( const QString &filename ) //static +MetaBundle::prettyTitle( const TQString &filename ) //static { - QString s = filename; //just so the code is more readable + TQString s = filename; //just so the code is more readable //remove .part extension if it exists if (s.endsWith( ".part" )) @@ -1101,13 +1101,13 @@ MetaBundle::prettyLength( int seconds, bool showHours ) //static if( seconds == Undetermined ) return "?"; if( seconds == Irrelevant ) return "-"; - return QString(); //Unavailable = "" + return TQString(); //Unavailable = "" } QString MetaBundle::prettyTime( uint seconds, bool showHours ) //static { - QString s = QChar( ':' ); + TQString s = TQChar( ':' ); s.append( zeroPad( seconds % 60 ) ); //seconds seconds /= 60; @@ -1119,7 +1119,7 @@ MetaBundle::prettyTime( uint seconds, bool showHours ) //static } //don't zeroPad the last one, as it can be greater than 2 digits - s.prepend( QString::number( seconds ) ); //hours or minutes depending on above if block + s.prepend( TQString::number( seconds ) ); //hours or minutes depending on above if block return s; } @@ -1132,17 +1132,17 @@ MetaBundle::veryPrettyTime( int time ) if( time == Irrelevant ) return i18n( "-" ); - QStringList s; - s << QString::number( time % 60 ); //seconds + TQStringList s; + s << TQString::number( time % 60 ); //seconds time /= 60; if( time ) - s << QString::number( time % 60 ); //minutes + s << TQString::number( time % 60 ); //minutes time /= 60; if( time ) - s << QString::number( time % 24 ); //hours + s << TQString::number( time % 24 ); //hours time /= 24; if( time ) - s << QString::number( time ); //days + s << TQString::number( time ); //days switch( s.count() ) { @@ -1157,7 +1157,7 @@ MetaBundle::veryPrettyTime( int time ) QString MetaBundle::fuzzyTime( int time ) { - QString s; + TQString s; int secs=0, min=0, hr=0, day=0, week=0; if( time == Undetermined ) @@ -1203,9 +1203,9 @@ MetaBundle::fuzzyTime( int time ) } } - QString weeks = i18n( "1 week %1", "%n weeks %1", week ); - QString days = i18n( "1 day %1", "%n days %1", day ); - QString hours = i18n( "1 hour", "%n hours", hr ); + TQString weeks = i18n( "1 week %1", "%n weeks %1", week ); + TQString days = i18n( "1 day %1", "%n days %1", day ); + TQString hours = i18n( "1 hour", "%n hours", hr ); if( week ) return weeks.arg( day ? days.arg("") : "" ).simplifyWhiteSpace(); @@ -1221,7 +1221,7 @@ QString MetaBundle::prettyBitrate( int i ) { //the point here is to force sharing of these strings returned from prettyBitrate() - static const QString bitrateStore[9] = { + static const TQString bitrateStore[9] = { "?", "32", "64", "96", "128", "160", "192", "224", "256" }; return (i >=0 && i <= 256 && i % 32 == 0) @@ -1239,9 +1239,9 @@ QString MetaBundle::prettyRating( int r, bool trailingzero ) //static { if( trailingzero ) - return QString::number( float( r ) / 2, 'f', 1 ); + return TQString::number( float( r ) / 2, 'f', 1 ); else - return r ? QString::number( float( r ) / 2 ) : QString(); + return r ? TQString::number( float( r ) / 2 ) : TQString(); } QString @@ -1267,8 +1267,8 @@ MetaBundle::ratingDescription( int r ) QStringList MetaBundle::ratingList() { - QString s = i18n( "rating - description", "%1 - %2" ); - QStringList list; + TQString s = i18n( "rating - description", "%1 - %2" ); + TQStringList list; list += ratingDescription( 0 ); for ( int i = 1; i<=10; i++ ) list += s.arg( prettyRating( i, true ) ).arg( ratingDescription( i ) ); @@ -1278,7 +1278,7 @@ MetaBundle::ratingList() QStringList MetaBundle::genreList() //static { - QStringList list; + TQStringList list; TagLib::StringList genres = TagLib::ID3v1::genreList(); for( TagLib::StringList::ConstIterator it = genres.begin(), end = genres.end(); it != end; ++it ) @@ -1290,7 +1290,7 @@ MetaBundle::genreList() //static } void -MetaBundle::setExtendedTag( TagLib::File *file, int tag, const QString value ) +MetaBundle::setExtendedTag( TagLib::File *file, int tag, const TQString value ) { const char *id = 0; @@ -1464,7 +1464,7 @@ MetaBundle::save( TagLib::FileRef* fileref ) TagLib::FileRef* f; if( !passedin ) - f = new TagLib::FileRef( QFile::encodeName( url().path() ), false ); + f = new TagLib::FileRef( TQFile::encodeName( url().path() ), false ); else f = fileref; @@ -1484,10 +1484,10 @@ MetaBundle::save( TagLib::FileRef* fileref ) { setExtendedTag( f->file(), albumArtistTag, albumArtist() ); setExtendedTag( f->file(), composerTag, composer().string().stripWhiteSpace() ); - setExtendedTag( f->file(), discNumberTag, discNumber() ? QString::number( discNumber() ) : QString() ); - setExtendedTag( f->file(), bpmTag, bpm() ? QString::number( bpm() ) : QString() ); + setExtendedTag( f->file(), discNumberTag, discNumber() ? TQString::number( discNumber() ) : TQString() ); + setExtendedTag( f->file(), bpmTag, bpm() ? TQString::number( bpm() ) : TQString() ); if ( compilation() != CompilationUnknown ) - setExtendedTag( f->file(), compilationTag, QString::number( compilation() ) ); + setExtendedTag( f->file(), compilationTag, TQString::number( compilation() ) ); } if( !passedin ) { @@ -1508,12 +1508,12 @@ MetaBundle::save( TagLib::FileRef* fileref ) // QT's version encodeAttr is 1) private to QDom, and 2) a litte slow. This // one can be made public if needed. It happens to be on a critical path -// (each char of playlist / undo save). QStyleSheet::escape does not deal with +// (each char of playlist / undo save). TQStyleSheet::escape does not deal with // unicode chars illegal for XML. There's a lot of junk in those tags -static inline void xmlEncode(QTextStream &stream, const QString &str) +static inline void xmlEncode(TQTextStream &stream, const TQString &str) { - QString tmp; - const QString *cur = &str; + TQString tmp; + const TQString *cur = &str; uint i = 0; while ( i < cur->length() ) { @@ -1547,14 +1547,14 @@ static inline void xmlEncode(QTextStream &stream, const QString &str) i = 0; // now write escaped string if ( escaped[0] ) stream << escaped; - else stream << "&#x" << QString::number(uc, 16) << ';'; + else stream << "&#x" << TQString::number(uc, 16) << ';'; } else i++; } if (!cur->isEmpty()) stream << *cur; } -bool MetaBundle::save(QTextStream &stream, const QStringList &attributes) const +bool MetaBundle::save(TQTextStream &stream, const TQStringList &attributes) const { // QDom is too slow to use here stream << " \n"; // end of for (int i = 0; i < NUM_COLUMNS; ++i) { if ( i == Filename ) continue; // the file name is already in the URL - const QString &tag = exactColumnName( i ); + const TQString &tag = exactColumnName( i ); // 2 indents stream << " <" << tag << ">"; xmlEncode( stream, exactText( i, true ) ); @@ -1580,16 +1580,16 @@ bool MetaBundle::save(QTextStream &stream, const QStringList &attributes) const void MetaBundle::setUrl( const KURL &url ) { - QValueList changes; + TQValueList changes; for( int i = 0; i < NUM_COLUMNS; ++i ) changes << i; aboutToChange( changes ); m_url = url; reactToChanges( changes ); setUniqueId(); } -void MetaBundle::setPath( const QString &path ) +void MetaBundle::setPath( const TQString &path ) { - QValueList changes; + TQValueList changes; for( int i = 0; i < NUM_COLUMNS; ++i ) changes << i; aboutToChange( changes ); m_url.setPath( path ); reactToChanges( changes ); @@ -1604,7 +1604,7 @@ void MetaBundle::setUniqueId() m_uniqueId = CollectionDB::instance()->uniqueIdFromUrl( url() ); } -void MetaBundle::setUniqueId( const QString &id ) +void MetaBundle::setUniqueId( const TQString &id ) { //WARNING WARNING WARNING //Don't call this function if you don't know what you're doing! @@ -1661,26 +1661,26 @@ MetaBundle::readUniqueId( TagLib::FileRef* fileref ) if( !fileref && isFile() ) { - const QString path = url().path(); + const TQString path = url().path(); //Make it get cleaned up at the end of the function automagically - tmpfileref = TagLib::FileRef( QFile::encodeName( path ), true, TagLib::AudioProperties::Fast ); + tmpfileref = TagLib::FileRef( TQFile::encodeName( path ), true, TagLib::AudioProperties::Fast ); fileref = &tmpfileref; } if( !fileref || fileref->isNull() ) - return QString(); + return TQString(); TagLib::ByteVector bv = readUniqueIdHelper( *fileref ); //get our unique id KMD5 md5( 0, 0 ); - QFile qfile( url().path() ); + TQFile qfile( url().path() ); char databuf[8192]; int readlen = 0; - QCString size = 0; - QString returnval; + TQCString size = 0; + TQString returnval; md5.update( bv.data(), bv.size() ); @@ -1690,13 +1690,13 @@ MetaBundle::readUniqueId( TagLib::FileRef* fileref ) { md5.update( databuf, readlen ); md5.update( size.setNum( (ulong)qfile.size() ) ); - return QString( md5.hexDigest().data() ); + return TQString( md5.hexDigest().data() ); } else - return QString(); + return TQString(); } - return QString::null; + return TQString::null; } int @@ -1723,10 +1723,10 @@ MetaBundle::getRandomString( int size, bool numbersOnly ) if( size != 8 ) { debug() << "Wrong size passed in!" << endl; - return QString(); + return TQString(); } - QString str; + TQString str; //do a memory op once, much faster than doing multiple later, especially since we know how big it will be str.reserve( size ); int i = getRand(); //seed it @@ -1762,7 +1762,7 @@ MetaBundle::getRandomString( int size, bool numbersOnly ) return str; } -void MetaBundle::setTitle( const QString &title ) +void MetaBundle::setTitle( const TQString &title ) { aboutToChange( Title ); m_title = title; reactToChange( Title ); } void MetaBundle::setArtist( const AtomicString &artist ) @@ -1845,25 +1845,25 @@ void MetaBundle::detach() //m_url.detach(); m_url = Amarok::detachedKURL( m_url ); - m_title = QDeepCopy(m_title); + m_title = TQDeepCopy(m_title); m_artist = m_artist.deepCopy(); m_albumArtist = m_albumArtist.deepCopy(); m_album = m_album.deepCopy(); m_comment = m_comment.deepCopy(); m_composer = m_composer.deepCopy(); m_genre = m_genre.deepCopy(); - m_streamName = QDeepCopy(m_streamName); - m_streamUrl = QDeepCopy(m_streamUrl); + m_streamName = TQDeepCopy(m_streamName); + m_streamUrl = TQDeepCopy(m_streamUrl); if( m_moodbar != 0 ) m_moodbar->detach(); - m_uniqueId = QDeepCopy( m_uniqueId ); + m_uniqueId = TQDeepCopy( m_uniqueId ); if ( m_podcastBundle ) - setPodcastBundle( QDeepCopy( *m_podcastBundle ) ); + setPodcastBundle( TQDeepCopy( *m_podcastBundle ) ); if ( m_lastFmBundle ) - setLastFmBundle( QDeepCopy( *m_lastFmBundle ) ); + setLastFmBundle( TQDeepCopy( *m_lastFmBundle ) ); } @@ -1873,11 +1873,11 @@ void PodcastEpisodeBundle::detach() m_localUrl = Amarok::detachedKURL( m_localUrl ); m_parent = Amarok::detachedKURL( m_parent ); - m_author = QDeepCopy(m_author); - m_title = QDeepCopy(m_title); - m_subtitle = QDeepCopy(m_subtitle); - m_description = QDeepCopy(m_subtitle); - m_date = QDeepCopy(m_date); - m_type = QDeepCopy(m_type); - m_guid = QDeepCopy(m_guid); + m_author = TQDeepCopy(m_author); + m_title = TQDeepCopy(m_title); + m_subtitle = TQDeepCopy(m_subtitle); + m_description = TQDeepCopy(m_subtitle); + m_date = TQDeepCopy(m_date); + m_type = TQDeepCopy(m_type); + m_guid = TQDeepCopy(m_guid); } diff --git a/amarok/src/metabundle.h b/amarok/src/metabundle.h index 2bfc6f63..98d20161 100644 --- a/amarok/src/metabundle.h +++ b/amarok/src/metabundle.h @@ -11,7 +11,7 @@ #define PRETTY_TITLE_CACHE #endif -#include +#include #include //inline functions #include //inline functions #include @@ -22,9 +22,9 @@ #include "amarok_export.h" class KFileMetaInfo; -class QDir; -class QTextStream; -template class QValueList; +class TQDir; +class TQTextStream; +template class TQValueList; namespace TagLib { class ByteVector; class File; @@ -89,17 +89,17 @@ public: EmbeddedImage() {} EmbeddedImage( const TagLib::ByteVector& data, const TagLib::String& description ); - const QCString &hash() const; - const QString &description() const { return m_description; } - bool save( const QDir& dir ) const; + const TQCString &hash() const; + const TQString &description() const { return m_description; } + bool save( const TQDir& dir ) const; private: - QByteArray m_data; - QString m_description; - mutable QCString m_hash; + TQByteArray m_data; + TQString m_description; + mutable TQCString m_hash; }; - typedef QValueList EmbeddedImageList; + typedef TQValueList EmbeddedImageList; /** This is a bit vector for selecting columns. It's very fast to compare in matchFast. It might be a good idea to replace the QValue @@ -107,11 +107,11 @@ public: typedef Q_UINT32 ColumnMask; /** Returns the name of the column at \p index as a string -- not i18ned, for internal purposes. */ - static const QString &exactColumnName( int index ); + static const TQString &exactColumnName( int index ); /** Returns the name of the column at \p index as a string -- i18ned, for display purposes. */ - static const QString prettyColumnName( int index ); + static const TQString prettyColumnName( int index ); /** Returns the index of the column with the not i18ned name \p name. */ - static int columnIndex( const QString &name ); + static int columnIndex( const TQString &name ); // These values are stored on the Database, so, don't change the order. Only append new ones to the end. enum FileType { other, mp3, ogg, wma, mp4, flac, ra, rv, rm, rmj, rmvb, asf }; @@ -134,11 +134,11 @@ public: EmbeddedImageList* images = 0 ); /** For the StreamProvider */ - LIBAMAROK_EXPORT MetaBundle( const QString &title, - const QString &streamUrl, + LIBAMAROK_EXPORT MetaBundle( const TQString &title, + const TQString &streamUrl, const int bitrate, - const QString &genre, - const QString &streamName, + const TQString &genre, + const TQString &streamName, const KURL &url ); LIBAMAROK_EXPORT MetaBundle( const MetaBundle &bundle ); @@ -174,7 +174,7 @@ public: bool save( TagLib::FileRef* fileref = 0 ); /** Saves the MetaBundle's data as XML to a text stream. */ - bool save( QTextStream &stream, const QStringList &attributes = QStringList() ) const; + bool save( TQTextStream &stream, const TQStringList &attributes = TQStringList() ) const; /** Returns whether the url referred to is a local file */ bool isFile() const; @@ -195,20 +195,20 @@ public: /** Returns a string representation of the tag at \p column, in a format suitable for internal purposes. For example, for a track 3:24 long, it'll return "204" (seconds). This should not be used for displaying the tag to the user. */ - QString exactText( int column, bool ensureCached = false ) const; + TQString exactText( int column, bool ensureCached = false ) const; /** Sets the tag at \p column from a string in the same format as returned by exactText(). */ - void setExactText( int column, const QString &text ); + void setExactText( int column, const TQString &text ); /** Returns the tag at \p column in a format suitable for displaying to the user. */ - QString prettyText( int column ) const; + TQString prettyText( int column ) const; /** Returns whether the bundle matches \p expression. This is fast and doesn't take advanced syntax into account, and should only be used when it is certain none is present. The tags in \p columns are checked for matches. @see ExpressionParser::isAdvancedExpression() */ - bool matchesSimpleExpression( const QString &expression, const QValueList &columns ) const; + bool matchesSimpleExpression( const TQString &expression, const TQValueList &columns ) const; /** A faster version of the above, that pre-caches all the data to be searched in a single string, to avoid re-building integer and lower @@ -217,17 +217,17 @@ public: although it's highly unlikely to crash. Consider this the beginning of a real super-efficient index (e.g. suffix tree). \p terms is a list of lower-case words. */ - bool matchesFast(const QStringList &terms, ColumnMask columns) const; + bool matchesFast(const TQStringList &terms, ColumnMask columns) const; /** Returns whether the bundle matches \p expression. This takes advanced syntax into account, and is slightly slower than matchesSimpleExpression(). The tags in \p defaultColumns are checked for matches where the expression doesn't specify any manually. */ - bool matchesExpression( const QString &expression, const QValueList &defaultColumns ) const; + bool matchesExpression( const TQString &expression, const TQValueList &defaultColumns ) const; /** Returns whether the bundle matches the pre-parsed expression \p parsedData. The tags in \p defaultColumns are checked for matches where the expression doesn't specify any manually. @see ExpressionParser */ - bool matchesParsedExpression( const ParsedExpression &parsedData, const QValueList &defaultColumns ) const; + bool matchesParsedExpression( const ParsedExpression &parsedData, const TQValueList &defaultColumns ) const; /** PlaylistItem reimplements this so it can be informed of moodbar data events without having to use signals */ @@ -243,16 +243,16 @@ public: public: //accessors const KURL &url() const; - QString title() const; + TQString title() const; AtomicString artist() const; AtomicString albumArtist() const; AtomicString composer() const; AtomicString album() const; AtomicString genre() const; AtomicString comment() const; - QString filename() const; - QString directory() const; - QString type() const; + TQString filename() const; + TQString directory() const; + TQString type() const; int year() const; int discNumber() const; int track() const; @@ -275,27 +275,27 @@ public: //accessors bool exists() const; // true for everything but local files that aren't there PodcastEpisodeBundle *podcastBundle() const; LastFm::Bundle *lastFmBundle() const; - QString streamName() const; - QString streamUrl() const; - QString uniqueId() const; - - QString prettyTitle() const; - QString veryNiceTitle() const; - QString prettyURL() const; - QString prettyBitrate() const; - QString prettyLength() const; - QString prettySampleRate( bool shortened = false ) const; - QString prettyFilesize() const; - QString prettyRating() const; + TQString streamName() const; + TQString streamUrl() const; + TQString uniqueId() const; + + TQString prettyTitle() const; + TQString veryNiceTitle() const; + TQString prettyURL() const; + TQString prettyBitrate() const; + TQString prettyLength() const; + TQString prettySampleRate( bool shortened = false ) const; + TQString prettyFilesize() const; + TQString prettyRating() const; bool safeToSave() { return m_safeToSave; } - QString getRandomString( int size, bool numbersOnly = false ); + TQString getRandomString( int size, bool numbersOnly = false ); public: //modifiers void setUrl( const KURL &url ); - void setPath( const QString &path ); - void setTitle( const QString &title ); + void setPath( const TQString &path ); + void setTitle( const TQString &title ); void setArtist( const AtomicString &artist ); void setAlbumArtist( const AtomicString &albumArtist ); void setComposer( const AtomicString &composer ); @@ -324,53 +324,53 @@ public: //modifiers void setPodcastBundle( const PodcastEpisodeBundle &peb ); void setLastFmBundle( const LastFm::Bundle &last ); void setUniqueId(); //uses database for lookup - void setUniqueId( const QString &id ); //SEE COMMENT in .CPP + void setUniqueId( const TQString &id ); //SEE COMMENT in .CPP const TagLib::ByteVector readUniqueIdHelper( TagLib::FileRef fileref ) const; - QString readUniqueId( TagLib::FileRef *fileref = 0 ); + TQString readUniqueId( TagLib::FileRef *fileref = 0 ); void scannerAcknowledged() {} - void detach(); // for being able to apply QDeepCopy<> + void detach(); // for being able to apply TQDeepCopy<> public: //static helper functions - static QString prettyBitrate( int ); - static QString prettyLength( int, bool showHours = false ); //must be int, see Unavailable, etc. above - static QString prettyFilesize( int ); - static QString prettyRating( int rating, bool trailingzero = false ); - static QString ratingDescription( int ); - static QStringList ratingList(); - static QString prettyTime( uint, bool showHours = true ); - static QString fuzzyTime( int ); - static QString veryPrettyTime( int ); - static QString zeroPad( uint i ); - static QString prettyTitle( const QString &filename ); - static QStringList genreList(); + static TQString prettyBitrate( int ); + static TQString prettyLength( int, bool showHours = false ); //must be int, see Unavailable, etc. above + static TQString prettyFilesize( int ); + static TQString prettyRating( int rating, bool trailingzero = false ); + static TQString ratingDescription( int ); + static TQStringList ratingList(); + static TQString prettyTime( uint, bool showHours = true ); + static TQString fuzzyTime( int ); + static TQString veryPrettyTime( int ); + static TQString zeroPad( uint i ); + static TQString prettyTitle( const TQString &filename ); + static TQStringList genreList(); protected: enum ExtendedTags { composerTag, albumArtistTag, discNumberTag, bpmTag, compilationTag }; /** Called before the tags in \p columns are changed. */ - virtual void aboutToChange( const QValueList &columns ); + virtual void aboutToChange( const TQValueList &columns ); /** Convenience method. */ void aboutToChange( int column ); /** Called after the tags in \p columns are changed. */ - virtual void reactToChanges( const QValueList &columns ); + virtual void reactToChanges( const TQValueList &columns ); /** Convenience method. */ void reactToChange( int column ); KURL m_url; - QString m_title; + TQString m_title; AtomicString m_artist; AtomicString m_albumArtist; AtomicString m_composer; AtomicString m_album; AtomicString m_comment; AtomicString m_genre; - QString m_streamName; - QString m_streamUrl; - QString m_uniqueId; + TQString m_streamName; + TQString m_streamUrl; + TQString m_uniqueId; int m_year; int m_discNumber; @@ -396,9 +396,9 @@ protected: bool m_notCompilation: 1; bool m_safeToSave: 1; int m_waitingOnKIO; - QString m_tempSavePath; - QString m_origRenamedSavePath; - QCString m_tempSaveDigest; + TQString m_tempSavePath; + TQString m_origRenamedSavePath; + TQCString m_tempSaveDigest; TagLib::FileRef* m_saveFileref; PodcastEpisodeBundle *m_podcastBundle; @@ -415,10 +415,10 @@ protected: // the search string: textualized columns separated by space // note that matchFast searches by words, hence a word cannot span // space-separated columns - mutable QString m_searchStr; + mutable TQString m_searchStr; private: - static inline QString prettyGeneric( const QString &s, const int i ) + static inline TQString prettyGeneric( const TQString &s, const int i ) { return (i > 0) ? s.arg( i ) : (i == Undetermined) ? "?" : "-"; } @@ -426,7 +426,7 @@ private: void init( TagLib::AudioProperties *ap = 0 ); void init( const KFileMetaInfo& info ); - void setExtendedTag( TagLib::File *file, int tag, const QString value ); + void setExtendedTag( TagLib::File *file, int tag, const TQString value ); void loadImagesFromTag( const TagLib::ID3v2::Tag &tag, EmbeddedImageList& images ) const; @@ -434,7 +434,7 @@ private: }; /// for your convenience -typedef QValueList BundleList; +typedef TQValueList BundleList; @@ -449,9 +449,9 @@ inline bool MetaBundle::audioPropertiesUndetermined() const return m_bitrate == Undetermined || m_sampleRate == Undetermined || m_length == Undetermined; } -inline void MetaBundle::aboutToChange( const QValueList& ) { } -inline void MetaBundle::aboutToChange( int column ) { aboutToChange( QValueList() << column ); } -inline void MetaBundle::reactToChange( int column ) { reactToChanges( QValueList() << column ); } +inline void MetaBundle::aboutToChange( const TQValueList& ) { } +inline void MetaBundle::aboutToChange( int column ) { aboutToChange( TQValueList() << column ); } +inline void MetaBundle::reactToChange( int column ) { reactToChanges( TQValueList() << column ); } inline bool MetaBundle::exists() const { return m_exists; } @@ -482,21 +482,21 @@ inline const Moodbar &MetaBundle::moodbar_const() const } inline const KURL& MetaBundle::url() const { return m_url; } -inline QString MetaBundle::filename() const { return url().fileName(); } -inline QString MetaBundle::directory() const +inline TQString MetaBundle::filename() const { return url().fileName(); } +inline TQString MetaBundle::directory() const { return url().isLocalFile() ? url().directory() : url().upURL().prettyURL(); } -inline QString MetaBundle::title() const { return m_title; } +inline TQString MetaBundle::title() const { return m_title; } inline AtomicString MetaBundle::artist() const { return m_artist; } inline AtomicString MetaBundle::album() const { return m_album; } inline AtomicString MetaBundle::comment() const { return m_comment; } inline AtomicString MetaBundle::genre() const { return m_genre; } inline AtomicString MetaBundle::composer() const { return m_composer; } inline AtomicString MetaBundle::albumArtist() const { return m_albumArtist; } -inline QString MetaBundle::streamName() const { return m_streamName; } -inline QString MetaBundle::streamUrl() const { return m_streamUrl; } -inline QString MetaBundle::uniqueId() const { return m_uniqueId; } +inline TQString MetaBundle::streamName() const { return m_streamName; } +inline TQString MetaBundle::streamUrl() const { return m_streamUrl; } +inline TQString MetaBundle::uniqueId() const { return m_uniqueId; } inline int MetaBundle::discNumber() const { return m_discNumber == Undetermined ? 0 : m_discNumber; } inline float MetaBundle::bpm() const { return m_bpm == Undetermined ? 0 : m_bpm; } @@ -511,7 +511,7 @@ inline int MetaBundle::compilation() const } -inline QString MetaBundle::type() const +inline TQString MetaBundle::type() const { return isFile() ? filename().mid( filename().findRev( '.' ) + 1 ) @@ -520,12 +520,12 @@ inline QString MetaBundle::type() const inline PodcastEpisodeBundle *MetaBundle::podcastBundle() const { return m_podcastBundle; } inline LastFm::Bundle *MetaBundle::lastFmBundle() const { return m_lastFmBundle; } -inline QString MetaBundle::prettyURL() const { return url().prettyURL(); } -inline QString MetaBundle::prettyBitrate() const { return prettyBitrate( m_bitrate ); } -inline QString MetaBundle::prettyLength() const { return prettyLength( m_length, true ); } -inline QString MetaBundle::prettyFilesize() const { return prettyFilesize( filesize() ); } -inline QString MetaBundle::prettyRating() const { return prettyRating( rating() ); } -inline QString MetaBundle::prettySampleRate( bool shortened ) const +inline TQString MetaBundle::prettyURL() const { return url().prettyURL(); } +inline TQString MetaBundle::prettyBitrate() const { return prettyBitrate( m_bitrate ); } +inline TQString MetaBundle::prettyLength() const { return prettyLength( m_length, true ); } +inline TQString MetaBundle::prettyFilesize() const { return prettyFilesize( filesize() ); } +inline TQString MetaBundle::prettyRating() const { return prettyRating( rating() ); } +inline TQString MetaBundle::prettySampleRate( bool shortened ) const { if ( shortened ) return prettyGeneric( i18n( "SampleRate", "%1 kHz" ), m_sampleRate / 1000 ); @@ -533,7 +533,7 @@ inline QString MetaBundle::prettySampleRate( bool shortened ) const return prettyGeneric( i18n( "SampleRate", "%1 Hz" ), m_sampleRate ); } -inline QString MetaBundle::zeroPad( uint i ) { return ( i < 10 ) ? QString( "0%1" ).arg( i ) : QString::number( i ); } +inline TQString MetaBundle::zeroPad( uint i ) { return ( i < 10 ) ? TQString( "0%1" ).arg( i ) : TQString::number( i ); } inline bool MetaBundle::hasExtendedMetaInformation() const { diff --git a/amarok/src/metabundlesaver.cpp b/amarok/src/metabundlesaver.cpp index 45edb530..371b5b51 100644 --- a/amarok/src/metabundlesaver.cpp +++ b/amarok/src/metabundlesaver.cpp @@ -27,9 +27,9 @@ #include #include #include -#include //decodePath() -#include -#include +#include //decodePath() +#include +#include #include #include @@ -37,10 +37,10 @@ #include "metabundle.h" MetaBundleSaver::MetaBundleSaver( MetaBundle *bundle ) - : QObject() + : TQObject() , m_bundle( bundle ) - , m_tempSavePath( QString::null ) - , m_origRenamedSavePath( QString::null ) + , m_tempSavePath( TQString::null ) + , m_origRenamedSavePath( TQString::null ) , m_tempSaveDigest( 0 ) , m_saveFileref( 0 ) , m_maxlen( 8192 ) @@ -74,28 +74,28 @@ MetaBundleSaver::prepareToSave() debug() << "Could not determine hostname!" << endl; return 0; } - QString pid; - QString randomString = m_bundle->getRandomString( 8, true ); - m_tempSavePath = origPath.path() + ".amaroktemp.host-" + QString( hostbuf ) + + TQString pid; + TQString randomString = m_bundle->getRandomString( 8, true ); + m_tempSavePath = origPath.path() + ".amaroktemp.host-" + TQString( hostbuf ) + ".pid-" + pid.setNum( getpid() ) + ".random-" + randomString + '.' + m_bundle->type(); - m_origRenamedSavePath = origPath.path() + ".amarokoriginal.host-" + QString( hostbuf ) + + m_origRenamedSavePath = origPath.path() + ".amarokoriginal.host-" + TQString( hostbuf ) + ".pid-" + pid.setNum( getpid() ) + ".random-" + randomString + '.' + m_bundle->type(); //The next long step is to copy the file over. We can't use KIO because it's not thread save, - //and std and QFile only have provisions for renaming and removing, so manual it is + //and std and TQFile only have provisions for renaming and removing, so manual it is //doing it block-by-block results it not needing a huge amount of memory overhead debug() << "Copying original file to copy and caluclating MD5" << endl; - if( QFile::exists( m_tempSavePath ) ) + if( TQFile::exists( m_tempSavePath ) ) { debug() << "Temp file already exists!" << endl; return 0; } - QFile orig( m_bundle->url().path() ); - QFile copy( m_tempSavePath ); + TQFile orig( m_bundle->url().path() ); + TQFile copy( m_tempSavePath ); if( !orig.open( IO_Raw | IO_ReadOnly ) ) { @@ -141,7 +141,7 @@ MetaBundleSaver::prepareToSave() //Now, we have a MD5 sum of the original file at the time of copying saved in m_tempSaveDigest //Create a fileref on the copied file, for modification - m_saveFileref = new TagLib::FileRef( QFile::encodeName( m_tempSavePath ), false ); + m_saveFileref = new TagLib::FileRef( TQFile::encodeName( m_tempSavePath ), false ); if( m_saveFileref && !m_saveFileref->isNull() ) return m_saveFileref; @@ -161,13 +161,13 @@ MetaBundleSaver::doSave() m_cleanupNeeded = true; bool revert = false; - QFile origRenamedFile( m_origRenamedSavePath ); + TQFile origRenamedFile( m_origRenamedSavePath ); KMD5 md5sum( 0, 0 ); Q_LONG actualreadlen; int errcode; - QCString origRenamedDigest; + TQCString origRenamedDigest; if( !m_saveFileref || m_tempSavePath.isEmpty() || m_tempSaveDigest.isEmpty() || m_origRenamedSavePath.isEmpty() ) { @@ -186,8 +186,8 @@ MetaBundleSaver::doSave() debug() << "Renaming original file to temporary name " << m_origRenamedSavePath << endl; - errcode = std::rename( QFile::encodeName( m_bundle->url().path() ).data(), - QFile::encodeName( m_origRenamedSavePath ).data() ); + errcode = std::rename( TQFile::encodeName( m_bundle->url().path() ).data(), + TQFile::encodeName( m_origRenamedSavePath ).data() ); if( errcode != 0 ) { debug() << "Could not move original!" << endl; @@ -226,8 +226,8 @@ MetaBundleSaver::doSave() debug() << "Renaming temp file to original's filename" << endl; - errcode = std::rename( QFile::encodeName( m_tempSavePath ).data(), - QFile::encodeName( m_bundle->url().path() ).data() ); + errcode = std::rename( TQFile::encodeName( m_tempSavePath ).data(), + TQFile::encodeName( m_bundle->url().path() ).data() ); if( errcode != 0 ) { debug() << "Could not rename newly-tagged file to original!" << endl; @@ -237,7 +237,7 @@ MetaBundleSaver::doSave() debug() << "Deleting original" << endl; - errcode = std::remove( QFile::encodeName( m_origRenamedSavePath ) ); + errcode = std::remove( TQFile::encodeName( m_origRenamedSavePath ) ); if( errcode != 0 ) { debug() << "Could not delete the original file!" << endl; @@ -252,7 +252,7 @@ MetaBundleSaver::doSave() fail_remove_copy: debug() << "Deleting temporary file..." << endl; - errcode = std::remove( QFile::encodeName( m_tempSavePath ).data() ); + errcode = std::remove( TQFile::encodeName( m_tempSavePath ).data() ); if( errcode != 0 ) { debug() << "Could not delete the temporary file!" << endl; @@ -263,8 +263,8 @@ MetaBundleSaver::doSave() return false; debug() << "Reverting original file to original filename!" << endl; - errcode = std::rename( QFile::encodeName( m_origRenamedSavePath ).data(), - QFile::encodeName( m_bundle->url().path() ).data() ); + errcode = std::rename( TQFile::encodeName( m_origRenamedSavePath ).data(), + TQFile::encodeName( m_bundle->url().path() ).data() ); if( errcode != 0 ) { debug() << "Could not revert file to original filename!" << endl; @@ -281,10 +281,10 @@ MetaBundleSaver::cleanupSave() bool dirty = false; - if( !m_tempSavePath.isEmpty() && QFile::exists( m_tempSavePath ) ) + if( !m_tempSavePath.isEmpty() && TQFile::exists( m_tempSavePath ) ) { int errcode; - errcode = std::remove( QFile::encodeName( m_tempSavePath ).data() ); + errcode = std::remove( TQFile::encodeName( m_tempSavePath ).data() ); if( errcode != 0 ) { dirty = true; @@ -292,9 +292,9 @@ MetaBundleSaver::cleanupSave() } } - m_tempSavePath = QString::null; - m_origRenamedSavePath = QString::null; - m_tempSaveDigest = QCString( 0 ); + m_tempSavePath = TQString::null; + m_origRenamedSavePath = TQString::null; + m_tempSaveDigest = TQCString( 0 ); if( m_saveFileref ) { delete m_saveFileref; diff --git a/amarok/src/metabundlesaver.h b/amarok/src/metabundlesaver.h index 38a90848..84046954 100644 --- a/amarok/src/metabundlesaver.h +++ b/amarok/src/metabundlesaver.h @@ -4,8 +4,8 @@ #ifndef METABUNDLESAVER_H #define METABUNDLESAVER_H -#include -#include +#include +#include #include //inline functions #include //inline functions #include @@ -35,13 +35,13 @@ public: TagLib::FileRef* prepareToSave(); bool doSave(); bool cleanupSave(); - void abortSave( const QString message ); + void abortSave( const TQString message ); private: MetaBundle *m_bundle; - QString m_tempSavePath; - QString m_origRenamedSavePath; - QCString m_tempSaveDigest; + TQString m_tempSavePath; + TQString m_origRenamedSavePath; + TQCString m_tempSaveDigest; TagLib::FileRef* m_saveFileref; char m_databuf[8192]; Q_ULONG m_maxlen; diff --git a/amarok/src/metadata/tplugins.cpp b/amarok/src/metadata/tplugins.cpp index 2e176255..d20e4bcc 100644 --- a/amarok/src/metadata/tplugins.cpp +++ b/amarok/src/metadata/tplugins.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -74,7 +74,7 @@ TagLib::File *MimeTypeFileTypeResolver::createFile(const char *fileName, bool readProperties, TagLib::AudioProperties::ReadStyle propertiesStyle) const { - QString fn = QFile::decodeName( fileName ); + TQString fn = TQFile::decodeName( fileName ); int accuracy = 0; KMimeType::Ptr mimetype = KMimeType::findByFileContent( fn, &accuracy ); diff --git a/amarok/src/moodbar.cpp b/amarok/src/moodbar.cpp index 16cd0872..c80c3ab1 100644 --- a/amarok/src/moodbar.cpp +++ b/amarok/src/moodbar.cpp @@ -31,7 +31,7 @@ // // The Moodbar is part of the track's metadata, so it's held by a // MetaBundle. The actual Moodbar object is only used to draw a -// QPixmap, which it does efficiently -- it caches a pixmap of the +// TQPixmap, which it does efficiently -- it caches a pixmap of the // last thing it drew, and just copies that pixmap if the dimensions // have not changed. To use the moodbar, one just needs a few lines of // code, such as the following, based on PrettySlider: @@ -39,8 +39,8 @@ // void MyClass::MyClass( void ) // { // // This only needs to be done once! -// connect( &m_bundle.moodbar(), SIGNAL( jobEvent( int ) ), -// SLOT( newMoodData( int ) ) ); +// connect( &m_bundle.moodbar(), TQT_SIGNAL( jobEvent( int ) ), +// TQT_SLOT( newMoodData( int ) ) ); // } // // void MyClass::newMetaBundle( const MetaBundle &b ) @@ -55,7 +55,7 @@ // // void MyClass::draw( void ) // { -// QPixmap toDraw; +// TQPixmap toDraw; // if( m_bundle.moodbar().dataExists() ) // toDraw = m_bundle.moodbar().draw( width(), height() ); // // else draw something else... @@ -121,7 +121,7 @@ // when MoodServer::queueJob() is called, and is disconnected in // slotJobEvent(). The reason for this care is because MetaBundle's, // and hence Moodbar's, are copied around and passed-by-value all the -// time, so I wanted to reduce overhead; also QObject::disconnect() is +// time, so I wanted to reduce overhead; also TQObject::disconnect() is // not reentrant (from what I understand), so we don't want that being // called every time a Moodbar is destroyed! For the same reason, the // PlaylistItem does not listen for the jobEvent() signal; instead it @@ -185,7 +185,7 @@ // ask MoodServer to run a job for us. Always changes the state // from Unloaded so subsequent calls to load() do nothing. // -// draw(): Draw the moodbar onto a QPixmap. Cache what we drew +// draw(): Draw the moodbar onto a TQPixmap. Cache what we drew // so that if draw() is called again with the same dimensions // we don't have to redraw. // @@ -287,10 +287,10 @@ #include "mountpointmanager.h" #include "statusbar.h" -#include -#include // For QDir::rename() -#include -#include +#include +#include // For TQDir::rename() +#include +#include #include @@ -319,20 +319,20 @@ MoodServer::MoodServer( void ) : m_moodbarBroken( false ) , m_currentProcess( 0 ) { - connect( App::instance(), SIGNAL( moodbarPrefs( bool, bool, int, bool ) ), - SLOT( slotMoodbarPrefs( bool, bool, int, bool ) ) ); + connect( App::instance(), TQT_SIGNAL( moodbarPrefs( bool, bool, int, bool ) ), + TQT_SLOT( slotMoodbarPrefs( bool, bool, int, bool ) ) ); connect( CollectionDB::instance(), - SIGNAL( fileMoved( const QString &, const QString & ) ), - SLOT( slotFileMoved( const QString &, const QString & ) ) ); + TQT_SIGNAL( fileMoved( const TQString &, const TQString & ) ), + TQT_SLOT( slotFileMoved( const TQString &, const TQString & ) ) ); connect( CollectionDB::instance(), - SIGNAL( fileMoved( const QString &, const QString &, const QString & ) ), - SLOT( slotFileMoved( const QString &, const QString & ) ) ); + TQT_SIGNAL( fileMoved( const TQString &, const TQString &, const TQString & ) ), + TQT_SLOT( slotFileMoved( const TQString &, const TQString & ) ) ); connect( CollectionDB::instance(), - SIGNAL( fileDeleted( const QString & ) ), - SLOT( slotFileDeleted( const QString & ) ) ); + TQT_SIGNAL( fileDeleted( const TQString & ) ), + TQT_SLOT( slotFileDeleted( const TQString & ) ) ); connect( CollectionDB::instance(), - SIGNAL( fileDeleted( const QString &, const QString & ) ), - SLOT( slotFileDeleted( const QString & ) ) ); + TQT_SIGNAL( fileDeleted( const TQString &, const TQString & ) ), + TQT_SLOT( slotFileDeleted( const TQString & ) ) ); } @@ -359,7 +359,7 @@ MoodServer::queueJob( MetaBundle *bundle ) } // Check if there's already a job in the queue for that URL - QValueList::iterator it; + TQValueList::iterator it; for( it = m_jobQueue.begin(); it != m_jobQueue.end(); ++it ) { if( (*it).m_url == bundle->url() ) @@ -383,7 +383,7 @@ MoodServer::queueJob( MetaBundle *bundle ) m_mutex.unlock(); // New jobs *must* be started from the GUI thread! - QTimer::singleShot( 1000, this, SLOT( slotNewJob( void ) ) ); + TQTimer::singleShot( 1000, this, TQT_SLOT( slotNewJob( void ) ) ); return false; } @@ -407,7 +407,7 @@ MoodServer::deQueueJob( KURL url ) } // Check if there's already a job in the queue for that URL - QValueList::iterator it; + TQValueList::iterator it; for( it = m_jobQueue.begin(); it != m_jobQueue.end(); ++it ) { if( (*it).m_url == url ) @@ -476,8 +476,8 @@ MoodServer::slotNewJob( void ) << (m_currentData.m_outfile + ".tmp") << m_currentData.m_infile; - connect( m_currentProcess, SIGNAL( processExited( KProcess* ) ), - SLOT( slotJobCompleted( KProcess* ) ) ); + connect( m_currentProcess, TQT_SIGNAL( processExited( KProcess* ) ), + TQT_SLOT( slotJobCompleted( KProcess* ) ) ); // We have to enable KProcess::Stdout (even though we don't monitor // it) since otherwise the child process crashes every time in @@ -525,13 +525,13 @@ MoodServer::slotJobCompleted( KProcess *proc ) if( success ) { - QString file = m_currentData.m_outfile; - QString dir = file.left( file.findRev( '/' ) ); + TQString file = m_currentData.m_outfile; + TQString dir = file.left( file.findRev( '/' ) ); file = file.right( file.length() - file.findRev( '/' ) - 1 ); - QDir( dir ).rename( file + ".tmp", file ); + TQDir( dir ).rename( file + ".tmp", file ); } else - QFile::remove( m_currentData.m_outfile + ".tmp" ); + TQFile::remove( m_currentData.m_outfile + ".tmp" ); delete m_currentProcess; m_currentProcess = 0; @@ -611,34 +611,34 @@ MoodServer::slotMoodbarPrefs( bool show, bool moodier, int alter, bool withMusic // When a file is deleted, either manually using Organize Collection or // automatically detected using AFT, delete the corresponding mood file. void -MoodServer::slotFileDeleted( const QString &path ) +MoodServer::slotFileDeleted( const TQString &path ) { - QString mood = Moodbar::moodFilename( KURL::fromPathOrURL( path ) ); - if( mood.isEmpty() || !QFile::exists( mood ) ) + TQString mood = Moodbar::moodFilename( KURL::fromPathOrURL( path ) ); + if( mood.isEmpty() || !TQFile::exists( mood ) ) return; debug() << "MoodServer::slotFileDeleted: deleting " << mood << endl; - QFile::remove( mood ); + TQFile::remove( mood ); } // When a file is moved, either manually using Organize Collection or // automatically using AFT, move the corresponding mood file. void -MoodServer::slotFileMoved( const QString &srcPath, const QString &dstPath ) +MoodServer::slotFileMoved( const TQString &srcPath, const TQString &dstPath ) { - QString srcMood = Moodbar::moodFilename( KURL::fromPathOrURL( srcPath ) ); - QString dstMood = Moodbar::moodFilename( KURL::fromPathOrURL( dstPath ) ); + TQString srcMood = Moodbar::moodFilename( KURL::fromPathOrURL( srcPath ) ); + TQString dstMood = Moodbar::moodFilename( KURL::fromPathOrURL( dstPath ) ); if( srcMood.isEmpty() || dstMood.isEmpty() || - srcMood == dstMood || !QFile::exists( srcMood ) ) + srcMood == dstMood || !TQFile::exists( srcMood ) ) return; debug() << "MoodServer::slotFileMoved: moving " << srcMood << " to " << dstMood << endl; Moodbar::copyFile( srcMood, dstMood ); - QFile::remove( srcMood ); + TQFile::remove( srcMood ); } @@ -673,12 +673,12 @@ MoodServer::clearJobs( void ) // We don't want to emit jobEvent (or really do anything // external) while the mutex is locked. m_mutex.lock(); - QValueList queueCopy - = QDeepCopy< QValueList > ( m_jobQueue ); + TQValueList queueCopy + = TQDeepCopy< TQValueList > ( m_jobQueue ); m_jobQueue.clear(); m_mutex.unlock(); - QValueList::iterator it; + TQValueList::iterator it; for( it = queueCopy.begin(); it != queueCopy.end(); ++it ) emit jobEvent( (*it).m_url, Moodbar::JobStateFailed ); } @@ -702,7 +702,7 @@ MoodServer::clearJobs( void ) // member of a MetaBundle, in other words. Moodbar::Moodbar( MetaBundle *mb ) - : QObject ( ) + : TQObject ( ) , m_bundle ( mb ) , m_hueSort ( 0 ) , m_state ( Unloaded ) @@ -746,8 +746,8 @@ Moodbar::operator=( const Moodbar &mood ) if( JOB_PENDING( m_state ) && !JOB_PENDING( oldState ) ) { connect( MoodServer::instance(), - SIGNAL( jobEvent( KURL, int ) ), - SLOT( slotJobEvent( KURL, int ) ) ); + TQT_SIGNAL( jobEvent( KURL, int ) ), + TQT_SLOT( slotJobEvent( KURL, int ) ) ); // Increase the refcount for this job. Use mood.m_bundle // since that one's already initialized. MoodServer::instance()->queueJob( mood.m_bundle ); @@ -756,7 +756,7 @@ Moodbar::operator=( const Moodbar &mood ) // If we had a job pending, de-queue it if( !JOB_PENDING( m_state ) && JOB_PENDING( oldState ) ) { - MoodServer::instance()->disconnect( this, SLOT( slotJobEvent( KURL, int ) ) ); + MoodServer::instance()->disconnect( this, TQT_SLOT( slotJobEvent( KURL, int ) ) ); MoodServer::instance()->deQueueJob( oldURL ); } @@ -779,12 +779,12 @@ Moodbar::reset( void ) if( JOB_PENDING( m_state ) ) { - MoodServer::instance()->disconnect( this, SLOT( slotJobEvent( KURL, int ) ) ); + MoodServer::instance()->disconnect( this, TQT_SLOT( slotJobEvent( KURL, int ) ) ); MoodServer::instance()->deQueueJob( m_url ); } m_data.clear(); - m_pixmap = QPixmap(); + m_pixmap = TQPixmap(); m_url = KURL(); m_hueSort = 0; m_state = Unloaded; @@ -799,11 +799,11 @@ Moodbar::detach( void ) { m_mutex.lock(); - m_data = QDeepCopy(m_data); + m_data = TQDeepCopy(m_data); m_pixmap.detach(); // Apparently this is the wrong hack -- don't detach urls - //QString url( QDeepCopy( m_url.url() ) ); + //TQString url( TQDeepCopy( m_url.url() ) ); //m_url = KURL::fromPathOrURL( url ); m_mutex.unlock(); @@ -898,8 +898,8 @@ Moodbar::load( void ) // Ok no more excuses, we have to queue a job connect( MoodServer::instance(), - SIGNAL( jobEvent( KURL, int ) ), - SLOT( slotJobEvent( KURL, int ) ) ); + TQT_SIGNAL( jobEvent( KURL, int ) ), + TQT_SLOT( slotJobEvent( KURL, int ) ) ); bool isRunning = MoodServer::instance()->queueJob( m_bundle ); m_state = isRunning ? JobRunning : JobQueued; m_url = m_bundle->url(); // Use this URL for MoodServer::deQueueJob @@ -930,7 +930,7 @@ Moodbar::slotJobEvent( KURL url, int newState ) m_mutex.lock(); // Disconnect the signal for efficiency's sake - MoodServer::instance()->disconnect( this, SLOT( slotJobEvent( KURL, int ) ) ); + MoodServer::instance()->disconnect( this, TQT_SLOT( slotJobEvent( KURL, int ) ) ); if( !success ) { @@ -968,7 +968,7 @@ QPixmap Moodbar::draw( int width, int height ) { if( m_state != Loaded || !AmarokConfig::showMoodbar() ) // Naughty caller! - return QPixmap(); + return TQPixmap(); m_mutex.lock(); @@ -979,17 +979,17 @@ Moodbar::draw( int width, int height ) return m_pixmap; } - m_pixmap = QPixmap( width, height ); - QPainter paint( &m_pixmap ); + m_pixmap = TQPixmap( width, height ); + TQPainter paint( &m_pixmap ); // First average the moodbar samples that will go into each // vertical bar on the screen. if( m_data.size() == 0 ) // Play it safe -- see below - return QPixmap(); + return TQPixmap(); ColorList screenColors; - QColor bar; + TQColor bar; float r, g, b; int h, s, v; @@ -1011,9 +1011,9 @@ Moodbar::draw( int width, int height ) } uint n = end - start; - bar = QColor( int( r / float( n ) ), + bar = TQColor( int( r / float( n ) ), int( g / float( n ) ), - int( b / float( n ) ), QColor::Rgb ); + int( b / float( n ) ), TQColor::Rgb ); /* Snap to the HSV values for later */ bar.getHsv(&h, &s, &v); @@ -1036,10 +1036,10 @@ Moodbar::draw( int width, int height ) float coeff2 = 1.f - ((1.f - coeff) * (1.f - coeff)); coeff = 1.f - (1.f - coeff) / 2.f; coeff2 = 1.f - (1.f - coeff2) / 2.f; - paint.setPen( QColor( h, + paint.setPen( TQColor( h, CLAMP( 0, int( float( s ) * coeff ), 255 ), CLAMP( 0, int( 255.f - (255.f - float( v )) * coeff2), 255 ), - QColor::Hsv ) ); + TQColor::Hsv ) ); paint.drawPoint(x, y); paint.drawPoint(x, height - 1 - y); } @@ -1072,15 +1072,15 @@ Moodbar::readFile( void ) if( m_state == Loaded ) return true; - QString path = moodFilename( m_bundle->url() ); + TQString path = moodFilename( m_bundle->url() ); if( path.isEmpty() ) return false; debug() << "Moodbar::readFile: Trying to read " << path << endl; - QFile moodFile( path ); + TQFile moodFile( path ); - if( !QFile::exists( path ) || + if( !TQFile::exists( path ) || !moodFile.open( IO_ReadOnly ) ) { // If the user has changed his/her preference about where to @@ -1088,11 +1088,11 @@ Moodbar::readFile( void ) // in the other place, so we should check there before giving // up. - QString path2 = moodFilename( m_bundle->url(), + TQString path2 = moodFilename( m_bundle->url(), !AmarokConfig::moodsWithMusic() ); moodFile.setName( path2 ); - if( !QFile::exists( path2 ) || + if( !TQFile::exists( path2 ) || !moodFile.open( IO_ReadOnly ) ) return false; @@ -1134,9 +1134,9 @@ Moodbar::readFile( void ) g = moodFile.getch(); b = moodFile.getch(); - m_data.push_back( QColor( CLAMP( 0, r, 255 ), + m_data.push_back( TQColor( CLAMP( 0, r, 255 ), CLAMP( 0, g, 255 ), - CLAMP( 0, b, 255 ), QColor::Rgb ) ); + CLAMP( 0, b, 255 ), TQColor::Rgb ) ); // Make a histogram of hues m_data.last().getHsv( &h, &s, &v ); @@ -1300,7 +1300,7 @@ Moodbar::readFile( void ) // Returns where the mood file for this bundle should be located, // based on the user preferences. If no location can be determined, -// return QString::null. +// return TQString::null. QString Moodbar::moodFilename( const KURL &url ) @@ -1313,7 +1313,7 @@ Moodbar::moodFilename( const KURL &url, bool withMusic ) { // No need to lock the object - QString path; + TQString path; if( withMusic ) { @@ -1321,12 +1321,12 @@ Moodbar::moodFilename( const KURL &url, bool withMusic ) path.truncate(path.findRev('.')); if (path.isEmpty()) // Weird... - return QString(); + return TQString(); path += ".mood"; int slash = path.findRev('/') + 1; - QString dir = path.left(slash); - QString file = path.right(path.length() - slash); + TQString dir = path.left(slash); + TQString file = path.right(path.length() - slash); path = dir + '.' + file; } @@ -1341,9 +1341,9 @@ Moodbar::moodFilename( const KURL &url, bool withMusic ) path.truncate(path.findRev('.')); if (path.isEmpty()) // Weird... - return QString(); + return TQString(); - path = QString::number( deviceid ) + ',' + path = TQString::number( deviceid ) + ',' + path.replace('/', ',') + ".mood"; // Creates the path if necessary @@ -1357,12 +1357,12 @@ Moodbar::moodFilename( const KURL &url, bool withMusic ) // Quick-n-dirty -->synchronous<-- file copy (the GUI needs its // moodbars immediately!) bool -Moodbar::copyFile( const QString &srcPath, const QString &dstPath ) +Moodbar::copyFile( const TQString &srcPath, const TQString &dstPath ) { - QFile file( srcPath ); + TQFile file( srcPath ); if( !file.open( IO_ReadOnly ) ) return false; - QByteArray contents = file.readAll(); + TQByteArray contents = file.readAll(); file.close(); file.setName( dstPath ); if( !file.open( IO_WriteOnly | IO_Truncate ) ) diff --git a/amarok/src/moodbar.h b/amarok/src/moodbar.h index 7263be40..e456a0c0 100644 --- a/amarok/src/moodbar.h +++ b/amarok/src/moodbar.h @@ -24,12 +24,12 @@ #ifndef MOODBAR_H #define MOODBAR_H -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include @@ -41,7 +41,7 @@ class Moodbar : public QObject Q_OBJECT public: - typedef QValueVector ColorList; + typedef TQValueVector ColorList; typedef enum { @@ -73,7 +73,7 @@ public: bool dataExists( void ); bool canHaveMood( void ); void load( void ); - QPixmap draw( int width, int height ); + TQPixmap draw( int width, int height ); int hueSort( void ) const { return m_hueSort; } @@ -81,9 +81,9 @@ public: { return m_state; } // Where are we storing the .mood file? - static QString moodFilename( const KURL &url ); - static QString moodFilename( const KURL &url, bool withMusic ); - static bool copyFile( const QString &srcPath, const QString &dstPath ); + static TQString moodFilename( const KURL &url ); + static TQString moodFilename( const KURL &url, bool withMusic ); + static bool copyFile( const TQString &srcPath, const TQString &dstPath ); static bool executableExists( void ); @@ -102,9 +102,9 @@ private: MetaBundle *m_bundle; // Parent bundle ColorList m_data; // .mood file contents - QPixmap m_pixmap; // Cached from the last time draw() was called + TQPixmap m_pixmap; // Cached from the last time draw() was called KURL m_url; // Keep a copy of this, mainly for dtor - mutable QMutex m_mutex; // Locks the whole object + mutable TQMutex m_mutex; // Locks the whole object int m_hueSort; // For PlaylistItem sorting State m_state; }; @@ -136,23 +136,23 @@ private slots: public slots: // Moodbar file organization slots - void slotFileDeleted( const QString &absPath ); - void slotFileMoved( const QString &srcPath, const QString &dstPath ); + void slotFileDeleted( const TQString &absPath ); + void slotFileMoved( const TQString &srcPath, const TQString &dstPath ); private: class ProcData { public: - ProcData( KURL url, QString infile, QString outfile ) + ProcData( KURL url, TQString infile, TQString outfile ) : m_url( url ), m_infile( infile ), m_outfile( outfile ) , m_refcount( 1 ) {} ProcData( void ) : m_refcount( 0 ) {} KURL m_url; - QString m_infile; - QString m_outfile; + TQString m_infile; + TQString m_outfile; // Keep track of how many Moodbars are waiting on this URL int m_refcount; }; @@ -170,11 +170,11 @@ private: void setMoodbarBroken( void ); void clearJobs( void ); - QValueList m_jobQueue; + TQValueList m_jobQueue; bool m_moodbarBroken; KProcess *m_currentProcess; ProcData m_currentData; - mutable QMutex m_mutex; + mutable TQMutex m_mutex; }; diff --git a/amarok/src/mountpointmanager.cpp b/amarok/src/mountpointmanager.cpp index a497f489..313c7750 100644 --- a/amarok/src/mountpointmanager.cpp +++ b/amarok/src/mountpointmanager.cpp @@ -31,15 +31,15 @@ #include //used in init() #include -#include -#include -#include -#include +#include +#include +#include +#include typedef Medium::List MediumList; MountPointManager::MountPointManager() - : QObject( 0, "MountPointManager" ) + : TQObject( 0, "MountPointManager" ) , m_noDeviceManager( false ) { @@ -52,9 +52,9 @@ MountPointManager::MountPointManager() //therefore it is enough to listen to DeviceManager's mediumChanged signal if (DeviceManager::instance()->isValid() ) { - connect( DeviceManager::instance(), SIGNAL( mediumAdded( const Medium*, QString ) ), SLOT( mediumAdded( const Medium* ) ) ); - connect( DeviceManager::instance(), SIGNAL( mediumChanged( const Medium*, QString ) ), SLOT( mediumChanged( const Medium* ) ) ); - connect( DeviceManager::instance(), SIGNAL( mediumRemoved( const Medium*, QString ) ), SLOT( mediumRemoved( const Medium* ) ) ); + connect( DeviceManager::instance(), TQT_SIGNAL( mediumAdded( const Medium*, TQString ) ), TQT_SLOT( mediumAdded( const Medium* ) ) ); + connect( DeviceManager::instance(), TQT_SIGNAL( mediumChanged( const Medium*, TQString ) ), TQT_SLOT( mediumChanged( const Medium* ) ) ); + connect( DeviceManager::instance(), TQT_SIGNAL( mediumRemoved( const Medium*, TQString ) ), TQT_SLOT( mediumRemoved( const Medium* ) ) ); } else { @@ -70,10 +70,10 @@ MountPointManager::MountPointManager() if ( collDB->adminValue( "Database Stats Version" ).toInt() >= 9 && /* make sure that deviceid actually exists*/ collDB->query( "SELECT COUNT(url) FROM statistics WHERE deviceid = -2;" ).first().toInt() != 0 ) { - connect( this, SIGNAL( mediumConnected( int ) ), SLOT( migrateStatistics() ) ); - QTimer::singleShot( 0, this, SLOT( migrateStatistics() ) ); + connect( this, TQT_SIGNAL( mediumConnected( int ) ), TQT_SLOT( migrateStatistics() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( migrateStatistics() ) ); } - connect( this, SIGNAL( mediumConnected( int ) ), SLOT( updateStatisticsURLs() ) ); + connect( this, TQT_SIGNAL( mediumConnected( int ) ), TQT_SLOT( updateStatisticsURLs() ) ); updateStatisticsURLs(); } @@ -99,7 +99,7 @@ MountPointManager::init() { DEBUG_BLOCK KTrader::OfferList plugins = PluginManager::query( "[X-KDE-Amarok-plugintype] == 'device'" ); - debug() << "Received [" << QString::number( plugins.count() ) << "] device plugin offers" << endl; + debug() << "Received [" << TQString::number( plugins.count() ) << "] device plugin offers" << endl; foreachType( KTrader::OfferList, plugins ) { Amarok::Plugin *plugin = PluginManager::createFromService( *it ); @@ -124,7 +124,7 @@ MountPointManager::init() } if( !KGlobal::config()->hasGroup( "Collection Folders" ) ) { - QStringList folders = AmarokConfig::collectionFolders(); + TQStringList folders = AmarokConfig::collectionFolders(); if( !folders.isEmpty() ) setCollectionFolders( folders ); } @@ -158,7 +158,7 @@ MountPointManager::getIdForUrl( KURL url ) } int -MountPointManager::getIdForUrl( const QString &url ) +MountPointManager::getIdForUrl( const TQString &url ) { return getIdForUrl( KURL::fromPathOrURL( url ) ); } @@ -174,7 +174,7 @@ MountPointManager::isMounted ( const int deviceId ) const { QString MountPointManager::getMountPointForId( const int id ) const { - QString mountPoint; + TQString mountPoint; if ( isMounted( id ) ) { m_handlerMapMutex.lock(); @@ -208,8 +208,8 @@ MountPointManager::getAbsolutePath( const int deviceId, const KURL& relativePath else { m_handlerMapMutex.unlock(); - QStringList lastMountPoint = CollectionDB::instance()->query( - QString( "SELECT lastmountpoint FROM devices WHERE id = %1" ) + TQStringList lastMountPoint = CollectionDB::instance()->query( + TQString( "SELECT lastmountpoint FROM devices WHERE id = %1" ) .arg( deviceId ) ); if ( lastMountPoint.count() == 0 ) { @@ -230,7 +230,7 @@ MountPointManager::getAbsolutePath( const int deviceId, const KURL& relativePath } QString -MountPointManager::getAbsolutePath( const int deviceId, const QString& relativePath ) const +MountPointManager::getAbsolutePath( const int deviceId, const TQString& relativePath ) const { KURL rpath; rpath.setProtocol("file"); @@ -247,7 +247,7 @@ MountPointManager::getRelativePath( const int deviceId, const KURL& absolutePath if ( deviceId != -1 && m_handlerMap.contains( deviceId ) ) { //FIXME max: returns garbage if the absolute path is actually not under the device's mount point - QString rpath = KURL::relativePath( m_handlerMap[deviceId]->getDevicePath(), absolutePath.path() ); + TQString rpath = KURL::relativePath( m_handlerMap[deviceId]->getDevicePath(), absolutePath.path() ); m_handlerMapMutex.unlock(); relativePath.setPath( rpath ); } @@ -255,13 +255,13 @@ MountPointManager::getRelativePath( const int deviceId, const KURL& absolutePath { m_handlerMapMutex.unlock(); //TODO: better error handling - QString rpath = KURL::relativePath( "/", absolutePath.path() ); + TQString rpath = KURL::relativePath( "/", absolutePath.path() ); relativePath.setPath( rpath ); } } QString -MountPointManager::getRelativePath( const int deviceId, const QString& absolutePath ) const +MountPointManager::getRelativePath( const int deviceId, const TQString& absolutePath ) const { KURL url; getRelativePath( deviceId, KURL::fromPathOrURL( absolutePath ), url ); @@ -403,15 +403,15 @@ QStringList MountPointManager::collectionFolders( ) { //TODO max: cache data - QStringList result; + TQStringList result; KConfig* const folders = Amarok::config( "Collection Folders" ); IdList ids = getMountedDeviceIds(); foreachType( IdList, ids ) { - QStringList rpaths = folders->readListEntry( QString::number( *it ) ); - for( QStringList::ConstIterator strIt = rpaths.begin(), end = rpaths.end(); strIt != end; ++strIt ) + TQStringList rpaths = folders->readListEntry( TQString::number( *it ) ); + for( TQStringList::ConstIterator strIt = rpaths.begin(), end = rpaths.end(); strIt != end; ++strIt ) { - QString absPath; + TQString absPath; if ( *strIt == "./" ) { absPath = getMountPointForId( *it ); @@ -428,22 +428,22 @@ MountPointManager::collectionFolders( ) } void -MountPointManager::setCollectionFolders( const QStringList &folders ) +MountPointManager::setCollectionFolders( const TQStringList &folders ) { //TODO max: cache data - typedef QMap FolderMap; + typedef TQMap FolderMap; KConfig* const folderConf = Amarok::config( "Collection Folders" ); FolderMap folderMap; foreach( folders ) { int id = getIdForUrl( *it ); - QString rpath = getRelativePath( id, *it ); + TQString rpath = getRelativePath( id, *it ); if ( folderMap.contains( id ) ) { if ( !folderMap[id].contains( rpath ) ) folderMap[id].append( rpath ); } else - folderMap[id] = QStringList( rpath ); + folderMap[id] = TQStringList( rpath ); } //make sure that collection folders on devices which are not in foldermap are deleted IdList ids = getMountedDeviceIds(); @@ -451,29 +451,29 @@ MountPointManager::setCollectionFolders( const QStringList &folders ) { if( !folderMap.contains( *it ) ) { - folderConf->deleteEntry( QString::number( *it ) ); + folderConf->deleteEntry( TQString::number( *it ) ); } } foreachType( FolderMap, folderMap ) { - folderConf->writeEntry( QString::number( it.key() ), it.data() ); + folderConf->writeEntry( TQString::number( it.key() ), it.data() ); } } void MountPointManager::migrateStatistics() { - QStringList urls = CollectionDB::instance()->query( "SELECT url FROM statistics WHERE deviceid = -2;" ); + TQStringList urls = CollectionDB::instance()->query( "SELECT url FROM statistics WHERE deviceid = -2;" ); foreach( urls ) { - if ( QFile::exists( *it) ) + if ( TQFile::exists( *it) ) { int deviceid = getIdForUrl( *it ); - QString rpath = getRelativePath( deviceid, *it ); - QString update = QString( "UPDATE statistics SET deviceid = %1, url = '%2'" ) + TQString rpath = getRelativePath( deviceid, *it ); + TQString update = TQString( "UPDATE statistics SET deviceid = %1, url = '%2'" ) .arg( deviceid ) .arg( CollectionDB::instance()->escapeString( rpath ) ); - update += QString( " WHERE url = '%1' AND deviceid = -2;" ) + update += TQString( " WHERE url = '%1' AND deviceid = -2;" ) .arg( CollectionDB::instance()->escapeString( *it ) ); CollectionDB::instance()->query( update ); } @@ -484,7 +484,7 @@ void MountPointManager::updateStatisticsURLs( bool changed ) { if ( changed ) - QTimer::singleShot( 0, this, SLOT( startStatisticsUpdateJob() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( startStatisticsUpdateJob() ) ); } void @@ -521,32 +521,32 @@ void UrlUpdateJob::updateStatistics( ) { CollectionDB *collDB = CollectionDB::instance(); MountPointManager *mpm = MountPointManager::instance(); - QStringList urls = collDB->query( "SELECT s.deviceid,s.url " + TQStringList urls = collDB->query( "SELECT s.deviceid,s.url " "FROM statistics AS s LEFT JOIN tags AS t ON s.deviceid = t.deviceid AND s.url = t.url " "WHERE t.url IS NULL AND s.deviceid != -2;" ); debug() << "Trying to update " << urls.count() / 2 << " statistics rows" << endl; foreach( urls ) { int deviceid = (*it).toInt(); - QString rpath = *++it; - QString realURL = mpm->getAbsolutePath( deviceid, rpath ); - if( QFile::exists( realURL ) ) + TQString rpath = *++it; + TQString realURL = mpm->getAbsolutePath( deviceid, rpath ); + if( TQFile::exists( realURL ) ) { int newDeviceid = mpm->getIdForUrl( realURL ); if( newDeviceid == deviceid ) continue; - QString newRpath = mpm->getRelativePath( newDeviceid, realURL ); + TQString newRpath = mpm->getRelativePath( newDeviceid, realURL ); int statCount = collDB->query( - QString( "SELECT COUNT( url ) FROM statistics WHERE deviceid = %1 AND url = '%2';" ) + TQString( "SELECT COUNT( url ) FROM statistics WHERE deviceid = %1 AND url = '%2';" ) .arg( newDeviceid ) .arg( collDB->escapeString( newRpath ) ) ).first().toInt(); if( statCount ) continue; //statistics row with new URL/deviceid values already exists - QString sql = QString( "UPDATE statistics SET deviceid = %1, url = '%2'" ) + TQString sql = TQString( "UPDATE statistics SET deviceid = %1, url = '%2'" ) .arg( newDeviceid ).arg( collDB->escapeString( newRpath ) ); - sql += QString( " WHERE deviceid = %1 AND url = '%2';" ) + sql += TQString( " WHERE deviceid = %1 AND url = '%2';" ) .arg( deviceid ).arg( collDB->escapeString( rpath ) ); collDB->query( sql ); } @@ -557,27 +557,27 @@ void UrlUpdateJob::updateLabels( ) { CollectionDB *collDB = CollectionDB::instance(); MountPointManager *mpm = MountPointManager::instance(); - QStringList labels = collDB->query( "SELECT l.deviceid,l.url " + TQStringList labels = collDB->query( "SELECT l.deviceid,l.url " "FROM tags_labels AS l LEFT JOIN tags as t ON l.deviceid = t.deviceid AND l.url = t.url " "WHERE t.url IS NULL;" ); debug() << "Trying to update " << labels.count() / 2 << " tags_labels rows" << endl; foreach( labels ) { int deviceid = (*it).toInt(); - QString rpath = *++it; - QString realUrl = mpm->getAbsolutePath( deviceid, rpath ); - if( QFile::exists( realUrl ) ) + TQString rpath = *++it; + TQString realUrl = mpm->getAbsolutePath( deviceid, rpath ); + if( TQFile::exists( realUrl ) ) { int newDeviceid = mpm->getIdForUrl( realUrl ); if( newDeviceid == deviceid ) continue; - QString newRpath = mpm->getRelativePath( newDeviceid, realUrl ); + TQString newRpath = mpm->getRelativePath( newDeviceid, realUrl ); //only update rows if there is not already a row with the new deviceid/rpath and the same labelid - QStringList labelids = collDB->query( - QString( "SELECT labelid FROM tags_labels WHERE deviceid = %1 AND url = '%2';" ) - .arg( QString::number( newDeviceid ), collDB->escapeString( newRpath ) ) ); - QString existingLabelids; + TQStringList labelids = collDB->query( + TQString( "SELECT labelid FROM tags_labels WHERE deviceid = %1 AND url = '%2';" ) + .arg( TQString::number( newDeviceid ), collDB->escapeString( newRpath ) ) ); + TQString existingLabelids; if( !labelids.isEmpty() ) { existingLabelids = " AND labelid NOT IN ("; @@ -589,11 +589,11 @@ void UrlUpdateJob::updateLabels( ) } existingLabelids += ')'; } - QString sql = QString( "UPDATE tags_labels SET deviceid = %1, url = '%2' " + TQString sql = TQString( "UPDATE tags_labels SET deviceid = %1, url = '%2' " "WHERE deviceid = %3 AND url = '%4'%5;" ) .arg( newDeviceid ) .arg( collDB->escapeString( newRpath ), - QString::number( deviceid ), + TQString::number( deviceid ), collDB->escapeString( rpath ), existingLabelids ); collDB->query( sql ); diff --git a/amarok/src/mountpointmanager.h b/amarok/src/mountpointmanager.h index a7f470d3..fdb52acd 100644 --- a/amarok/src/mountpointmanager.h +++ b/amarok/src/mountpointmanager.h @@ -29,18 +29,18 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include class DeviceHandler; class DeviceHandlerFactory; -typedef QValueList IdList; -typedef QPtrList FactoryList; -typedef QMap HandlerMap; +typedef TQValueList IdList; +typedef TQPtrList FactoryList; +typedef TQMap HandlerMap; class LIBAMAROK_EXPORT DeviceHandlerFactory : public Amarok::Plugin @@ -78,9 +78,9 @@ public: /** * returns the type of the DeviceHandler. Should be the same as the value used in * ~/.kde/share/config/amarokrc - * @return a QString describing the type of the DeviceHandler + * @return a TQString describing the type of the DeviceHandler */ - virtual QString type() const = 0; + virtual TQString type() const = 0; }; @@ -100,9 +100,9 @@ public: /** * returns the type of the DeviceHandler. Should be the same as the value used in * ~/.kde/share/config/amarokrc - * @return a QString describing the type of the DeviceHandler + * @return a TQString describing the type of the DeviceHandler */ - virtual QString type() const = 0; + virtual TQString type() const = 0; /** * returns an absolute path which is guaranteed to be playable by amarok's current engine. (based on an @@ -131,7 +131,7 @@ public: */ virtual int getDeviceID() = 0; - virtual const QString &getDevicePath() const = 0; + virtual const TQString &getDevicePath() const = 0; /** * allows MountPointManager to check if a device handler handles a specific medium. @@ -144,7 +144,7 @@ public: /** * @author Maximilian Kossick */ -class MountPointManager : public QObject { +class MountPointManager : public TQObject { Q_OBJECT signals: @@ -167,13 +167,13 @@ public: * @return */ int getIdForUrl( KURL url ); - int getIdForUrl( const QString &url ); + int getIdForUrl( const TQString &url ); /** * * @param id * @return */ - QString getMountPointForId( const int id ) const; + TQString getMountPointForId( const int id ) const; /** * builds the absolute path from the mount point of the medium and the given relative * path. @@ -182,7 +182,7 @@ public: * @return the absolute path */ void getAbsolutePath( const int deviceId, const KURL& relativePath, KURL& absolutePath ) const; - QString getAbsolutePath ( const int deviceId, const QString& relativePath ) const; + TQString getAbsolutePath ( const int deviceId, const TQString& relativePath ) const; /** * calculates a file's/directory's relative path on a given device. * @param deviceId the unique id which identifies the device the file/directory is supposed to be on @@ -190,15 +190,15 @@ public: * @param relativePath the calculated relative path */ void getRelativePath( const int deviceId, const KURL& absolutePath, KURL& relativePath ) const; - QString getRelativePath( const int deviceId, const QString& absolutePath ) const; + TQString getRelativePath( const int deviceId, const TQString& absolutePath ) const; /** * allows calling code to access the ids of all active devices * @return the ids of all devices which are currently mounted or otherwise accessible */ IdList getMountedDeviceIds() const; - QStringList collectionFolders(); - void setCollectionFolders( const QStringList &folders ); + TQStringList collectionFolders(); + void setCollectionFolders( const TQStringList &folders ); public slots: void mediumAdded( const Medium *m ); @@ -235,7 +235,7 @@ private: * changed for the real Dynamic Collection implementation. */ HandlerMap m_handlerMap; - mutable QMutex m_handlerMapMutex; + mutable TQMutex m_handlerMapMutex; FactoryList m_mediumFactories; FactoryList m_remoteFactories; bool m_noDeviceManager; @@ -245,7 +245,7 @@ private: class UrlUpdateJob : public ThreadManager::DependentJob { public: - UrlUpdateJob( QObject *dependent ) : DependentJob( dependent, "UrlUpdateJob" ) {} + UrlUpdateJob( TQObject *dependent ) : DependentJob( dependent, "UrlUpdateJob" ) {} virtual bool doJob(); diff --git a/amarok/src/multitabbar.cpp b/amarok/src/multitabbar.cpp index c374f7cf..406b4ec6 100644 --- a/amarok/src/multitabbar.cpp +++ b/amarok/src/multitabbar.cpp @@ -31,13 +31,13 @@ #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -50,12 +50,12 @@ #define NEARBYINT(i) ((int(float(i) + 0.5))) -namespace Amarok { extern KConfig *config( const QString& ); } +namespace Amarok { extern KConfig *config( const TQString& ); } class MultiTabBarTabPrivate { public: - QPixmap pix; + TQPixmap pix; }; class MultiTabBarButtonPrivate @@ -66,7 +66,7 @@ class MultiTabBarButtonPrivate }; -MultiTabBarInternal::MultiTabBarInternal( QWidget *parent, MultiTabBar::MultiTabBarMode bm ) : QScrollView( parent ) +MultiTabBarInternal::MultiTabBarInternal( TQWidget *parent, MultiTabBar::MultiTabBarMode bm ) : TQScrollView( parent ) { m_expandedTabSize = -1; m_showActiveTabTexts = false; @@ -75,14 +75,14 @@ MultiTabBarInternal::MultiTabBarInternal( QWidget *parent, MultiTabBar::MultiTab setHScrollBarMode( AlwaysOff ); setVScrollBarMode( AlwaysOff ); if ( bm == MultiTabBar::Vertical ) { - box = new QWidget( viewport() ); - mainLayout = new QVBoxLayout( box ); + box = new TQWidget( viewport() ); + mainLayout = new TQVBoxLayout( box ); mainLayout->setAutoAdd( true ); box->setFixedWidth( 24 ); setFixedWidth( 24 ); } else { - box = new QWidget( viewport() ); - mainLayout = new QHBoxLayout( box ); + box = new TQWidget( viewport() ); + mainLayout = new TQHBoxLayout( box ); mainLayout->setAutoAdd( true ); box->setFixedHeight( 24 ); setFixedHeight( 24 ); @@ -108,13 +108,13 @@ void MultiTabBarInternal::setStyle( enum MultiTabBar::MultiTabBarStyle style ) resizeEvent( 0 ); } else if ( mainLayout == 0 ) { if ( m_barMode == MultiTabBar::Vertical ) { - box = new QWidget( viewport() ); - mainLayout = new QVBoxLayout( box ); + box = new TQWidget( viewport() ); + mainLayout = new TQVBoxLayout( box ); box->setFixedWidth( 24 ); setFixedWidth( 24 ); } else { - box = new QWidget( viewport() ); - mainLayout = new QHBoxLayout( box ); + box = new TQWidget( viewport() ); + mainLayout = new TQHBoxLayout( box ); box->setFixedHeight( 24 ); setFixedHeight( 24 ); } @@ -127,9 +127,9 @@ void MultiTabBarInternal::setStyle( enum MultiTabBar::MultiTabBarStyle style ) viewport() ->repaint(); } -void MultiTabBarInternal::drawContents ( QPainter * paint, int clipx, int clipy, int clipw, int cliph ) +void MultiTabBarInternal::drawContents ( TQPainter * paint, int clipx, int clipy, int clipw, int cliph ) { - QScrollView::drawContents ( paint , clipx, clipy, clipw, cliph ); + TQScrollView::drawContents ( paint , clipx, clipy, clipw, cliph ); if ( m_position == MultiTabBar::Right ) { @@ -163,13 +163,13 @@ void MultiTabBarInternal::drawContents ( QPainter * paint, int clipx, int clipy, } } -void MultiTabBarInternal::contentsMousePressEvent( QMouseEvent *ev ) +void MultiTabBarInternal::contentsMousePressEvent( TQMouseEvent *ev ) { ev->ignore(); } -void MultiTabBarInternal::showTabSelectionMenu(QPoint pos) +void MultiTabBarInternal::showTabSelectionMenu(TQPoint pos) { KPopupMenu popup; @@ -187,9 +187,9 @@ void MultiTabBarInternal::showTabSelectionMenu(QPoint pos) } -void MultiTabBarInternal::mousePressEvent( QMouseEvent *ev ) +void MultiTabBarInternal::mousePressEvent( TQMouseEvent *ev ) { - if ( ev->button() != QMouseEvent::RightButton ){ + if ( ev->button() != TQMouseEvent::RightButton ){ ev->ignore(); return; } @@ -216,13 +216,13 @@ void MultiTabBarInternal::mousePressEvent( QMouseEvent *ev ) } else {diff=0; } -void MultiTabBarInternal::resizeEvent( QResizeEvent *ev ) +void MultiTabBarInternal::resizeEvent( TQResizeEvent *ev ) { /* kdDebug()<<"MultiTabBarInternal::resizeEvent"<geometry()< it( m_tabs );it.current();++it ) { + for ( TQPtrListIterator it( m_tabs );it.current();++it ) { if ( it.current() ->id() == id ) return it.current(); } return 0; } -bool MultiTabBarInternal::eventFilter( QObject *, QEvent *e ) +bool MultiTabBarInternal::eventFilter( TQObject *, TQEvent *e ) { - if ( e->type() == QEvent::Resize ) + if ( e->type() == TQEvent::Resize ) resizeEvent( 0 ); //PATCH by markey: Allow switching of tabs with mouse wheel - if ( e->type() == QEvent::Wheel ) { - QWheelEvent* event = static_cast( e ); + if ( e->type() == TQEvent::Wheel ) { + TQWheelEvent* event = static_cast( e ); const int delta = event->delta() / 120; // Determine which tab is currently active @@ -410,7 +410,7 @@ bool MultiTabBarInternal::eventFilter( QObject *, QEvent *e ) return false; } -int MultiTabBarInternal::appendTab( const QPixmap &pic , int id, const QString& text, const QString& identifier ) +int MultiTabBarInternal::appendTab( const TQPixmap &pic , int id, const TQString& text, const TQString& identifier ) { MultiTabBarTab * tab; m_tabs.append( tab = new MultiTabBarTab( pic, text, id, box, m_position, m_style ) ); @@ -507,15 +507,15 @@ uint MultiTabBarInternal::sizePerTab() } -MultiTabBarButton::MultiTabBarButton( const QPixmap& pic, const QString& text, QPopupMenu *popup, - int id, QWidget *parent, MultiTabBar::MultiTabBarPosition pos, MultiTabBar::MultiTabBarStyle style ) - : QPushButton( QIconSet(), text, parent ) +MultiTabBarButton::MultiTabBarButton( const TQPixmap& pic, const TQString& text, TQPopupMenu *popup, + int id, TQWidget *parent, MultiTabBar::MultiTabBarPosition pos, MultiTabBar::MultiTabBarStyle style ) + : TQPushButton( TQIconSet(), text, parent ) , m_position( pos ) , m_style( style ) , m_id( id ) , m_animCount( 0 ) - , m_animTimer( new QTimer( this ) ) - , m_dragSwitchTimer( new QTimer( this ) ) + , m_animTimer( new TQTimer( this ) ) + , m_dragSwitchTimer( new TQTimer( this ) ) { setAcceptDrops( true ); setIconSet( pic ); @@ -525,18 +525,18 @@ MultiTabBarButton::MultiTabBarButton( const QPixmap& pic, const QString& text, Q setFixedHeight( 24 ); setFixedWidth( 24 ); -// QToolTip::add( this, text ); // Deactivated cause it's annoying - connect( this, SIGNAL( clicked() ), this, SLOT( slotClicked() ) ); - connect( m_animTimer, SIGNAL( timeout() ), this, SLOT( slotAnimTimer() ) ); - connect( m_dragSwitchTimer, SIGNAL( timeout() ), this, SLOT( slotDragSwitchTimer() ) ); +// TQToolTip::add( this, text ); // Deactivated cause it's annoying + connect( this, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotClicked() ) ); + connect( m_animTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotAnimTimer() ) ); + connect( m_dragSwitchTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotDragSwitchTimer() ) ); } -MultiTabBarButton::MultiTabBarButton( const QString& text, QPopupMenu *popup, - int id, QWidget *parent, MultiTabBar::MultiTabBarPosition pos, MultiTabBar::MultiTabBarStyle style ) - : QPushButton( QIconSet(), text, parent ), m_style( style ) +MultiTabBarButton::MultiTabBarButton( const TQString& text, TQPopupMenu *popup, + int id, TQWidget *parent, MultiTabBar::MultiTabBarPosition pos, MultiTabBar::MultiTabBarStyle style ) + : TQPushButton( TQIconSet(), text, parent ), m_style( style ) , m_animCount( 0 ) - , m_animTimer( new QTimer( this ) ) - , m_dragSwitchTimer( new QTimer( this ) ) + , m_animTimer( new TQTimer( this ) ) + , m_dragSwitchTimer( new TQTimer( this ) ) { d = new MultiTabBarButtonPrivate; setAcceptDrops( true ); @@ -547,11 +547,11 @@ MultiTabBarButton::MultiTabBarButton( const QString& text, QPopupMenu *popup, setFixedHeight( 24 ); setFixedWidth( 24 ); m_id = id; -// QToolTip::add( this, text ); +// TQToolTip::add( this, text ); - connect( this, SIGNAL( clicked() ), this, SLOT( slotClicked() ) ); - connect( m_animTimer, SIGNAL( timeout() ), this, SLOT( slotAnimTimer() ) ); - connect( m_dragSwitchTimer, SIGNAL( timeout() ), this, SLOT( slotDragSwitchTimer() ) ); + connect( this, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotClicked() ) ); + connect( m_animTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotAnimTimer() ) ); + connect( m_dragSwitchTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotDragSwitchTimer() ) ); } MultiTabBarButton::~MultiTabBarButton() @@ -564,11 +564,11 @@ int MultiTabBarButton::id() const return m_id; } -void MultiTabBarButton::setText( const QString& text ) +void MultiTabBarButton::setText( const TQString& text ) { - QPushButton::setText( text ); + TQPushButton::setText( text ); m_text = text; -// QToolTip::add( this, text ); +// TQToolTip::add( this, text ); } void MultiTabBarButton::proxyDrops( DropProxyTarget *finalDropTarget ) @@ -593,21 +593,21 @@ void MultiTabBarButton::setStyle( MultiTabBar::MultiTabBarStyle style ) repaint(); } -void MultiTabBarButton::hideEvent( QHideEvent* he ) +void MultiTabBarButton::hideEvent( TQHideEvent* he ) { - QPushButton::hideEvent( he ); + TQPushButton::hideEvent( he ); MultiTabBar *tb = dynamic_cast( parentWidget() ); if ( tb ) tb->updateSeparator(); } -void MultiTabBarButton::showEvent( QShowEvent* he ) +void MultiTabBarButton::showEvent( TQShowEvent* he ) { - QPushButton::showEvent( he ); + TQPushButton::showEvent( he ); MultiTabBar *tb = dynamic_cast( parentWidget() ); if ( tb ) tb->updateSeparator(); } -void MultiTabBarButton::enterEvent( QEvent* ) +void MultiTabBarButton::enterEvent( TQEvent* ) { m_animEnter = true; m_animCount = 0; @@ -615,7 +615,7 @@ void MultiTabBarButton::enterEvent( QEvent* ) m_animTimer->start( ANIM_INTERVAL ); } -void MultiTabBarButton::leaveEvent( QEvent* ) +void MultiTabBarButton::leaveEvent( TQEvent* ) { // This can happen if you enter and leave the tab quickly if ( m_animCount == 0 ) @@ -625,25 +625,25 @@ void MultiTabBarButton::leaveEvent( QEvent* ) m_animTimer->start( ANIM_INTERVAL ); } -void MultiTabBarButton::dragEnterEvent ( QDragEnterEvent *e ) +void MultiTabBarButton::dragEnterEvent ( TQDragEnterEvent *e ) { enterEvent ( e ); e->accept( d->finalDropTarget ); } -void MultiTabBarButton::dragMoveEvent ( QDragMoveEvent * ) +void MultiTabBarButton::dragMoveEvent ( TQDragMoveEvent * ) { if ( !m_dragSwitchTimer->isActive() ) m_dragSwitchTimer->start( ANIM_INTERVAL * ANIM_MAX + 300, true ); } -void MultiTabBarButton::dragLeaveEvent ( QDragLeaveEvent *e ) +void MultiTabBarButton::dragLeaveEvent ( TQDragLeaveEvent *e ) { m_dragSwitchTimer->stop(); leaveEvent( e ); } -void MultiTabBarButton::dropEvent( QDropEvent *e ) +void MultiTabBarButton::dropEvent( TQDropEvent *e ) { m_dragSwitchTimer->stop(); if( d->finalDropTarget ) @@ -671,7 +671,7 @@ void MultiTabBarButton::slotAnimTimer() } } -QSize MultiTabBarButton::sizeHint() const +TQSize MultiTabBarButton::sizeHint() const { constPolish(); @@ -680,26 +680,26 @@ QSize MultiTabBarButton::sizeHint() const // calculate contents size... #ifndef QT_NO_ICONSET if ( iconSet() && !iconSet() ->isNull() ) { - int iw = iconSet() ->pixmap( QIconSet::Small, QIconSet::Normal ).width() + 4; - int ih = iconSet() ->pixmap( QIconSet::Small, QIconSet::Normal ).height(); + int iw = iconSet() ->pixmap( TQIconSet::Small, TQIconSet::Normal ).width() + 4; + int ih = iconSet() ->pixmap( TQIconSet::Small, TQIconSet::Normal ).height(); w += iw; h = QMAX( h, ih ); } #endif if ( isMenuButton() ) - w += style().pixelMetric( QStyle::PM_MenuButtonIndicator, this ); + w += style().pixelMetric( TQStyle::PM_MenuButtonIndicator, this ); if ( pixmap() ) { - QPixmap * pm = const_cast< QPixmap * >( pixmap() ); + TQPixmap * pm = const_cast< TQPixmap * >( pixmap() ); w += pm->width(); h += pm->height(); } else { - QString s( text() ); + TQString s( text() ); bool empty = s.isEmpty(); if ( empty ) - s = QString::fromLatin1( "XXXX" ); - QFontMetrics fm = fontMetrics(); - QSize sz = fm.size( ShowPrefix, s ); + s = TQString::fromLatin1( "XXXX" ); + TQFontMetrics fm = fontMetrics(); + TQSize sz = fm.size( ShowPrefix, s ); if ( !empty || !w ) w += sz.width(); if ( !empty || !h ) @@ -714,13 +714,13 @@ QSize MultiTabBarButton::sizeHint() const // h = ( parentWidget()->width() - 3 ) / NUM_TABS; // } - return ( style().sizeFromContents( QStyle::CT_ToolButton, this, QSize( w, h ) ). - expandedTo( QApplication::globalStrut() ) ); + return ( style().sizeFromContents( TQStyle::CT_ToolButton, this, TQSize( w, h ) ). + expandedTo( TQApplication::globalStrut() ) ); } -MultiTabBarTab::MultiTabBarTab( const QPixmap& pic, const QString& text, - int id, QWidget *parent, MultiTabBar::MultiTabBarPosition pos, +MultiTabBarTab::MultiTabBarTab( const TQPixmap& pic, const TQString& text, + int id, TQWidget *parent, MultiTabBar::MultiTabBarPosition pos, MultiTabBar::MultiTabBarStyle style ) : MultiTabBarButton( text, 0, id, parent, pos, style ), m_visible(true), @@ -746,7 +746,7 @@ void MultiTabBarTab::setTabsPosition( MultiTabBar::MultiTabBarPosition pos ) { if ( ( pos != m_position ) && ( ( pos == MultiTabBar::Left ) || ( pos == MultiTabBar::Right ) ) ) { if ( !d->pix.isNull() ) { - QWMatrix temp; // (1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F); + TQWMatrix temp; // (1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F); temp.rotate( 180 ); d->pix = d->pix.xForm( temp ); setIconSet( d->pix ); @@ -757,23 +757,23 @@ void MultiTabBarTab::setTabsPosition( MultiTabBar::MultiTabBarPosition pos ) // repaint(); } -void MultiTabBarTab::setIcon( const QString& icon ) +void MultiTabBarTab::setIcon( const TQString& icon ) { - QPixmap pic = SmallIcon( icon ); + TQPixmap pic = SmallIcon( icon ); setIcon( pic ); } -void MultiTabBarTab::setIcon( const QPixmap& icon ) +void MultiTabBarTab::setIcon( const TQPixmap& icon ) { if ( m_style != MultiTabBar::KDEV3 ) { if ( ( m_position == MultiTabBar::Left ) || ( m_position == MultiTabBar::Right ) ) { - QWMatrix rotateMatrix; + TQWMatrix rotateMatrix; if ( m_position == MultiTabBar::Left ) rotateMatrix.rotate( 90 ); else rotateMatrix.rotate( -90 ); - QPixmap pic = icon.xForm( rotateMatrix ); //TODO FIX THIS, THIS SHOWS WINDOW + TQPixmap pic = icon.xForm( rotateMatrix ); //TODO FIX THIS, THIS SHOWS WINDOW d->pix = pic; setIconSet( pic ); } else setIconSet( icon ); @@ -803,10 +803,10 @@ void MultiTabBarTab::updateState() if ( m_style != MultiTabBar::KONQSBC ) { if ( ( m_style == MultiTabBar::KDEV3 ) || ( m_style == MultiTabBar::KDEV3ICON ) || ( m_style == MultiTabBar::AMAROK ) || ( isOn() ) ) { - QPushButton::setText( m_text ); + TQPushButton::setText( m_text ); } else { - kdDebug() << "MultiTabBarTab::updateState(): setting text to an empty QString***************" << endl; - QPushButton::setText( QString::null ); + kdDebug() << "MultiTabBarTab::updateState(): setting text to an empty TQString***************" << endl; + TQPushButton::setText( TQString::null ); } if ( ( m_position == MultiTabBar::Right || m_position == MultiTabBar::Left ) ) { @@ -831,13 +831,13 @@ void MultiTabBarTab::updateState() else setFixedWidth( m_expandedSize ); } - QApplication::sendPostedEvents( 0, QEvent::Paint | QEvent::Move | QEvent::Resize | QEvent::LayoutHint ); - QApplication::flush(); + TQApplication::sendPostedEvents( 0, TQEvent::Paint | TQEvent::Move | TQEvent::Resize | TQEvent::LayoutHint ); + TQApplication::flush(); } int MultiTabBarTab::neededSize() { - return ( ( ( m_style != MultiTabBar::KDEV3 ) ? 24 : 0 ) + QFontMetrics( QFont() ).width( m_text ) + 6 ); + return ( ( ( m_style != MultiTabBar::KDEV3 ) ? 24 : 0 ) + TQFontMetrics( TQFont() ).width( m_text ) + 6 ); } void MultiTabBarTab::setSize( int size ) @@ -851,44 +851,44 @@ void MultiTabBarTab::showActiveTabText( bool show ) m_showActiveTabText = show; } -void MultiTabBarTab::drawButtonLabel( QPainter *p ) +void MultiTabBarTab::drawButtonLabel( TQPainter *p ) { drawButton( p ); } -void MultiTabBarTab::drawButton( QPainter *paint ) +void MultiTabBarTab::drawButton( TQPainter *paint ) { if ( m_style == MultiTabBar::AMAROK ) drawButtonAmarok( paint ); else if ( m_style != MultiTabBar::KONQSBC ) drawButtonStyled( paint ); else drawButtonClassic( paint ); } -void MultiTabBarTab::drawButtonStyled( QPainter *paint ) +void MultiTabBarTab::drawButtonStyled( TQPainter *paint ) { - QSize sh; + TQSize sh; const int width = 36; // rotated const int height = 24; if ( ( m_style == MultiTabBar::KDEV3 ) || ( m_style == MultiTabBar::KDEV3ICON ) || ( m_style == MultiTabBar::AMAROK ) || ( isOn() ) ) { if ( ( m_position == MultiTabBar::Left ) || ( m_position == MultiTabBar::Right ) ) - sh = QSize( this->height(), this->width() ); //MultiTabBarButton::sizeHint(); + sh = TQSize( this->height(), this->width() ); //MultiTabBarButton::sizeHint(); else - sh = QSize( this->width(), this->height() ); + sh = TQSize( this->width(), this->height() ); } else - sh = QSize( width, height ); + sh = TQSize( width, height ); - QPixmap pixmap( sh.width(), height ); ///,sh.height()); + TQPixmap pixmap( sh.width(), height ); ///,sh.height()); pixmap.fill( eraseColor() ); - QPainter painter( &pixmap ); + TQPainter painter( &pixmap ); - QStyle::SFlags st = QStyle::Style_Default; + TQStyle::SFlags st = TQStyle::Style_Default; - st |= QStyle::Style_Enabled; + st |= TQStyle::Style_Enabled; - if ( isOn() ) st |= QStyle::Style_On; + if ( isOn() ) st |= TQStyle::Style_On; - style().drawControl( QStyle::CE_PushButton, &painter, this, QRect( 0, 0, pixmap.width(), pixmap.height() ), colorGroup(), st ); - style().drawControl( QStyle::CE_PushButtonLabel, &painter, this, QRect( 0, 0, pixmap.width(), pixmap.height() ), colorGroup(), st ); + style().drawControl( TQStyle::CE_PushButton, &painter, this, TQRect( 0, 0, pixmap.width(), pixmap.height() ), colorGroup(), st ); + style().drawControl( TQStyle::CE_PushButtonLabel, &painter, this, TQRect( 0, 0, pixmap.width(), pixmap.height() ), colorGroup(), st ); switch ( m_position ) { case MultiTabBar::Left: @@ -904,21 +904,21 @@ void MultiTabBarTab::drawButtonStyled( QPainter *paint ) paint->drawPixmap( 0, 0, pixmap ); break; } - // style().drawControl(QStyle::CE_PushButtonLabel,painter,this, QRect(0,0,pixmap.width(),pixmap.height()), - // colorGroup(),QStyle::Style_Enabled); + // style().drawControl(TQStyle::CE_PushButtonLabel,painter,this, TQRect(0,0,pixmap.width(),pixmap.height()), + // colorGroup(),TQStyle::Style_Enabled); } -void MultiTabBarTab::drawButtonClassic( QPainter *paint ) +void MultiTabBarTab::drawButtonClassic( TQPainter *paint ) { - QPixmap pixmap; + TQPixmap pixmap; if ( iconSet() ) - pixmap = iconSet() ->pixmap( QIconSet::Small, QIconSet::Normal ); + pixmap = iconSet() ->pixmap( TQIconSet::Small, TQIconSet::Normal ); paint->fillRect( 0, 0, 24, 24, colorGroup().background() ); if ( !isOn() ) { if ( m_position == MultiTabBar::Right ) { - paint->fillRect( 0, 0, 21, 21, QBrush( colorGroup().background() ) ); + paint->fillRect( 0, 0, 21, 21, TQBrush( colorGroup().background() ) ); paint->setPen( colorGroup().background().dark( 150 ) ); paint->drawLine( 0, 22, 23, 22 ); @@ -932,7 +932,7 @@ void MultiTabBarTab::drawButtonClassic( QPainter *paint ) } else if ( ( m_position == MultiTabBar::Bottom ) || ( m_position == MultiTabBar::Top ) ) { - paint->fillRect( 0, 1, 23, 22, QBrush( colorGroup().background() ) ); + paint->fillRect( 0, 1, 23, 22, TQBrush( colorGroup().background() ) ); paint->drawPixmap( 12 - pixmap.width() / 2, 12 - pixmap.height() / 2, pixmap ); @@ -951,7 +951,7 @@ void MultiTabBarTab::drawButtonClassic( QPainter *paint ) } else { paint->setPen( colorGroup().background().dark( 120 ) ); paint->drawLine( 0, 23, 23, 23 ); - paint->fillRect( 0, 0, 23, 21, QBrush( colorGroup().background() ) ); + paint->fillRect( 0, 0, 23, 21, TQBrush( colorGroup().background() ) ); paint->drawPixmap( 12 - pixmap.width() / 2, 12 - pixmap.height() / 2, pixmap ); paint->setPen( colorGroup().light() ); @@ -971,19 +971,19 @@ void MultiTabBarTab::drawButtonClassic( QPainter *paint ) paint->drawLine( 0, height() - 2, 23, height() - 2 ); paint->drawLine( 23, 0, 23, height() - 1 ); paint->drawLine( 22, 0, 22, height() - 1 ); - paint->fillRect( 0, 0, 21, height() - 3, QBrush( colorGroup().light() ) ); + paint->fillRect( 0, 0, 21, height() - 3, TQBrush( colorGroup().light() ) ); paint->drawPixmap( 10 - pixmap.width() / 2, 10 - pixmap.height() / 2, pixmap ); if ( m_showActiveTabText ) { if ( height() < 25 + 4 ) return ; - QPixmap tpixmap( height() - 25 - 3, width() - 2 ); - QPainter painter( &tpixmap ); + TQPixmap tpixmap( height() - 25 - 3, width() - 2 ); + TQPainter painter( &tpixmap ); - painter.fillRect( 0, 0, tpixmap.width(), tpixmap.height(), QBrush( colorGroup().light() ) ); + painter.fillRect( 0, 0, tpixmap.width(), tpixmap.height(), TQBrush( colorGroup().light() ) ); painter.setPen( colorGroup().text() ); - painter.drawText( 0, + width() / 2 + QFontMetrics( QFont() ).height() / 2, m_text ); + painter.drawText( 0, + width() / 2 + TQFontMetrics( TQFont() ).height() / 2, m_text ); paint->rotate( 90 ); kdDebug() << "tpixmap.width:" << tpixmap.width() << endl; @@ -992,22 +992,22 @@ void MultiTabBarTab::drawButtonClassic( QPainter *paint ) } else if ( m_position == MultiTabBar::Top ) { - paint->fillRect( 0, 0, width() - 1, 23, QBrush( colorGroup().light() ) ); + paint->fillRect( 0, 0, width() - 1, 23, TQBrush( colorGroup().light() ) ); paint->drawPixmap( 10 - pixmap.width() / 2, 10 - pixmap.height() / 2, pixmap ); if ( m_showActiveTabText ) { paint->setPen( colorGroup().text() ); - paint->drawText( 25, height() / 2 + QFontMetrics( QFont() ).height() / 2, m_text ); + paint->drawText( 25, height() / 2 + TQFontMetrics( TQFont() ).height() / 2, m_text ); } } else if ( m_position == MultiTabBar::Bottom ) { paint->setPen( colorGroup().shadow() ); paint->drawLine( 0, 23, width() - 1, 23 ); paint->drawLine( 0, 22, width() - 1, 22 ); - paint->fillRect( 0, 0, width() - 1, 21, QBrush( colorGroup().light() ) ); + paint->fillRect( 0, 0, width() - 1, 21, TQBrush( colorGroup().light() ) ); paint->drawPixmap( 10 - pixmap.width() / 2, 10 - pixmap.height() / 2, pixmap ); if ( m_showActiveTabText ) { paint->setPen( colorGroup().text() ); - paint->drawText( 25, height() / 2 + QFontMetrics( QFont() ).height() / 2, m_text ); + paint->drawText( 25, height() / 2 + TQFontMetrics( TQFont() ).height() / 2, m_text ); } } else { @@ -1016,19 +1016,19 @@ void MultiTabBarTab::drawButtonClassic( QPainter *paint ) paint->setPen( colorGroup().shadow() ); paint->drawLine( 0, height() - 1, 23, height() - 1 ); paint->drawLine( 0, height() - 2, 23, height() - 2 ); - paint->fillRect( 0, 0, 23, height() - 3, QBrush( colorGroup().light() ) ); + paint->fillRect( 0, 0, 23, height() - 3, TQBrush( colorGroup().light() ) ); paint->drawPixmap( 10 - pixmap.width() / 2, 10 - pixmap.height() / 2, pixmap ); if ( m_showActiveTabText ) { if ( height() < 25 + 4 ) return ; - QPixmap tpixmap( height() - 25 - 3, width() - 2 ); - QPainter painter( &tpixmap ); + TQPixmap tpixmap( height() - 25 - 3, width() - 2 ); + TQPainter painter( &tpixmap ); - painter.fillRect( 0, 0, tpixmap.width(), tpixmap.height(), QBrush( colorGroup().light() ) ); + painter.fillRect( 0, 0, tpixmap.width(), tpixmap.height(), TQBrush( colorGroup().light() ) ); painter.setPen( colorGroup().text() ); - painter.drawText( tpixmap.width() - QFontMetrics( QFont() ).width( m_text ), + width() / 2 + QFontMetrics( QFont() ).height() / 2, m_text ); + painter.drawText( tpixmap.width() - TQFontMetrics( TQFont() ).width( m_text ), + width() / 2 + TQFontMetrics( TQFont() ).height() / 2, m_text ); paint->rotate( -90 ); kdDebug() << "tpixmap.width:" << tpixmap.width() << endl; @@ -1042,9 +1042,9 @@ void MultiTabBarTab::drawButtonClassic( QPainter *paint ) } } -void MultiTabBarTab::drawButtonAmarok( QPainter *paint ) +void MultiTabBarTab::drawButtonAmarok( TQPainter *paint ) { - QColor fillColor, textColor; + TQColor fillColor, textColor; if ( isOn() ) { fillColor = blendColors( colorGroup().highlight(), colorGroup().background(), static_cast( m_animCount * 3.5 ) ); textColor = blendColors( colorGroup().highlightedText(), colorGroup().text(), static_cast( m_animCount * 4.5 ) ); @@ -1059,16 +1059,16 @@ void MultiTabBarTab::drawButtonAmarok( QPainter *paint ) #ifndef QT_NO_ICONSET if ( iconSet() && !iconSet() ->isNull() ) { - QPixmap icon = iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ); + TQPixmap icon = iconSet()->pixmap( TQIconSet::Small, TQIconSet::Normal ); // Apply icon effect when widget disabled. Should really be cached, but *shrug*. if( !isEnabled() ) icon = kapp->iconLoader()->iconEffect()->apply( icon, KIcon::Small, KIcon::DisabledState ); if( m_position == MultiTabBar::Left || m_position == MultiTabBar::Right ) { - QPixmap pixmap( height(), width() ); + TQPixmap pixmap( height(), width() ); pixmap.fill( fillColor ); - QPainter painter( &pixmap ); + TQPainter painter( &pixmap ); // Draw the frame painter.setPen( colorGroup().mid() ); @@ -1076,13 +1076,13 @@ void MultiTabBarTab::drawButtonAmarok( QPainter *paint ) painter.drawLine( 0, pixmap.height() - 1, pixmap.width() - 1, pixmap.height() - 1 ); // Draw the text - QFont font; + TQFont font; painter.setFont( font ); - QString text = KStringHandler::rPixelSqueeze( m_text, QFontMetrics( font ), pixmap.width() - icon.width() - 3 ); + TQString text = KStringHandler::rPixelSqueeze( m_text, TQFontMetrics( font ), pixmap.width() - icon.width() - 3 ); text.replace( "...", ".." ); - const int textX = pixmap.width() / 2 - QFontMetrics( font ).width( text ) / 2; + const int textX = pixmap.width() / 2 - TQFontMetrics( font ).width( text ) / 2; painter.setPen( textColor ); - const QRect rect( textX + icon.width() / 2 + 2, 0, pixmap.width(), pixmap.height() ); + const TQRect rect( textX + icon.width() / 2 + 2, 0, pixmap.width(), pixmap.height() ); painter.drawText( rect, Qt::AlignLeft | Qt::AlignVCenter, text ); // Draw the icon @@ -1094,9 +1094,9 @@ void MultiTabBarTab::drawButtonAmarok( QPainter *paint ) } else { // Horizontal - QPixmap pixmap( width(), height() ); + TQPixmap pixmap( width(), height() ); pixmap.fill( fillColor ); - QPainter painter( &pixmap ); + TQPainter painter( &pixmap ); // Draw the frame painter.setPen( colorGroup().mid() ); @@ -1104,13 +1104,13 @@ void MultiTabBarTab::drawButtonAmarok( QPainter *paint ) painter.drawLine( 0, pixmap.height() - 1, pixmap.width() - 1, pixmap.height() - 1 ); // Draw the text - QFont font; + TQFont font; painter.setFont( font ); - QString text = KStringHandler::rPixelSqueeze( m_text, QFontMetrics( font ), pixmap.width() - icon.width() - 3 ); + TQString text = KStringHandler::rPixelSqueeze( m_text, TQFontMetrics( font ), pixmap.width() - icon.width() - 3 ); text.replace( "...", ".." ); - const int textX = pixmap.width() / 2 - QFontMetrics( font ).width( text ) / 2; + const int textX = pixmap.width() / 2 - TQFontMetrics( font ).width( text ) / 2; painter.setPen( textColor ); - const QRect rect( textX + icon.width() / 2 + 2, 0, pixmap.width(), pixmap.height() ); + const TQRect rect( textX + icon.width() / 2 + 2, 0, pixmap.width(), pixmap.height() ); painter.drawText( rect, Qt::AlignLeft | Qt::AlignVCenter, text ); // Draw the icon @@ -1124,7 +1124,7 @@ void MultiTabBarTab::drawButtonAmarok( QPainter *paint ) } -QColor MultiTabBarTab::blendColors( const QColor& color1, const QColor& color2, int percent ) +TQColor MultiTabBarTab::blendColors( const TQColor& color1, const TQColor& color2, int percent ) { const float factor1 = ( 100 - ( float ) percent ) / 100; const float factor2 = ( float ) percent / 100; @@ -1133,7 +1133,7 @@ QColor MultiTabBarTab::blendColors( const QColor& color1, const QColor& color2, const int g = static_cast( color1.green() * factor1 + color2.green() * factor2 ); const int b = static_cast( color1.blue() * factor1 + color2.blue() * factor2 ); - QColor result; + TQColor result; result.setRgb( r, g, b ); return result; @@ -1142,16 +1142,16 @@ QColor MultiTabBarTab::blendColors( const QColor& color1, const QColor& color2, -MultiTabBar::MultiTabBar( MultiTabBarMode bm, QWidget *parent, const char *name ) : QWidget( parent, name ) +MultiTabBar::MultiTabBar( MultiTabBarMode bm, TQWidget *parent, const char *name ) : TQWidget( parent, name ) { m_buttons.setAutoDelete( false ); if ( bm == Vertical ) { - m_l = new QVBoxLayout( this ); - setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding, true ); + m_l = new TQVBoxLayout( this ); + setSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Expanding, true ); // setFixedWidth(24); } else { - m_l = new QHBoxLayout( this ); - setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed, true ); + m_l = new TQHBoxLayout( this ); + setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed, true ); // setFixedHeight(24); } m_l->setMargin( 0 ); @@ -1163,9 +1163,9 @@ MultiTabBar::MultiTabBar( MultiTabBarMode bm, QWidget *parent, const char *name // setStyle(KDEV3); //setStyle(KONQSBC); m_l->insertWidget( 0, m_internal ); - m_l->insertWidget( 0, m_btnTabSep = new QFrame( this ) ); + m_l->insertWidget( 0, m_btnTabSep = new TQFrame( this ) ); m_btnTabSep->setFixedHeight( 4 ); - m_btnTabSep->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + m_btnTabSep->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); m_btnTabSep->setLineWidth( 2 ); m_btnTabSep->hide(); @@ -1175,16 +1175,16 @@ MultiTabBar::MultiTabBar( MultiTabBarMode bm, QWidget *parent, const char *name MultiTabBar::~MultiTabBar() {} -/*int MultiTabBar::insertButton(QPixmap pic,int id ,const QString&) +/*int MultiTabBar::insertButton(TQPixmap pic,int id ,const TQString&) { (new KToolbarButton(pic,id,m_internal))->show(); return 0; }*/ -int MultiTabBar::appendButton( const QPixmap &pic , int id, QPopupMenu *popup, const QString& ) +int MultiTabBar::appendButton( const TQPixmap &pic , int id, TQPopupMenu *popup, const TQString& ) { MultiTabBarButton * btn; - m_buttons.append( btn = new MultiTabBarButton( pic, QString::null, + m_buttons.append( btn = new MultiTabBarButton( pic, TQString::null, popup, id, this, m_position, m_internal->m_style ) ); m_l->insertWidget( 0, btn ); btn->show(); @@ -1195,7 +1195,7 @@ int MultiTabBar::appendButton( const QPixmap &pic , int id, QPopupMenu *popup, c void MultiTabBar::updateSeparator() { bool hideSep = true; - for ( QPtrListIterator it( m_buttons );it.current();++it ) { + for ( TQPtrListIterator it( m_buttons );it.current();++it ) { if ( it.current() ->isVisibleTo( this ) ) { hideSep = false; break; @@ -1206,7 +1206,7 @@ void MultiTabBar::updateSeparator() } -int MultiTabBar::appendTab( const QPixmap &pic , int id , const QString& text, const QString& identifier ) +int MultiTabBar::appendTab( const TQPixmap &pic , int id , const TQString& text, const TQString& identifier ) { m_internal->appendTab( pic, id, text, identifier ); return 0; @@ -1214,7 +1214,7 @@ int MultiTabBar::appendTab( const QPixmap &pic , int id , const QString& text, c MultiTabBarButton* MultiTabBar::button( int id ) const { - for ( QPtrListIterator it( m_buttons );it.current();++it ) { + for ( TQPtrListIterator it( m_buttons );it.current();++it ) { if ( it.current() ->id() == id ) return it.current(); } return 0; @@ -1291,17 +1291,17 @@ void MultiTabBar::setPosition( MultiTabBarPosition pos ) for ( uint i = 0;i < m_buttons.count();i++ ) m_buttons.at( i ) ->setPosition( pos ); } -void MultiTabBar::fontChange( const QFont& /* oldFont */ ) +void MultiTabBar::fontChange( const TQFont& /* oldFont */ ) { for ( uint i = 0;i < tabs() ->count();i++ ) tabs() ->at( i ) ->resize(); repaint(); } -QPtrList* MultiTabBar::tabs() { return m_internal->tabs();} -QPtrList* MultiTabBar::buttons() { return & m_buttons;} +TQPtrList* MultiTabBar::tabs() { return m_internal->tabs();} +TQPtrList* MultiTabBar::buttons() { return & m_buttons;} -void MultiTabBar::showTabSelectionMenu(QPoint pos) +void MultiTabBar::showTabSelectionMenu(TQPoint pos) { m_internal->showTabSelectionMenu(pos); } diff --git a/amarok/src/multitabbar.h b/amarok/src/multitabbar.h index 7f4eed96..fbb898f2 100644 --- a/amarok/src/multitabbar.h +++ b/amarok/src/multitabbar.h @@ -26,17 +26,17 @@ #ifndef _Multitabbar_h_ #define _Multitabbar_h_ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include -class QPixmap; -class QPainter; -class QFrame; +class TQPixmap; +class TQPainter; +class TQFrame; class MultiTabBarPrivate; class MultiTabBarTabPrivate; @@ -47,7 +47,7 @@ class MultiTabBarInternal; class DropProxyTarget { public: - virtual void dropProxyEvent( QDropEvent *e ) = 0; + virtual void dropProxyEvent( TQDropEvent *e ) = 0; }; /** @@ -72,7 +72,7 @@ class MultiTabBar: public QWidget */ enum MultiTabBarStyle{VSNET = 0, KDEV3 = 1, KONQSBC = 2, KDEV3ICON = 3, AMAROK = 4, STYLELAST = 0xffff}; - MultiTabBar( MultiTabBarMode bm, QWidget *parent = 0, const char *name = 0 ); + MultiTabBar( MultiTabBarMode bm, TQWidget *parent = 0, const char *name = 0 ); virtual ~MultiTabBar(); /** @@ -84,7 +84,7 @@ class MultiTabBar: public QWidget * @param popup A popup menu which should be displayed if the button is clicked * @param not_used_yet will be used for a popup text in the future */ - int appendButton( const QPixmap &pic, int id = -1, QPopupMenu* popup = 0, const QString& not_used_yet = QString::null ); + int appendButton( const TQPixmap &pic, int id = -1, TQPopupMenu* popup = 0, const TQString& not_used_yet = TQString::null ); /** * remove a button with the given ID */ @@ -96,7 +96,7 @@ class MultiTabBar: public QWidget * @param text if a mode with text is used it will be the tab text, otherwise a mouse over hint * @param identifier for storing visibility to config file */ - int appendTab( const QPixmap &pic, int id = -1, const QString& text = QString::null, const QString& identifier = QString::null ); + int appendTab( const TQPixmap &pic, int id = -1, const TQString& text = TQString::null, const TQString& identifier = TQString::null ); /** * remove a tab with a given ID */ @@ -132,11 +132,11 @@ class MultiTabBar: public QWidget /** * be carefull, don't delete tabs yourself and don't delete the list itself */ - QPtrList* tabs(); + TQPtrList* tabs(); /** * be carefull, don't delete buttons yourself and don't delete the list itself */ - QPtrList* buttons(); + TQPtrList* buttons(); /** * might vanish, not sure yet @@ -152,17 +152,17 @@ class MultiTabBar: public QWidget */ uint sizePerTab(); - void showTabSelectionMenu(QPoint pos); + void showTabSelectionMenu(TQPoint pos); protected: friend class MultiTabBarButton; - virtual void fontChange( const QFont& ); + virtual void fontChange( const TQFont& ); void updateSeparator(); private: class MultiTabBarInternal *m_internal; - QBoxLayout *m_l; - QFrame *m_btnTabSep; - QPtrList m_buttons; + TQBoxLayout *m_l; + TQFrame *m_btnTabSep; + TQPtrList m_buttons; MultiTabBarPosition m_position; MultiTabBarPrivate *d; }; @@ -174,10 +174,10 @@ class MultiTabBarButton: public QPushButton { Q_OBJECT public: - MultiTabBarButton( const QPixmap& pic, const QString&, QPopupMenu *popup, - int id, QWidget *parent, MultiTabBar::MultiTabBarPosition pos, MultiTabBar::MultiTabBarStyle style ); - MultiTabBarButton( const QString&, QPopupMenu *popup, - int id, QWidget *parent, MultiTabBar::MultiTabBarPosition pos, MultiTabBar::MultiTabBarStyle style ); + MultiTabBarButton( const TQPixmap& pic, const TQString&, TQPopupMenu *popup, + int id, TQWidget *parent, MultiTabBar::MultiTabBarPosition pos, MultiTabBar::MultiTabBarStyle style ); + MultiTabBarButton( const TQString&, TQPopupMenu *popup, + int id, TQWidget *parent, MultiTabBar::MultiTabBarPosition pos, MultiTabBar::MultiTabBarStyle style ); virtual ~MultiTabBarButton(); int id() const; @@ -196,14 +196,14 @@ class MultiTabBarButton: public QPushButton /** * modify the text of the button */ - void setText( const QString & ); + void setText( const TQString & ); /** * make this a drop proxy for finalDropTarget */ void proxyDrops( DropProxyTarget *finalDropTarget ); - QSize sizeHint() const; + TQSize sizeHint() const; protected: static const int ANIM_INTERVAL = 18; @@ -211,23 +211,23 @@ class MultiTabBarButton: public QPushButton MultiTabBar::MultiTabBarPosition m_position; MultiTabBar::MultiTabBarStyle m_style; - QString m_text; + TQString m_text; int m_id; bool m_animEnter; int m_animCount; - class QTimer* m_animTimer; - class QTimer* m_dragSwitchTimer; + class TQTimer* m_animTimer; + class TQTimer* m_dragSwitchTimer; - virtual void hideEvent( class QHideEvent* ); - virtual void showEvent( class QShowEvent* ); - virtual void enterEvent( class QEvent* ); - virtual void leaveEvent( class QEvent* ); + virtual void hideEvent( class TQHideEvent* ); + virtual void showEvent( class TQShowEvent* ); + virtual void enterEvent( class TQEvent* ); + virtual void leaveEvent( class TQEvent* ); - virtual void dragEnterEvent ( class QDragEnterEvent * ); - virtual void dragMoveEvent ( class QDragMoveEvent * ); - virtual void dragLeaveEvent ( class QDragLeaveEvent * ); - virtual void dropEvent( class QDropEvent * ); + virtual void dragEnterEvent ( class TQDragEnterEvent * ); + virtual void dragMoveEvent ( class TQDragMoveEvent * ); + virtual void dragLeaveEvent ( class TQDragLeaveEvent * ); + virtual void dropEvent( class TQDropEvent * ); private: MultiTabBarButtonPrivate *d; signals: @@ -250,7 +250,7 @@ class MultiTabBarTab: public MultiTabBarButton { Q_OBJECT public: - MultiTabBarTab( const QPixmap& pic, const QString&, int id, QWidget *parent, + MultiTabBarTab( const TQPixmap& pic, const TQString&, int id, TQWidget *parent, MultiTabBar::MultiTabBarPosition pos, MultiTabBar::MultiTabBarStyle style ); virtual ~MultiTabBarTab(); /** @@ -266,32 +266,32 @@ class MultiTabBarTab: public MultiTabBarButton void resize() { setSize( neededSize() ); } bool visible() { return m_visible; }; void setVisible( bool visible) { m_visible = visible; }; - void setIdentifier( const QString &id ) { m_identifier = id; } - const QString &identifier() const { return m_identifier; } + void setIdentifier( const TQString &id ) { m_identifier = id; } + const TQString &identifier() const { return m_identifier; } private: bool m_visible; bool m_showActiveTabText; int m_expandedSize; - QString m_identifier; + TQString m_identifier; MultiTabBarTabPrivate *d; protected: friend class MultiTabBarInternal; void setSize( int ); int neededSize(); void updateState(); - virtual void drawButton( QPainter * ); - virtual void drawButtonLabel( QPainter * ); - void drawButtonStyled( QPainter * ); - void drawButtonClassic( QPainter * ); - void drawButtonAmarok( QPainter * ); - QColor blendColors( const QColor& color1, const QColor& color2, int percent ); + virtual void drawButton( TQPainter * ); + virtual void drawButtonLabel( TQPainter * ); + void drawButtonStyled( TQPainter * ); + void drawButtonClassic( TQPainter * ); + void drawButtonAmarok( TQPainter * ); + TQColor blendColors( const TQColor& color1, const TQColor& color2, int percent ); protected slots: virtual void slotClicked(); void setTabsPosition( MultiTabBar::MultiTabBarPosition ); public slots: - virtual void setIcon( const QString& ); - virtual void setIcon( const QPixmap& ); + virtual void setIcon( const TQString& ); + virtual void setIcon( const TQPixmap& ); }; #endif diff --git a/amarok/src/multitabbar_p.h b/amarok/src/multitabbar_p.h index 05bd2e12..5ba18ad8 100644 --- a/amarok/src/multitabbar_p.h +++ b/amarok/src/multitabbar_p.h @@ -24,31 +24,31 @@ #ifndef MULTI_TAB_BAR_P_H #define MULTI_TAB_BAR_P_H -#include +#include #include class MultiTabBarInternal: public QScrollView { Q_OBJECT public: - MultiTabBarInternal(QWidget *parent,MultiTabBar::MultiTabBarMode bm); - int appendTab(const QPixmap &,int=-1,const QString& =QString::null, const QString&identifier=QString::null); + MultiTabBarInternal(TQWidget *parent,MultiTabBar::MultiTabBarMode bm); + int appendTab(const TQPixmap &,int=-1,const TQString& =TQString::null, const TQString&identifier=TQString::null); MultiTabBarTab *tab(int) const; void removeTab(int); void setTabVisible(int id, bool visible); void setPosition(enum MultiTabBar::MultiTabBarPosition pos); void setStyle(enum MultiTabBar::MultiTabBarStyle style); void showActiveTabTexts(bool show); - QPtrList* tabs(){return &m_tabs;} + TQPtrList* tabs(){return &m_tabs;} uint visibleTabCount(); uint sizePerTab(); - void showTabSelectionMenu(QPoint pos); + void showTabSelectionMenu(TQPoint pos); private: friend class MultiTabBar; - QWidget *box; - QBoxLayout *mainLayout; - QPtrList m_tabs; + TQWidget *box; + TQBoxLayout *mainLayout; + TQPtrList m_tabs; enum MultiTabBar::MultiTabBarPosition m_position; bool m_showActiveTabTexts; enum MultiTabBar::MultiTabBarStyle m_style; @@ -57,17 +57,17 @@ private: MultiTabBar::MultiTabBarMode m_barMode; protected: - virtual bool eventFilter(QObject *,QEvent*); - virtual void drawContents ( QPainter *, int, int, int, int); + virtual bool eventFilter(TQObject *,TQEvent*); + virtual void drawContents ( TQPainter *, int, int, int, int); /** * [contentsM|m]ousePressEvent are reimplemented from QScrollView * in order to ignore all mouseEvents on the viewport, so that the * parent can handle them. */ - virtual void contentsMousePressEvent(QMouseEvent *); - virtual void mousePressEvent(QMouseEvent *); - virtual void resizeEvent(QResizeEvent *); + virtual void contentsMousePressEvent(TQMouseEvent *); + virtual void mousePressEvent(TQMouseEvent *); + virtual void resizeEvent(TQResizeEvent *); }; #endif diff --git a/amarok/src/mydiroperator.cpp b/amarok/src/mydiroperator.cpp index 718d3dfb..3e353f5b 100644 --- a/amarok/src/mydiroperator.cpp +++ b/amarok/src/mydiroperator.cpp @@ -3,9 +3,9 @@ #include -#include +#include -MyDirOperator::MyDirOperator ( const KURL &url, QWidget *parent, Medium *medium ) : KDirOperator( url, parent ) +MyDirOperator::MyDirOperator ( const KURL &url, TQWidget *parent, Medium *medium ) : KDirOperator( url, parent ) { m_medium = medium; setDirLister( new MyDirLister( true ) ); @@ -16,7 +16,7 @@ void MyDirOperator::myHome() { KURL u; - u.setPath( m_medium ? m_medium->mountPoint() : QDir::homeDirPath() ); + u.setPath( m_medium ? m_medium->mountPoint() : TQDir::homeDirPath() ); setURL(u, true); } @@ -24,7 +24,7 @@ void MyDirOperator::myCdUp() { KURL tmp( url() ); - tmp.cd( QString::fromLatin1("..")); + tmp.cd( TQString::fromLatin1("..")); if( m_medium && !tmp.path().startsWith( m_medium->mountPoint() ) ) tmp.setPath( m_medium->mountPoint() ); setURL(tmp, true); diff --git a/amarok/src/mydiroperator.h b/amarok/src/mydiroperator.h index d28bf85e..1068ffca 100644 --- a/amarok/src/mydiroperator.h +++ b/amarok/src/mydiroperator.h @@ -14,11 +14,11 @@ class MyDirOperator : public KDirOperator { Q_OBJECT public: - MyDirOperator( const KURL &url, QWidget *parent, Medium *medium = 0 ); + MyDirOperator( const KURL &url, TQWidget *parent, Medium *medium = 0 ); public slots: //reimplemented due to a bug in KDirOperator::activatedMenu ( KDE 3.4.2 ) - See Bug #103305 - virtual void activatedMenu (const KFileItem *, const QPoint &pos) { + virtual void activatedMenu (const KFileItem *, const TQPoint &pos) { updateSelectionDependentActions(); reenableDeleteKey(); static_cast(actionCollection()->action("popupMenu"))->popupMenu()->popup( pos ); diff --git a/amarok/src/organizecollectiondialog.ui.h b/amarok/src/organizecollectiondialog.ui.h index 4ca3fc03..9c8da710 100644 --- a/amarok/src/organizecollectiondialog.ui.h +++ b/amarok/src/organizecollectiondialog.ui.h @@ -4,18 +4,18 @@ #include "qstringx.h" -QString OrganizeCollectionDialog::buildDestination( const QString &format, const MetaBundle &mb ) const +TQString OrganizeCollectionDialog::buildDestination( const TQString &format, const MetaBundle &mb ) const { bool isCompilation = false; if( !mb.album().isEmpty() ) { const int albumId = CollectionDB::instance()->albumID( mb.album() ); - isCompilation = CollectionDB::instance()->albumIsCompilation( QString::number(albumId) ); + isCompilation = CollectionDB::instance()->albumIsCompilation( TQString::number(albumId) ); } - QMap args; - QString artist = mb.artist(); - QString albumartist = artist; + TQMap args; + TQString artist = mb.artist(); + TQString albumartist = artist; if( isCompilation ) albumartist = i18n( "Various Artists" ); args["theartist"] = cleanPath( artist ); @@ -38,26 +38,26 @@ QString OrganizeCollectionDialog::buildDestination( const QString &format, const args["folder"] = folderCombo->currentText(); args["initial"] = albumartist.mid( 0, 1 ).upper(); args["filetype"] = mb.url().path().section( ".", -1 ).lower(); - QString track; + TQString track; if ( mb.track() ) track.sprintf( "%02d", mb.track() ); args["track"] = track; Amarok::QStringx formatx( format ); - QString result = formatx.namedOptArgs( args ); + TQString result = formatx.namedOptArgs( args ); if( result.startsWith( folderCombo->currentText() ) ) { - QString tail = result.mid( folderCombo->currentText().length() ); + TQString tail = result.mid( folderCombo->currentText().length() ); if( !tail.startsWith( "/" ) ) tail.prepend( "/" ); - return folderCombo->currentText() + tail.replace( QRegExp( "/\\.*" ), "/" ); + return folderCombo->currentText() + tail.replace( TQRegExp( "/\\.*" ), "/" ); } - return result.replace( QRegExp( "/\\.*" ), "/" ); + return result.replace( TQRegExp( "/\\.*" ), "/" ); } -QString OrganizeCollectionDialog::buildFormatTip() const +TQString OrganizeCollectionDialog::buildFormatTip() const { - QMap args; + TQMap args; for( int i = 0; i < MetaBundle::NUM_COLUMNS; i++ ) { if( i == MetaBundle::Score || i == MetaBundle::PlayCount @@ -74,14 +74,14 @@ QString OrganizeCollectionDialog::buildFormatTip() const args["filetype"] = i18n( "File Extension of Source" ); args["track"] = i18n( "Track Number" ); - QString tooltip = i18n( "

    Custom Format String

    " ); + TQString tooltip = i18n( "

    Custom Format String

    " ); tooltip += i18n( "You can use the following tokens:" ); tooltip += "
      "; - for( QMap::iterator it = args.begin(); + for( TQMap::iterator it = args.begin(); it != args.end(); ++it ) { - tooltip += QString( "
    • %1 - %2" ).arg( it.data(), "%" + it.key() ); + tooltip += TQString( "
    • %1 - %2" ).arg( it.data(), "%" + it.key() ); } tooltip += "
    "; @@ -92,9 +92,9 @@ QString OrganizeCollectionDialog::buildFormatTip() const } -QString OrganizeCollectionDialog::buildFormatString() const +TQString OrganizeCollectionDialog::buildFormatString() const { - QString format = "%folder/"; + TQString format = "%folder/"; if( filetypeCheck->isChecked() ) format += "%filetype/"; if( initialCheck->isChecked() ) @@ -125,15 +125,15 @@ void OrganizeCollectionDialog::setPreviewBundle( const MetaBundle &bundle ) } -void OrganizeCollectionDialog::preview( const QString &format ) +void OrganizeCollectionDialog::preview( const TQString &format ) { emit updatePreview( buildDestination( format, previewBundle ) ); } -QString OrganizeCollectionDialog::cleanPath( const QString &component ) const +TQString OrganizeCollectionDialog::cleanPath( const TQString &component ) const { - QString result = component; + TQString result = component; if( asciiCheck->isChecked() ) { @@ -142,11 +142,11 @@ QString OrganizeCollectionDialog::cleanPath( const QString &component ) const } if( !regexpEdit->text().isEmpty() ) - result.replace( QRegExp( regexpEdit->text() ), replaceEdit->text() ); + result.replace( TQRegExp( regexpEdit->text() ), replaceEdit->text() ); result.simplifyWhiteSpace(); if( spaceCheck->isChecked() ) - result.replace( QRegExp( "\\s" ), "_" ); + result.replace( TQRegExp( "\\s" ), "_" ); if( vfatCheck->isChecked() ) result = Amarok::vfatPath( result ); @@ -160,7 +160,7 @@ void OrganizeCollectionDialog::update( int dummy ) { Q_UNUSED( dummy ); - QString oldFormat = formatEdit->text(); + TQString oldFormat = formatEdit->text(); if( !customschemeCheck->isChecked() ) formatEdit->setText( buildFormatString() ); @@ -169,7 +169,7 @@ void OrganizeCollectionDialog::update( int dummy ) } -void OrganizeCollectionDialog::update( const QString & dummy ) +void OrganizeCollectionDialog::update( const TQString & dummy ) { Q_UNUSED( dummy ); @@ -201,9 +201,9 @@ void OrganizeCollectionDialog::slotDetails() formatHelp->hide(); } - if( dynamic_cast(parent()) ) { - static_cast(parent())->adjustSize(); - static_cast(parent())->updateGeometry(); + if( dynamic_cast(parent()) ) { + static_cast(parent())->adjustSize(); + static_cast(parent())->updateGeometry(); } } @@ -212,6 +212,6 @@ void OrganizeCollectionDialog::init() { detailed = true; - formatHelp->setText( QString( "%2" ). + formatHelp->setText( TQString( "%2" ). arg( Amarok::escapeHTMLAttr( buildFormatTip() ), i18n( "(Help)" ) ) ); } diff --git a/amarok/src/osd.cpp b/amarok/src/osd.cpp index da50436f..ff9c0cb8 100644 --- a/amarok/src/osd.cpp +++ b/amarok/src/osd.cpp @@ -29,26 +29,26 @@ #include #include //locate -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace ShadowEngine { - QImage makeShadow( const QPixmap &textPixmap, const QColor &bgColor ); + TQImage makeShadow( const TQPixmap &textPixmap, const TQColor &bgColor ); } #define MOODBAR_HEIGHT 20 -OSDWidget::OSDWidget( QWidget *parent, const char *name ) - : QWidget( parent, name, WType_TopLevel | WNoAutoErase | WStyle_Customize | WX11BypassWM | WStyle_StaysOnTop ) +OSDWidget::OSDWidget( TQWidget *parent, const char *name ) + : TQWidget( parent, name, WType_TopLevel | WNoAutoErase | WStyle_Customize | WX11BypassWM | WStyle_StaysOnTop ) , m_duration( 2000 ) - , m_timer( new QTimer( this ) ) + , m_timer( new TQTimer( this ) ) , m_alignment( Middle ) , m_screen( 0 ) , m_y( MARGIN ) @@ -61,16 +61,16 @@ OSDWidget::OSDWidget( QWidget *parent, const char *name ) setBackgroundMode( NoBackground ); unsetColors(); - connect( m_timer, SIGNAL(timeout()), SLOT(hide()) ); - connect( CollectionDB::instance(), SIGNAL( ratingChanged( const QString&, int ) ), - this, SLOT( ratingChanged( const QString&, int ) ) ); + connect( m_timer, TQT_SIGNAL(timeout()), TQT_SLOT(hide()) ); + connect( CollectionDB::instance(), TQT_SIGNAL( ratingChanged( const TQString&, int ) ), + this, TQT_SLOT( ratingChanged( const TQString&, int ) ) ); - //or crashes, KWin bug I think, crashes in QWidget::icon() + //or crashes, KWin bug I think, crashes in TQWidget::icon() kapp->setTopWidget( this ); } void -OSDWidget::show( const QString &text, QImage newImage ) +OSDWidget::show( const TQString &text, TQImage newImage ) { #ifdef Q_WS_X11 m_text = text; @@ -101,7 +101,7 @@ OSDWidget::ratingChanged( const short rating ) } void -OSDWidget::ratingChanged( const QString& path, int rating ) +OSDWidget::ratingChanged( const TQString& path, int rating ) { const MetaBundle ¤tTrack = EngineController::instance()->bundle(); if( currentTrack.isFile() && currentTrack.url().path() == path ) @@ -130,21 +130,21 @@ OSDWidget::show() //virtual const uint M = fontMetrics().width( 'x' ); - const QRect oldGeometry = QRect( pos(), size() ); - const QRect newGeometry = determineMetrics( M ); + const TQRect oldGeometry = TQRect( pos(), size() ); + const TQRect newGeometry = determineMetrics( M ); if( m_translucency && !isShown() || !newGeometry.intersects( oldGeometry ) ) - m_screenshot = QPixmap::grabWindow( qt_xrootwin(), + m_screenshot = TQPixmap::grabWindow( qt_xrootwin(), newGeometry.x(), newGeometry.y(), newGeometry.width(), newGeometry.height() ); else if( m_translucency ) { - const QRect unite = oldGeometry.unite( newGeometry ); - KPixmap pix = QPixmap::grabWindow( qt_xrootwin(), unite.x(), unite.y(), unite.width(), unite.height() ); + const TQRect unite = oldGeometry.unite( newGeometry ); + KPixmap pix = TQPixmap::grabWindow( qt_xrootwin(), unite.x(), unite.y(), unite.width(), unite.height() ); - QPoint p = oldGeometry.topLeft() - unite.topLeft(); + TQPoint p = oldGeometry.topLeft() - unite.topLeft(); bitBlt( &pix, p, &m_screenshot ); m_screenshot.resize( newGeometry.size() ); @@ -157,7 +157,7 @@ OSDWidget::show() //virtual { render( M, newGeometry.size() ); setGeometry( newGeometry ); - QWidget::show(); + TQWidget::show(); bitBlt( this, 0, 0, &m_buffer ); if( m_duration ) //duration 0 -> stay forever @@ -172,30 +172,30 @@ QRect OSDWidget::determineMetrics( const uint M ) { // sometimes we only have a tiddly cover - const QSize minImageSize = m_cover.size().boundedTo( QSize(100,100) ); + const TQSize minImageSize = m_cover.size().boundedTo( TQSize(100,100) ); // determine a sensible maximum size, don't cover the whole desktop or cross the screen - const QSize margin( (M + MARGIN) * 2, (M + MARGIN) * 2 ); //margins - const QSize image = m_cover.isNull() ? QSize( 0, 0 ) : minImageSize; - const QSize max = QApplication::desktop()->screen( m_screen )->size() - margin; + const TQSize margin( (M + MARGIN) * 2, (M + MARGIN) * 2 ); //margins + const TQSize image = m_cover.isNull() ? TQSize( 0, 0 ) : minImageSize; + const TQSize max = TQApplication::desktop()->screen( m_screen )->size() - margin; // If we don't do that, the boundingRect() might not be suitable for drawText() (Qt issue N67674) - m_text.replace( QRegExp(" +\n"), "\n" ); + m_text.replace( TQRegExp(" +\n"), "\n" ); // remove consecutive line breaks - m_text.replace( QRegExp("\n+"), "\n" ); + m_text.replace( TQRegExp("\n+"), "\n" ); // The osd cannot be larger than the screen - QRect rect = fontMetrics().boundingRect( 0, 0, + TQRect rect = fontMetrics().boundingRect( 0, 0, max.width() - image.width(), max.height(), AlignCenter | WordBreak, m_text ); if( m_volume ) { - static const QString tmp = QString ("******").insert( 3, + static const TQString tmp = TQString ("******").insert( 3, ( i18n("Volume: 100%").length() >= i18n("Mute").length() )? i18n("Volume: 100%") : i18n("Mute") ); - QRect tmpRect = fontMetrics().boundingRect( 0, 0, + TQRect tmpRect = fontMetrics().boundingRect( 0, 0, max.width() - image.width(), max.height() - fontMetrics().height(), AlignCenter | WordBreak, tmp ); tmpRect.setHeight( tmpRect.height() + fontMetrics().height() / 2 ); @@ -205,7 +205,7 @@ OSDWidget::determineMetrics( const uint M ) if( m_rating ) { - QPixmap* star = StarManager::instance()->getStar( 1, true ); + TQPixmap* star = StarManager::instance()->getStar( 1, true ); if( rect.width() < star->width() * 5 ) rect.setWidth( star->width() * 5 ); //changes right edge position rect.setHeight( rect.height() + star->height() + M ); //changes bottom edge pos @@ -221,7 +221,7 @@ OSDWidget::determineMetrics( const uint M ) m_scaledCover = m_cover.smoothScale( QMIN( availableWidth, m_cover.width() ), QMIN( rect.height(), m_cover.height() ), - QImage::ScaleMin ); //this will force us to be with our bounds + TQImage::ScaleMin ); //this will force us to be with our bounds int shadowWidth = 0; if( m_drawShadow && !m_scaledCover.hasAlpha() && @@ -239,9 +239,9 @@ OSDWidget::determineMetrics( const uint M ) // expand in all directions by M rect.addCoords( -M, -M, M, M ); - const QSize newSize = rect.size(); - const QRect screen = QApplication::desktop()->screenGeometry( m_screen ); - QPoint newPos( MARGIN, m_y ); + const TQSize newSize = rect.size(); + const TQRect screen = TQApplication::desktop()->screenGeometry( m_screen ); + TQPoint newPos( MARGIN, m_y ); switch( m_alignment ) { @@ -269,34 +269,34 @@ OSDWidget::determineMetrics( const uint M ) // correct for screen position newPos += screen.topLeft(); - return QRect( newPos, rect.size() ); + return TQRect( newPos, rect.size() ); } void -OSDWidget::render( const uint M, const QSize &size ) +OSDWidget::render( const uint M, const TQSize &size ) { /// render with margin/spacing @param M and @param size - QPoint point; - QRect rect( point, size ); + TQPoint point; + TQRect rect( point, size ); // From qt sources const uint xround = (M * 200) / size.width(); const uint yround = (M * 200) / size.height(); { /// apply the mask - static QBitmap mask; + static TQBitmap mask; mask.resize( size ); mask.fill( Qt::black ); - QPainter p( &mask ); + TQPainter p( &mask ); p.setBrush( Qt::white ); p.drawRoundRect( rect, xround, yround ); setMask( mask ); } - QColor shadowColor; + TQColor shadowColor; { int h,s,v; foregroundColor().getHsv( &h, &s, &v ); @@ -306,7 +306,7 @@ OSDWidget::render( const uint M, const QSize &size ) int align = Qt::AlignCenter | WordBreak; m_buffer.resize( rect.size() ); - QPainter p( &m_buffer ); + TQPainter p( &m_buffer ); if( m_translucency ) { @@ -324,20 +324,20 @@ OSDWidget::render( const uint M, const QSize &size ) if( !m_cover.isNull() ) { - QRect r( rect ); + TQRect r( rect ); r.setTop( (size.height() - m_scaledCover.height()) / 2 ); r.setSize( m_scaledCover.size() ); if( !m_scaledCover.hasAlpha() && m_drawShadow && ( m_scaledCover.width() > 22 || m_scaledCover.height() > 22 ) ) { // don't draw a shadow for eg, the Amarok icon - QImage shadow; + TQImage shadow; const uint shadowSize = static_cast( m_scaledCover.width() / 100.0 * 6.0 ); - const QString folder = Amarok::saveLocation( "covershadow-cache/" ); - const QString file = QString( "shadow_albumcover%1x%2.png" ).arg( m_scaledCover.width() + shadowSize ) + const TQString folder = Amarok::saveLocation( "covershadow-cache/" ); + const TQString file = TQString( "shadow_albumcover%1x%2.png" ).arg( m_scaledCover.width() + shadowSize ) .arg( m_scaledCover.height() + shadowSize ); - if ( QFile::exists( folder + file ) ) + if ( TQFile::exists( folder + file ) ) shadow.load( folder + file ); else { shadow.load( locate( "data", "amarok/images/shadow_albumcover.png" ) ); @@ -345,7 +345,7 @@ OSDWidget::render( const uint M, const QSize &size ) shadow.save( folder + file, "PNG" ); } - QPixmap target; + TQPixmap target; target.convertFromImage( shadow ); //FIXME slow copyBlt( &target, 0, 0, &m_scaledCover ); m_scaledCover = target; @@ -360,27 +360,27 @@ OSDWidget::render( const uint M, const QSize &size ) if( m_volume ) { - QPixmap vol; - vol = QPixmap( rect.width(), rect.height() + fontMetrics().height() / 4 ); + TQPixmap vol; + vol = TQPixmap( rect.width(), rect.height() + fontMetrics().height() / 4 ); - QPixmap buf( vol.size() ); - QRect r( rect ); + TQPixmap buf( vol.size() ); + TQRect r( rect ); r.setLeft( rect.left() + rect.width() / 2 - vol.width() / 2 ); r.setTop( size.height() / 2 - vol.height() / 2); KPixmap pixmapGradient; { // gradient - QBitmap mask; + TQBitmap mask; mask.resize( vol.size() ); mask.fill( Qt::black ); - QPainter p( &mask ); + TQPainter p( &mask ); p.setBrush( Qt::white ); p.drawRoundRect ( 3, 3, vol.width() - 6, vol.height() - 6, M * 300 / vol.width(), 99 ); p.end(); - pixmapGradient = QPixmap( vol.size() ); + pixmapGradient = TQPixmap( vol.size() ); KPixmapEffect::gradient( pixmapGradient, colorGroup().background(), colorGroup().highlight(), KPixmapEffect::EllipticGradient ); pixmapGradient.setMask( mask ); @@ -396,11 +396,11 @@ OSDWidget::render( const uint M, const QSize &size ) vol.fill( backgroundColor() ); { // vol ( bg-alpha ) - static QBitmap mask; + static TQBitmap mask; mask.resize( vol.size() ); mask.fill( Qt::white ); - QPainter p( &mask ); + TQPainter p( &mask ); p.setBrush( Qt::black ); p.drawRoundRect ( 1, 1, rect.width()-2, rect.height() + fontMetrics().height() / 4 - 2, M * 300 / vol.width(), 99 ); @@ -421,14 +421,14 @@ OSDWidget::render( const uint M, const QSize &size ) m_volume = false; } - QPixmap* star = StarManager::instance()->getStar( m_rating/2, true ); + TQPixmap* star = StarManager::instance()->getStar( m_rating/2, true ); int graphicsHeight = 0; if( useMoodbar() ) { - QPixmap moodbar + TQPixmap moodbar = m_moodbarBundle.moodbar().draw( rect.width(), MOODBAR_HEIGHT ); - QRect r( rect ); + TQRect r( rect ); r.setTop( rect.bottom() - moodbar.height() - (m_rating ? star->height() + M : 0) ); graphicsHeight += moodbar.height() + M; @@ -439,7 +439,7 @@ OSDWidget::render( const uint M, const QSize &size ) if( m_rating > 0 ) { - QRect r( rect ); + TQRect r( rect ); //Align to center... r.setLeft(( rect.left() + rect.width() / 2 ) - star->width() * m_rating / 4 ); @@ -450,7 +450,7 @@ OSDWidget::render( const uint M, const QSize &size ) if( half ) { - QPixmap* halfStar = StarManager::instance()->getHalfStar( m_rating/2 + 1, true ); + TQPixmap* halfStar = StarManager::instance()->getHalfStar( m_rating/2 + 1, true ); p.drawPixmap( r.left() + star->width() * ( m_rating / 2 ), r.top(), *halfStar ); star = StarManager::instance()->getStar( m_rating/2 + 1, true ); } @@ -467,18 +467,18 @@ OSDWidget::render( const uint M, const QSize &size ) if( m_drawShadow ) { - QPixmap pixmap( rect.size() + QSize(10,10) ); + TQPixmap pixmap( rect.size() + TQSize(10,10) ); pixmap.fill( Qt::black ); pixmap.setMask( pixmap.createHeuristicMask( true ) ); - QPainter p2( &pixmap ); + TQPainter p2( &pixmap ); p2.setFont( font() ); p2.setPen( Qt::white ); p2.setBrush( Qt::white ); - p2.drawText( QRect(QPoint(5,5), rect.size()), align , m_text ); + p2.drawText( TQRect(TQPoint(5,5), rect.size()), align , m_text ); p2.end(); - p.drawImage( rect.topLeft() - QPoint(5,5), ShadowEngine::makeShadow( pixmap, shadowColor ) ); + p.drawImage( rect.topLeft() - TQPoint(5,5), ShadowEngine::makeShadow( pixmap, shadowColor ) ); } p.setPen( foregroundColor() ); @@ -488,24 +488,24 @@ OSDWidget::render( const uint M, const QSize &size ) } bool -OSDWidget::event( QEvent *e ) +OSDWidget::event( TQEvent *e ) { switch( e->type() ) { - case QEvent::ApplicationPaletteChange: + case TQEvent::ApplicationPaletteChange: if( !AmarokConfig::osdUseCustomColors() ) unsetColors(); //use new palette's colours return true; - case QEvent::Paint: + case TQEvent::Paint: bitBlt( this, 0, 0, &m_buffer ); return true; default: - return QWidget::event( e ); + return TQWidget::event( e ); } } void -OSDWidget::mousePressEvent( QMouseEvent* ) +OSDWidget::mousePressEvent( TQMouseEvent* ) { hide(); } @@ -513,7 +513,7 @@ OSDWidget::mousePressEvent( QMouseEvent* ) void OSDWidget::unsetColors() { - const QColorGroup c = QApplication::palette().active(); + const TQColorGroup c = TQApplication::palette().active(); setPaletteForegroundColor( c.highlightedText() ); setPaletteBackgroundColor( c.highlight() ); @@ -522,7 +522,7 @@ OSDWidget::unsetColors() void OSDWidget::setScreen( int screen ) { - const int n = QApplication::desktop()->numScreens(); + const int n = TQApplication::desktop()->numScreens(); m_screen = (screen >= n) ? n-1 : screen; } @@ -541,10 +541,10 @@ OSDWidget::useMoodbar( void ) namespace Amarok { - QImage icon() { return QImage( KIconLoader().iconPath( "amarok", -KIcon::SizeHuge ) ); } + TQImage icon() { return TQImage( KIconLoader().iconPath( "amarok", -KIcon::SizeHuge ) ); } } -OSDPreviewWidget::OSDPreviewWidget( QWidget *parent ) +OSDPreviewWidget::OSDPreviewWidget( TQWidget *parent ) : OSDWidget( parent, "osdpreview" ) , m_dragging( false ) { @@ -553,7 +553,7 @@ OSDPreviewWidget::OSDPreviewWidget( QWidget *parent ) m_cover = Amarok::icon(); } -void OSDPreviewWidget::mousePressEvent( QMouseEvent *event ) +void OSDPreviewWidget::mousePressEvent( TQMouseEvent *event ) { m_dragOffset = event->pos(); @@ -564,7 +564,7 @@ void OSDPreviewWidget::mousePressEvent( QMouseEvent *event ) } -void OSDPreviewWidget::mouseReleaseEvent( QMouseEvent * /*event*/ ) +void OSDPreviewWidget::mouseReleaseEvent( TQMouseEvent * /*event*/ ) { if( m_dragging ) { @@ -572,13 +572,13 @@ void OSDPreviewWidget::mouseReleaseEvent( QMouseEvent * /*event*/ ) releaseMouse(); // compute current Position && offset - QDesktopWidget *desktop = QApplication::desktop(); + TQDesktopWidget *desktop = TQApplication::desktop(); int currentScreen = desktop->screenNumber( pos() ); if( currentScreen != -1 ) { // set new data m_screen = currentScreen; - m_y = QWidget::y(); + m_y = TQWidget::y(); emit positionChanged(); } @@ -586,18 +586,18 @@ void OSDPreviewWidget::mouseReleaseEvent( QMouseEvent * /*event*/ ) } -void OSDPreviewWidget::mouseMoveEvent( QMouseEvent *e ) +void OSDPreviewWidget::mouseMoveEvent( TQMouseEvent *e ) { if( m_dragging && this == mouseGrabber() ) { // Here we implement a "snap-to-grid" like positioning system for the preview widget - const QRect screen = QApplication::desktop()->screenGeometry( m_screen ); + const TQRect screen = TQApplication::desktop()->screenGeometry( m_screen ); const uint hcenter = screen.width() / 2; const uint eGlobalPosX = e->globalPos().x() - screen.left(); const uint snapZone = screen.width() / 24; - QPoint destination = e->globalPos() - m_dragOffset - screen.topLeft(); + TQPoint destination = e->globalPos() - m_dragOffset - screen.topLeft(); int maxY = screen.height() - height() - MARGIN; if( destination.y() < MARGIN ) destination.ry() = MARGIN; if( destination.y() > maxY ) destination.ry() = maxY; @@ -636,40 +636,40 @@ void OSDPreviewWidget::mouseMoveEvent( QMouseEvent *e ) #include "enginecontroller.h" #include "metabundle.h" -#include +#include Amarok::OSD::OSD(): OSDWidget( 0 ) { - connect( CollectionDB::instance(), SIGNAL( coverChanged( const QString&, const QString& ) ), - this, SLOT( slotCoverChanged( const QString&, const QString& ) ) ); - connect( CollectionDB::instance(), SIGNAL( imageFetched( const QString& ) ), - this, SLOT( slotImageChanged( const QString& ) ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( coverChanged( const TQString&, const TQString& ) ), + this, TQT_SLOT( slotCoverChanged( const TQString&, const TQString& ) ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( imageFetched( const TQString& ) ), + this, TQT_SLOT( slotImageChanged( const TQString& ) ) ); } void Amarok::OSD::show( const MetaBundle &bundle ) //slot { #ifdef Q_WS_X11 - QString text = ""; + TQString text = ""; if( bundle.url().isEmpty() ) text = i18n( "No track playing" ); else { - QValueVector tags; + TQValueVector tags; tags.append(bundle.prettyTitle()); for( int i = 0; i < PlaylistItem::NUM_COLUMNS; ++i ) tags.append(bundle.prettyText( i )); if( bundle.length() <= 0 ) - tags[PlaylistItem::Length+1] = QString::null; + tags[PlaylistItem::Length+1] = TQString::null; if( AmarokConfig::osdUsePlaylistColumns() ) { - QString tag; - QValueVector availableTags; //eg, ones that aren't empty - static const QValueList parens = //display these in parentheses - QValueList() << PlaylistItem::PlayCount << PlaylistItem::Year << PlaylistItem::Comment + TQString tag; + TQValueVector availableTags; //eg, ones that aren't empty + static const TQValueList parens = //display these in parentheses + TQValueList() << PlaylistItem::PlayCount << PlaylistItem::Year << PlaylistItem::Comment << PlaylistItem::Genre << PlaylistItem::Length << PlaylistItem::Bitrate << PlaylistItem::LastPlayed << PlaylistItem::Score << PlaylistItem::Filesize; OSDWidget::setMoodbar(); @@ -688,7 +688,7 @@ Amarok::OSD::show( const MetaBundle &bundle ) //slot for( int n = availableTags.count(), i = 0; i < n; ++i ) { const int column = availableTags.at( i ); - QString append = ( i == 0 ) ? "" + TQString append = ( i == 0 ) ? "" : ( n > 1 && i == n / 2 ) ? "\n" : ( parens.contains( column ) || parens.contains( availableTags.at( i - 1 ) ) ) ? " " : i18n(" - "); @@ -698,13 +698,13 @@ Amarok::OSD::show( const MetaBundle &bundle ) //slot } else { - QMap args; + TQMap args; args["prettytitle"] = bundle.prettyTitle(); for( int i = 0; i < PlaylistItem::NUM_COLUMNS; ++i ) args[bundle.exactColumnName( i ).lower()] = bundle.prettyText( i ); if( bundle.length() <= 0 ) - args["length"] = QString::null; + args["length"] = TQString::null; uint time=EngineController::instance()->engine()->position(); @@ -713,17 +713,17 @@ Amarok::OSD::show( const MetaBundle &bundle ) //slot uint min=(time/60)%60; time /= 60; uint hour=(time/60)%60; - QString timeformat=""; + TQString timeformat=""; if(hour!=0) { - timeformat += QString::number(hour); + timeformat += TQString::number(hour); timeformat +=":"; } - timeformat +=QString::number(min); + timeformat +=TQString::number(min); timeformat +=":"; if(sec<10) timeformat +="0"; - timeformat +=QString::number(sec); + timeformat +=TQString::number(sec); args["elapsed"]=timeformat; QStringx osd = AmarokConfig::osdText(); @@ -749,7 +749,7 @@ Amarok::OSD::show( const MetaBundle &bundle ) //slot //avoid showing the generic cover. we can overwrite this by passing an arg. //get large cover for scaling if big cover needed - QString location = QString::null; + TQString location = TQString::null; if( bundle.podcastBundle() ) location = CollectionDB::instance()->podcastImage( bundle, false, 0 ); else @@ -819,12 +819,12 @@ Amarok::OSD::forceToggleOSD() } void -Amarok::OSD::slotCoverChanged( const QString &artist, const QString &album ) +Amarok::OSD::slotCoverChanged( const TQString &artist, const TQString &album ) { if( AmarokConfig::osdCover() && artist == EngineController::instance()->bundle().artist() && album == EngineController::instance()->bundle().album() ) { - QString location = CollectionDB::instance()->albumImage( artist, album, false, 0 ); + TQString location = CollectionDB::instance()->albumImage( artist, album, false, 0 ); if( location.find( "nocover" ) != -1 ) setImage( Amarok::icon() ); @@ -834,9 +834,9 @@ Amarok::OSD::slotCoverChanged( const QString &artist, const QString &album ) } void -Amarok::OSD::slotImageChanged( const QString &remoteURL ) +Amarok::OSD::slotImageChanged( const TQString &remoteURL ) { - QString url = EngineController::instance()->bundle().url().url(); + TQString url = EngineController::instance()->bundle().url().url(); PodcastEpisodeBundle peb; if( CollectionDB::instance()->getPodcastEpisodeBundle( url, &peb ) ) { @@ -845,7 +845,7 @@ Amarok::OSD::slotImageChanged( const QString &remoteURL ) { if( pcb.imageURL().url() == remoteURL ) { - QString location = CollectionDB::instance()->podcastImage( remoteURL, false, 0 ); + TQString location = CollectionDB::instance()->podcastImage( remoteURL, false, 0 ); if( location == CollectionDB::instance()->notAvailCover( false, 0 ) ) setImage( Amarok::icon() ); else @@ -891,11 +891,11 @@ namespace ShadowEngine // Self explanatory static const int MAX_OPACITY = 200; - double decay( QImage&, int, int ); + double decay( TQImage&, int, int ); - QImage makeShadow( const QPixmap& textPixmap, const QColor &bgColor ) + TQImage makeShadow( const TQPixmap& textPixmap, const TQColor &bgColor ) { - QImage result; + TQImage result; const int w = textPixmap.width(); const int h = textPixmap.height(); @@ -906,7 +906,7 @@ namespace ShadowEngine int alphaShadow; // This is the source pixmap - QImage img = textPixmap.convertToImage().convertDepth( 32 ); + TQImage img = textPixmap.convertToImage().convertDepth( 32 ); result.create( w, h, 32 ); result.fill( 0 ); // fill with black @@ -925,7 +925,7 @@ namespace ShadowEngine return result; } - double decay( QImage& source, int i, int j ) + double decay( TQImage& source, int i, int j ) { //if ((i < 1) || (j < 1) || (i > source.width() - 2) || (j > source.height() - 2)) // return 0; diff --git a/amarok/src/osd.h b/amarok/src/osd.h index 5ad577e7..72e80d9a 100644 --- a/amarok/src/osd.h +++ b/amarok/src/osd.h @@ -6,7 +6,7 @@ */ /* - osd.h - Provides an interface to a plain QWidget, which is independent of KDE (bypassed to X11) + osd.h - Provides an interface to a plain TQWidget, which is independent of KDE (bypassed to X11) begin: Fre Sep 26 2003 copyright: (C) 2003 by Christian Muehlhaeuser email: chris@chris.de @@ -18,9 +18,9 @@ #include "metabundle.h" #include -#include -#include -#include //baseclass +#include +#include +#include //baseclass class OSDWidget : public QWidget @@ -30,16 +30,16 @@ class OSDWidget : public QWidget public: enum Alignment { Left, Middle, Center, Right }; - OSDWidget( QWidget *parent, const char *name = "osd" ); + OSDWidget( TQWidget *parent, const char *name = "osd" ); /** resets the colours to defaults */ void unsetColors(); public slots: /** calls setText() then show(), after setting image if needed */ - void show( const QString &text, QImage newImage = QImage::QImage() ); + void show( const TQString &text, TQImage newImage = TQImage::TQImage() ); void ratingChanged( const short rating ); - void ratingChanged( const QString& path, int rating ); + void ratingChanged( const TQString& path, int rating ); void volChanged( unsigned char volume ); /** reimplemented, shows the OSD */ @@ -53,13 +53,13 @@ class OSDWidget : public QWidget * To force an update call show(); */ void setDuration( int ms ) { m_duration = ms; } - void setTextColor( const QColor &color ) { setPaletteForegroundColor( color ); } - void setBackgroundColor(const QColor &color ) { setPaletteBackgroundColor( color ); } + void setTextColor( const TQColor &color ) { setPaletteForegroundColor( color ); } + void setBackgroundColor(const TQColor &color ) { setPaletteBackgroundColor( color ); } void setOffset( int y ) { m_y = y; } void setAlignment( Alignment alignment ) { m_alignment = alignment; } - void setImage( const QImage &image ) { m_cover = image; } + void setImage( const TQImage &image ) { m_cover = image; } void setScreen( int screen ); - void setText( const QString &text ) { m_text = text; } + void setText( const TQString &text ) { m_text = text; } void setDrawShadow( const bool b ) { m_drawShadow = b; } void setTranslucency( const bool b ) { m_translucency = b; } void setRating( const short rating ) { if ( isEnabled() ) m_rating = rating; } @@ -69,14 +69,14 @@ class OSDWidget : public QWidget protected: /** determine new size and position */ - QRect determineMetrics( const uint marginMetric ); + TQRect determineMetrics( const uint marginMetric ); /** render OSD */ - void render( const uint marginMetric, const QSize &size ); + void render( const uint marginMetric, const TQSize &size ); /** reimplemented */ - virtual void mousePressEvent( QMouseEvent* ); - virtual bool event( QEvent* ); + virtual void mousePressEvent( TQMouseEvent* ); + virtual bool event( TQEvent* ); bool useMoodbar( void ); @@ -84,7 +84,7 @@ class OSDWidget : public QWidget static const int MARGIN = 15; int m_duration; - QTimer *m_timer; + TQTimer *m_timer; Alignment m_alignment; int m_screen; uint m_y; @@ -93,13 +93,13 @@ class OSDWidget : public QWidget short m_rating; unsigned char m_newvolume; bool m_volume; - QString m_text; - QImage m_cover; + TQString m_text; + TQImage m_cover; // need a whole MetaBundle to draw the moodbar on the fly MetaBundle m_moodbarBundle; - QPixmap m_scaledCover; + TQPixmap m_scaledCover; KPixmap m_screenshot; - QPixmap m_buffer; + TQPixmap m_buffer; }; @@ -109,19 +109,19 @@ class OSDPreviewWidget : public OSDWidget Q_OBJECT public: - OSDPreviewWidget( QWidget *parent ); + OSDPreviewWidget( TQWidget *parent ); int screen() { return m_screen; } int alignment() { return m_alignment; } int y() { return m_y; } public slots: - void setTextColor( const QColor &color ) { OSDWidget::setTextColor( color ); doUpdate(); } - void setBackgroundColor(const QColor &color ) { OSDWidget::setBackgroundColor( color ); doUpdate(); } + void setTextColor( const TQColor &color ) { OSDWidget::setTextColor( color ); doUpdate(); } + void setBackgroundColor(const TQColor &color ) { OSDWidget::setBackgroundColor( color ); doUpdate(); } void setDrawShadow( bool b ) { OSDWidget::setDrawShadow( b ); doUpdate(); } - void setFont( const QFont &font ) { OSDWidget::setFont( font ); doUpdate(); } + void setFont( const TQFont &font ) { OSDWidget::setFont( font ); doUpdate(); } void setScreen( int screen ) { OSDWidget::setScreen( screen ); doUpdate(); } - void setUseCustomColors( const bool use, const QColor &fg, const QColor &bg ) + void setUseCustomColors( const bool use, const TQColor &fg, const TQColor &bg ) { if( use ) { OSDWidget::setTextColor( fg ); @@ -138,13 +138,13 @@ signals: void positionChanged(); protected: - void mousePressEvent( QMouseEvent * ); - void mouseReleaseEvent( QMouseEvent * ); - void mouseMoveEvent( QMouseEvent * ); + void mousePressEvent( TQMouseEvent * ); + void mouseReleaseEvent( TQMouseEvent * ); + void mouseMoveEvent( TQMouseEvent * ); private: bool m_dragging; - QPoint m_dragOffset; + TQPoint m_dragOffset; }; @@ -176,8 +176,8 @@ namespace Amarok OSD(); private slots: - void slotCoverChanged( const QString &artist, const QString &album ); - void slotImageChanged( const QString &remoteURL ); + void slotCoverChanged( const TQString &artist, const TQString &album ); + void slotImageChanged( const TQString &remoteURL ); }; } diff --git a/amarok/src/pixmapviewer.cpp b/amarok/src/pixmapviewer.cpp index 764aedd3..85c56dc8 100644 --- a/amarok/src/pixmapviewer.cpp +++ b/amarok/src/pixmapviewer.cpp @@ -19,46 +19,46 @@ ***************************************************************************/ #include "pixmapviewer.h" #include -#include -#include +#include +#include -PixmapViewer::PixmapViewer(QWidget *widget, const QPixmap &pixmap) - : QScrollView(widget, 0, WNoAutoErase) +PixmapViewer::PixmapViewer(TQWidget *widget, const TQPixmap &pixmap) + : TQScrollView(widget, 0, WNoAutoErase) , m_isDragging(false) , m_pixmap(pixmap) { resizeContents( m_pixmap.width(), m_pixmap.height() ); } -void PixmapViewer::drawContents( QPainter * p, int clipx, int clipy, int clipw, int cliph ) { - p->drawPixmap(QPoint(clipx, clipy), +void PixmapViewer::drawContents( TQPainter * p, int clipx, int clipy, int clipw, int cliph ) { + p->drawPixmap(TQPoint(clipx, clipy), m_pixmap, - QRect(clipx, clipy, clipw, cliph)); + TQRect(clipx, clipy, clipw, cliph)); } -void PixmapViewer::contentsMousePressEvent(QMouseEvent *event) { +void PixmapViewer::contentsMousePressEvent(TQMouseEvent *event) { if(LeftButton == event->button()) { m_currentPos = event->globalPos(); m_isDragging = true; } } -void PixmapViewer::contentsMouseReleaseEvent(QMouseEvent *event) { +void PixmapViewer::contentsMouseReleaseEvent(TQMouseEvent *event) { if(LeftButton == event->button()) { m_currentPos = event->globalPos(); m_isDragging = false; } } -void PixmapViewer::contentsMouseMoveEvent(QMouseEvent *event) { +void PixmapViewer::contentsMouseMoveEvent(TQMouseEvent *event) { if(m_isDragging) { - QPoint delta = m_currentPos - event->globalPos(); + TQPoint delta = m_currentPos - event->globalPos(); scrollBy(delta.x(), delta.y()); m_currentPos = event->globalPos(); } } -QSize PixmapViewer::maximalSize() { +TQSize PixmapViewer::maximalSize() { return m_pixmap.size().boundedTo( KApplication::desktop()->size() ) + size() - viewport()->size(); } diff --git a/amarok/src/pixmapviewer.h b/amarok/src/pixmapviewer.h index 28a63d1e..5a93d551 100644 --- a/amarok/src/pixmapviewer.h +++ b/amarok/src/pixmapviewer.h @@ -19,27 +19,27 @@ #ifndef PIXMAPVIEWER_H #define PIXMAPVIEWER_H -#include +#include -class PixmapViewer : public QScrollView { +class PixmapViewer : public TQScrollView { Q_OBJECT public: - PixmapViewer(QWidget *widget, const QPixmap &pixmap); + PixmapViewer(TQWidget *widget, const TQPixmap &pixmap); // The size of this widget that requires no scrollbars - QSize maximalSize(); + TQSize maximalSize(); - void drawContents( QPainter * p, int clipx, int clipy, int clipw, int cliph ); + void drawContents( TQPainter * p, int clipx, int clipy, int clipw, int cliph ); - void contentsMousePressEvent(QMouseEvent *event); - void contentsMouseReleaseEvent(QMouseEvent *event); - void contentsMouseMoveEvent(QMouseEvent *event); + void contentsMousePressEvent(TQMouseEvent *event); + void contentsMouseReleaseEvent(TQMouseEvent *event); + void contentsMouseMoveEvent(TQMouseEvent *event); private: bool m_isDragging; - QPoint m_currentPos; - const QPixmap &m_pixmap; + TQPoint m_currentPos; + const TQPixmap &m_pixmap; }; #endif diff --git a/amarok/src/playerwindow.cpp b/amarok/src/playerwindow.cpp index a4a2339a..f61e07a6 100644 --- a/amarok/src/playerwindow.cpp +++ b/amarok/src/playerwindow.cpp @@ -26,16 +26,16 @@ email : markey@web.de #include "sliderwidget.h" #include "tracktooltip.h" //setScroll() -#include //our quit shortcut in the ctor -#include //various events -#include -#include -#include -#include -#include -#include -#include -#include //analyzer tooltip +#include //our quit shortcut in the ctor +#include //various events +#include +#include +#include +#include +#include +#include +#include +#include //analyzer tooltip #include #include @@ -50,18 +50,18 @@ namespace Amarok { //TODO remove these, they suck, do a generic getImage - QPixmap getPNG( const QString &filename ) + TQPixmap getPNG( const TQString &filename ) { - QString file = !filename.endsWith( ".png", false ) ? "amarok/images/%1.png" : "amarok/images/%1"; + TQString file = !filename.endsWith( ".png", false ) ? "amarok/images/%1.png" : "amarok/images/%1"; - return QPixmap( locate( "data", file.arg( filename ) ), "PNG" ); + return TQPixmap( locate( "data", file.arg( filename ) ), "PNG" ); } - QPixmap getJPG( const QString &filename ) + TQPixmap getJPG( const TQString &filename ) { - QString file = !filename.endsWith( ".jpg", false ) ? "amarok/images/%1.jpg" : "amarok/images/%1"; + TQString file = !filename.endsWith( ".jpg", false ) ? "amarok/images/%1.jpg" : "amarok/images/%1"; - return QPixmap( locate( "data", QString( "amarok/images/%1.jpg" ).arg( filename ) ), "JPEG" ); + return TQPixmap( locate( "data", TQString( "amarok/images/%1.jpg" ).arg( filename ) ), "JPEG" ); } } @@ -71,7 +71,7 @@ using Amarok::getPNG; //fairly pointless template which was designed to make the ctor clearer, //but probably achieves the opposite. Still, the code is neater.. template static inline W* -createWidget( const QRect &r, QWidget *parent, const char *name = 0, Qt::WFlags f = 0 ) +createWidget( const TQRect &r, TQWidget *parent, const char *name = 0, Qt::WFlags f = 0 ) { W *w = new W( parent, name, f ); w->setGeometry( r ); @@ -79,11 +79,11 @@ createWidget( const QRect &r, QWidget *parent, const char *name = 0, Qt::WFlags } -PlayerWidget::PlayerWidget( QWidget *parent, const char *name, bool enablePlaylist ) - : QWidget( parent, name, Qt::WType_TopLevel ) +PlayerWidget::PlayerWidget( TQWidget *parent, const char *name, bool enablePlaylist ) + : TQWidget( parent, name, Qt::WType_TopLevel ) , EngineObserver( EngineController::instance() ) , m_minimalView( false ) - , m_pAnimTimer( new QTimer( this ) ) + , m_pAnimTimer( new TQTimer( this ) ) , m_scrollBuffer( 291, 16 ) , m_plusPixmap( getPNG( "time_plus" ) ) , m_minusPixmap( getPNG( "time_minus" ) ) @@ -98,7 +98,7 @@ PlayerWidget::PlayerWidget( QWidget *parent, const char *name, bool enablePlayli parent->installEventFilter( this ); //for hidePLaylistWithMainWindow mode //if this is the first time we have ever been run we let KWin place us - if ( AmarokConfig::playerPos() != QPoint(-1,-1) ) + if ( AmarokConfig::playerPos() != TQPoint(-1,-1) ) move( AmarokConfig::playerPos() ); setModifiedPalette(); @@ -107,18 +107,18 @@ PlayerWidget::PlayerWidget( QWidget *parent, const char *name, bool enablePlayli setAcceptDrops( true ); //another quit shortcut because the other window has all the accels - QAccel *accel = new QAccel( this ); + TQAccel *accel = new TQAccel( this ); accel->insertItem( CTRL + Key_Q ); - connect( accel, SIGNAL( activated( int ) ), kapp, SLOT( quit() ) ); + connect( accel, TQT_SIGNAL( activated( int ) ), kapp, TQT_SLOT( quit() ) ); - QFont font; + TQFont font; font.setBold( true ); font.setPixelSize( 10 ); setFont( font ); { // //NOTE we use a layout for the buttons so resizing will be possible - m_pFrameButtons = createWidget( QRect(0, 118, 311, 22), this ); + m_pFrameButtons = createWidget( TQRect(0, 118, 311, 22), this ); KActionCollection *ac =Amarok::actionCollection(); @@ -130,9 +130,9 @@ PlayerWidget::PlayerWidget( QWidget *parent, const char *name, bool enablePlayli new NavButton( m_pFrameButtons, "next", ac->action( "next" ) ); KPushButton *switchView = new KPushButton( KGuiItem( "", "mini_dock" ), m_pFrameButtons ); - switchView->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred ); // too big! - switchView->setFocusPolicy( QWidget::NoFocus ); - connect( switchView, SIGNAL( clicked() ), SLOT( toggleView() ) ); + switchView->setSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Preferred ); // too big! + switchView->setFocusPolicy( TQWidget::NoFocus ); + connect( switchView, TQT_SIGNAL( clicked() ), TQT_SLOT( toggleView() ) ); m_pButtonPlay->setToggleButton( true ); @@ -151,24 +151,24 @@ PlayerWidget::PlayerWidget( QWidget *parent, const char *name, bool enablePlayli m_pVolSlider->setValue( AmarokConfig::masterVolume() ); EngineController* const ec = EngineController::instance(); - connect( m_pSlider, SIGNAL(sliderReleased( int )), ec, SLOT(seek( int )) ); - connect( m_pSlider, SIGNAL(valueChanged( int )), SLOT(timeDisplay( int )) ); - connect( m_pVolSlider, SIGNAL(sliderMoved( int )), ec, SLOT(setVolume( int )) ); - connect( m_pVolSlider, SIGNAL(sliderReleased( int )), ec, SLOT(setVolume( int )) ); + connect( m_pSlider, TQT_SIGNAL(sliderReleased( int )), ec, TQT_SLOT(seek( int )) ); + connect( m_pSlider, TQT_SIGNAL(valueChanged( int )), TQT_SLOT(timeDisplay( int )) ); + connect( m_pVolSlider, TQT_SIGNAL(sliderMoved( int )), ec, TQT_SLOT(setVolume( int )) ); + connect( m_pVolSlider, TQT_SIGNAL(sliderReleased( int )), ec, TQT_SLOT(setVolume( int )) ); } // { // font.setPixelSize( 11 ); - const int fontHeight = QFontMetrics( font ).height(); //the real height is more like 13px + const int fontHeight = TQFontMetrics( font ).height(); //the real height is more like 13px - m_pScrollFrame = createWidget( QRect(6,18, 285,fontHeight), this ); + m_pScrollFrame = createWidget( TQRect(6,18, 285,fontHeight), this ); m_pScrollFrame->setFont( font ); { // } // font.setPixelSize( 18 ); - m_pTimeLabel = createWidget( QRect(16,36, 9*12+2,18), this, 0, Qt::WNoAutoErase ); + m_pTimeLabel = createWidget( TQRect(16,36, 9*12+2,18), this, 0, Qt::WNoAutoErase ); m_pTimeLabel->setFont( font ); m_timeBuffer.resize( m_pTimeLabel->size() ); @@ -176,18 +176,18 @@ PlayerWidget::PlayerWidget( QWidget *parent, const char *name, bool enablePlayli } // - m_pButtonEq = new IconButton( this, "eq", this, SLOT(slotShowEqualizer( bool )) ); + m_pButtonEq = new IconButton( this, "eq", this, TQT_SLOT(slotShowEqualizer( bool )) ); m_pButtonEq->setGeometry( 34,85, 28,13 ); //TODO set isOn() - m_pPlaylistButton = new IconButton( this, "pl", SIGNAL(playlistToggled( bool )) ); + m_pPlaylistButton = new IconButton( this, "pl", TQT_SIGNAL(playlistToggled( bool )) ); m_pPlaylistButton->setGeometry( 5,85, 28,13 ); m_pPlaylistButton->setOn( parent->isShown() || enablePlaylist ); - m_pDescription = createWidget( QRect(4,6, 250,10), this ); - m_pTimeSign = createWidget( QRect(6,40, 10,10), this, 0, Qt::WRepaintNoErase ); - m_pVolSign = createWidget( QRect(295,7, 9,8), this ); + m_pDescription = createWidget( TQRect(4,6, 250,10), this ); + m_pTimeSign = createWidget( TQRect(6,40, 10,10), this, 0, Qt::WRepaintNoErase ); + m_pVolSign = createWidget( TQRect(295,7, 9,8), this ); m_pDescription->setText( i18n( "Artist-Title|Album|Length" ) ); m_pVolSign ->setPixmap( getPNG( "vol_speaker" ) ); @@ -209,7 +209,7 @@ PlayerWidget::PlayerWidget( QWidget *parent, const char *name, bool enablePlayli //KWin::setType( winId(), NET::Override ); //KWin::setOnAllDesktops( winId(), true ); - connect( m_pAnimTimer, SIGNAL( timeout() ), SLOT( drawScroll() ) ); + connect( m_pAnimTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( drawScroll() ) ); TrackToolTip::instance()->addToWidget( m_pScrollFrame ); } @@ -225,12 +225,12 @@ PlayerWidget::~PlayerWidget() // METHODS ---------------------------------------------------------------- -void PlayerWidget::setScroll( const QStringList &list ) +void PlayerWidget::setScroll( const TQStringList &list ) { - QString text; - QStringList list2( list ); - QStringList::Iterator end( list2.end() ); - for( QStringList::Iterator it = list2.begin(); it != end; ) + TQString text; + TQStringList list2( list ); + TQStringList::Iterator end( list2.end() ); + for( TQStringList::Iterator it = list2.begin(); it != end; ) { if( !(*it).isEmpty() ) { @@ -240,11 +240,11 @@ void PlayerWidget::setScroll( const QStringList &list ) else it = list2.remove( it ); } - //FIXME empty QString would crash due to NULL Pixmaps + //FIXME empty TQString would crash due to NULL Pixmaps if( text.isEmpty() ) text = i18n( "Please report this message to amarok@kde.org, thanks!" ); - QFont font( m_pScrollFrame->font() ); - QFontMetrics fm( font ); + TQFont font( m_pScrollFrame->font() ); + TQFontMetrics fm( font ); const uint separatorWidth = 21; const uint baseline = font.pixelSize(); //the font actually extends below its pixelHeight const uint separatorYPos = baseline - fm.boundingRect( "x" ).height() + 1; @@ -252,12 +252,12 @@ void PlayerWidget::setScroll( const QStringList &list ) m_scrollTextPixmap.resize( fm.width( text ) + list2.count() * separatorWidth, m_pScrollFrame->height() ); m_scrollTextPixmap.fill( backgroundColor() ); - QPainter p( &m_scrollTextPixmap ); + TQPainter p( &m_scrollTextPixmap ); p.setPen( foregroundColor() ); p.setFont( font ); uint x = 0; - for( QStringList::ConstIterator it = list2.constBegin(); + for( TQStringList::ConstIterator it = list2.constBegin(); it != list2.constEnd(); ++it ) { @@ -275,8 +275,8 @@ void PlayerWidget::drawScroll() { static uint phase = 0; - QPixmap* const buffer = &m_scrollBuffer; - QPixmap* const scroll = &m_scrollTextPixmap; + TQPixmap* const buffer = &m_scrollBuffer; + TQPixmap* const scroll = &m_scrollTextPixmap; const uint topMargin = 0; //moved margins into widget placement const uint leftMargin = 0; //as this makes it easier to fiddle @@ -323,7 +323,7 @@ void PlayerWidget::engineStateChanged( Engine::State state, Engine::State /*oldS m_pSlider->newBundle( MetaBundle() ); // Set an empty bundle for no moodbar m_pTimeLabel->hide(); m_pTimeSign->hide(); - m_rateString = QString::null; + m_rateString = TQString::null; m_pSlider->setEnabled( false ); setScroll( i18n( "Welcome to Amarok" ) ); update(); @@ -365,7 +365,7 @@ void PlayerWidget::engineNewMetaData( const MetaBundle &bundle, bool ) m_pSlider->newBundle( bundle ); m_rateString = bundle.prettyBitrate(); - QString Hz = bundle.prettySampleRate( true ); + TQString Hz = bundle.prettySampleRate( true ); if( !Hz.isEmpty() ) { if( m_rateString.isEmpty() ) @@ -374,7 +374,7 @@ void PlayerWidget::engineNewMetaData( const MetaBundle &bundle, bool ) m_rateString = i18n("%1 kBit - %2").arg( m_rateString, Hz ); } - QStringList list( bundle.prettyTitle() ); + TQStringList list( bundle.prettyTitle() ); list << bundle.album(); if( bundle.length() ) list << bundle.prettyLength(); setScroll( list ); @@ -406,7 +406,7 @@ void PlayerWidget::timeDisplay( int ms ) if( showRemaining ) seconds = songLength - seconds; m_timeBuffer.fill( backgroundColor() ); - QPainter p( &m_timeBuffer ); + TQPainter p( &m_timeBuffer ); p.setPen( foregroundColor() ); p.setFont( m_pTimeLabel->font() ); p.drawText( 0, 16, MetaBundle::prettyTime( seconds ) ); //FIXME remove padding, instead move()! @@ -416,12 +416,12 @@ void PlayerWidget::timeDisplay( int ms ) } -static inline QColor comodulate( int hue, QColor target ) +static inline TQColor comodulate( int hue, TQColor target ) { ///this function is only used by determineAmarokColors() int ignore, s, v; target.getHsv( &ignore, &s, &v ); - return QColor( hue, s, v, QColor::Hsv ); + return TQColor( hue, s, v, TQColor::Hsv ); } void PlayerWidget::determineAmarokColors() //static @@ -455,20 +455,20 @@ void PlayerWidget::determineAmarokColors() //static void PlayerWidget::setModifiedPalette() { - QPalette p = QApplication::palette(); - QColorGroup cg = p.active(); - cg.setColor( QColorGroup::Background, Amarok::ColorScheme::Base ); - cg.setColor( QColorGroup::Foreground, Amarok::ColorScheme::Text ); - setPalette( QPalette(cg, p.disabled(), cg) ); + TQPalette p = TQApplication::palette(); + TQColorGroup cg = p.active(); + cg.setColor( TQColorGroup::Background, Amarok::ColorScheme::Base ); + cg.setColor( TQColorGroup::Foreground, Amarok::ColorScheme::Text ); + setPalette( TQPalette(cg, p.disabled(), cg) ); } void PlayerWidget::applySettings() { //NOTE DON'T use unsetFont(), we use custom font sizes (for now) - QFont phont = font(); + TQFont phont = font(); phont.setFamily( AmarokConfig::useCustomFonts() ? AmarokConfig::playerWidgetFont().family() - : QApplication::font().family() ); + : TQApplication::font().family() ); setFont( phont ); setModifiedPalette(); @@ -525,19 +525,19 @@ void PlayerWidget::setMinimalView( bool enable ) static bool dontChangeButtonState = false; //FIXME I hate this hack -bool PlayerWidget::event( QEvent *e ) +bool PlayerWidget::event( TQEvent *e ) { switch( e->type() ) { - case QEvent::Wheel: - case QEvent::DragEnter: - case QEvent::Drop: - case QEvent::Close: + case TQEvent::Wheel: + case TQEvent::DragEnter: + case TQEvent::Drop: + case TQEvent::Close: Amarok::genericEventHandler( this, e ); return true; //we handled it - case QEvent::ApplicationPaletteChange: + case TQEvent::ApplicationPaletteChange: if( AmarokConfig::schemeKDE() ) { @@ -546,16 +546,16 @@ bool PlayerWidget::event( QEvent *e ) } return true; - case 6/*QEvent::KeyPress*/: - if (static_cast(e)->key() == Qt::Key_D/* && (m_pAnalyzer->inherits("QGLWidget")*/) + case 6/*TQEvent::KeyPress*/: + if (static_cast(e)->key() == Qt::Key_D/* && (m_pAnalyzer->inherits("TQGLWidget")*/) { if( m_pAnalyzer->parent() ) { - m_pAnalyzer->reparent( 0, QPoint(50,50), true ); + m_pAnalyzer->reparent( 0, TQPoint(50,50), true ); m_pAnalyzer->setCaption( kapp->makeStdCaption( i18n("Analyzer") ) ); m_pAnalyzer->installEventFilter( this ); m_pAnalyzer->setPaletteBackgroundColor( paletteBackgroundColor() ); - QToolTip::remove( m_pAnalyzer ); + TQToolTip::remove( m_pAnalyzer ); } else createAnalyzer( 0 ); @@ -564,7 +564,7 @@ bool PlayerWidget::event( QEvent *e ) } return false; //don't eat event - case QEvent::Show: + case TQEvent::Show: m_pAnimTimer->start( ANIM_TIMER ); @@ -590,7 +590,7 @@ bool PlayerWidget::event( QEvent *e ) //extern Atom qt_wm_state; //XAtom defined by Qt //TODO prevent the active Window flicker from playlist to player window please! - //TODO look at code for QWidget::show(); + //TODO look at code for TQWidget::show(); //XDeleteProperty( qt_xdisplay(), id, qt_wm_state ); @@ -623,7 +623,7 @@ bool PlayerWidget::event( QEvent *e ) return false; - case QEvent::Hide: + case TQEvent::Hide: m_pAnimTimer->stop(); { @@ -657,7 +657,7 @@ bool PlayerWidget::event( QEvent *e ) return false; default: - return QWidget::event( e ); + return TQWidget::event( e ); } } @@ -674,14 +674,14 @@ bool PlayerWidget::event( QEvent *e ) // } bool -PlayerWidget::eventFilter( QObject *o, QEvent *e ) +PlayerWidget::eventFilter( TQObject *o, TQEvent *e ) { //NOTE we only monitor for parent() - which is the PlaylistWindow if( o == m_pAnalyzer ) { //delete analyzer, create same one back in Player Window - if( e->type() == QEvent::Close ) + if( e->type() == TQEvent::Close ) { createAnalyzer( 0 ); return true; @@ -691,12 +691,12 @@ PlayerWidget::eventFilter( QObject *o, QEvent *e ) switch( e->type() ) { - case QEvent::Close: + case TQEvent::Close: - static_cast(e)->accept(); //close the window! + static_cast(e)->accept(); //close the window! return true; //don't let PlaylistWindow have the event - see PlaylistWindow::closeEvent() - case QEvent::Hide: + case TQEvent::Hide: if( dontChangeButtonState ) { @@ -719,7 +719,7 @@ PlayerWidget::eventFilter( QObject *o, QEvent *e ) //FALL THROUGH - case QEvent::Show: + case TQEvent::Show: if( isShown() ) { @@ -728,7 +728,7 @@ PlayerWidget::eventFilter( QObject *o, QEvent *e ) //this is a good thing, but we have to set the state correctly when we are shown m_pPlaylistButton->blockSignals( true ); - m_pPlaylistButton->setOn( e->type() == QEvent::Show ); + m_pPlaylistButton->setOn( e->type() == TQEvent::Show ); m_pPlaylistButton->blockSignals( false ); } break; @@ -741,10 +741,10 @@ PlayerWidget::eventFilter( QObject *o, QEvent *e ) } -void PlayerWidget::paintEvent( QPaintEvent* ) +void PlayerWidget::paintEvent( TQPaintEvent* ) { //uses widget's font and foregroundColor() - see ctor - QPainter p( this ); + TQPainter p( this ); if( !m_minimalView ) p.drawText( 6, 68, m_rateString ); @@ -753,14 +753,14 @@ void PlayerWidget::paintEvent( QPaintEvent* ) } -void PlayerWidget::contextMenuEvent( QMouseEvent *e ) +void PlayerWidget::contextMenuEvent( TQMouseEvent *e ) { Amarok::Menu::instance()->exec( e->globalPos() ); } -void PlayerWidget::mousePressEvent( QMouseEvent *e ) +void PlayerWidget::mousePressEvent( TQMouseEvent *e ) { - if ( e->button() == QMouseEvent::RightButton ) + if ( e->button() == TQMouseEvent::RightButton ) { //Amarok::Menu::instance()->exec( e->globalPos() ); } @@ -784,13 +784,13 @@ void PlayerWidget::mousePressEvent( QMouseEvent *e ) } -void PlayerWidget::mouseMoveEvent( QMouseEvent *e ) +void PlayerWidget::mouseMoveEvent( TQMouseEvent *e ) { if( e->state() & Qt::LeftButton ) { const int distance = (e->pos() - m_startDragPos).manhattanLength(); - if( distance > QApplication::startDragDistance() ) startDrag(); + if( distance > TQApplication::startDragDistance() ) startDrag(); } } @@ -805,14 +805,14 @@ void PlayerWidget::createAnalyzer( int increment ) m_pAnalyzer = Analyzer::Factory::createAnalyzer( this ); m_pAnalyzer->setGeometry( 120,40, 168,56 ); - QToolTip::add( m_pAnalyzer, i18n( "Click for more analyzers, press 'd' to detach." ) ); + TQToolTip::add( m_pAnalyzer, i18n( "Click for more analyzers, press 'd' to detach." ) ); m_pAnalyzer->show(); } void PlayerWidget::startDrag() { - QDragObject *d = new QTextDrag( EngineController::instance()->bundle().prettyTitle(), this ); + TQDragObject *d = new TQTextDrag( EngineController::instance()->bundle().prettyTitle(), this ); d->dragCopy(); // Qt will delete d for us. } @@ -828,7 +828,7 @@ void PlayerWidget::slotShowEqualizer( bool show ) //SLOT KMessageBox::sorry( 0, i18n( "Equalizer is not available with this engine." ) ); else - QTimer::singleShot( 0, kapp, SLOT( slotConfigEqualizer() ) ); + TQTimer::singleShot( 0, kapp, TQT_SLOT( slotConfigEqualizer() ) ); } } @@ -839,30 +839,30 @@ void PlayerWidget::slotShowEqualizer( bool show ) //SLOT #include #include -NavButton::NavButton( QWidget *parent, const QString &icon, KAction *action ) - : QToolButton( parent ) +NavButton::NavButton( TQWidget *parent, const TQString &icon, KAction *action ) + : TQToolButton( parent ) , m_glowIndex( 0 ) { // Prevent flicker setWFlags( Qt::WNoAutoErase ); - QPixmap pixmap( getPNG( "b_" + icon ) ); + TQPixmap pixmap( getPNG( "b_" + icon ) ); KIconEffect ie; // Tint icon blueish for "off" state - m_pixmapOff = ie.apply( pixmap, KIconEffect::Colorize, 0.5, QColor( 0x30, 0x10, 0xff ), false ); + m_pixmapOff = ie.apply( pixmap, KIconEffect::Colorize, 0.5, TQColor( 0x30, 0x10, 0xff ), false ); // Tint gray and make pseudo-transparent for "disabled" state - m_pixmapDisabled = ie.apply( pixmap, KIconEffect::ToGray, 0.7, QColor(), true ); + m_pixmapDisabled = ie.apply( pixmap, KIconEffect::ToGray, 0.7, TQColor(), true ); int r = 0x20, g = 0x10, b = 0xff; float percentRed = 0.0; - QPixmap temp; + TQPixmap temp; // Precalculate pixmaps for "on" icon state for ( int i = 0; i < NUMPIXMAPS; i++ ) { - QImage img = pixmap.convertToImage(); + TQImage img = pixmap.convertToImage(); temp = KImageEffect::channelIntensity( img, percentRed, KImageEffect::Red ); - temp = ie.apply( temp, KIconEffect::Colorize, 1.0, QColor( r, 0x10, 0x30 ), false ); - temp = ie.apply( temp, KIconEffect::Colorize, 1.0, QColor( r, g, b ), false ); + temp = ie.apply( temp, KIconEffect::Colorize, 1.0, TQColor( r, 0x10, 0x30 ), false ); + temp = ie.apply( temp, KIconEffect::Colorize, 1.0, TQColor( r, g, b ), false ); // Create new pixmap on the heap and add pointer to list m_glowPixmaps.append( temp ); @@ -875,27 +875,27 @@ NavButton::NavButton( QWidget *parent, const QString &icon, KAction *action ) // And the the same reversed for ( int i = NUMPIXMAPS - 1; i > 0; i-- ) { - QPixmap temp = m_glowPixmaps[i]; + TQPixmap temp = m_glowPixmaps[i]; m_glowPixmaps.append(temp); } // This is just for initialization - QIconSet iconSet; - iconSet.setPixmap( pixmap, QIconSet::Automatic, QIconSet::Normal, QIconSet::Off ); - iconSet.setPixmap( pixmap, QIconSet::Automatic, QIconSet::Normal, QIconSet::On ); - iconSet.setPixmap( pixmap, QIconSet::Automatic, QIconSet::Disabled, QIconSet::Off ); + TQIconSet iconSet; + iconSet.setPixmap( pixmap, TQIconSet::Automatic, TQIconSet::Normal, TQIconSet::Off ); + iconSet.setPixmap( pixmap, TQIconSet::Automatic, TQIconSet::Normal, TQIconSet::On ); + iconSet.setPixmap( pixmap, TQIconSet::Automatic, TQIconSet::Disabled, TQIconSet::Off ); setIconSet( iconSet ); - setFocusPolicy( QWidget::NoFocus ); + setFocusPolicy( TQWidget::NoFocus ); setEnabled( action->isEnabled() ); - connect( action, SIGNAL( enabled( bool ) ), SLOT( setEnabled( bool ) ) ); - connect( this, SIGNAL( clicked() ), action, SLOT( activate() ) ); + connect( action, TQT_SIGNAL( enabled( bool ) ), TQT_SLOT( setEnabled( bool ) ) ); + connect( this, TQT_SIGNAL( clicked() ), action, TQT_SLOT( activate() ) ); startTimer( GLOW_INTERVAL ); } -void NavButton::timerEvent( QTimerEvent* ) +void NavButton::timerEvent( TQTimerEvent* ) { if ( isOn() ) { m_glowIndex++; @@ -907,7 +907,7 @@ void NavButton::timerEvent( QTimerEvent* ) } -void NavButton::drawButtonLabel( QPainter* p ) +void NavButton::drawButtonLabel( TQPainter* p ) { int x = width() / 2 - m_pixmapOff.width() / 2; int y = height() / 2 - m_pixmapOff.height() / 2; @@ -925,29 +925,29 @@ void NavButton::drawButtonLabel( QPainter* p ) // CLASS IconButton ////////////////////////////////////////////////////////////////////////////////////////// -IconButton::IconButton( QWidget *parent, const QString &icon, const char *signal ) - : QButton( parent ) +IconButton::IconButton( TQWidget *parent, const TQString &icon, const char *signal ) + : TQButton( parent ) , m_up( getPNG( icon + "_active2" ) ) //TODO rename files better (like the right way round for one!) , m_down( getPNG( icon + "_inactive2" ) ) { - connect( this, SIGNAL(toggled( bool )), parent, signal ); + connect( this, TQT_SIGNAL(toggled( bool )), parent, signal ); setToggleButton( true ); setFocusPolicy( NoFocus ); //we have no way to show focus on these widgets currently } -IconButton::IconButton( QWidget *parent, const QString &icon, QObject* receiver, const char *slot ) - : QButton( parent ) +IconButton::IconButton( TQWidget *parent, const TQString &icon, TQObject* receiver, const char *slot ) + : TQButton( parent ) , m_up( getPNG( icon + "_active2" ) ) //TODO rename files better (like the right way round for one!) , m_down( getPNG( icon + "_inactive2" ) ) { - connect( this, SIGNAL(toggled( bool )), receiver, slot ); + connect( this, TQT_SIGNAL(toggled( bool )), receiver, slot ); setToggleButton( true ); setFocusPolicy( NoFocus ); //we have no way to show focus on these widgets currently } -void IconButton::drawButton( QPainter *p ) +void IconButton::drawButton( TQPainter *p ) { p->drawPixmap( 0, 0, (isOn()||isDown()) ? m_down : m_up ); } diff --git a/amarok/src/playerwindow.h b/amarok/src/playerwindow.h index 659d6c9e..7caf3413 100644 --- a/amarok/src/playerwindow.h +++ b/amarok/src/playerwindow.h @@ -18,10 +18,10 @@ #ifndef PLAYERWIDGET_H #define PLAYERWIDGET_H -#include //stack allocated -#include //baseclass -#include //stack allocated -#include //baseclass +#include //stack allocated +#include //baseclass +#include //stack allocated +#include //baseclass #include "engineobserver.h" //baseclass @@ -29,31 +29,31 @@ namespace Amarok { class PrettySlider; } class KAction; class MetaBundle; class PlayerWidget; -class QBitmap; -class QButton; -class QHBox; -class QLabel; -class QString; -class QStringList; -class QTimerEvent; +class TQBitmap; +class TQButton; +class TQHBox; +class TQLabel; +class TQString; +class TQStringList; +class TQTimerEvent; -class NavButton : public QToolButton //no QOBJECT macro - why bother? +class NavButton : public TQToolButton //no QOBJECT macro - why bother? { public: - NavButton( QWidget*, const QString&, KAction* ); + NavButton( TQWidget*, const TQString&, KAction* ); protected: - void timerEvent( QTimerEvent* ); - void drawButtonLabel( QPainter* ); + void timerEvent( TQTimerEvent* ); + void drawButtonLabel( TQPainter* ); static const int GLOW_INTERVAL = 35; static const int NUMPIXMAPS = 16; - QPixmap m_pixmapOff; - QPixmap m_pixmapDisabled; + TQPixmap m_pixmapOff; + TQPixmap m_pixmapDisabled; - QValueVector m_glowPixmaps; + TQValueVector m_glowPixmaps; int m_glowIndex; }; @@ -63,27 +63,27 @@ class IconButton : public QButton Q_OBJECT public: - IconButton( QWidget*, const QString&, const char *signal ); - IconButton( QWidget*, const QString&, QObject* receiver, const char *slot ); + IconButton( TQWidget*, const TQString&, const char *signal ); + IconButton( TQWidget*, const TQString&, TQObject* receiver, const char *slot ); public slots: - void setOn( bool b ) { QButton::setOn( b ); } - void setOff() { QButton::setOn( false ); } + void setOn( bool b ) { TQButton::setOn( b ); } + void setOff() { TQButton::setOn( false ); } private: - void drawButton( QPainter* ); + void drawButton( TQPainter* ); - const QPixmap m_up; - const QPixmap m_down; + const TQPixmap m_up; + const TQPixmap m_down; }; -class PlayerWidget : public QWidget, public EngineObserver +class PlayerWidget : public TQWidget, public EngineObserver { Q_OBJECT public: - PlayerWidget( QWidget* = 0, const char* = 0, bool enablePlaylist = false ); + PlayerWidget( TQWidget* = 0, const char* = 0, bool enablePlaylist = false ); ~PlayerWidget(); /** Set modified Amarok palette */ @@ -121,18 +121,18 @@ class PlayerWidget : public QWidget, public EngineObserver void slotShowEqualizer( bool show ); private: - void setScroll( const QStringList& ); + void setScroll( const TQStringList& ); - virtual bool event( QEvent* ); - virtual bool eventFilter( QObject*, QEvent* ); + virtual bool event( TQEvent* ); + virtual bool eventFilter( TQObject*, TQEvent* ); //virtual bool x11Event( XEvent* ); - virtual void paintEvent( QPaintEvent* ); - virtual void contextMenuEvent( QMouseEvent* ); - virtual void mousePressEvent( QMouseEvent* ); - virtual void mouseMoveEvent( QMouseEvent* ); + virtual void paintEvent( TQPaintEvent* ); + virtual void contextMenuEvent( TQMouseEvent* ); + virtual void mousePressEvent( TQMouseEvent* ); + virtual void mouseMoveEvent( TQMouseEvent* ); ///to make the code clearer to n00bies ;) - QWidget *playlistWindow() { return parentWidget(); } + TQWidget *playlistWindow() { return parentWidget(); } static const int SCROLL_RATE = 1; static const int ANIM_TIMER = 30; @@ -140,35 +140,35 @@ class PlayerWidget : public QWidget, public EngineObserver // ATTRIBUTES ------ bool m_minimalView; - QTimer *m_pAnimTimer; + TQTimer *m_pAnimTimer; - QPixmap m_scrollTextPixmap; - QPixmap m_scrollBuffer; - QPixmap m_timeBuffer; - QPixmap m_plusPixmap; - QPixmap m_minusPixmap; + TQPixmap m_scrollTextPixmap; + TQPixmap m_scrollBuffer; + TQPixmap m_timeBuffer; + TQPixmap m_plusPixmap; + TQPixmap m_minusPixmap; - QPoint m_startDragPos; //for drag behaviour + TQPoint m_startDragPos; //for drag behaviour //widgets - QString m_rateString; - QWidget *m_pAnalyzer; + TQString m_rateString; + TQWidget *m_pAnalyzer; IconButton *m_pButtonEq; IconButton *m_pPlaylistButton; - QLabel *m_pTimeLabel; - QLabel *m_pTimeSign; + TQLabel *m_pTimeLabel; + TQLabel *m_pTimeSign; - QFrame *m_pScrollFrame; - QLabel *m_pVolSign; - QLabel *m_pDescription; - QHBox *m_pFrameButtons; + TQFrame *m_pScrollFrame; + TQLabel *m_pVolSign; + TQLabel *m_pDescription; + TQHBox *m_pFrameButtons; Amarok::PrettySlider *m_pSlider; Amarok::PrettySlider *m_pVolSlider; - QToolButton *m_pButtonPlay; - QToolButton *m_pButtonPause; + TQToolButton *m_pButtonPlay; + TQToolButton *m_pButtonPause; - QString m_currentURL; + TQString m_currentURL; }; #endif diff --git a/amarok/src/playlist.cpp b/amarok/src/playlist.cpp index 2e88c374..91875de2 100644 --- a/amarok/src/playlist.cpp +++ b/amarok/src/playlist.cpp @@ -47,22 +47,22 @@ #include //for pow() in playNextTrack() -#include -#include //copyToClipboard(), slotMouseButtonPressed() -#include -#include -#include //undo system -#include //eventFilter() -#include //showUsageMessage() -#include -#include //slotGlowTimer() -#include //toolTipText() -#include -#include -#include -#include //addHybridTracks() -#include //playNextTrack() -#include +#include +#include //copyToClipboard(), slotMouseButtonPressed() +#include +#include +#include //undo system +#include //eventFilter() +#include //showUsageMessage() +#include +#include //slotGlowTimer() +#include //toolTipText() +#include +#include +#include +#include //addHybridTracks() +#include //playNextTrack() +#include #include #include @@ -108,7 +108,7 @@ typedef PlaylistIterator MyIt; class TagWriter : public ThreadManager::Job { //TODO make this do all tags at once when you split playlist.cpp up public: - TagWriter( PlaylistItem*, const QString &oldTag, const QString &newTag, const int, const bool updateView = true ); + TagWriter( PlaylistItem*, const TQString &oldTag, const TQString &newTag, const int, const bool updateView = true ); ~TagWriter(); bool doJob(); void completeJob(); @@ -116,8 +116,8 @@ private: PlaylistItem* const m_item; bool m_failed; - QString m_oldTagString; - QString m_newTagString; + TQString m_oldTagString; + TQString m_newTagString; int m_tagType; bool m_updateView; }; @@ -141,7 +141,7 @@ namespace Glow static const uint STEPS = 13; static uint counter; - static QTimer timer; + static TQTimer timer; inline void startTimer() { @@ -160,13 +160,13 @@ namespace Glow /// CLASS Playlist ////////////////////////////////////////////////////////////////////////////////////////// -QMutex* Playlist::s_dynamicADTMutex = new QMutex(); +TQMutex* Playlist::s_dynamicADTMutex = new TQMutex(); Playlist *Playlist::s_instance = 0; -Playlist::Playlist( QWidget *parent ) +Playlist::Playlist( TQWidget *parent ) : KListView( parent, "ThePlaylist" ) , EngineObserver( EngineController::instance() ) - , m_startupTime_t( QDateTime::currentDateTime().toTime_t() ) + , m_startupTime_t( TQDateTime::currentDateTime().toTime_t() ) , m_oldestTime_t( CollectionDB::instance()->query( "SELECT MIN( createdate ) FROM statistics;" ).first().toInt() ) , m_currentTrack( 0 ) , m_marker( 0 ) @@ -206,28 +206,28 @@ Playlist::Playlist( QWidget *parent ) { s_instance = this; - connect( CollectionDB::instance(), SIGNAL(fileMoved(const QString&, - const QString&, const QString&)), SLOT(updateEntriesUrl(const QString&, - const QString&, const QString&)) ); - connect( CollectionDB::instance(), SIGNAL(uniqueIdChanged(const QString&, - const QString&, const QString&)), SLOT(updateEntriesUniqueId(const QString&, - const QString&, const QString&)) ); - connect( CollectionDB::instance(), SIGNAL(fileDeleted(const QString&, - const QString&)), SLOT(updateEntriesStatusDeleted(const QString&, const QString&)) ); - connect( CollectionDB::instance(), SIGNAL(fileAdded(const QString&, - const QString&)), SLOT(updateEntriesStatusAdded(const QString&, const QString&)) ); - connect( CollectionDB::instance(), SIGNAL(filesAdded(const QMap&)), - SLOT(updateEntriesStatusAdded(const QMap&)) ); + connect( CollectionDB::instance(), TQT_SIGNAL(fileMoved(const TQString&, + const TQString&, const TQString&)), TQT_SLOT(updateEntriesUrl(const TQString&, + const TQString&, const TQString&)) ); + connect( CollectionDB::instance(), TQT_SIGNAL(uniqueIdChanged(const TQString&, + const TQString&, const TQString&)), TQT_SLOT(updateEntriesUniqueId(const TQString&, + const TQString&, const TQString&)) ); + connect( CollectionDB::instance(), TQT_SIGNAL(fileDeleted(const TQString&, + const TQString&)), TQT_SLOT(updateEntriesStatusDeleted(const TQString&, const TQString&)) ); + connect( CollectionDB::instance(), TQT_SIGNAL(fileAdded(const TQString&, + const TQString&)), TQT_SLOT(updateEntriesStatusAdded(const TQString&, const TQString&)) ); + connect( CollectionDB::instance(), TQT_SIGNAL(filesAdded(const TQMap&)), + TQT_SLOT(updateEntriesStatusAdded(const TQMap&)) ); initStarPixmaps(); EngineController* const ec = EngineController::instance(); - connect( ec, SIGNAL(orderPrevious()), SLOT(playPrevTrack()) ); - connect( ec, SIGNAL(orderNext( const bool )), SLOT(playNextTrack( const bool )) ); - connect( ec, SIGNAL(orderCurrent()), SLOT(playCurrentTrack()) ); + connect( ec, TQT_SIGNAL(orderPrevious()), TQT_SLOT(playPrevTrack()) ); + connect( ec, TQT_SIGNAL(orderNext( const bool )), TQT_SLOT(playNextTrack( const bool )) ); + connect( ec, TQT_SIGNAL(orderCurrent()), TQT_SLOT(playCurrentTrack()) ); - connect( this, SIGNAL( itemCountChanged( int, int, int, int, int, int ) ), ec, SLOT( playlistChanged() ) ); + connect( this, TQT_SIGNAL( itemCountChanged( int, int, int, int, int, int ) ), ec, TQT_SLOT( playlistChanged() ) ); setShowSortIndicator( true ); @@ -238,7 +238,7 @@ Playlist::Playlist( QWidget *parent ) //setItemsRenameable( true ); setAcceptDrops( true ); - setSelectionMode( QListView::Extended ); + setSelectionMode( TQListView::Extended ); setAllColumnsShowFocus( true ); //setItemMargin( 1 ); //aesthetics @@ -294,48 +294,48 @@ Playlist::Playlist( QWidget *parent ) setColumnAlignment( PlaylistItem::PlayCount, Qt::AlignCenter ); - connect( this, SIGNAL( doubleClicked( QListViewItem* ) ), - this, SLOT( doubleClicked( QListViewItem* ) ) ); - connect( this, SIGNAL( returnPressed( QListViewItem* ) ), - this, SLOT( activate( QListViewItem* ) ) ); - connect( this, SIGNAL( mouseButtonPressed( int, QListViewItem*, const QPoint&, int ) ), - this, SLOT( slotMouseButtonPressed( int, QListViewItem*, const QPoint&, int ) ) ); - connect( this, SIGNAL( queueChanged( const PLItemList &, const PLItemList & ) ), - this, SLOT( slotQueueChanged( const PLItemList &, const PLItemList & ) ) ); - connect( this, SIGNAL( itemRenamed( QListViewItem*, const QString&, int ) ), - this, SLOT( writeTag( QListViewItem*, const QString&, int ) ) ); - connect( this, SIGNAL( aboutToClear() ), - this, SLOT( saveUndoState() ) ); - connect( CollectionDB::instance(), SIGNAL( scoreChanged( const QString&, float ) ), - this, SLOT( scoreChanged( const QString&, float ) ) ); - connect( CollectionDB::instance(), SIGNAL( ratingChanged( const QString&, int ) ), - this, SLOT( ratingChanged( const QString&, int ) ) ); - connect( CollectionDB::instance(), SIGNAL( fileMoved( const QString&, const QString& ) ), - this, SLOT( fileMoved( const QString&, const QString& ) ) ); - connect( header(), SIGNAL( indexChange( int, int, int ) ), - this, SLOT( columnOrderChanged() ) ), + connect( this, TQT_SIGNAL( doubleClicked( TQListViewItem* ) ), + this, TQT_SLOT( doubleClicked( TQListViewItem* ) ) ); + connect( this, TQT_SIGNAL( returnPressed( TQListViewItem* ) ), + this, TQT_SLOT( activate( TQListViewItem* ) ) ); + connect( this, TQT_SIGNAL( mouseButtonPressed( int, TQListViewItem*, const TQPoint&, int ) ), + this, TQT_SLOT( slotMouseButtonPressed( int, TQListViewItem*, const TQPoint&, int ) ) ); + connect( this, TQT_SIGNAL( queueChanged( const PLItemList &, const PLItemList & ) ), + this, TQT_SLOT( slotQueueChanged( const PLItemList &, const PLItemList & ) ) ); + connect( this, TQT_SIGNAL( itemRenamed( TQListViewItem*, const TQString&, int ) ), + this, TQT_SLOT( writeTag( TQListViewItem*, const TQString&, int ) ) ); + connect( this, TQT_SIGNAL( aboutToClear() ), + this, TQT_SLOT( saveUndoState() ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( scoreChanged( const TQString&, float ) ), + this, TQT_SLOT( scoreChanged( const TQString&, float ) ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( ratingChanged( const TQString&, int ) ), + this, TQT_SLOT( ratingChanged( const TQString&, int ) ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( fileMoved( const TQString&, const TQString& ) ), + this, TQT_SLOT( fileMoved( const TQString&, const TQString& ) ) ); + connect( header(), TQT_SIGNAL( indexChange( int, int, int ) ), + this, TQT_SLOT( columnOrderChanged() ) ), - connect( &Glow::timer, SIGNAL(timeout()), SLOT(slotGlowTimer()) ); + connect( &Glow::timer, TQT_SIGNAL(timeout()), TQT_SLOT(slotGlowTimer()) ); KActionCollection* const ac = Amarok::actionCollection(); - KAction *copy = KStdAction::copy( this, SLOT( copyToClipboard() ), ac, "playlist_copy" ); - KStdAction::selectAll( this, SLOT( selectAll() ), ac, "playlist_select_all" ); + KAction *copy = KStdAction::copy( this, TQT_SLOT( copyToClipboard() ), ac, "playlist_copy" ); + KStdAction::selectAll( this, TQT_SLOT( selectAll() ), ac, "playlist_select_all" ); - m_clearButton = new KAction( i18n( "clear playlist", "&Clear" ), Amarok::icon( "playlist_clear" ), 0, this, SLOT( clear() ), ac, "playlist_clear" ); - m_undoButton = KStdAction::undo( this, SLOT( undo() ), ac, "playlist_undo" ); - m_redoButton = KStdAction::redo( this, SLOT( redo() ), ac, "playlist_redo" ); + m_clearButton = new KAction( i18n( "clear playlist", "&Clear" ), Amarok::icon( "playlist_clear" ), 0, this, TQT_SLOT( clear() ), ac, "playlist_clear" ); + m_undoButton = KStdAction::undo( this, TQT_SLOT( undo() ), ac, "playlist_undo" ); + m_redoButton = KStdAction::redo( this, TQT_SLOT( redo() ), ac, "playlist_redo" ); m_undoButton ->setIcon( Amarok::icon( "undo" ) ); m_redoButton ->setIcon( Amarok::icon( "redo" ) ); - new KAction( i18n( "&Repopulate" ), Amarok::icon( "playlist_refresh" ), 0, this, SLOT( repopulate() ), ac, "repopulate" ); - new KAction( i18n( "S&huffle" ), "rebuild", CTRL+Key_H, this, SLOT( shuffle() ), ac, "playlist_shuffle" ); - KAction *gotoCurrent = new KAction( i18n( "&Go To Current Track" ), Amarok::icon( "music" ), CTRL+Key_J, this, SLOT( showCurrentTrack() ), ac, "playlist_show" ); - new KAction( i18n( "&Remove Duplicate && Dead Entries" ), 0, this, SLOT( removeDuplicates() ), ac, "playlist_remove_duplicates" ); - new KAction( i18n( "&Queue Selected Tracks" ), Amarok::icon( "queue_track" ), CTRL+Key_D, this, SLOT( queueSelected() ), ac, "queue_selected" ); + new KAction( i18n( "&Repopulate" ), Amarok::icon( "playlist_refresh" ), 0, this, TQT_SLOT( repopulate() ), ac, "repopulate" ); + new KAction( i18n( "S&huffle" ), "rebuild", CTRL+Key_H, this, TQT_SLOT( shuffle() ), ac, "playlist_shuffle" ); + KAction *gotoCurrent = new KAction( i18n( "&Go To Current Track" ), Amarok::icon( "music" ), CTRL+Key_J, this, TQT_SLOT( showCurrentTrack() ), ac, "playlist_show" ); + new KAction( i18n( "&Remove Duplicate && Dead Entries" ), 0, this, TQT_SLOT( removeDuplicates() ), ac, "playlist_remove_duplicates" ); + new KAction( i18n( "&Queue Selected Tracks" ), Amarok::icon( "queue_track" ), CTRL+Key_D, this, TQT_SLOT( queueSelected() ), ac, "queue_selected" ); KToggleAction *stopafter = new KToggleAction( i18n( "&Stop Playing After Track" ), Amarok::icon( "stop" ), CTRL+ALT+Key_V, - this, SLOT( toggleStopAfterCurrentItem() ), ac, "stop_after" ); + this, TQT_SLOT( toggleStopAfterCurrentItem() ), ac, "stop_after" ); { // KAction idiocy -- shortcuts don't work until they've been plugged into a menu KPopupMenu asdf; @@ -350,14 +350,14 @@ Playlist::Playlist( QWidget *parent ) } //ensure we update action enabled states when repeat Playlist is toggled - connect( ac->action( "repeat" ), SIGNAL(activated( int )), SLOT(updateNextPrev()) ); - connect( ac->action( "repeat" ), SIGNAL( activated( int ) ), SLOT( generateInfo() ) ); - connect( ac->action( "favor_tracks" ), SIGNAL( activated( int ) ), SLOT( generateInfo() ) ); - connect( ac->action( "random_mode" ), SIGNAL( activated( int ) ), SLOT( generateInfo() ) ); + connect( ac->action( "repeat" ), TQT_SIGNAL(activated( int )), TQT_SLOT(updateNextPrev()) ); + connect( ac->action( "repeat" ), TQT_SIGNAL( activated( int ) ), TQT_SLOT( generateInfo() ) ); + connect( ac->action( "favor_tracks" ), TQT_SIGNAL( activated( int ) ), TQT_SLOT( generateInfo() ) ); + connect( ac->action( "random_mode" ), TQT_SIGNAL( activated( int ) ), TQT_SLOT( generateInfo() ) ); // undostates are written in chronological order, so this is a clever way to get them back in the correct order :) - QStringList undos = m_undoDir.entryList( QString("*.xml"), QDir::Files, QDir::Time ); + TQStringList undos = m_undoDir.entryList( TQString("*.xml"), TQDir::Files, TQDir::Time ); foreach( undos ) m_undoList.append( m_undoDir.absPath() + '/' + (*it) ); @@ -383,14 +383,14 @@ Playlist::Playlist( QWidget *parent ) columnResizeEvent( header()->count(), 0, 0 ); //do after you resize all the columns - connect( header(), SIGNAL(sizeChange( int, int, int )), SLOT(columnResizeEvent( int, int, int )) ); + connect( header(), TQT_SIGNAL(sizeChange( int, int, int )), TQT_SLOT(columnResizeEvent( int, int, int )) ); - connect( this, SIGNAL( contentsMoving( int, int ) ), SLOT( slotContentsMoving() ) ); + connect( this, TQT_SIGNAL( contentsMoving( int, int ) ), TQT_SLOT( slotContentsMoving() ) ); - connect( App::instance(), SIGNAL( useScores( bool ) ), this, SLOT( slotUseScores( bool ) ) ); - connect( App::instance(), SIGNAL( useRatings( bool ) ), this, SLOT( slotUseRatings( bool ) ) ); - connect( App::instance(), SIGNAL( moodbarPrefs( bool, bool, int, bool ) ), - this, SLOT( slotMoodbarPrefs( bool, bool, int, bool ) ) ); + connect( App::instance(), TQT_SIGNAL( useScores( bool ) ), this, TQT_SLOT( slotUseScores( bool ) ) ); + connect( App::instance(), TQT_SIGNAL( useRatings( bool ) ), this, TQT_SLOT( slotUseRatings( bool ) ) ); + connect( App::instance(), TQT_SIGNAL( moodbarPrefs( bool, bool, int, bool ) ), + this, TQT_SLOT( slotMoodbarPrefs( bool, bool, int, bool ) ) ); Amarok::ToolTip::add( this, viewport() ); @@ -398,16 +398,16 @@ Playlist::Playlist( QWidget *parent ) renameLineEdit()->installEventFilter( this ); setTabOrderedRenaming( false ); - m_filtertimer = new QTimer( this ); - connect( m_filtertimer, SIGNAL(timeout()), this, SLOT(setDelayedFilter()) ); + m_filtertimer = new TQTimer( this ); + connect( m_filtertimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(setDelayedFilter()) ); - connect( MountPointManager::instance(), SIGNAL(mediumConnected( int )), - SLOT(mediumChange( int )) ); - connect( MountPointManager::instance(), SIGNAL(mediumRemoved( int )), - SLOT(mediumChange( int )) ); + connect( MountPointManager::instance(), TQT_SIGNAL(mediumConnected( int )), + TQT_SLOT(mediumChange( int )) ); + connect( MountPointManager::instance(), TQT_SIGNAL(mediumRemoved( int )), + TQT_SLOT(mediumChange( int )) ); - m_clicktimer = new QTimer( this ); - connect( m_clicktimer, SIGNAL(timeout()), this, SLOT(slotSingleClick()) ); + m_clicktimer = new TQTimer( this ); + connect( m_clicktimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotSingleClick()) ); } Playlist::~Playlist() @@ -433,7 +433,7 @@ Playlist::mediumChange( int deviceid ) // SLOT { Q_UNUSED( deviceid ); - for( QListViewItem *it = firstChild(); + for( TQListViewItem *it = firstChild(); it; it = it->nextSibling() ) { @@ -471,7 +471,7 @@ Playlist::insertMedia( const KURL::List &list, int options ) PlaylistItem *after = lastItem(); KURL::List addMe; - QPtrList alreadyHave; + TQPtrList alreadyHave; // Filter out duplicates foreachType( KURL::List, list ) { @@ -487,7 +487,7 @@ Playlist::insertMedia( const KURL::List &list, int options ) if ( addMe.isEmpty() ) // all songs to be queued are already in the playlist { // queue all the songs - foreachType( QPtrList, alreadyHave ) + foreachType( TQPtrList, alreadyHave ) queue( *it, false, false ); return; } else { @@ -533,7 +533,7 @@ Playlist::insertMediaInternal( const KURL::List &list, PlaylistItem *after, int } void -Playlist::insertMediaSql( const QString& sql, int options ) +Playlist::insertMediaSql( const TQString& sql, int options ) { const bool isPlaying = EngineController::engine()->state() == Engine::Playing; if( isPlaying ) @@ -630,16 +630,16 @@ Playlist::adjustDynamicPrevious( uint songCount, bool saveUndo ) int current = currentTrackIndex(); int x = current - songCount; - QPtrList list; + TQPtrList list; int y=0; - for( QListViewItemIterator it( firstChild() ); y < x ; list.prepend( *it ), ++it, y++ ); + for( TQListViewItemIterator it( firstChild() ); y < x ; list.prepend( *it ), ++it, y++ ); if( list.isEmpty() ) return; if ( saveUndo ) saveUndoState(); //remove the items - for( QListViewItem *item = list.first(); item; item = list.next() ) + for( TQListViewItem *item = list.first(); item; item = list.next() ) { removeItem( static_cast( item ) ); delete item; @@ -688,7 +688,7 @@ Playlist::restoreSession() // check it exists, because on the first ever run it doesn't and // it looks bad to show "some URLs were not suitable.." on the // first ever-run - if( QFile::exists( url.path() ) ) + if( TQFile::exists( url.path() ) ) { ThreadManager::instance()->queueJob( new UrlLoader( url, 0, 0 ) ); } @@ -700,18 +700,18 @@ Playlist::restoreSession() Copyright (C) 2000,2003 Charles Samuels Copyright (C) 2000 Peter Putzer */ -void Playlist::saveLayout(KConfig *config, const QString &group) const +void Playlist::saveLayout(KConfig *config, const TQString &group) const { KConfigGroupSaver saver(config, group); - QStringList names, widths, order; + TQStringList names, widths, order; const int colCount = columns(); - QHeader* const thisHeader = header(); + TQHeader* const thisHeader = header(); for (int i = 0; i < colCount; ++i) { names << PlaylistItem::exactColumnName(i); - widths << QString::number(columnWidth(i)); - order << QString::number(thisHeader->mapToIndex(i)); + widths << TQString::number(columnWidth(i)); + order << TQString::number(thisHeader->mapToIndex(i)); } config->writeEntry("ColumnsVersion", 1); config->writeEntry("ColumnNames", names); @@ -721,15 +721,15 @@ void Playlist::saveLayout(KConfig *config, const QString &group) const config->writeEntry("SortAscending", ascendingSort()); } -void Playlist::restoreLayout(KConfig *config, const QString &group) +void Playlist::restoreLayout(KConfig *config, const TQString &group) { KConfigGroupSaver saver(config, group); int version = config->readNumEntry("ColumnsVersion", 0); - QValueList iorder; //internal ordering + TQValueList iorder; //internal ordering if( version ) { - QStringList names = config->readListEntry("ColumnNames"); + TQStringList names = config->readListEntry("ColumnNames"); for( int i = 0, n = names.count(); i < n; ++i ) { bool found = false; @@ -764,11 +764,11 @@ void Playlist::restoreLayout(KConfig *config, const QString &group) } - QStringList cols = config->readListEntry("ColumnWidths"); + TQStringList cols = config->readListEntry("ColumnWidths"); int i = 0; { // scope the iterators - QStringList::ConstIterator it = cols.constBegin(); - const QStringList::ConstIterator itEnd = cols.constEnd(); + TQStringList::ConstIterator it = cols.constBegin(); + const TQStringList::ConstIterator itEnd = cols.constEnd(); for (; it != itEnd; ++it) setColumnWidth(iorder[i++], (*it).toInt()); } @@ -781,8 +781,8 @@ void Playlist::restoreLayout(KConfig *config, const QString &group) const int colCount = columns(); for (i = 0; i < colCount; ++i) // final index positions from lowest to highest { - QStringList::ConstIterator it = cols.constBegin(); - const QStringList::ConstIterator itEnd = cols.constEnd(); + TQStringList::ConstIterator it = cols.constBegin(); + const TQStringList::ConstIterator itEnd = cols.constEnd(); int section = 0; for (; (it != itEnd) && (iorder[(*it).toInt()] != i); ++it, ++section) ; @@ -809,25 +809,25 @@ void Playlist::restoreLayout(KConfig *config, const QString &group) } void -Playlist::addToUniqueMap( const QString uniqueid, PlaylistItem* item ) +Playlist::addToUniqueMap( const TQString uniqueid, PlaylistItem* item ) { - QPtrList *list; + TQPtrList *list; if( m_uniqueMap.contains( uniqueid ) ) list = m_uniqueMap[uniqueid]; else - list = new QPtrList(); + list = new TQPtrList(); list->append( item ); if( !m_uniqueMap.contains( uniqueid ) ) m_uniqueMap[uniqueid] = list; } void -Playlist::removeFromUniqueMap( const QString uniqueid, PlaylistItem* item ) +Playlist::removeFromUniqueMap( const TQString uniqueid, PlaylistItem* item ) { if( !m_uniqueMap.contains( uniqueid ) ) return; - QPtrList *list; + TQPtrList *list; list = m_uniqueMap[uniqueid]; list->remove( item ); //don't care about return value @@ -840,12 +840,12 @@ Playlist::removeFromUniqueMap( const QString uniqueid, PlaylistItem* item ) } void -Playlist::updateEntriesUrl( const QString &oldUrl, const QString &newUrl, const QString &uniqueid ) +Playlist::updateEntriesUrl( const TQString &oldUrl, const TQString &newUrl, const TQString &uniqueid ) { // Make sure the MoodServer gets this signal first! MoodServer::instance()->slotFileMoved( oldUrl, newUrl ); - QPtrList *list; + TQPtrList *list; if( m_uniqueMap.contains( uniqueid ) ) { list = m_uniqueMap[uniqueid]; @@ -859,9 +859,9 @@ Playlist::updateEntriesUrl( const QString &oldUrl, const QString &newUrl, const } void -Playlist::updateEntriesUniqueId( const QString &/*url*/, const QString &oldid, const QString &newid ) +Playlist::updateEntriesUniqueId( const TQString &/*url*/, const TQString &oldid, const TQString &newid ) { - QPtrList *list, *oldlist; + TQPtrList *list, *oldlist; if( m_uniqueMap.contains( oldid ) ) { list = m_uniqueMap[oldid]; @@ -885,9 +885,9 @@ Playlist::updateEntriesUniqueId( const QString &/*url*/, const QString &oldid, c } void -Playlist::updateEntriesStatusDeleted( const QString &/*absPath*/, const QString &uniqueid ) +Playlist::updateEntriesStatusDeleted( const TQString &/*absPath*/, const TQString &uniqueid ) { - QPtrList *list; + TQPtrList *list; if( m_uniqueMap.contains( uniqueid ) ) { list = m_uniqueMap[uniqueid]; @@ -898,9 +898,9 @@ Playlist::updateEntriesStatusDeleted( const QString &/*absPath*/, const QString } void -Playlist::updateEntriesStatusAdded( const QString &absPath, const QString &uniqueid ) +Playlist::updateEntriesStatusAdded( const TQString &absPath, const TQString &uniqueid ) { - QPtrList *list; + TQPtrList *list; if( m_uniqueMap.contains( uniqueid ) ) { list = m_uniqueMap[uniqueid]; @@ -917,11 +917,11 @@ Playlist::updateEntriesStatusAdded( const QString &absPath, const QString &uniqu } void -Playlist::updateEntriesStatusAdded( const QMap &map ) +Playlist::updateEntriesStatusAdded( const TQMap &map ) { - QMap*> uniquecopy( m_uniqueMap ); + TQMap*> uniquecopy( m_uniqueMap ); - QMap*>::Iterator it; + TQMap*>::Iterator it; for( it = uniquecopy.begin(); it != uniquecopy.end(); ++it ) { if( map.contains( it.key() )) @@ -932,7 +932,7 @@ Playlist::updateEntriesStatusAdded( const QMap &map ) } for( it = uniquecopy.begin(); it != uniquecopy.end(); ++it ) - updateEntriesStatusDeleted( QString::null, it.key() ); + updateEntriesStatusDeleted( TQString::null, it.key() ); } //////////////////////////////////////////////////////////////////////////////// @@ -988,7 +988,7 @@ Playlist::playNextTrack( bool forceNext ) else if( AmarokConfig::randomMode() ) { - QValueVector tracks; + TQValueVector tracks; //make a list of everything we can play if( Amarok::randomAlbums() ) // add the first visible track from every unplayed album @@ -1021,7 +1021,7 @@ Playlist::playNextTrack( bool forceNext ) { // don't add it to previous albums if we only have one album in the playlist // would loop infinitely otherwise - QPtrList albums; + TQPtrList albums; for( PlaylistIterator it( this, PlaylistIterator::Visible ); *it && albums.count() <= 1; ++it ) if( albums.findRef( (*it)->m_album ) == -1 ) albums.append( (*it)->m_album ); @@ -1082,8 +1082,8 @@ Playlist::playNextTrack( bool forceNext ) item = tracks.at( KApplication::random() % tracks.count() ); //is O(1) else { - const uint currenttime_t = QDateTime::currentDateTime().toTime_t(); - QValueVector weights( tracks.size() ); + const uint currenttime_t = TQDateTime::currentDateTime().toTime_t(); + TQValueVector weights( tracks.size() ); Q_INT64 total = m_total; if( Amarok::randomAlbums() ) { @@ -1298,7 +1298,7 @@ void Playlist::queueSelected() { PLItemList in, out; - QPtrList dynamicList; + TQPtrList dynamicList; for( MyIt it( this, MyIt::Selected ); *it; ++it ) { @@ -1318,7 +1318,7 @@ Playlist::queueSelected() if( dynamicMode() ) { - QListViewItem *item = dynamicList.first(); + TQListViewItem *item = dynamicList.first(); if( m_nextTracks.containsRef( static_cast(item) ) ) { for( item = dynamicList.last(); item; item = dynamicList.prev() ) @@ -1335,7 +1335,7 @@ Playlist::queueSelected() } void -Playlist::queue( QListViewItem *item, bool multi, bool invertQueue ) +Playlist::queue( TQListViewItem *item, bool multi, bool invertQueue ) { #define item static_cast(item) @@ -1542,7 +1542,7 @@ void Playlist::generateInfo() (*it)->incrementTotals(); } -void Playlist::doubleClicked( QListViewItem *item ) +void Playlist::doubleClicked( TQListViewItem *item ) { /* We have to check if the item exists before calling activate, otherwise clicking on an empty playlist space would stop playing (check BR #105106)*/ @@ -1569,7 +1569,7 @@ Playlist::checkFileStatus( PlaylistItem * item ) if( !item->checkExists() ) { //debug() << "not found, finding new url" << endl; - QString path = QString::null; + TQString path = TQString::null; if( !item->uniqueId().isEmpty() ) { path = CollectionDB::instance()->urlFromUniqueId( item->uniqueId() ); @@ -1602,7 +1602,7 @@ Playlist::checkFileStatus( PlaylistItem * item ) } void -Playlist::activate( QListViewItem *item ) +Playlist::activate( TQListViewItem *item ) { ///item will be played if possible, the playback may be delayed ///so we start the glow anyway and hope @@ -1616,7 +1616,7 @@ Playlist::activate( QListViewItem *item ) EngineController::instance()->stop(); setCurrentTrack( 0 ); Amarok::OSD::instance()->OSDWidget::show( i18n("Playlist finished"), - QImage( KIconLoader().iconPath( "amarok", -KIcon::SizeHuge ) ) ); + TQImage( KIconLoader().iconPath( "amarok", -KIcon::SizeHuge ) ) ); return; } @@ -1694,30 +1694,30 @@ Playlist::activate( QListViewItem *item ) #undef item } -QPair Playlist::toolTipText( QWidget*, const QPoint &pos ) const +QPair Playlist::toolTipText( TQWidget*, const TQPoint &pos ) const { PlaylistItem *item = static_cast( itemAt( pos ) ); if( !item ) - return QPair( QString::null, QRect() ); + return QPair( TQString::null, TQRect() ); - const QPoint contentsPos = viewportToContents( pos ); + const TQPoint contentsPos = viewportToContents( pos ); const int col = header()->sectionAt( contentsPos.x() ); if( item == m_renameItem && col == m_renameColumn ) - return QPair( QString::null, QRect() ); + return QPair( TQString::null, TQRect() ); - QString text; + TQString text; if( col == PlaylistItem::Rating ) text = item->ratingDescription( item->rating() ); else text = item->text( col ); - QRect irect = itemRect( item ); + TQRect irect = itemRect( item ); const int headerPos = header()->sectionPos( col ); irect.setLeft( headerPos - 1 ); irect.setRight( headerPos + header()->sectionSize( col ) ); - static QFont f; + static TQFont f; static int minbearing = 1337 + 666; //can be 0 or negative, 2003 is less likely if( minbearing == 2003 || f != font() ) { @@ -1737,11 +1737,11 @@ QPair Playlist::toolTipText( QWidget*, const QPoint &pos ) const } if( col != PlaylistItem::Rating && fontMetrics().width( text ) <= itemWidth ) - return QPair( QString::null, QRect() ); + return QPair( TQString::null, TQRect() ); - QRect globalRect( viewport()->mapToGlobal( irect.topLeft() ), irect.size() ); - QSimpleRichText t( text, font() ); - int dright = QApplication::desktop()->screenGeometry( qscrollview() ).topRight().x(); + TQRect globalRect( viewport()->mapToGlobal( irect.topLeft() ), irect.size() ); + TQSimpleRichText t( text, font() ); + int dright = TQApplication::desktop()->screenGeometry( qscrollview() ).topRight().x(); t.setWidth( dright - globalRect.left() ); if( col == PlaylistItem::Rating ) globalRect.setRight( kMin( dright, kMax( globalRect.left() + t.widthUsed(), globalRect.left() + ( StarManager::instance()->getGreyStar()->width() + 1 ) * ( ( item->rating() + 1 ) / 2 ) ) ) ); @@ -1755,19 +1755,19 @@ QPair Playlist::toolTipText( QWidget*, const QPoint &pos ) const text = text.replace( "&", "&" ).replace( "<", "<" ).replace( ">", ">" ); if( item->isCurrent() ) { - text = QString("%1").arg( text ); + text = TQString("%1").arg( text ); Amarok::ToolTip::s_hack = 1; //HACK for precise positioning } - return QPair( text, globalRect ); + return QPair( text, globalRect ); } - return QPair( QString::null, QRect() ); + return QPair( TQString::null, TQRect() ); } void Playlist::activateByIndex( int index ) { - QListViewItem* item = itemAtIndex( index ); + TQListViewItem* item = itemAtIndex( index ); if ( item ) activate(item); @@ -1836,7 +1836,7 @@ Playlist::setCurrentTrack( PlaylistItem *item ) prev->invalidateHeight(); prev->setup(); //remove pixmap in first column - prev->setPixmap( m_firstColumn, QPixmap() ); + prev->setPixmap( m_firstColumn, TQPixmap() ); } updateNextPrev(); @@ -1871,7 +1871,7 @@ BundleList Playlist::nextTracks() const { BundleList list; - for( QPtrListIterator it( m_nextTracks ); *it; ++it ) + for( TQPtrListIterator it( m_nextTracks ); *it; ++it ) list << (**it); return list; } @@ -1915,7 +1915,7 @@ Playlist::setCurrentTrackPixmap( int state ) if( !m_currentTrack ) return; - QString pixmap = QString::null; + TQString pixmap = TQString::null; if( state < 0 ) state = EngineController::engine()->state(); @@ -1925,7 +1925,7 @@ Playlist::setCurrentTrackPixmap( int state ) else if( state == Engine::Playing ) pixmap = "currenttrack_play"; - m_currentTrack->setPixmap( m_firstColumn, pixmap.isNull() ? QPixmap() : Amarok::getPNG( pixmap ) ); + m_currentTrack->setPixmap( m_firstColumn, pixmap.isNull() ? TQPixmap() : Amarok::getPNG( pixmap ) ); PlaylistItem::setPixmapChanged(); } @@ -1961,7 +1961,7 @@ Playlist::countChanged() if( !m_itemCountDirty ) { m_itemCountDirty = true; - QTimer::singleShot( 0, this, SLOT( slotCountChanged() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( slotCountChanged() ) ); } } @@ -2024,7 +2024,7 @@ Playlist::engineNewMetaData( const MetaBundle &bundle, bool trackChanged ) //we do it because often the stream title is from the pls file and is informative //we don't want to lose it when we get the meta data else if ( m_currentTrack->artist().isEmpty() ) { - QString comment = m_currentTrack->title(); + TQString comment = m_currentTrack->title(); m_currentTrack->copyFrom( bundle ); m_currentTrack->setComment( comment ); } @@ -2077,7 +2077,7 @@ Playlist::engineStateChanged( Engine::State state, Engine::State /*oldState*/ ) if ( m_currentTrack ) { //remove pixmap in all columns - QPixmap null; + TQPixmap null; for( int i = 0; i < header()->count(); i++ ) m_currentTrack->setPixmap( i, null ); @@ -2104,7 +2104,7 @@ Playlist::engineStateChanged( Engine::State state, Engine::State /*oldState*/ ) //////////////////////////////////////////////////////////////////////////////// void -Playlist::appendMedia( const QString &path ) +Playlist::appendMedia( const TQString &path ) { appendMedia( KURL::fromPathOrURL( path ) ); } @@ -2158,7 +2158,7 @@ Playlist::clear() //SLOT } /** - * Workaround for Qt 3.3.5 bug in QListView::clear() + * Workaround for Qt 3.3.5 bug in TQListView::clear() * @see http://lists.kde.org/?l=kde-devel&m=113113845120155&w=2 * @see BUG 116004 */ @@ -2175,8 +2175,8 @@ Playlist::safeClear() blockSignals( true ); clearSelection(); - QListViewItem *c = firstChild(); - QListViewItem *n; + TQListViewItem *c = firstChild(); + TQListViewItem *n; while( c ) { n = c->nextSibling(); if ( !static_cast( c )->isEmpty() ) //avoid deleting markers @@ -2216,7 +2216,7 @@ Playlist::setColumnWidth( int col, int width ) } void -Playlist::rename( QListViewItem *item, int column ) //SLOT +Playlist::rename( TQListViewItem *item, int column ) //SLOT { if( !item ) return; @@ -2266,21 +2266,21 @@ Playlist::rename( QListViewItem *item, int column ) //SLOT } void -Playlist::writeTag( QListViewItem *qitem, const QString &, int column ) //SLOT +Playlist::writeTag( TQListViewItem *qitem, const TQString &, int column ) //SLOT { const bool dynamicEnabled = static_cast(qitem)->isDynamicEnabled(); if( m_itemsToChangeTagsFor.isEmpty() ) m_itemsToChangeTagsFor.append( static_cast( qitem ) ); - const QString newTag = static_cast( qitem )->exactText( column ); + const TQString newTag = static_cast( qitem )->exactText( column ); for( PlaylistItem *item = m_itemsToChangeTagsFor.first(); item; item = m_itemsToChangeTagsFor.next() ) { if( !checkFileStatus( item ) ) continue; - const QString oldTag = item == qitem ? m_editOldTag : item->exactText(column); + const TQString oldTag = item == qitem ? m_editOldTag : item->exactText(column); if( column == PlaylistItem::Score ) CollectionDB::instance()->setSongPercentage( item->url().path(), newTag.toInt() ); @@ -2300,7 +2300,7 @@ Playlist::writeTag( QListViewItem *qitem, const QString &, int column ) //SLOT static_cast(qitem)->setDynamicEnabled( dynamicEnabled ); m_itemsToChangeTagsFor.clear(); - m_editOldTag = QString::null; + m_editOldTag = TQString::null; } void @@ -2319,21 +2319,21 @@ Playlist::columnOrderChanged() //SLOT //force redraw of currentTrack if( m_currentTrack ) { - m_currentTrack->setPixmap( prevColumn, QPixmap() ); + m_currentTrack->setPixmap( prevColumn, TQPixmap() ); setCurrentTrackPixmap(); } - QResizeEvent e( size(), QSize() ); + TQResizeEvent e( size(), TQSize() ); viewportResizeEvent( &e ); emit columnsChanged(); } void -Playlist::paletteChange( const QPalette &p ) +Playlist::paletteChange( const TQPalette &p ) { using namespace Glow; - QColor fg; - QColor bg; + TQColor fg; + TQColor bg; { using namespace Base; @@ -2376,11 +2376,11 @@ Playlist::paletteChange( const QPalette &p ) } void -Playlist::contentsDragEnterEvent( QDragEnterEvent *e ) +Playlist::contentsDragEnterEvent( TQDragEnterEvent *e ) { - QString data; - QCString subtype; - QTextDrag::decode( e, data, subtype ); + TQString data; + TQCString subtype; + TQTextDrag::decode( e, data, subtype ); e->accept( e->source() == viewport() || @@ -2390,7 +2390,7 @@ Playlist::contentsDragEnterEvent( QDragEnterEvent *e ) } void -Playlist::contentsDragMoveEvent( QDragMoveEvent* e ) +Playlist::contentsDragMoveEvent( TQDragMoveEvent* e ) { if( !e->isAccepted() ) return; @@ -2401,8 +2401,8 @@ Playlist::contentsDragMoveEvent( QDragMoveEvent* e ) #endif //Get the closest item _before_ the cursor - const QPoint p = contentsToViewport( e->pos() ); - QListViewItem *item = itemAt( p ); + const TQPoint p = contentsToViewport( e->pos() ); + TQListViewItem *item = itemAt( p ); if( !item || ctrlPressed ) item = lastItem(); else if( p.y() - itemRect( item ).top() < (item->height()/2) ) item = item->itemAbove(); @@ -2415,19 +2415,19 @@ Playlist::contentsDragMoveEvent( QDragMoveEvent* e ) } void -Playlist::contentsDragLeaveEvent( QDragLeaveEvent* ) +Playlist::contentsDragLeaveEvent( TQDragLeaveEvent* ) { slotEraseMarker(); } void -Playlist::contentsDropEvent( QDropEvent *e ) +Playlist::contentsDropEvent( TQDropEvent *e ) { DEBUG_BLOCK //NOTE parent is always 0 currently, but we support it in case we start using trees - QListViewItem *parent = 0; - QListViewItem *after = m_marker; + TQListViewItem *parent = 0; + TQListViewItem *after = m_marker; //make sure to disable only if in dynamic mode and you're inserting //at the beginning or in the middle of the disabled tracks @@ -2455,10 +2455,10 @@ Playlist::contentsDropEvent( QDropEvent *e ) if ( e->source() == viewport() ) { setSorting( NO_SORT ); //disableSorting and saveState() movableDropEvent( parent, after ); - QPtrList items = selectedItems(); + TQPtrList items = selectedItems(); if( dynamicMode() && after ) { - QListViewItem *item; + TQListViewItem *item; bool enabled = static_cast(after)->isDynamicEnabled(); for( item = items.first(); item; item = items.next() ) static_cast(item)->setDynamicEnabled( enabled ); @@ -2467,15 +2467,15 @@ Playlist::contentsDropEvent( QDropEvent *e ) } else { - QString data; - QCString subtype; - QTextDrag::decode( e, data, subtype ); + TQString data; + TQCString subtype; + TQTextDrag::decode( e, data, subtype ); - debug() << "QTextDrag::subtype(): " << subtype << endl; + debug() << "TQTextDrag::subtype(): " << subtype << endl; if( subtype == "amarok-sql" ) { setSorting( NO_SORT ); - QString query = data.section( "\n", 1 ); + TQString query = data.section( "\n", 1 ); ThreadManager::instance()->queueJob( new SqlLoader( query, after ) ); ScriptManager::instance()->notifyPlaylistChange("changed"); } @@ -2502,7 +2502,7 @@ Playlist::contentsDropEvent( QDropEvent *e ) updateNextPrev(); } -QDragObject* +TQDragObject* Playlist::dragObject() { DEBUG_THREAD_FUNC_INFO @@ -2518,25 +2518,25 @@ Playlist::dragObject() KURLDrag *drag = new KURLDrag( list, viewport() ); drag->setPixmap( CollectionDB::createDragPixmap( list ), - QPoint( CollectionDB::DRAGPIXMAP_OFFSET_X, CollectionDB::DRAGPIXMAP_OFFSET_Y ) ); + TQPoint( CollectionDB::DRAGPIXMAP_OFFSET_X, CollectionDB::DRAGPIXMAP_OFFSET_Y ) ); return drag; } -#include +#include void -Playlist::viewportPaintEvent( QPaintEvent *e ) +Playlist::viewportPaintEvent( TQPaintEvent *e ) { if( e ) KListView::viewportPaintEvent( e ); //we call with 0 in contentsDropEvent() if ( m_marker ) { - QPainter p( viewport() ); + TQPainter p( viewport() ); p.fillRect( drawDropVisualizer( 0, 0, m_marker ), - QBrush( colorGroup().highlight().dark(), QBrush::Dense4Pattern ) ); + TQBrush( colorGroup().highlight().dark(), TQBrush::Dense4Pattern ) ); } else if( m_showHelp && isEmpty() ) { - QPainter p( viewport() ); - QString minimumText(i18n( + TQPainter p( viewport() ); + TQString minimumText(i18n( "
    " "

    The Playlist

    " "This is the playlist. " @@ -2544,19 +2544,19 @@ Playlist::viewportPaintEvent( QPaintEvent *e ) "drag tracks from the browser-panels on the left, " "drop them here and then double-click them to start playback." "
    " ) ); - QSimpleRichText *t = new QSimpleRichText( minimumText + + TQSimpleRichText *t = new TQSimpleRichText( minimumText + i18n( "
    " "

    The Browsers

    " "The browsers are the source of all your music. " "The collection-browser holds your collection. " "The playlist-browser holds your pre-set playlistings. " "The file-browser shows a file-selector which you can use to access any music on your computer. " - "
    " ), QApplication::font() ); + "" ), TQApplication::font() ); if ( t->width()+30 >= viewport()->width() || t->height()+30 >= viewport()->height() ) { // too big for the window, so let's cut part of the text delete t; - t = new QSimpleRichText( minimumText, QApplication::font()); + t = new TQSimpleRichText( minimumText, TQApplication::font()); if ( t->width()+30 >= viewport()->width() || t->height()+30 >= viewport()->height() ) { //still too big, giving up delete t; @@ -2571,7 +2571,7 @@ Playlist::viewportPaintEvent( QPaintEvent *e ) p.setBrush( colorGroup().background() ); p.drawRoundRect( x, y, w+30, h+30, (8*200)/w, (8*200)/h ); - t->draw( &p, x+15, y+15, QRect(), colorGroup() ); + t->draw( &p, x+15, y+15, TQRect(), colorGroup() ); delete t; } } @@ -2579,7 +2579,7 @@ Playlist::viewportPaintEvent( QPaintEvent *e ) static uint negativeWidth = 0; void -Playlist::viewportResizeEvent( QResizeEvent *e ) +Playlist::viewportResizeEvent( TQResizeEvent *e ) { if ( !m_smartResizing ) { KListView::viewportResizeEvent( e ); @@ -2717,19 +2717,19 @@ Playlist::columnResizeEvent( int col, int oldw, int neww ) //we have to do this after we have established negativeWidth and set the columnFractions if( neww == 0 || oldw == 0 ) { //then this column has been inserted or removed, we need to update all the column widths - QResizeEvent e( size(), QSize() ); + TQResizeEvent e( size(), TQSize() ); viewportResizeEvent( &e ); emit columnsChanged(); } } bool -Playlist::eventFilter( QObject *o, QEvent *e ) +Playlist::eventFilter( TQObject *o, TQEvent *e ) { - #define me static_cast(e) - #define ke static_cast(e) + #define me static_cast(e) + #define ke static_cast(e) - if( o == header() && e->type() == QEvent::MouseButtonPress && me->button() == Qt::RightButton ) + if( o == header() && e->type() == TQEvent::MouseButtonPress && me->button() == Qt::RightButton ) { enum { HIDE = 1000, SELECT, CUSTOM, SMARTRESIZING }; @@ -2754,13 +2754,13 @@ Playlist::eventFilter( QObject *o, QEvent *e ) popup.insertItem( i18n("&Fit to Width"), SMARTRESIZING ); popup.setItemChecked( SMARTRESIZING, m_smartResizing ); - int col = popup.exec( static_cast(e)->globalPos() ); + int col = popup.exec( static_cast(e)->globalPos() ); switch( col ) { case HIDE: { hideColumn( mouseOverColumn ); - QResizeEvent e( size(), QSize() ); + TQResizeEvent e( size(), TQSize() ); viewportResizeEvent( &e ); } break; @@ -2795,7 +2795,7 @@ Playlist::eventFilter( QObject *o, QEvent *e ) } // not in slotMouseButtonPressed because we need to disable normal usage. - if( o == viewport() && e->type() == QEvent::MouseButtonPress && me->state() == Qt::ControlButton && me->button() == RightButton ) + if( o == viewport() && e->type() == TQEvent::MouseButtonPress && me->state() == Qt::ControlButton && me->button() == RightButton ) { PlaylistItem *item = static_cast( itemAt( me->pos() ) ); @@ -2810,7 +2810,7 @@ Playlist::eventFilter( QObject *o, QEvent *e ) } // trigger in-place tag editing - else if( o == viewport() && e->type() == QEvent::MouseButtonPress && me->button() == LeftButton ) + else if( o == viewport() && e->type() == TQEvent::MouseButtonPress && me->button() == LeftButton ) { m_clicktimer->stop(); m_itemToRename = 0; @@ -2833,7 +2833,7 @@ Playlist::eventFilter( QObject *o, QEvent *e ) } } - else if( o == viewport() && e->type() == QEvent::MouseButtonRelease && me->button() == LeftButton ) + else if( o == viewport() && e->type() == TQEvent::MouseButtonRelease && me->button() == LeftButton ) { int col = header()->sectionAt( viewportToContents( me->pos() ).x() ); if( col != PlaylistItem::Rating ) @@ -2841,7 +2841,7 @@ Playlist::eventFilter( QObject *o, QEvent *e ) PlaylistItem *item = static_cast( itemAt( me->pos() ) ); if( item == m_itemToRename && me->pos() == m_clickPos ) { - m_clicktimer->start( int( QApplication::doubleClickInterval() ), true ); + m_clicktimer->start( int( TQApplication::doubleClickInterval() ), true ); return true; } else @@ -2852,14 +2852,14 @@ Playlist::eventFilter( QObject *o, QEvent *e ) } // avoid in-place tag editing upon double-clicks - else if( e->type() == QEvent::MouseButtonDblClick && me->button() == Qt::LeftButton ) + else if( e->type() == TQEvent::MouseButtonDblClick && me->button() == Qt::LeftButton ) { m_itemToRename = 0; m_clicktimer->stop(); } // Toggle play/pause if user middle-clicks on current track - else if( o == viewport() && e->type() == QEvent::MouseButtonPress && me->button() == MidButton ) + else if( o == viewport() && e->type() == TQEvent::MouseButtonPress && me->button() == MidButton ) { PlaylistItem *item = static_cast( itemAt( me->pos() ) ); @@ -2870,7 +2870,7 @@ Playlist::eventFilter( QObject *o, QEvent *e ) } } - else if( o == renameLineEdit() && e->type() == 6 /*QEvent::KeyPress*/ && m_renameItem ) + else if( o == renameLineEdit() && e->type() == 6 /*TQEvent::KeyPress*/ && m_renameItem ) { const int visibleCols = numVisibleColumns(); int physicalColumn = visibleCols - 1; @@ -2884,7 +2884,7 @@ Playlist::eventFilter( QObject *o, QEvent *e ) } int column = m_renameColumn; - QListViewItem *item = m_renameItem; + TQListViewItem *item = m_renameItem; if( ke->state() & Qt::AltButton ) { @@ -2961,7 +2961,7 @@ Playlist::eventFilter( QObject *o, QEvent *e ) } } - else if( o == renameLineEdit() && ( e->type() == QEvent::Hide || e->type() == QEvent::Close ) ) + else if( o == renameLineEdit() && ( e->type() == TQEvent::Hide || e->type() == TQEvent::Close ) ) { m_renameItem = 0; } @@ -2985,7 +2985,7 @@ Playlist::slotSingleClick() } void -Playlist::customEvent( QCustomEvent *e ) +Playlist::customEvent( TQCustomEvent *e ) { if( e->type() == (int)UrlLoader::JobFinishedEvent ) { refreshNextTracks( 0 ); @@ -3086,11 +3086,11 @@ Playlist::customEvent( QCustomEvent *e ) //////////////////////////////////////////////////////////////////////////////// bool -Playlist::saveM3U( const QString &path, bool relative ) const +Playlist::saveM3U( const TQString &path, bool relative ) const { - QValueList urls; - QValueList titles; - QValueList lengths; + TQValueList urls; + TQValueList titles; + TQValueList lengths; for( MyIt it( firstChild(), MyIt::Visible ); *it; ++it ) { urls << (*it)->url(); @@ -3101,32 +3101,32 @@ Playlist::saveM3U( const QString &path, bool relative ) const } void -Playlist::saveXML( const QString &path ) +Playlist::saveXML( const TQString &path ) { DEBUG_BLOCK - QFile file( path ); + TQFile file( path ); if( !file.open( IO_WriteOnly | IO_Truncate | IO_Raw ) ) return; // Manual buffering since QFile's is slow for whatever reason const uint kWriteSize = 256 * 1024; - QBuffer buffer; + TQBuffer buffer; buffer.open(IO_WriteOnly); - QTextStream stream( &buffer ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &buffer ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); stream << "\n"; - QString dynamic; + TQString dynamic; if( dynamicMode() ) { - const QString title = ( dynamicMode()->title() ).replace( "&", "&" ) + const TQString title = ( dynamicMode()->title() ).replace( "&", "&" ) .replace( "<", "<" ) .replace( ">", ">" ); - dynamic = QString(" dynamicMode=\"%1\"").arg( title ); + dynamic = TQString(" dynamicMode=\"%1\"").arg( title ); } - stream << QString( "\n" ) + stream << TQString( "\n" ) .arg( "Amarok" ).arg( Amarok::xmlVersion() ).arg( dynamic ); for( MyIt it( this, MyIt::All ); *it; ++it ) @@ -3134,12 +3134,12 @@ Playlist::saveXML( const QString &path ) const PlaylistItem *item = *it; if( item->isEmpty() ) continue; // Skip marker items and such - QStringList attributes; + TQStringList attributes; const int queueIndex = m_nextTracks.findRef( item ); if ( queueIndex != -1 ) - attributes << "queue_index" << QString::number( queueIndex + 1 ); + attributes << "queue_index" << TQString::number( queueIndex + 1 ); else if ( item == currentTrack() ) - attributes << "queue_index" << QString::number( 0 ); + attributes << "queue_index" << TQString::number( 0 ); if( !item->isDynamicEnabled() ) attributes << "dynamicdisabled" << "true"; @@ -3166,7 +3166,7 @@ Playlist::burnPlaylist( int projectType ) { KURL::List list; - QListViewItemIterator it( this ); + TQListViewItemIterator it( this ); for( ; it.current(); ++it ) { PlaylistItem *item = static_cast(*it); KURL url = item->url(); @@ -3182,7 +3182,7 @@ Playlist::burnSelectedTracks( int projectType ) { KURL::List list; - QListViewItemIterator it( this, QListViewItemIterator::Selected ); + TQListViewItemIterator it( this, TQListViewItemIterator::Selected ); for( ; it.current(); ++it ) { PlaylistItem *item = static_cast(*it); KURL url = item->url(); @@ -3194,13 +3194,13 @@ Playlist::burnSelectedTracks( int projectType ) } void -Playlist::addCustomMenuItem( const QString &submenu, const QString &itemTitle ) //for dcop +Playlist::addCustomMenuItem( const TQString &submenu, const TQString &itemTitle ) //for dcop { m_customSubmenuItem[submenu] << itemTitle; } bool -Playlist::removeCustomMenuItem( const QString &submenu, const QString &itemTitle ) //for dcop +Playlist::removeCustomMenuItem( const TQString &submenu, const TQString &itemTitle ) //for dcop { if( !m_customSubmenuItem.contains(submenu) ) return false; @@ -3218,8 +3218,8 @@ Playlist::removeCustomMenuItem( const QString &submenu, const QString &itemTitle void Playlist::customMenuClicked(int id) //adapted from burnSelectedTracks { - QString message = m_customIdItem[id]; - QListViewItemIterator it( this, QListViewItemIterator::Selected ); + TQString message = m_customIdItem[id]; + TQListViewItemIterator it( this, TQListViewItemIterator::Selected ); for( ; it.current(); ++it ) { PlaylistItem *item = static_cast(*it); KURL url = item->url().url(); @@ -3318,7 +3318,7 @@ Playlist::repopulate() //SLOT // Repopulate the upcoming tracks MyIt it( this, MyIt::All ); - QPtrList list; + TQPtrList list; for( ; *it; ++it ) { @@ -3337,7 +3337,7 @@ Playlist::repopulate() //SLOT saveUndoState(); //remove the items - for( QListViewItem *item = list.first(); item; item = list.next() ) + for( TQListViewItem *item = list.first(); item; item = list.next() ) { removeItem( static_cast( item ) ); delete item; @@ -3356,7 +3356,7 @@ Playlist::shuffle() //SLOT if( dynamicMode() ) return; - QPtrList list; + TQPtrList list; setSorting( NO_SORT ); @@ -3366,14 +3366,14 @@ Playlist::shuffle() //SLOT // we do it in two steps because the iterator doesn't seem // to like it when we do takeItem and ++it in the same loop - for( QListViewItem *item = list.first(); item; item = list.next() ) + for( TQListViewItem *item = list.first(); item; item = list.next() ) takeItem( item ); //shuffle KRandomSequence( (long)KApplication::random() ).randomize( &list ); //reinsert in new order - for( QListViewItem *item = list.first(); item; item = list.next() ) + for( TQListViewItem *item = list.first(); item; item = list.next() ) insertItem( item ); updateNextPrev(); @@ -3429,16 +3429,16 @@ Playlist::removeSelectedItems() //SLOT //remove the items if( queued.count() ) { - for( QListViewItem *item = queued.first(); item; item = queued.next() ) + for( TQListViewItem *item = queued.first(); item; item = queued.next() ) removeItem( static_cast( item ), true ); emit queueChanged( PLItemList(), queued ); - for( QListViewItem *item = queued.first(); item; item = queued.next() ) + for( TQListViewItem *item = queued.first(); item; item = queued.next() ) delete item; } - for( QListViewItem *item = list.first(); item; item = list.next() ) + for( TQListViewItem *item = list.first(); item; item = list.next() ) { removeItem( static_cast( item ) ); delete item; @@ -3470,7 +3470,7 @@ Playlist::deleteSelectedFiles() //SLOT removeSelectedItems(); foreachType( KURL::List, urls ) CollectionDB::instance()->emitFileDeleted( (*it).path() ); - QTimer::singleShot( 0, CollectionView::instance(), SLOT( renderView() ) ); + TQTimer::singleShot( 0, CollectionView::instance(), TQT_SLOT( renderView() ) ); } } @@ -3479,10 +3479,10 @@ Playlist::removeDuplicates() //SLOT { // Remove dead entries: - for( QListViewItemIterator it( this ); it.current(); ) { + for( TQListViewItemIterator it( this ); it.current(); ) { PlaylistItem* item = static_cast( *it ); const KURL url = item->url(); - if ( url.isLocalFile() && !QFile::exists( url.path() ) ) { + if ( url.isLocalFile() && !TQFile::exists( url.path() ) ) { removeItem( item ); ++it; delete item; @@ -3492,13 +3492,13 @@ Playlist::removeDuplicates() //SLOT // Remove dupes: - QSortedList list; - for( QListViewItemIterator it( this ); it.current(); ++it ) + TQSortedList list; + for( TQListViewItemIterator it( this ); it.current(); ++it ) list.prepend( static_cast( it.current() ) ); list.sort(); - QPtrListIterator it( list ); + TQPtrListIterator it( list ); PlaylistItem *item; while( (item = it.current()) ) { const KURL &compare = item->url(); @@ -3511,7 +3511,7 @@ Playlist::removeDuplicates() //SLOT } void -Playlist::copyToClipboard( const QListViewItem *item ) const //SLOT +Playlist::copyToClipboard( const TQListViewItem *item ) const //SLOT { if( !item ) item = currentTrack(); @@ -3519,18 +3519,18 @@ Playlist::copyToClipboard( const QListViewItem *item ) const //SLOT { const PlaylistItem* playlistItem = static_cast( item ); - QString text = playlistItem->prettyTitle(); + TQString text = playlistItem->prettyTitle(); // For streams add the streamtitle too //TODO make prettyTitle do this if ( playlistItem->url().protocol() == "http" ) text.append( " :: " + playlistItem->url().url() ); // Copy both to clipboard and X11-selection - QApplication::clipboard()->setText( text, QClipboard::Clipboard ); - QApplication::clipboard()->setText( text, QClipboard::Selection ); + TQApplication::clipboard()->setText( text, QClipboard::Clipboard ); + TQApplication::clipboard()->setText( text, QClipboard::Selection ); Amarok::OSD::instance()->OSDWidget::show( i18n( "Copied: %1" ).arg( text ), - QImage(CollectionDB::instance()->albumImage(*playlistItem )) ); + TQImage(CollectionDB::instance()->albumImage(*playlistItem )) ); } } @@ -3581,14 +3581,14 @@ Playlist::showQueueManager() } QueueManager dialog; - if( dialog.exec() == QDialog::Accepted ) + if( dialog.exec() == TQDialog::Accepted ) { changeFromQueueManager(dialog.newQueue()); } } void -Playlist::changeFromQueueManager(QPtrList list) +Playlist::changeFromQueueManager(TQPtrList list) { PLItemList oldQueue = m_nextTracks; m_nextTracks = list; @@ -3612,7 +3612,7 @@ Playlist::changeFromQueueManager(QPtrList list) } void -Playlist::setFilterSlot( const QString &query ) //SLOT +Playlist::setFilterSlot( const TQString &query ) //SLOT { m_filtertimer->stop(); if( m_filter != query ) @@ -3633,7 +3633,7 @@ Playlist::setDelayedFilter() //SLOT } void -Playlist::setFilter( const QString &query ) //SLOT +Playlist::setFilter( const TQString &query ) //SLOT { const bool advanced = ExpressionParser::isAdvancedExpression( query ); MyIt it( this, ( !advanced && query.lower().contains( m_prevfilter.lower() ) ) @@ -3644,13 +3644,13 @@ Playlist::setFilter( const QString &query ) //SLOT if( advanced ) { ParsedExpression parsed = ExpressionParser::parse( query ); - QValueList visible = visibleColumns(); + TQValueList visible = visibleColumns(); for(; *it; ++it ) (*it)->setVisible( (*it)->matchesParsedExpression( parsed, visible ) ); } else { // optimized path - const QStringList terms = QStringList::split( ' ', query.lower() ); + const TQStringList terms = TQStringList::split( ' ', query.lower() ); const MetaBundle::ColumnMask visible = getVisibleColumnMask(); for(; *it; ++it ) { (*it)->setVisible( (*it)->matchesFast(terms, visible)); @@ -3666,7 +3666,7 @@ Playlist::setFilter( const QString &query ) //SLOT } void -Playlist::scoreChanged( const QString &path, float score ) +Playlist::scoreChanged( const TQString &path, float score ) { for( MyIt it( this, MyIt::All ); *it; ++it ) { @@ -3682,7 +3682,7 @@ Playlist::scoreChanged( const QString &path, float score ) } void -Playlist::ratingChanged( const QString &path, int rating ) +Playlist::ratingChanged( const TQString &path, int rating ) { for( MyIt it( this, MyIt::All ); *it; ++it ) { @@ -3696,7 +3696,7 @@ Playlist::ratingChanged( const QString &path, int rating ) } void -Playlist::fileMoved( const QString &srcPath, const QString &dstPath ) +Playlist::fileMoved( const TQString &srcPath, const TQString &dstPath ) { // Make sure the MoodServer gets this signal first! MoodServer::instance()->slotFileMoved( srcPath, dstPath ); @@ -3760,7 +3760,7 @@ Playlist::removeFromPreviousAlbums( PlaylistAlbum *album ) void -Playlist::showContextMenu( QListViewItem *item, const QPoint &p, int col ) //SLOT +Playlist::showContextMenu( TQListViewItem *item, const TQPoint &p, int col ) //SLOT { //if clicked on an empty area enum { REPOPULATE, ENABLEDYNAMIC }; @@ -3800,8 +3800,8 @@ Playlist::showContextMenu( QListViewItem *item, const QPoint &p, int col ) //SLO const bool isPlaying = EngineController::engine()->state() == Engine::Playing; const bool trackColumn = col == PlaylistItem::Track; const bool isLastFm = item->url().protocol() == "lastfm"; - const QString tagName = columnText( col ); - const QString tag = item->text( col ); + const TQString tagName = columnText( col ); + const TQString tag = item->text( col ); uint itemCount = 0; for( MyIt it( this, MyIt::Selected ); *it; ++it ) @@ -3891,7 +3891,7 @@ Playlist::showContextMenu( QListViewItem *item, const QPoint &p, int col ) //SLO popup.insertItem( SmallIconSet( Amarok::icon( "save" ) ), i18n("S&ave as Playlist..."), SAVE_PLAYLIST ); } - popup.insertItem( SmallIconSet( Amarok::icon( "remove_from_playlist" ) ), i18n( "Re&move From Playlist" ), this, SLOT( removeSelectedItems() ), Key_Delete, REMOVE ); + popup.insertItem( SmallIconSet( Amarok::icon( "remove_from_playlist" ) ), i18n( "Re&move From Playlist" ), this, TQT_SLOT( removeSelectedItems() ), Key_Delete, REMOVE ); popup.insertSeparator(); @@ -3905,7 +3905,7 @@ Playlist::showContextMenu( QListViewItem *item, const QPoint &p, int col ) //SLO fileMenu.insertItem( SmallIconSet( "filesaveas" ), i18n("&Copy Track to Collection...", "&Copy %n Tracks to Collection...", itemCount), COPY_TO_COLLECTION ); fileMenu.insertItem( SmallIconSet( "filesaveas" ), i18n("&Move Track to Collection...", "&Move %n Tracks to Collection...", itemCount), MOVE_TO_COLLECTION ); } - fileMenu.insertItem( SmallIconSet( Amarok::icon( "remove" ) ), i18n("&Delete File...", "&Delete %n Selected Files...", itemCount ), this, SLOT( deleteSelectedFiles() ), SHIFT+Key_Delete, DELETE ); + fileMenu.insertItem( SmallIconSet( Amarok::icon( "remove" ) ), i18n("&Delete File...", "&Delete %n Selected Files...", itemCount ), this, TQT_SLOT( deleteSelectedFiles() ), SHIFT+Key_Delete, DELETE ); popup.insertItem( SmallIconSet( Amarok::icon( "files" ) ), i18n("Manage &Files"), &fileMenu, FILE_MENU ); if( itemCount == 1 ) @@ -3938,8 +3938,8 @@ Playlist::showContextMenu( QListViewItem *item, const QPoint &p, int col ) //SLO if( m_customSubmenuItem.count() > 0 ) popup.insertSeparator(); - QValueList submenuTexts = m_customSubmenuItem.keys(); - for( QValueList::Iterator keyIt =submenuTexts.begin(); keyIt != submenuTexts.end(); ++keyIt ) + TQValueList submenuTexts = m_customSubmenuItem.keys(); + for( TQValueList::Iterator keyIt =submenuTexts.begin(); keyIt != submenuTexts.end(); ++keyIt ) { KPopupMenu* menu; if( (*keyIt) == "root") @@ -3961,7 +3961,7 @@ Playlist::showContextMenu( QListViewItem *item, const QPoint &p, int col ) //SLO } } - const QPoint pos( p.x() - popup.sidePixmapWidth(), p.y() + 3 ); + const TQPoint pos( p.x() - popup.sidePixmapWidth(), p.y() + 3 ); int menuItemId = popup.exec( pos ); PLItemList in, out; @@ -3998,7 +3998,7 @@ Playlist::showContextMenu( QListViewItem *item, const QPoint &p, int col ) //SLO break; case EDIT: - // do this because QListView sucks, if track change occurs during + // do this because TQListView sucks, if track change occurs during // an edit event, the rename operation ends, BUT, the list is not // cleared because writeTag is never called. Q/K ListView sucks m_itemsToChangeTagsFor.clear(); @@ -4015,7 +4015,7 @@ Playlist::showContextMenu( QListViewItem *item, const QPoint &p, int col ) //SLO case FILL_DOWN: //Spreadsheet like fill-down { - QString newTag = item->exactText( col ); + TQString newTag = item->exactText( col ); MyIt it( this, MyIt::Selected ); //special handling for track column @@ -4031,7 +4031,7 @@ Playlist::showContextMenu( QListViewItem *item, const QPoint &p, int col ) //SLO for( ; *it; ++it ) { if ( trackColumn ) //special handling for track column - newTag = QString::number( ++trackNo ); + newTag = TQString::number( ++trackNo ); else if ( *it == item ) //skip the one we are copying @@ -4108,7 +4108,7 @@ Playlist::showContextMenu( QListViewItem *item, const QPoint &p, int col ) //SLO { KURL::List list; - for( QListViewItemIterator it( this, QListViewItemIterator::Selected ); + for( TQListViewItemIterator it( this, TQListViewItemIterator::Selected ); it.current(); ++it ) { @@ -4139,7 +4139,7 @@ Playlist::showContextMenu( QListViewItem *item, const QPoint &p, int col ) //SLO //////////////////////////////////////////////////////////////////////////////// void -Playlist::fontChange( const QFont &old ) +Playlist::fontChange( const TQFont &old ) { KListView::fontChange( old ); initStarPixmaps(); @@ -4147,12 +4147,12 @@ Playlist::fontChange( const QFont &old ) } void -Playlist::contentsMouseMoveEvent( QMouseEvent *e ) +Playlist::contentsMouseMoveEvent( TQMouseEvent *e ) { if( e ) KListView::contentsMouseMoveEvent( e ); PlaylistItem *prev = m_hoveredRating; - const QPoint pos = e ? e->pos() : viewportToContents( viewport()->mapFromGlobal( QCursor::pos() ) ); + const TQPoint pos = e ? e->pos() : viewportToContents( viewport()->mapFromGlobal( TQCursor::pos() ) ); PlaylistItem *item = static_cast( itemAt( contentsToViewport( pos ) ) ); if( item && pos.x() > header()->sectionPos( PlaylistItem::Rating ) && @@ -4167,14 +4167,14 @@ Playlist::contentsMouseMoveEvent( QMouseEvent *e ) if( prev ) { if( m_selCount > 1 && prev->isSelected() ) - QScrollView::updateContents( header()->sectionPos( PlaylistItem::Rating ) + 1, contentsY(), + TQScrollView::updateContents( header()->sectionPos( PlaylistItem::Rating ) + 1, contentsY(), header()->sectionSize( PlaylistItem::Rating ) - 2, visibleHeight() ); else prev->updateColumn( PlaylistItem::Rating ); } } -void Playlist::leaveEvent( QEvent *e ) +void Playlist::leaveEvent( TQEvent *e ) { KListView::leaveEvent( e ); @@ -4184,7 +4184,7 @@ void Playlist::leaveEvent( QEvent *e ) prev->updateColumn( PlaylistItem::Rating ); } -void Playlist::contentsMousePressEvent( QMouseEvent *e ) +void Playlist::contentsMousePressEvent( TQMouseEvent *e ) { PlaylistItem *item = static_cast( itemAt( contentsToViewport( e->pos() ) ) ); @@ -4208,12 +4208,12 @@ void Playlist::contentsMousePressEvent( QMouseEvent *e ) KListView::contentsMousePressEvent( e ); } -void Playlist::contentsWheelEvent( QWheelEvent *e ) +void Playlist::contentsWheelEvent( TQWheelEvent *e ) { PlaylistItem* const item = static_cast( itemAt( contentsToViewport( e->pos() ) ) ); const int column = header()->sectionAt( e->pos().x() ); const int distance = header()->sectionPos( column ) + header()->sectionSize( column ) - e->pos().x(); - const int maxdistance = fontMetrics().width( QString::number( m_nextTracks.count() ) ) + 7; + const int maxdistance = fontMetrics().width( TQString::number( m_nextTracks.count() ) ) + 7; if( item && column == m_firstColumn && distance <= maxdistance && item->isQueued() ) { const int n = e->delta() / 120, @@ -4281,9 +4281,9 @@ Playlist::numVisibleColumns() const return r; } -QValueList Playlist::visibleColumns() const +TQValueList Playlist::visibleColumns() const { - QValueList r; + TQValueList r; for( int i = 0, n = columns(); i < n; ++i) if( columnWidth( i ) ) r.append( i ); @@ -4324,7 +4324,7 @@ Playlist::mapToLogicalColumn( int physical ) const } void -Playlist::setColumns( QValueList order, QValueList visible ) +Playlist::setColumns( TQValueList order, TQValueList visible ) { for( int i = order.count() - 1; i >= 0; --i ) header()->moveSection( order[i], i ); @@ -4346,7 +4346,7 @@ Playlist::removeItem( PlaylistItem *item, bool multi ) // a lock() check, (currently...) //this function ensures we don't have dangling pointers to items that are about to be removed - //for some reason using QListView::takeItem() and QListViewItem::takeItem() was ineffective + //for some reason using TQListView::takeItem() and TQListViewItem::takeItem() was ineffective //NOTE we don't delete item for you! You must call delete item yourself :) //TODO there must be a way to do this without requiring notification from the item dtor! @@ -4397,20 +4397,20 @@ Playlist::removeItem( PlaylistItem *item, bool multi ) updateNextPrev(); } -void Playlist::ensureItemCentered( QListViewItem *item ) +void Playlist::ensureItemCentered( TQListViewItem *item ) { if( !item ) return; //HACK -- apparently the various metrics aren't reliable while the UI is still updating & stuff m_itemToReallyCenter = item; - QTimer::singleShot( 0, this, SLOT( reallyEnsureItemCentered() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( reallyEnsureItemCentered() ) ); } void Playlist::reallyEnsureItemCentered() { - if( QListViewItem *item = m_itemToReallyCenter ) + if( TQListViewItem *item = m_itemToReallyCenter ) { m_itemToReallyCenter = 0; if( m_selCount == 1 ) @@ -4456,7 +4456,7 @@ Playlist::saveUndoState() //SLOT } bool -Playlist::saveState( QStringList &list ) +Playlist::saveState( TQStringList &list ) { //used by undo system, save state of playlist to undo/redo list @@ -4464,7 +4464,7 @@ Playlist::saveState( QStringList &list ) //if you must change this, fix undo/redo first. Ask me what needs fixing if( !isEmpty() ) { - QString fileName; + TQString fileName; m_undoCounter %= AmarokConfig::undoLevels(); fileName.setNum( m_undoCounter++ ); fileName.prepend( m_undoDir.absPath() + '/' ); @@ -4494,7 +4494,7 @@ Playlist::saveState( QStringList &list ) } void -Playlist::switchState( QStringList &loadFromMe, QStringList &saveToMe ) +Playlist::switchState( TQStringList &loadFromMe, TQStringList &saveToMe ) { m_undoDirt = true; //switch to a previously saved state, remember current state @@ -4533,7 +4533,7 @@ Playlist::saveSelectedAsPlaylist() MyIt it( this, MyIt::Visible | MyIt::Selected ); if( !(*it) ) return; //safety - const QString album = (*it)->album(), + const TQString album = (*it)->album(), artist = (*it)->artist(); int suggestion = !album.stripWhiteSpace().isEmpty() ? 1 : !artist.stripWhiteSpace().isEmpty() ? 2 : 3; while( *it ) @@ -4546,16 +4546,16 @@ Playlist::saveSelectedAsPlaylist() break; ++it; } - QString path = PlaylistDialog::getSaveFileName( suggestion == 1 ? album + TQString path = PlaylistDialog::getSaveFileName( suggestion == 1 ? album : suggestion == 2 ? artist : i18n( "Untitled" ) ); if( path.isEmpty() ) return; - QValueList urls; - QValueList titles; - QValueList lengths; + TQValueList urls; + TQValueList titles; + TQValueList lengths; for( it = MyIt( this, MyIt::Visible | MyIt::Selected ); *it; ++it ) { urls << (*it)->url(); @@ -4573,13 +4573,13 @@ void Playlist::initStarPixmaps() } void -Playlist::slotMouseButtonPressed( int button, QListViewItem *after, const QPoint &p, int col ) //SLOT +Playlist::slotMouseButtonPressed( int button, TQListViewItem *after, const TQPoint &p, int col ) //SLOT { switch( button ) { case Qt::MidButton: { - const QString path = QApplication::clipboard()->text( QClipboard::Selection ); + const TQString path = TQApplication::clipboard()->text( QClipboard::Selection ); const KURL url = KURL::fromPathOrURL( path ); if( url.isValid() ) @@ -4600,13 +4600,13 @@ Playlist::slotMouseButtonPressed( int button, QListViewItem *after, const QPoint void Playlist::slotContentsMoving() { Amarok::ToolTip::hideTips(); - QTimer::singleShot( 0, this, SLOT( contentsMouseMoveEvent() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( contentsMouseMoveEvent() ) ); } void Playlist::slotQueueChanged( const PLItemList &/*in*/, const PLItemList &out) { - for( QPtrListIterator it( out ); *it; ++it ) + for( TQPtrListIterator it( out ); *it; ++it ) (*it)->update(); refreshNextTracks( 0 ); updateNextPrev(); @@ -4671,12 +4671,12 @@ Playlist::slotGlowTimer() //SLOT { using namespace Base; PlaylistItem::glowIntensity = d; - PlaylistItem::glowBase = QColor( r, g, b ); + PlaylistItem::glowBase = TQColor( r, g, b ); } { using namespace Text; - PlaylistItem::glowText = QColor( r + int(d*dr), g + int(d*dg), b + int(d*db) ); + PlaylistItem::glowText = TQColor( r + int(d*dr), g + int(d*dg), b + int(d*db) ); } if( currentTrack() ) @@ -4698,14 +4698,14 @@ Playlist::slotEraseMarker() //SLOT { if( m_marker ) { - const QRect spot = drawDropVisualizer( 0, 0, m_marker ); + const TQRect spot = drawDropVisualizer( 0, 0, m_marker ); m_marker = 0; viewport()->repaint( spot, false ); } } void -Playlist::showTagDialog( QPtrList items ) +Playlist::showTagDialog( TQPtrList items ) { /// the tag dialog was once modal, because we thought that damage would occur /// when passing playlist items into the editor and it was removed from the playlist. @@ -4745,7 +4745,7 @@ Playlist::showTagDialog( QPtrList items ) else { //edit multiple tracks in tag dialog KURL::List urls; - for( QListViewItem *item = items.first(); item; item = items.next() ) + for( TQListViewItem *item = items.first(); item; item = items.next() ) if ( item->isVisible() ) urls << static_cast( item )->url(); @@ -4759,10 +4759,10 @@ Playlist::showTagDialog( QPtrList items ) #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include //usleep() // Moved outside the only function that uses it because @@ -4770,26 +4770,26 @@ Playlist::showTagDialog( QPtrList items ) class CustomColumnDialog : public KDialog { public: - CustomColumnDialog( QWidget *parent ) + CustomColumnDialog( TQWidget *parent ) : KDialog( parent ) { - QLabel *textLabel1, *textLabel2, *textLabel3; - QLineEdit *lineEdit1, *lineEdit2; - QGroupBox *groupBox1; + TQLabel *textLabel1, *textLabel2, *textLabel3; + TQLineEdit *lineEdit1, *lineEdit2; + TQGroupBox *groupBox1; - textLabel1 = new QLabel( i18n( + textLabel1 = new TQLabel( i18n( "

    You can create a custom column that runs a shell command against each item in the playlist. " "The shell command is run as the user nobody, this is for security reasons.\n" "

    You can only run the command against local files for the time being. " "The fullpath is inserted at the position %f in the string. " "If you do not specify %f it is appended." ), this ); - textLabel2 = new QLabel( i18n( "Column &name:" ), this ); - textLabel3 = new QLabel( i18n( "&Command:" ), this ); + textLabel2 = new TQLabel( i18n( "Column &name:" ), this ); + textLabel3 = new TQLabel( i18n( "&Command:" ), this ); - lineEdit1 = new QLineEdit( this, "ColumnName" ); - lineEdit2 = new QLineEdit( this, "Command" ); + lineEdit1 = new TQLineEdit( this, "ColumnName" ); + lineEdit2 = new TQLineEdit( this, "Command" ); - groupBox1 = new QGroupBox( 1, Qt::Vertical, i18n( "Examples" ), this ); + groupBox1 = new TQGroupBox( 1, Qt::Vertical, i18n( "Examples" ), this ); groupBox1->layout()->setMargin( 11 ); new KActiveLabel( i18n( "file --brief %f\n" "ls -sh %f\n" "basename %f\n" "dirname %f" ), groupBox1 ); @@ -4798,23 +4798,23 @@ Playlist::showTagDialog( QPtrList items ) textLabel3->setBuddy( lineEdit2 ); // layouts - QHBoxLayout *layout1 = new QHBoxLayout( 0, 0, 6 ); - layout1->addItem( new QSpacerItem( 181, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); + TQHBoxLayout *layout1 = new TQHBoxLayout( 0, 0, 6 ); + layout1->addItem( new TQSpacerItem( 181, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ) ); layout1->addWidget( new KPushButton( KStdGuiItem::ok(), this, "OkButton" ) ); layout1->addWidget( new KPushButton( KStdGuiItem::cancel(), this, "CancelButton" ) ); - QGridLayout *layout2 = new QGridLayout( 0, 2, 2, 0, 6 ); - layout2->QLayout::add( textLabel2 ); - layout2->QLayout::add( lineEdit1 ); - layout2->QLayout::add( textLabel3 ); - layout2->QLayout::add( lineEdit2 ); + TQGridLayout *layout2 = new TQGridLayout( 0, 2, 2, 0, 6 ); + layout2->TQLayout::add( textLabel2 ); + layout2->TQLayout::add( lineEdit1 ); + layout2->TQLayout::add( textLabel3 ); + layout2->TQLayout::add( lineEdit2 ); - QVBoxLayout *Form1Layout = new QVBoxLayout( this, 11, 6, "Form1Layout"); + TQVBoxLayout *Form1Layout = new TQVBoxLayout( this, 11, 6, "Form1Layout"); Form1Layout->addWidget( textLabel1 ); Form1Layout->addWidget( groupBox1 ); Form1Layout->addLayout( layout2 ); Form1Layout->addLayout( layout1 ); - Form1Layout->addItem( new QSpacerItem( 20, 231, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); + Form1Layout->addItem( new TQSpacerItem( 20, 231, TQSizePolicy::Minimum, TQSizePolicy::Expanding ) ); // properties setCaption( i18n("Add Custom Column") ); @@ -4822,16 +4822,16 @@ Playlist::showTagDialog( QPtrList items ) // connects connect( child( "OkButton" ), - SIGNAL(clicked()), - SLOT(accept()) ); + TQT_SIGNAL(clicked()), + TQT_SLOT(accept()) ); connect( child( "CancelButton" ), - SIGNAL(clicked()), - SLOT(reject()) ); + TQT_SIGNAL(clicked()), + TQT_SLOT(reject()) ); } - QString command() { return static_cast(child("Command"))->text(); } - QString name() { return static_cast(child("ColumnName"))->text(); } + TQString command() { return static_cast(child("Command"))->text(); } + TQString name() { return static_cast(child("ColumnName"))->text(); } }; void @@ -4839,11 +4839,11 @@ Playlist::addCustomColumn() { CustomColumnDialog dialog( this ); - if ( dialog.exec() == QDialog::Accepted ) { + if ( dialog.exec() == TQDialog::Accepted ) { const int index = addColumn( dialog.name(), 100 ); - QStringList args = QStringList::split( ' ', dialog.command() ); + TQStringList args = TQStringList::split( ' ', dialog.command() ); - QStringList::Iterator pcf = args.find( "%f" ); + TQStringList::Iterator pcf = args.find( "%f" ); if ( pcf == args.end() ) { //there is no %f, so add one on the end //TODO prolly this is confusing, instead ask the user if we should add one @@ -4866,7 +4866,7 @@ Playlist::addCustomColumn() debug() << args << endl; - QProcess p( args ); + TQProcess p( args ); for( p.start(); p.isRunning(); /*kapp->processEvents()*/ ) ::usleep( 5000 ); @@ -4878,7 +4878,7 @@ Playlist::addCustomColumn() #include #include -TagWriter::TagWriter( PlaylistItem *item, const QString &oldTag, const QString &newTag, const int col, const bool updateView ) +TagWriter::TagWriter( PlaylistItem *item, const TQString &oldTag, const TQString &newTag, const int col, const bool updateView ) : ThreadManager::Job( "TagWriter" ) , m_item( item ) , m_failed( true ) diff --git a/amarok/src/playlist.h b/amarok/src/playlist.h index c7c1dd49..0162a8ca 100644 --- a/amarok/src/playlist.h +++ b/amarok/src/playlist.h @@ -33,10 +33,10 @@ #include //baseclass #include //KURL::List -#include //stack allocated -#include //stack allocated -#include //stack allocated -#include //stack allocated +#include //stack allocated +#include //stack allocated +#include //stack allocated +#include //stack allocated #include //stack allocated class KAction; @@ -46,9 +46,9 @@ class PlaylistEntry; class PlaylistLoader; class PlaylistAlbum; class TagWriter; -class QBoxLayout; -class QLabel; -class QTimer; +class TQBoxLayout; +class TQLabel; +class TQTimer; class Medium; @@ -60,7 +60,7 @@ class Medium; * was necessary as it is too dangerous to allow public access to PlaylistItems * due to the multi-threading environment. * - * Unfortunately, since QObject is now inaccessible you have to connect slots + * Unfortunately, since TQObject is now inaccessible you have to connect slots * via one of PlaylistWindow's friend members or in Playlist * * If you want to add new playlist type functionality you should implement it @@ -84,7 +84,7 @@ class Playlist : private KListView, public EngineObserver, public Amarok::ToolTi ~Playlist(); LIBAMAROK_EXPORT static Playlist *instance() { return s_instance; } - static QString defaultPlaylistPath(); + static TQString defaultPlaylistPath(); static const int NO_SORT = 200; static const int Append = 1; /// inserts media after the last item in the playlist @@ -98,16 +98,16 @@ class Playlist : private KListView, public EngineObserver, public Amarok::ToolTi static const int DefaultOptions = Append | Unique | StartPlay; // it's really just the *ListView parts we want to hide... - QScrollView *qscrollview() const + TQScrollView *qscrollview() const { - return reinterpret_cast( const_cast( this ) ); + return reinterpret_cast( const_cast( this ) ); } /** Add media to the playlist * @param options you can OR these together, see the enum * @param sql Sql program to execute */ LIBAMAROK_EXPORT void insertMedia( const KURL::List &, int options = Append ); - void insertMediaSql( const QString& sql, int options = Append ); + void insertMediaSql( const TQString& sql, int options = Append ); // Dynamic mode functions void addDynamicModeTracks( uint songCount ); @@ -123,12 +123,12 @@ class Playlist : private KListView, public EngineObserver, public Amarok::ToolTi LIBAMAROK_EXPORT bool isTrackBefore() const; LIBAMAROK_EXPORT bool isTrackAfter() const; void restoreSession(); // called during initialisation - void setPlaylistName( const QString &name, bool proposeOverwriting = false ) { m_playlistName = name; m_proposeOverwriting = proposeOverwriting; } - void proposePlaylistName( const QString &name, bool proposeOverwriting = false ) { if( isEmpty() || m_playlistName==i18n("Untitled") ) m_playlistName = name; m_proposeOverwriting = proposeOverwriting; } - const QString &playlistName() const { return m_playlistName; } + void setPlaylistName( const TQString &name, bool proposeOverwriting = false ) { m_playlistName = name; m_proposeOverwriting = proposeOverwriting; } + void proposePlaylistName( const TQString &name, bool proposeOverwriting = false ) { if( isEmpty() || m_playlistName==i18n("Untitled") ) m_playlistName = name; m_proposeOverwriting = proposeOverwriting; } + const TQString &playlistName() const { return m_playlistName; } bool proposeOverwriteOnSave() const { return m_proposeOverwriting; } - bool saveM3U( const QString&, bool relative = AmarokConfig::relativePlaylist() ) const; - void saveXML( const QString& ); + bool saveM3U( const TQString&, bool relative = AmarokConfig::relativePlaylist() ) const; + void saveXML( const TQString& ); int totalTrackCount() const; BundleList nextTracks() const; uint repeatAlbumTrackCount() const; //returns number of tracks from same album @@ -146,11 +146,11 @@ class Playlist : private KListView, public EngineObserver, public Amarok::ToolTi int stopAfterMode(); - void addCustomMenuItem ( const QString &submenu, const QString &itemTitle ); + void addCustomMenuItem ( const TQString &submenu, const TQString &itemTitle ); void customMenuClicked ( int id ); - bool removeCustomMenuItem( const QString &submenu, const QString &itemTitle ); + bool removeCustomMenuItem( const TQString &submenu, const TQString &itemTitle ); - void setFont( const QFont &f ) { KListView::setFont( f ); } //made public for convenience + void setFont( const TQFont &f ) { KListView::setFont( f ); } //made public for convenience void unsetFont() { KListView::unsetFont(); } PlaylistItem *firstChild() const { return static_cast( KListView::firstChild() ); } @@ -158,11 +158,11 @@ class Playlist : private KListView, public EngineObserver, public Amarok::ToolTi PlaylistItem *currentItem() const { return static_cast( KListView::currentItem() ); } int numVisibleColumns() const; - QValueList visibleColumns() const; + TQValueList visibleColumns() const; MetaBundle::ColumnMask getVisibleColumnMask() const; int mapToLogicalColumn( int physical ) const; // Converts physical PlaylistItem column position to logical - QString columnText( int c ) const { return KListView::columnText( c ); }; - void setColumns( QValueList order, QValueList visible ); + TQString columnText( int c ) const { return KListView::columnText( c ); }; + void setColumns( TQValueList order, TQValueList visible ); /** Call this to prevent items being removed from the playlist, it is mostly for internal use only * Don't forget to unlock() !! */ @@ -170,18 +170,18 @@ class Playlist : private KListView, public EngineObserver, public Amarok::ToolTi void unlock(); //reimplemented to save columns by name instead of index, to be more resilient to reorderings and such - void saveLayout(KConfig *config, const QString &group) const; - void restoreLayout(KConfig *config, const QString &group); + void saveLayout(KConfig *config, const TQString &group) const; + void restoreLayout(KConfig *config, const TQString &group); //AFT-related functions bool checkFileStatus( PlaylistItem * item ); - void addToUniqueMap( const QString uniqueid, PlaylistItem* item ); - void removeFromUniqueMap( const QString uniqueid, PlaylistItem* item ); + void addToUniqueMap( const TQString uniqueid, PlaylistItem* item ); + void removeFromUniqueMap( const TQString uniqueid, PlaylistItem* item ); enum RequestType { Prev = -1, Current = 0, Next = 1 }; enum StopAfterMode { DoNotStop, StopAfterCurrent, StopAfterQueue, StopAfterOther }; - class QDragObject *dragObject(); + class TQDragObject *dragObject(); friend class PlaylistItem; friend class UrlLoader; friend class QueueManager; @@ -193,10 +193,10 @@ class Playlist : private KListView, public EngineObserver, public Amarok::ToolTi friend class TagWriter; //calls removeItem() friend void PlaylistWindow::init(); //setting up connections etc. friend TrackToolTip::TrackToolTip(); - friend bool PlaylistWindow::eventFilter( QObject*, QEvent* ); //for convenience we handle some playlist events here + friend bool PlaylistWindow::eventFilter( TQObject*, TQEvent* ); //for convenience we handle some playlist events here public: - QPair toolTipText( QWidget*, const QPoint &pos ) const; + QPair toolTipText( TQWidget*, const TQPoint &pos ) const; signals: void aboutToClear(); @@ -209,11 +209,11 @@ class Playlist : private KListView, public EngineObserver, public Amarok::ToolTi void activateByIndex(int); void addCustomColumn(); void appendMedia( const KURL &url ); - void appendMedia( const QString &path ); + void appendMedia( const TQString &path ); void clear(); - void copyToClipboard( const QListViewItem* = 0 ) const; + void copyToClipboard( const TQListViewItem* = 0 ) const; void deleteSelectedFiles(); - void ensureItemCentered( QListViewItem* item ); + void ensureItemCentered( TQListViewItem* item ); void playCurrentTrack(); void playNextTrack( const bool forceNext = true ); void playPrevTrack(); @@ -229,12 +229,12 @@ class Playlist : private KListView, public EngineObserver, public Amarok::ToolTi void rebuildDynamicModeCache(); void repopulate(); void safeClear(); - void scoreChanged( const QString &path, float score ); - void ratingChanged( const QString &path, int rating ); - void fileMoved( const QString &srcPath, const QString &dstPath ); - void selectAll() { QListView::selectAll( true ); } - void setFilter( const QString &filter ); - void setFilterSlot( const QString &filter ); //uses a delay where applicable + void scoreChanged( const TQString &path, float score ); + void ratingChanged( const TQString &path, int rating ); + void fileMoved( const TQString &srcPath, const TQString &dstPath ); + void selectAll() { TQListView::selectAll( true ); } + void setFilter( const TQString &filter ); + void setFilterSlot( const TQString &filter ); //uses a delay where applicable void setStopAfterCurrent( bool on ); void setStopAfterItem( PlaylistItem *item ); void toggleStopAfterCurrentItem(); @@ -242,48 +242,48 @@ class Playlist : private KListView, public EngineObserver, public Amarok::ToolTi void setStopAfterMode( int mode ); void showCurrentTrack() { ensureItemCentered( m_currentTrack ); } void showQueueManager(); - void changeFromQueueManager(QPtrList list); + void changeFromQueueManager(TQPtrList list); void shuffle(); void undo(); void updateMetaData( const MetaBundle& ); void adjustColumn( int n ); - void updateEntriesUrl( const QString &oldUrl, const QString &newUrl, const QString &uniqueid ); - void updateEntriesUniqueId( const QString &url, const QString &oldid, const QString &newid ); - void updateEntriesStatusDeleted( const QString &absPath, const QString &uniqueid ); - void updateEntriesStatusAdded( const QString &absPath, const QString &uniqueid ); - void updateEntriesStatusAdded( const QMap &map ); + void updateEntriesUrl( const TQString &oldUrl, const TQString &newUrl, const TQString &uniqueid ); + void updateEntriesUniqueId( const TQString &url, const TQString &oldid, const TQString &newid ); + void updateEntriesStatusDeleted( const TQString &absPath, const TQString &uniqueid ); + void updateEntriesStatusAdded( const TQString &absPath, const TQString &uniqueid ); + void updateEntriesStatusAdded( const TQMap &map ); protected: - virtual void fontChange( const QFont &old ); + virtual void fontChange( const TQFont &old ); protected slots: - void contentsMouseMoveEvent( QMouseEvent *e = 0 ); - void leaveEvent( QEvent *e ); - void contentsMousePressEvent( QMouseEvent *e ); - void contentsWheelEvent( QWheelEvent *e ); + void contentsMouseMoveEvent( TQMouseEvent *e = 0 ); + void leaveEvent( TQEvent *e ); + void contentsMousePressEvent( TQMouseEvent *e ); + void contentsWheelEvent( TQWheelEvent *e ); private slots: void mediumChange( int ); void slotCountChanged(); - void activate( QListViewItem* ); + void activate( TQListViewItem* ); void columnOrderChanged(); void columnResizeEvent( int, int, int ); - void doubleClicked( QListViewItem* ); + void doubleClicked( TQListViewItem* ); void generateInfo(); //generates info for Random Albums /* the only difference multi makes is whether it emits queueChanged(). (if multi, then no) if you're queue()ing many items, consider passing true and emitting queueChanged() yourself. */ /* if invertQueue then queueing an already queued song dequeues it */ - void queue( QListViewItem*, bool multi = false, bool invertQueue = true ); + void queue( TQListViewItem*, bool multi = false, bool invertQueue = true ); void saveUndoState(); void setDelayedFilter(); //after the delay is over - void showContextMenu( QListViewItem*, const QPoint&, int ); + void showContextMenu( TQListViewItem*, const TQPoint&, int ); void slotEraseMarker(); void slotGlowTimer(); void reallyEnsureItemCentered(); - void slotMouseButtonPressed( int, QListViewItem*, const QPoint&, int ); + void slotMouseButtonPressed( int, TQListViewItem*, const TQPoint&, int ); void slotSingleClick(); void slotContentsMoving(); void slotRepeatTrackToggled( int mode ); @@ -292,10 +292,10 @@ class Playlist : private KListView, public EngineObserver, public Amarok::ToolTi void slotUseRatings( bool use ); void slotMoodbarPrefs( bool show, bool moodier, int alter, bool withMusic ); void updateNextPrev(); - void writeTag( QListViewItem*, const QString&, int ); + void writeTag( TQListViewItem*, const TQString&, int ); private: - Playlist( QWidget* ); + Playlist( TQWidget* ); Playlist( const Playlist& ); //not defined LIBAMAROK_EXPORT static Playlist *s_instance; @@ -306,15 +306,15 @@ class Playlist : private KListView, public EngineObserver, public Amarok::ToolTi PlaylistItem *restoreCurrentTrack(); void insertMediaInternal( const KURL::List&, PlaylistItem*, int options = 0 ); - bool isAdvancedQuery( const QString &query ); + bool isAdvancedQuery( const TQString &query ); void refreshNextTracks( int = -1 ); void removeItem( PlaylistItem*, bool = false ); - bool saveState( QStringList& ); + bool saveState( TQStringList& ); void setCurrentTrack( PlaylistItem* ); void setCurrentTrackPixmap( int state = -1 ); - void showTagDialog( QPtrList items ); + void showTagDialog( TQPtrList items ); void sortQueuedItems(); - void switchState( QStringList&, QStringList& ); + void switchState( TQStringList&, TQStringList& ); void saveSelectedAsPlaylist(); void initStarPixmaps(); @@ -323,51 +323,51 @@ class Playlist : private KListView, public EngineObserver, public Amarok::ToolTi void engineStateChanged( Engine::State, Engine::State = Engine::Empty ); /// KListView Overloaded functions - void contentsDropEvent ( QDropEvent* ); - void contentsDragEnterEvent( QDragEnterEvent* ); - void contentsDragMoveEvent ( QDragMoveEvent* ); - void contentsDragLeaveEvent( QDragLeaveEvent* ); + void contentsDropEvent ( TQDropEvent* ); + void contentsDragEnterEvent( TQDragEnterEvent* ); + void contentsDragMoveEvent ( TQDragMoveEvent* ); + void contentsDragLeaveEvent( TQDragLeaveEvent* ); #ifdef PURIST //KListView imposes hand cursor so override it - void contentsMouseMoveEvent( QMouseEvent *e ) { QListView::contentsMouseMoveEvent( e ); } + void contentsMouseMoveEvent( TQMouseEvent *e ) { TQListView::contentsMouseMoveEvent( e ); } #endif - void customEvent( QCustomEvent* ); - bool eventFilter( QObject*, QEvent* ); - void paletteChange( const QPalette& ); - void rename( QListViewItem*, int ); + void customEvent( TQCustomEvent* ); + bool eventFilter( TQObject*, TQEvent* ); + void paletteChange( const TQPalette& ); + void rename( TQListViewItem*, int ); void setColumnWidth( int, int ); void setSorting( int, bool = true ); - void viewportPaintEvent( QPaintEvent* ); - void viewportResizeEvent( QResizeEvent* ); + void viewportPaintEvent( TQPaintEvent* ); + void viewportResizeEvent( TQResizeEvent* ); void appendToPreviousTracks( PlaylistItem *item ); void appendToPreviousAlbums( PlaylistAlbum *album ); void removeFromPreviousTracks( PlaylistItem *item = 0 ); void removeFromPreviousAlbums( PlaylistAlbum *album = 0 ); - typedef QMap AlbumMap; - typedef QMap ArtistAlbumMap; + typedef TQMap AlbumMap; + typedef TQMap ArtistAlbumMap; ArtistAlbumMap m_albums; - uint m_startupTime_t; //QDateTime::currentDateTime().toTime_t as of startup + uint m_startupTime_t; //TQDateTime::currentDateTime().toTime_t as of startup uint m_oldestTime_t; //the createdate of the oldest song in the collection /// ATTRIBUTES PlaylistItem *m_currentTrack; //the track that is playing - QListViewItem *m_marker; //track that has the drag/drop marker under it + TQListViewItem *m_marker; //track that has the drag/drop marker under it PlaylistItem *m_hoveredRating; //if the mouse is hovering over the rating of an item //NOTE these container types were carefully chosen - QPtrList m_prevAlbums; //the previously played albums in Entire Albums mode + TQPtrList m_prevAlbums; //the previously played albums in Entire Albums mode PLItemList m_prevTracks; //the previous history PLItemList m_nextTracks; //the tracks to be played after the current track - QString m_filter; - QString m_prevfilter; - QTimer *m_filtertimer; + TQString m_filter; + TQString m_prevfilter; + TQTimer *m_filtertimer; PLItemList m_itemsToChangeTagsFor; @@ -387,9 +387,9 @@ class Playlist : private KListView, public EngineObserver, public Amarok::ToolTi KAction *m_redoButton; KAction *m_clearButton; - QDir m_undoDir; - QStringList m_undoList; - QStringList m_redoList; + TQDir m_undoDir; + TQStringList m_undoList; + TQStringList m_redoList; uint m_undoCounter; DynamicMode *m_dynamicMode; @@ -401,40 +401,40 @@ class Playlist : private KListView, public EngineObserver, public Amarok::ToolTi bool m_queueDirt; //When queuing disabled items, we need to place the marker on the newly inserted item bool m_undoDirt; //Make sure we don't repopulate the playlist when dynamic mode and undo() int m_insertFromADT; //Don't automatically start playing if a user hits Next in dynamic mode when not already playing - static QMutex *s_dynamicADTMutex; + static TQMutex *s_dynamicADTMutex; - QListViewItem *m_itemToReallyCenter; - QListViewItem *m_renameItem; + TQListViewItem *m_itemToReallyCenter; + TQListViewItem *m_renameItem; int m_renameColumn; - QTimer *m_clicktimer; - QListViewItem *m_itemToRename; - QPoint m_clickPos; + TQTimer *m_clicktimer; + TQListViewItem *m_itemToRename; + TQPoint m_clickPos; int m_columnToRename; - QMap m_customSubmenuItem; - QMap m_customIdItem; + TQMap m_customSubmenuItem; + TQMap m_customIdItem; bool isLocked() const { return m_lockStack > 0; } /// stack counter for PLaylist::lock() and unlock() int m_lockStack; - QString m_editOldTag; //text before inline editing ( the new tag is written only if it's changed ) + TQString m_editOldTag; //text before inline editing ( the new tag is written only if it's changed ) std::vector m_columnFraction; - QMap*> m_uniqueMap; + TQMap*> m_uniqueMap; int m_oldRandom; int m_oldRepeat; - QString m_playlistName; + TQString m_playlistName; bool m_proposeOverwriting; // indexing stuff // An index of playlist items by some field. The index is backed by AtomicStrings, to avoid // duplication thread-safely. template - class Index : private QMap > + class Index : private TQMap > { public: // constructors take the PlaylistItem getter to index by @@ -460,7 +460,7 @@ class Playlist : private KListView, public EngineObserver, public Amarok::ToolTi } void add( PlaylistItem *item ) { - QPtrList &row = operator[]( keyOf( *item ) ); // adds one if needed + TQPtrList &row = operator[]( keyOf( *item ) ); // adds one if needed if ( !row.containsRef(item) ) row.append( item ); } @@ -483,7 +483,7 @@ class Playlist : private KListView, public EngineObserver, public Amarok::ToolTi // safety // TODO: we should just store the url() as AtomicString, it will save headaches (e.g. at least a // crash with multicore enabled traces back to KURL refcounting) - //Index m_uniqueIndex; + //Index m_uniqueIndex; }; class PlaylistAlbum @@ -505,23 +505,23 @@ public: class PlaylistIterator : public QListViewItemIterator { public: - PlaylistIterator( QListViewItem *item, int flags = 0 ) - //QListViewItemIterator is not great and doesn't allow you to see everything if you + PlaylistIterator( TQListViewItem *item, int flags = 0 ) + //TQListViewItemIterator is not great and doesn't allow you to see everything if you //mask both Visible and Invisible :( instead just visible items are returned - : QListViewItemIterator( item, flags == All ? 0 : flags | Visible ) + : TQListViewItemIterator( item, flags == All ? 0 : flags | Visible ) {} - PlaylistIterator( QListView *view, int flags = 0 ) - : QListViewItemIterator( view, flags == All ? 0 : flags | Visible ) + PlaylistIterator( TQListView *view, int flags = 0 ) + : TQListViewItemIterator( view, flags == All ? 0 : flags | Visible ) {} //FIXME! Dirty hack for enabled/disabled items. enum IteratorFlag { - Visible = QListViewItemIterator::Visible, - All = QListViewItemIterator::Invisible + Visible = TQListViewItemIterator::Visible, + All = TQListViewItemIterator::Invisible }; - inline PlaylistItem *operator*() { return static_cast( QListViewItemIterator::operator*() ); } + inline PlaylistItem *operator*() { return static_cast( TQListViewItemIterator::operator*() ); } /// @return the next visible PlaylistItem after item static PlaylistItem *nextVisible( PlaylistItem *item ) diff --git a/amarok/src/playlistbrowser.cpp b/amarok/src/playlistbrowser.cpp index 35ddfecd..a018eba9 100644 --- a/amarok/src/playlistbrowser.cpp +++ b/amarok/src/playlistbrowser.cpp @@ -34,12 +34,12 @@ #include "contextbrowser.h" #include "xspfplaylist.h" -#include //customEvent() -#include //mousePressed() -#include -#include //paintCell() -#include //paintCell() -#include //loadPlaylists(), saveM3U(), savePLS() +#include //customEvent() +#include //mousePressed() +#include +#include //paintCell() +#include //paintCell() +#include //loadPlaylists(), saveM3U(), savePLS() #include #include @@ -64,21 +64,21 @@ namespace Amarok { - QListViewItem* - findItemByPath( QListView *view, QString name ) + TQListViewItem* + findItemByPath( TQListView *view, TQString name ) { - const static QString escaped( "\\/" ); - const static QChar sep( '/' ); + const static TQString escaped( "\\/" ); + const static TQChar sep( '/' ); debug() << "Searching " << name << endl; - QStringList path = splitPath( name ); + TQStringList path = splitPath( name ); - QListViewItem *prox = view->firstChild(); - QListViewItem *item = 0; + TQListViewItem *prox = view->firstChild(); + TQListViewItem *item = 0; foreach( path ) { item = prox; - QString text( *it ); + TQString text( *it ); text.replace( escaped, sep ); for ( ; item; item = item->nextSibling() ) { @@ -95,10 +95,10 @@ namespace Amarok { } QStringList - splitPath( QString path ) { - QStringList list; + splitPath( TQString path ) { + TQStringList list; - const static QChar sep( '/' ); + const static TQChar sep( '/' ); int bOffset = 0, sOffset = 0; int pos = path.find( sep, bOffset ); @@ -124,7 +124,7 @@ namespace Amarok { inline QString -fileExtension( const QString &fileName ) +fileExtension( const TQString &fileName ) { return Amarok::extension( fileName ); } @@ -133,7 +133,7 @@ PlaylistBrowser *PlaylistBrowser::s_instance = 0; PlaylistBrowser::PlaylistBrowser( const char *name ) - : QVBox( 0, name ) + : TQVBox( 0, name ) , m_polished( false ) , m_playlistCategory( 0 ) , m_streamsCategory( 0 ) @@ -149,13 +149,13 @@ PlaylistBrowser::PlaylistBrowser( const char *name ) , m_smartDefaultsOpen( false ) , m_lastfmOpen( false ) , m_ac( new KActionCollection( this ) ) - , m_podcastTimer( new QTimer( this ) ) + , m_podcastTimer( new TQTimer( this ) ) { s_instance = this; - QVBox *browserBox = new QVBox( this ); + TQVBox *browserBox = new TQVBox( this ); browserBox->setSpacing( 3 ); // @@ -165,7 +165,7 @@ PlaylistBrowser::PlaylistBrowser( const char *name ) KPopupMenu *playlistMenu = new KPopupMenu( this ); playlistMenu->insertItem( i18n("New..."), PLAYLIST ); playlistMenu->insertItem( i18n("Import Existing..."), PLAYLIST_IMPORT ); - connect( playlistMenu, SIGNAL( activated(int) ), SLOT( slotAddPlaylistMenu(int) ) ); + connect( playlistMenu, TQT_SIGNAL( activated(int) ), TQT_SLOT( slotAddPlaylistMenu(int) ) ); KPopupMenu *addMenu = addMenuButton->popupMenu(); addMenu->insertItem( i18n("Playlist"), playlistMenu ); @@ -173,10 +173,10 @@ PlaylistBrowser::PlaylistBrowser( const char *name ) addMenu->insertItem( i18n("Dynamic Playlist..."), ADDDYNAMIC); addMenu->insertItem( i18n("Radio Stream..."), STREAM ); addMenu->insertItem( i18n("Podcast..."), PODCAST ); - connect( addMenu, SIGNAL( activated(int) ), SLOT( slotAddMenu(int) ) ); + connect( addMenu, TQT_SIGNAL( activated(int) ), TQT_SLOT( slotAddMenu(int) ) ); - renameButton = new KAction( i18n("Rename"), "editclear", 0, this, SLOT( renameSelectedItem() ), m_ac ); - removeButton = new KAction( i18n("Delete"), Amarok::icon( "remove" ), 0, this, SLOT( removeSelectedItems() ), m_ac ); + renameButton = new KAction( i18n("Rename"), "editclear", 0, this, TQT_SLOT( renameSelectedItem() ), m_ac ); + removeButton = new KAction( i18n("Delete"), Amarok::icon( "remove" ), 0, this, TQT_SLOT( removeSelectedItems() ), m_ac ); m_toolbar = new Browser::ToolBar( browserBox ); m_toolbar->setIconText( KToolBar::IconTextRight, false ); //we want the open button to have text on right @@ -191,7 +191,7 @@ PlaylistBrowser::PlaylistBrowser( const char *name ) removeButton->setEnabled( false ); // - m_splitter = new QSplitter( Qt::Vertical, browserBox ); + m_splitter = new TQSplitter( Qt::Vertical, browserBox ); m_splitter->setChildrenCollapsible( false ); // hiding the InfoPane entirely can only be confusing m_listview = new PlaylistBrowserView( m_splitter ); @@ -200,18 +200,18 @@ PlaylistBrowser::PlaylistBrowser( const char *name ) m_listview->setSorting( 0, sort == Qt::Ascending ? true : false ); m_podcastTimerInterval = Amarok::config( "PlaylistBrowser" )->readNumEntry( "Podcast Interval", 14400000 ); - connect( m_podcastTimer, SIGNAL(timeout()), this, SLOT(scanPodcasts()) ); + connect( m_podcastTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(scanPodcasts()) ); // signals and slots connections - connect( m_listview, SIGNAL( contextMenuRequested( QListViewItem *, const QPoint &, int ) ), - this, SLOT( showContextMenu( QListViewItem *, const QPoint &, int ) ) ); - connect( m_listview, SIGNAL( doubleClicked( QListViewItem *, const QPoint &, int ) ), - this, SLOT( invokeItem( QListViewItem *, const QPoint &, int ) ) ); - connect( m_listview, SIGNAL( itemRenamed( QListViewItem*, const QString&, int ) ), - this, SLOT( renamePlaylist( QListViewItem*, const QString&, int ) ) ); - connect( m_listview, SIGNAL( currentChanged( QListViewItem * ) ), - this, SLOT( currentItemChanged( QListViewItem * ) ) ); - connect( CollectionDB::instance(), SIGNAL( scanDone( bool ) ), SLOT( collectionScanDone() ) ); + connect( m_listview, TQT_SIGNAL( contextMenuRequested( TQListViewItem *, const TQPoint &, int ) ), + this, TQT_SLOT( showContextMenu( TQListViewItem *, const TQPoint &, int ) ) ); + connect( m_listview, TQT_SIGNAL( doubleClicked( TQListViewItem *, const TQPoint &, int ) ), + this, TQT_SLOT( invokeItem( TQListViewItem *, const TQPoint &, int ) ) ); + connect( m_listview, TQT_SIGNAL( itemRenamed( TQListViewItem*, const TQString&, int ) ), + this, TQT_SLOT( renamePlaylist( TQListViewItem*, const TQString&, int ) ) ); + connect( m_listview, TQT_SIGNAL( currentChanged( TQListViewItem * ) ), + this, TQT_SLOT( currentItemChanged( TQListViewItem * ) ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( scanDone( bool ) ), TQT_SLOT( collectionScanDone() ) ); setMinimumWidth( m_toolbar->sizeHint().width() ); @@ -238,7 +238,7 @@ PlaylistBrowser::polish() // BrowserBar::instance()->restoreWidth(); // blockSignals( false ); - QVBox::polish(); + TQVBox::polish(); /// Podcasting is always initialised in the ctor because of autoscanning @@ -284,8 +284,8 @@ PlaylistBrowser::polish() // First we check if the number of items in the listview is the same as it was on last // application exit. If true, we iterate over all items and restore their open/closed state. // Note: We ignore podcast items, because they are added dynamically added to the ListView. - QValueList stateList = Amarok::config( "PlaylistBrowser" )->readIntListEntry( "Item State" ); - QListViewItemIterator it( m_listview ); + TQValueList stateList = Amarok::config( "PlaylistBrowser" )->readIntListEntry( "Item State" ); + TQListViewItemIterator it( m_listview ); uint count = 0; while ( it.current() ) { if( !isPodcastEpisode( it.current() ) ) @@ -295,7 +295,7 @@ PlaylistBrowser::polish() if ( count == stateList.count() ) { uint index = 0; - it = QListViewItemIterator( m_listview ); + it = TQListViewItemIterator( m_listview ); while ( it.current() ) { if( !isPodcastEpisode( it.current() ) ) { it.current()->setOpen( stateList[index] ); @@ -326,10 +326,10 @@ PlaylistBrowser::~PlaylistBrowser() savePodcastFolderStates( m_podcastCategory ); - QStringList list; + TQStringList list; for( uint i=0; i < m_dynamicEntries.count(); i++ ) { - QListViewItem *item = m_dynamicEntries.at( i ); + TQListViewItem *item = m_dynamicEntries.at( i ); list.append( item->text(0) ); } @@ -342,15 +342,15 @@ PlaylistBrowser::~PlaylistBrowser() void -PlaylistBrowser::setInfo( const QString &title, const QString &info ) +PlaylistBrowser::setInfo( const TQString &title, const TQString &info ) { m_infoPane->setInfo( title, info ); } void -PlaylistBrowser::resizeEvent( QResizeEvent * ) +PlaylistBrowser::resizeEvent( TQResizeEvent * ) { - if( static_cast( m_infoPane->child( "container" ) )->isShown() ) + if( static_cast( m_infoPane->child( "container" ) )->isShown() ) m_infoPane->setMaximumHeight( ( int )( m_splitter->height() / 1.5 ) ); } @@ -360,7 +360,7 @@ PlaylistBrowser::markDynamicEntries() { if( Amarok::dynamicMode() ) { - QStringList playlists = Amarok::dynamicMode()->items(); + TQStringList playlists = Amarok::dynamicMode()->items(); for( uint i=0; i < playlists.count(); i++ ) { @@ -384,7 +384,7 @@ PlaylistBrowser::markDynamicEntries() ************************************************************************* **/ -QString PlaylistBrowser::streamBrowserCache() const +TQString PlaylistBrowser::streamBrowserCache() const { return Amarok::saveLocation() + "streambrowser_save.xml"; } @@ -392,15 +392,15 @@ QString PlaylistBrowser::streamBrowserCache() const PlaylistCategory* PlaylistBrowser::loadStreams() { - QFile file( streamBrowserCache() ); + TQFile file( streamBrowserCache() ); - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); - QDomDocument d; - QDomElement e; + TQDomDocument d; + TQDomElement e; - QListViewItem *after = m_dynamicCategory; + TQListViewItem *after = m_dynamicCategory; if( !file.open( IO_ReadOnly ) || !d.setContent( stream.read() ) ) { /*Couldn't open the file or it had invalid content, so let's create an empty element*/ @@ -415,8 +415,8 @@ PlaylistCategory* PlaylistBrowser::loadStreams() } else { // Old unversioned format PlaylistCategory* p = new PlaylistCategory( m_listview, after, i18n("Radio Streams") ); - QListViewItem *last = 0; - QDomNode n = d.namedItem( "streambrowser" ).namedItem("stream"); + TQListViewItem *last = 0; + TQDomNode n = d.namedItem( "streambrowser" ).namedItem("stream"); for( ; !n.isNull(); n = n.nextSibling() ) { last = new StreamEntry( p, last, n.toElement() ); } @@ -427,14 +427,14 @@ PlaylistCategory* PlaylistBrowser::loadStreams() void PlaylistBrowser::loadCoolStreams() { - QFile file( locate( "data","amarok/data/Cool-Streams.xml" ) ); + TQFile file( locate( "data","amarok/data/Cool-Streams.xml" ) ); if( !file.open( IO_ReadOnly ) ) return; - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); - QDomDocument d; + TQDomDocument d; if( !d.setContent( stream.read() ) ) { @@ -447,12 +447,12 @@ void PlaylistBrowser::loadCoolStreams() m_coolStreams->setKept( false ); StreamEntry *last = 0; - QDomNode n = d.namedItem( "coolstreams" ).firstChild(); + TQDomNode n = d.namedItem( "coolstreams" ).firstChild(); for( ; !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); - QString name = e.attribute( "name" ); + TQDomElement e = n.toElement(); + TQString name = e.attribute( "name" ); e = n.namedItem( "url" ).toElement(); KURL url( e.text() ); last = new StreamEntry( m_coolStreams, last, url, name ); @@ -460,14 +460,14 @@ void PlaylistBrowser::loadCoolStreams() } } -void PlaylistBrowser::addStream( QListViewItem *parent ) +void PlaylistBrowser::addStream( TQListViewItem *parent ) { - StreamEditor dialog( this, i18n( "Radio Stream" ), QString::null ); + StreamEditor dialog( this, i18n( "Radio Stream" ), TQString::null ); dialog.setCaption( i18n( "Add Radio Stream" ) ); - if( !parent ) parent = static_cast(m_streamsCategory); + if( !parent ) parent = static_cast(m_streamsCategory); - if( dialog.exec() == QDialog::Accepted ) + if( dialog.exec() == TQDialog::Accepted ) { new StreamEntry( parent, 0, dialog.url(), dialog.name() ); parent->sortChildItems( 0, true ); @@ -483,7 +483,7 @@ void PlaylistBrowser::editStreamURL( StreamEntry *item, const bool readonly ) StreamEditor dialog( this, item->title(), item->url().prettyURL(), readonly ); dialog.setCaption( readonly ? i18n( "Radio Stream" ) : i18n( "Edit Radio Stream" ) ); - if( dialog.exec() == QDialog::Accepted ) + if( dialog.exec() == TQDialog::Accepted ) { item->setTitle( dialog.name() ); item->setURL( dialog.url() ); @@ -493,23 +493,23 @@ void PlaylistBrowser::editStreamURL( StreamEntry *item, const bool readonly ) void PlaylistBrowser::saveStreams() { - QFile file( streamBrowserCache() ); + TQFile file( streamBrowserCache() ); - QDomDocument doc; - QDomElement streamB = m_streamsCategory->xml(); + TQDomDocument doc; + TQDomElement streamB = m_streamsCategory->xml(); streamB.setAttribute( "product", "Amarok" ); streamB.setAttribute( "version", APP_VERSION ); streamB.setAttribute( "formatversion", "1.1" ); - QDomNode streamsNode = doc.importNode( streamB, true ); + TQDomNode streamsNode = doc.importNode( streamB, true ); doc.appendChild( streamsNode ); - QString temp( doc.toString() ); + TQString temp( doc.toString() ); // Only open the file after all data is ready. If it crashes, data is not lost! if ( !file.open( IO_WriteOnly ) ) return; - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); stream << "\n"; stream << temp; } @@ -522,15 +522,15 @@ void PlaylistBrowser::saveStreams() void PlaylistBrowser::loadLastfmStreams( const bool subscriber /*false*/ ) { - QFile file( Amarok::saveLocation() + "lastfmbrowser_save.xml" ); + TQFile file( Amarok::saveLocation() + "lastfmbrowser_save.xml" ); - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); - QDomDocument d; - QDomElement e; + TQDomDocument d; + TQDomElement e; - QListViewItem *after = m_streamsCategory; + TQListViewItem *after = m_streamsCategory; if( !file.open( IO_ReadOnly ) || !d.setContent( stream.read() ) ) { /*Couldn't open the file or it had invalid content, so let's create an empty element*/ @@ -544,7 +544,7 @@ void PlaylistBrowser::loadLastfmStreams( const bool subscriber /*false*/ ) /// Load the default items - QStringList globaltags; + TQStringList globaltags; globaltags << "Alternative" << "Ambient" << "Chill Out" << "Classical" << "Dance" << "Electronica" << "Favorites" << "Heavy Metal" << "Hip Hop" << "Indie Rock" << "Industrial" << "Japanese" << "Pop" << "Psytrance" << "Rap" << "Rock" @@ -561,35 +561,35 @@ void PlaylistBrowser::loadLastfmStreams( const bool subscriber /*false*/ ) last->setKept( false ); } - QString user = AmarokConfig::scrobblerUsername(); - KURL url( QString("lastfm://user/%1/neighbours").arg( user ) ); + TQString user = AmarokConfig::scrobblerUsername(); + KURL url( TQString("lastfm://user/%1/neighbours").arg( user ) ); last = new LastFmEntry( m_lastfmCategory, tagsFolder, url, i18n( "Neighbor Radio" ) ); last->setKept( false ); - url = KURL::fromPathOrURL( QString("lastfm://user/%1/recommended/100").arg( user ) ); + url = KURL::fromPathOrURL( TQString("lastfm://user/%1/recommended/100").arg( user ) ); last = new LastFmEntry( m_lastfmCategory, last, url, i18n( "Recommended Radio" ) ); last->setKept( false ); if( subscriber ) { - url = KURL::fromPathOrURL( QString("lastfm://user/%1/personal").arg( user ) ); + url = KURL::fromPathOrURL( TQString("lastfm://user/%1/personal").arg( user ) ); last = new LastFmEntry( m_lastfmCategory, last, url, i18n( "Personal Radio" ) ); last->setKept( false ); - url = KURL::fromPathOrURL( QString("lastfm://user/%1/loved").arg( user ) ); + url = KURL::fromPathOrURL( TQString("lastfm://user/%1/loved").arg( user ) ); last = new LastFmEntry( m_lastfmCategory, last, url, i18n( "Loved Radio" ) ); last->setKept( false ); } } -void PlaylistBrowser::addLastFmRadio( QListViewItem *parent ) +void PlaylistBrowser::addLastFmRadio( TQListViewItem *parent ) { - StreamEditor dialog( this, i18n( "Last.fm Radio" ), QString::null ); + StreamEditor dialog( this, i18n( "Last.fm Radio" ), TQString::null ); dialog.setCaption( i18n( "Add Last.fm Radio" ) ); - if( !parent ) parent = static_cast(m_lastfmCategory); + if( !parent ) parent = static_cast(m_lastfmCategory); - if( dialog.exec() == QDialog::Accepted ) + if( dialog.exec() == TQDialog::Accepted ) { new LastFmEntry( parent, 0, dialog.url(), dialog.name() ); parent->sortChildItems( 0, true ); @@ -598,16 +598,16 @@ void PlaylistBrowser::addLastFmRadio( QListViewItem *parent ) } } -void PlaylistBrowser::addLastFmCustomRadio( QListViewItem *parent ) +void PlaylistBrowser::addLastFmCustomRadio( TQListViewItem *parent ) { - QString token = LastFm::Controller::createCustomStation(); + TQString token = LastFm::Controller::createCustomStation(); if( token.isEmpty() ) return; token.replace( "/", "%252" ); - const QString text = "lastfm://artistnames/" + token; + const TQString text = "lastfm://artistnames/" + token; const KURL url( text ); - QString name = LastFm::Controller::stationDescription( text ); + TQString name = LastFm::Controller::stationDescription( text ); name.replace( "%252", "/" ); new LastFmEntry( parent, 0, url, name ); saveLastFm(); @@ -618,23 +618,23 @@ void PlaylistBrowser::saveLastFm() if ( !m_lastfmCategory ) return; - QFile file( Amarok::saveLocation() + "lastfmbrowser_save.xml" ); + TQFile file( Amarok::saveLocation() + "lastfmbrowser_save.xml" ); - QDomDocument doc; - QDomElement lastfmB = m_lastfmCategory->xml(); + TQDomDocument doc; + TQDomElement lastfmB = m_lastfmCategory->xml(); lastfmB.setAttribute( "product", "Amarok" ); lastfmB.setAttribute( "version", APP_VERSION ); lastfmB.setAttribute( "formatversion", "1.1" ); - QDomNode lastfmNode = doc.importNode( lastfmB, true ); + TQDomNode lastfmNode = doc.importNode( lastfmB, true ); doc.appendChild( lastfmNode ); - QString temp( doc.toString() ); + TQString temp( doc.toString() ); // Only open the file after all data is ready. If it crashes, data is not lost! if ( !file.open( IO_WriteOnly ) ) return; - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); stream << "\n"; stream << temp; } @@ -646,24 +646,24 @@ void PlaylistBrowser::saveLastFm() ************************************************************************* **/ -QString PlaylistBrowser::smartplaylistBrowserCache() const +TQString PlaylistBrowser::smartplaylistBrowserCache() const { return Amarok::saveLocation() + "smartplaylistbrowser_save.xml"; } -void PlaylistBrowser::addSmartPlaylist( QListViewItem *parent ) //SLOT +void PlaylistBrowser::addSmartPlaylist( TQListViewItem *parent ) //SLOT { if( CollectionDB::instance()->isEmpty() || !m_smartCategory ) return; - if( !parent ) parent = static_cast(m_smartCategory); + if( !parent ) parent = static_cast(m_smartCategory); SmartPlaylistEditor dialog( i18n("Untitled"), this ); - if( dialog.exec() == QDialog::Accepted ) { + if( dialog.exec() == TQDialog::Accepted ) { PlaylistCategory *category = dynamic_cast(parent); - for( QListViewItem *item = category->firstChild(); item; item = item->nextSibling() ) { + for( TQListViewItem *item = category->firstChild(); item; item = item->nextSibling() ) { SmartPlaylist *sp = dynamic_cast(item); if ( sp && sp->title() == dialog.name() ) { if( KMessageBox::warningContinueCancel( @@ -689,13 +689,13 @@ void PlaylistBrowser::addSmartPlaylist( QListViewItem *parent ) //SLOT PlaylistCategory* PlaylistBrowser::loadSmartPlaylists() { - QFile file( smartplaylistBrowserCache() ); - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); - QListViewItem *after = m_playlistCategory; + TQFile file( smartplaylistBrowserCache() ); + TQTextStream stream( &file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); + TQListViewItem *after = m_playlistCategory; - QDomDocument d; - QDomElement e; + TQDomDocument d; + TQDomElement e; if( !file.open( IO_ReadOnly ) || !d.setContent( stream.read() ) ) { /*Couldn't open the file or it had invalid content, so let's create an empty element*/ @@ -703,7 +703,7 @@ PlaylistCategory* PlaylistBrowser::loadSmartPlaylists() } else { e = d.namedItem( "category" ).toElement(); - QString version = e.attribute("formatversion"); + TQString version = e.attribute("formatversion"); float fversion = e.attribute("formatversion").toFloat(); if ( version == "1.8" ) { @@ -722,8 +722,8 @@ PlaylistCategory* PlaylistBrowser::loadSmartPlaylists() } else { // Old unversioned format PlaylistCategory* p = new PlaylistCategory(m_listview, after , i18n("Smart Playlists") ); - QListViewItem *last = 0; - QDomNode n = d.namedItem( "smartplaylists" ).namedItem("smartplaylist"); + TQListViewItem *last = 0; + TQDomNode n = d.namedItem( "smartplaylists" ).namedItem("smartplaylist"); for( ; !n.isNull(); n = n.nextSibling() ) { last = new SmartPlaylist( p, last, n.toElement() ); } @@ -732,21 +732,21 @@ PlaylistCategory* PlaylistBrowser::loadSmartPlaylists() } } -void PlaylistBrowser::updateSmartPlaylists( QListViewItem *p ) +void PlaylistBrowser::updateSmartPlaylists( TQListViewItem *p ) { if( !p ) return; - for( QListViewItem *it = p->firstChild(); + for( TQListViewItem *it = p->firstChild(); it; it = it->nextSibling() ) { SmartPlaylist *spl = dynamic_cast( it ); if( spl ) { - QDomElement xml = spl->xml(); - QDomElement query = xml.namedItem( "sqlquery" ).toElement(); - QDomElement expandBy = xml.namedItem( "expandby" ).toElement(); + TQDomElement xml = spl->xml(); + TQDomElement query = xml.namedItem( "sqlquery" ).toElement(); + TQDomElement expandBy = xml.namedItem( "expandby" ).toElement(); updateSmartPlaylistElement( query ); updateSmartPlaylistElement( expandBy ); spl->setXml( xml ); @@ -756,24 +756,24 @@ void PlaylistBrowser::updateSmartPlaylists( QListViewItem *p ) } } -void PlaylistBrowser::updateSmartPlaylistElement( QDomElement& query ) +void PlaylistBrowser::updateSmartPlaylistElement( TQDomElement& query ) { - QRegExp limitSearch( "LIMIT.*(\\d+)\\s*,\\s*(\\d+)" ); - QRegExp selectFromSearch( "SELECT[^'\"]*FROM" ); - for(QDomNode child = query.firstChild(); + TQRegExp limitSearch( "LIMIT.*(\\d+)\\s*,\\s*(\\d+)" ); + TQRegExp selectFromSearch( "SELECT[^'\"]*FROM" ); + for(TQDomNode child = query.firstChild(); !child.isNull(); child = child.nextSibling() ) { if( child.isText() ) { //HACK this should be refactored to just regenerate the SQL from the 's - QDomText text = child.toText(); - QString sql = text.data(); + TQDomText text = child.toText(); + TQString sql = text.data(); if ( selectFromSearch.search( sql ) != -1 ) sql.replace( selectFromSearch, "SELECT (*ListOfFields*) FROM" ); if ( limitSearch.search( sql ) != -1 ) sql.replace( limitSearch, - QString( "LIMIT %1 OFFSET %2").arg( limitSearch.capturedTexts()[2].toInt() ).arg( limitSearch.capturedTexts()[1].toInt() ) ); + TQString( "LIMIT %1 OFFSET %2").arg( limitSearch.capturedTexts()[2].toInt() ).arg( limitSearch.capturedTexts()[1].toInt() ) ); text.setData( sql ); break; @@ -785,8 +785,8 @@ void PlaylistBrowser::loadDefaultSmartPlaylists() { DEBUG_BLOCK - const QStringList genres = CollectionDB::instance()->query( "SELECT DISTINCT name FROM genre;" ); - const QStringList artists = CollectionDB::instance()->artistList(); + const TQStringList genres = CollectionDB::instance()->query( "SELECT DISTINCT name FROM genre;" ); + const TQStringList artists = CollectionDB::instance()->artistList(); SmartPlaylist *item; QueryBuilder qb; SmartPlaylist *last = 0; @@ -891,7 +891,7 @@ void PlaylistBrowser::loadDefaultSmartPlaylists() item->setKept( false ); /********** Genres **************/ - item = new SmartPlaylist( m_smartDefaults, item, i18n( "Genres" ), QString() ); + item = new SmartPlaylist( m_smartDefaults, item, i18n( "Genres" ), TQString() ); item->setKept( false ); last = 0; @@ -919,7 +919,7 @@ void PlaylistBrowser::editSmartPlaylist( SmartPlaylist* item ) { SmartPlaylistEditor dialog( this, item->xml() ); - if( dialog.exec() == QDialog::Accepted ) + if( dialog.exec() == TQDialog::Accepted ) { item->setXml ( dialog.result() ); item->setText( 0, dialog.name() ); @@ -931,7 +931,7 @@ void PlaylistBrowser::editSmartPlaylist( SmartPlaylist* item ) void PlaylistBrowser::saveSmartPlaylists( PlaylistCategory *smartCategory ) { - QFile file( smartplaylistBrowserCache() ); + TQFile file( smartplaylistBrowserCache() ); if( !smartCategory ) smartCategory = m_smartCategory; @@ -939,21 +939,21 @@ void PlaylistBrowser::saveSmartPlaylists( PlaylistCategory *smartCategory ) // If the user hadn't set a collection, we didn't create the Smart Playlist Item if( !smartCategory ) return; - QDomDocument doc; - QDomElement smartB = smartCategory->xml(); + TQDomDocument doc; + TQDomElement smartB = smartCategory->xml(); smartB.setAttribute( "product", "Amarok" ); smartB.setAttribute( "version", APP_VERSION ); smartB.setAttribute( "formatversion", "1.8" ); - QDomNode smartplaylistsNode = doc.importNode( smartB, true ); + TQDomNode smartplaylistsNode = doc.importNode( smartB, true ); doc.appendChild( smartplaylistsNode ); - QString temp( doc.toString() ); + TQString temp( doc.toString() ); // Only open the file after all data is ready. If it crashes, data is not lost! if ( !file.open( IO_WriteOnly ) ) return; - QTextStream smart( &file ); - smart.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream smart( &file ); + smart.setEncoding( TQTextStream::UnicodeUTF8 ); smart << "\n"; smart << temp; } @@ -964,20 +964,20 @@ void PlaylistBrowser::saveSmartPlaylists( PlaylistCategory *smartCategory ) ************************************************************************* **/ -QString PlaylistBrowser::dynamicBrowserCache() const +TQString PlaylistBrowser::dynamicBrowserCache() const { return Amarok::saveLocation() + "dynamicbrowser_save.xml"; } PlaylistCategory* PlaylistBrowser::loadDynamics() { - QFile file( dynamicBrowserCache() ); + TQFile file( dynamicBrowserCache() ); - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); - QDomDocument d; - QDomElement e; + TQDomDocument d; + TQDomElement e; PlaylistCategory *after = m_smartCategory; if( CollectionDB::instance()->isEmpty() || !m_smartCategory ) // incase of no collection @@ -990,7 +990,7 @@ PlaylistCategory* PlaylistBrowser::loadDynamics() } else { e = d.namedItem( "category" ).toElement(); - QString version = e.attribute("formatversion"); + TQString version = e.attribute("formatversion"); if ( version == "1.2" ) { PlaylistCategory* p = new PlaylistCategory( m_listview, after, e ); p->setText( 0, i18n("Dynamic Playlists") ); @@ -1006,8 +1006,8 @@ PlaylistCategory* PlaylistBrowser::loadDynamics() } else { // Old unversioned format PlaylistCategory* p = new PlaylistCategory( m_listview, after, i18n("Dynamic Playlists") ); - QListViewItem *last = 0; - QDomNode n = d.namedItem( "dynamicbrowser" ).namedItem("dynamic"); + TQListViewItem *last = 0; + TQDomNode n = d.namedItem( "dynamicbrowser" ).namedItem("dynamic"); for( ; !n.isNull(); n = n.nextSibling() ) { last = new DynamicEntry( p, last, n.toElement() ); } @@ -1018,14 +1018,14 @@ PlaylistCategory* PlaylistBrowser::loadDynamics() void -PlaylistBrowser::fixDynamicPlaylistPath( QListViewItem *item ) +PlaylistBrowser::fixDynamicPlaylistPath( TQListViewItem *item ) { DynamicEntry *entry = dynamic_cast( item ); if ( entry ) { - QStringList names = entry->items(); - QStringList paths; + TQStringList names = entry->items(); + TQStringList paths; foreach( names ) { - QString path = guessPathFromPlaylistName( *it ); + TQString path = guessPathFromPlaylistName( *it ); if ( !path.isNull() ) paths+=path; } @@ -1033,7 +1033,7 @@ PlaylistBrowser::fixDynamicPlaylistPath( QListViewItem *item ) } PlaylistCategory *cat = dynamic_cast( item ); if ( cat ) { - QListViewItem *it = cat->firstChild(); + TQListViewItem *it = cat->firstChild(); for( ; it; it = it->nextSibling() ) { fixDynamicPlaylistPath( it ); } @@ -1041,13 +1041,13 @@ PlaylistBrowser::fixDynamicPlaylistPath( QListViewItem *item ) } QString -PlaylistBrowser::guessPathFromPlaylistName( QString name ) +PlaylistBrowser::guessPathFromPlaylistName( TQString name ) { - QListViewItem *item = m_listview->findItem( name, 0, Qt::ExactMatch ); + TQListViewItem *item = m_listview->findItem( name, 0, Qt::ExactMatch ); PlaylistBrowserEntry *entry = dynamic_cast( item ); if ( entry ) return entry->name(); - return QString(); + return TQString(); } void PlaylistBrowser::saveDynamics() @@ -1060,23 +1060,23 @@ void PlaylistBrowser::saveDynamics() Amarok::config( "PlaylistBrowser" )->writeEntry( "Dynamic Suggest Upcoming Count", m_suggestedDynamic->upcomingCount() ); Amarok::config( "PlaylistBrowser" )->writeEntry( "Dynamic Suggest Previous Count", m_suggestedDynamic->previousCount() ); - QFile file( dynamicBrowserCache() ); - QTextStream stream( &file ); + TQFile file( dynamicBrowserCache() ); + TQTextStream stream( &file ); - QDomDocument doc; - QDomElement dynamicB = m_dynamicCategory->xml(); + TQDomDocument doc; + TQDomElement dynamicB = m_dynamicCategory->xml(); dynamicB.setAttribute( "product", "Amarok" ); dynamicB.setAttribute( "version", APP_VERSION ); dynamicB.setAttribute( "formatversion", "1.2" ); - QDomNode dynamicsNode = doc.importNode( dynamicB, true ); + TQDomNode dynamicsNode = doc.importNode( dynamicB, true ); doc.appendChild( dynamicsNode ); - QString temp( doc.toString() ); + TQString temp( doc.toString() ); // Only open the file after all data is ready. If it crashes, data is not lost! if ( !file.open( IO_WriteOnly ) ) return; - stream.setEncoding( QTextStream::UnicodeUTF8 ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); stream << "\n"; stream << temp; } @@ -1086,7 +1086,7 @@ void PlaylistBrowser::loadDynamicItems() // Make sure all items are unmarked for( uint i=0; i < m_dynamicEntries.count(); i++ ) { - QListViewItem *it = m_dynamicEntries.at( i ); + TQListViewItem *it = m_dynamicEntries.at( i ); if( it ) static_cast(it)->setDynamic( false ); @@ -1103,7 +1103,7 @@ void PlaylistBrowser::loadDynamicItems() ************************************************************************* **/ -QString PlaylistBrowser::podcastBrowserCache() const +TQString PlaylistBrowser::podcastBrowserCache() const { //returns the playlists stats cache file return Amarok::saveLocation() + "podcastbrowser_save.xml"; @@ -1113,14 +1113,14 @@ PlaylistCategory* PlaylistBrowser::loadPodcasts() { DEBUG_BLOCK - QFile file( podcastBrowserCache() ); - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQFile file( podcastBrowserCache() ); + TQTextStream stream( &file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); - QDomDocument d; - QDomElement e; + TQDomDocument d; + TQDomElement e; - QListViewItem *after = 0; + TQListViewItem *after = 0; if( !file.open( IO_ReadOnly ) || !d.setContent( stream.read() ) ) { /*Couldn't open the file or it had invalid content, so let's create an empty element*/ @@ -1161,15 +1161,15 @@ DEBUG_BLOCK while( p->firstChild() ) delete p->firstChild(); - QMap folderMap = loadPodcastFolders( p ); + TQMap folderMap = loadPodcastFolders( p ); - QValueList channels; + TQValueList channels; channels = CollectionDB::instance()->getPodcastChannels(); PodcastChannel *channel = 0; - foreachType( QValueList, channels ) + foreachType( TQValueList, channels ) { PlaylistCategory *parent = p; const int parentId = (*it).parentId(); @@ -1178,7 +1178,7 @@ DEBUG_BLOCK channel = new PodcastChannel( parent, channel, *it ); - bool hasNew = CollectionDB::instance()->query( QString("SELECT COUNT(parent) FROM podcastepisodes WHERE ( parent='%1' AND isNew=%2 ) LIMIT 1" ) + bool hasNew = CollectionDB::instance()->query( TQString("SELECT COUNT(parent) FROM podcastepisodes WHERE ( parent='%1' AND isNew=%2 ) LIMIT 1" ) .arg( (*it).url().url(), CollectionDB::instance()->boolT() ) ) .first().toInt() > 0; @@ -1192,20 +1192,20 @@ DEBUG_BLOCK m_podcastTimer->start( m_podcastTimerInterval ); } -QMap +TQMap PlaylistBrowser::loadPodcastFolders( PlaylistCategory *p ) { DEBUG_BLOCK - QString sql = "SELECT * FROM podcastfolders ORDER BY parent ASC;"; - QStringList values = CollectionDB::instance()->query( sql ); + TQString sql = "SELECT * FROM podcastfolders ORDER BY parent ASC;"; + TQStringList values = CollectionDB::instance()->query( sql ); // store the folder and IDs so finding a parent is fast - QMap folderMap; + TQMap folderMap; PlaylistCategory *folder = 0; foreach( values ) { const int id = (*it).toInt(); - const QString t = *++it; + const TQString t = *++it; const int parentId = (*++it).toInt(); const bool isOpen = ( (*++it) == CollectionDB::instance()->boolT() ? true : false ); @@ -1269,7 +1269,7 @@ void PlaylistBrowser::scanPodcasts() for( uint i=0; i < m_podcastItemsToScan.count(); i++ ) { - QListViewItem *item = m_podcastItemsToScan.at( i ); + TQListViewItem *item = m_podcastItemsToScan.at( i ); PodcastChannel *pc = static_cast(item); pc->rescan(); } @@ -1277,9 +1277,9 @@ void PlaylistBrowser::scanPodcasts() m_podcastTimer->start( m_podcastTimerInterval ); } -void PlaylistBrowser::refreshPodcasts( QListViewItem *parent ) +void PlaylistBrowser::refreshPodcasts( TQListViewItem *parent ) { - for( QListViewItem *child = parent->firstChild(); + for( TQListViewItem *child = parent->firstChild(); child; child = child->nextSibling() ) { @@ -1290,10 +1290,10 @@ void PlaylistBrowser::refreshPodcasts( QListViewItem *parent ) } } -void PlaylistBrowser::addPodcast( QListViewItem *parent ) +void PlaylistBrowser::addPodcast( TQListViewItem *parent ) { bool ok; - const QString name = KInputDialog::getText(i18n("Add Podcast"), i18n("Enter Podcast URL:"), QString::null, &ok, this); + const TQString name = KInputDialog::getText(i18n("Add Podcast"), i18n("Enter Podcast URL:"), TQString::null, &ok, this); if( ok && !name.isEmpty() ) { @@ -1301,10 +1301,10 @@ void PlaylistBrowser::addPodcast( QListViewItem *parent ) } } -void PlaylistBrowser::configurePodcasts( QListViewItem *parent ) +void PlaylistBrowser::configurePodcasts( TQListViewItem *parent ) { - QPtrList podcastChannelList; - for( QListViewItem *child = parent->firstChild(); + TQPtrList podcastChannelList; + for( TQListViewItem *child = parent->firstChild(); child; child = child->nextSibling() ) { @@ -1319,8 +1319,8 @@ void PlaylistBrowser::configurePodcasts( QListViewItem *parent ) void PlaylistBrowser::configureSelectedPodcasts() { - QPtrList selected; - QListViewItemIterator it( m_listview, QListViewItemIterator::Selected); + TQPtrList selected; + TQListViewItemIterator it( m_listview, TQListViewItemIterator::Selected); for( ; it.current(); ++it ) { if( isPodcastChannel( (*it) ) ) @@ -1342,8 +1342,8 @@ void PlaylistBrowser::configureSelectedPodcasts() // else timer is already running } -void PlaylistBrowser::configurePodcasts( QPtrList &podcastChannelList, - const QString &caption ) +void PlaylistBrowser::configurePodcasts( TQPtrList &podcastChannelList, + const TQString &caption ) { if( podcastChannelList.isEmpty() ) @@ -1351,8 +1351,8 @@ void PlaylistBrowser::configurePodcasts( QPtrList &podcastChanne debug() << "BUG: podcastChannelList is empty" << endl; return; } - QPtrList podcastSettingsList; - foreachType( QPtrList, podcastChannelList) + TQPtrList podcastSettingsList; + foreachType( TQPtrList, podcastChannelList) { podcastSettingsList.append( (*it)->getSettings() ); } @@ -1360,7 +1360,7 @@ void PlaylistBrowser::configurePodcasts( QPtrList &podcastChanne if( dialog->configure() ) { PodcastChannel *channel = podcastChannelList.first(); - foreachType( QPtrList, podcastSettingsList ) + foreachType( TQPtrList, podcastSettingsList ) { if ( (*it)->title() == channel->title() ) { @@ -1375,11 +1375,11 @@ void PlaylistBrowser::configurePodcasts( QPtrList &podcastChanne } PodcastChannel * -PlaylistBrowser::findPodcastChannel( const KURL &feed, QListViewItem *parent ) const +PlaylistBrowser::findPodcastChannel( const KURL &feed, TQListViewItem *parent ) const { - if( !parent ) parent = static_cast(m_podcastCategory); + if( !parent ) parent = static_cast(m_podcastCategory); - for( QListViewItem *it = parent->firstChild(); + for( TQListViewItem *it = parent->firstChild(); it; it = it->nextSibling() ) { @@ -1412,7 +1412,7 @@ PlaylistBrowser::findPodcastEpisode( const KURL &episode, const KURL &feed ) con if( !channel->isPolished() ) channel->load(); - QListViewItem *child = channel->firstChild(); + TQListViewItem *child = channel->firstChild(); while( child ) { #define child static_cast(child) @@ -1425,9 +1425,9 @@ PlaylistBrowser::findPodcastEpisode( const KURL &episode, const KURL &feed ) con return 0; } -void PlaylistBrowser::addPodcast( const KURL& origUrl, QListViewItem *parent ) +void PlaylistBrowser::addPodcast( const KURL& origUrl, TQListViewItem *parent ) { - if( !parent ) parent = static_cast(m_podcastCategory); + if( !parent ) parent = static_cast(m_podcastCategory); KURL url( origUrl ); if( url.protocol() == "itpc" || url.protocol() == "pcast" ) @@ -1481,8 +1481,8 @@ void PlaylistBrowser::changePodcastInterval() bool PlaylistBrowser::deleteSelectedPodcastItems( const bool removeItem, const bool silent ) { KURL::List urls; - QListViewItemIterator it( m_podcastCategory, QListViewItemIterator::Selected ); - QPtrList erasedItems; + TQListViewItemIterator it( m_podcastCategory, TQListViewItemIterator::Selected ); + TQPtrList erasedItems; for( ; it.current(); ++it ) { @@ -1503,7 +1503,7 @@ bool PlaylistBrowser::deleteSelectedPodcastItems( const bool removeItem, const b button = KMessageBox::warningContinueCancel( this, i18n( "

    You have selected 1 podcast episode to be irreversibly deleted. ", "

    You have selected %n podcast episodes to be irreversibly deleted. ", - urls.count() ), QString::null, KStdGuiItem::del() ); + urls.count() ), TQString::null, KStdGuiItem::del() ); if( silent || button != KMessageBox::Continue ) return false; @@ -1518,19 +1518,19 @@ bool PlaylistBrowser::deleteSelectedPodcastItems( const bool removeItem, const b delete item; } else - connect( job, SIGNAL( result( KIO::Job* ) ), item, SLOT( isOnDisk() ) );; + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), item, TQT_SLOT( isOnDisk() ) );; } return true; } -bool PlaylistBrowser::deletePodcasts( QPtrList items ) +bool PlaylistBrowser::deletePodcasts( TQPtrList items ) { if( items.isEmpty() ) return false; KURL::List urls; - foreachType( QPtrList, items ) + foreachType( TQPtrList, items ) { - for( QListViewItem *ch = (*it)->firstChild(); ch; ch = ch->nextSibling() ) + for( TQListViewItem *ch = (*it)->firstChild(); ch; ch = ch->nextSibling() ) { #define ch static_cast(ch) if( ch->isOnDisk() ) @@ -1554,7 +1554,7 @@ bool PlaylistBrowser::deletePodcasts( QPtrList items ) void PlaylistBrowser::downloadSelectedPodcasts() { - QListViewItemIterator it( m_listview, QListViewItemIterator::Selected ); + TQListViewItemIterator it( m_listview, TQListViewItemIterator::Selected ); for( ; it.current(); ++it ) { @@ -1577,8 +1577,8 @@ void PlaylistBrowser::downloadPodcastQueue() //SLOT first->downloadMedia(); m_podcastDownloadQueue.removeFirst(); - connect( first, SIGNAL( downloadFinished() ), this, SLOT( downloadPodcastQueue() ) ); - connect( first, SIGNAL( downloadAborted() ), this, SLOT( abortPodcastQueue() ) ); + connect( first, TQT_SIGNAL( downloadFinished() ), this, TQT_SLOT( downloadPodcastQueue() ) ); + connect( first, TQT_SIGNAL( downloadAborted() ), this, TQT_SLOT( abortPodcastQueue() ) ); } void PlaylistBrowser::abortPodcastQueue() //SLOT @@ -1586,7 +1586,7 @@ void PlaylistBrowser::abortPodcastQueue() //SLOT m_podcastDownloadQueue.clear(); } -void PlaylistBrowser::registerPodcastSettings( const QString &title, const PodcastSettings *settings ) +void PlaylistBrowser::registerPodcastSettings( const TQString &title, const PodcastSettings *settings ) { m_podcastSettings.insert( title, settings ); } @@ -1597,7 +1597,7 @@ void PlaylistBrowser::registerPodcastSettings( const QString &title, const Podca ************************************************************************* **/ -QString PlaylistBrowser::playlistBrowserCache() const +TQString PlaylistBrowser::playlistBrowserCache() const { //returns the playlists stats cache file return Amarok::saveLocation() + "playlistbrowser_save.xml"; @@ -1605,13 +1605,13 @@ QString PlaylistBrowser::playlistBrowserCache() const PlaylistCategory* PlaylistBrowser::loadPlaylists() { - QFile file( playlistBrowserCache() ); + TQFile file( playlistBrowserCache() ); - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); - QDomDocument d; - QDomElement e; + TQDomDocument d; + TQDomElement e; if( !file.open( IO_ReadOnly ) || !d.setContent( stream.read() ) ) { /*Couldn't open the file or it had invalid content, so let's create an empty element*/ @@ -1627,8 +1627,8 @@ PlaylistCategory* PlaylistBrowser::loadPlaylists() } else { // Old unversioned format PlaylistCategory* p = new PlaylistCategory( m_listview, 0 , i18n("Playlists") ); - QListViewItem *last = 0; - QDomNode n = d.namedItem( "playlistbrowser" ).namedItem("playlist"); + TQListViewItem *last = 0; + TQDomNode n = d.namedItem( "playlistbrowser" ).namedItem("playlist"); for ( ; !n.isNull(); n = n.nextSibling() ) last = new PlaylistEntry( p, last, n.toElement() ); @@ -1638,20 +1638,20 @@ PlaylistCategory* PlaylistBrowser::loadPlaylists() } } -QListViewItem * -PlaylistBrowser::findItemInTree( const QString &searchstring, int c ) const +TQListViewItem * +PlaylistBrowser::findItemInTree( const TQString &searchstring, int c ) const { - QStringList list = QStringList::split( "/", searchstring, true ); + TQStringList list = TQStringList::split( "/", searchstring, true ); // select the 1st level - QStringList::Iterator it = list.begin(); - QListViewItem *pli = findItem (*it, c); + TQStringList::Iterator it = list.begin(); + TQListViewItem *pli = findItem (*it, c); if ( !pli ) return pli; for ( ++it ; it != list.end(); ++it ) { - QListViewItemIterator it2( pli ); + TQListViewItemIterator it2( pli ); for( ++it2 ; it2.current(); ++it2 ) { if ( *it == (*it2)->text(0) ) @@ -1670,12 +1670,12 @@ PlaylistBrowser::findItemInTree( const QString &searchstring, int c ) const return pli; } -DynamicMode *PlaylistBrowser::findDynamicModeByTitle( const QString &title ) +DynamicMode *PlaylistBrowser::findDynamicModeByTitle( const TQString &title ) { if( !m_polished ) polish(); - for ( QListViewItem *item = m_dynamicCategory->firstChild(); item; item = item->nextSibling() ) + for ( TQListViewItem *item = m_dynamicCategory->firstChild(); item; item = item->nextSibling() ) { DynamicEntry *entry = dynamic_cast( item ); if ( entry && entry->title() == title ) @@ -1686,11 +1686,11 @@ DynamicMode *PlaylistBrowser::findDynamicModeByTitle( const QString &title ) } PlaylistEntry * -PlaylistBrowser::findPlaylistEntry( const QString &url, QListViewItem *parent ) const +PlaylistBrowser::findPlaylistEntry( const TQString &url, TQListViewItem *parent ) const { - if( !parent ) parent = static_cast(m_playlistCategory); + if( !parent ) parent = static_cast(m_playlistCategory); - for( QListViewItem *it = parent->firstChild(); + for( TQListViewItem *it = parent->firstChild(); it; it = it->nextSibling() ) { @@ -1715,12 +1715,12 @@ PlaylistBrowser::findPlaylistEntry( const QString &url, QListViewItem *parent ) return 0; } -int PlaylistBrowser::loadPlaylist( const QString &playlist, bool /*force*/ ) +int PlaylistBrowser::loadPlaylist( const TQString &playlist, bool /*force*/ ) { // roland DEBUG_BLOCK - QListViewItem *pli = findItemInTree( playlist, 0 ); + TQListViewItem *pli = findItemInTree( playlist, 0 ); if ( ! pli ) return -1; slotDoubleClicked( pli ); @@ -1728,14 +1728,14 @@ int PlaylistBrowser::loadPlaylist( const QString &playlist, bool /*force*/ ) // roland } -void PlaylistBrowser::addPlaylist( const QString &path, QListViewItem *parent, bool force, bool imported ) +void PlaylistBrowser::addPlaylist( const TQString &path, TQListViewItem *parent, bool force, bool imported ) { // this function adds a playlist to the playlist browser if( !m_polished ) polish(); - QFile file( path ); + TQFile file( path ); if( !file.exists() ) return; PlaylistEntry *playlist = findPlaylistEntry( path ); @@ -1744,9 +1744,9 @@ void PlaylistBrowser::addPlaylist( const QString &path, QListViewItem *parent, b playlist->load(); //reload the playlist if( imported ) { - QListViewItem *playlistImports = 0; + TQListViewItem *playlistImports = 0; //First try and find the imported folder - for ( QListViewItem *it = m_playlistCategory->firstChild(); it; it = it->nextSibling() ) + for ( TQListViewItem *it = m_playlistCategory->firstChild(); it; it = it->nextSibling() ) { if ( dynamic_cast( it ) && static_cast( it )->isFolder() && it->text( 0 ) == i18n( "Imported" ) ) @@ -1759,7 +1759,7 @@ void PlaylistBrowser::addPlaylist( const QString &path, QListViewItem *parent, b playlistImports = new PlaylistCategory( m_playlistCategory, 0, i18n("Imported") ); parent = playlistImports; } - else if( !parent ) parent = static_cast(m_playlistCategory); + else if( !parent ) parent = static_cast(m_playlistCategory); if( !playlist ) { if( !m_playlistCategory || !m_playlistCategory->childCount() ) { //first child @@ -1778,14 +1778,14 @@ void PlaylistBrowser::addPlaylist( const QString &path, QListViewItem *parent, b playlist->setSelected( true ); } -bool PlaylistBrowser::savePlaylist( const QString &path, const QValueList &in_urls, - const QValueList &titles, const QValueList &lengths, +bool PlaylistBrowser::savePlaylist( const TQString &path, const TQValueList &in_urls, + const TQValueList &titles, const TQValueList &lengths, bool relative ) { if( path.isEmpty() ) return false; - QFile file( path ); + TQFile file( path ); if( !file.open( IO_WriteOnly ) ) { @@ -1793,14 +1793,14 @@ bool PlaylistBrowser::savePlaylist( const QString &path, const QValueList return false; } - QTextStream stream( &file ); + TQTextStream stream( &file ); stream << "#EXTM3U\n"; KURL::List urls; for( int i = 0, n = in_urls.count(); i < n; ++i ) { const KURL &url = in_urls[i]; - if( url.isLocalFile() && QFileInfo( url.path() ).isDir() ) + if( url.isLocalFile() && TQFileInfo( url.path() ).isDir() ) urls += recurse( url ); else urls += url; @@ -1813,14 +1813,14 @@ bool PlaylistBrowser::savePlaylist( const QString &path, const QValueList if( !titles.isEmpty() && !lengths.isEmpty() ) { stream << "#EXTINF:"; - stream << QString::number( lengths[i] ); + stream << TQString::number( lengths[i] ); stream << ','; stream << titles[i]; stream << '\n'; } if (url.protocol() == "file" ) { if ( relative ) { - const QFileInfo fi(file); + const TQFileInfo fi(file); stream << KURL::relativePath(fi.dirPath(), url.path()); } else stream << url.path(); @@ -1836,14 +1836,14 @@ bool PlaylistBrowser::savePlaylist( const QString &path, const QValueList return true; } -void PlaylistBrowser::openPlaylist( QListViewItem *parent ) //SLOT +void PlaylistBrowser::openPlaylist( TQListViewItem *parent ) //SLOT { // open a file selector to add playlists to the playlist browser - QStringList files; - files = KFileDialog::getOpenFileNames( QString::null, "*.m3u *.pls *.xspf|" + i18n("Playlist Files"), this, i18n("Import Playlists") ); + TQStringList files; + files = KFileDialog::getOpenFileNames( TQString::null, "*.m3u *.pls *.xspf|" + i18n("Playlist Files"), this, i18n("Import Playlists") ); - const QStringList::ConstIterator end = files.constEnd(); - for( QStringList::ConstIterator it = files.constBegin(); it != end; ++it ) + const TQStringList::ConstIterator end = files.constEnd(); + for( TQStringList::ConstIterator it = files.constBegin(); it != end; ++it ) addPlaylist( *it, parent ); savePlaylists(); @@ -1851,31 +1851,31 @@ void PlaylistBrowser::openPlaylist( QListViewItem *parent ) //SLOT void PlaylistBrowser::savePlaylists() { - QFile file( playlistBrowserCache() ); + TQFile file( playlistBrowserCache() ); - QDomDocument doc; - QDomElement playlistsB = m_playlistCategory->xml(); + TQDomDocument doc; + TQDomElement playlistsB = m_playlistCategory->xml(); playlistsB.setAttribute( "product", "Amarok" ); playlistsB.setAttribute( "version", APP_VERSION ); playlistsB.setAttribute( "formatversion", "1.1" ); - QDomNode playlistsNode = doc.importNode( playlistsB, true ); + TQDomNode playlistsNode = doc.importNode( playlistsB, true ); doc.appendChild( playlistsNode ); - QString temp( doc.toString() ); + TQString temp( doc.toString() ); // Only open the file after all data is ready. If it crashes, data is not lost! if ( !file.open( IO_WriteOnly ) ) return; - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); stream << "\n"; stream << temp; } -bool PlaylistBrowser::deletePlaylists( QPtrList items ) +bool PlaylistBrowser::deletePlaylists( TQPtrList items ) { KURL::List urls; - foreachType( QPtrList, items ) + foreachType( TQPtrList, items ) { urls.append( (*it)->url() ); } @@ -1892,7 +1892,7 @@ bool PlaylistBrowser::deletePlaylists( KURL::List items ) // TODO We need to check which files have been deleted successfully // Avoid deleting dirs. See bug #122480 for ( KURL::List::iterator it = items.begin(), end = items.end(); it != end; ++it ) { - if ( QFileInfo( (*it).path() ).isDir() ) { + if ( TQFileInfo( (*it).path() ).isDir() ) { it = items.remove( it ); continue; } @@ -1909,7 +1909,7 @@ void PlaylistBrowser::savePlaylist( PlaylistEntry *item ) append = true; //save the modified playlist in m3u or pls format - const QString ext = fileExtension( item->url().path() ); + const TQString ext = fileExtension( item->url().path() ); if( ext.lower() == "m3u" ) saveM3U( item, append ); else if ( ext.lower() == "xspf" ) @@ -1925,21 +1925,21 @@ void PlaylistBrowser::savePlaylist( PlaylistEntry *item ) **/ PlaylistBrowserEntry * -PlaylistBrowser::findItem( QString &t, int c ) const +PlaylistBrowser::findItem( TQString &t, int c ) const { return static_cast( m_listview->findItem( t, c, Qt::ExactMatch ) ); } -bool PlaylistBrowser::createPlaylist( QListViewItem *parent, bool current, QString title ) +bool PlaylistBrowser::createPlaylist( TQListViewItem *parent, bool current, TQString title ) { if( title.isEmpty() ) title = i18n("Untitled"); - const QString path = PlaylistDialog::getSaveFileName( title ); + const TQString path = PlaylistDialog::getSaveFileName( title ); if( path.isEmpty() ) return false; if( !parent ) - parent = static_cast( m_playlistCategory ); + parent = static_cast( m_playlistCategory ); if( current ) { @@ -1951,12 +1951,12 @@ bool PlaylistBrowser::createPlaylist( QListViewItem *parent, bool current, QStri { //Remove any items in Listview that have the same path as this one // Should only happen when overwriting a playlist - QListViewItem *item = parent->firstChild(); + TQListViewItem *item = parent->firstChild(); while( item ) { if( static_cast( item )->url() == path ) { - QListViewItem *todelete = item; + TQListViewItem *todelete = item; item = item->nextSibling(); delete todelete; } @@ -1965,8 +1965,8 @@ bool PlaylistBrowser::createPlaylist( QListViewItem *parent, bool current, QStri } //Remove existing playlist if it exists - if ( QFileInfo( path ).exists() ) - QFileInfo( path ).dir().remove( path ); + if ( TQFileInfo( path ).exists() ) + TQFileInfo( path ).dir().remove( path ); m_lastPlaylist = new PlaylistEntry( parent, 0, path ); parent->sortChildItems( 0, true ); @@ -1984,7 +1984,7 @@ void PlaylistBrowser::addSelectedToPlaylist( int options ) KURL::List list; - QListViewItemIterator it( m_listview, QListViewItemIterator::Selected ); + TQListViewItemIterator it( m_listview, TQListViewItemIterator::Selected ); for( ; it.current(); ++it ) { #define item (*it) @@ -2004,7 +2004,7 @@ void PlaylistBrowser::addSelectedToPlaylist( int options ) channel->load(); #undef channel KURL::List _list; - QListViewItem *child = item->firstChild(); + TQListViewItem *child = item->firstChild(); while( child ) { #define child static_cast(child) @@ -2037,20 +2037,20 @@ void PlaylistBrowser::addSelectedToPlaylist( int options ) } void -PlaylistBrowser::invokeItem( QListViewItem* i, const QPoint& point, int column ) //SLOT +PlaylistBrowser::invokeItem( TQListViewItem* i, const TQPoint& point, int column ) //SLOT { if( column == -1 ) return; PlaylistBrowserView *view = getListView(); - QPoint p = mapFromGlobal( point ); + TQPoint p = mapFromGlobal( point ); if ( p.x() > view->header()->sectionPos( view->header()->mapToIndex( 0 ) ) + view->treeStepSize() * ( i->depth() + ( view->rootIsDecorated() ? 1 : 0) ) + view->itemMargin() || p.x() < view->header()->sectionPos( view->header()->mapToIndex( 0 ) ) ) slotDoubleClicked( i ); } -void PlaylistBrowser::slotDoubleClicked( QListViewItem *item ) //SLOT +void PlaylistBrowser::slotDoubleClicked( TQListViewItem *item ) //SLOT { if( !item ) return; PlaylistBrowserEntry *entry = dynamic_cast(item); @@ -2085,17 +2085,17 @@ void PlaylistBrowser::removeSelectedItems() //SLOT int folderCount = 0; int lastfmCount = 0; - QPtrList playlistsToDelete; - QPtrList podcastsToDelete; + TQPtrList playlistsToDelete; + TQPtrList podcastsToDelete; - QPtrList playlistFoldersToDelete; - QPtrList podcastFoldersToDelete; + TQPtrList playlistFoldersToDelete; + TQPtrList podcastFoldersToDelete; //remove currentItem, no matter if selected or not m_listview->setSelected( m_listview->currentItem(), true ); - QPtrList selected; - QListViewItemIterator it( m_listview, QListViewItemIterator::Selected ); + TQPtrList selected; + TQListViewItemIterator it( m_listview, TQListViewItemIterator::Selected ); for( ; it.current(); ++it ) { if( !static_cast(*it)->isKept() ) @@ -2106,7 +2106,7 @@ void PlaylistBrowser::removeSelectedItems() //SLOT // if the playlist containing this item is already selected the current item will be skipped // it will be deleted from the parent - QListViewItem *parent = it.current()->parent(); + TQListViewItem *parent = it.current()->parent(); if( parent && parent->isSelected() ) //parent will remove children continue; @@ -2156,7 +2156,7 @@ void PlaylistBrowser::removeSelectedItems() //SLOT folderCount++; if( parent == m_playlistCategory ) { - for( QListViewItem *ch = (*it)->firstChild(); ch; ch = ch->nextSibling() ) + for( TQListViewItem *ch = (*it)->firstChild(); ch; ch = ch->nextSibling() ) { if( isCategory( ch ) ) { @@ -2174,7 +2174,7 @@ void PlaylistBrowser::removeSelectedItems() //SLOT } else if( parent == m_podcastCategory ) { - for( QListViewItem *ch = (*it)->firstChild(); ch; ch = ch->nextSibling() ) + for( TQListViewItem *ch = (*it)->firstChild(); ch; ch = ch->nextSibling() ) { if( isCategory( ch ) ) { @@ -2203,7 +2203,7 @@ void PlaylistBrowser::removeSelectedItems() //SLOT if( selected.isEmpty() && !totalCount ) return; - QString message = i18n( "

    You have selected:

      " ); + TQString message = i18n( "

      You have selected:

        " ); if( playlistCount ) message += "
      • " + i18n( "1 playlist", "%n playlists", playlistCount ) + "
      • "; @@ -2226,12 +2226,12 @@ void PlaylistBrowser::removeSelectedItems() //SLOT if( totalCount > 0 ) { - int button = KMessageBox::warningContinueCancel( this, message, QString::null, KStdGuiItem::del() ); + int button = KMessageBox::warningContinueCancel( this, message, TQString::null, KStdGuiItem::del() ); if( button != KMessageBox::Continue ) return; } - foreachType( QPtrList, selected ) + foreachType( TQPtrList, selected ) { if ( isPlaylistTrackItem( *it ) ) { @@ -2248,7 +2248,7 @@ void PlaylistBrowser::removeSelectedItems() //SLOT { if( deletePlaylists( playlistsToDelete ) ) { - foreachType( QPtrList, playlistsToDelete ) + foreachType( TQPtrList, playlistsToDelete ) { m_dynamicEntries.remove(*it); delete (*it); @@ -2259,14 +2259,14 @@ void PlaylistBrowser::removeSelectedItems() //SLOT if( podcastCount ) { if( deletePodcasts( podcastsToDelete ) ) - foreachType( QPtrList, podcastsToDelete ) + foreachType( TQPtrList, podcastsToDelete ) delete (*it); } - foreachType( QPtrList, playlistFoldersToDelete ) + foreachType( TQPtrList, playlistFoldersToDelete ) delete (*it); - foreachType( QPtrList, podcastFoldersToDelete ) + foreachType( TQPtrList, podcastFoldersToDelete ) removePodcastFolder( *it ); if( playlistCount || trackCount ) @@ -2289,10 +2289,10 @@ void PlaylistBrowser::removePodcastFolder( PlaylistCategory *item ) return; } - QListViewItem *child = item->firstChild(); + TQListViewItem *child = item->firstChild(); while( child ) { - QListViewItem *nextChild = 0; + TQListViewItem *nextChild = 0; if( isPodcastChannel( child ) ) { #define child static_cast(child) @@ -2315,7 +2315,7 @@ void PlaylistBrowser::removePodcastFolder( PlaylistCategory *item ) void PlaylistBrowser::renameSelectedItem() //SLOT { - QListViewItem *item = m_listview->currentItem(); + TQListViewItem *item = m_listview->currentItem(); if( !item ) return; if( item == m_randomDynamic || item == m_suggestedDynamic ) @@ -2327,7 +2327,7 @@ void PlaylistBrowser::renameSelectedItem() //SLOT } -void PlaylistBrowser::renamePlaylist( QListViewItem* item, const QString& newName, int ) //SLOT +void PlaylistBrowser::renamePlaylist( TQListViewItem* item, const TQString& newName, int ) //SLOT { PlaylistBrowserEntry *entry = dynamic_cast( item ); if ( entry ) @@ -2337,14 +2337,14 @@ void PlaylistBrowser::renamePlaylist( QListViewItem* item, const QString& newNam void PlaylistBrowser::saveM3U( PlaylistEntry *item, bool append ) { - QFile file( item->url().path() ); + TQFile file( item->url().path() ); if( append ? file.open( IO_WriteOnly | IO_Append ) : file.open( IO_WriteOnly ) ) { - QTextStream stream( &file ); + TQTextStream stream( &file ); if( !append ) stream << "#EXTM3U\n"; - QPtrList trackList = append ? item->droppedTracks() : item->trackList(); + TQPtrList trackList = append ? item->droppedTracks() : item->trackList(); for( TrackItemInfo *info = trackList.first(); info; info = trackList.next() ) { stream << "#EXTINF:"; @@ -2369,7 +2369,7 @@ void PlaylistBrowser::saveXSPF( PlaylistEntry *item, bool append ) XSPFtrackList list; - QPtrList trackList = append ? item->droppedTracks() : item->trackList(); + TQPtrList trackList = append ? item->droppedTracks() : item->trackList(); for( TrackItemInfo *info = trackList.first(); info; info = trackList.next() ) { XSPFtrack track; @@ -2382,12 +2382,12 @@ void PlaylistBrowser::saveXSPF( PlaylistEntry *item, bool append ) playlist->setTrackList( list, append ); - QFile file( item->url().path() ); + TQFile file( item->url().path() ); if ( !file.open( IO_WriteOnly ) ) warning() << "Could not open file " << file.name() << " write-only" << endl; else { - QTextStream stream ( &file ); + TQTextStream stream ( &file ); playlist->save( stream, 2 ); file.close(); } @@ -2396,12 +2396,12 @@ void PlaylistBrowser::saveXSPF( PlaylistEntry *item, bool append ) void PlaylistBrowser::savePLS( PlaylistEntry *item, bool append ) { - QFile file( item->url().path() ); + TQFile file( item->url().path() ); if( append ? file.open( IO_WriteOnly | IO_Append ) : file.open( IO_WriteOnly ) ) { - QTextStream stream( &file ); - QPtrList trackList = append ? item->droppedTracks() : item->trackList(); + TQTextStream stream( &file ); + TQPtrList trackList = append ? item->droppedTracks() : item->trackList(); stream << "NumberOfEntries=" << trackList.count() << endl; int c=1; for( TrackItemInfo *info = trackList.first(); info; info = trackList.next(), ++c ) @@ -2421,12 +2421,12 @@ void PlaylistBrowser::savePLS( PlaylistEntry *item, bool append ) } #include -#include +#include #include "playlistloader.h" //this function (C) Copyright 2003-4 Max Howell, (C) Copyright 2004 Mark Kretschmann KURL::List PlaylistBrowser::recurse( const KURL &url ) { - typedef QMap FileMap; + typedef TQMap FileMap; KDirLister lister( false ); lister.setAutoUpdate( false ); @@ -2434,9 +2434,9 @@ KURL::List PlaylistBrowser::recurse( const KURL &url ) lister.openURL( url ); while( !lister.isFinished() ) - kapp->eventLoop()->processEvents( QEventLoop::ExcludeUserInput ); + kapp->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput ); - KFileItemList items = lister.items(); //returns QPtrList, so we MUST only do it once! + KFileItemList items = lister.items(); //returns TQPtrList, so we MUST only do it once! KURL::List urls; FileMap files; for( KFileItem *item = items.first(); item; item = items.next() ) { @@ -2455,7 +2455,7 @@ KURL::List PlaylistBrowser::recurse( const KURL &url ) } -void PlaylistBrowser::currentItemChanged( QListViewItem *item ) //SLOT +void PlaylistBrowser::currentItemChanged( TQListViewItem *item ) //SLOT { // rename remove and delete buttons are disabled if there are no playlists // rename and delete buttons are disabled for track items @@ -2489,7 +2489,7 @@ void PlaylistBrowser::currentItemChanged( QListViewItem *item ) //SLOT } -void PlaylistBrowser::customEvent( QCustomEvent *e ) +void PlaylistBrowser::customEvent( TQCustomEvent *e ) { // If a playlist is found in collection folders it will be automatically added to the playlist browser // The ScanController sends a PlaylistFoundEvent when a playlist is found. @@ -2543,7 +2543,7 @@ void PlaylistBrowser::slotAddPlaylistMenu( int id ) //SLOT ************************ **/ -void PlaylistBrowser::showContextMenu( QListViewItem *item, const QPoint &p, int ) //SLOT +void PlaylistBrowser::showContextMenu( TQListViewItem *item, const TQPoint &p, int ) //SLOT { if( !item ) return; @@ -2556,14 +2556,14 @@ void PlaylistBrowser::showContextMenu( QListViewItem *item, const QPoint &p, int // CLASS PlaylistBrowserView //////////////////////////////////////////////////////////////////////////// -PlaylistBrowserView::PlaylistBrowserView( QWidget *parent, const char *name ) +PlaylistBrowserView::PlaylistBrowserView( TQWidget *parent, const char *name ) : KListView( parent, name ) , m_marker( 0 ) { addColumn( i18n("Playlists") ); - setSelectionMode( QListView::Extended ); - setResizeMode( QListView::AllColumns ); + setSelectionMode( TQListView::Extended ); + setResizeMode( TQListView::AllColumns ); setShowSortIndicator( true ); setRootIsDecorated( true ); @@ -2574,26 +2574,26 @@ PlaylistBrowserView::PlaylistBrowserView( QWidget *parent, const char *name ) setTreeStepSize( 20 ); - connect( this, SIGNAL( mouseButtonPressed ( int, QListViewItem *, const QPoint &, int ) ), - this, SLOT( mousePressed( int, QListViewItem *, const QPoint &, int ) ) ); + connect( this, TQT_SIGNAL( mouseButtonPressed ( int, TQListViewItem *, const TQPoint &, int ) ), + this, TQT_SLOT( mousePressed( int, TQListViewItem *, const TQPoint &, int ) ) ); //TODO moving tracks - //connect( this, SIGNAL( moved(QListViewItem *, QListViewItem *, QListViewItem * )), - // this, SLOT( itemMoved(QListViewItem *, QListViewItem *, QListViewItem * ))); + //connect( this, TQT_SIGNAL( moved(TQListViewItem *, TQListViewItem *, TQListViewItem * )), + // this, TQT_SLOT( itemMoved(TQListViewItem *, TQListViewItem *, TQListViewItem * ))); } PlaylistBrowserView::~PlaylistBrowserView() { } -void PlaylistBrowserView::contentsDragEnterEvent( QDragEnterEvent *e ) +void PlaylistBrowserView::contentsDragEnterEvent( TQDragEnterEvent *e ) { e->accept( e->source() == viewport() || KURLDrag::canDecode( e ) ); } -void PlaylistBrowserView::contentsDragMoveEvent( QDragMoveEvent* e ) +void PlaylistBrowserView::contentsDragMoveEvent( TQDragMoveEvent* e ) { //Get the closest item _before_ the cursor - const QPoint p = contentsToViewport( e->pos() ); - QListViewItem *item = itemAt( p ); + const TQPoint p = contentsToViewport( e->pos() ); + TQListViewItem *item = itemAt( p ); if( !item ) { eraseMarker(); return; @@ -2611,19 +2611,19 @@ void PlaylistBrowserView::contentsDragMoveEvent( QDragMoveEvent* e ) } } -void PlaylistBrowserView::contentsDragLeaveEvent( QDragLeaveEvent* ) +void PlaylistBrowserView::contentsDragLeaveEvent( TQDragLeaveEvent* ) { eraseMarker(); } -void PlaylistBrowserView::contentsDropEvent( QDropEvent *e ) +void PlaylistBrowserView::contentsDropEvent( TQDropEvent *e ) { - QListViewItem *parent = 0; - QListViewItem *after; + TQListViewItem *parent = 0; + TQListViewItem *after; - const QPoint p = contentsToViewport( e->pos() ); - QListViewItem *item = itemAt( p ); + const TQPoint p = contentsToViewport( e->pos() ); + TQListViewItem *item = itemAt( p ); if( !item ) { eraseMarker(); return; @@ -2640,13 +2640,13 @@ void PlaylistBrowserView::contentsDropEvent( QDropEvent *e ) } else { KURL::List decodedList; - QValueList bundles; + TQValueList bundles; if( KURLDrag::decode( e, decodedList ) ) { KURL::List::ConstIterator it = decodedList.begin(); MetaBundle first( *it ); - const QString album = first.album(); - const QString artist = first.artist(); + const TQString album = first.album(); + const TQString artist = first.artist(); int suggestion = !album.stripWhiteSpace().isEmpty() ? 1 : !artist.stripWhiteSpace().isEmpty() ? 2 : 3; @@ -2654,7 +2654,7 @@ void PlaylistBrowserView::contentsDropEvent( QDropEvent *e ) { if( isCategory(item) ) { // check if it is podcast category - QListViewItem *cat = item; + TQListViewItem *cat = item; while( isCategory(cat) && cat!=PlaylistBrowser::instance()->podcastCategory() ) cat = cat->parent(); @@ -2663,7 +2663,7 @@ void PlaylistBrowserView::contentsDropEvent( QDropEvent *e ) continue; } - QString filename = (*it).fileName(); + TQString filename = (*it).fileName(); if( filename.endsWith("m3u") || filename.endsWith("pls") ) PlaylistBrowser::instance()->addPlaylist( (*it).path() ); @@ -2698,7 +2698,7 @@ void PlaylistBrowserView::contentsDropEvent( QDropEvent *e ) } else //dropped on a playlist item { - QListViewItem *parent = item; + TQListViewItem *parent = item; bool isPlaylistFolder = false; while( parent ) @@ -2719,9 +2719,9 @@ void PlaylistBrowserView::contentsDropEvent( QDropEvent *e ) else if( isCategory( item ) && isPlaylistFolder ) { PlaylistBrowser *pb = PlaylistBrowser::instance(); - QString title = suggestion == 1 ? album + TQString title = suggestion == 1 ? album : suggestion == 2 ? artist - : QString::null; + : TQString::null; if ( pb->createPlaylist( item, false, title ) ) pb->m_lastPlaylist->insertTracks( 0, bundles ); } @@ -2737,7 +2737,7 @@ void PlaylistBrowserView::eraseMarker() //SLOT { if( m_marker ) { - QRect spot; + TQRect spot; if( isPlaylist( m_marker ) ) spot = drawItemHighlighter( 0, m_marker ); else @@ -2748,22 +2748,22 @@ void PlaylistBrowserView::eraseMarker() //SLOT } } -void PlaylistBrowserView::viewportPaintEvent( QPaintEvent *e ) +void PlaylistBrowserView::viewportPaintEvent( TQPaintEvent *e ) { if( e ) KListView::viewportPaintEvent( e ); //we call with 0 in contentsDropEvent() if( m_marker ) { - QPainter painter( viewport() ); + TQPainter painter( viewport() ); if( isPlaylist( m_marker ) ) //when dragging on a playlist we draw a focus rect drawItemHighlighter( &painter, m_marker ); else //when dragging on a track we draw a line marker painter.fillRect( drawDropVisualizer( 0, 0, m_marker ), - QBrush( colorGroup().highlight(), QBrush::Dense4Pattern ) ); + TQBrush( colorGroup().highlight(), TQBrush::Dense4Pattern ) ); } } -void PlaylistBrowserView::mousePressed( int button, QListViewItem *item, const QPoint &pnt, int ) //SLOT +void PlaylistBrowserView::mousePressed( int button, TQListViewItem *item, const TQPoint &pnt, int ) //SLOT { // this function expande/collapse the playlist if the +/- symbol has been pressed // and show the save menu if the save icon has been pressed @@ -2772,12 +2772,12 @@ void PlaylistBrowserView::mousePressed( int button, QListViewItem *item, const Q if( isPlaylist( item ) ) { - QPoint p = mapFromGlobal( pnt ); + TQPoint p = mapFromGlobal( pnt ); p.setY( p.y() - header()->height() ); - QRect itemrect = itemRect( item ); + TQRect itemrect = itemRect( item ); - QRect expandRect = QRect( 4, itemrect.y() + (item->height()/2) - 5, 15, 15 ); + TQRect expandRect = TQRect( 4, itemrect.y() + (item->height()/2) - 5, 15, 15 ); if( expandRect.contains( p ) ) { //expand symbol clicked setOpen( item, !item->isOpen() ); return; @@ -2785,12 +2785,12 @@ void PlaylistBrowserView::mousePressed( int button, QListViewItem *item, const Q } } -void PlaylistBrowserView::moveSelectedItems( QListViewItem *newParent ) +void PlaylistBrowserView::moveSelectedItems( TQListViewItem *newParent ) { if( !newParent ) return; - QListViewItem *after=0; + TQListViewItem *after=0; if( isDynamic( newParent ) || isPodcastChannel( newParent ) || isSmartPlaylist( newParent ) || isPodcastEpisode( newParent ) || isStream( newParent ) ) { @@ -2803,8 +2803,8 @@ void PlaylistBrowserView::moveSelectedItems( QListViewItem *newParent ) return; #undef newParent - QPtrList selected; - QListViewItemIterator it( this, QListViewItemIterator::Selected ); + TQPtrList selected; + TQListViewItemIterator it( this, TQListViewItemIterator::Selected ); for( ; it.current(); ++it ) { if( !(*it)->parent() ) //must be a base category we are draggin' @@ -2813,9 +2813,9 @@ void PlaylistBrowserView::moveSelectedItems( QListViewItem *newParent ) selected.append( *it ); } - for( QListViewItem *item = selected.first(); item; item = selected.next() ) + for( TQListViewItem *item = selected.first(); item; item = selected.next() ) { - QListViewItem *itemParent = item->parent(); + TQListViewItem *itemParent = item->parent(); if( isPlaylistTrackItem( item ) ) { if( isPlaylistTrackItem( newParent ) ) @@ -2840,7 +2840,7 @@ void PlaylistBrowserView::moveSelectedItems( QListViewItem *newParent ) else if( !isCategory( newParent ) ) continue; - QListViewItem *base = newParent; + TQListViewItem *base = newParent; while( base->parent() ) base = base->parent(); @@ -2872,11 +2872,11 @@ void PlaylistBrowserView::moveSelectedItems( QListViewItem *newParent ) } } -void PlaylistBrowserView::rename( QListViewItem *item, int c ) +void PlaylistBrowserView::rename( TQListViewItem *item, int c ) { KListView::rename( item, c ); - QRect rect( itemRect( item ) ); + TQRect rect( itemRect( item ) ); int fieldX = rect.x() + treeStepSize() + 2; int fieldW = rect.width() - treeStepSize() - 2; @@ -2885,7 +2885,7 @@ void PlaylistBrowserView::rename( QListViewItem *item, int c ) renameEdit->show(); } -void PlaylistBrowserView::keyPressEvent( QKeyEvent *e ) +void PlaylistBrowserView::keyPressEvent( TQKeyEvent *e ) { switch( e->key() ) { case Key_Space: //load @@ -2916,8 +2916,8 @@ void PlaylistBrowserView::startDrag() PodcastEpisode *lastPodcastEpisode = 0; // keep track of the last podcastepisode we visited. KMultipleDrag *drag = new KMultipleDrag( this ); - QListViewItemIterator it( this, QListViewItemIterator::Selected ); - QString pixText = QString::null; + TQListViewItemIterator it( this, TQListViewItemIterator::Selected ); + TQString pixText = TQString::null; uint count = 0; for( ; it.current(); ++it ) @@ -2952,7 +2952,7 @@ void PlaylistBrowserView::startDrag() else if( isPodcastEpisode( *it ) ) { if( (*it)->parent()->isSelected() ) continue; - if( !podList.isEmpty() && lastPodcastEpisode && lastPodcastEpisode->QListViewItem::parent() != (*it)->parent() ) + if( !podList.isEmpty() && lastPodcastEpisode && lastPodcastEpisode->TQListViewItem::parent() != (*it)->parent() ) { // we moved onto a new podcast channel urls += podList; podList.clear(); @@ -2978,7 +2978,7 @@ void PlaylistBrowserView::startDrag() if( !item->isPolished() ) item->load(); - QListViewItem *child = item->firstChild(); + TQListViewItem *child = item->firstChild(); KURL::List tmp; // we add the podcasts in reverse, its much nicer to add them chronologically :) while( child ) @@ -3002,11 +3002,11 @@ void PlaylistBrowserView::startDrag() if( !item->query().isEmpty() ) { - QTextDrag *textdrag = new QTextDrag( item->text(0) + '\n' + item->query(), 0 ); + TQTextDrag *textdrag = new TQTextDrag( item->text(0) + '\n' + item->query(), 0 ); textdrag->setSubtype( "amarok-sql" ); drag->addDragObject( textdrag ); } - itemList += KURL::fromPathOrURL( QString("smartplaylist://%1").arg( item->text(0) ) ); + itemList += KURL::fromPathOrURL( TQString("smartplaylist://%1").arg( item->text(0) ) ); pixText = (*it)->text(0); } @@ -3015,12 +3015,12 @@ void PlaylistBrowserView::startDrag() DynamicEntry *item = static_cast( *it ); // Serialize pointer to string - const QString str = QString::number( reinterpret_cast( item ) ); + const TQString str = TQString::number( reinterpret_cast( item ) ); - QTextDrag *textdrag = new QTextDrag( str, 0 ); + TQTextDrag *textdrag = new TQTextDrag( str, 0 ); textdrag->setSubtype( "dynamic" ); drag->addDragObject( textdrag ); - itemList += KURL::fromPathOrURL( QString("dynamic://%1").arg( item->text(0) ) ); + itemList += KURL::fromPathOrURL( TQString("dynamic://%1").arg( item->text(0) ) ); pixText = (*it)->text(0); } @@ -3036,11 +3036,11 @@ void PlaylistBrowserView::startDrag() if( !podList.isEmpty() ) urls += podList; - if( count > 1 ) pixText = QString::null; + if( count > 1 ) pixText = TQString::null; drag->addDragObject( new KURLDrag( urls, viewport() ) ); drag->setPixmap( CollectionDB::createDragPixmap( itemList, pixText ), - QPoint( CollectionDB::DRAGPIXMAP_OFFSET_X, CollectionDB::DRAGPIXMAP_OFFSET_Y ) ); + TQPoint( CollectionDB::DRAGPIXMAP_OFFSET_X, CollectionDB::DRAGPIXMAP_OFFSET_Y ) ); drag->dragCopy(); } @@ -3048,25 +3048,25 @@ void PlaylistBrowserView::startDrag() // CLASS PlaylistDialog //////////////////////////////////////////////////////////////////////////// -QString PlaylistDialog::getSaveFileName( const QString &suggestion, bool proposeOverwriting ) //static +TQString PlaylistDialog::getSaveFileName( const TQString &suggestion, bool proposeOverwriting ) //static { PlaylistDialog dialog; if( !suggestion.isEmpty() ) { - QString path = Amarok::saveLocation("playlists/") + "%1" + ".m3u"; - if( QFileInfo( path.arg( suggestion ) ).exists() && !proposeOverwriting ) + TQString path = Amarok::saveLocation("playlists/") + "%1" + ".m3u"; + if( TQFileInfo( path.arg( suggestion ) ).exists() && !proposeOverwriting ) { int n = 2; - while( QFileInfo( path.arg( i18n( "%1 (%2)" ).arg( suggestion, QString::number( n ) ) ) ).exists() ) + while( TQFileInfo( path.arg( i18n( "%1 (%2)" ).arg( suggestion, TQString::number( n ) ) ) ).exists() ) n++; - dialog.edit->setText( i18n( "%1 (%2)" ).arg( suggestion, QString::number( n ) ) ); + dialog.edit->setText( i18n( "%1 (%2)" ).arg( suggestion, TQString::number( n ) ) ); } else dialog.edit->setText( suggestion ); } if( dialog.exec() == Accepted ) return dialog.result; - return QString(); + return TQString(); } PlaylistDialog::PlaylistDialog() @@ -3075,28 +3075,28 @@ PlaylistDialog::PlaylistDialog() KGuiItem( i18n( "Save to location..." ), SmallIconSet( Amarok::icon( "files" ) ) ) ) , customChosen( false ) { - QVBox *vbox = makeVBoxMainWidget(); - QLabel *label = new QLabel( i18n( "&Enter a name for the playlist:" ), vbox ); + TQVBox *vbox = makeVBoxMainWidget(); + TQLabel *label = new TQLabel( i18n( "&Enter a name for the playlist:" ), vbox ); edit = new KLineEdit( vbox ); edit->setFocus(); label->setBuddy( edit ); enableButtonOK( false ); - connect( edit, SIGNAL( textChanged( const QString & ) ), - this, SLOT( slotTextChanged( const QString& ) ) ); - connect( this, SIGNAL( user1Clicked() ), SLOT( slotCustomPath() ) ); + connect( edit, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SLOT( slotTextChanged( const TQString& ) ) ); + connect( this, TQT_SIGNAL( user1Clicked() ), TQT_SLOT( slotCustomPath() ) ); } void PlaylistDialog::slotOk() { // TODO Remove this hack for 1.2. It's needed because playlists was a file once. - QString folder = Amarok::saveLocation( "playlists" ); - QFileInfo info( folder ); - if ( !info.isDir() ) QFile::remove( folder ); + TQString folder = Amarok::saveLocation( "playlists" ); + TQFileInfo info( folder ); + if ( !info.isDir() ) TQFile::remove( folder ); if( !customChosen && !edit->text().isEmpty() ) result = Amarok::saveLocation( "playlists/" ) + edit->text() + ".m3u"; - if( !QFileInfo( result ).exists() || + if( !TQFileInfo( result ).exists() || KMessageBox::warningContinueCancel( PlaylistWindow::self(), i18n( "A playlist named \"%1\" already exists. Do you want to overwrite it?" ).arg( edit->text() ), @@ -3106,7 +3106,7 @@ void PlaylistDialog::slotOk() } } -void PlaylistDialog::slotTextChanged( const QString &s ) +void PlaylistDialog::slotTextChanged( const TQString &s ) { enableButtonOK( !s.isEmpty() ); } @@ -3124,23 +3124,23 @@ void PlaylistDialog::slotCustomPath() } -InfoPane::InfoPane( QWidget *parent ) - : QVBox( parent ), +InfoPane::InfoPane( TQWidget *parent ) + : TQVBox( parent ), m_enable( false ), m_storedHeight( 100 ) { - QFrame *container = new QVBox( this, "container" ); + TQFrame *container = new TQVBox( this, "container" ); container->hide(); { - QFrame *box = new QHBox( container ); + TQFrame *box = new TQHBox( container ); box->setMargin( 3 ); box->setBackgroundMode( Qt::PaletteBase ); m_infoBrowser = new HTMLView( box, "extended_info", false /*DNDEnabled*/, false /*JS enabled*/ ); - container->setFrameStyle( QFrame::StyledPanel ); + container->setFrameStyle( TQFrame::StyledPanel ); container->setMargin( 3 ); container->setBackgroundMode( Qt::PaletteBase ); } @@ -3148,7 +3148,7 @@ InfoPane::InfoPane( QWidget *parent ) m_pushButton = new KPushButton( KGuiItem( i18n("&Show Extended Info"), "info" ), this ); m_pushButton->setToggleButton( true ); m_pushButton->setEnabled( m_enable ); - connect( m_pushButton, SIGNAL(toggled( bool )), SLOT(toggle( bool )) ); + connect( m_pushButton, TQT_SIGNAL(toggled( bool )), TQT_SLOT(toggle( bool )) ); //Set the height to fixed. The button shouldn't be resized. setFixedHeight( m_pushButton->sizeHint().height() ); @@ -3165,10 +3165,10 @@ InfoPane::~InfoPane() int InfoPane::getHeight() { - if( static_cast( child( "container" ) )->isShown() ) + if( static_cast( child( "container" ) )->isShown() ) { //If the InfoPane is shown, return true height. - return static_cast( parentWidget() )->sizes().last(); + return static_cast( parentWidget() )->sizes().last(); } return m_storedHeight; @@ -3182,7 +3182,7 @@ InfoPane::setStoredHeight( const int newHeight ) { void InfoPane::toggle( bool toggled ) { - QSplitter *splitter = static_cast( parentWidget() ); + TQSplitter *splitter = static_cast( parentWidget() ); if ( !toggled ) { @@ -3200,7 +3200,7 @@ InfoPane::toggle( bool toggled ) //Restore the height of the InfoPane (change the splitter properties) //Done every time since the pane forgets its height if you try to resize it while the info is hidden. - QValueList sizes = splitter->sizes(); + TQValueList sizes = splitter->sizes(); const int sizeOffset = getHeight() - sizes.last(); sizes.first() -= sizeOffset; sizes.last() += sizeOffset; @@ -3209,28 +3209,28 @@ InfoPane::toggle( bool toggled ) setMinimumHeight( 150 ); } - static_cast( child( "container" ) )->setShown( toggled ); + static_cast( child( "container" ) )->setShown( toggled ); } void -InfoPane::setInfo( const QString &title, const QString &info ) +InfoPane::setInfo( const TQString &title, const TQString &info ) { //If the info pane is not shown, we can enable or disable the button depending on //whether there is content to show. Otherwise, just remember what we wanted to do //so we can do it later, when the user does hide the pane. m_enable = !( info.isEmpty() && title.isEmpty() ); - if ( !static_cast(child("container"))->isShown() ) + if ( !static_cast(child("container"))->isShown() ) m_pushButton->setEnabled( m_enable ); if( m_pushButton->isOn() ) toggle( !(info.isEmpty() && title.isEmpty()) ); - QString info_ = info; + TQString info_ = info; info_.replace( "\n", "
        " ); m_infoBrowser->set( m_enable ? - QString( "
        " + TQString( "
        " "
        " "" " %1 " @@ -3244,7 +3244,7 @@ InfoPane::setInfo( const QString &title, const QString &info ) "" "" "
        " ).arg( title, info_ ) : - QString::null ); + TQString::null ); } #include "playlistbrowser.moc" diff --git a/amarok/src/playlistbrowser.h b/amarok/src/playlistbrowser.h index 7ec42dd0..fd0e2d01 100644 --- a/amarok/src/playlistbrowser.h +++ b/amarok/src/playlistbrowser.h @@ -18,21 +18,21 @@ #include #include #include -#include -#include -#include +#include +#include +#include class KTextBrowser; class KToolBar; -class QCustomEvent; -class QColorGroup; -class QDragObject; -class QPainter; -class QPixmap; -class QPoint; -class QSplitter; -class QTimer; +class TQCustomEvent; +class TQColorGroup; +class TQDragObject; +class TQPainter; +class TQPixmap; +class TQPoint; +class TQSplitter; +class TQTimer; class HTMLView; class InfoPane; @@ -62,38 +62,38 @@ class PlaylistBrowser : public QVBox ~PlaylistBrowser(); - void setInfo( const QString &title, const QString &info ); + void setInfo( const TQString &title, const TQString &info ); - void addStream( QListViewItem *parent = 0 ); - void addSmartPlaylist( QListViewItem *parent = 0 ); - void addDynamic( QListViewItem *parent = 0 ); - void addPlaylist( const QString &path, QListViewItem *parent = 0, bool force=false, bool imported=false ); - PlaylistEntry *findPlaylistEntry( const QString &url, QListViewItem *parent=0 ) const; - int loadPlaylist( const QString &playlist, bool force=false ); + void addStream( TQListViewItem *parent = 0 ); + void addSmartPlaylist( TQListViewItem *parent = 0 ); + void addDynamic( TQListViewItem *parent = 0 ); + void addPlaylist( const TQString &path, TQListViewItem *parent = 0, bool force=false, bool imported=false ); + PlaylistEntry *findPlaylistEntry( const TQString &url, TQListViewItem *parent=0 ) const; + int loadPlaylist( const TQString &playlist, bool force=false ); - void addPodcast( QListViewItem *parent = 0 ); - void addPodcast( const KURL &url, QListViewItem *parent = 0 ); + void addPodcast( TQListViewItem *parent = 0 ); + void addPodcast( const KURL &url, TQListViewItem *parent = 0 ); void loadPodcastsFromDatabase( PlaylistCategory *p = 0 ); - void registerPodcastSettings( const QString &title, const PodcastSettings *settings ); + void registerPodcastSettings( const TQString &title, const PodcastSettings *settings ); - static bool savePlaylist( const QString &path, const QValueList &urls, - const QValueList &titles = QValueList(), - const QValueList &lengths = QValueList(), + static bool savePlaylist( const TQString &path, const TQValueList &urls, + const TQValueList &titles = TQValueList(), + const TQValueList &lengths = TQValueList(), bool relative = AmarokConfig::relativePlaylist() ); - QString dynamicBrowserCache() const; - QString playlistBrowserCache() const; - QString podcastBrowserCache() const; - QString streamBrowserCache() const; - QString smartplaylistBrowserCache() const; + TQString dynamicBrowserCache() const; + TQString playlistBrowserCache() const; + TQString podcastBrowserCache() const; + TQString streamBrowserCache() const; + TQString smartplaylistBrowserCache() const; - PlaylistBrowserEntry *findItem( QString &t, int c ) const; - QListViewItem *findItemInTree( const QString &searchstring, int c ) const; + PlaylistBrowserEntry *findItem( TQString &t, int c ) const; + TQListViewItem *findItemInTree( const TQString &searchstring, int c ) const; PodcastEpisode *findPodcastEpisode( const KURL &episode, const KURL &feed ) const; - QPtrList dynamicEntries() const { return m_dynamicEntries; } - DynamicMode *findDynamicModeByTitle( const QString &title ); - QListViewItem *podcastCategory() const { return m_podcastCategory; } + TQPtrList dynamicEntries() const { return m_dynamicEntries; } + DynamicMode *findDynamicModeByTitle( const TQString &title ); + TQListViewItem *podcastCategory() const { return m_podcastCategory; } static PlaylistBrowser *instance() { if(!s_instance) s_instance = new PlaylistBrowser("PlaylistBrowser"); @@ -106,31 +106,31 @@ class PlaylistBrowser : public QVBox void saveDynamics(); protected: - virtual void resizeEvent( QResizeEvent * ); + virtual void resizeEvent( TQResizeEvent * ); signals: void selectionChanged(); public slots: - void openPlaylist( QListViewItem *parent = 0 ); + void openPlaylist( TQListViewItem *parent = 0 ); void scanPodcasts(); private slots: void abortPodcastQueue(); void addSelectedToPlaylist( int options = -1 ); void collectionScanDone(); - void currentItemChanged( QListViewItem * ); + void currentItemChanged( TQListViewItem * ); void downloadPodcastQueue(); void editStreamURL( StreamEntry *item, const bool readOnly=false ); void removeSelectedItems(); - void renamePlaylist( QListViewItem*, const QString&, int ); + void renamePlaylist( TQListViewItem*, const TQString&, int ); void renameSelectedItem(); - void invokeItem( QListViewItem*, const QPoint &, int column ); - void slotDoubleClicked( QListViewItem *item ); + void invokeItem( TQListViewItem*, const TQPoint &, int column ); + void slotDoubleClicked( TQListViewItem *item ); void slotAddMenu( int id ); void slotAddPlaylistMenu( int id ); - void showContextMenu( QListViewItem*, const QPoint&, int ); + void showContextMenu( TQListViewItem*, const TQPoint&, int ); void loadDynamicItems(); @@ -145,46 +145,46 @@ class PlaylistBrowser : public QVBox void saveStreams(); void loadLastfmStreams( const bool subscriber = false ); - void addLastFmRadio( QListViewItem *parent ); - void addLastFmCustomRadio( QListViewItem *parent ); + void addLastFmRadio( TQListViewItem *parent ); + void addLastFmCustomRadio( TQListViewItem *parent ); void saveLastFm(); PlaylistCategory* loadSmartPlaylists(); void loadDefaultSmartPlaylists(); void editSmartPlaylist( SmartPlaylist* ); void saveSmartPlaylists( PlaylistCategory *smartCategory = NULL ); - void updateSmartPlaylists( QListViewItem *root ); - void updateSmartPlaylistElement( QDomElement& query ); + void updateSmartPlaylists( TQListViewItem *root ); + void updateSmartPlaylistElement( TQDomElement& query ); PlaylistCategory* loadDynamics(); - void fixDynamicPlaylistPath( QListViewItem *item ); - QString guessPathFromPlaylistName( QString name ); + void fixDynamicPlaylistPath( TQListViewItem *item ); + TQString guessPathFromPlaylistName( TQString name ); PlaylistCategory* loadPodcasts(); - QMap loadPodcastFolders( PlaylistCategory *p ); + TQMap loadPodcastFolders( PlaylistCategory *p ); void changePodcastInterval(); - void configurePodcasts( QListViewItem *parent ); - void configurePodcasts( QPtrList &podcastChannelList, const QString &caption ); + void configurePodcasts( TQListViewItem *parent ); + void configurePodcasts( TQPtrList &podcastChannelList, const TQString &caption ); void configureSelectedPodcasts(); bool deleteSelectedPodcastItems( const bool removeItem=false, const bool silent=false ); - bool deletePodcasts( QPtrList items ); + bool deletePodcasts( TQPtrList items ); void downloadSelectedPodcasts(); - void refreshPodcasts( QListViewItem *category ); + void refreshPodcasts( TQListViewItem *category ); void removePodcastFolder( PlaylistCategory *item ); void savePodcastFolderStates( PlaylistCategory *folder ); - PodcastChannel *findPodcastChannel( const KURL &feed, QListViewItem *parent=0 ) const; + PodcastChannel *findPodcastChannel( const KURL &feed, TQListViewItem *parent=0 ) const; void markDynamicEntries(); - PlaylistBrowserEntry* findByName( QString name ); + PlaylistBrowserEntry* findByName( TQString name ); PlaylistCategory* loadPlaylists(); void savePlaylists(); void savePlaylist( PlaylistEntry * ); - bool createPlaylist( QListViewItem *parent = 0, bool current = true, QString title = 0 ); - bool deletePlaylists( QPtrList items ); + bool createPlaylist( TQListViewItem *parent = 0, bool current = true, TQString title = 0 ); + bool deletePlaylists( TQPtrList items ); bool deletePlaylists( KURL::List items ); - void customEvent( QCustomEvent* e ); + void customEvent( TQCustomEvent* e ); void saveM3U( PlaylistEntry *, bool append ); void savePLS( PlaylistEntry *, bool append ); void saveXSPF( PlaylistEntry *, bool append ); @@ -218,21 +218,21 @@ class PlaylistBrowser : public QVBox KActionMenu *viewMenuButton; KActionMenu *addMenuButton; KToolBar *m_toolbar; - QValueList m_dynamicSizeSave; + TQValueList m_dynamicSizeSave; - QDict m_podcastSettings; - QPtrList m_dynamicEntries; + TQDict m_podcastSettings; + TQPtrList m_dynamicEntries; - QTimer *m_podcastTimer; + TQTimer *m_podcastTimer; int m_podcastTimerInterval; //in ms - QPtrList m_podcastItemsToScan; - QPtrList m_podcastDownloadQueue; + TQPtrList m_podcastItemsToScan; + TQPtrList m_podcastDownloadQueue; InfoPane *m_infoPane; bool m_removeDirt; - QSplitter *m_splitter; + TQSplitter *m_splitter; }; @@ -244,53 +244,53 @@ class PlaylistBrowserView : public KListView friend class PlaylistEntry; public: - PlaylistBrowserView( QWidget *parent, const char *name=0 ); + PlaylistBrowserView( TQWidget *parent, const char *name=0 ); ~PlaylistBrowserView(); - void rename( QListViewItem *item, int c ); + void rename( TQListViewItem *item, int c ); protected: - virtual void keyPressEvent( QKeyEvent * ); + virtual void keyPressEvent( TQKeyEvent * ); private slots: - void mousePressed( int, QListViewItem *, const QPoint &, int ); - void moveSelectedItems( QListViewItem* newParent ); + void mousePressed( int, TQListViewItem *, const TQPoint &, int ); + void moveSelectedItems( TQListViewItem* newParent ); private: void startDrag(); - void contentsDropEvent( QDropEvent* ); - void contentsDragEnterEvent( QDragEnterEvent* ); - void contentsDragMoveEvent( QDragMoveEvent* ); - void contentsDragLeaveEvent( QDragLeaveEvent* ); - void viewportPaintEvent( QPaintEvent* ); + void contentsDropEvent( TQDropEvent* ); + void contentsDragEnterEvent( TQDragEnterEvent* ); + void contentsDragMoveEvent( TQDragMoveEvent* ); + void contentsDragLeaveEvent( TQDragLeaveEvent* ); + void viewportPaintEvent( TQPaintEvent* ); void eraseMarker(); - QListViewItem *m_marker; //track that has the drag/drop marker under it + TQListViewItem *m_marker; //track that has the drag/drop marker under it }; class PlaylistDialog: public KDialogBase { Q_OBJECT public: - static QString getSaveFileName( const QString &suggestion = QString::null, bool proposeOverwriting = false ); + static TQString getSaveFileName( const TQString &suggestion = TQString::null, bool proposeOverwriting = false ); private: KLineEdit *edit; bool customChosen; - QString result; + TQString result; PlaylistDialog(); private slots: void slotOk(); - void slotTextChanged( const QString &s ); + void slotTextChanged( const TQString &s ); void slotCustomPath(); }; // Returns true if item is Playlist, Stream, Smart Playlist or DynamicMode. inline bool -isElement( QListViewItem *item ) +isElement( TQListViewItem *item ) { if( !item ) return false; @@ -299,7 +299,7 @@ isElement( QListViewItem *item ) } inline bool -isCategory( QListViewItem *item ) +isCategory( TQListViewItem *item ) { if( !item ) return false; @@ -307,7 +307,7 @@ isCategory( QListViewItem *item ) } inline bool -isDynamic( QListViewItem *item ) +isDynamic( TQListViewItem *item ) { if( !item ) return false; @@ -315,7 +315,7 @@ isDynamic( QListViewItem *item ) } inline bool -isPlaylist( QListViewItem *item ) +isPlaylist( TQListViewItem *item ) { if( !item ) return false; @@ -323,7 +323,7 @@ isPlaylist( QListViewItem *item ) } inline bool -isSmartPlaylist( QListViewItem *item ) +isSmartPlaylist( TQListViewItem *item ) { if( !item ) return false; @@ -331,7 +331,7 @@ isSmartPlaylist( QListViewItem *item ) } inline bool -isPlaylistTrackItem( QListViewItem *item ) +isPlaylistTrackItem( TQListViewItem *item ) { if( !item ) return false; @@ -339,7 +339,7 @@ isPlaylistTrackItem( QListViewItem *item ) } inline bool -isPodcastChannel( QListViewItem *item ) +isPodcastChannel( TQListViewItem *item ) { if( !item ) return false; @@ -347,7 +347,7 @@ isPodcastChannel( QListViewItem *item ) } inline bool -isPodcastEpisode( QListViewItem *item ) +isPodcastEpisode( TQListViewItem *item ) { if( !item ) return false; @@ -355,7 +355,7 @@ isPodcastEpisode( QListViewItem *item ) } inline bool -isStream( QListViewItem *item ) +isStream( TQListViewItem *item ) { if( !item ) return false; @@ -363,7 +363,7 @@ isStream( QListViewItem *item ) } inline bool -isLastFm( QListViewItem *item ) +isLastFm( TQListViewItem *item ) { if( !item ) return false; @@ -371,16 +371,16 @@ isLastFm( QListViewItem *item ) } inline QString -fileBaseName( const QString &filePath ) +fileBaseName( const TQString &filePath ) { // this function returns the file name without extension // (e.g. if the file path is "/home/user/playlist.m3u", "playlist" is returned - QString fileName = filePath.right( filePath.length() - filePath.findRev( '/' ) - 1 ); + TQString fileName = filePath.right( filePath.length() - filePath.findRev( '/' ) - 1 ); return fileName.mid( 0, fileName.findRev( '.' ) ); } inline QString -fileDirPath( const QString &filePath ) +fileDirPath( const TQString &filePath ) { return filePath.left( filePath.findRev( '/' )+1 ); } @@ -392,13 +392,13 @@ class InfoPane : public QVBox Q_OBJECT public: - InfoPane( QWidget *parent ); + InfoPane( TQWidget *parent ); ~InfoPane(); int getHeight(); void setStoredHeight( const int newHeight ); public slots: - void setInfo( const QString &title, const QString &info ); + void setInfo( const TQString &title, const TQString &info ); private slots: void toggle( bool ); diff --git a/amarok/src/playlistbrowseritem.cpp b/amarok/src/playlistbrowseritem.cpp index 058a0d67..1eb0c426 100644 --- a/amarok/src/playlistbrowseritem.cpp +++ b/amarok/src/playlistbrowseritem.cpp @@ -30,12 +30,12 @@ #include "threadmanager.h" #include "mediabrowser.h" -#include -#include -#include -#include //paintCell() -#include //paintCell() -#include +#include +#include +#include +#include //paintCell() +#include //paintCell() +#include #include //Used for Shoutcast random name generation #include //KDE_VERSION ifndefs. Remove this once we reach a kde 4 dep @@ -62,9 +62,9 @@ class PlaylistReader : public ThreadManager::DependentJob { public: - PlaylistReader( QObject *recipient, const QString &path ) + PlaylistReader( TQObject *recipient, const TQString &path ) : ThreadManager::DependentJob( recipient, "PlaylistReader" ) - , m_path( QDeepCopy( path ) ) {} + , m_path( TQDeepCopy( path ) ) {} virtual bool doJob() { DEBUG_BLOCK @@ -80,20 +80,20 @@ class PlaylistReader : public ThreadManager::DependentJob virtual void completeJob() { DEBUG_BLOCK PlaylistFile pf = PlaylistFile( m_path ); - bundles = QDeepCopy( bundles ); - title = QDeepCopy( title ); + bundles = TQDeepCopy( bundles ); + title = TQDeepCopy( title ); for( BundleList::iterator it = bundles.begin(); it != bundles.end(); ++it ) - *it = QDeepCopy( *it ); + *it = TQDeepCopy( *it ); ThreadManager::DependentJob::completeJob(); } BundleList bundles; - QString title; + TQString title; private: - const QString m_path; + const TQString m_path; }; ///////////////////////////////////////////////////////////////////////////// @@ -101,7 +101,7 @@ class PlaylistReader : public ThreadManager::DependentJob //////////////////////////////////////////////////////////////////////////// int -PlaylistBrowserEntry::compare( QListViewItem* item, int col, bool ascending ) const +PlaylistBrowserEntry::compare( TQListViewItem* item, int col, bool ascending ) const { bool i1 = rtti() == PlaylistCategory::RTTI; bool i2 = item->rtti() == PlaylistCategory::RTTI; @@ -113,7 +113,7 @@ PlaylistBrowserEntry::compare( QListViewItem* item, int col, bool ascending ) co { PlaylistBrowser * const pb = PlaylistBrowser::instance(); - QValueList toplevels; //define a static order for the toplevel categories + TQValueList toplevels; //define a static order for the toplevel categories toplevels << pb->m_playlistCategory << pb->m_smartCategory << pb->m_dynamicCategory @@ -143,7 +143,7 @@ PlaylistBrowserEntry::setKept( bool k ) void PlaylistBrowserEntry::updateInfo() { - PlaylistBrowser::instance()->setInfo( QString::null, QString::null ); + PlaylistBrowser::instance()->setInfo( TQString::null, TQString::null ); return; } @@ -156,7 +156,7 @@ PlaylistBrowserEntry::slotDoubleClicked() void PlaylistBrowserEntry::slotRenameItem() { - QListViewItem *parent = KListViewItem::parent(); + TQListViewItem *parent = KListViewItem::parent(); while( parent ) { @@ -172,7 +172,7 @@ PlaylistBrowserEntry::slotRenameItem() } void -PlaylistBrowserEntry::slotPostRenameItem( const QString /*newName*/ ) +PlaylistBrowserEntry::slotPostRenameItem( const TQString /*newName*/ ) { setRenameEnabled( 0, false ); } @@ -181,7 +181,7 @@ PlaylistBrowserEntry::slotPostRenameItem( const QString /*newName*/ ) /// CLASS PlaylistCategory //////////////////////////////////////////////////////////////////////////// -PlaylistCategory::PlaylistCategory( QListView *parent, QListViewItem *after, const QString &t, bool isFolder ) +PlaylistCategory::PlaylistCategory( TQListView *parent, TQListViewItem *after, const TQString &t, bool isFolder ) : PlaylistBrowserEntry( parent, after ) , m_title( t ) , m_id( -1 ) @@ -194,7 +194,7 @@ PlaylistCategory::PlaylistCategory( QListView *parent, QListViewItem *after, con } -PlaylistCategory::PlaylistCategory( PlaylistCategory *parent, QListViewItem *after, const QString &t, bool isFolder ) +PlaylistCategory::PlaylistCategory( PlaylistCategory *parent, TQListViewItem *after, const TQString &t, bool isFolder ) : PlaylistBrowserEntry( parent, after ) , m_title( t ) , m_id( -1 ) @@ -207,7 +207,7 @@ PlaylistCategory::PlaylistCategory( PlaylistCategory *parent, QListViewItem *aft } -PlaylistCategory::PlaylistCategory( QListView *parent, QListViewItem *after, const QDomElement &xmlDefinition, bool isFolder ) +PlaylistCategory::PlaylistCategory( TQListView *parent, TQListViewItem *after, const TQDomElement &xmlDefinition, bool isFolder ) : PlaylistBrowserEntry( parent, after ) , m_id( -1 ) , m_folder( isFolder ) @@ -219,7 +219,7 @@ PlaylistCategory::PlaylistCategory( QListView *parent, QListViewItem *after, con } -PlaylistCategory::PlaylistCategory( PlaylistCategory *parent, QListViewItem *after, const QDomElement &xmlDefinition ) +PlaylistCategory::PlaylistCategory( PlaylistCategory *parent, TQListViewItem *after, const TQDomElement &xmlDefinition ) : PlaylistBrowserEntry( parent, after ) , m_id( -1 ) , m_folder( true ) @@ -230,7 +230,7 @@ PlaylistCategory::PlaylistCategory( PlaylistCategory *parent, QListViewItem *aft setPixmap( 0, SmallIcon( Amarok::icon( "files" ) ) ); } -PlaylistCategory::PlaylistCategory( PlaylistCategory *parent, QListViewItem *after, const QString &t, const int id ) +PlaylistCategory::PlaylistCategory( PlaylistCategory *parent, TQListViewItem *after, const TQString &t, const int id ) : PlaylistBrowserEntry( parent, after ) , m_title( t ) , m_id( id ) @@ -244,7 +244,7 @@ PlaylistCategory::PlaylistCategory( PlaylistCategory *parent, QListViewItem *aft void PlaylistCategory::okRename( int col ) { - QListViewItem::okRename( col ); + TQListViewItem::okRename( col ); if( m_id < 0 ) return; @@ -253,19 +253,19 @@ void PlaylistCategory::okRename( int col ) CollectionDB::instance()->updatePodcastFolder( m_id, text(0), parentId, isOpen() ); } -void PlaylistCategory::setXml( const QDomElement &xml ) +void PlaylistCategory::setXml( const TQDomElement &xml ) { PlaylistBrowser *pb = PlaylistBrowser::instance(); - QString tname = xml.tagName(); + TQString tname = xml.tagName(); if ( tname == "category" ) { setOpen( xml.attribute( "isOpen" ) == "true" ); m_title = xml.attribute( "name" ); setText( 0, m_title ); - QListViewItem *last = 0; - for( QDomNode n = xml.firstChild() ; !n.isNull(); n = n.nextSibling() ) + TQListViewItem *last = 0; + for( TQDomNode n = xml.firstChild() ; !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.tagName() == "category" ) last = new PlaylistCategory( this, last, e); @@ -298,13 +298,13 @@ void PlaylistCategory::setXml( const QDomElement &xml ) else if ( e.tagName() == "podcast" ) { const KURL url( n.namedItem( "url").toElement().text() ); - QString xmlLocation = Amarok::saveLocation( "podcasts/" ); + TQString xmlLocation = Amarok::saveLocation( "podcasts/" ); xmlLocation += n.namedItem( "cache" ).toElement().text(); - QDomDocument xml; - QFile xmlFile( xmlLocation ); - QTextStream stream( &xmlFile ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQDomDocument xml; + TQFile xmlFile( xmlLocation ); + TQTextStream stream( &xmlFile ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); if( !xmlFile.open( IO_ReadOnly ) || !xml.setContent( stream.read() ) ) { @@ -330,10 +330,10 @@ void PlaylistCategory::setXml( const QDomElement &xml ) } -QDomElement PlaylistCategory::xml() const +TQDomElement PlaylistCategory::xml() const { - QDomDocument d; - QDomElement i = d.createElement("category"); + TQDomDocument d; + TQDomElement i = d.createElement("category"); i.setAttribute( "name", text(0) ); if( isOpen() ) i.setAttribute( "isOpen", "true" ); @@ -342,8 +342,8 @@ QDomElement PlaylistCategory::xml() const { if( it == PlaylistBrowser::instance()->m_coolStreams ) { - QDomDocument doc; - QDomElement e = doc.createElement("default"); + TQDomDocument doc; + TQDomElement e = doc.createElement("default"); e.setAttribute( "type", "stream" ); if( it->isOpen() ) e.setAttribute( "isOpen", "true" ); @@ -351,8 +351,8 @@ QDomElement PlaylistCategory::xml() const } else if( it == PlaylistBrowser::instance()->m_lastfmCategory ) { - QDomDocument doc; - QDomElement e = doc.createElement("default"); + TQDomDocument doc; + TQDomElement e = doc.createElement("default"); e.setAttribute( "type", "lastfm" ); if( it->isOpen() ) e.setAttribute( "isOpen", "true" ); @@ -360,8 +360,8 @@ QDomElement PlaylistCategory::xml() const } else if( it == PlaylistBrowser::instance()->m_smartDefaults ) { - QDomDocument doc; - QDomElement e = doc.createElement("default"); + TQDomDocument doc; + TQDomElement e = doc.createElement("default"); e.setAttribute( "type", "smartplaylist" ); if( it->isOpen() ) e.setAttribute( "isOpen", "true" ); @@ -390,7 +390,7 @@ PlaylistCategory::slotRenameItem() void -PlaylistCategory::showContextMenu( const QPoint &position ) +PlaylistCategory::showContextMenu( const TQPoint &position ) { KPopupMenu menu( listView() ); @@ -399,7 +399,7 @@ PlaylistCategory::showContextMenu( const QPoint &position ) enum Actions { RENAME, REMOVE, CREATE, PLAYLIST, PLAYLIST_IMPORT, SMART, STREAM, DYNAMIC, LASTFM, LASTFMCUSTOM, PODCAST, REFRESH, CONFIG, INTERVAL }; - QListViewItem *parentCat = this; + TQListViewItem *parentCat = this; while( parentCat->parent() ) parentCat = parentCat->parent(); @@ -412,28 +412,28 @@ PlaylistCategory::showContextMenu( const QPoint &position ) menu.insertSeparator(); } - if( parentCat == static_cast( PlaylistBrowser::instance()->m_playlistCategory) ) + if( parentCat == static_cast( PlaylistBrowser::instance()->m_playlistCategory) ) { menu.insertItem( SmallIconSet(Amarok::icon( "add_playlist" )), i18n("Create Playlist..."), PLAYLIST ); menu.insertItem( SmallIconSet(Amarok::icon( "add_playlist" )), i18n("Import Playlist..."), PLAYLIST_IMPORT ); } - else if( parentCat == static_cast(PlaylistBrowser::instance()->m_smartCategory) ) + else if( parentCat == static_cast(PlaylistBrowser::instance()->m_smartCategory) ) menu.insertItem( SmallIconSet(Amarok::icon( "add_playlist" )), i18n("New Smart Playlist..."), SMART ); - else if( parentCat == static_cast(PlaylistBrowser::instance()->m_dynamicCategory) ) + else if( parentCat == static_cast(PlaylistBrowser::instance()->m_dynamicCategory) ) menu.insertItem( SmallIconSet(Amarok::icon( "add_playlist" )), i18n("New Dynamic Playlist..."), DYNAMIC ); - else if( parentCat == static_cast(PlaylistBrowser::instance()->m_streamsCategory) ) + else if( parentCat == static_cast(PlaylistBrowser::instance()->m_streamsCategory) ) menu.insertItem( SmallIconSet(Amarok::icon( "add_playlist" )), i18n("Add Radio Stream..."), STREAM ); - else if( parentCat == static_cast(PlaylistBrowser::instance()->m_lastfmCategory) ) + else if( parentCat == static_cast(PlaylistBrowser::instance()->m_lastfmCategory) ) { menu.insertItem( SmallIconSet(Amarok::icon( "add_playlist" )), i18n("Add Last.fm Radio..."), LASTFM ); menu.insertItem( SmallIconSet(Amarok::icon( "add_playlist" )), i18n("Add Custom Last.fm Radio..."), LASTFMCUSTOM ); } - else if( parentCat == static_cast(PlaylistBrowser::instance()->m_podcastCategory) ) + else if( parentCat == static_cast(PlaylistBrowser::instance()->m_podcastCategory) ) { isPodcastFolder = true; menu.insertItem( SmallIconSet( Amarok::icon( "add_playlist" ) ), i18n("Add Podcast..."), PODCAST ); @@ -449,10 +449,10 @@ PlaylistCategory::showContextMenu( const QPoint &position ) menu.insertSeparator(); menu.insertItem( SmallIconSet( Amarok::icon( "files" ) ), i18n("Create Sub-Folder"), CREATE ); - QListViewItem *tracker = 0; + TQListViewItem *tracker = 0; PlaylistCategory *newFolder = 0; int c; - QString name; + TQString name; switch( menu.exec( position ) ) { case RENAME: @@ -535,9 +535,9 @@ PlaylistCategory::showContextMenu( const QPoint &position ) void -PlaylistCategory::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align ) +PlaylistCategory::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align ) { - QFont font( p->font() ); + TQFont font( p->font() ); if( !m_folder ) { font.setBold( true ); @@ -553,7 +553,7 @@ PlaylistCategory::paintCell( QPainter *p, const QColorGroup &cg, int column, int /// CLASS PlaylistEntry //////////////////////////////////////////////////////////////////////////// -PlaylistEntry::PlaylistEntry( QListViewItem *parent, QListViewItem *after, const KURL &url, int tracks, int length ) +PlaylistEntry::PlaylistEntry( TQListViewItem *parent, TQListViewItem *after, const KURL &url, int tracks, int length ) : PlaylistBrowserEntry( parent, after ) , m_url( url ) , m_length( length ) @@ -561,8 +561,8 @@ PlaylistEntry::PlaylistEntry( QListViewItem *parent, QListViewItem *after, const , m_loading( false ) , m_loaded( false ) , m_dynamic( false ) - , m_loading1( new QPixmap( locate("data", "amarok/images/loading1.png" ) ) ) - , m_loading2( new QPixmap( locate("data", "amarok/images/loading2.png" ) ) ) + , m_loading1( new TQPixmap( locate("data", "amarok/images/loading1.png" ) ) ) + , m_loading2( new TQPixmap( locate("data", "amarok/images/loading2.png" ) ) ) , m_lastTrack( 0 ) { m_trackList.setAutoDelete( true ); @@ -583,20 +583,20 @@ PlaylistEntry::PlaylistEntry( QListViewItem *parent, QListViewItem *after, const } -PlaylistEntry::PlaylistEntry( QListViewItem *parent, QListViewItem *after, const QDomElement &xmlDefinition ) +PlaylistEntry::PlaylistEntry( TQListViewItem *parent, TQListViewItem *after, const TQDomElement &xmlDefinition ) : PlaylistBrowserEntry( parent, after ) , m_loading( false ) , m_loaded( false ) , m_dynamic( false ) - , m_loading1( new QPixmap( locate("data", "amarok/images/loading1.png" ) ) ) - , m_loading2( new QPixmap( locate("data", "amarok/images/loading2.png" ) ) ) + , m_loading1( new TQPixmap( locate("data", "amarok/images/loading1.png" ) ) ) + , m_loading2( new TQPixmap( locate("data", "amarok/images/loading2.png" ) ) ) , m_lastTrack( 0 ) { m_url.setPath( xmlDefinition.attribute( "file" ) ); m_trackCount = xmlDefinition.namedItem( "tracks" ).toElement().text().toInt(); m_length = xmlDefinition.namedItem( "length" ).toElement().text().toInt(); - QString title = xmlDefinition.attribute( "title" ); + TQString title = xmlDefinition.attribute( "title" ); if( title.isEmpty() ) { title = fileBaseName( m_url.path() ); @@ -640,7 +640,7 @@ void PlaylistEntry::load() //starts loading animation m_iconCounter = 1; startAnimation(); - connect( &m_animationTimer, SIGNAL(timeout()), this, SLOT(slotAnimation()) ); + connect( &m_animationTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotAnimation()) ); //delete all children, so that we don't duplicate things while( firstChild() ) @@ -673,9 +673,9 @@ void PlaylistEntry::slotAnimation() m_iconCounter++; } -void PlaylistEntry::insertTracks( QListViewItem *after, KURL::List list ) +void PlaylistEntry::insertTracks( TQListViewItem *after, KURL::List list ) { - QValueList bundles; + TQValueList bundles; foreachType( KURL::List, list ) bundles += MetaBundle( *it ); @@ -683,7 +683,7 @@ void PlaylistEntry::insertTracks( QListViewItem *after, KURL::List list ) insertTracks( after, bundles ); } -void PlaylistEntry::insertTracks( QListViewItem *after, QValueList bundles ) +void PlaylistEntry::insertTracks( TQListViewItem *after, TQValueList bundles ) { int pos = 0; if( after ) { @@ -693,7 +693,7 @@ void PlaylistEntry::insertTracks( QListViewItem *after, QValueList b } uint k = 0; - foreachType( QValueList, bundles ) + foreachType( TQValueList, bundles ) { TrackItemInfo *newInfo = new TrackItemInfo( *it ); m_length += newInfo->length(); @@ -724,7 +724,7 @@ void PlaylistEntry::insertTracks( QListViewItem *after, QValueList b } -void PlaylistEntry::removeTrack( QListViewItem *item, bool isLast ) +void PlaylistEntry::removeTrack( TQListViewItem *item, bool isLast ) { #define item static_cast(item) //remove a track and update playlist stats @@ -733,7 +733,7 @@ void PlaylistEntry::removeTrack( QListViewItem *item, bool isLast ) m_trackCount--; m_trackList.remove( info ); if( item == m_lastTrack ) { - QListViewItem *above = item->itemAbove(); + TQListViewItem *above = item->itemAbove(); m_lastTrack = above ? static_cast( above ) : 0; } delete item; @@ -745,13 +745,13 @@ void PlaylistEntry::removeTrack( QListViewItem *item, bool isLast ) } -void PlaylistEntry::customEvent( QCustomEvent *e ) +void PlaylistEntry::customEvent( TQCustomEvent *e ) { if( e->type() != (int)PlaylistReader::JobFinishedEvent ) return; #define playlist static_cast(e) - QString str = playlist->title; + TQString str = playlist->title; if ( str.isEmpty() ) str = fileBaseName( m_url.path() ); @@ -821,17 +821,17 @@ void PlaylistEntry::setOpen( bool open ) m_lastTrack = 0; } - QListViewItem::setOpen( open ); + TQListViewItem::setOpen( open ); PlaylistBrowser::instance()->savePlaylists(); } -int PlaylistEntry::compare( QListViewItem* i, int /*col*/ ) const +int PlaylistEntry::compare( TQListViewItem* i, int /*col*/ ) const { PlaylistEntry* item = static_cast(i); // Compare case-insensitive - return QString::localeAwareCompare( text( 0 ).lower(), item->text( 0 ).lower() ); + return TQString::localeAwareCompare( text( 0 ).lower(), item->text( 0 ).lower() ); } @@ -851,12 +851,12 @@ KURL::List PlaylistEntry::tracksURL() void PlaylistEntry::updateInfo() { - const QString body = "%1%2"; + const TQString body = "%1%2"; - QString str = ""; + TQString str = "
        "; str += body.arg( i18n( "Playlist" ), text(0) ); - str += body.arg( i18n( "Number of tracks" ), QString::number(m_trackCount) ); + str += body.arg( i18n( "Number of tracks" ), TQString::number(m_trackCount) ); str += body.arg( i18n( "Length" ), MetaBundle::prettyTime( m_length ) ); str += body.arg( i18n( "Location" ), m_url.prettyURL() ); str += "
        "; @@ -871,7 +871,7 @@ void PlaylistEntry::slotDoubleClicked() } -void PlaylistEntry::showContextMenu( const QPoint &position ) +void PlaylistEntry::showContextMenu( const TQPoint &position ) { KPopupMenu menu( listView() ); @@ -925,12 +925,12 @@ void PlaylistEntry::showContextMenu( const QPoint &position ) } -void PlaylistEntry::slotPostRenameItem( const QString newName ) +void PlaylistEntry::slotPostRenameItem( const TQString newName ) { - QString oldPath = url().path(); - QString newPath = fileDirPath( oldPath ) + newName + '.' + Amarok::extension( oldPath ); + TQString oldPath = url().path(); + TQString newPath = fileDirPath( oldPath ) + newName + '.' + Amarok::extension( oldPath ); - if ( std::rename( QFile::encodeName( oldPath ), QFile::encodeName( newPath ) ) == -1 ) + if ( std::rename( TQFile::encodeName( oldPath ), TQFile::encodeName( newPath ) ) == -1 ) KMessageBox::error( listView(), i18n("Error renaming the file.") ); else setUrl( newPath ); @@ -956,7 +956,7 @@ void PlaylistEntry::setDynamic( bool enable ) void PlaylistEntry::setup() { - QFontMetrics fm( listView()->font() ); + TQFontMetrics fm( listView()->font() ); int margin = listView()->itemMargin()*2; int h = fm.lineSpacing(); if ( h % 2 > 0 ) h++; @@ -964,10 +964,10 @@ void PlaylistEntry::setup() } -void PlaylistEntry::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align ) +void PlaylistEntry::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align ) { //flicker-free drawing - static QPixmap buffer; + static TQPixmap buffer; buffer.resize( width, height() ); if( buffer.isNull() ) @@ -976,7 +976,7 @@ void PlaylistEntry::paintCell( QPainter *p, const QColorGroup &cg, int column, i return; } - QPainter pBuf( &buffer, true ); + TQPainter pBuf( &buffer, true ); // use alternate background #if KDE_VERSION < KDE_MAKE_VERSION(3,3,91) pBuf.fillRect( buffer.rect(), isSelected() ? cg.highlight() : backgroundColor() ); @@ -986,8 +986,8 @@ void PlaylistEntry::paintCell( QPainter *p, const QColorGroup &cg, int column, i KListView *lv = static_cast( listView() ); - QFont font( p->font() ); - QFontMetrics fm( p->fontMetrics() ); + TQFont font( p->font() ); + TQFontMetrics fm( p->fontMetrics() ); int text_x = 0;// lv->treeStepSize() + 3; int textHeight; @@ -1004,9 +1004,9 @@ void PlaylistEntry::paintCell( QPainter *p, const QColorGroup &cg, int column, i } pBuf.setFont( font ); - QFontMetrics fmName( font ); + TQFontMetrics fmName( font ); - QString name = text(column); + TQString name = text(column); const int _width = width - text_x - lv->itemMargin()*2; if( fmName.width( name ) > _width ) { @@ -1020,28 +1020,28 @@ void PlaylistEntry::paintCell( QPainter *p, const QColorGroup &cg, int column, i } -QDomElement PlaylistEntry::xml() const +TQDomElement PlaylistEntry::xml() const { - QDomDocument doc; - QDomElement i = doc.createElement("playlist"); + TQDomDocument doc; + TQDomElement i = doc.createElement("playlist"); i.setAttribute( "file", url().path() ); i.setAttribute( "title", text(0) ); if( isOpen() ) i.setAttribute( "isOpen", "true" ); - QDomElement attr = doc.createElement( "tracks" ); - QDomText t = doc.createTextNode( QString::number( trackCount() ) ); + TQDomElement attr = doc.createElement( "tracks" ); + TQDomText t = doc.createTextNode( TQString::number( trackCount() ) ); attr.appendChild( t ); i.appendChild( attr ); attr = doc.createElement( "length" ); - t = doc.createTextNode( QString::number( length() ) ); + t = doc.createTextNode( TQString::number( length() ) ); attr.appendChild( t ); i.appendChild( attr ); - QFileInfo fi( url().path() ); + TQFileInfo fi( url().path() ); attr = doc.createElement( "modified" ); - t = doc.createTextNode( QString::number( fi.lastModified().toTime_t() ) ); + t = doc.createTextNode( TQString::number( fi.lastModified().toTime_t() ) ); attr.appendChild( t ); i.appendChild( attr ); @@ -1053,7 +1053,7 @@ QDomElement PlaylistEntry::xml() const /// CLASS PlaylistTrackItem //////////////////////////////////////////////////////////////////////////////// -PlaylistTrackItem::PlaylistTrackItem( QListViewItem *parent, QListViewItem *after, TrackItemInfo *info ) +PlaylistTrackItem::PlaylistTrackItem( TQListViewItem *parent, TQListViewItem *after, TrackItemInfo *info ) : PlaylistBrowserEntry( parent, after ) , m_trackInfo( info ) { @@ -1079,7 +1079,7 @@ void PlaylistTrackItem::slotDoubleClicked() } -void PlaylistTrackItem::showContextMenu( const QPoint &position ) +void PlaylistTrackItem::showContextMenu( const TQPoint &position ) { KPopupMenu menu( listView() ); enum Actions { LOAD, APPEND, QUEUE, BURN, REMOVE, INFO }; @@ -1117,7 +1117,7 @@ void PlaylistTrackItem::showContextMenu( const QPoint &position ) case INFO: if( !url().isLocalFile() ) KMessageBox::sorry( PlaylistBrowser::instance(), i18n( "Track information is not available for remote media." ) ); - else if( QFile::exists( url().path() ) ) { + else if( TQFile::exists( url().path() ) ) { TagDialog* dialog = new TagDialog( url() ); dialog->show(); } @@ -1155,7 +1155,7 @@ TrackItemInfo::TrackItemInfo( const MetaBundle &mb ) /// CLASS StreamEntry //////////////////////////////////////////////////////////////////////////// -StreamEntry::StreamEntry( QListViewItem *parent, QListViewItem *after, const KURL &u, const QString &t ) +StreamEntry::StreamEntry( TQListViewItem *parent, TQListViewItem *after, const KURL &u, const TQString &t ) : PlaylistBrowserEntry( parent, after ) , m_title( t ) , m_url( u ) @@ -1172,7 +1172,7 @@ StreamEntry::StreamEntry( QListViewItem *parent, QListViewItem *after, const KUR setText( 0, m_title ); } -StreamEntry::StreamEntry( QListViewItem *parent, QListViewItem *after, const QDomElement &xmlDefinition ) +StreamEntry::StreamEntry( TQListViewItem *parent, TQListViewItem *after, const TQDomElement &xmlDefinition ) : PlaylistBrowserEntry( parent, after ) { setDragEnabled( true ); @@ -1180,7 +1180,7 @@ StreamEntry::StreamEntry( QListViewItem *parent, QListViewItem *after, const QDo setExpandable( false ); m_title = xmlDefinition.attribute( "name" ); - QDomElement e = xmlDefinition.namedItem( "url" ).toElement(); + TQDomElement e = xmlDefinition.namedItem( "url" ).toElement(); m_url = KURL::fromPathOrURL( e.text() ); @@ -1193,14 +1193,14 @@ StreamEntry::StreamEntry( QListViewItem *parent, QListViewItem *after, const QDo } -QDomElement StreamEntry::xml() const +TQDomElement StreamEntry::xml() const { - QDomDocument doc; - QDomElement i = doc.createElement("stream"); + TQDomDocument doc; + TQDomElement i = doc.createElement("stream"); i.setAttribute( "name", title() ); if( isOpen() ) i.setAttribute( "isOpen", "true" ); - QDomElement url = doc.createElement( "url" ); + TQDomElement url = doc.createElement( "url" ); url.appendChild( doc.createTextNode( m_url.prettyURL() )); i.appendChild( url ); return i; @@ -1208,9 +1208,9 @@ QDomElement StreamEntry::xml() const void StreamEntry::updateInfo() { - const QString body = "%1%2"; + const TQString body = "%1%2"; - QString str = ""; + TQString str = "
        "; str += body.arg( i18n( "URL" ), m_url.prettyURL() ); str += "
        "; @@ -1226,17 +1226,17 @@ void StreamEntry::slotDoubleClicked() void StreamEntry::setup() { - QFontMetrics fm( listView()->font() ); + TQFontMetrics fm( listView()->font() ); int margin = listView()->itemMargin()*2; int h = fm.lineSpacing(); if ( h % 2 > 0 ) h++; setHeight( h + margin ); } -void StreamEntry::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align ) +void StreamEntry::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align ) { //flicker-free drawing - static QPixmap buffer; + static TQPixmap buffer; buffer.resize( width, height() ); if( buffer.isNull() ) @@ -1245,7 +1245,7 @@ void StreamEntry::paintCell( QPainter *p, const QColorGroup &cg, int column, int return; } - QPainter pBuf( &buffer, true ); + TQPainter pBuf( &buffer, true ); // use alternate background #if KDE_VERSION < KDE_MAKE_VERSION(3,3,91) pBuf.fillRect( buffer.rect(), isSelected() ? cg.highlight() : backgroundColor() ); @@ -1255,8 +1255,8 @@ void StreamEntry::paintCell( QPainter *p, const QColorGroup &cg, int column, int KListView *lv = static_cast( listView() ); - QFont font( p->font() ); - QFontMetrics fm( p->fontMetrics() ); + TQFont font( p->font() ); + TQFontMetrics fm( p->fontMetrics() ); int text_x = 0;// lv->treeStepSize() + 3; int textHeight; @@ -1272,9 +1272,9 @@ void StreamEntry::paintCell( QPainter *p, const QColorGroup &cg, int column, int } pBuf.setFont( font ); - QFontMetrics fmName( font ); + TQFontMetrics fmName( font ); - QString name = text(column); + TQString name = text(column); const int _width = width - text_x - lv->itemMargin()*2; if( fmName.width( name ) > _width ) { @@ -1288,7 +1288,7 @@ void StreamEntry::paintCell( QPainter *p, const QColorGroup &cg, int column, int } void -StreamEntry::showContextMenu( const QPoint &position ) +StreamEntry::showContextMenu( const TQPoint &position ) { KPopupMenu menu( listView() ); enum Actions { LOAD, APPEND, QUEUE, EDIT, REMOVE }; @@ -1337,14 +1337,14 @@ StreamEntry::showContextMenu( const QPoint &position ) /// CLASS LastFmEntry //////////////////////////////////////////////////////////////////////////// -QDomElement LastFmEntry::xml() const +TQDomElement LastFmEntry::xml() const { - QDomDocument doc; - QDomElement i = doc.createElement("lastfm"); + TQDomDocument doc; + TQDomElement i = doc.createElement("lastfm"); i.setAttribute( "name", title() ); if( isOpen() ) i.setAttribute( "isOpen", "true" ); - QDomElement url = doc.createElement( "url" ); + TQDomElement url = doc.createElement( "url" ); url.appendChild( doc.createTextNode( m_url.prettyURL() )); i.appendChild( url ); return i; @@ -1354,17 +1354,17 @@ QDomElement LastFmEntry::xml() const /// CLASS StreamEditor //////////////////////////////////////////////////////////////////////////// -StreamEditor::StreamEditor( QWidget *parent, const QString &title, const QString &url, bool readonly ) - : KDialogBase( parent, "StreamEditor", true, QString::null, Ok|Cancel) +StreamEditor::StreamEditor( TQWidget *parent, const TQString &title, const TQString &url, bool readonly ) + : KDialogBase( parent, "StreamEditor", true, TQString::null, Ok|Cancel) { makeGridMainWidget( 2, Qt::Horizontal ); - QLabel *nameLabel = new QLabel( i18n("&Name:"), mainWidget() ); + TQLabel *nameLabel = new TQLabel( i18n("&Name:"), mainWidget() ); m_nameLineEdit = new KLineEdit( title, mainWidget() ); m_nameLineEdit->setReadOnly( readonly ); nameLabel->setBuddy( m_nameLineEdit ); - QLabel *urlLabel = new QLabel( i18n("&Url:"), mainWidget() ); + TQLabel *urlLabel = new TQLabel( i18n("&Url:"), mainWidget() ); m_urlLineEdit = new KLineEdit( url, mainWidget() ); m_urlLineEdit->setReadOnly( readonly ); urlLabel->setBuddy( m_urlLineEdit ); @@ -1379,7 +1379,7 @@ StreamEditor::StreamEditor( QWidget *parent, const QString &title, const QString setButtonCancel( KStdGuiItem::close() ); } - QSize min( 480, 110 ); + TQSize min( 480, 110 ); setInitialSize( min ); } @@ -1387,7 +1387,7 @@ StreamEditor::StreamEditor( QWidget *parent, const QString &title, const QString ///////////////////////////////////////////////////////////////////////////// /// CLASS DynamicEntry //////////////////////////////////////////////////////////////////////////// -DynamicEntry::DynamicEntry( QListViewItem *parent, QListViewItem *after, const QString &name ) +DynamicEntry::DynamicEntry( TQListViewItem *parent, TQListViewItem *after, const TQString &name ) : PlaylistBrowserEntry( parent, after, name ) , DynamicMode( name ) { @@ -1395,14 +1395,14 @@ DynamicEntry::DynamicEntry( QListViewItem *parent, QListViewItem *after, const Q setDragEnabled( true ); } -DynamicEntry::DynamicEntry( QListViewItem *parent, QListViewItem *after, const QDomElement &xmlDefinition ) +DynamicEntry::DynamicEntry( TQListViewItem *parent, TQListViewItem *after, const TQDomElement &xmlDefinition ) : PlaylistBrowserEntry( parent, after ) , DynamicMode( xmlDefinition.attribute( "name" ) ) { setPixmap( 0, SmallIcon( Amarok::icon( "dynamic" ) ) ); setDragEnabled( true ); - QDomElement e; + TQDomElement e; setCycleTracks ( xmlDefinition.namedItem( "cycleTracks" ).toElement().text() == "true" ); setUpcomingCount( xmlDefinition.namedItem( "upcoming" ).toElement().text().toInt() ); @@ -1411,50 +1411,50 @@ DynamicEntry::DynamicEntry( QListViewItem *parent, QListViewItem *after, const Q setAppendType( xmlDefinition.namedItem( "appendType" ).toElement().text().toInt() ); if ( appendType() == 2 ) { - setItems( QStringList::split( ',', xmlDefinition.namedItem( "items" ).toElement().text() ) ); + setItems( TQStringList::split( ',', xmlDefinition.namedItem( "items" ).toElement().text() ) ); } } -QString DynamicEntry::text( int column ) const +TQString DynamicEntry::text( int column ) const { if( column == 0 ) return title(); return PlaylistBrowserEntry::text( column ); } -QDomElement DynamicEntry::xml() const +TQDomElement DynamicEntry::xml() const { - QDomDocument doc; - QDomElement i; + TQDomDocument doc; + TQDomElement i; i = doc.createElement("dynamic"); i.setAttribute( "name", title() ); if( isOpen() ) i.setAttribute( "isOpen", "true" ); - QDomElement attr = doc.createElement( "cycleTracks" ); - QDomText t = doc.createTextNode( cycleTracks() ? "true" : "false" ); + TQDomElement attr = doc.createElement( "cycleTracks" ); + TQDomText t = doc.createTextNode( cycleTracks() ? "true" : "false" ); attr.appendChild( t ); i.appendChild( attr ); attr = doc.createElement( "upcoming" ); - t = doc.createTextNode( QString::number( upcomingCount() ) ); + t = doc.createTextNode( TQString::number( upcomingCount() ) ); attr.appendChild( t ); i.appendChild( attr ); attr = doc.createElement( "previous" ); - t = doc.createTextNode( QString::number( previousCount() ) ); + t = doc.createTextNode( TQString::number( previousCount() ) ); attr.appendChild( t ); i.appendChild( attr ); attr = doc.createElement( "appendType" ); - t = doc.createTextNode( QString::number( appendType() ) ); + t = doc.createTextNode( TQString::number( appendType() ) ); attr.appendChild( t ); i.appendChild( attr ); - QString list; + TQString list; if( appendType() == 2 ) { - QStringList itemsl = items(); + TQStringList itemsl = items(); for( uint c = 0; c < itemsl.count(); c = c + 2 ) { list.append( itemsl[c] ); list.append( ',' ); @@ -1480,7 +1480,7 @@ DynamicEntry::slotDoubleClicked() void -DynamicEntry::showContextMenu( const QPoint &position ) +DynamicEntry::showContextMenu( const TQPoint &position ) { KPopupMenu menu( listView() ); @@ -1511,7 +1511,7 @@ DynamicEntry::showContextMenu( const QPoint &position ) /// CLASS PodcastChannel //////////////////////////////////////////////////////////////////////////// -PodcastChannel::PodcastChannel( QListViewItem *parent, QListViewItem *after, const KURL &url ) +PodcastChannel::PodcastChannel( TQListViewItem *parent, TQListViewItem *after, const KURL &url ) : PlaylistBrowserEntry( parent, after ) , m_polished( true ) // we get the items immediately if url is given , m_url( url ) @@ -1531,8 +1531,8 @@ PodcastChannel::PodcastChannel( QListViewItem *parent, QListViewItem *after, con fetch(); } -PodcastChannel::PodcastChannel( QListViewItem *parent, QListViewItem *after, const KURL &url, - const QDomNode &channelSettings ) +PodcastChannel::PodcastChannel( TQListViewItem *parent, TQListViewItem *after, const KURL &url, + const TQDomNode &channelSettings ) : PlaylistBrowserEntry( parent, after ) , m_polished( true ) // we get the items immediately if url is given , m_url( url ) @@ -1554,9 +1554,9 @@ PodcastChannel::PodcastChannel( QListViewItem *parent, QListViewItem *after, con fetch(); } -PodcastChannel::PodcastChannel( QListViewItem *parent, QListViewItem *after, - const KURL &url, const QDomNode &channelSettings, - const QDomDocument &xmlDefinition ) +PodcastChannel::PodcastChannel( TQListViewItem *parent, TQListViewItem *after, + const KURL &url, const TQDomNode &channelSettings, + const TQDomDocument &xmlDefinition ) : PlaylistBrowserEntry( parent, after ) , m_polished( true ) //automatically load the channel , m_url( url ) @@ -1567,7 +1567,7 @@ PodcastChannel::PodcastChannel( QListViewItem *parent, QListViewItem *after, , m_parent( static_cast(parent) ) , m_settingsValid( true ) { - QDomNode type = xmlDefinition.namedItem("rss"); + TQDomNode type = xmlDefinition.namedItem("rss"); if( !type.isNull() ) setXml( type.namedItem("channel"), RSS ); else @@ -1581,7 +1581,7 @@ PodcastChannel::PodcastChannel( QListViewItem *parent, QListViewItem *after, setPixmap( 0, SmallIcon( Amarok::icon( "podcast" ) ) ); } -PodcastChannel::PodcastChannel( QListViewItem *parent, QListViewItem *after, const PodcastChannelBundle &pcb ) +PodcastChannel::PodcastChannel( TQListViewItem *parent, TQListViewItem *after, const PodcastChannelBundle &pcb ) : PlaylistBrowserEntry( parent, after ) , m_bundle( pcb ) , m_polished( false ) @@ -1601,9 +1601,9 @@ PodcastChannel::PodcastChannel( QListViewItem *parent, QListViewItem *after, con } void -PodcastChannel::setDOMSettings( const QDomNode &channelSettings ) +PodcastChannel::setDOMSettings( const TQDomNode &channelSettings ) { - QString save = channelSettings.namedItem("savelocation").toElement().text(); + TQString save = channelSettings.namedItem("savelocation").toElement().text(); bool scan = channelSettings.namedItem("autoscan").toElement().text() == "true"; bool hasPurge = channelSettings.namedItem("purge").toElement().text() == "true"; int purgeCount = channelSettings.namedItem("purgecount").toElement().text().toInt(); @@ -1613,7 +1613,7 @@ PodcastChannel::setDOMSettings( const QDomNode &channelSettings ) fetchType = AUTOMATIC; KURL saveURL; - QString t = title(); + TQString t = title(); if( save.isEmpty() ) save = Amarok::saveLocation( "podcasts/" + Amarok::vfatPath( t ) ); @@ -1638,7 +1638,7 @@ PodcastChannel::configure() void PodcastChannel::checkAndSetNew() { - for( QListViewItem *child = firstChild(); child; child = child->nextSibling() ) + for( TQListViewItem *child = firstChild(); child; child = child->nextSibling() ) { if( static_cast(child)->isNew() ) { @@ -1655,7 +1655,7 @@ PodcastChannel::setListened( const bool n /*true*/ ) if( !isPolished() ) load(); - QListViewItem *child = firstChild(); + TQListViewItem *child = firstChild(); while( child ) { static_cast(child)->setListened( n ); @@ -1673,12 +1673,12 @@ PodcastChannel::setOpen( bool b ) if( isPolished() ) { - QListViewItem::setOpen( b ); + TQListViewItem::setOpen( b ); return; } // not polished if( b ) load(); - QListViewItem::setOpen( b ); + TQListViewItem::setOpen( b ); } void @@ -1688,7 +1688,7 @@ PodcastChannel::load() bool hasNew = m_new; int episodeCount = hasPurge() ? purgeCount() : -1; - QValueList episodes; + TQValueList episodes; episodes = CollectionDB::instance()->getPodcastEpisodes( url(), false, episodeCount ); PodcastEpisodeBundle bundle; @@ -1764,7 +1764,7 @@ PodcastChannel::setSettings( PodcastSettings *newSettings ) void PodcastChannel::downloadChildren() { - QListViewItem *item = firstChild(); + TQListViewItem *item = firstChild(); while( item ) { #define item static_cast(item) @@ -1786,7 +1786,7 @@ PodcastChannel::downloadChildQueue() first->downloadMedia(); m_podcastDownloadQueue.removeFirst(); - connect( first, SIGNAL( downloadFinished() ), this, SLOT( downloadChildQueue() ) ); + connect( first, TQT_SIGNAL( downloadFinished() ), this, TQT_SLOT( downloadChildQueue() ) ); } void @@ -1796,15 +1796,15 @@ PodcastChannel::fetch() m_iconCounter = 1; startAnimation(); - connect( &m_animationTimer, SIGNAL(timeout()), this, SLOT(slotAnimation()) ); + connect( &m_animationTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotAnimation()) ); m_podcastJob = KIO::storedGet( m_url, false, false ); Amarok::StatusBar::instance()->newProgressOperation( m_podcastJob ) .setDescription( i18n( "Fetching Podcast" ) ) - .setAbortSlot( this, SLOT( abortFetch() ) ); + .setAbortSlot( this, TQT_SLOT( abortFetch() ) ); - connect( m_podcastJob, SIGNAL( result( KIO::Job* ) ), SLOT( fetchResult( KIO::Job* ) ) ); + connect( m_podcastJob, TQT_SIGNAL( result( KIO::Job* ) ), TQT_SLOT( fetchResult( KIO::Job* ) ) ); } void @@ -1837,10 +1837,10 @@ PodcastChannel::fetchResult( KIO::Job* job ) //SLOT KIO::StoredTransferJob* const storedJob = static_cast( job ); - QDomDocument d; + TQDomDocument d; - QString data = QString( storedJob->data() ); - QString error; + TQString data = TQString( storedJob->data() ); + TQString error; int errorline, errorcolumn; if( !d.setContent( storedJob->data(), false /* disable namespace processing */, &error, &errorline, &errorcolumn ) ) @@ -1855,7 +1855,7 @@ PodcastChannel::fetchResult( KIO::Job* job ) //SLOT return; } - QDomNode type = d.elementsByTagName("rss").item( 0 ); + TQDomNode type = d.elementsByTagName("rss").item( 0 ); if( type.isNull() || type.toElement().attribute( "version" ) != "2.0" ) { type = d.elementsByTagName("feed").item( 0 ); @@ -1883,7 +1883,7 @@ PodcastChannel::fetchResult( KIO::Job* job ) //SLOT void PodcastChannel::removeChildren() { - QListViewItem *child, *next; + TQListViewItem *child, *next; if ( (child = firstChild()) ) { while ( (next = child->nextSibling()) ) @@ -1918,30 +1918,30 @@ PodcastChannel::setNew( bool n ) /// DON'T TOUCH m_url!!! The podcast has no mention to the location of the xml file. void -PodcastChannel::setXml( const QDomNode &xml, const int feedType ) +PodcastChannel::setXml( const TQDomNode &xml, const int feedType ) { /// Podcast Channel information const bool isAtom = ( feedType == ATOM ); - QString t = xml.namedItem( "title" ).toElement().text().remove("\n"); + TQString t = xml.namedItem( "title" ).toElement().text().remove("\n"); - QString a = xml.namedItem( "author" ).toElement().text().remove("\n"); + TQString a = xml.namedItem( "author" ).toElement().text().remove("\n"); setText( 0, t ); - QString l = QString::null; + TQString l = TQString::null; if( isAtom ) l = xml.namedItem( "link" ).toElement().attribute( "rel" ); else l = xml.namedItem( "link" ).toElement().text(); - QString d = xml.namedItem( "description" ).toElement().text(); - QString id = xml.namedItem( "itunes:summary" ).toElement().text(); + TQString d = xml.namedItem( "description" ).toElement().text(); + TQString id = xml.namedItem( "itunes:summary" ).toElement().text(); if( id.length() > d.length() ) d = id; - QString c = xml.namedItem( "copyright" ).toElement().text(); - QString img = xml.namedItem( "image" ).toElement().namedItem( "url" ).toElement().text(); + TQString c = xml.namedItem( "copyright" ).toElement().text(); + TQString img = xml.namedItem( "image" ).toElement().namedItem( "url" ).toElement().text(); if( img.isEmpty() ) img = xml.namedItem( "itunes:image" ).toElement().namedItem( "url" ).toElement().text(); if( img.isEmpty() ) @@ -1978,7 +1978,7 @@ PodcastChannel::setXml( const QDomNode &xml, const int feedType ) /// Podcast Episodes information - QDomNode n; + TQDomNode n; if( isAtom ) n = xml.namedItem( "entry" ); else @@ -1986,29 +1986,29 @@ PodcastChannel::setXml( const QDomNode &xml, const int feedType ) bool hasNew = false; bool downloadMedia = ( fetchType() == AUTOMATIC ); - QDomNode node; + TQDomNode node; // We use an auto-increment id in the database, so we must insert podcasts in the reverse order // to ensure we can pull them out reliably. - QPtrList eList; + TQPtrList eList; for( ; !n.isNull(); n = n.nextSibling() ) { if( !n.namedItem( "enclosure" ).toElement().attribute( "url" ).isEmpty() ) { //prepending ensures correct order in 99% of the channels, except those who use chronological order - eList.prepend( new QDomElement( n.toElement() ) ); + eList.prepend( new TQDomElement( n.toElement() ) ); } else if( isAtom ) { // Atom feeds have multiple nodes called link, only one which has an enclosure. - QDomNode nodes = n.namedItem("link"); + TQDomNode nodes = n.namedItem("link"); for( ; !nodes.isNull(); nodes = nodes.nextSibling() ) { if( nodes.toElement().attribute("rel") == "enclosure" ) { - eList.prepend( new QDomElement( n.toElement() ) ); + eList.prepend( new TQDomElement( n.toElement() ) ); break; } } @@ -2016,7 +2016,7 @@ PodcastChannel::setXml( const QDomNode &xml, const int feedType ) } uint i = m_bundle.hasPurge() ? m_bundle.purgeCount() : eList.count(); - foreachType( QPtrList, eList ) + foreachType( TQPtrList, eList ) { if( !m_updating || ( ( i++ >= eList.count() ) && !episodeExists( (**it), feedType ) ) ) { @@ -2047,48 +2047,48 @@ PodcastChannel::setXml( const QDomNode &xml, const int feedType ) } const bool -PodcastChannel::episodeExists( const QDomNode &xml, const int feedType ) +PodcastChannel::episodeExists( const TQDomNode &xml, const int feedType ) { - QString command; + TQString command; if( feedType == RSS ) { //check id - QString guid = xml.namedItem( "guid" ).toElement().text(); + TQString guid = xml.namedItem( "guid" ).toElement().text(); if( !guid.isEmpty() ) { - command = QString("SELECT id FROM podcastepisodes WHERE parent='%1' AND guid='%2';") + command = TQString("SELECT id FROM podcastepisodes WHERE parent='%1' AND guid='%2';") .arg( CollectionDB::instance()->escapeString( url().url() ), CollectionDB::instance()->escapeString( guid ) ); - QStringList values = CollectionDB::instance()->query( command ); + TQStringList values = CollectionDB::instance()->query( command ); return !values.isEmpty(); } - QString episodeTitle = xml.namedItem( "title" ).toElement().text(); + TQString episodeTitle = xml.namedItem( "title" ).toElement().text(); KURL episodeURL = xml.namedItem( "enclosure" ).toElement().attribute( "url" ); - command = QString("SELECT id FROM podcastepisodes WHERE parent='%1' AND url='%2' AND title='%3';") + command = TQString("SELECT id FROM podcastepisodes WHERE parent='%1' AND url='%2' AND title='%3';") .arg( CollectionDB::instance()->escapeString( url().url() ), CollectionDB::instance()->escapeString( episodeURL.url() ), CollectionDB::instance()->escapeString( episodeTitle ) ); - QStringList values = CollectionDB::instance()->query( command ); + TQStringList values = CollectionDB::instance()->query( command ); return !values.isEmpty(); } else if( feedType == ATOM ) { //check id - QString guid = xml.namedItem( "id" ).toElement().text(); + TQString guid = xml.namedItem( "id" ).toElement().text(); if( !guid.isEmpty() ) { - command = QString("SELECT id FROM podcastepisodes WHERE parent='%1' AND guid='%2';") + command = TQString("SELECT id FROM podcastepisodes WHERE parent='%1' AND guid='%2';") .arg( CollectionDB::instance()->escapeString( url().url() ), CollectionDB::instance()->escapeString( guid ) ); - QStringList values = CollectionDB::instance()->query( command ); + TQStringList values = CollectionDB::instance()->query( command ); return !values.isEmpty(); } - QString episodeTitle = xml.namedItem("title").toElement().text(); - QString episodeURL = QString::null; - QDomNode n = xml.namedItem("link"); + TQString episodeTitle = xml.namedItem("title").toElement().text(); + TQString episodeURL = TQString::null; + TQDomNode n = xml.namedItem("link"); for( ; !n.isNull(); n = n.nextSibling() ) { if( n.nodeName() == "link" && n.toElement().attribute("rel") == "enclosure" ) @@ -2098,11 +2098,11 @@ PodcastChannel::episodeExists( const QDomNode &xml, const int feedType ) } } - command = QString("SELECT id FROM podcastepisodes WHERE parent='%1' AND url='%2' AND title='%3';") + command = TQString("SELECT id FROM podcastepisodes WHERE parent='%1' AND url='%2' AND title='%3';") .arg( CollectionDB::instance()->escapeString( url().url() ), CollectionDB::instance()->escapeString( episodeURL ), CollectionDB::instance()->escapeString( episodeTitle ) ); - QStringList values = CollectionDB::instance()->query( command ); + TQStringList values = CollectionDB::instance()->query( command ); return !values.isEmpty(); } @@ -2132,9 +2132,9 @@ PodcastChannel::updateInfo() if( !isPolished() ) load(); - const QString body = "%1%2"; + const TQString body = "%1%2"; - QString str = ""; + TQString str = "
        "; str += body.arg( i18n( "Description" ), description() ); str += body.arg( i18n( "Website" ), link().prettyURL() ); @@ -2142,9 +2142,9 @@ PodcastChannel::updateInfo() str += body.arg( i18n( "URL" ), m_url.prettyURL() ); str += "
        "; str += i18n( "

         Episodes

          " ); - for( QListViewItem *c = firstChild(); c; c = c->nextSibling() ) + for( TQListViewItem *c = firstChild(); c; c = c->nextSibling() ) { - str += QString("
        • %1
        • ").arg( static_cast(c)->title() ); + str += TQString("
        • %1
        • ").arg( static_cast(c)->title() ); } str += "
        "; @@ -2158,7 +2158,7 @@ PodcastChannel::slotDoubleClicked() if( !isPolished() ) load(); KURL::List list; - QListViewItem *child = firstChild(); + TQListViewItem *child = firstChild(); while( child ) { #define child static_cast(child) @@ -2187,9 +2187,9 @@ PodcastChannel::purge() } KURL::List urlsToDelete; - QValueList purgedItems; + TQValueList purgedItems; - QListViewItem *current = firstChild(); + TQListViewItem *current = firstChild(); for( int i=0; current && i < childCount(); current = current->nextSibling(), i++ ) { if( i < purgeCount() ) @@ -2198,9 +2198,9 @@ PodcastChannel::purge() purgedItems.append( current ); } - foreachType( QValueList, purgedItems ) + foreachType( TQValueList, purgedItems ) { - QListViewItem *item = *it; + TQListViewItem *item = *it; #define item static_cast(item) if( item->isOnDisk() ) @@ -2224,10 +2224,10 @@ PodcastChannel::restorePurged() if( restoreCount <= 0 ) return; - QValueList episodes; + TQValueList episodes; episodes = CollectionDB::instance()->getPodcastEpisodes( url() ); - QValueList possibleEntries; + TQValueList possibleEntries; int i = 0; @@ -2259,7 +2259,7 @@ PodcastChannel::restorePurged() } // the sorting of the channels automatically means the new episodes gets placed at the end - for( QValueList::Iterator it = possibleEntries.begin(), end = possibleEntries.end(); + for( TQValueList::Iterator it = possibleEntries.begin(), end = possibleEntries.end(); it != end; ++it ) new PodcastEpisode( this, 0, (*it) ); @@ -2295,7 +2295,7 @@ PodcastChannel::slotAnimation() void -PodcastChannel::showContextMenu( const QPoint &position ) +PodcastChannel::showContextMenu( const TQPoint &position ) { KPopupMenu menu( listView() ); @@ -2355,8 +2355,8 @@ PodcastChannel::showContextMenu( const QPoint &position ) /// @note we fucking hate itunes for taking over podcasts and inserting /// their own attributes. //////////////////////////////////////////////////////////////////////////// -PodcastEpisode::PodcastEpisode( QListViewItem *parent, QListViewItem *after, - const QDomElement &xml, const int feedType, const bool &isNew ) +PodcastEpisode::PodcastEpisode( TQListViewItem *parent, TQListViewItem *after, + const TQDomElement &xml, const int feedType, const bool &isNew ) : PlaylistBrowserEntry( parent, after ) , m_parent( parent ) , m_fetching( false ) @@ -2364,17 +2364,17 @@ PodcastEpisode::PodcastEpisode( QListViewItem *parent, QListViewItem *after, , m_localUrl( KURL() ) { const bool isAtom = ( feedType == ATOM ); - QString title = xml.namedItem( "title" ).toElement().text().remove("\n"); - QString subtitle; + TQString title = xml.namedItem( "title" ).toElement().text().remove("\n"); + TQString subtitle; - QString description, author, date, guid, type; + TQString description, author, date, guid, type; int duration = 0; uint size = 0; KURL link; if( isAtom ) { - for( QDomNode n = xml.firstChild(); !n.isNull(); n = n.nextSibling() ) + for( TQDomNode n = xml.firstChild(); !n.isNull(); n = n.nextSibling() ) { if ( n.nodeName() == "summary" ) description = n.toElement().text(); else if ( n.nodeName() == "author" ) author = n.toElement().text().remove("\n"); @@ -2384,7 +2384,7 @@ PodcastEpisode::PodcastEpisode( QListViewItem *parent, QListViewItem *after, { if( n.toElement().attribute( "rel" ) == "enclosure" ) { - const QString weblink = n.toElement().attribute( "href" ); + const TQString weblink = n.toElement().attribute( "href" ); link = KURL::fromPathOrURL( weblink ); } } @@ -2393,7 +2393,7 @@ PodcastEpisode::PodcastEpisode( QListViewItem *parent, QListViewItem *after, else { description = xml.namedItem( "description" ).toElement().text(); - QString idescription = xml.namedItem( "itunes:summary" ).toElement().text(); + TQString idescription = xml.namedItem( "itunes:summary" ).toElement().text(); if( idescription.length() > description.length() ) description = idescription; @@ -2408,19 +2408,19 @@ PodcastEpisode::PodcastEpisode( QListViewItem *parent, QListViewItem *after, if( date.isEmpty() ) date = xml.namedItem( "dc:date" ).toElement().text(); - QString ds = xml.namedItem( "itunes:duration" ).toElement().text(); - QString secs = ds.section( ":", -1, -1 ); + TQString ds = xml.namedItem( "itunes:duration" ).toElement().text(); + TQString secs = ds.section( ":", -1, -1 ); duration = secs.toInt(); - QString min = ds.section( ":", -2, -2 ); + TQString min = ds.section( ":", -2, -2 ); duration += min.toInt() * 60; - QString h = ds.section( ":", -3, -3 ); + TQString h = ds.section( ":", -3, -3 ); duration += h.toInt() * 3600; size = xml.namedItem( "enclosure" ).toElement().attribute( "length" ).toInt(); type = xml.namedItem( "enclosure" ).toElement().attribute( "type" ); guid = xml.namedItem( "guid" ).toElement().text(); - const QString weblink = xml.namedItem( "enclosure" ).toElement().attribute( "url" ); + const TQString weblink = xml.namedItem( "enclosure" ).toElement().attribute( "url" ); link = KURL::fromPathOrURL( weblink ); } @@ -2452,7 +2452,7 @@ PodcastEpisode::PodcastEpisode( QListViewItem *parent, QListViewItem *after, setRenameEnabled( 0, false ); } -PodcastEpisode::PodcastEpisode( QListViewItem *parent, QListViewItem *after, PodcastEpisodeBundle &bundle ) +PodcastEpisode::PodcastEpisode( TQListViewItem *parent, TQListViewItem *after, PodcastEpisodeBundle &bundle ) : PlaylistBrowserEntry( parent, after ) , m_parent( parent ) , m_bundle( bundle ) @@ -2469,7 +2469,7 @@ PodcastEpisode::PodcastEpisode( QListViewItem *parent, QListViewItem *after, Pod } int -PodcastEpisode::compare( QListViewItem* item, int col, bool ascending ) const +PodcastEpisode::compare( TQListViewItem* item, int col, bool ascending ) const { if ( item->rtti() == PodcastEpisode::RTTI ) { @@ -2524,7 +2524,7 @@ PodcastEpisode::isOnDisk() else { // bool oldOnDisk = m_onDisk; - m_onDisk = QFile::exists( m_localUrl.path() ); + m_onDisk = TQFile::exists( m_localUrl.path() ); updatePixmap(); // m_bundle.setLocalURL( m_onDisk ? m_localUrl : KURL() ); // if( oldOnDisk != m_onDisk && dBId() ) @@ -2547,7 +2547,7 @@ PodcastEpisode::downloadMedia() m_iconCounter = 1; startAnimation(); - connect( &m_animationTimer, SIGNAL(timeout()), this, SLOT(slotAnimation()) ); + connect( &m_animationTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotAnimation()) ); KURL localDir; PodcastChannel *channel = dynamic_cast(m_parent); @@ -2566,11 +2566,11 @@ PodcastEpisode::downloadMedia() .setDescription( title().isEmpty() ? i18n( "Downloading Podcast Media" ) : i18n( "Downloading Podcast \"%1\"" ).arg( title() ) ) - .setAbortSlot( this, SLOT( abortDownload()) ) - .setProgressSignal( m_podcastEpisodeJob, SIGNAL( percent( KIO::Job *, unsigned long ) ) ); + .setAbortSlot( this, TQT_SLOT( abortDownload()) ) + .setProgressSignal( m_podcastEpisodeJob, TQT_SIGNAL( percent( KIO::Job *, unsigned long ) ) ); - connect( m_podcastEpisodeJob, SIGNAL( result( KIO::Job * ) ), SLOT( downloadResult( KIO::Job * ) ) ); - connect( m_podcastEpisodeJob, SIGNAL( redirection( KIO::Job *,const KURL& ) ), SLOT( redirected( KIO::Job *,const KURL& ) ) ); + connect( m_podcastEpisodeJob, TQT_SIGNAL( result( KIO::Job * ) ), TQT_SLOT( downloadResult( KIO::Job * ) ) ); + connect( m_podcastEpisodeJob, TQT_SIGNAL( redirection( KIO::Job *,const KURL& ) ), TQT_SLOT( redirected( KIO::Job *,const KURL& ) ) ); } /* change the localurl if redirected, allows us to use the original filename to transfer to mediadevices*/ @@ -2584,12 +2584,12 @@ void PodcastEpisode::createLocalDir( const KURL &localDir ) { if( localDir.isEmpty() ) return; - QString localDirString = localDir.path(); - if( !QFile::exists( localDirString ) ) + TQString localDirString = localDir.path(); + if( !TQFile::exists( localDirString ) ) { - QString parentDirString = localDir.directory( true, true ); + TQString parentDirString = localDir.directory( true, true ); createLocalDir( parentDirString ); - QDir dir( localDirString ); + TQDir dir( localDirString ); dir.mkdir( localDirString ); } } @@ -2626,7 +2626,7 @@ void PodcastEpisode::downloadResult( KIO::Job * transferJob ) { m_localUrl.addPath( m_filename ); - QFile *localFile = new QFile( m_localUrl.path() ); + TQFile *localFile = new TQFile( m_localUrl.path() ); localFile->open( IO_WriteOnly ); localFile->writeBlock( m_podcastEpisodeJob->data() ); localFile->close(); @@ -2668,12 +2668,12 @@ PodcastEpisode::addToMediaDevice() } void -PodcastEpisode::setLocalUrlBase( const QString &s ) +PodcastEpisode::setLocalUrlBase( const TQString &s ) { if ( !m_localUrl.isEmpty() ) { - QString filename = m_localUrl.filename(); - QString newL = s + filename; + TQString filename = m_localUrl.filename(); + TQString newL = s + filename; m_localUrl = KURL::fromPathOrURL( newL ); } } @@ -2721,7 +2721,7 @@ PodcastEpisode::slotAnimation() void PodcastEpisode::setup() { - QFontMetrics fm( listView()->font() ); + TQFontMetrics fm( listView()->font() ); int margin = listView()->itemMargin()*2; int h = fm.lineSpacing(); if ( h % 2 > 0 ) h++; @@ -2729,10 +2729,10 @@ PodcastEpisode::setup() } void -PodcastEpisode::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align ) +PodcastEpisode::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align ) { //flicker-free drawing - static QPixmap buffer; + static TQPixmap buffer; buffer.resize( width, height() ); if( buffer.isNull() ) @@ -2741,7 +2741,7 @@ PodcastEpisode::paintCell( QPainter *p, const QColorGroup &cg, int column, int w return; } - QPainter pBuf( &buffer, true ); + TQPainter pBuf( &buffer, true ); // use alternate background #if KDE_VERSION < KDE_MAKE_VERSION(3,3,91) pBuf.fillRect( buffer.rect(), isSelected() ? cg.highlight() : backgroundColor() ); @@ -2751,8 +2751,8 @@ PodcastEpisode::paintCell( QPainter *p, const QColorGroup &cg, int column, int w KListView *lv = static_cast( listView() ); - QFont font( p->font() ); - QFontMetrics fm( p->fontMetrics() ); + TQFont font( p->font() ); + TQFontMetrics fm( p->fontMetrics() ); int text_x = 0;// lv->treeStepSize() + 3; int textHeight; @@ -2769,9 +2769,9 @@ PodcastEpisode::paintCell( QPainter *p, const QColorGroup &cg, int column, int w } pBuf.setFont( font ); - QFontMetrics fmName( font ); + TQFontMetrics fmName( font ); - QString name = text(column); + TQString name = text(column); const int _width = width - text_x - lv->itemMargin()*2; if( fmName.width( name ) > _width ) { @@ -2790,9 +2790,9 @@ PodcastEpisode::paintCell( QPainter *p, const QColorGroup &cg, int column, int w void PodcastEpisode::updateInfo() { - const QString body = "%1%2"; + const TQString body = "%1%2"; - QString str = ""; + TQString str = "
        "; //str += body.arg( i18n( "Title" ), m_bundle.title() ); str += body.arg( i18n( "Description" ), m_bundle.description() ); @@ -2822,7 +2822,7 @@ PodcastEpisode::slotDoubleClicked() void -PodcastEpisode::showContextMenu( const QPoint &position ) +PodcastEpisode::showContextMenu( const TQPoint &position ) { KPopupMenu menu( listView() ); @@ -2908,7 +2908,7 @@ PodcastEpisode::showContextMenu( const QPoint &position ) break; case LISTENED: - for ( QListViewItemIterator it( listView(), QListViewItemIterator::Selected); *it; ++it ) + for ( TQListViewItemIterator it( listView(), TQListViewItemIterator::Selected); *it; ++it ) { if ( isPodcastEpisode( *it ) ) static_cast(*it)->setListened(); @@ -2916,7 +2916,7 @@ PodcastEpisode::showContextMenu( const QPoint &position ) break; case NEW: - for ( QListViewItemIterator it( listView(), QListViewItemIterator::Selected); *it; ++it ) + for ( TQListViewItemIterator it( listView(), TQListViewItemIterator::Selected); *it; ++it ) { if ( isPodcastEpisode( *it ) ) static_cast(*it)->setListened(false); @@ -2927,7 +2927,7 @@ PodcastEpisode::showContextMenu( const QPoint &position ) // tags on podcasts are sometimes bad, thus use other meta information if available if( isSelected() ) { - for ( QListViewItemIterator it( listView(), QListViewItemIterator::Selected); *it; ++it) + for ( TQListViewItemIterator it( listView(), TQListViewItemIterator::Selected); *it; ++it) { if( isPodcastEpisode( *it ) ) { @@ -2979,7 +2979,7 @@ class AssociatePodcastDialog : public KDialogBase AssociatePodcastDialog( PodcastEpisode *item ) : KDialogBase( Amarok::mainWindow(), "associatepodcastdialog", true, i18n("Select Local File for %1").arg(item->title()), Ok|Cancel, Ok, false ) { - QVBox* vbox = makeVBoxMainWidget(); + TQVBox* vbox = makeVBoxMainWidget(); vbox->setSpacing( KDialog::spacingHint() ); m_urlRequester = new KURLRequester( vbox ); @@ -2995,7 +2995,7 @@ PodcastEpisode::associateWithLocalFile() AssociatePodcastDialog d( this ); if( d.exec() == KDialogBase::Accepted ) { - if( !d.url().isLocalFile() || !QFileInfo( d.url().path() ).isFile() ) + if( !d.url().isLocalFile() || !TQFileInfo( d.url().path() ).isFile() ) Amarok::StatusBar::instance()->shortMessage( i18n( "Invalid local podcast URL." ) ); else setLocalUrl( d.url() ); @@ -3007,7 +3007,7 @@ PodcastEpisode::associateWithLocalFile() /// CLASS SmartPlaylist //////////////////////////////////////////////////////////////////////////// -SmartPlaylist::SmartPlaylist( QListViewItem *parent, QListViewItem *after, const QString &name, const QString &query ) +SmartPlaylist::SmartPlaylist( TQListViewItem *parent, TQListViewItem *after, const TQString &name, const TQString &query ) : PlaylistBrowserEntry( parent, after, name ) , m_sqlForTags( query ) , m_title( name ) @@ -3019,7 +3019,7 @@ SmartPlaylist::SmartPlaylist( QListViewItem *parent, QListViewItem *after, const setText( 0, name ); } -SmartPlaylist::SmartPlaylist( QListViewItem *parent, QListViewItem *after, const QString &name, const QString &urls, const QString &tags ) +SmartPlaylist::SmartPlaylist( TQListViewItem *parent, TQListViewItem *after, const TQString &name, const TQString &urls, const TQString &tags ) : PlaylistBrowserEntry( parent, after, name ) , m_sqlForTags( tags ) , m_title( name ) @@ -3032,7 +3032,7 @@ SmartPlaylist::SmartPlaylist( QListViewItem *parent, QListViewItem *after, const } -SmartPlaylist::SmartPlaylist( QListViewItem *parent, QListViewItem *after, const QDomElement &xmlDefinition ) +SmartPlaylist::SmartPlaylist( TQListViewItem *parent, TQListViewItem *after, const TQDomElement &xmlDefinition ) : PlaylistBrowserEntry( parent, after ) , m_after( after ) , m_dynamic( false ) @@ -3044,17 +3044,17 @@ SmartPlaylist::SmartPlaylist( QListViewItem *parent, QListViewItem *after, const int SmartPlaylist::length() { - QString sql = query(); - sql.replace(QRegExp("SELECT.*FROM"), "SELECT COUNT(*) FROM"); + TQString sql = query(); + sql.replace(TQRegExp("SELECT.*FROM"), "SELECT COUNT(*) FROM"); CollectionDB *db = CollectionDB::instance(); - QStringList result = db->query( sql ); + TQStringList result = db->query( sql ); if (! result.isEmpty()) return result.first().toInt(); else return 0; } -void SmartPlaylist::setXml( const QDomElement &xml ) +void SmartPlaylist::setXml( const TQDomElement &xml ) { m_xml = xml; m_title = xml.attribute( "name" ); @@ -3062,24 +3062,24 @@ void SmartPlaylist::setXml( const QDomElement &xml ) // ignore query, we now compute it when needed //m_sqlForTags = xml.namedItem( "sqlquery" ).toElement().text(); m_sqlForTags = ""; - static QStringList genres; - static QStringList artists; - static QStringList composers; - static QStringList albums; - static QStringList years; - static QStringList labels; + static TQStringList genres; + static TQStringList artists; + static TQStringList composers; + static TQStringList albums; + static TQStringList years; + static TQStringList labels; //Delete all children before while( firstChild() ) delete firstChild(); - QDomNode expandN = xml.namedItem( "expandby" ); + TQDomNode expandN = xml.namedItem( "expandby" ); if ( !expandN.isNull() ) { // precompute query - QString queryChildren = xmlToQuery( m_xml, true ); + TQString queryChildren = xmlToQuery( m_xml, true ); - QDomElement expand = expandN.toElement(); - QString field = expand.attribute( "field" ); + TQDomElement expand = expandN.toElement(); + TQString field = expand.attribute( "field" ); SmartPlaylist *item = this; if ( field == i18n("Genre") ) { if ( genres.isEmpty() ) { @@ -3087,7 +3087,7 @@ void SmartPlaylist::setXml( const QDomElement &xml ) } foreach( genres ) { m_after = new SmartPlaylist( item, m_after, i18n( "%1" ).arg( *it ), - QString(queryChildren).replace( + TQString(queryChildren).replace( "(*ExpandString*)", *it) ); } } @@ -3097,7 +3097,7 @@ void SmartPlaylist::setXml( const QDomElement &xml ) } foreach( artists ) { m_after = new SmartPlaylist( item, m_after, i18n( "By %1" ).arg( *it ), - QString(queryChildren).replace( + TQString(queryChildren).replace( "(*ExpandString*)", *it) ); } } @@ -3107,7 +3107,7 @@ void SmartPlaylist::setXml( const QDomElement &xml ) } foreach( composers ) { m_after = new SmartPlaylist( item, m_after, i18n( "By %1" ).arg( *it ), - QString(queryChildren).replace( + TQString(queryChildren).replace( "(*ExpandString*)", *it) ); } } @@ -3117,7 +3117,7 @@ void SmartPlaylist::setXml( const QDomElement &xml ) } foreach( albums ) { m_after = new SmartPlaylist( item, m_after, i18n( "%1" ).arg( *it ), - QString(queryChildren).replace( + TQString(queryChildren).replace( "(*ExpandString*)", *it) ); } } @@ -3127,7 +3127,7 @@ void SmartPlaylist::setXml( const QDomElement &xml ) } foreach( years ) { m_after = new SmartPlaylist( item, m_after, i18n( "%1" ).arg( *it ), - QString(queryChildren).replace( + TQString(queryChildren).replace( "(*ExpandString*)", *it) ); } } @@ -3136,20 +3136,20 @@ void SmartPlaylist::setXml( const QDomElement &xml ) labels = CollectionDB::instance()->labelList(); } foreach( labels ) { - m_after = new SmartPlaylist( item, m_after, i18n( "%1" ).arg( *it ), QString(queryChildren).replace("(*ExpandString*)", *it) ); + m_after = new SmartPlaylist( item, m_after, i18n( "%1" ).arg( *it ), TQString(queryChildren).replace("(*ExpandString*)", *it) ); } } } } -QString SmartPlaylist::query() +TQString SmartPlaylist::query() { if ( m_sqlForTags.isEmpty() ) m_sqlForTags = xmlToQuery( m_xml ); - // duplicate string, thread-safely (QDeepCopy is not thread-safe) - return QString( m_sqlForTags.unicode(), m_sqlForTags.length() ) + // duplicate string, thread-safely (TQDeepCopy is not thread-safe) + return TQString( m_sqlForTags.unicode(), m_sqlForTags.length() ) .replace( "(*CurrentTimeT*)" , - QString::number(QDateTime::currentDateTime().toTime_t()) ) + TQString::number(TQDateTime::currentDateTime().toTime_t()) ) .replace( "(*ListOfFields*)" , QueryBuilder::dragSQLFields() ) .replace( "(*MountedDeviceSelection*)" , CollectionDB::instance()->deviceidSelection() ); @@ -3157,7 +3157,7 @@ QString SmartPlaylist::query() // static QString -SmartPlaylist::xmlToQuery(const QDomElement &xml, bool forExpand /* = false */) { +SmartPlaylist::xmlToQuery(const TQDomElement &xml, bool forExpand /* = false */) { QueryBuilder qb; qb.initSQLDrag(); @@ -3167,10 +3167,10 @@ SmartPlaylist::xmlToQuery(const QDomElement &xml, bool forExpand /* = false */) // it's just a little more verbose when iterating. // Add filters - QDomNodeList matchesList = xml.elementsByTagName( "matches" ); + TQDomNodeList matchesList = xml.elementsByTagName( "matches" ); for ( uint i = 0; i < matchesList.count(); i++ ) { - QDomElement matches = matchesList.item( i ).toElement(); - QDomNodeList criteriaList = matches.elementsByTagName( "criteria" ); + TQDomElement matches = matchesList.item( i ).toElement(); + TQDomNodeList criteriaList = matches.elementsByTagName( "criteria" ); if ( matches.attribute( "glue" ) == "OR" ) qb.beginOR(); @@ -3178,35 +3178,35 @@ SmartPlaylist::xmlToQuery(const QDomElement &xml, bool forExpand /* = false */) qb.beginAND(); for ( uint j = 0; j < criteriaList.count(); j++ ) { - QDomElement criteria = criteriaList.item( j ).toElement(); - QString field = criteria.attribute( "field" ); + TQDomElement criteria = criteriaList.item( j ).toElement(); + TQString field = criteria.attribute( "field" ); int table; Q_INT64 value; if ( !qb.getField( field, &table, &value ) ) continue; - QStringList filters; + TQStringList filters; // name conflict :) XML "value" -> QueryBuilder "filter" - QDomNodeList domFilterList = criteria.elementsByTagName( "value" ); + TQDomNodeList domFilterList = criteria.elementsByTagName( "value" ); for ( uint k = 0 ; k < domFilterList.count(); k++ ) { filters << domFilterList.item(k).toElement().text(); } - QString condition = criteria.attribute( "condition" ); + TQString condition = criteria.attribute( "condition" ); // Interpret dates bool isDate = (value & (QueryBuilder::valCreateDate | QueryBuilder::valAccessDate)) > 0; if ( isDate ) { - QDateTime dt1, dt2; + TQDateTime dt1, dt2; if ( condition == i18n( "is in the last" ) || condition == i18n( "is not in the last" ) ) { - QString period = criteria.attribute( "period" ); + TQString period = criteria.attribute( "period" ); uint time = filters[0].toInt(); if ( period == "days" ) time *= 86400; else if ( period == "months" ) time *= 86400 * 30; else if ( period == "years" ) time *= 86400 * 365; - filters[0] = "(*CurrentTimeT*) - " + QString::number( time ); + filters[0] = "(*CurrentTimeT*) - " + TQString::number( time ); if ( filters.count() == 1 ) filters.push_back( "" ); filters[1] = "(*CurrentTimeT*)"; @@ -3215,25 +3215,25 @@ SmartPlaylist::xmlToQuery(const QDomElement &xml, bool forExpand /* = false */) dt1.setTime_t( filters[0].toInt() ); // truncate to midnight if ( condition == i18n( "is after" ) ) - dt1.setTime( QTime().addSecs(-1) ); // 11:59:59 pm + dt1.setTime( TQTime().addSecs(-1) ); // 11:59:59 pm else - dt1.setTime( QTime() ); + dt1.setTime( TQTime() ); if ( filters.count() > 1 ) { dt2.setTime_t( filters[1].toInt() ); // this is a "between", so always go till right before midnight - dt2.setTime( QTime().addSecs( -1 ) ); + dt2.setTime( TQTime().addSecs( -1 ) ); } } } if ( value & QueryBuilder::valLength ) { - QString period = criteria.attribute( "period" ); + TQString period = criteria.attribute( "period" ); uint time1 = filters[0].toInt(); if ( period == "minutes" ) time1 *= 60; else if ( period == "hours" ) time1 *= 3600; - filters[0] = QString::number( time1 ); + filters[0] = TQString::number( time1 ); if ( condition == i18n( "is between" ) ) { uint time2 = filters[1].toInt(); @@ -3241,7 +3241,7 @@ SmartPlaylist::xmlToQuery(const QDomElement &xml, bool forExpand /* = false */) time2 *= 60; else if ( period == "hours" ) time2 *= 3600; - filters[1] = QString::number( time2 ); + filters[1] = TQString::number( time2 ); } } @@ -3301,10 +3301,10 @@ SmartPlaylist::xmlToQuery(const QDomElement &xml, bool forExpand /* = false */) } // order by - QDomNodeList orderbyList = xml.elementsByTagName( "orderby" ); + TQDomNodeList orderbyList = xml.elementsByTagName( "orderby" ); for ( uint i = 0; i < orderbyList.count(); i++ ) { - QDomElement orderby = orderbyList.item( i ).toElement(); - QString field = orderby.attribute( "field" ); + TQDomElement orderby = orderbyList.item( i ).toElement(); + TQString field = orderby.attribute( "field" ); if ( field == "random" ) { // shuffle @@ -3332,10 +3332,10 @@ SmartPlaylist::xmlToQuery(const QDomElement &xml, bool forExpand /* = false */) // and what to expand by, then have the children compute the query as needed. // This could save a few megs of RAM for queries, but this patch is getting // too big already, right now. Ovy - QDomNodeList expandbyList = xml.elementsByTagName( "expandby" ); + TQDomNodeList expandbyList = xml.elementsByTagName( "expandby" ); for ( uint i = 0; i < expandbyList.count(); i++ ) { - QDomElement expandby = expandbyList.item( i ).toElement(); - QString field = expandby.attribute( "field" ); + TQDomElement expandby = expandbyList.item( i ).toElement(); + TQString field = expandby.attribute( "field" ); int table = QueryBuilder::tabGenre; // make compiler happy if ( field == i18n( "Genre" ) ) table = QueryBuilder::tabGenre; @@ -3371,11 +3371,11 @@ void SmartPlaylist::setDynamic( bool enable ) bool SmartPlaylist::isTimeOrdered() { // matches statistics.createdate (firstplayed) and tags.createdate (modified date) - QRegExp createDate( "ORDER BY.*createdate" ); + TQRegExp createDate( "ORDER BY.*createdate" ); // matches last played - QRegExp accessDate( "ORDER BY.*accessdate" ); + TQRegExp accessDate( "ORDER BY.*accessdate" ); - const QString sql = query(); + const TQString sql = query(); return ! ( ( sql.find( createDate, false ) == -1 ) /*not create ordered*/ && ( sql.find( accessDate, false ) == -1 ) /*not access ordered*/ ); @@ -3390,7 +3390,7 @@ void SmartPlaylist::slotDoubleClicked() } } -void SmartPlaylist::showContextMenu( const QPoint &position ) +void SmartPlaylist::showContextMenu( const TQPoint &position ) { KPopupMenu menu( listView() ); @@ -3438,8 +3438,8 @@ void SmartPlaylist::showContextMenu( const QPoint &position ) break; case MEDIADEVICE_COPY: { - const QString playlist = text(0); - const QStringList values = CollectionDB::instance()->query( query() ); + const TQString playlist = text(0); + const TQStringList values = CollectionDB::instance()->query( query() ); MediaBrowser::queue()->addURLs( CollectionDB::instance()->URLsFromSqlDrag( values ), playlist ); } break; @@ -3449,7 +3449,7 @@ void SmartPlaylist::showContextMenu( const QPoint &position ) } } -void SmartPlaylist::slotPostRenameItem( const QString newName ) +void SmartPlaylist::slotPostRenameItem( const TQString newName ) { xml().setAttribute( "name", newName ); } @@ -3458,8 +3458,8 @@ ShoutcastBrowser::ShoutcastBrowser( PlaylistCategory *parent ) : PlaylistCategory( parent, 0, i18n( "Shoutcast Streams" ) ) , m_downloading( false ) , m_cj( 0 ) - , m_loading1( new QPixmap( locate("data", "amarok/images/loading1.png" ) ) ) - , m_loading2( new QPixmap( locate("data", "amarok/images/loading2.png" ) ) ) + , m_loading1( new TQPixmap( locate("data", "amarok/images/loading1.png" ) ) ) + , m_loading2( new TQPixmap( locate("data", "amarok/images/loading2.png" ) ) ) { setExpandable( true ); setKept( false ); @@ -3477,16 +3477,16 @@ void ShoutcastBrowser::setOpen( bool open ) if ( firstChild() ) // don't redownload everything { - QListViewItem::setOpen( open ); + TQListViewItem::setOpen( open ); return; } if( !m_animationTimer.isActive() ) m_animationTimer.start( ANIMATION_INTERVAL ); - connect( &m_animationTimer, SIGNAL(timeout()), this, SLOT(slotAnimation()) ); + connect( &m_animationTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotAnimation()) ); - QStringList tmpdirs = KGlobal::dirs()->resourceDirs( "tmp" ); - QString tmpfile = tmpdirs[0]; + TQStringList tmpdirs = KGlobal::dirs()->resourceDirs( "tmp" ); + TQString tmpfile = tmpdirs[0]; tmpfile += "/amarok-genres-" + KApplication::randomString(10) + ".xml-"; //get the genre list @@ -3494,12 +3494,12 @@ void ShoutcastBrowser::setOpen( bool open ) { m_downloading = true; m_cj = KIO::copy( "http://www.shoutcast.com/sbin/newxml.phtml", tmpfile, false ); - connect( m_cj, SIGNAL( copyingDone( KIO::Job*, const KURL&, const KURL&, bool, bool)) - , this, SLOT(doneGenreDownload(KIO::Job*, const KURL&, const KURL&, bool, bool ))); - connect( m_cj, SIGNAL( result( KIO::Job* )), this, SLOT( jobFinished( KIO::Job* ))); + connect( m_cj, TQT_SIGNAL( copyingDone( KIO::Job*, const KURL&, const KURL&, bool, bool)) + , this, TQT_SLOT(doneGenreDownload(KIO::Job*, const KURL&, const KURL&, bool, bool ))); + connect( m_cj, TQT_SIGNAL( result( KIO::Job* )), this, TQT_SLOT( jobFinished( KIO::Job* ))); } - QListViewItem::setOpen( open ); + TQListViewItem::setOpen( open ); } void ShoutcastBrowser::slotAnimation() @@ -3516,8 +3516,8 @@ void ShoutcastBrowser::doneGenreDownload( KIO::Job *job, const KURL &from, const { Q_UNUSED( job ); Q_UNUSED( from ); Q_UNUSED( directory ); Q_UNUSED( renamed ); - QDomDocument doc( "genres" ); - QFile file( to.path() ); + TQDomDocument doc( "genres" ); + TQFile file( to.path() ); if ( !file.open( IO_ReadOnly ) ) { warning() << "Cannot open shoutcast genre xml" << endl; @@ -3537,7 +3537,7 @@ void ShoutcastBrowser::doneGenreDownload( KIO::Job *job, const KURL &from, const KIO::del( to, false, false ); // We use this list to filter out some obscure genres - QStringList bannedGenres; + TQStringList bannedGenres; bannedGenres << "alles" << "any" << "anything" << "autopilot" << "backup" << "bandas" << "beer"; bannedGenres << "catholic" << "chr" << "das" << "domaca" << "everything" << "fire" << "her" << "hollands"; bannedGenres << "http" << "just" << "lokale" << "middle" << "noticias" << "only" << "scanner" << "shqip"; @@ -3552,7 +3552,7 @@ void ShoutcastBrowser::doneGenreDownload( KIO::Job *job, const KURL &from, const bannedGenres << "max" << "informaci" << "halk" << "dobra" << "welcome" << "genre"; // This maps genres that should be combined together - QMap genreMapping; + TQMap genreMapping; genreMapping["Romania"] = "Romanian"; genreMapping["Turk"] = "Turkish"; genreMapping["Turkce"] = "Turkish"; @@ -3573,14 +3573,14 @@ void ShoutcastBrowser::doneGenreDownload( KIO::Job *job, const KURL &from, const genreMapping["Sports"] = "Sport"; genreMapping["Spain"] = "Spanish"; - QDomElement docElem = doc.documentElement(); - QDomNode n = docElem.firstChild(); - QListViewItem *last = 0; - QMap genreCache; // maps names to the listview item + TQDomElement docElem = doc.documentElement(); + TQDomNode n = docElem.firstChild(); + TQListViewItem *last = 0; + TQMap genreCache; // maps names to the listview item while( !n.isNull() ) { - QDomElement e = n.toElement(); // try to convert the node to an element. - const QString name = e.attribute( "name" ); + TQDomElement e = n.toElement(); // try to convert the node to an element. + const TQString name = e.attribute( "name" ); if( !name.isNull() && !bannedGenres.contains( name.lower() ) && !genreMapping.contains( name ) ) { last = new ShoutcastGenre( this, last, name ); @@ -3589,7 +3589,7 @@ void ShoutcastBrowser::doneGenreDownload( KIO::Job *job, const KURL &from, const n = n.nextSibling(); } // Process the mapped (alternate) genres - for( QMap::iterator it = genreMapping.begin(); it != genreMapping.end(); ++it ) + for( TQMap::iterator it = genreMapping.begin(); it != genreMapping.end(); ++it ) { // Find the target genre ShoutcastGenre *existingGenre = dynamic_cast ( genreCache[ it.data() ] ); @@ -3612,11 +3612,11 @@ void ShoutcastBrowser::jobFinished( KIO::Job *job ) job->showErrorDialog( 0 ); } -ShoutcastGenre::ShoutcastGenre( ShoutcastBrowser *browser, QListViewItem *after, QString genre ) +ShoutcastGenre::ShoutcastGenre( ShoutcastBrowser *browser, TQListViewItem *after, TQString genre ) : PlaylistCategory( browser, after, genre ) , m_downloading( false ) - , m_loading1( new QPixmap( locate("data", "amarok/images/loading1.png" ) ) ) - , m_loading2( new QPixmap( locate("data", "amarok/images/loading2.png" ) ) ) + , m_loading1( new TQPixmap( locate("data", "amarok/images/loading1.png" ) ) ) + , m_loading2( new TQPixmap( locate("data", "amarok/images/loading2.png" ) ) ) { setExpandable( true ); setKept( false ); @@ -3635,15 +3635,15 @@ void ShoutcastGenre::setOpen( bool open ) if( firstChild() ) // don't redownload everything { - QListViewItem::setOpen( open ); + TQListViewItem::setOpen( open ); return; } if( !m_animationTimer.isActive() ) m_animationTimer.start( ANIMATION_INTERVAL ); - connect( &m_animationTimer, SIGNAL(timeout()), this, SLOT(slotAnimation()) ); + connect( &m_animationTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotAnimation()) ); - QStringList tmpdirs = KGlobal::dirs()->resourceDirs( "tmp" ); + TQStringList tmpdirs = KGlobal::dirs()->resourceDirs( "tmp" ); //get the genre list from shoutcast async, and when its done call the finish up functions to process if( !m_downloading) @@ -3652,19 +3652,19 @@ void ShoutcastGenre::setOpen( bool open ) m_totalJobs = 0; m_completedJobs = 0; startGenreDownload( m_genre, tmpdirs[0] ); - for( QStringList::iterator it = m_alternateGenres.begin(); it != m_alternateGenres.end(); ++it ) + for( TQStringList::iterator it = m_alternateGenres.begin(); it != m_alternateGenres.end(); ++it ) startGenreDownload( *it, tmpdirs[0] ); } } -void ShoutcastGenre::startGenreDownload( QString genre, QString tmppath ) +void ShoutcastGenre::startGenreDownload( TQString genre, TQString tmppath ) { - QString tmpfile = tmppath + "/amarok-list-" + genre + "-" + KApplication::randomString(10) + ".xml"; + TQString tmpfile = tmppath + "/amarok-list-" + genre + "-" + KApplication::randomString(10) + ".xml"; KIO::CopyJob *cj = KIO::copy( "http://www.shoutcast.com/sbin/newxml.phtml?genre=" + genre, tmpfile, false ); - connect( cj, SIGNAL( copyingDone ( KIO::Job*, const KURL&, const KURL&, bool, bool ) ), - this, SLOT( doneListDownload( KIO::Job*, const KURL&, const KURL&, bool, bool ) ) ); - connect( cj, SIGNAL( result ( KIO::Job* ) ), - this, SLOT( jobFinished( KIO::Job* ) ) ); + connect( cj, TQT_SIGNAL( copyingDone ( KIO::Job*, const KURL&, const KURL&, bool, bool ) ), + this, TQT_SLOT( doneListDownload( KIO::Job*, const KURL&, const KURL&, bool, bool ) ) ); + connect( cj, TQT_SIGNAL( result ( KIO::Job* ) ), + this, TQT_SLOT( jobFinished( KIO::Job* ) ) ); m_totalJobs++; } @@ -3684,8 +3684,8 @@ void ShoutcastGenre::doneListDownload( KIO::Job *job, const KURL &from, const KU m_completedJobs++; - QDomDocument doc( "list" ); - QFile file( to.path() ); + TQDomDocument doc( "list" ); + TQFile file( to.path() ); if ( !file.open( IO_ReadOnly ) ) { warning() << "Cannot open shoutcast playlist xml" << endl; @@ -3705,11 +3705,11 @@ void ShoutcastGenre::doneListDownload( KIO::Job *job, const KURL &from, const KU KIO::del(to, false, false); //Go through the XML file and add all the stations - QDomElement docElem = doc.documentElement(); - QDomNode n = docElem.firstChild(); + TQDomElement docElem = doc.documentElement(); + TQDomNode n = docElem.firstChild(); while( !n.isNull() ) { - QDomElement e = n.toElement(); // try to convert the node to an element. + TQDomElement e = n.toElement(); // try to convert the node to an element. if( e.hasAttribute( "name" ) ) { if( !e.attribute( "name" ).isNull() && ! m_stations.contains( e.attribute( "name" ) ) ) diff --git a/amarok/src/playlistbrowseritem.h b/amarok/src/playlistbrowseritem.h index 7cba8ddc..e6d955e9 100644 --- a/amarok/src/playlistbrowseritem.h +++ b/amarok/src/playlistbrowseritem.h @@ -20,12 +20,12 @@ #include #include -#include -#include -#include -#include -#include // Podcast loading animation -#include +#include +#include +#include +#include +#include // Podcast loading animation +#include class MetaBundle; class PlaylistTrackItem; @@ -47,19 +47,19 @@ namespace KIO { class Job; class TransferJob; class CopyJob; } //podcast downloa /* A base class to be able to use polymorphism and avoid tons of casts */ -class PlaylistBrowserEntry : public QObject, public KListViewItem +class PlaylistBrowserEntry : public TQObject, public KListViewItem { Q_OBJECT public: - PlaylistBrowserEntry( QListViewItem *parent, QListViewItem *after ) + PlaylistBrowserEntry( TQListViewItem *parent, TQListViewItem *after ) : KListViewItem( parent, after) { m_kept = true; } - PlaylistBrowserEntry( QListView *parent, QListViewItem *after ) + PlaylistBrowserEntry( TQListView *parent, TQListViewItem *after ) : KListViewItem( parent, after) { m_kept = true; } - PlaylistBrowserEntry( QListViewItem *parent, QListViewItem *after, const QString &name ) + PlaylistBrowserEntry( TQListViewItem *parent, TQListViewItem *after, const TQString &name ) : KListViewItem( parent, after, name) { m_kept = true; } - virtual QDomElement xml() const { return QDomElement(); } - QListViewItem* parent() const { return KListViewItem::parent(); } + virtual TQDomElement xml() const { return TQDomElement(); } + TQListViewItem* parent() const { return KListViewItem::parent(); } bool isKept() const { return m_kept; } // if kept == true, then it will be saved void setKept( bool k ); // to the cache files. If false, non-renameable @@ -70,11 +70,11 @@ class PlaylistBrowserEntry : public QObject, public KListViewItem public slots: virtual void slotDoubleClicked(); virtual void slotRenameItem(); - virtual void slotPostRenameItem( const QString newName ); - virtual void showContextMenu( const QPoint & ) {}; + virtual void slotPostRenameItem( const TQString newName ); + virtual void showContextMenu( const TQPoint & ) {}; protected: - virtual int compare( QListViewItem*, int, bool ) const; //reimplemented + virtual int compare( TQListViewItem*, int, bool ) const; //reimplemented /** Interval of the download pixmap animation, in milliseconds */ static const int ANIMATION_INTERVAL = 250; @@ -87,43 +87,43 @@ class DynamicEntry : public PlaylistBrowserEntry, public DynamicMode { Q_OBJECT public: - DynamicEntry( QListViewItem *parent, QListViewItem *after, const QString &title ); - DynamicEntry( QListViewItem *parent, QListViewItem *after, const QDomElement &xmlDefinition ); + DynamicEntry( TQListViewItem *parent, TQListViewItem *after, const TQString &title ); + DynamicEntry( TQListViewItem *parent, TQListViewItem *after, const TQDomElement &xmlDefinition ); ~DynamicEntry() { }; - virtual QString text( int column ) const; + virtual TQString text( int column ) const; - virtual QDomElement xml() const; + virtual TQDomElement xml() const; static const int RTTI = 1005; int rtti() const { return RTTI; } public slots: virtual void slotDoubleClicked(); - virtual void showContextMenu( const QPoint & ); + virtual void showContextMenu( const TQPoint & ); }; class PlaylistCategory : public PlaylistBrowserEntry { Q_OBJECT public: - PlaylistCategory( QListView *parent, QListViewItem *after, const QString &, bool isFolder=false ); - PlaylistCategory( PlaylistCategory *parent, QListViewItem *after, const QString &, bool isFolder=true ); - PlaylistCategory( QListView *parent, QListViewItem *after, const QDomElement &xmlDefinition, bool isFolder=false); - PlaylistCategory( PlaylistCategory *parent, QListViewItem *after, const QDomElement &xmlDefinition ); - PlaylistCategory( PlaylistCategory *parent, QListViewItem *after, const QString &t, const int id ); + PlaylistCategory( TQListView *parent, TQListViewItem *after, const TQString &, bool isFolder=false ); + PlaylistCategory( PlaylistCategory *parent, TQListViewItem *after, const TQString &, bool isFolder=true ); + PlaylistCategory( TQListView *parent, TQListViewItem *after, const TQDomElement &xmlDefinition, bool isFolder=false); + PlaylistCategory( PlaylistCategory *parent, TQListViewItem *after, const TQDomElement &xmlDefinition ); + PlaylistCategory( PlaylistCategory *parent, TQListViewItem *after, const TQString &t, const int id ); ~PlaylistCategory() { }; - const QString &title() const { return m_title; } + const TQString &title() const { return m_title; } bool isFolder() { return m_folder; } - void paintCell( QPainter*, const QColorGroup&, int, int, int ); + void paintCell( TQPainter*, const TQColorGroup&, int, int, int ); void setId( const int id ) { m_id = id; } const int id() const { return m_id; } - virtual QDomElement xml() const; + virtual TQDomElement xml() const; int rtti() const { return RTTI; } static const int RTTI = 1000; //category item @@ -131,16 +131,16 @@ class PlaylistCategory : public PlaylistBrowserEntry public slots: virtual void slotDoubleClicked(); virtual void slotRenameItem(); - virtual void showContextMenu( const QPoint & ); + virtual void showContextMenu( const TQPoint & ); protected: void okRename( int col ); private: - void setXml( const QDomElement &xml ); + void setXml( const TQDomElement &xml ); - QString m_title; + TQString m_title; int m_id; bool m_folder; }; @@ -155,8 +155,8 @@ class PlaylistEntry : public PlaylistBrowserEntry friend class PlaylistCategory; public: - PlaylistEntry( QListViewItem *parent, QListViewItem *after, const KURL &, int tracks=0, int length=0 ); - PlaylistEntry( QListViewItem *parent, QListViewItem *after, const QDomElement &xmlDefinition ); + PlaylistEntry( TQListViewItem *parent, TQListViewItem *after, const KURL &, int tracks=0, int length=0 ); + PlaylistEntry( TQListViewItem *parent, TQListViewItem *after, const TQDomElement &xmlDefinition ); ~PlaylistEntry(); void sortChildItems ( int /*column*/, bool /*ascending*/ ) { /* Don't sort its children */ }; //reimplemented @@ -164,7 +164,7 @@ class PlaylistEntry : public PlaylistBrowserEntry void load(); const KURL &url() const { return m_url; } - void setUrl( const QString &u ) { m_url.setPath( u ); } + void setUrl( const TQString &u ) { m_url.setPath( u ); } int trackCount() const { return m_trackCount; } int length() const { return m_length; } bool isDynamic() const { return m_dynamic; } @@ -172,23 +172,23 @@ class PlaylistEntry : public PlaylistBrowserEntry void setDynamic( bool ); - int compare( QListViewItem* i, int col ) const; //reimpl. + int compare( TQListViewItem* i, int col ) const; //reimpl. KURL::List tracksURL(); //returns the list of tracks url - void insertTracks( QListViewItem *after, KURL::List list ); - void insertTracks( QListViewItem *after, QValueList bundles ); + void insertTracks( TQListViewItem *after, KURL::List list ); + void insertTracks( TQListViewItem *after, TQValueList bundles ); // isLast is used to avoid saving the playlist to disk every time a track is removed // when removing a list of tracks from the playlist - void removeTrack( QListViewItem *item, bool isLast = true ); + void removeTrack( TQListViewItem *item, bool isLast = true ); //returns a list of track information - QPtrList trackList() const { return m_trackList; } - QPtrList droppedTracks() const { return tmp_droppedTracks; } + TQPtrList trackList() const { return m_trackList; } + TQPtrList droppedTracks() const { return tmp_droppedTracks; } void setOpen( bool ); void setup(); - void paintCell( QPainter*, const QColorGroup&, int, int, int ); + void paintCell( TQPainter*, const TQColorGroup&, int, int, int ); - virtual QDomElement xml() const; + virtual TQDomElement xml() const; virtual void updateInfo(); @@ -198,8 +198,8 @@ class PlaylistEntry : public PlaylistBrowserEntry public slots: virtual void slotDoubleClicked(); - virtual void slotPostRenameItem( const QString newName ); - virtual void showContextMenu( const QPoint & ); + virtual void slotPostRenameItem( const TQString newName ); + virtual void showContextMenu( const TQPoint & ); signals: void startingLoading(); @@ -209,20 +209,20 @@ class PlaylistEntry : public PlaylistBrowserEntry void slotAnimation(); private: - void customEvent( QCustomEvent* e ); + void customEvent( TQCustomEvent* e ); void startAnimation(); void stopAnimation(); KURL m_url; //playlist url int m_length; //total length in seconds int m_trackCount; //track counter - QPtrList m_trackList; //tracks in playlist - QPtrList tmp_droppedTracks; //tracks dropped to the playlist while it wasn't been loaded + TQPtrList m_trackList; //tracks in playlist + TQPtrList tmp_droppedTracks; //tracks dropped to the playlist while it wasn't been loaded bool m_loading; bool m_loaded; //playlist loaded bool m_dynamic; //the playlist is scheduled for dynamic mode rotation - QPixmap *m_loading1, *m_loading2; //icons for loading animation - QTimer m_animationTimer; + TQPixmap *m_loading1, *m_loading2; //icons for loading animation + TQTimer m_animationTimer; uint m_iconCounter; PlaylistTrackItem *m_lastTrack; }; @@ -233,7 +233,7 @@ class PlaylistTrackItem : public PlaylistBrowserEntry friend class TrackItemInfo; public: - PlaylistTrackItem( QListViewItem *parent, QListViewItem *after, TrackItemInfo *info ); + PlaylistTrackItem( TQListViewItem *parent, TQListViewItem *after, TrackItemInfo *info ); const KURL &url(); TrackItemInfo *trackInfo() const { return m_trackInfo; } @@ -244,7 +244,7 @@ class PlaylistTrackItem : public PlaylistBrowserEntry public slots: virtual void slotDoubleClicked(); virtual void slotRenameItem() { /* Do nothing */ }; - virtual void showContextMenu( const QPoint & ); + virtual void showContextMenu( const TQPoint & ); private: TrackItemInfo *m_trackInfo; @@ -256,13 +256,13 @@ class PodcastEpisode : public PlaylistBrowserEntry Q_OBJECT public: - PodcastEpisode( QListViewItem *parent, QListViewItem *after, const QDomElement &xml, + PodcastEpisode( TQListViewItem *parent, TQListViewItem *after, const TQDomElement &xml, const int feedType, const bool &isNew=false ); - PodcastEpisode( QListViewItem *parent, QListViewItem *after, PodcastEpisodeBundle &bundle ); + PodcastEpisode( TQListViewItem *parent, TQListViewItem *after, PodcastEpisodeBundle &bundle ); void downloadMedia(); void setOnDisk( bool d = true ); - QListViewItem *itemChannel() { return m_parent; } + TQListViewItem *itemChannel() { return m_parent; } const bool isNew() const { return m_bundle.isNew(); } @@ -273,19 +273,19 @@ class PodcastEpisode : public PlaylistBrowserEntry // for convenience const int dBId() const { return m_bundle.dBId(); } const KURL url() const { return m_bundle.url(); } - const QString title() const { return m_bundle.title(); } - const QString author() const { return m_bundle.author(); } - const QString date() const { return m_bundle.date(); } - const QString type() const { return m_bundle.type(); } - const QString description() const { return m_bundle.description(); } - const QString guid() const { return m_bundle.guid(); } + const TQString title() const { return m_bundle.title(); } + const TQString author() const { return m_bundle.author(); } + const TQString date() const { return m_bundle.date(); } + const TQString type() const { return m_bundle.type(); } + const TQString description() const { return m_bundle.description(); } + const TQString guid() const { return m_bundle.guid(); } const int duration() const { return m_bundle.duration(); } const KURL &localUrl() const { return m_bundle.localUrl(); } - void setLocalUrlBase( const QString &s ); + void setLocalUrlBase( const TQString &s ); void setLocalUrl( const KURL &localUrl ); void setup(); - void paintCell( QPainter*, const QColorGroup&, int, int, int ); + void paintCell( TQPainter*, const TQColorGroup&, int, int, int ); virtual void updateInfo(); @@ -303,7 +303,7 @@ class PodcastEpisode : public PlaylistBrowserEntry const bool isOnDisk(); virtual void slotDoubleClicked(); virtual void slotRenameItem() { /* Do nothing */ }; - virtual void showContextMenu( const QPoint & ); + virtual void showContextMenu( const TQPoint & ); private slots: void abortDownload(); @@ -314,7 +314,7 @@ class PodcastEpisode : public PlaylistBrowserEntry private: enum FeedType{ RSS=0, ATOM=1 }; - virtual int compare( QListViewItem*, int, bool ) const; //reimplemented + virtual int compare( TQListViewItem*, int, bool ) const; //reimplemented void associateWithLocalFile(); @@ -322,16 +322,16 @@ class PodcastEpisode : public PlaylistBrowserEntry void stopAnimation(); void updatePixmap(); - QListViewItem *m_parent; //podcast channel it belongs to + TQListViewItem *m_parent; //podcast channel it belongs to PodcastEpisodeBundle m_bundle; KURL m_localUrl; bool m_fetching; - QTimer m_animationTimer; + TQTimer m_animationTimer; uint m_iconCounter; KIO::StoredTransferJob* m_podcastEpisodeJob; - QString m_filename; + TQString m_filename; bool m_downloaded; //marked as downloaded in cached xml bool m_onDisk; @@ -343,12 +343,12 @@ class PodcastChannel : public PlaylistBrowserEntry Q_OBJECT public: - PodcastChannel( QListViewItem *parent, QListViewItem *after, const KURL &url, - const QDomNode &channelSettings ); - PodcastChannel( QListViewItem *parent, QListViewItem *after, const KURL &url ); - PodcastChannel( QListViewItem *parent, QListViewItem *after, const KURL &url, - const QDomNode &channelSettings, const QDomDocument &xml ); - PodcastChannel( QListViewItem *parent, QListViewItem *after, const PodcastChannelBundle &pcb ); + PodcastChannel( TQListViewItem *parent, TQListViewItem *after, const KURL &url, + const TQDomNode &channelSettings ); + PodcastChannel( TQListViewItem *parent, TQListViewItem *after, const KURL &url ); + PodcastChannel( TQListViewItem *parent, TQListViewItem *after, const KURL &url, + const TQDomNode &channelSettings, const TQDomDocument &xml ); + PodcastChannel( TQListViewItem *parent, TQListViewItem *after, const PodcastChannelBundle &pcb ); enum MediaFetch{ STREAM=0, AUTOMATIC=1 }; @@ -370,16 +370,16 @@ class PodcastChannel : public PlaylistBrowserEntry const KURL &url() const { return m_url; } const KURL link() const { return m_bundle.link(); } - const QString title() const { return m_bundle.title(); } - const QString description() const { return m_bundle.description(); } - const QString copyright() const { return m_bundle.copyright(); } + const TQString title() const { return m_bundle.title(); } + const TQString description() const { return m_bundle.description(); } + const TQString copyright() const { return m_bundle.copyright(); } const bool autoscan() const { return m_bundle.autoscan(); } const bool autotransfer() const { return m_bundle.autotransfer(); } const int fetchType() const { return m_bundle.fetchType(); } const bool hasPurge() const { return m_bundle.hasPurge(); } const int purgeCount() const { return m_bundle.purgeCount(); } - const QString &saveLocation() const { return m_bundle.saveLocation(); } + const TQString &saveLocation() const { return m_bundle.saveLocation(); } PodcastSettings *getSettings() const { return new PodcastSettings( title(), saveLocation(), @@ -389,7 +389,7 @@ class PodcastChannel : public PlaylistBrowserEntry void setParent( PlaylistCategory *newParent ); void setSettings( PodcastSettings *settings ); - void setXml( const QDomNode &xml, const int feedType ); + void setXml( const TQDomNode &xml, const int feedType ); virtual void updateInfo(); @@ -399,7 +399,7 @@ class PodcastChannel : public PlaylistBrowserEntry public slots: virtual void slotDoubleClicked(); virtual void slotRenameItem() { /* Do nothing */ }; - virtual void showContextMenu( const QPoint & ); + virtual void showContextMenu( const TQPoint & ); private slots: void abortFetch(); @@ -411,13 +411,13 @@ class PodcastChannel : public PlaylistBrowserEntry enum FeedType{ RSS=0, ATOM=1 }; static const int EPISODE_LIMIT = 10; //Maximum number of episodes initially shown - bool containsItem( QDomElement xml ); + bool containsItem( TQDomElement xml ); void downloadChildren(); - const bool episodeExists( const QDomNode &xml, const int feedType ); + const bool episodeExists( const TQDomNode &xml, const int feedType ); void purge(); void restorePurged(); void removeChildren(); - void setDOMSettings( const QDomNode &channelSettings ); + void setDOMSettings( const TQDomNode &channelSettings ); void startAnimation(); void stopAnimation(); @@ -430,15 +430,15 @@ class PodcastChannel : public PlaylistBrowserEntry KURL m_url; //remote xml url bool m_fetching; bool m_updating; - QTimer m_animationTimer; + TQTimer m_animationTimer; uint m_iconCounter; bool m_new; bool m_hasProblem; KIO::TransferJob *m_podcastJob; PlaylistCategory *m_parent; // category it belongs to - QString m_podcastCurrentUrl; - QPtrList m_podcastDownloadQueue; + TQString m_podcastCurrentUrl; + TQPtrList m_podcastDownloadQueue; bool m_settingsValid; }; @@ -446,20 +446,20 @@ class StreamEntry : public PlaylistBrowserEntry { Q_OBJECT public: - StreamEntry( QListViewItem *parent, QListViewItem *after, const KURL &, const QString &t ); - StreamEntry( QListViewItem *parent, QListViewItem *after, const QDomElement &xmlDefinition ); + StreamEntry( TQListViewItem *parent, TQListViewItem *after, const KURL &, const TQString &t ); + StreamEntry( TQListViewItem *parent, TQListViewItem *after, const TQDomElement &xmlDefinition ); ~StreamEntry() { }; void setURL ( KURL u ) { m_url = u; } - void setTitle( QString t ) { m_title = t; } + void setTitle( TQString t ) { m_title = t; } void setup(); - void paintCell( QPainter*, const QColorGroup&, int, int, int ); + void paintCell( TQPainter*, const TQColorGroup&, int, int, int ); const KURL &url() const { return m_url; } - const QString &title() const { return m_title; } + const TQString &title() const { return m_title; } - virtual QDomElement xml() const; + virtual TQDomElement xml() const; virtual void updateInfo(); @@ -468,10 +468,10 @@ class StreamEntry : public PlaylistBrowserEntry public slots: virtual void slotDoubleClicked(); - virtual void showContextMenu( const QPoint & ); + virtual void showContextMenu( const TQPoint & ); protected: - QString m_title; + TQString m_title; KURL m_url; }; @@ -479,11 +479,11 @@ class LastFmEntry : public StreamEntry { Q_OBJECT public: - LastFmEntry( QListViewItem *parent, QListViewItem *after, const KURL &u, const QString &t ) + LastFmEntry( TQListViewItem *parent, TQListViewItem *after, const KURL &u, const TQString &t ) : StreamEntry( parent, after, u, t ) { } - LastFmEntry( QListViewItem *parent, QListViewItem *after, const QDomElement &xmlDefinition ) + LastFmEntry( TQListViewItem *parent, TQListViewItem *after, const TQDomElement &xmlDefinition ) : StreamEntry( parent, after, xmlDefinition ) { } - virtual QDomElement xml() const; + virtual TQDomElement xml() const; public slots: virtual void slotRenameItem() { /* Do nothing */ } @@ -496,10 +496,10 @@ class LastFmEntry : public StreamEntry class StreamEditor : public KDialogBase { public: - StreamEditor( QWidget *parent, const QString &title, const QString &url, bool readonly = false ); + StreamEditor( TQWidget *parent, const TQString &title, const TQString &url, bool readonly = false ); KURL url() const { return KURL( m_urlLineEdit->text() ); } - QString name() const { return m_nameLineEdit->text().replace( "\n", " " ); } + TQString name() const { return m_nameLineEdit->text().replace( "\n", " " ); } private: KLineEdit *m_urlLineEdit; @@ -511,42 +511,42 @@ class SmartPlaylist : public PlaylistBrowserEntry { Q_OBJECT public: - SmartPlaylist( QListViewItem *parent, QListViewItem *after, const QString &name, const QString &query ); - SmartPlaylist( QListViewItem *parent, QListViewItem *after, const QString &name, - const QString &urls, const QString &tags ); - SmartPlaylist( QListViewItem *parent, QListViewItem *after, const QDomElement &xmlDefinition ); + SmartPlaylist( TQListViewItem *parent, TQListViewItem *after, const TQString &name, const TQString &query ); + SmartPlaylist( TQListViewItem *parent, TQListViewItem *after, const TQString &name, + const TQString &urls, const TQString &tags ); + SmartPlaylist( TQListViewItem *parent, TQListViewItem *after, const TQDomElement &xmlDefinition ); bool isDynamic() const { return m_dynamic; } bool isEditable() const { return !m_xml.isNull(); } bool isTimeOrdered(); //returns yes if the ordering is based on a time attribute - QString query(); - QString title() const { return m_title; } - virtual QDomElement xml() const { return m_xml; } + TQString query(); + TQString title() const { return m_title; } + virtual TQDomElement xml() const { return m_xml; } int length(); void setDynamic( bool ); - void setXml( const QDomElement &xml ); + void setXml( const TQDomElement &xml ); int rtti() const { return RTTI; } static const int RTTI = 1004; //smart playlist item public slots: virtual void slotDoubleClicked(); - virtual void slotPostRenameItem( const QString newName ); - virtual void showContextMenu( const QPoint & ); + virtual void slotPostRenameItem( const TQString newName ); + virtual void showContextMenu( const TQPoint & ); private: // for xml playlists, this member is computed on demand - QString m_sqlForTags; + TQString m_sqlForTags; - QString m_title; - QDomElement m_xml; - QListViewItem *m_after; + TQString m_title; + TQDomElement m_xml; + TQListViewItem *m_after; bool m_dynamic; // Build the query for a given xml object. If \p for expand is true, // insert (*ExpandString*) as placeholders for childrens' filters - static QString xmlToQuery( const QDomElement &xml, bool forExpand = false ); + static TQString xmlToQuery( const TQDomElement &xml, bool forExpand = false ); }; //this class is used to store information of a playlist track @@ -556,16 +556,16 @@ class TrackItemInfo TrackItemInfo( const MetaBundle &mb ); ~TrackItemInfo() {} const KURL &url() const { return m_url; } - const QString &album() const { return m_album; } - const QString &artist() const { return m_artist; } - const QString &title() const { return m_title; } + const TQString &album() const { return m_album; } + const TQString &artist() const { return m_artist; } + const TQString &title() const { return m_title; } const int length() const { return m_length; } private: KURL m_url; - QString m_artist; - QString m_album; - QString m_title; + TQString m_artist; + TQString m_album; + TQString m_title; int m_length; }; @@ -595,8 +595,8 @@ class ShoutcastBrowser : public PlaylistCategory private: bool m_downloading; KIO::CopyJob *m_cj; - QPixmap *m_loading1, *m_loading2; //icons for loading animation - QTimer m_animationTimer; + TQPixmap *m_loading1, *m_loading2; //icons for loading animation + TQTimer m_animationTimer; }; /*! @@ -610,9 +610,9 @@ class ShoutcastGenre : public PlaylistCategory { Q_OBJECT public: - ShoutcastGenre( ShoutcastBrowser *browser, QListViewItem *after, QString genre ); + ShoutcastGenre( ShoutcastBrowser *browser, TQListViewItem *after, TQString genre ); void setOpen( bool open ); - void appendAlternateGenre( QString alternateGenre ) { m_alternateGenres << alternateGenre; } + void appendAlternateGenre( TQString alternateGenre ) { m_alternateGenres << alternateGenre; } public slots: virtual void slotDoubleClicked(); @@ -623,13 +623,13 @@ class ShoutcastGenre : public PlaylistCategory void slotAnimation(); private: - void startGenreDownload( QString genre, QString tmppath ); + void startGenreDownload( TQString genre, TQString tmppath ); bool m_downloading; - QString m_genre; - QPixmap *m_loading1, *m_loading2; //icons for loading animation - QTimer m_animationTimer; - QStringList m_alternateGenres; - QStringList m_stations; + TQString m_genre; + TQPixmap *m_loading1, *m_loading2; //icons for loading animation + TQTimer m_animationTimer; + TQStringList m_alternateGenres; + TQStringList m_stations; int m_totalJobs; int m_completedJobs; }; diff --git a/amarok/src/playlistitem.cpp b/amarok/src/playlistitem.cpp index cf63e62b..74af7ca5 100644 --- a/amarok/src/playlistitem.cpp +++ b/amarok/src/playlistitem.cpp @@ -29,14 +29,14 @@ #include "sliderwidget.h" #include "starmanager.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -48,19 +48,19 @@ #include "playlistitem.h" double PlaylistItem::glowIntensity; -QColor PlaylistItem::glowText = Qt::white; -QColor PlaylistItem::glowBase = Qt::white; +TQColor PlaylistItem::glowText = Qt::white; +TQColor PlaylistItem::glowBase = Qt::white; bool PlaylistItem::s_pixmapChanged = false; -PlaylistItem::PlaylistItem( QListView *listview, QListViewItem *item ) +PlaylistItem::PlaylistItem( TQListView *listview, TQListViewItem *item ) : KListViewItem( listview, item ) , m_album( 0 ) { KListViewItem::setVisible( false ); } -PlaylistItem::PlaylistItem( const MetaBundle &bundle, QListViewItem *lvi, bool enabled ) +PlaylistItem::PlaylistItem( const MetaBundle &bundle, TQListViewItem *lvi, bool enabled ) : MetaBundle( bundle ), KListViewItem( lvi->listView(), lvi->itemAbove() ) , m_album( 0 ) , m_deleteAfterEdit( false ) @@ -112,15 +112,15 @@ PlaylistItem::~PlaylistItem() ///////////////////////////////////////////////////////////////////////////////////// -void PlaylistItem::setText( int column, const QString &text ) +void PlaylistItem::setText( int column, const TQString &text ) { if( column == Rating ) - setExactText( column, QString::number( int( text.toFloat() * 2 ) ) ); + setExactText( column, TQString::number( int( text.toFloat() * 2 ) ) ); else setExactText( column, text ); } -QString PlaylistItem::text( int column ) const +TQString PlaylistItem::text( int column ) const { if( column == Title && listView()->header()->sectionSize( Filename ) ) //don't show the filename twice return exactText( column ); @@ -144,7 +144,7 @@ QString PlaylistItem::text( int column ) const } } -void PlaylistItem::aboutToChange( const QValueList &columns ) +void PlaylistItem::aboutToChange( const TQValueList &columns ) { bool totals = false, ref = false, length = false, url = false; for( int i = 0, n = columns.count(); i < n; ++i ) @@ -166,7 +166,7 @@ void PlaylistItem::aboutToChange( const QValueList &columns ) Playlist::instance()->m_urlIndex.remove(this); } -void PlaylistItem::reactToChanges( const QValueList &columns ) +void PlaylistItem::reactToChanges( const TQValueList &columns ) { MetaBundle::reactToChanges(columns); bool totals = false, ref = false, length = false, url = false; @@ -196,7 +196,7 @@ void PlaylistItem::reactToChanges( const QValueList &columns ) incrementTotals(); } -void PlaylistItem::filter( const QString &expression ) +void PlaylistItem::filter( const TQString &expression ) { setVisible( matchesExpression( expression, listView()->visibleColumns() ) ); } @@ -384,7 +384,7 @@ void PlaylistItem::update() const void PlaylistItem::updateColumn( int column ) const { - const QRect r = listView()->itemRect( this ); + const TQRect r = listView()->itemRect( this ); if( !r.isValid() ) return; @@ -421,7 +421,7 @@ PlaylistItem::nextInAlbum() const ( m_album->tracks.at( i )->discNumber() == discNumber() && m_album->tracks.at( i )->track() > track() ) ) return m_album->tracks.at( i ); else - for( QListViewItemIterator it( const_cast(this), QListViewItemIterator::Visible ); *it; ++it ) + for( TQListViewItemIterator it( const_cast(this), TQListViewItemIterator::Visible ); *it; ++it ) #define pit static_cast( *it ) if( pit != this && pit->m_album == m_album && !pit->track() ) return pit; @@ -446,7 +446,7 @@ PlaylistItem::prevInAlbum() const ( m_album->tracks.at( i )->discNumber() == discNumber() && m_album->tracks.at( i )->track() < track() ) ) ) return m_album->tracks.at( i ); else - for( QListViewItemIterator it( const_cast(this), QListViewItemIterator::Visible ); *it; --it ) + for( TQListViewItemIterator it( const_cast(this), TQListViewItemIterator::Visible ); *it; --it ) #define pit static_cast( *it ) if( pit != this && pit->m_album == m_album && !pit->track() ) return pit; @@ -459,7 +459,7 @@ PlaylistItem::prevInAlbum() const ///////////////////////////////////////////////////////////////////////////////////// int -PlaylistItem::compare( QListViewItem *i, int col, bool ascending ) const +PlaylistItem::compare( TQListViewItem *i, int col, bool ascending ) const { #define i static_cast(i) if( Playlist::instance()->dynamicMode() && (isEnabled() != i->isEnabled()) ) @@ -492,8 +492,8 @@ PlaylistItem::compare( QListViewItem *i, int col, bool ascending ) const #undef cmp #undef i - QString a = text( col ).lower(); - QString b = i->text( col ).lower(); + TQString a = text( col ).lower(); + TQString b = i->text( col ).lower(); switch( col ) { @@ -521,10 +521,10 @@ PlaylistItem::compare( QListViewItem *i, int col, bool ascending ) const break; } - return QString::localeAwareCompare( a, b ); + return TQString::localeAwareCompare( a, b ); } -void PlaylistItem::paintCell( QPainter *painter, const QColorGroup &cg, int column, int width, int align ) +void PlaylistItem::paintCell( TQPainter *painter, const TQColorGroup &cg, int column, int width, int align ) { //TODO add spacing on either side of items //p->translate( 2, 0 ); width -= 3; @@ -533,9 +533,9 @@ void PlaylistItem::paintCell( QPainter *painter, const QColorGroup &cg, int colu if( !painter || !listView() || width <= 0 || height() == 0 ) return; - static const QImage currentTrackLeft = locate( "data", "amarok/images/currenttrack_bar_left.png" ); - static const QImage currentTrackMid = locate( "data", "amarok/images/currenttrack_bar_mid.png" ); - static const QImage currentTrackRight = locate( "data", "amarok/images/currenttrack_bar_right.png" ); + static const TQImage currentTrackLeft = locate( "data", "amarok/images/currenttrack_bar_left.png" ); + static const TQImage currentTrackMid = locate( "data", "amarok/images/currenttrack_bar_mid.png" ); + static const TQImage currentTrackRight = locate( "data", "amarok/images/currenttrack_bar_right.png" ); if( column == Mood && !moodbar().dataExists() ) moodbar().load(); // Only has an effect the first time @@ -545,18 +545,18 @@ void PlaylistItem::paintCell( QPainter *painter, const QColorGroup &cg, int colu const int moodbarType = column != Mood ? 0 : moodbar().state() == Moodbar::Loaded ? 1 : 2; - const QString colText = text( column ); + const TQString colText = text( column ); const bool isCurrent = this == listView()->currentTrack(); - QPixmap buf( width, height() ); - QPainter p( &buf, true ); + TQPixmap buf( width, height() ); + TQPainter p( &buf, true ); if( isCurrent ) { static paintCacheItem paintCache[NUM_COLUMNS]; // Convert intensity to string, so we can use it as a key - const QString colorKey = QString::number( glowIntensity ); + const TQString colorKey = TQString::number( glowIntensity ); const bool cacheValid = paintCache[column].width == width && @@ -586,7 +586,7 @@ void PlaylistItem::paintCell( QPainter *painter, const QColorGroup &cg, int colu paintCache[column].color = glowBase; paintCache[column].selected = isSelected(); - QColor bg; + TQColor bg; if( isSelected() ) bg = listView()->colorGroup().highlight(); else @@ -613,7 +613,7 @@ void PlaylistItem::paintCell( QPainter *painter, const QColorGroup &cg, int colu // Left part if( column == listView()->m_firstColumn ) { - QImage tmpImage = currentTrackLeft.smoothScale( 1, height(), QImage::ScaleMax ); + TQImage tmpImage = currentTrackLeft.smoothScale( 1, height(), TQImage::ScaleMax ); KIconEffect::colorize( tmpImage, glowBase, colorize ); imageTransparency( tmpImage, intensity ); p.drawImage( 0, 0, tmpImage, 0, 0, tmpImage.width() - 1 ); //HACK @@ -625,7 +625,7 @@ void PlaylistItem::paintCell( QPainter *painter, const QColorGroup &cg, int colu else if( column == Playlist::instance()->mapToLogicalColumn( Playlist::instance()->numVisibleColumns() - 1 ) ) { - QImage tmpImage = currentTrackRight.smoothScale( 1, height(), QImage::ScaleMax ); + TQImage tmpImage = currentTrackRight.smoothScale( 1, height(), TQImage::ScaleMax ); KIconEffect::colorize( tmpImage, glowBase, colorize ); imageTransparency( tmpImage, intensity ); p.drawImage( width - tmpImage.width(), 0, tmpImage ); @@ -635,7 +635,7 @@ void PlaylistItem::paintCell( QPainter *painter, const QColorGroup &cg, int colu // Middle part // Here we scale the one pixel wide middel image to stretch to the full column width. - QImage tmpImage = currentTrackMid.copy(); + TQImage tmpImage = currentTrackMid.copy(); KIconEffect::colorize( tmpImage, glowBase, colorize ); imageTransparency( tmpImage, intensity ); tmpImage = tmpImage.smoothScale( width - leftOffset - rightOffset, height() ); @@ -656,7 +656,7 @@ void PlaylistItem::paintCell( QPainter *painter, const QColorGroup &cg, int colu moodbarType != 1 ) { // Draw the text - static QFont font; + static TQFont font; static int minbearing = 1337 + 666; if( minbearing == 2003 || font != painter->font() ) { @@ -672,7 +672,7 @@ void PlaylistItem::paintCell( QPainter *painter, const QColorGroup &cg, int colu p.setPen( cg.highlightedText() ); // paint.setPen( glowText ); const int _width = width - leftMargin - margin + minbearing - 1; // -1 seems to be necessary - const QString _text = KStringHandler::rPixelSqueeze( colText, painter->fontMetrics(), _width ); + const TQString _text = KStringHandler::rPixelSqueeze( colText, painter->fontMetrics(), _width ); p.drawText( leftMargin, 0, _width, height(), align, _text ); font.setItalic( italic ); p.setFont( font ); @@ -689,11 +689,11 @@ void PlaylistItem::paintCell( QPainter *painter, const QColorGroup &cg, int colu } else { - const QColorGroup _cg = ( !exists() || !isEnabled() ) + const TQColorGroup _cg = ( !exists() || !isEnabled() ) ? listView()->palette().disabled() : listView()->palette().active(); - QColor bg = isSelected() ? _cg.highlight() + TQColor bg = isSelected() ? _cg.highlight() : isAlternate() ? listView()->alternateBackground() : listView()->viewport()->backgroundColor(); #if KDE_IS_VERSION( 3, 3, 91 ) @@ -704,7 +704,7 @@ void PlaylistItem::paintCell( QPainter *painter, const QColorGroup &cg, int colu Copyright (C) 2000,2003 Charles Samuels Copyright (C) 2000 Peter Putzer */ if ( bg == Qt::black ) - bg = QColor(55, 55, 55); // dark gray + bg = TQColor(55, 55, 55); // dark gray else { int h,s,v; @@ -717,7 +717,7 @@ void PlaylistItem::paintCell( QPainter *painter, const QColorGroup &cg, int colu } #endif - const QColor textc = isSelected() ? _cg.highlightedText() : _cg.text(); + const TQColor textc = isSelected() ? _cg.highlightedText() : _cg.text(); buf.fill( bg ); @@ -745,7 +745,7 @@ void PlaylistItem::paintCell( QPainter *painter, const QColorGroup &cg, int colu else { // Draw the text - static QFont font; + static TQFont font; static int minbearing = 1337 + 666; //can be 0 or negative, 2003 is less likely if( minbearing == 2003 || font != painter->font() ) { @@ -757,7 +757,7 @@ void PlaylistItem::paintCell( QPainter *painter, const QColorGroup &cg, int colu p.setPen( ( m_isNew && isEnabled() && !isSelected() ) ? AmarokConfig::newPlaylistItemsColor() : textc ); const int _width = width - leftMargin - margin + minbearing - 1; // -1 seems to be necessary - const QString _text = KStringHandler::rPixelSqueeze( colText, painter->fontMetrics(), _width ); + const TQString _text = KStringHandler::rPixelSqueeze( colText, painter->fontMetrics(), _width ); p.drawText( leftMargin, 0, _width, height(), align, _text ); } } @@ -768,7 +768,7 @@ void PlaylistItem::paintCell( QPainter *painter, const QColorGroup &cg, int colu const uint num = ( queue ? 1 : 0 ) + ( stop ? 1 : 0 ) + ( repeat ? 1 : 0 ); - static const QPixmap pixstop = Amarok::getPNG( "currenttrack_stop_small" ), + static const TQPixmap pixstop = Amarok::getPNG( "currenttrack_stop_small" ), pixrepeat = Amarok::getPNG( "currenttrack_repeat_small" ); //figure out if we are in the actual physical first column @@ -777,7 +777,7 @@ void PlaylistItem::paintCell( QPainter *painter, const QColorGroup &cg, int colu //margin, height const uint m = 2, h = height() - m; - const QString str = QString::number( queue ); + const TQString str = TQString::number( queue ); const uint qw = painter->fontMetrics().width( str ), sw = pixstop.width(), rw = pixrepeat.width(), qh = painter->fontMetrics().height(), sh = pixstop.height(), rh = pixrepeat.height(); @@ -810,7 +810,7 @@ void PlaylistItem::paintCell( QPainter *painter, const QColorGroup &cg, int colu //draw the shadowed inner text //NOTE we can't set an arbituary font size or family, these settings are already optional //and user defaults should also take presidence if no playlist font has been selected - //const QFont smallFont( "Arial", (playNext > 9) ? 9 : 12 ); + //const TQFont smallFont( "Arial", (playNext > 9) ? 9 : 12 ); //p->setFont( smallFont ); //TODO the shadow is hard to do well when using a dark font color //TODO it also looks cluttered for small font sizes @@ -859,7 +859,7 @@ void PlaylistItem::paintCell( QPainter *painter, const QColorGroup &cg, int colu if( this != listView()->currentTrack() && !isSelected() ) { - p.setPen( QPen( cg.mid(), 0, Qt::SolidLine ) ); + p.setPen( TQPen( cg.mid(), 0, Qt::SolidLine ) ); p.drawLine( width - 1, 0, width - 1, height() - 1 ); } @@ -867,20 +867,20 @@ void PlaylistItem::paintCell( QPainter *painter, const QColorGroup &cg, int colu painter->drawPixmap( 0, 0, buf ); } -void PlaylistItem::drawRating( QPainter *p ) +void PlaylistItem::drawRating( TQPainter *p ) { int gray = 0; if( this == listView()->m_hoveredRating || ( isSelected() && listView()->m_selCount > 1 && listView()->m_hoveredRating && listView()->m_hoveredRating->isSelected() ) ) { - const int pos = listView()->viewportToContents( listView()->viewport()->mapFromGlobal( QCursor::pos() ) ).x(); + const int pos = listView()->viewportToContents( listView()->viewport()->mapFromGlobal( TQCursor::pos() ) ).x(); gray = ratingAtPoint( pos ); } drawRating( p, ( rating() + 1 ) / 2, gray / 2, rating() % 2 ); } -void PlaylistItem::drawRating( QPainter *p, int stars, int greystars, bool half ) +void PlaylistItem::drawRating( TQPainter *p, int stars, int greystars, bool half ) { int i = 1, x = 1; const int y = height() / 2 - StarManager::instance()->getGreyStar()->height() / 2; @@ -906,7 +906,7 @@ void PlaylistItem::drawRating( QPainter *p, int stars, int greystars, bool half #define MOODBAR_SPACING 2 // The distance from the moodbar pixmap to each side -void PlaylistItem::drawMood( QPainter *p, int width, int height ) +void PlaylistItem::drawMood( TQPainter *p, int width, int height ) { // In theory, if AmarokConfig::showMoodbar() == false, then the // moodbar column should be hidden and we shouldn't be here. @@ -916,7 +916,7 @@ void PlaylistItem::drawMood( QPainter *p, int width, int height ) // Due to the logic of the calling code, this should always return true if( moodbar().dataExists() ) { - QPixmap mood = moodbar().draw( width - MOODBAR_SPACING*2, + TQPixmap mood = moodbar().draw( width - MOODBAR_SPACING*2, height - MOODBAR_SPACING*2 ); p->drawPixmap( MOODBAR_SPACING, MOODBAR_SPACING, mood ); } @@ -949,15 +949,15 @@ void PlaylistItem::setup() } -void PlaylistItem::paintFocus( QPainter* p, const QColorGroup& cg, const QRect& r ) +void PlaylistItem::paintFocus( TQPainter* p, const TQColorGroup& cg, const TQRect& r ) { if( this != listView()->currentTrack() ) KListViewItem::paintFocus( p, cg, r ); } -const QString &PlaylistItem::editingText() +const TQString &PlaylistItem::editingText() { - static const QString text = i18n( "Writing tag..." ); + static const TQString text = i18n( "Writing tag..." ); return text; } @@ -967,7 +967,7 @@ const QString &PlaylistItem::editingText() * @param image Image to be manipulated. Must be true color (8 bit per channel). * @param factor > 1.0 == more transparency, < 1.0 == less transparency. */ -void PlaylistItem::imageTransparency( QImage& image, float factor ) //static +void PlaylistItem::imageTransparency( TQImage& image, float factor ) //static { uint *data = reinterpret_cast( image.bits() ); const int pixels = image.width() * image.height(); @@ -990,7 +990,7 @@ void PlaylistItem::imageTransparency( QImage& image, float factor ) //static AtomicString PlaylistItem::artist_album() const { - static const AtomicString various_artist = QString( "Various Artists (INTERNAL) [ASDF!]" ); + static const AtomicString various_artist = TQString( "Various Artists (INTERNAL) [ASDF!]" ); if( compilation() == CompilationYes ) return various_artist; else diff --git a/amarok/src/playlistitem.h b/amarok/src/playlistitem.h index 5f255821..a3640c82 100644 --- a/amarok/src/playlistitem.h +++ b/amarok/src/playlistitem.h @@ -15,17 +15,17 @@ #include //baseclass #include //stack allocated -#include //stack allocated -#include //stack allocated -#include -#include -#include - -class QColorGroup; -class QDomNode; -class QImage; -class QListViewItem; -class QPainter; +#include //stack allocated +#include //stack allocated +#include +#include +#include + +class TQColorGroup; +class TQDomNode; +class TQImage; +class TQListViewItem; +class TQPainter; class MetaBundle; class Playlist; class PlaylistAlbum; @@ -39,24 +39,24 @@ class LIBAMAROK_EXPORT PlaylistItem : public MetaBundle, public KListViewItem /// For the glow colouration stuff static double glowIntensity; - static QColor glowText; - static QColor glowBase; + static TQColor glowText; + static TQColor glowBase; public: - PlaylistItem( QListView*, QListViewItem* ); //used by PlaylistLoader - PlaylistItem( const MetaBundle&, QListViewItem*, bool enabled = true ); + PlaylistItem( TQListView*, TQListViewItem* ); //used by PlaylistLoader + PlaylistItem( const MetaBundle&, TQListViewItem*, bool enabled = true ); ~PlaylistItem(); /// pass 'raw' data here, for example "92" for Length, and not "1:32" - virtual void setText( int column, const QString& ); + virtual void setText( int column, const TQString& ); /** * @return The text of the column @p column, formatted for display purposes. * (For example, if the Length is 92, "1:32".) */ - virtual QString text( int column ) const; + virtual TQString text( int column ) const; - void filter( const QString &expression ); //makes visible depending on whether it matches + void filter( const TQString &expression ); //makes visible depending on whether it matches bool isCurrent() const; @@ -90,7 +90,7 @@ class LIBAMAROK_EXPORT PlaylistItem : public MetaBundle, public KListViewItem static int ratingAtPoint( int x ); static int ratingColumnWidth(); - /// like QWidget::update() + /// like TQWidget::update() void update() const; //updates only the area of a specific column, avoids flickering of the current item marker @@ -105,8 +105,8 @@ class LIBAMAROK_EXPORT PlaylistItem : public MetaBundle, public KListViewItem PlaylistItem *prevInAlbum() const; protected: - virtual void aboutToChange( const QValueList &columns ); - virtual void reactToChanges( const QValueList &columns ); + virtual void aboutToChange( const TQValueList &columns ); + virtual void reactToChanges( const TQValueList &columns ); private: friend class Playlist; @@ -115,29 +115,29 @@ class LIBAMAROK_EXPORT PlaylistItem : public MetaBundle, public KListViewItem struct paintCacheItem { int width; int height; - QString text; - QFont font; - QColor color; + TQString text; + TQFont font; + TQColor color; bool selected; - QMap map; + TQMap map; }; - virtual void paintCell( QPainter*, const QColorGroup&, int, int, int ); - void drawRating( QPainter *p ); - void drawRating( QPainter *p, int stars, int greystars, bool half ); - void drawMood( QPainter *p, int width, int height ); + virtual void paintCell( TQPainter*, const TQColorGroup&, int, int, int ); + void drawRating( TQPainter *p ); + void drawRating( TQPainter *p, int stars, int greystars, bool half ); + void drawMood( TQPainter *p, int width, int height ); virtual void moodbarJobEvent( int newState ); // Used for sorting - virtual int compare( QListViewItem*, int, bool ) const; + virtual int compare( TQListViewItem*, int, bool ) const; /** * Paints a focus indicator on the rectangle (current item). We disable it * over the currentTrack, cause it would look like crap and flicker. */ - void paintFocus( QPainter*, const QColorGroup&, const QRect& ); + void paintFocus( TQPainter*, const TQColorGroup&, const TQRect& ); - static void imageTransparency( QImage& image, float factor ); + static void imageTransparency( TQImage& image, float factor ); AtomicString artist_album() const; // returns a placeholder 'artist' for compilations @@ -163,15 +163,15 @@ class LIBAMAROK_EXPORT PlaylistItem : public MetaBundle, public KListViewItem bool m_isNew; //New items will be assigned a different color static bool s_pixmapChanged; - static const QString &editingText(); + static const TQString &editingText(); }; -class PLItemList: public QPtrList +class PLItemList: public TQPtrList { public: - PLItemList() : QPtrList() { } - PLItemList( const QPtrList &list ) : QPtrList( list ) { } - PLItemList( PlaylistItem *item ) : QPtrList() { append( item ); } + PLItemList() : TQPtrList() { } + PLItemList( const TQPtrList &list ) : TQPtrList( list ) { } + PLItemList( PlaylistItem *item ) : TQPtrList() { append( item ); } inline PLItemList &operator<<( PlaylistItem *item ) { append( item ); return *this; } }; diff --git a/amarok/src/playlistloader.cpp b/amarok/src/playlistloader.cpp index b79ceba0..22cafbf3 100644 --- a/amarok/src/playlistloader.cpp +++ b/amarok/src/playlistloader.cpp @@ -28,13 +28,13 @@ #include "contextbrowser.h" #include "xspfplaylist.h" -#include //::recurse() -#include //::recurse() -#include //::loadPlaylist() -#include -#include -#include -#include //::loadPlaylist() +#include //::recurse() +#include //::recurse() +#include //::loadPlaylist() +#include +#include +#include +#include //::loadPlaylist() #include #include @@ -54,10 +54,10 @@ struct XMLData XMLData(): queue(-1), stopafter(false), dynamicdisabled(false) { } }; -class TagsEvent : public QCustomEvent { +class TagsEvent : public TQCustomEvent { public: - TagsEvent( const QValueList &x ) : QCustomEvent( 1001 ), xml( QDeepCopy >( x ) ) { } - TagsEvent( const BundleList &bees ) : QCustomEvent( 1000 ), bundles( QDeepCopy( bees ) ) { + TagsEvent( const TQValueList &x ) : TQCustomEvent( 1001 ), xml( TQDeepCopy >( x ) ) { } + TagsEvent( const BundleList &bees ) : TQCustomEvent( 1000 ), bundles( TQDeepCopy( bees ) ) { for( BundleList::Iterator it = bundles.begin(), end = bundles.end(); it != end; ++it ) { (*it).detach(); @@ -67,12 +67,12 @@ public: } } - QValueList xml; + TQValueList xml; BundleList bundles; }; -UrlLoader::UrlLoader( const KURL::List &urls, QListViewItem *after, int options ) +UrlLoader::UrlLoader( const KURL::List &urls, TQListViewItem *after, int options ) : ThreadManager::DependentJob( Playlist::instance(), "UrlLoader" ) , m_markerListViewItem( new PlaylistItem( Playlist::instance(), after ) ) , m_playFirstUrl( options & (Playlist::StartPlay | Playlist::DirectPlay) ) @@ -83,8 +83,8 @@ UrlLoader::UrlLoader( const KURL::List &urls, QListViewItem *after, int options , m_xmlSource( 0 ) { - connect( this, SIGNAL( queueChanged( const PLItemList &, const PLItemList & ) ), - Playlist::instance(), SIGNAL( queueChanged( const PLItemList &, const PLItemList & ) ) ); + connect( this, TQT_SIGNAL( queueChanged( const PLItemList &, const PLItemList & ) ), + Playlist::instance(), TQT_SIGNAL( queueChanged( const PLItemList &, const PLItemList & ) ) ); Playlist::instance()->lock(); // prevent user removing items as this could be bad @@ -95,12 +95,12 @@ UrlLoader::UrlLoader( const KURL::List &urls, QListViewItem *after, int options Amarok::StatusBar::instance()->newProgressOperation( this ) .setDescription( m_description ) .setStatus( i18n("Preparing") ) - .setAbortSlot( this, SLOT(abort()) ) + .setAbortSlot( this, TQT_SLOT(abort()) ) .setTotalSteps( 100 ); foreachType( KURL::List, urls ) { const KURL url = Amarok::detachedKURL(Amarok::mostLocalURL( *it )); - const QString protocol = url.protocol(); + const TQString protocol = url.protocol(); if( protocol == "seek" ) continue; @@ -119,7 +119,7 @@ UrlLoader::UrlLoader( const KURL::List &urls, QListViewItem *after, int options } else if( protocol == "file" ) { - if( QFileInfo( url.path() ).isDir() ) + if( TQFileInfo( url.path() ).isDir() ) m_URLs += recurse( url ); else m_URLs += url; @@ -129,24 +129,24 @@ UrlLoader::UrlLoader( const KURL::List &urls, QListViewItem *after, int options // it has been fixed for kde 3.5.3 else if( protocol == "media" || url.url().startsWith( "system:/media/" ) ) { - QString path = url.path( -1 ); + TQString path = url.path( -1 ); if( url.url().startsWith( "system:/media/" ) ) path = path.mid( 6 ); // url looks like media:/device/path DCOPRef mediamanager( "kded", "mediamanager" ); - QString device = path.mid( 1 ); // remove first slash + TQString device = path.mid( 1 ); // remove first slash const int slash = device.find( '/' ); - const QString filePath = device.mid( slash ); // extract relative path + const TQString filePath = device.mid( slash ); // extract relative path device = device.left( slash ); // extract device - DCOPReply reply = mediamanager.call( "properties(QString)", device ); + DCOPReply reply = mediamanager.call( "properties(TQString)", device ); if( reply.isValid() ) { - const QStringList properties = reply; + const TQStringList properties = reply; // properties[6] is the mount point KURL localUrl = KURL( properties[6] + filePath ); // add urls - if( QFileInfo( localUrl.path() ).isDir() ) + if( TQFileInfo( localUrl.path() ).isDir() ) m_URLs += recurse( localUrl ); else m_URLs += localUrl; @@ -207,7 +207,7 @@ UrlLoader::doJob() PlaylistFile playlist( url.path() ); if( !playlist.isError() ) - QApplication::postEvent( this, new TagsEvent( playlist.bundles()) ); + TQApplication::postEvent( this, new TagsEvent( playlist.bundles()) ); else m_badURLs += url; @@ -218,7 +218,7 @@ UrlLoader::doJob() } if( urls.count() == OPTIMUM_BUNDLE_COUNT || it == last ) { - QApplication::postEvent( this, new TagsEvent( CollectionDB::instance()->bundlesByUrls( urls ) ) ); + TQApplication::postEvent( this, new TagsEvent( CollectionDB::instance()->bundlesByUrls( urls ) ) ); urls.clear(); } } @@ -227,7 +227,7 @@ UrlLoader::doJob() } void -UrlLoader::customEvent( QCustomEvent *e) +UrlLoader::customEvent( TQCustomEvent *e) { //DEBUG_BLOCK #define e static_cast(e) @@ -261,7 +261,7 @@ UrlLoader::customEvent( QCustomEvent *e) case 1001: { - foreachType( QValueList, e->xml ) + foreachType( TQValueList, e->xml ) { if( (*it).bundle.isEmpty() ) //safety continue; @@ -309,7 +309,7 @@ UrlLoader::completeJob() { DEBUG_BLOCK const PLItemList &newQueue = Playlist::instance()->m_nextTracks; - QPtrListIterator it( newQueue ); + TQPtrListIterator it( newQueue ); PLItemList added; for( it.toFirst(); *it; ++it ) if( !m_oldQueue.containsRef( *it ) ) @@ -319,14 +319,14 @@ UrlLoader::completeJob() emit queueChanged( added, PLItemList() ); if ( !m_badURLs.isEmpty() ) { - QString text = i18n("These media could not be loaded into the playlist: " ); + TQString text = i18n("These media could not be loaded into the playlist: " ); debug() << "The following urls were not suitable for the playlist:" << endl; for ( uint it = 0; it < m_badURLs.count(); it++ ) { if( it < 5 ) - text += QString("
        %1").arg( m_badURLs[it].prettyURL() ); + text += TQString("
        %1").arg( m_badURLs[it].prettyURL() ); else if( it == 5 ) - text += QString("
        Plus %1 more").arg( m_badURLs.count() - it ); + text += TQString("
        Plus %1 more").arg( m_badURLs.count() - it ); debug() << "\t" << m_badURLs[it] << endl; } @@ -338,13 +338,13 @@ UrlLoader::completeJob() Playlist::instance()->setDynamicMode( PlaylistBrowser::instance()->findDynamicModeByTitle( m_dynamicMode ) ); //synchronous, ie not using eventLoop - QApplication::sendEvent( dependent(), this ); + TQApplication::sendEvent( dependent(), this ); } KURL::List UrlLoader::recurse( const KURL &url ) { - typedef QMap FileMap; + typedef TQMap FileMap; KDirLister lister( false ); lister.setAutoUpdate( false ); @@ -354,13 +354,13 @@ UrlLoader::recurse( const KURL &url ) // Fucking KDirLister sometimes hangs on remote media, so we add a timeout const int timeout = 3000; // ms - QTime watchdog; + TQTime watchdog; watchdog.start(); while( !lister.isFinished() && !isAborted() && watchdog.elapsed() < timeout ) - kapp->eventLoop()->processEvents( QEventLoop::ExcludeUserInput ); + kapp->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput ); - KFileItemList items = lister.items(); //returns QPtrList, so we MUST only do it once! + KFileItemList items = lister.items(); //returns TQPtrList, so we MUST only do it once! KURL::List urls; FileMap files; for( KFileItem *item = items.first(); item; item = items.next() ) { @@ -385,9 +385,9 @@ namespace Amarok KURL::List recursiveUrlExpand( const KURL &url, int maxURLs ) { - typedef QMap FileMap; + typedef TQMap FileMap; - if( url.protocol() != "file" || !QFileInfo( url.path() ).isDir() ) + if( url.protocol() != "file" || !TQFileInfo( url.path() ).isDir() ) return KURL::List( url ); MyDirLister lister( false ); @@ -398,13 +398,13 @@ recursiveUrlExpand( const KURL &url, int maxURLs ) // Fucking KDirLister sometimes hangs on remote media, so we add a timeout const int timeout = 3000; // ms - QTime watchdog; + TQTime watchdog; watchdog.start(); while( !lister.isFinished() && watchdog.elapsed() < timeout ) - kapp->eventLoop()->processEvents( QEventLoop::ExcludeUserInput ); + kapp->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput ); - KFileItemList items = lister.items(); //returns QPtrList, so we MUST only do it once! + KFileItemList items = lister.items(); //returns TQPtrList, so we MUST only do it once! KURL::List urls; FileMap files; for( KFileItem *item = items.first(); item; item = items.next() ) { @@ -449,7 +449,7 @@ recursiveUrlExpand( const KURL::List &list, int maxURLs ) void UrlLoader::loadXml( const KURL &url ) { - QFile file( url.path() ); + TQFile file( url.path() ); if( !file.open( IO_ReadOnly ) ) { m_badURLs += url; return; @@ -457,16 +457,16 @@ UrlLoader::loadXml( const KURL &url ) m_currentURL = url; delete m_xmlSource; - m_xmlSource = new QXmlInputSource( file ); + m_xmlSource = new TQXmlInputSource( file ); MyXmlLoader loader; - connect( &loader, SIGNAL( newBundle( const MetaBundle&, const XmlAttributeList& ) ), - this, SLOT( slotNewBundle( const MetaBundle&, const XmlAttributeList& ) ) ); - connect( &loader, SIGNAL( playlistInfo( const QString&, const QString&, const QString& ) ), - this, SLOT( slotPlaylistInfo( const QString&, const QString&, const QString& ) ) ); + connect( &loader, TQT_SIGNAL( newBundle( const MetaBundle&, const XmlAttributeList& ) ), + this, TQT_SLOT( slotNewBundle( const MetaBundle&, const XmlAttributeList& ) ) ); + connect( &loader, TQT_SIGNAL( playlistInfo( const TQString&, const TQString&, const TQString& ) ), + this, TQT_SLOT( slotPlaylistInfo( const TQString&, const TQString&, const TQString& ) ) ); loader.load( m_xmlSource ); if( !m_xml.isEmpty() ) { - QApplication::postEvent( this, new TagsEvent( m_xml ) ); + TQApplication::postEvent( this, new TagsEvent( m_xml ) ); m_xml.clear(); } if( !loader.lastError().isEmpty() ) @@ -482,7 +482,7 @@ UrlLoader::loadXml( const KURL &url ) void UrlLoader::slotNewBundle( const MetaBundle &bundle, const XmlAttributeList &atts ) { XMLData data; - data.bundle = QDeepCopy( bundle ); + data.bundle = TQDeepCopy( bundle ); for( int i = 0, n = atts.count(); i < n; ++i ) { if( atts[i].first == "queue_index" ) @@ -501,12 +501,12 @@ void UrlLoader::slotNewBundle( const MetaBundle &bundle, const XmlAttributeList m_xml.append( data ); if( m_xml.count() == OPTIMUM_BUNDLE_COUNT ) { - QApplication::postEvent( this, new TagsEvent( m_xml ) ); + TQApplication::postEvent( this, new TagsEvent( m_xml ) ); m_xml.clear(); } } -void UrlLoader::slotPlaylistInfo( const QString &, const QString &version, const QString &dynamicMode ) +void UrlLoader::slotPlaylistInfo( const TQString &, const TQString &version, const TQString &dynamicMode ) { if( version != Amarok::xmlVersion() ) { @@ -515,7 +515,7 @@ void UrlLoader::slotPlaylistInfo( const QString &, const QString &version, const "and this version can no longer read it.\n" "You will have to create a new one.\n" "Sorry :(" ) ); - static_cast( const_cast( sender() ) )->abort(); //HACK? + static_cast( const_cast( sender() ) )->abort(); //HACK? return; } else @@ -524,16 +524,16 @@ void UrlLoader::slotPlaylistInfo( const QString &, const QString &version, const /// @class PlaylistFile -PlaylistFile::PlaylistFile( const QString &path ) +PlaylistFile::PlaylistFile( const TQString &path ) : m_path( path ) { - QFile file( path ); + TQFile file( path ); if( !file.open( IO_ReadOnly ) ) { m_error = i18n( "Amarok could not open the file." ); return; } - QTextStream stream( &file ); + TQTextStream stream( &file ); switch( format( m_path ) ) { case M3U: loadM3u( stream ); break; @@ -556,17 +556,17 @@ PlaylistFile::PlaylistFile( const QString &path ) } bool -PlaylistFile::loadM3u( QTextStream &stream ) +PlaylistFile::loadM3u( TQTextStream &stream ) { - const QString directory = m_path.left( m_path.findRev( '/' ) + 1 ); + const TQString directory = m_path.left( m_path.findRev( '/' ) + 1 ); MetaBundle b; - for( QString line; !stream.atEnd(); ) + for( TQString line; !stream.atEnd(); ) { line = stream.readLine(); if( line.startsWith( "#EXTINF" ) ) { - const QString extinf = line.section( ':', 1 ); + const TQString extinf = line.section( ':', 1 ); const int length = extinf.section( ',', 0, 0 ).toInt(); b.setTitle( extinf.section( ',', 1 ) ); b.setLength( length <= 0 ? /*MetaBundle::Undetermined HACK*/ -2 : length ); @@ -575,7 +575,7 @@ PlaylistFile::loadM3u( QTextStream &stream ) else if( !line.startsWith( "#" ) && !line.isEmpty() ) { // KURL::isRelativeURL() expects absolute URLs to start with a protocol, so prepend it if missing - QString url = line; + TQString url = line; if( url.startsWith( "/" ) ) url.prepend( "file://" ); @@ -601,7 +601,7 @@ PlaylistFile::loadM3u( QTextStream &stream ) } bool -PlaylistFile::loadPls( QTextStream &stream ) +PlaylistFile::loadPls( TQTextStream &stream ) { // Counted number of "File#=" lines. unsigned int entryCnt = 0; @@ -609,15 +609,15 @@ PlaylistFile::loadPls( QTextStream &stream ) unsigned int numberOfEntries = 0; // Does the file have a "[playlist]" section? (as it's required by the standard) bool havePlaylistSection = false; - QString tmp; - QStringList lines; + TQString tmp; + TQStringList lines; - const QRegExp regExp_NumberOfEntries("^NumberOfEntries\\s*=\\s*\\d+$"); - const QRegExp regExp_File("^File\\d+\\s*="); - const QRegExp regExp_Title("^Title\\d+\\s*="); - const QRegExp regExp_Length("^Length\\d+\\s*=\\s*\\d+$"); - const QRegExp regExp_Version("^Version\\s*=\\s*\\d+$"); - const QString section_playlist("[playlist]"); + const TQRegExp regExp_NumberOfEntries("^NumberOfEntries\\s*=\\s*\\d+$"); + const TQRegExp regExp_File("^File\\d+\\s*="); + const TQRegExp regExp_Title("^Title\\d+\\s*="); + const TQRegExp regExp_Length("^Length\\d+\\s*=\\s*\\d+$"); + const TQRegExp regExp_Version("^Version\\s*=\\s*\\d+$"); + const TQString section_playlist("[playlist]"); /* Preprocess the input data. * Read the lines into a buffer; Cleanup the line strings; @@ -665,7 +665,7 @@ PlaylistFile::loadPls( QTextStream &stream ) /* Now iterate through all beautified lines in the buffer * and parse the playlist data. */ - QStringList::const_iterator i = lines.begin(), end = lines.end(); + TQStringList::const_iterator i = lines.begin(), end = lines.end(); for ( ; i != end; ++i) { if (!inPlaylistSection && havePlaylistSection) { /* The playlist begins with the "[playlist]" tag. @@ -724,7 +724,7 @@ PlaylistFile::loadPls( QTextStream &stream ) } bool -PlaylistFile::loadXSPF( QTextStream &stream ) +PlaylistFile::loadXSPF( TQTextStream &stream ) { XSPFPlaylist* doc = new XSPFPlaylist( stream ); @@ -733,11 +733,11 @@ PlaylistFile::loadXSPF( QTextStream &stream ) foreachType( XSPFtrackList, trackList ) { KURL location = (*it).location; - QString artist = (*it).creator; - QString title = (*it).title; - QString album = (*it).album; + TQString artist = (*it).creator; + TQString title = (*it).title; + TQString album = (*it).album; - if( location.isEmpty() || ( location.isLocalFile() && !QFile::exists( location.url() ) ) ) + if( location.isEmpty() || ( location.isLocalFile() && !TQFile::exists( location.url() ) ) ) { QueryBuilder qb; qb.addMatch( QueryBuilder::tabArtist, QueryBuilder::valName, artist ); @@ -746,7 +746,7 @@ PlaylistFile::loadXSPF( QTextStream &stream ) qb.addMatch( QueryBuilder::valName, album ); qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL ); - QStringList values = qb.run(); + TQStringList values = qb.run(); if( values.isEmpty() ) continue; @@ -774,7 +774,7 @@ PlaylistFile::loadXSPF( QTextStream &stream ) } unsigned int -PlaylistFile::loadPls_extractIndex( const QString &str ) const +PlaylistFile::loadPls_extractIndex( const TQString &str ) const { /* Extract the index number out of a .pls line. * Example: @@ -782,18 +782,18 @@ PlaylistFile::loadPls_extractIndex( const QString &str ) const */ bool ok = false; unsigned int ret; - QString tmp(str.section('=', 0, 0)); - tmp.remove(QRegExp("^\\D*")); + TQString tmp(str.section('=', 0, 0)); + tmp.remove(TQRegExp("^\\D*")); ret = tmp.stripWhiteSpace().toUInt(&ok); Q_ASSERT(ok); return ret; } bool -PlaylistFile::loadRealAudioRam( QTextStream &stream ) +PlaylistFile::loadRealAudioRam( TQTextStream &stream ) { MetaBundle b; - QString url; + TQString url; //while loop adapted from Kaffeine 0.5 while (!stream.atEnd()) { @@ -812,21 +812,21 @@ PlaylistFile::loadRealAudioRam( QTextStream &stream ) } bool -PlaylistFile::loadASX( QTextStream &stream ) +PlaylistFile::loadASX( TQTextStream &stream ) { //adapted from Kaffeine 0.7 MetaBundle b; - QDomDocument doc; - QString errorMsg; + TQDomDocument doc; + TQString errorMsg; int errorLine, errorColumn; - stream.setEncoding( QTextStream::UnicodeUTF8 ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); - QString content = stream.read(); + TQString content = stream.read(); //ASX looks a lot like xml, but doesn't require tags to be case sensitive, //meaning we have to accept things like: ... //We use a dirty way to achieve this: we make all tags lower case - QRegExp ex("(<[/]?[^>]*[A-Z]+[^>]*>)"); + TQRegExp ex("(<[/]?[^>]*[A-Z]+[^>]*>)"); ex.setCaseSensitive(true); while ( (ex.search(content)) != -1 ) content.replace(ex.cap( 1 ), ex.cap( 1 ).lower()); @@ -839,26 +839,26 @@ PlaylistFile::loadASX( QTextStream &stream ) return false; } - QDomElement root = doc.documentElement(); + TQDomElement root = doc.documentElement(); - QString url; - QString title; - QString author; - QTime length; - QString duration; + TQString url; + TQString title; + TQString author; + TQTime length; + TQString duration; if (root.nodeName().lower() != "asx") return false; - QDomNode node = root.firstChild(); - QDomNode subNode; - QDomElement element; + TQDomNode node = root.firstChild(); + TQDomNode subNode; + TQDomElement element; while (!node.isNull()) { - url = QString::null; - title = QString::null; - author = QString::null; - length = QTime(); + url = TQString::null; + title = TQString::null; + author = TQString::null; + length = TQTime(); if (node.nodeName().lower() == "entry") { subNode = node.firstChild(); @@ -878,7 +878,7 @@ PlaylistFile::loadASX( QTextStream &stream ) } if ((subNode.nodeName().lower() == "duration") && (subNode.isElement())) { - duration = QString::null; + duration = TQString::null; element = subNode.toElement(); if (element.hasAttribute("value")) duration = element.attribute("value"); @@ -916,26 +916,26 @@ PlaylistFile::loadASX( QTextStream &stream ) } bool -PlaylistFile::loadSMIL( QTextStream &stream ) +PlaylistFile::loadSMIL( TQTextStream &stream ) { // adapted from Kaffeine 0.7 - QDomDocument doc; + TQDomDocument doc; if( !doc.setContent( stream.read() ) ) { debug() << "Could now read smil playlist" << endl; return false; } - QDomElement root = doc.documentElement(); - stream.setEncoding ( QTextStream::UnicodeUTF8 ); + TQDomElement root = doc.documentElement(); + stream.setEncoding ( TQTextStream::UnicodeUTF8 ); if( root.nodeName().lower() != "smil" ) return false; KURL kurl; - QString url; - QDomNodeList nodeList; - QDomNode node; - QDomElement element; + TQString url; + TQDomNodeList nodeList; + TQDomNode node; + TQDomElement element; //audio sources... nodeList = doc.elementsByTagName( "audio" ); @@ -943,7 +943,7 @@ PlaylistFile::loadSMIL( QTextStream &stream ) { MetaBundle b; node = nodeList.item(i); - url = QString::null; + url = TQString::null; if( (node.nodeName().lower() == "audio") && (node.isElement()) ) { element = node.toElement(); @@ -973,16 +973,16 @@ PlaylistFile::loadSMIL( QTextStream &stream ) #include #include -RemotePlaylistFetcher::RemotePlaylistFetcher( const KURL &source, QListViewItem *after, int options ) - : QObject( Playlist::instance()->qscrollview() ) +RemotePlaylistFetcher::RemotePlaylistFetcher( const KURL &source, TQListViewItem *after, int options ) + : TQObject( Playlist::instance()->qscrollview() ) , m_source( source ) , m_after( after ) , m_playFirstUrl( options & (Playlist::StartPlay | Playlist::DirectPlay) ) , m_options( options ) { //We keep the extension so the UrlLoader knows what file type it is - const QString path = source.path(); - m_temp = new KTempFile( QString::null /*use default prefix*/, path.mid( path.findRev( '.' ) ) ); + const TQString path = source.path(); + m_temp = new KTempFile( TQString::null /*use default prefix*/, path.mid( path.findRev( '.' ) ) ); m_temp->setAutoDelete( true ); m_destination.setPath( m_temp->name() ); @@ -996,7 +996,7 @@ RemotePlaylistFetcher::RemotePlaylistFetcher( const KURL &source, QListViewItem Amarok::StatusBar::instance()->newProgressOperation( job ) .setDescription( i18n("Retrieving Playlist") ); - connect( job, SIGNAL(result( KIO::Job* )), SLOT(result( KIO::Job* )) ); + connect( job, TQT_SIGNAL(result( KIO::Job* )), TQT_SLOT(result( KIO::Job* )) ); Playlist::instance()->lock(); } @@ -1033,9 +1033,9 @@ RemotePlaylistFetcher::result( KIO::Job *job ) /// @class SqlLoader -SqlLoader::SqlLoader( const QString &sql, QListViewItem *after, int options ) +SqlLoader::SqlLoader( const TQString &sql, TQListViewItem *after, int options ) : UrlLoader( KURL::List(), after, options ) - , m_sql( QDeepCopy( sql ) ) + , m_sql( TQDeepCopy( sql ) ) { // Ovy: just until we make sure every SQL query from dynamic playlists is handled // correctly @@ -1046,19 +1046,19 @@ bool SqlLoader::doJob() { DEBUG_BLOCK - const QStringList values = CollectionDB::instance()->query( m_sql ); + const TQStringList values = CollectionDB::instance()->query( m_sql ); setProgressTotalSteps( values.count() ); BundleList bundles; uint x = 0; - for( for_iterators( QStringList, values ); it != end && !isAborted(); ++it ) { + for( for_iterators( TQStringList, values ); it != end && !isAborted(); ++it ) { setProgress( x += QueryBuilder::dragFieldCount ); bundles += CollectionDB::instance()->bundleFromQuery( &it ); if( bundles.count() == OPTIMUM_BUNDLE_COUNT || it == last ) { - QApplication::postEvent( this, new TagsEvent( bundles ) ); + TQApplication::postEvent( this, new TagsEvent( bundles ) ); bundles.clear(); } } @@ -1068,27 +1068,27 @@ SqlLoader::doJob() return true; } -QTime PlaylistFile::stringToTime(const QString& timeString) +TQTime PlaylistFile::stringToTime(const TQString& timeString) { int sec = 0; bool ok = false; - QStringList tokens = QStringList::split(':',timeString); + TQStringList tokens = TQStringList::split(':',timeString); sec += tokens[0].toInt(&ok)*3600; //hours sec += tokens[1].toInt(&ok)*60; //minutes sec += tokens[2].toInt(&ok); //secs if (ok) - return QTime().addSecs(sec); + return TQTime().addSecs(sec); else - return QTime(); + return TQTime(); } -bool MyXmlLoader::startElement( const QString &a, const QString &name, const QString &b, const QXmlAttributes &atts ) +bool MyXmlLoader::startElement( const TQString &a, const TQString &name, const TQString &b, const TQXmlAttributes &atts ) { if( name == "playlist" ) { - QString product, version, dynamic; + TQString product, version, dynamic; for( int i = 0, n = atts.count(); i < n; ++i ) { if( atts.localName( i ) == "product" ) diff --git a/amarok/src/playlistloader.h b/amarok/src/playlistloader.h index ec47789b..d1509a1f 100644 --- a/amarok/src/playlistloader.h +++ b/amarok/src/playlistloader.h @@ -8,15 +8,15 @@ #include "amarok.h" #include "debug.h" //stack allocated -#include -#include //baseclass +#include +#include //baseclass #include //KURL::List #include "metabundle.h" //stack allocated #include "threadmanager.h" //baseclass #include "xmlloader.h" //baseclass -class QListViewItem; -class QTextStream; +class TQListViewItem; +class TQTextStream; class PlaylistItem; class PLItemList; class XMLData; @@ -37,7 +37,7 @@ namespace KIO { class Job; } class PlaylistFile { public: - PlaylistFile( const QString &path ); + PlaylistFile( const TQString &path ); enum Format { M3U, PLS, XML, RAM, SMIL, ASX, XSPF, Unknown, NotPlaylist = Unknown }; @@ -46,39 +46,39 @@ public: BundleList &bundles() { return m_bundles; } /// the name of the playlist. often stored in the document (eg xspf) or derived from the filename - QString &title() { return m_title; } + TQString &title() { return m_title; } ///@return true if couldn't load the playlist's contents bool isError() const { return !m_error.isEmpty(); } /// if start returns false this has a translated error description - QString error() const { return m_error; } + TQString error() const { return m_error; } static inline bool isPlaylistFile( const KURL &url ) { return isPlaylistFile( url.fileName() ); } - static inline bool isPlaylistFile( const QString &fileName ) { return format( fileName ) != Unknown; } - static inline Format format( const QString &fileName ); - static QTime stringToTime(const QString&); + static inline bool isPlaylistFile( const TQString &fileName ) { return format( fileName ) != Unknown; } + static inline Format format( const TQString &fileName ); + static TQTime stringToTime(const TQString&); protected: /// make these virtual if you need to - bool loadM3u( QTextStream& ); - bool loadPls( QTextStream& ); - unsigned int loadPls_extractIndex( const QString &str ) const; - bool loadRealAudioRam( QTextStream& ); - bool loadASX( QTextStream& ); - bool loadSMIL( QTextStream& ); - bool loadXSPF( QTextStream& ); - QString m_path; - QString m_error; + bool loadM3u( TQTextStream& ); + bool loadPls( TQTextStream& ); + unsigned int loadPls_extractIndex( const TQString &str ) const; + bool loadRealAudioRam( TQTextStream& ); + bool loadASX( TQTextStream& ); + bool loadSMIL( TQTextStream& ); + bool loadXSPF( TQTextStream& ); + TQString m_path; + TQString m_error; BundleList m_bundles; - QString m_title; + TQString m_title; }; inline PlaylistFile::Format -PlaylistFile::format( const QString &fileName ) +PlaylistFile::format( const TQString &fileName ) { - const QString ext = Amarok::extension( fileName ); + const TQString ext = Amarok::extension( fileName ); if( ext == "m3u" ) return M3U; if( ext == "pls" ) return PLS; @@ -105,7 +105,7 @@ class UrlLoader : public ThreadManager::DependentJob Q_OBJECT public: - UrlLoader( const KURL::List&, QListViewItem*, int options = 0 ); + UrlLoader( const KURL::List&, TQListViewItem*, int options = 0 ); ~UrlLoader(); static const uint OPTIMUM_BUNDLE_COUNT = 200; @@ -117,13 +117,13 @@ protected: /// reimplemented from ThreadManager::Job virtual bool doJob(); virtual void completeJob(); - virtual void customEvent( QCustomEvent* ); + virtual void customEvent( TQCustomEvent* ); void loadXml( const KURL& ); private slots: void slotNewBundle( const MetaBundle &bundle, const XmlAttributeList &attributes ); - void slotPlaylistInfo( const QString &product, const QString &version, const QString &dynamicMode ); + void slotPlaylistInfo( const TQString &product, const TQString &version, const TQString &dynamicMode ); private: KURL::List recurse( const KURL& ); @@ -136,11 +136,11 @@ private: bool m_coloring; int m_options; Debug::Block m_block; - QPtrList m_oldQueue; - QXmlInputSource *m_xmlSource; - QValueList m_xml; + TQPtrList m_oldQueue; + TQXmlInputSource *m_xmlSource; + TQValueList m_xml; KURL m_currentURL; - QString m_dynamicMode; + TQString m_dynamicMode; protected: UrlLoader( const UrlLoader& ); //undefined @@ -157,10 +157,10 @@ protected: */ class SqlLoader : public UrlLoader { - const QString m_sql; + const TQString m_sql; public: - SqlLoader( const QString &sql, QListViewItem *after, int options = 0 ); + SqlLoader( const TQString &sql, TQListViewItem *after, int options = 0 ); virtual bool doJob(); }; @@ -177,13 +177,13 @@ class RemotePlaylistFetcher : public QObject const KURL m_source; KURL m_destination; - QListViewItem *m_after; + TQListViewItem *m_after; bool m_playFirstUrl; int m_options; class KTempFile *m_temp; public: - RemotePlaylistFetcher( const KURL &source, QListViewItem *after, int options = 0 ); + RemotePlaylistFetcher( const KURL &source, TQListViewItem *after, int options = 0 ); ~RemotePlaylistFetcher(); private slots: @@ -198,9 +198,9 @@ class MyXmlLoader: public MetaBundle::XmlLoader Q_OBJECT public: MyXmlLoader() { } - virtual bool startElement( const QString&, const QString&, const QString &, const QXmlAttributes& ); + virtual bool startElement( const TQString&, const TQString&, const TQString &, const TQXmlAttributes& ); signals: - void playlistInfo( const QString &product, const QString &version, const QString &dynamicMode ); + void playlistInfo( const TQString &product, const TQString &version, const TQString &dynamicMode ); }; diff --git a/amarok/src/playlistselection.cpp b/amarok/src/playlistselection.cpp index 4e5dc69b..aaad2ea0 100644 --- a/amarok/src/playlistselection.cpp +++ b/amarok/src/playlistselection.cpp @@ -17,13 +17,13 @@ #include "playlistbrowser.h" #include "playlistselection.h" -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -31,17 +31,17 @@ #include #include -PlaylistSelection::PlaylistSelection( QWidget* parent, const char* name ) +PlaylistSelection::PlaylistSelection( TQWidget* parent, const char* name ) : KListView( parent, name ) { addColumn( i18n("Select Playlists") ); setRootIsDecorated( true ); PlaylistBrowserView* browserTree = PlaylistBrowser::instance()->getListView(); - QListViewItem* browserItem = browserTree->firstChild(); + TQListViewItem* browserItem = browserTree->firstChild(); //load into the tree the first two items, which is the smart playlist and the playlist for( int i = 0; i<2; i++ ) { - QListViewItem* newItem = new QListViewItem( this, browserItem->text(0) ); + TQListViewItem* newItem = new TQListViewItem( this, browserItem->text(0) ); newItem->setPixmap( 0, *browserItem->pixmap(0) ); loadChildren( browserItem, newItem ); newItem->setOpen( true ); @@ -49,9 +49,9 @@ PlaylistSelection::PlaylistSelection( QWidget* parent, const char* name ) } } -void PlaylistSelection::loadChildren( QListViewItem* browserParent, QListViewItem* selectionParent ) +void PlaylistSelection::loadChildren( TQListViewItem* browserParent, TQListViewItem* selectionParent ) { - QListViewItem* browserChild = browserParent->firstChild(); + TQListViewItem* browserChild = browserParent->firstChild(); while( browserChild ) { @@ -71,7 +71,7 @@ void PlaylistSelection::loadChildren( QListViewItem* browserParent, QListViewIte //////////////////////////////// namespace ConfigDynamic { - KDialogBase* basicDialog( QWidget* parent ) + KDialogBase* basicDialog( TQWidget* parent ) { KDialogBase* dialog = new KDialogBase( parent, "new dynamic", true, i18n("Create Dynamic Playlist"), @@ -80,24 +80,24 @@ namespace ConfigDynamic kapp->setTopWidget( dialog ); dialog->setCaption( i18n("Dynamic Mode") ); NewDynamic* nd = new NewDynamic( dialog, "new dynamic"); - //QSizePolicy policy; - //policy.setHorData(QSizePolicy::Maximum); + //TQSizePolicy policy; + //policy.setHorData(TQSizePolicy::Maximum); //dialog->setSizePolicy(policy); dialog->setMainWidget( nd ); return dialog; } - void dynamicDialog( QWidget* parent ) + void dynamicDialog( TQWidget* parent ) { KDialogBase* dialog = basicDialog( parent ); NewDynamic* nd = static_cast(dialog->mainWidget()); nd->m_mixLabel->setText( i18n("Add Dynamic Playlist") ); - if( dialog->exec() == QDialog::Accepted ) + if( dialog->exec() == TQDialog::Accepted ) addDynamic( nd ); } - void editDynamicPlaylist( QWidget* parent, DynamicMode* mode ) + void editDynamicPlaylist( TQWidget* parent, DynamicMode* mode ) { KDialogBase* dialog = basicDialog( parent ); NewDynamic* nd = static_cast(dialog->mainWidget()); @@ -111,10 +111,10 @@ namespace ConfigDynamic { //check items in the custom playlist nd->m_mixLabel->setText( i18n("Edit Dynamic Playlist") ); - QStringList items = mode->items(); + TQStringList items = mode->items(); foreach( items ) { - QCheckListItem* current = dynamic_cast( + TQCheckListItem* current = dynamic_cast( Amarok::findItemByPath(nd->selectPlaylist, (*it)) ); if( current ) current->setOn(true); @@ -140,7 +140,7 @@ namespace ConfigDynamic nd->updateGeometry(); dialog->resize( nd->minimumSizeHint() ); - if( dialog->exec() == QDialog::Accepted ) + if( dialog->exec() == TQDialog::Accepted ) { loadDynamicMode( mode, nd ); PlaylistBrowser::instance()->getDynamicCategory()->sortChildItems( 0, true ); @@ -156,9 +156,9 @@ namespace ConfigDynamic saveMe->setUpcomingCount( dialog->m_upcomingIntSpinBox->value() ); saveMe->setPreviousCount( dialog->m_previousIntSpinBox->value() ); - QStringList list; + TQStringList list; debug() << "Saving custom list..." << endl; - QListViewItemIterator it( dialog->selectPlaylist, QListViewItemIterator::Checked ); + TQListViewItemIterator it( dialog->selectPlaylist, TQListViewItemIterator::Checked ); while( it.current() ) { @@ -171,7 +171,7 @@ namespace ConfigDynamic void addDynamic( NewDynamic* dialog ) { - QListViewItem *parent = PlaylistBrowser::instance()->getDynamicCategory(); + TQListViewItem *parent = PlaylistBrowser::instance()->getDynamicCategory(); DynamicEntry *saveMe = new DynamicEntry( parent, 0, dialog->m_name->text().replace( "\n", " " ) ); saveMe->setAppendType( DynamicMode::CUSTOM ); @@ -187,19 +187,19 @@ namespace ConfigDynamic //////////////////////////////// /// SelectionListItem //////////////////////////////// -SelectionListItem::SelectionListItem( QCheckListItem * parent, const QString& text, QListViewItem* browserEquivalent ) - : QCheckListItem( parent, text, QCheckListItem::CheckBox ) +SelectionListItem::SelectionListItem( TQCheckListItem * parent, const TQString& text, TQListViewItem* browserEquivalent ) + : TQCheckListItem( parent, text, TQCheckListItem::CheckBox ) , m_browserEquivalent( browserEquivalent ) { } -SelectionListItem::SelectionListItem( QListViewItem * parent, const QString& text, QListViewItem* browserEquivalent ) - : QCheckListItem( parent, text, QCheckListItem::CheckBox ) +SelectionListItem::SelectionListItem( TQListViewItem * parent, const TQString& text, TQListViewItem* browserEquivalent ) + : TQCheckListItem( parent, text, TQCheckListItem::CheckBox ) , m_browserEquivalent( browserEquivalent ) { } void SelectionListItem::stateChange( bool b ) { - QListViewItem* it = firstChild(); + TQListViewItem* it = firstChild(); while( it ) { static_cast(it)->setOn( b ); //calls stateChange, so is recursive @@ -210,8 +210,8 @@ void SelectionListItem::stateChange( bool b ) QString SelectionListItem::name() const { - QString fullName = text(0).replace('/', "\\/"); - QListViewItem *p = parent(); + TQString fullName = text(0).replace('/', "\\/"); + TQListViewItem *p = parent(); while ( p ) { fullName.prepend( p->text(0).replace('/', "\\/") + "/" ); p = p->parent(); diff --git a/amarok/src/playlistselection.h b/amarok/src/playlistselection.h index ce13d424..c0830095 100644 --- a/amarok/src/playlistselection.h +++ b/amarok/src/playlistselection.h @@ -21,39 +21,39 @@ class PlaylistSelection : public KListView { Q_OBJECT public: - PlaylistSelection(QWidget* parent, const char* name); - virtual QSize sizeHint() const + PlaylistSelection(TQWidget* parent, const char* name); + virtual TQSize sizeHint() const { return minimumSizeHint(); } private: - void loadChildren(QListViewItem* browserParent, QListViewItem* selectionParent); + void loadChildren(TQListViewItem* browserParent, TQListViewItem* selectionParent); }; namespace ConfigDynamic { void addDynamic( NewDynamic* dialog ); - void dynamicDialog( QWidget* parent ); - void editDynamicPlaylist( QWidget* parent, DynamicMode* mode ); + void dynamicDialog( TQWidget* parent ); + void editDynamicPlaylist( TQWidget* parent, DynamicMode* mode ); void loadDynamicMode( DynamicMode* saveMe, NewDynamic* dialog ); - KDialogBase* basicDialog( QWidget* parent ); + KDialogBase* basicDialog( TQWidget* parent ); } class SelectionListItem : public QCheckListItem { public: - SelectionListItem( QListViewItem * parent, const QString& text, QListViewItem* browserEquivalent ); - SelectionListItem( QCheckListItem * parent, const QString& text, QListViewItem* browserEquivalent ); + SelectionListItem( TQListViewItem * parent, const TQString& text, TQListViewItem* browserEquivalent ); + SelectionListItem( TQCheckListItem * parent, const TQString& text, TQListViewItem* browserEquivalent ); - virtual QString name() const; + virtual TQString name() const; protected: virtual void stateChange( bool ); private: - QListViewItem* m_browserEquivalent; + TQListViewItem* m_browserEquivalent; }; #endif /*PLAYLISTSELECTION_H*/ diff --git a/amarok/src/playlistwindow.cpp b/amarok/src/playlistwindow.cpp index 829949b3..1ccbdf99 100644 --- a/amarok/src/playlistwindow.cpp +++ b/amarok/src/playlistwindow.cpp @@ -41,19 +41,19 @@ #include "threadmanager.h" #include "magnatunebrowser/magnatunebrowser.h" -#include //eventFilter() -#include -#include -#include -#include //search filter label +#include //eventFilter() +#include +#include +#include +#include //search filter label -#include //dynamic title -#include +#include //dynamic title +#include -#include //qspaceritem in dynamic bar -#include //search filter timer -#include //QToolTip::add() -#include //contains the playlist +#include //qspaceritem in dynamic bar +#include //search filter timer +#include //TQToolTip::add() +#include //contains the playlist #include //m_actionCollection #include //kapp @@ -86,18 +86,18 @@ namespace Amarok class ToolBar : public KToolBar { public: - ToolBar( QWidget *parent, const char *name ) + ToolBar( TQWidget *parent, const char *name ) : KToolBar( parent, name ) {} protected: virtual void - contextMenuEvent( QContextMenuEvent *e ) { + contextMenuEvent( TQContextMenuEvent *e ) { Amarok::Menu::instance()->popup( e->globalPos() ); } virtual void - wheelEvent( QWheelEvent *e ) { + wheelEvent( TQWheelEvent *e ) { EngineController::instance()->increaseVolume( e->delta() / Amarok::VOLUME_SENSITIVITY ); } }; @@ -106,7 +106,7 @@ namespace Amarok PlaylistWindow *PlaylistWindow::s_instance = 0; PlaylistWindow::PlaylistWindow() - : QWidget( 0, "PlaylistWindow", Qt::WGroupLeader ) + : TQWidget( 0, "PlaylistWindow", Qt::WGroupLeader ) , KXMLGUIClient() , m_lastBrowser( 0 ) { @@ -123,38 +123,38 @@ PlaylistWindow::PlaylistWindow() new K3bExporter(); - KStdAction::configureToolbars( kapp, SLOT( slotConfigToolBars() ), ac ); - KStdAction::keyBindings( kapp, SLOT( slotConfigShortcuts() ), ac ); - KStdAction::keyBindings( kapp, SLOT( slotConfigGlobalShortcuts() ), ac, "options_configure_globals" ); - KStdAction::preferences( kapp, SLOT( slotConfigAmarok() ), ac ); + KStdAction::configureToolbars( kapp, TQT_SLOT( slotConfigToolBars() ), ac ); + KStdAction::keyBindings( kapp, TQT_SLOT( slotConfigShortcuts() ), ac ); + KStdAction::keyBindings( kapp, TQT_SLOT( slotConfigGlobalShortcuts() ), ac, "options_configure_globals" ); + KStdAction::preferences( kapp, TQT_SLOT( slotConfigAmarok() ), ac ); ac->action("options_configure_globals")->setIcon( Amarok::icon( "configure" ) ); ac->action(KStdAction::name(KStdAction::KeyBindings))->setIcon( Amarok::icon( "configure" ) ); ac->action(KStdAction::name(KStdAction::ConfigureToolbars))->setIcon( Amarok::icon( "configure" ) ); ac->action(KStdAction::name(KStdAction::Preferences))->setIcon( Amarok::icon( "configure" ) ); - KStdAction::quit( kapp, SLOT( quit() ), ac ); - KStdAction::open( this, SLOT(slotAddLocation()), ac, "playlist_add" )->setText( i18n("&Add Media...") ); + KStdAction::quit( kapp, TQT_SLOT( quit() ), ac ); + KStdAction::open( this, TQT_SLOT(slotAddLocation()), ac, "playlist_add" )->setText( i18n("&Add Media...") ); ac->action( "playlist_add" )->setIcon( Amarok::icon( "files" ) ); - KStdAction::open( this, SLOT(slotAddStream()), ac, "stream_add" )->setText( i18n("&Add Stream...") ); + KStdAction::open( this, TQT_SLOT(slotAddStream()), ac, "stream_add" )->setText( i18n("&Add Stream...") ); ac->action( "stream_add" )->setIcon( Amarok::icon( "files" ) ); - KStdAction::save( this, SLOT(savePlaylist()), ac, "playlist_save" )->setText( i18n("&Save Playlist As...") ); + KStdAction::save( this, TQT_SLOT(savePlaylist()), ac, "playlist_save" )->setText( i18n("&Save Playlist As...") ); ac->action( "playlist_save" )->setIcon( Amarok::icon( "save" ) ); #ifndef Q_WS_MAC - KStdAction::showMenubar( this, SLOT(slotToggleMenu()), ac ); + KStdAction::showMenubar( this, TQT_SLOT(slotToggleMenu()), ac ); #endif //FIXME: after string freeze rename to "Burn Current Playlist"? - new KAction( i18n("Burn to CD"), Amarok::icon( "burn" ), 0, this, SLOT(slotBurnPlaylist()), ac, "playlist_burn" ); + new KAction( i18n("Burn to CD"), Amarok::icon( "burn" ), 0, this, TQT_SLOT(slotBurnPlaylist()), ac, "playlist_burn" ); actionCollection()->action("playlist_burn")->setEnabled( K3bExporter::isAvailable() ); - new KAction( i18n("Play Media..."), Amarok::icon( "files" ), 0, this, SLOT(slotPlayMedia()), ac, "playlist_playmedia" ); - new KAction( i18n("Play Audio CD"), Amarok::icon( "album" ), 0, this, SLOT(playAudioCD()), ac, "play_audiocd" ); - KAction *playPause = new KAction( i18n( "&Play/Pause" ), Amarok::icon( "play" ), Key_Space, ec, SLOT( playPause() ), ac, "play_pause" ); - new KAction( i18n("Script Manager"), Amarok::icon( "scripts" ), 0, this, SLOT(showScriptSelector()), ac, "script_manager" ); - new KAction( i18n("Queue Manager"), Amarok::icon( "queue" ), 0, this, SLOT(showQueueManager()), ac, "queue_manager" ); - KAction *seekForward = new KAction( i18n( "&Seek Forward" ), Amarok::icon( "fastforward" ), Key_Right, ec, SLOT( seekForward() ), ac, "seek_forward" ); - KAction *seekBackward = new KAction( i18n( "&Seek Backward" ), Amarok::icon( "rewind" ), Key_Left, ec, SLOT( seekBackward() ), ac, "seek_backward" ); - new KAction( i18n("Statistics"), Amarok::icon( "info" ), 0, this, SLOT(showStatistics()), ac, "statistics" ); - new KAction( i18n("Update Collection"), Amarok::icon( "refresh" ), 0, CollectionDB::instance(), SLOT( scanModifiedDirs() ), actionCollection(), "update_collection" ); + new KAction( i18n("Play Media..."), Amarok::icon( "files" ), 0, this, TQT_SLOT(slotPlayMedia()), ac, "playlist_playmedia" ); + new KAction( i18n("Play Audio CD"), Amarok::icon( "album" ), 0, this, TQT_SLOT(playAudioCD()), ac, "play_audiocd" ); + KAction *playPause = new KAction( i18n( "&Play/Pause" ), Amarok::icon( "play" ), Key_Space, ec, TQT_SLOT( playPause() ), ac, "play_pause" ); + new KAction( i18n("Script Manager"), Amarok::icon( "scripts" ), 0, this, TQT_SLOT(showScriptSelector()), ac, "script_manager" ); + new KAction( i18n("Queue Manager"), Amarok::icon( "queue" ), 0, this, TQT_SLOT(showQueueManager()), ac, "queue_manager" ); + KAction *seekForward = new KAction( i18n( "&Seek Forward" ), Amarok::icon( "fastforward" ), Key_Right, ec, TQT_SLOT( seekForward() ), ac, "seek_forward" ); + KAction *seekBackward = new KAction( i18n( "&Seek Backward" ), Amarok::icon( "rewind" ), Key_Left, ec, TQT_SLOT( seekBackward() ), ac, "seek_backward" ); + new KAction( i18n("Statistics"), Amarok::icon( "info" ), 0, this, TQT_SLOT(showStatistics()), ac, "statistics" ); + new KAction( i18n("Update Collection"), Amarok::icon( "refresh" ), 0, CollectionDB::instance(), TQT_SLOT( scanModifiedDirs() ), actionCollection(), "update_collection" ); m_lastfmTags << "Alternative" << "Ambient" << "Chill Out" << "Classical" << "Dance" << "Electronica" << "Favorites" << "Heavy Metal" << "Hip Hop" << "Indie Rock" @@ -164,39 +164,39 @@ PlaylistWindow::PlaylistWindow() KPopupMenu* playTagRadioMenu = new KPopupMenu( this ); int id = 0; foreach( m_lastfmTags ) { - playTagRadioMenu->insertItem( *it, this, SLOT( playLastfmGlobaltag( int ) ), 0, id ); + playTagRadioMenu->insertItem( *it, this, TQT_SLOT( playLastfmGlobaltag( int ) ), 0, id ); ++id; } KPopupMenu* addTagRadioMenu = new KPopupMenu( this ); id = 0; foreach( m_lastfmTags ) { - addTagRadioMenu->insertItem( *it, this, SLOT( addLastfmGlobaltag( int ) ), 0, id ); + addTagRadioMenu->insertItem( *it, this, TQT_SLOT( addLastfmGlobaltag( int ) ), 0, id ); ++id; } KActionMenu* playLastfm = new KActionMenu( i18n( "Play las&t.fm Stream" ), Amarok::icon( "audioscrobbler" ), ac, "lastfm_play" ); - QPopupMenu* playLastfmMenu = playLastfm->popupMenu(); - playLastfmMenu->insertItem( i18n( "Personal Radio" ), this, SLOT( playLastfmPersonal() ) ); - playLastfmMenu->insertItem( i18n( "Neighbor Radio" ), this, SLOT( playLastfmNeighbor() ) ); - playLastfmMenu->insertItem( i18n( "Custom Station" ), this, SLOT( playLastfmCustom() ) ); + TQPopupMenu* playLastfmMenu = playLastfm->popupMenu(); + playLastfmMenu->insertItem( i18n( "Personal Radio" ), this, TQT_SLOT( playLastfmPersonal() ) ); + playLastfmMenu->insertItem( i18n( "Neighbor Radio" ), this, TQT_SLOT( playLastfmNeighbor() ) ); + playLastfmMenu->insertItem( i18n( "Custom Station" ), this, TQT_SLOT( playLastfmCustom() ) ); playLastfmMenu->insertItem( i18n( "Global Tag Radio" ), playTagRadioMenu ); KActionMenu* addLastfm = new KActionMenu( i18n( "Add las&t.fm Stream" ), Amarok::icon( "audioscrobbler" ), ac, "lastfm_add" ); - QPopupMenu* addLastfmMenu = addLastfm->popupMenu(); - addLastfmMenu->insertItem( i18n( "Personal Radio" ), this, SLOT( addLastfmPersonal() ) ); - addLastfmMenu->insertItem( i18n( "Neighbor Radio" ), this, SLOT( addLastfmNeighbor() ) ); - addLastfmMenu->insertItem( i18n( "Custom Station" ), this, SLOT( addLastfmCustom() ) ); + TQPopupMenu* addLastfmMenu = addLastfm->popupMenu(); + addLastfmMenu->insertItem( i18n( "Personal Radio" ), this, TQT_SLOT( addLastfmPersonal() ) ); + addLastfmMenu->insertItem( i18n( "Neighbor Radio" ), this, TQT_SLOT( addLastfmNeighbor() ) ); + addLastfmMenu->insertItem( i18n( "Custom Station" ), this, TQT_SLOT( addLastfmCustom() ) ); addLastfmMenu->insertItem( i18n( "Global Tag Radio" ), addTagRadioMenu ); ac->action( "options_configure_globals" )->setText( i18n( "Configure &Global Shortcuts..." ) ); - new KAction( i18n( "Previous Track" ), Amarok::icon( "back" ), 0, ec, SLOT( previous() ), ac, "prev" ); - new KAction( i18n( "Play" ), Amarok::icon( "play" ), 0, ec, SLOT( play() ), ac, "play" ); - new KAction( i18n( "Pause" ), Amarok::icon( "pause" ), 0, ec, SLOT( pause() ), ac, "pause" ); - new KAction( i18n( "Next Track" ), Amarok::icon( "next" ), 0, ec, SLOT( next() ), ac, "next" ); + new KAction( i18n( "Previous Track" ), Amarok::icon( "back" ), 0, ec, TQT_SLOT( previous() ), ac, "prev" ); + new KAction( i18n( "Play" ), Amarok::icon( "play" ), 0, ec, TQT_SLOT( play() ), ac, "play" ); + new KAction( i18n( "Pause" ), Amarok::icon( "pause" ), 0, ec, TQT_SLOT( pause() ), ac, "pause" ); + new KAction( i18n( "Next Track" ), Amarok::icon( "next" ), 0, ec, TQT_SLOT( next() ), ac, "next" ); - KAction *toggleFocus = new KAction( i18n( "Toggle Focus" ), "reload", CTRL+Key_Tab, this, SLOT( slotToggleFocus() ), ac, "toggle_focus" ); + KAction *toggleFocus = new KAction( i18n( "Toggle Focus" ), "reload", CTRL+Key_Tab, this, TQT_SLOT( slotToggleFocus() ), ac, "toggle_focus" ); { // KAction idiocy -- shortcuts don't work until they've been plugged into a menu @@ -261,7 +261,7 @@ void PlaylistWindow::init() // DynamicBar *dynamicBar = new DynamicBar( m_browsers->container()); - QFrame *playlist; + TQFrame *playlist; { // KToolBar *bar = new KToolBar( m_browsers->container(), "NotMainToolBar" ); @@ -276,29 +276,29 @@ void PlaylistWindow::init() actionCollection()->action( "playlist_undo")->plug( bar ); actionCollection()->action( "playlist_redo")->plug( bar ); bar->boxLayout()->addStretch(); - QWidget *button = new KToolBarButton( "locationbar_erase", 1, bar ); - QLabel *filter_label = new QLabel( i18n("S&earch:") + ' ', bar ); + TQWidget *button = new KToolBarButton( "locationbar_erase", 1, bar ); + TQLabel *filter_label = new TQLabel( i18n("S&earch:") + ' ', bar ); m_lineEdit = new ClickLineEdit( i18n( "Playlist Search" ), bar ); filter_label->setBuddy( m_lineEdit ); bar->setStretchableWidget( m_lineEdit ); KPushButton *filterButton = new KPushButton("...", bar, "filter"); - filterButton->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ); + filterButton->setSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Fixed ); - m_lineEdit->setFrame( QFrame::Sunken ); + m_lineEdit->setFrame( TQFrame::Sunken ); m_lineEdit->installEventFilter( this ); //we intercept keyEvents - connect( button, SIGNAL(clicked()), m_lineEdit, SLOT(clear()) ); - connect( m_lineEdit, SIGNAL(textChanged( const QString& )), - playlist, SLOT(setFilterSlot( const QString& )) ); - connect( filterButton, SIGNAL( clicked() ), SLOT( slotEditFilter() ) ); + connect( button, TQT_SIGNAL(clicked()), m_lineEdit, TQT_SLOT(clear()) ); + connect( m_lineEdit, TQT_SIGNAL(textChanged( const TQString& )), + playlist, TQT_SLOT(setFilterSlot( const TQString& )) ); + connect( filterButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotEditFilter() ) ); - QToolTip::add( button, i18n( "Clear search field" ) ); - QString filtertip = i18n( "Enter space-separated terms to search in the playlist.\n\n" + TQToolTip::add( button, i18n( "Clear search field" ) ); + TQString filtertip = i18n( "Enter space-separated terms to search in the playlist.\n\n" "Advanced, Google-esque syntax is also available;\n" "see the handbook (The Playlist section of chapter 4) for details." ); - QToolTip::add( m_lineEdit, filtertip ); - QToolTip::add( filterButton, i18n( "Click to edit playlist filter" ) ); + TQToolTip::add( m_lineEdit, filtertip ); + TQToolTip::add( filterButton, i18n( "Click to edit playlist filter" ) ); } // @@ -307,10 +307,10 @@ void PlaylistWindow::init() #ifndef Q_WS_MAC m_toolbar->setShown( AmarokConfig::showToolbar() ); #endif - QWidget *statusbar = new Amarok::StatusBar( this ); + TQWidget *statusbar = new Amarok::StatusBar( this ); KAction* repeatAction = Amarok::actionCollection()->action( "repeat" ); - connect( repeatAction, SIGNAL( activated( int ) ), playlist, SLOT( slotRepeatTrackToggled( int ) ) ); + connect( repeatAction, TQT_SIGNAL( activated( int ) ), playlist, TQT_SLOT( slotRepeatTrackToggled( int ) ) ); m_menubar = new KMenuBar( this ); #ifndef Q_WS_MAC @@ -330,7 +330,7 @@ void PlaylistWindow::init() actionsMenu->insertSeparator(); actionCollection()->action(KStdAction::name(KStdAction::Quit))->plug( actionsMenu ); - connect( actionsMenu, SIGNAL( aboutToShow() ), SLOT( actionsMenuAboutToShow() ) ); + connect( actionsMenu, TQT_SIGNAL( aboutToShow() ), TQT_SLOT( actionsMenuAboutToShow() ) ); //END Actions menu //BEGIN Playlist menu @@ -368,7 +368,7 @@ void PlaylistWindow::init() m_toolsMenu->insertItem( SmallIconSet( Amarok::icon( "covermanager" ) ), i18n("&Cover Manager"), Amarok::Menu::ID_SHOW_COVER_MANAGER ); actionCollection()->action("queue_manager")->plug( m_toolsMenu ); m_toolsMenu->insertItem( SmallIconSet( Amarok::icon( "visualizations" ) ), i18n("&Visualizations"), Amarok::Menu::ID_SHOW_VIS_SELECTOR ); - m_toolsMenu->insertItem( SmallIconSet( Amarok::icon( "equalizer") ), i18n("&Equalizer"), kapp, SLOT( slotConfigEqualizer() ), 0, Amarok::Menu::ID_CONFIGURE_EQUALIZER ); + m_toolsMenu->insertItem( SmallIconSet( Amarok::icon( "equalizer") ), i18n("&Equalizer"), kapp, TQT_SLOT( slotConfigEqualizer() ), 0, Amarok::Menu::ID_CONFIGURE_EQUALIZER ); actionCollection()->action("script_manager")->plug( m_toolsMenu ); actionCollection()->action("statistics")->plug( m_toolsMenu ); m_toolsMenu->insertSeparator(); @@ -381,8 +381,8 @@ void PlaylistWindow::init() m_toolsMenu->setItemEnabled( Amarok::Menu::ID_SHOW_VIS_SELECTOR, false ); #endif - connect( m_toolsMenu, SIGNAL( aboutToShow() ), SLOT( toolsMenuAboutToShow() ) ); - connect( m_toolsMenu, SIGNAL( activated(int) ), SLOT( slotMenuActivated(int) ) ); + connect( m_toolsMenu, TQT_SIGNAL( aboutToShow() ), TQT_SLOT( toolsMenuAboutToShow() ) ); + connect( m_toolsMenu, TQT_SIGNAL( activated(int) ), TQT_SLOT( slotMenuActivated(int) ) ); //END Tools menu //BEGIN Settings menu @@ -405,7 +405,7 @@ void PlaylistWindow::init() actionCollection()->action(KStdAction::name(KStdAction::ConfigureToolbars))->plug( m_settingsMenu ); actionCollection()->action(KStdAction::name(KStdAction::Preferences))->plug( m_settingsMenu ); - connect( m_settingsMenu, SIGNAL( activated(int) ), SLOT( slotMenuActivated(int) ) ); + connect( m_settingsMenu, TQT_SIGNAL( activated(int) ), TQT_SLOT( slotMenuActivated(int) ) ); //END Settings menu m_menubar->insertItem( i18n( "E&ngage" ), actionsMenu ); @@ -416,7 +416,7 @@ void PlaylistWindow::init() m_menubar->insertItem( i18n( "&Help" ), Amarok::Menu::helpMenu() ); - QBoxLayout *layV = new QVBoxLayout( this ); + TQBoxLayout *layV = new TQVBoxLayout( this ); layV->addWidget( m_menubar ); layV->addWidget( m_browsers, 1 ); layV->addWidget( m_toolbar ); @@ -424,7 +424,7 @@ void PlaylistWindow::init() layV->addWidget( statusbar ); //The volume slider later becomes our FocusProxy, so all wheelEvents get redirected to it - m_toolbar->setFocusPolicy( QWidget::WheelFocus ); + m_toolbar->setFocusPolicy( TQWidget::WheelFocus ); m_toolbar->setFlat( true ); m_toolbar->setMovingEnabled( false ); playlist->setMargin( 2 ); @@ -433,7 +433,7 @@ void PlaylistWindow::init() // { - QString xmlFile = Amarok::config()->readEntry( "XMLFile", "amarokui.rc" ); + TQString xmlFile = Amarok::config()->readEntry( "XMLFile", "amarokui.rc" ); // this bug can bite you if you are a pre 1.2 user, we // deleted amarokui_first.rc, but we must still support it @@ -474,8 +474,8 @@ void PlaylistWindow::init() { addInstBrowserMacro( MediaBrowser, "MediaBrowser", i18n("Devices"), Amarok::icon( "device" ) ) //to re-enable mediabrowser hiding, uncomment this: - //connect( MediaBrowser::instance(), SIGNAL( availabilityChanged( bool ) ), - // this, SLOT( mbAvailabilityChanged( bool ) ) ); + //connect( MediaBrowser::instance(), TQT_SIGNAL( availabilityChanged( bool ) ), + // this, TQT_SLOT( mbAvailabilityChanged( bool ) ) ); m_browsers->makeDropProxy( "MediaBrowser", MediaBrowser::queue() ); } @@ -484,21 +484,21 @@ void PlaylistWindow::init() } // - connect( Playlist::instance()->qscrollview(), SIGNAL( dynamicModeChanged( const DynamicMode* ) ), - PlaylistBrowser::instance(), SLOT( loadDynamicItems() ) ); + connect( Playlist::instance()->qscrollview(), TQT_SIGNAL( dynamicModeChanged( const DynamicMode* ) ), + PlaylistBrowser::instance(), TQT_SLOT( loadDynamicItems() ) ); qApp->installEventFilter( this ); // keyboards shortcuts for the browsers - connect( playlist, SIGNAL( itemCountChanged( int, int, int, int, int, int ) ), - statusbar, SLOT( slotItemCountChanged( int, int, int, int, int, int ) ) ); - connect( playlist, SIGNAL( queueChanged( const PLItemList &, const PLItemList & ) ), - statusbar, SLOT( updateQueueLabel() ) ); - connect( playlist, SIGNAL( aboutToClear() ), m_lineEdit, SLOT( clear() ) ); + connect( playlist, TQT_SIGNAL( itemCountChanged( int, int, int, int, int, int ) ), + statusbar, TQT_SLOT( slotItemCountChanged( int, int, int, int, int, int ) ) ); + connect( playlist, TQT_SIGNAL( queueChanged( const PLItemList &, const PLItemList & ) ), + statusbar, TQT_SLOT( updateQueueLabel() ) ); + connect( playlist, TQT_SIGNAL( aboutToClear() ), m_lineEdit, TQT_SLOT( clear() ) ); Amarok::MessageQueue::instance()->sendMessages(); } -void PlaylistWindow::slotSetFilter( const QString &filter ) //SLOT +void PlaylistWindow::slotSetFilter( const TQString &filter ) //SLOT { m_lineEdit->setText( filter ); } @@ -506,13 +506,13 @@ void PlaylistWindow::slotSetFilter( const QString &filter ) //SLOT void PlaylistWindow::slotEditFilter() //SLOT { EditFilterDialog *fd = new EditFilterDialog( this, true, m_lineEdit->text() ); - connect( fd, SIGNAL(filterChanged(const QString &)), SLOT(slotSetFilter(const QString &)) ); + connect( fd, TQT_SIGNAL(filterChanged(const TQString &)), TQT_SLOT(slotSetFilter(const TQString &)) ); if( fd->exec() ) m_lineEdit->setText( fd->filter() ); delete fd; } -void PlaylistWindow::addBrowser( const QString &name, QWidget *browser, const QString &text, const QString &icon ) +void PlaylistWindow::addBrowser( const TQString &name, TQWidget *browser, const TQString &text, const TQString &icon ) { if( !m_browsers->browser( name ) ) m_browsers->addBrowser( name, browser, text, icon ); @@ -564,7 +564,7 @@ void PlaylistWindow::createGUI() //KToolBarButton::modeChange() causes that button to set its mode to that of its parent KToolBar //KToolBar::setIconText() calls modeChange() for children, unless 2nd param is false - QStringList list; + TQStringList list; list << "toolbutton_playlist_add" // << "toolbutton_playlist_clear" // << "toolbutton_playlist_shuffle" @@ -574,9 +574,9 @@ void PlaylistWindow::createGUI() m_toolbar->setIconText( KToolBar::IconTextRight, false ); //we want some buttons to have text on right - const QStringList::ConstIterator end = list.constEnd(); - const QStringList::ConstIterator last = list.fromLast(); - for( QStringList::ConstIterator it = list.constBegin(); it != end; ++it ) + const TQStringList::ConstIterator end = list.constEnd(); + const TQStringList::ConstIterator last = list.fromLast(); + for( TQStringList::ConstIterator it = list.constBegin(); it != end; ++it ) { KToolBarButton* const button = static_cast( m_toolbar->child( (*it).latin1() ) ); @@ -589,7 +589,7 @@ void PlaylistWindow::createGUI() if ( button ) { button->modeChange(); - button->setFocusPolicy( QWidget::NoFocus ); + button->setFocusPolicy( TQWidget::NoFocus ); } } @@ -626,25 +626,25 @@ void PlaylistWindow::applySettings() * Here we filter some events for the Playlist Search LineEdit and the Playlist. @n * this makes life easier since we have more useful functions available from this class */ -bool PlaylistWindow::eventFilter( QObject *o, QEvent *e ) +bool PlaylistWindow::eventFilter( TQObject *o, TQEvent *e ) { Playlist* const pl = Playlist::instance(); - typedef QListViewItemIterator It; + typedef TQListViewItemIterator It; switch( e->type() ) { - case 6/*QEvent::KeyPress*/: + case 6/*TQEvent::KeyPress*/: //there are a few keypresses that we intercept - #define e static_cast(e) + #define e static_cast(e) if( e->key() == Key_F2 ) { // currentItem is ALWAYS visible. - QListViewItem *item = pl->currentItem(); + TQListViewItem *item = pl->currentItem(); // intercept F2 for inline tag renaming // NOTE: tab will move to the next tag @@ -684,7 +684,7 @@ bool PlaylistWindow::eventFilter( QObject *o, QEvent *e ) if( o == m_lineEdit ) //the search lineedit { - QListViewItem *item; + TQListViewItem *item; switch( e->key() ) { case Key_Up: @@ -692,7 +692,7 @@ bool PlaylistWindow::eventFilter( QObject *o, QEvent *e ) case Key_PageDown: case Key_PageUp: pl->setFocus(); - QApplication::sendEvent( pl, e ); + TQApplication::sendEvent( pl, e ); return true; case Key_Return: @@ -757,7 +757,7 @@ bool PlaylistWindow::eventFilter( QObject *o, QEvent *e ) { if( pl->currentItem() && ( e->key() == Key_Up && pl->currentItem()->itemAbove() == 0 && !(e->state() & Qt::ShiftButton) ) ) { - QListViewItem *lastitem = *It( pl, It::Visible ); + TQListViewItem *lastitem = *It( pl, It::Visible ); if ( !lastitem ) return false; while( lastitem->itemBelow() ) @@ -784,7 +784,7 @@ bool PlaylistWindow::eventFilter( QObject *o, QEvent *e ) if( ( ( e->key() >= Key_0 && e->key() <= Key_Z ) || e->key() == Key_Backspace || e->key() == Key_Escape ) && ( !e->state() || e->state() == Qt::ShiftButton ) ) //only if shift or no modifier key is pressed and 0-Z or backspace or escape { m_lineEdit->setFocus(); - QApplication::sendEvent( m_lineEdit, e ); + TQApplication::sendEvent( m_lineEdit, e ); return true; } } @@ -795,11 +795,11 @@ bool PlaylistWindow::eventFilter( QObject *o, QEvent *e ) break; } - return QWidget::eventFilter( o, e ); + return TQWidget::eventFilter( o, e ); } -void PlaylistWindow::closeEvent( QCloseEvent *e ) +void PlaylistWindow::closeEvent( TQCloseEvent *e ) { #ifdef Q_WS_MAC Q_UNUSED( e ); @@ -810,7 +810,7 @@ void PlaylistWindow::closeEvent( QCloseEvent *e ) } -void PlaylistWindow::showEvent( QShowEvent* ) +void PlaylistWindow::showEvent( TQShowEvent* ) { static bool firstTime = true; if( firstTime ) @@ -818,10 +818,10 @@ void PlaylistWindow::showEvent( QShowEvent* ) firstTime = false; } -#include -QSize PlaylistWindow::sizeHint() const +#include +TQSize PlaylistWindow::sizeHint() const { - return QApplication::desktop()->screenGeometry( (QWidget*)this ).size() / 1.5; + return TQApplication::desktop()->screenGeometry( (TQWidget*)this ).size() / 1.5; } @@ -833,12 +833,12 @@ void PlaylistWindow::savePlaylist() const //SLOT if( item && !item->isVisible() ) item = static_cast( item->itemBelow() ); - QString title = pl->playlistName(); + TQString title = pl->playlistName(); if( item && title == i18n( "Untitled" ) ) { - QString artist = item->artist(); - QString album = item->album(); + TQString artist = item->artist(); + TQString album = item->album(); bool useArtist = true, useAlbum = true; @@ -863,7 +863,7 @@ void PlaylistWindow::savePlaylist() const //SLOT title = album; } - QString path = PlaylistDialog::getSaveFileName( title, pl->proposeOverwriteOnSave() ); + TQString path = PlaylistDialog::getSaveFileName( title, pl->proposeOverwriteOnSave() ); if( !path.isEmpty() && Playlist::instance()->saveM3U( path ) ) PlaylistWindow::self()->showBrowser( "PlaylistBrowser" ); @@ -887,8 +887,8 @@ void PlaylistWindow::slotAddLocation( bool directPlay ) //SLOT { // open a file selector to add media to the playlist KURL::List files; - //files = KFileDialog::getOpenURLs( QString::null, "*.*|" + i18n("All Files"), this, i18n("Add Media") ); - KFileDialog dlg( QString::null, "*.*|", this, "openMediaDialog", true ); + //files = KFileDialog::getOpenURLs( TQString::null, "*.*|" + i18n("All Files"), this, i18n("Add Media") ); + KFileDialog dlg( TQString::null, "*.*|", this, "openMediaDialog", true ); dlg.setCaption( directPlay ? i18n("Play Media (Files or URLs)") : i18n("Add Media (Files or URLs)") ); dlg.setMode( KFile::Files | KFile::Directory ); dlg.exec(); @@ -908,7 +908,7 @@ void PlaylistWindow::slotAddLocation( bool directPlay ) //SLOT void PlaylistWindow::slotAddStream() //SLOT { bool ok; - QString url = KInputDialog::getText( i18n("Add Stream"), i18n("URL"), QString::null, &ok, this ); + TQString url = KInputDialog::getText( i18n("Add Stream"), i18n("URL"), TQString::null, &ok, this ); if ( !ok ) return; @@ -921,7 +921,7 @@ void PlaylistWindow::playLastfmPersonal() //SLOT { if( !LastFm::Controller::checkCredentials() ) return; - const KURL url( QString( "lastfm://user/%1/personal" ) + const KURL url( TQString( "lastfm://user/%1/personal" ) .arg( AmarokConfig::scrobblerUsername() ) ); Playlist::instance()->insertMedia( url, Playlist::Append|Playlist::DirectPlay ); @@ -932,7 +932,7 @@ void PlaylistWindow::addLastfmPersonal() //SLOT { if( !LastFm::Controller::checkCredentials() ) return; - const KURL url( QString( "lastfm://user/%1/personal" ) + const KURL url( TQString( "lastfm://user/%1/personal" ) .arg( AmarokConfig::scrobblerUsername() ) ); Playlist::instance()->insertMedia( url ); @@ -943,7 +943,7 @@ void PlaylistWindow::playLastfmNeighbor() //SLOT { if( !LastFm::Controller::checkCredentials() ) return; - const KURL url( QString( "lastfm://user/%1/neighbours" ) + const KURL url( TQString( "lastfm://user/%1/neighbours" ) .arg( AmarokConfig::scrobblerUsername() ) ); Playlist::instance()->insertMedia( url, Playlist::Append|Playlist::DirectPlay ); @@ -954,7 +954,7 @@ void PlaylistWindow::addLastfmNeighbor() //SLOT { if( !LastFm::Controller::checkCredentials() ) return; - const KURL url( QString( "lastfm://user/%1/neighbours" ) + const KURL url( TQString( "lastfm://user/%1/neighbours" ) .arg( AmarokConfig::scrobblerUsername() ) ); Playlist::instance()->insertMedia( url ); @@ -963,7 +963,7 @@ void PlaylistWindow::addLastfmNeighbor() //SLOT void PlaylistWindow::playLastfmCustom() //SLOT { - const QString token = LastFm::Controller::createCustomStation(); + const TQString token = LastFm::Controller::createCustomStation(); if( token.isEmpty() ) return; const KURL url( "lastfm://artist/" + token + "/similarartists" ); @@ -973,7 +973,7 @@ void PlaylistWindow::playLastfmCustom() //SLOT void PlaylistWindow::addLastfmCustom() //SLOT { - const QString token = LastFm::Controller::createCustomStation(); + const TQString token = LastFm::Controller::createCustomStation(); if( token.isEmpty() ) return; const KURL url( "lastfm://artist/" + token + "/similarartists" ); @@ -985,7 +985,7 @@ void PlaylistWindow::playLastfmGlobaltag( int id ) //SLOT { if( !LastFm::Controller::checkCredentials() ) return; - const QString tag = m_lastfmTags[id].lower(); + const TQString tag = m_lastfmTags[id].lower(); const KURL url( "lastfm://globaltags/" + tag ); Playlist::instance()->insertMedia( url, Playlist::Append|Playlist::DirectPlay ); @@ -996,7 +996,7 @@ void PlaylistWindow::addLastfmGlobaltag( int id ) //SLOT { if( !LastFm::Controller::checkCredentials() ) return; - const QString tag = m_lastfmTags[id].lower(); + const TQString tag = m_lastfmTags[id].lower(); const KURL url( "lastfm://globaltags/" + tag ); Playlist::instance()->insertMedia( url ); @@ -1006,7 +1006,7 @@ void PlaylistWindow::addLastfmGlobaltag( int id ) //SLOT void PlaylistWindow::playAudioCD() //SLOT { KURL::List urls; - if( EngineController::engine()->getAudioCDContents(QString::null, urls) ) + if( EngineController::engine()->getAudioCDContents(TQString::null, urls) ) { if (!urls.isEmpty()) Playlist::instance()->insertMedia(urls, Playlist::Replace); @@ -1079,7 +1079,7 @@ void PlaylistWindow::slotMenuActivated( int index ) //SLOT case ID_SHOW_PLAYERWINDOW: AmarokConfig::setShowPlayerWindow( !AmarokConfig::showPlayerWindow() ); m_settingsMenu->changeItem( index, AmarokConfig::showPlayerWindow() ? i18n("Hide Player &Window") : i18n("Show Player &Window") ); - QTimer::singleShot( 0, kapp, SLOT( applySettings() ) ); + TQTimer::singleShot( 0, kapp, TQT_SLOT( applySettings() ) ); break; case Amarok::Menu::ID_RESCAN_COLLECTION: CollectionDB::instance()->startScan(); @@ -1187,30 +1187,30 @@ PlaylistWindow::mbAvailabilityChanged( bool isAvailable ) //SLOT ////////////////////////////////////////////////////////////////////////////////////////// /// DynamicBar ////////////////////////////////////////////////////////////////////////////////////////// -DynamicBar::DynamicBar(QWidget* parent) - : QHBox( parent, "DynamicModeStatusBar" ) +DynamicBar::DynamicBar(TQWidget* parent) + : TQHBox( parent, "DynamicModeStatusBar" ) { m_titleWidget = new DynamicTitle(this); setSpacing( KDialog::spacingHint() ); - QWidget *spacer = new QWidget( this ); + TQWidget *spacer = new TQWidget( this ); setStretchFactor( spacer, 10 ); } // necessary because it has to be constructed before Playlist::instance(), but also connect to it void DynamicBar::init() { - connect(Playlist::instance()->qscrollview(), SIGNAL(dynamicModeChanged(const DynamicMode*)), - SLOT(slotNewDynamicMode(const DynamicMode*))); + connect(Playlist::instance()->qscrollview(), TQT_SIGNAL(dynamicModeChanged(const DynamicMode*)), + TQT_SLOT(slotNewDynamicMode(const DynamicMode*))); KPushButton* editDynamicButton = new KPushButton( i18n("Edit"), this, "DynamicModeEdit" ); - connect( editDynamicButton, SIGNAL(clicked()), Playlist::instance()->qscrollview(), SLOT(editActiveDynamicMode()) ); + connect( editDynamicButton, TQT_SIGNAL(clicked()), Playlist::instance()->qscrollview(), TQT_SLOT(editActiveDynamicMode()) ); KPushButton* repopButton = new KPushButton( i18n("Repopulate"), this, "DynamicModeRepopulate" ); - connect( repopButton, SIGNAL(clicked()), Playlist::instance()->qscrollview(), SLOT(repopulate()) ); + connect( repopButton, TQT_SIGNAL(clicked()), Playlist::instance()->qscrollview(), TQT_SLOT(repopulate()) ); KPushButton* disableButton = new KPushButton( i18n("Turn Off"), this, "DynamicModeDisable" ); - connect( disableButton, SIGNAL(clicked()), Playlist::instance()->qscrollview(), SLOT(disableDynamicMode()) ); + connect( disableButton, TQT_SIGNAL(clicked()), Playlist::instance()->qscrollview(), TQT_SLOT(disableDynamicMode()) ); slotNewDynamicMode( Playlist::instance()->dynamicMode() ); } @@ -1222,7 +1222,7 @@ void DynamicBar::slotNewDynamicMode(const DynamicMode* mode) changeTitle(mode->title()); } -void DynamicBar::changeTitle(const QString& title) +void DynamicBar::changeTitle(const TQString& title) { m_titleWidget->setTitle(title); } @@ -1230,31 +1230,31 @@ void DynamicBar::changeTitle(const QString& title) ////////////////////////////////////////////////////////////////////////////////////////// /// DynamicTitle ////////////////////////////////////////////////////////////////////////////////////////// -DynamicTitle::DynamicTitle(QWidget* w) - : QWidget(w, "dynamic title") +DynamicTitle::DynamicTitle(TQWidget* w) + : TQWidget(w, "dynamic title") { m_font.setBold( true ); setTitle(""); } -void DynamicTitle::setTitle(const QString& newTitle) +void DynamicTitle::setTitle(const TQString& newTitle) { m_title = newTitle; - QFontMetrics fm(m_font); + TQFontMetrics fm(m_font); setMinimumWidth( s_curveWidth*3 + fm.width(m_title) + s_imageSize ); setMinimumHeight( fm.height() ); } -void DynamicTitle::paintEvent(QPaintEvent* /*e*/) +void DynamicTitle::paintEvent(TQPaintEvent* /*e*/) { - QPainter p; + TQPainter p; p.begin( this, false ); - QPen pen( colorGroup().highlightedText(), 0, Qt::NoPen ); + TQPen pen( colorGroup().highlightedText(), 0, Qt::NoPen ); p.setPen( pen ); p.setBrush( colorGroup().highlight() ); p.setFont(m_font); - QFontMetrics fm(m_font); + TQFontMetrics fm(m_font); int textHeight = fm.height(); if (textHeight < s_imageSize) textHeight = s_imageSize; @@ -1266,10 +1266,10 @@ void DynamicTitle::paintEvent(QPaintEvent* /*e*/) p.drawEllipse( 0, yStart, s_curveWidth * 2, textHeight); p.drawEllipse( s_curveWidth + textWidth + s_imageSize, yStart, s_curveWidth*2, textHeight); p.fillRect( s_curveWidth, yStart, textWidth + s_imageSize + s_curveWidth, textHeight - , QBrush( colorGroup().highlight()) ); + , TQBrush( colorGroup().highlight()) ); p.drawPixmap( s_curveWidth, yStart + ((textHeight - s_imageSize) /2), SmallIcon("dynamic") ); //not sure why first arg of Rect shouldn't add @curveWidth - p.drawText( QRect(s_imageSize, yStart, s_curveWidth + textWidth +s_imageSize, textHeight), Qt::AlignCenter, m_title); + p.drawText( TQRect(s_imageSize, yStart, s_curveWidth + textWidth +s_imageSize, textHeight), Qt::AlignCenter, m_title); } #include "playlistwindow.moc" diff --git a/amarok/src/playlistwindow.h b/amarok/src/playlistwindow.h index 243d618e..7f04cb8b 100644 --- a/amarok/src/playlistwindow.h +++ b/amarok/src/playlistwindow.h @@ -18,19 +18,19 @@ #include "browserbar.h" -#include //baseclass for DynamicBox -#include //baseclass +#include //baseclass for DynamicBox +#include //baseclass #include //baseclass (for XMLGUI) class ClickLineEdit; class CollectionBrowser; class ContextBrowser; class MediaBrowser; -class QMenuBar; +class TQMenuBar; class KPopupMenu; class KToolBar; -class QLabel; -class QTimer; +class TQLabel; +class TQTimer; /** * @class PlaylistWindow @@ -38,7 +38,7 @@ class QTimer; * * This is the main window widget (the Playlist not Player). */ -class PlaylistWindow : public QWidget, public KXMLGUIClient +class PlaylistWindow : public TQWidget, public KXMLGUIClient { Q_OBJECT @@ -53,13 +53,13 @@ class PlaylistWindow : public QWidget, public KXMLGUIClient void recreateGUI(); //allows us to switch browsers from within other browsers etc - void showBrowser( const QString& name ) { m_browsers->showBrowser( name ); } - void addBrowser( const QString &name, QWidget *widget, const QString &text, const QString &icon ); + void showBrowser( const TQString& name ) { m_browsers->showBrowser( name ); } + void addBrowser( const TQString &name, TQWidget *widget, const TQString &text, const TQString &icon ); //takes into account minimized, multiple desktops, etc. bool isReallyShown() const; - virtual bool eventFilter( QObject*, QEvent* ); + virtual bool eventFilter( TQObject*, TQEvent* ); //instance is declared in KXMLGUI static PlaylistWindow *self() { return s_instance; } @@ -94,25 +94,25 @@ class PlaylistWindow : public QWidget, public KXMLGUIClient void slotToggleMenu(); void slotToggleFocus(); void slotEditFilter(); - void slotSetFilter( const QString &filter ); + void slotSetFilter( const TQString &filter ); protected: - virtual void closeEvent( QCloseEvent* ); - virtual void showEvent( QShowEvent* ); - virtual QSize sizeHint() const; + virtual void closeEvent( TQCloseEvent* ); + virtual void showEvent( TQShowEvent* ); + virtual TQSize sizeHint() const; private: enum MenuId { ID_SHOW_TOOLBAR = 2000, ID_SHOW_PLAYERWINDOW }; - QMenuBar *m_menubar; + TQMenuBar *m_menubar; KPopupMenu *m_toolsMenu; KPopupMenu *m_settingsMenu; BrowserBar *m_browsers; KPopupMenu *m_searchMenu; ClickLineEdit *m_lineEdit; KToolBar *m_toolbar; - QTimer *m_timer; //search filter timer - QStringList m_lastfmTags; + TQTimer *m_timer; //search filter timer + TQStringList m_lastfmTags; MediaBrowser *m_currMediaBrowser; int m_lastBrowser; @@ -125,29 +125,29 @@ class DynamicTitle : public QWidget { Q_OBJECT public: - DynamicTitle( QWidget* parent ); - void setTitle( const QString& newTitle ); + DynamicTitle( TQWidget* parent ); + void setTitle( const TQString& newTitle ); protected: - virtual void paintEvent( QPaintEvent* e ); + virtual void paintEvent( TQPaintEvent* e ); private: static const int s_curveWidth = 5; static const int s_imageSize = 16; - QString m_title; - QFont m_font; + TQString m_title; + TQFont m_font; }; class DynamicBar : public QHBox { Q_OBJECT public: - DynamicBar( QWidget* parent ); + DynamicBar( TQWidget* parent ); void init(); public slots: void slotNewDynamicMode( const DynamicMode* mode ); - void changeTitle( const QString& title ); + void changeTitle( const TQString& title ); private: DynamicTitle* m_titleWidget; diff --git a/amarok/src/plugin/plugin.cpp b/amarok/src/plugin/plugin.cpp index 0d305f0e..5a1d98c6 100644 --- a/amarok/src/plugin/plugin.cpp +++ b/amarok/src/plugin/plugin.cpp @@ -16,14 +16,14 @@ Plugin::~Plugin() void -Plugin::addPluginProperty( const QString& key, const QString& value ) +Plugin::addPluginProperty( const TQString& key, const TQString& value ) { m_properties[key.lower()] = value; } QString -Plugin::pluginProperty( const QString& key ) +Plugin::pluginProperty( const TQString& key ) { if ( m_properties.find( key.lower() ) == m_properties.end() ) return "false"; @@ -33,7 +33,7 @@ Plugin::pluginProperty( const QString& key ) bool -Plugin::hasPluginProperty( const QString& key ) +Plugin::hasPluginProperty( const TQString& key ) { return m_properties.find( key.lower() ) != m_properties.end(); } diff --git a/amarok/src/plugin/plugin.h b/amarok/src/plugin/plugin.h index 2d905676..b10948c7 100644 --- a/amarok/src/plugin/plugin.h +++ b/amarok/src/plugin/plugin.h @@ -12,10 +12,10 @@ KDE_EXPORT Amarok::Plugin* create_plugin() { return new classname; } \ } -#include -#include +#include +#include -class QWidget; +class TQWidget; namespace Amarok { @@ -30,18 +30,18 @@ namespace Amarok * TODO @param parent you must parent the widget to parent * @return the configure widget for your plugin, create it on the heap! */ - //TODO rename configureWidget( QWidget *parent ) + //TODO rename configureWidget( TQWidget *parent ) virtual PluginConfig* configure() const { return 0; } - void addPluginProperty( const QString& key, const QString& value ); - QString pluginProperty( const QString& key ); - bool hasPluginProperty( const QString& key ); + void addPluginProperty( const TQString& key, const TQString& value ); + TQString pluginProperty( const TQString& key ); + bool hasPluginProperty( const TQString& key ); protected: Plugin(); private: - QMap m_properties; + TQMap m_properties; }; } //namespace Amarok diff --git a/amarok/src/plugin/pluginconfig.h b/amarok/src/plugin/pluginconfig.h index 477f55cc..ccc182c5 100644 --- a/amarok/src/plugin/pluginconfig.h +++ b/amarok/src/plugin/pluginconfig.h @@ -4,9 +4,9 @@ #ifndef AMAROK_PLUGINCONFIG_H #define AMAROK_PLUGINCONFIG_H -#include +#include -class QWidget; +class TQWidget; namespace Amarok { @@ -29,7 +29,7 @@ namespace Amarok /** Return the view widget, * The PluginConfig object owns this pointer, nobody else will delete it for you */ - virtual QWidget* view() = 0; + virtual TQWidget* view() = 0; /** Return true if any of the view settings are different to the currently saved state */ virtual bool hasChanged() const = 0; diff --git a/amarok/src/pluginmanager.cpp b/amarok/src/pluginmanager.cpp index 4398e1ea..472a2510 100644 --- a/amarok/src/pluginmanager.cpp +++ b/amarok/src/pluginmanager.cpp @@ -21,8 +21,8 @@ email : markey@web.de #include -#include -#include +#include +#include #include #include @@ -41,12 +41,12 @@ PluginManager::m_store; ///////////////////////////////////////////////////////////////////////////////////// KTrader::OfferList -PluginManager::query( const QString& constraint ) +PluginManager::query( const TQString& constraint ) { // Add versioning constraint QString str = "[X-KDE-Amarok-framework-version] == "; - str += QString::number( FrameworkVersion ); + str += TQString::number( FrameworkVersion ); if ( !constraint.stripWhiteSpace().isEmpty() ) str += " and " + constraint; str += " and "; @@ -59,7 +59,7 @@ PluginManager::query( const QString& constraint ) Plugin* -PluginManager::createFromQuery( const QString &constraint ) +PluginManager::createFromQuery( const TQString &constraint ) { Debug::Block block( __PRETTY_FUNCTION__ ); @@ -90,7 +90,7 @@ PluginManager::createFromService( const KService::Ptr service ) //get the library loader instance KLibLoader *loader = KLibLoader::self(); //try to load the specified library - KLibrary *lib = loader->globalLibrary( QFile::encodeName( service->library() ) ); + KLibrary *lib = loader->globalLibrary( TQFile::encodeName( service->library() ) ); if ( !lib ) { KMessageBox::error( 0, i18n( "

        KLibLoader could not load the plugin:
        %1

        " @@ -161,7 +161,7 @@ PluginManager::getService( const Plugin* plugin ) void -PluginManager::showAbout( const QString &constraint ) +PluginManager::showAbout( const TQString &constraint ) { KTrader::OfferList offers = query( constraint ); @@ -170,9 +170,9 @@ PluginManager::showAbout( const QString &constraint ) KService::Ptr s = offers.front(); - const QString body = "
        "; + const TQString body = ""; - QString str = "
        %1%2
        %1%2
        "; + TQString str = "
        "; str += body.arg( i18n( "Name" ), s->name() ); str += body.arg( i18n( "Library" ), s->library() ); diff --git a/amarok/src/pluginmanager.h b/amarok/src/pluginmanager.h index 787829e2..861c0b8e 100644 --- a/amarok/src/pluginmanager.h +++ b/amarok/src/pluginmanager.h @@ -47,22 +47,22 @@ class PluginManager * The keys used in the query (Type, ServiceType, Exec) are all * fields found in the .desktop files. * - * @param constraint A constraint to limit the choices returned, QString::null to + * @param constraint A constraint to limit the choices returned, TQString::null to * get all services of the given @p servicetype * * @return A list of services that satisfy the query * @see http://developer.kde.org/documentation/library/kdeqt/tradersyntax.html */ - static KTrader::OfferList query( const QString& constraint = QString::null ); + static KTrader::OfferList query( const TQString& constraint = TQString::null ); /** * Load and instantiate plugin from query - * @param constraint A constraint to limit the choices returned, QString::null to + * @param constraint A constraint to limit the choices returned, TQString::null to * get all services of the given @p servicetype * @return Pointer to Plugin, or NULL if error * @see http://developer.kde.org/documentation/library/kdeqt/tradersyntax.html */ - static Amarok::Plugin* createFromQuery( const QString& constraint = QString::null ); + static Amarok::Plugin* createFromQuery( const TQString& constraint = TQString::null ); /** * Load and instantiate plugin from service @@ -94,7 +94,7 @@ class PluginManager * Show modal info dialog about plugin * @param constraint A constraint to limit the choices returned */ - static void showAbout( const QString& constraint ); + static void showAbout( const TQString& constraint ); private: struct StoreItem { diff --git a/amarok/src/podcastbundle.h b/amarok/src/podcastbundle.h index 704f022a..f1e4fbe1 100644 --- a/amarok/src/podcastbundle.h +++ b/amarok/src/podcastbundle.h @@ -7,7 +7,7 @@ #include "podcastsettings.h" #include #include -#include +#include class PodcastChannelBundle { @@ -20,8 +20,8 @@ class PodcastChannelBundle , m_purge( false ) , m_purgeCount( -1 ) { } - PodcastChannelBundle( const KURL &url, const QString &title, const QString &author, const KURL &link, - const QString &desc, const QString ©, PodcastSettings *settings ) + PodcastChannelBundle( const KURL &url, const TQString &title, const TQString &author, const KURL &link, + const TQString &desc, const TQString ©, PodcastSettings *settings ) { m_url = url; m_title = title; m_author = author; @@ -51,28 +51,28 @@ class PodcastChannelBundle /// Return the url of the podcast feed const KURL &url() const; /// The title of the Podcast channel - const QString &title() const; + const TQString &title() const; /// The author of the Podcast channel - const QString &author() const; + const TQString &author() const; /// A url to the webpage of the podcast const KURL &link() const; /// A url to the image of the podcast const KURL &imageURL() const; - const QString &description() const; - const QString ©right() const; + const TQString &description() const; + const TQString ©right() const; /// The id which the parent folder has in the database int parentId() const; void setURL( const KURL &u ); - void setTitle( const QString &t ); - void setAuthor( const QString &a ); + void setTitle( const TQString &t ); + void setAuthor( const TQString &a ); void setLink( const KURL &l ); void setImageURL( const KURL &i ); - void setDescription( const QString &d ); - void setCopyright( const QString &c ); + void setDescription( const TQString &d ); + void setCopyright( const TQString &c ); void setParentId( const int p ); - void setSaveLocation( const QString &s ); + void setSaveLocation( const TQString &s ); void setAutoScan( const bool b ); void setFetchType( const int i ); void setAutoTransfer( const bool b ); @@ -80,7 +80,7 @@ class PodcastChannelBundle void setPurgeCount( const int i ); //settings - const QString& saveLocation() const; + const TQString& saveLocation() const; bool autoscan() const; int fetchType() const; bool autotransfer() const; @@ -89,15 +89,15 @@ class PodcastChannelBundle private: KURL m_url; - QString m_title; - QString m_author; + TQString m_title; + TQString m_author; KURL m_link; KURL m_imageUrl; - QString m_description; - QString m_copyright; + TQString m_description; + TQString m_copyright; int m_parentId; - QString m_saveLocation; + TQString m_saveLocation; bool m_autoscan; int m_fetchType; bool m_autotransfer; @@ -106,31 +106,31 @@ class PodcastChannelBundle }; inline const KURL &PodcastChannelBundle::url() const { return m_url; } -inline const QString &PodcastChannelBundle::title() const { return m_title; } -inline const QString &PodcastChannelBundle::author() const { return m_author; } +inline const TQString &PodcastChannelBundle::title() const { return m_title; } +inline const TQString &PodcastChannelBundle::author() const { return m_author; } inline const KURL &PodcastChannelBundle::link() const { return m_link; } inline const KURL &PodcastChannelBundle::imageURL() const { return m_imageUrl; } -inline const QString &PodcastChannelBundle::description() const { return m_description; } -inline const QString &PodcastChannelBundle::copyright() const { return m_copyright; } +inline const TQString &PodcastChannelBundle::description() const { return m_description; } +inline const TQString &PodcastChannelBundle::copyright() const { return m_copyright; } inline int PodcastChannelBundle::parentId() const { return m_parentId; } inline void PodcastChannelBundle::setURL ( const KURL &u ) { m_url = u; } -inline void PodcastChannelBundle::setTitle ( const QString &t ) { m_title = t; } -inline void PodcastChannelBundle::setAuthor ( const QString &a ) { m_author = a; } +inline void PodcastChannelBundle::setTitle ( const TQString &t ) { m_title = t; } +inline void PodcastChannelBundle::setAuthor ( const TQString &a ) { m_author = a; } inline void PodcastChannelBundle::setLink ( const KURL &l ) { m_link = l; } inline void PodcastChannelBundle::setImageURL ( const KURL &i ) { m_imageUrl = i; } -inline void PodcastChannelBundle::setDescription ( const QString &d ) { m_description = d; } -inline void PodcastChannelBundle::setCopyright ( const QString &c ) { m_copyright = c; } +inline void PodcastChannelBundle::setDescription ( const TQString &d ) { m_description = d; } +inline void PodcastChannelBundle::setCopyright ( const TQString &c ) { m_copyright = c; } inline void PodcastChannelBundle::setParentId ( const int p ) { m_parentId = p; } -inline void PodcastChannelBundle::setSaveLocation( const QString &s ) { m_saveLocation = s; } +inline void PodcastChannelBundle::setSaveLocation( const TQString &s ) { m_saveLocation = s; } inline void PodcastChannelBundle::setAutoScan( const bool b ) { m_autoscan = b; } inline void PodcastChannelBundle::setFetchType( const int i ) { m_fetchType = i; } inline void PodcastChannelBundle::setAutoTransfer( const bool b ) { m_autotransfer = b; } inline void PodcastChannelBundle::setPurge( const bool b ) { m_purge = b; } inline void PodcastChannelBundle::setPurgeCount( const int i ) { m_purgeCount = i; } -inline const QString &PodcastChannelBundle::saveLocation() const { return m_saveLocation; } +inline const TQString &PodcastChannelBundle::saveLocation() const { return m_saveLocation; } inline bool PodcastChannelBundle::autoscan() const { return m_autoscan; } inline int PodcastChannelBundle::fetchType() const { return m_fetchType; } inline bool PodcastChannelBundle::autotransfer() const { return m_autotransfer; } @@ -149,9 +149,9 @@ class PodcastEpisodeBundle , m_isNew( false ) { } - PodcastEpisodeBundle( const KURL &url, const KURL &parent, const QString &title, - const QString &author, const QString &desc, const QString &date, - const QString &type, const int duration, const QString &guid, + PodcastEpisodeBundle( const KURL &url, const KURL &parent, const TQString &title, + const TQString &author, const TQString &desc, const TQString &date, + const TQString &type, const int duration, const TQString &guid, const bool isNew ) : m_id( 0 ) , m_size( 0 ) @@ -179,18 +179,18 @@ class PodcastEpisodeBundle const KURL &localUrl() const; /// The url of the podcast channel const KURL &parent() const; - const QString &author() const; - const QString &title() const; - const QString &subtitle() const; - const QString &description() const; - const QString &date() const; - QDateTime dateTime() const; + const TQString &author() const; + const TQString &title() const; + const TQString &subtitle() const; + const TQString &description() const; + const TQString &date() const; + TQDateTime dateTime() const; /// File type of the podcast episode, eg ogg, mp3 etc - const QString &type() const; + const TQString &type() const; int duration() const; // duration in seconds uint size() const; // file/stream size in bytes /// unique identifier that should be available in the feed (RSS 2.0: guid ATOM: id) - const QString &guid() const; + const TQString &guid() const; /// Has this particular podcast episode been listened to? bool isNew() const; @@ -198,34 +198,34 @@ class PodcastEpisodeBundle void setURL( const KURL &u ); void setLocalURL( const KURL &u ); void setParent( const KURL &u ); - void setAuthor( const QString &a ); - void setTitle( const QString &t ); - void setSubtitle( const QString &s ); - void setDescription( const QString &d ); - void setDate( const QString &d ); - void setType( const QString &t ); + void setAuthor( const TQString &a ); + void setTitle( const TQString &t ); + void setSubtitle( const TQString &s ); + void setDescription( const TQString &d ); + void setDate( const TQString &d ); + void setType( const TQString &t ); void setDuration( const int i ); void setSize( const uint i ); - void setGuid( const QString &g ); + void setGuid( const TQString &g ); void setNew( const bool &b ); - void detach(); // for being able to apply QDeepCopy<> + void detach(); // for being able to apply TQDeepCopy<> private: int m_id; KURL m_url; KURL m_localUrl; KURL m_parent; - QString m_author; - QString m_title; - QString m_subtitle; - QString m_description; - QString m_date; - QDateTime m_dateTime; - QString m_type; + TQString m_author; + TQString m_title; + TQString m_subtitle; + TQString m_description; + TQString m_date; + TQDateTime m_dateTime; + TQString m_type; int m_duration; uint m_size; - QString m_guid; + TQString m_guid; bool m_isNew; }; @@ -233,32 +233,32 @@ inline int PodcastEpisodeBundle::dBId() const { return m_id; } inline const KURL &PodcastEpisodeBundle::url() const { return m_url; } inline const KURL &PodcastEpisodeBundle::localUrl() const { return m_localUrl; } inline const KURL &PodcastEpisodeBundle::parent() const { return m_parent; } -inline const QString &PodcastEpisodeBundle::author() const { return m_author; } -inline const QString &PodcastEpisodeBundle::title() const { return m_title; } -inline const QString &PodcastEpisodeBundle::subtitle() const { return m_subtitle; } -inline const QString &PodcastEpisodeBundle::description() const { return m_description; } -inline const QString &PodcastEpisodeBundle::date() const { return m_date; } -inline QDateTime PodcastEpisodeBundle::dateTime() const { return m_dateTime; } -inline const QString &PodcastEpisodeBundle::type() const { return m_type; } +inline const TQString &PodcastEpisodeBundle::author() const { return m_author; } +inline const TQString &PodcastEpisodeBundle::title() const { return m_title; } +inline const TQString &PodcastEpisodeBundle::subtitle() const { return m_subtitle; } +inline const TQString &PodcastEpisodeBundle::description() const { return m_description; } +inline const TQString &PodcastEpisodeBundle::date() const { return m_date; } +inline TQDateTime PodcastEpisodeBundle::dateTime() const { return m_dateTime; } +inline const TQString &PodcastEpisodeBundle::type() const { return m_type; } inline int PodcastEpisodeBundle::duration() const { return m_duration; } inline uint PodcastEpisodeBundle::size() const { return m_size; } -inline const QString &PodcastEpisodeBundle::guid() const { return m_guid; } +inline const TQString &PodcastEpisodeBundle::guid() const { return m_guid; } inline bool PodcastEpisodeBundle::isNew() const { return m_isNew; } inline void PodcastEpisodeBundle::setDBId( const int i ) { m_id = i; } inline void PodcastEpisodeBundle::setURL( const KURL &u ) { m_url = u; } inline void PodcastEpisodeBundle::setLocalURL( const KURL &u ) { m_localUrl = u; } inline void PodcastEpisodeBundle::setParent( const KURL &u ) { m_parent = u; } -inline void PodcastEpisodeBundle::setAuthor( const QString &a ) { m_author = a; } -inline void PodcastEpisodeBundle::setTitle( const QString &t ) { m_title = t; } -inline void PodcastEpisodeBundle::setSubtitle( const QString &t ) { m_subtitle = t; } -inline void PodcastEpisodeBundle::setDescription( const QString &d ) { m_description = d; } -inline void PodcastEpisodeBundle::setDate( const QString &d ) +inline void PodcastEpisodeBundle::setAuthor( const TQString &a ) { m_author = a; } +inline void PodcastEpisodeBundle::setTitle( const TQString &t ) { m_title = t; } +inline void PodcastEpisodeBundle::setSubtitle( const TQString &t ) { m_subtitle = t; } +inline void PodcastEpisodeBundle::setDescription( const TQString &d ) { m_description = d; } +inline void PodcastEpisodeBundle::setDate( const TQString &d ) { m_date = d; if( !d.isEmpty() ) m_dateTime.setTime_t( KRFCDate::parseDate( d ) );} -inline void PodcastEpisodeBundle::setType( const QString &t ) { m_type = t; } +inline void PodcastEpisodeBundle::setType( const TQString &t ) { m_type = t; } inline void PodcastEpisodeBundle::setDuration( const int i ) { m_duration = i; } inline void PodcastEpisodeBundle::setSize( const uint i ) { m_size = i; } -inline void PodcastEpisodeBundle::setGuid( const QString &g ) { m_guid = g; } +inline void PodcastEpisodeBundle::setGuid( const TQString &g ) { m_guid = g; } inline void PodcastEpisodeBundle::setNew( const bool &b ) { m_isNew = b; } #endif /* AMAROK_PODCASTBUNDLE_H */ diff --git a/amarok/src/podcastsettings.cpp b/amarok/src/podcastsettings.cpp index 4ee5af19..298486a1 100644 --- a/amarok/src/podcastsettings.cpp +++ b/amarok/src/podcastsettings.cpp @@ -14,12 +14,12 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include -PodcastSettings::PodcastSettings( const QDomNode &channelSettings, const QString &title ) +PodcastSettings::PodcastSettings( const TQDomNode &channelSettings, const TQString &title ) : m_title( title ) { m_saveLocation = channelSettings.namedItem( "savelocation").toElement().text(); @@ -31,7 +31,7 @@ PodcastSettings::PodcastSettings( const QDomNode &channelSettings, const QString } // default settings -PodcastSettings::PodcastSettings( const QString &title ) +PodcastSettings::PodcastSettings( const TQString &title ) : m_title( title ) { m_saveLocation = Amarok::saveLocation( "podcasts/" ); @@ -43,7 +43,7 @@ PodcastSettings::PodcastSettings( const QString &title ) m_purgeCount = 0; } -PodcastSettings::PodcastSettings( const QString &title, const QString &save, const bool autoScan, +PodcastSettings::PodcastSettings( const TQString &title, const TQString &save, const bool autoScan, const int fetchType, const bool autotransfer, const bool purge, const int purgecount ) { m_title = title; @@ -62,7 +62,7 @@ PodcastSettings::PodcastSettings( const QString &title, const QString &save, con m_purgeCount = purgecount; } -PodcastSettingsDialog::PodcastSettingsDialog( PodcastSettings *settings, QWidget* parent ) +PodcastSettingsDialog::PodcastSettingsDialog( PodcastSettings *settings, TQWidget* parent ) : KDialogBase( parent, 0, true, i18n("change options", "Configure %1").arg( settings->m_title ) , KDialogBase::User1|KDialogBase::Ok|KDialogBase::Cancel , KDialogBase::Ok, true @@ -73,7 +73,7 @@ PodcastSettingsDialog::PodcastSettingsDialog( PodcastSettings *settings, QWidget setSettings( settings ); } -PodcastSettingsDialog::PodcastSettingsDialog( const QPtrList &list, const QString &caption, QWidget* parent ) +PodcastSettingsDialog::PodcastSettingsDialog( const TQPtrList &list, const TQString &caption, TQWidget* parent ) : KDialogBase( parent, 0, true, i18n("change options", "Configure %1").arg( caption ) , KDialogBase::User1|KDialogBase::Ok|KDialogBase::Cancel , KDialogBase::Ok, true @@ -102,13 +102,13 @@ PodcastSettingsDialog::init() enableButtonOK( false ); // Connects for modification check - connect( m_ps->m_purgeCountSpinBox->child( "qt_spinbox_edit" ), SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); - connect( m_ps->m_saveLocation, SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); - connect( m_ps->m_autoFetchCheck, SIGNAL(clicked()), SLOT(checkModified()) ); - connect( m_ps->m_streamRadio, SIGNAL(clicked()), SLOT(checkModified()) ); - connect( m_ps->m_addToMediaDeviceCheck, SIGNAL(clicked()), SLOT(checkModified()) ); - connect( m_ps->m_downloadRadio, SIGNAL(clicked()), SLOT(checkModified()) ); - connect( m_ps->m_purgeCheck, SIGNAL(clicked()), SLOT(checkModified()) ); + connect( m_ps->m_purgeCountSpinBox->child( "qt_spinbox_edit" ), TQT_SIGNAL(textChanged( const TQString& )), TQT_SLOT(checkModified()) ); + connect( m_ps->m_saveLocation, TQT_SIGNAL(textChanged( const TQString& )), TQT_SLOT(checkModified()) ); + connect( m_ps->m_autoFetchCheck, TQT_SIGNAL(clicked()), TQT_SLOT(checkModified()) ); + connect( m_ps->m_streamRadio, TQT_SIGNAL(clicked()), TQT_SLOT(checkModified()) ); + connect( m_ps->m_addToMediaDeviceCheck, TQT_SIGNAL(clicked()), TQT_SLOT(checkModified()) ); + connect( m_ps->m_downloadRadio, TQT_SIGNAL(clicked()), TQT_SLOT(checkModified()) ); + connect( m_ps->m_purgeCheck, TQT_SIGNAL(clicked()), TQT_SLOT(checkModified()) ); } bool @@ -141,7 +141,7 @@ void PodcastSettingsDialog::slotOk() //slot if ( !m_settingsList.isEmpty() ) { - foreachType( QPtrList, m_settingsList) + foreachType( TQPtrList, m_settingsList) { (*it)->m_saveLocation = requesterSaveLocation().append( Amarok::vfatPath( (*it)->title() ) ); (*it)->m_autoScan = m_ps->m_autoFetchCheck->isChecked(); @@ -172,9 +172,9 @@ void PodcastSettingsDialog::slotOk() //slot } // KUrlRequester doesn't provide us with convenient functions for adding trailing slashes -QString PodcastSettingsDialog::requesterSaveLocation() +TQString PodcastSettingsDialog::requesterSaveLocation() { - QString url = m_ps->m_saveLocation->url(); + TQString url = m_ps->m_saveLocation->url(); if( url.endsWith( "/" ) ) return url; else @@ -183,7 +183,7 @@ QString PodcastSettingsDialog::requesterSaveLocation() void PodcastSettingsDialog::setSettings( PodcastSettings *settings ) { - QString saveLocation = settings->m_saveLocation; + TQString saveLocation = settings->m_saveLocation; m_ps->m_saveLocation->setURL( saveLocation ); m_ps->m_autoFetchCheck->setChecked( settings->m_autoScan ); @@ -219,7 +219,7 @@ void PodcastSettingsDialog::slotUser1() //slot bool PodcastSettingsDialog::configure() { - return exec() == QDialog::Accepted; + return exec() == TQDialog::Accepted; } #include "podcastsettings.moc" diff --git a/amarok/src/podcastsettings.h b/amarok/src/podcastsettings.h index 7bb65cc0..0e5b8b80 100644 --- a/amarok/src/podcastsettings.h +++ b/amarok/src/podcastsettings.h @@ -8,35 +8,35 @@ #include -#include +#include class PodcastChannel; class PodcastEpisode; class PodcastSettingsDialogBase; -class QDomNode; -class QDomElement; +class TQDomNode; +class TQDomElement; enum MediaFetch{ STREAM=0, AUTOMATIC=1 }; class PodcastSettings { public: - PodcastSettings( const QDomNode &channelSettings, const QString &title ); - PodcastSettings( const PodcastSettings *parentSettings, const QString &title ); - PodcastSettings( const QString &title ); // standard settings - PodcastSettings( const QString &title, const QString &save, const bool autoScan, + PodcastSettings( const TQDomNode &channelSettings, const TQString &title ); + PodcastSettings( const PodcastSettings *parentSettings, const TQString &title ); + PodcastSettings( const TQString &title ); // standard settings + PodcastSettings( const TQString &title, const TQString &save, const bool autoScan, const int fetchType, const bool autotransfer, const bool purge, const int purgecount ); - const QString &saveLocation() { return m_saveLocation; } - const QString &title() { return m_title; } + const TQString &saveLocation() { return m_saveLocation; } + const TQString &title() { return m_title; } bool autoscan() { return m_autoScan; } int fetchType() { return m_fetch; } bool autoTransfer() { return m_addToMediaDevice; } bool hasPurge() { return m_purge; } int purgeCount() { return m_purgeCount; } - QString m_title; //the title of the podcast or category these settings belong to - QString m_saveLocation; + TQString m_title; //the title of the podcast or category these settings belong to + TQString m_saveLocation; bool m_autoScan; int m_fetch; bool m_addToMediaDevice; @@ -50,8 +50,8 @@ class PodcastSettingsDialog : public KDialogBase Q_OBJECT public: - PodcastSettingsDialog( PodcastSettings *list, QWidget* parent=0 ); - PodcastSettingsDialog( const QPtrList &list, const QString &caption, QWidget* parent=0 ); + PodcastSettingsDialog( PodcastSettings *list, TQWidget* parent=0 ); + PodcastSettingsDialog( const TQPtrList &list, const TQString &caption, TQWidget* parent=0 ); bool configure(); PodcastSettings *getSettings() { return m_settings; } @@ -67,10 +67,10 @@ class PodcastSettingsDialog : public KDialogBase private: void init(); void setSettings( PodcastSettings *settings ); - QString requesterSaveLocation(); + TQString requesterSaveLocation(); PodcastSettingsDialogBase *m_ps; - QPtrList m_settingsList; + TQPtrList m_settingsList; PodcastSettings *m_settings; }; diff --git a/amarok/src/prettypopupmenu.cpp b/amarok/src/prettypopupmenu.cpp index 799cc693..7cb3b745 100644 --- a/amarok/src/prettypopupmenu.cpp +++ b/amarok/src/prettypopupmenu.cpp @@ -20,9 +20,9 @@ #include "prettypopupmenu.h" -#include -#include -#include +#include +#include +#include #include #include @@ -30,14 +30,14 @@ #include -QImage PrettyPopupMenu::s_sidePixmap; -QColor PrettyPopupMenu::s_sidePixmapColor; +TQImage PrettyPopupMenu::s_sidePixmap; +TQColor PrettyPopupMenu::s_sidePixmapColor; //////////////////////////////////////////////////////////////////////////////// // public //////////////////////////////////////////////////////////////////////////////// -PrettyPopupMenu::PrettyPopupMenu( QWidget* parent, const char* name ) +PrettyPopupMenu::PrettyPopupMenu( TQWidget* parent, const char* name ) : KPopupMenu( parent, name ) { // Must be initialized so that we know the size on first invocation @@ -53,7 +53,7 @@ PrettyPopupMenu::PrettyPopupMenu( QWidget* parent, const char* name ) void PrettyPopupMenu::generateSidePixmap() { - const QColor newColor = calcPixmapColor(); + const TQColor newColor = calcPixmapColor(); if ( newColor != s_sidePixmapColor ) { s_sidePixmapColor = newColor; @@ -65,7 +65,7 @@ PrettyPopupMenu::generateSidePixmap() QRect PrettyPopupMenu::sideImageRect() const { - return QStyle::visualRect( QRect( frameWidth(), frameWidth(), s_sidePixmap.width(), + return TQStyle::visualRect( TQRect( frameWidth(), frameWidth(), s_sidePixmap.width(), height() - 2*frameWidth() ), this ); } @@ -74,17 +74,17 @@ PrettyPopupMenu::calcPixmapColor() { KConfig *config = KGlobal::config(); config->setGroup("WM"); - QColor color = QApplication::palette().active().highlight(); -// QColor activeTitle = QApplication::palette().active().background(); -// QColor inactiveTitle = QApplication::palette().inactive().background(); - QColor activeTitle = config->readColorEntry("activeBackground", &color); - QColor inactiveTitle = config->readColorEntry("inactiveBackground", &color); + TQColor color = TQApplication::palette().active().highlight(); +// TQColor activeTitle = TQApplication::palette().active().background(); +// TQColor inactiveTitle = TQApplication::palette().inactive().background(); + TQColor activeTitle = config->readColorEntry("activeBackground", &color); + TQColor inactiveTitle = config->readColorEntry("inactiveBackground", &color); // figure out which color is most suitable for recoloring to int h1, s1, v1, h2, s2, v2, h3, s3, v3; activeTitle.hsv(&h1, &s1, &v1); inactiveTitle.hsv(&h2, &s2, &v2); - QApplication::palette().active().background().hsv(&h3, &s3, &v3); + TQApplication::palette().active().background().hsv(&h3, &s3, &v3); if ( (kAbs(h1-h3)+kAbs(s1-s3)+kAbs(v1-v3) < kAbs(h2-h3)+kAbs(s2-s3)+kAbs(v2-v3)) && ((kAbs(h1-h3)+kAbs(s1-s3)+kAbs(v1-v3) < 32) || (s1 < 32)) && (s2 > s1)) @@ -111,13 +111,13 @@ PrettyPopupMenu::calcPixmapColor() } void -PrettyPopupMenu::setMinimumSize(const QSize & s) +PrettyPopupMenu::setMinimumSize(const TQSize & s) { KPopupMenu::setMinimumSize(s.width() + s_sidePixmap.width(), s.height()); } void -PrettyPopupMenu::setMaximumSize(const QSize & s) +PrettyPopupMenu::setMaximumSize(const TQSize & s) { KPopupMenu::setMaximumSize(s.width() + s_sidePixmap.width(), s.height()); } @@ -134,11 +134,11 @@ PrettyPopupMenu::setMaximumSize(int w, int h) KPopupMenu::setMaximumSize(w + s_sidePixmap.width(), h); } -void PrettyPopupMenu::resizeEvent(QResizeEvent * e) +void PrettyPopupMenu::resizeEvent(TQResizeEvent * e) { KPopupMenu::resizeEvent( e ); - setFrameRect( QStyle::visualRect( QRect( s_sidePixmap.width(), 0, + setFrameRect( TQStyle::visualRect( TQRect( s_sidePixmap.width(), 0, width() - s_sidePixmap.width(), height() ), this ) ); } @@ -150,18 +150,18 @@ void PrettyPopupMenu::resize( int width, int height ) } void -PrettyPopupMenu::paintEvent( QPaintEvent* e ) +PrettyPopupMenu::paintEvent( TQPaintEvent* e ) { generateSidePixmap(); - QPainter p( this ); + TQPainter p( this ); - QRect r = sideImageRect(); + TQRect r = sideImageRect(); r.setTop( r.bottom() - s_sidePixmap.height() ); if ( r.intersects( e->rect() ) ) { - QRect drawRect = r.intersect( e->rect() ).intersect( sideImageRect() ); - QRect pixRect = drawRect; + TQRect drawRect = r.intersect( e->rect() ).intersect( sideImageRect() ); + TQRect pixRect = drawRect; pixRect.moveBy( -r.left(), -r.top() ); p.drawImage( drawRect.topLeft(), s_sidePixmap, pixRect ); } @@ -174,10 +174,10 @@ PrettyPopupMenu::paintEvent( QPaintEvent* e ) drawContents( &p ); - style().drawPrimitive( QStyle::PE_PanelPopup, &p, - QRect( 0, 0, width(), height() ), - colorGroup(), QStyle::Style_Default, - QStyleOption( frameWidth(), 0 ) ); + style().drawPrimitive( TQStyle::PE_PanelPopup, &p, + TQRect( 0, 0, width(), height() ), + colorGroup(), TQStyle::Style_Default, + TQStyleOption( frameWidth(), 0 ) ); } diff --git a/amarok/src/prettypopupmenu.h b/amarok/src/prettypopupmenu.h index 848188f3..230c7368 100644 --- a/amarok/src/prettypopupmenu.h +++ b/amarok/src/prettypopupmenu.h @@ -23,11 +23,11 @@ #include -#include -#include -#include +#include +#include +#include -class QSize; +class TQSize; /** * @class PrettyPopup @@ -44,7 +44,7 @@ class PrettyPopupMenu : public KPopupMenu Q_OBJECT public: - PrettyPopupMenu( QWidget *parent = 0, const char *name = 0 ); + PrettyPopupMenu( TQWidget *parent = 0, const char *name = 0 ); int sidePixmapWidth() const { return s_sidePixmap.width(); } @@ -52,22 +52,22 @@ class PrettyPopupMenu : public KPopupMenu /** Loads and prepares the sidebar image */ void generateSidePixmap(); /** Returns the available size for the image */ - QRect sideImageRect() const; + TQRect sideImageRect() const; /** Calculates a color that matches the current colorscheme */ - QColor calcPixmapColor(); + TQColor calcPixmapColor(); - void setMinimumSize( const QSize& s ); - void setMaximumSize( const QSize& s ); + void setMinimumSize( const TQSize& s ); + void setMaximumSize( const TQSize& s ); void setMinimumSize( int w, int h ); void setMaximumSize( int w, int h ); - void resizeEvent( QResizeEvent* e ); + void resizeEvent( TQResizeEvent* e ); void resize( int width, int height ); - void paintEvent( QPaintEvent* e ); + void paintEvent( TQPaintEvent* e ); - static QImage s_sidePixmap; - static QColor s_sidePixmapColor; + static TQImage s_sidePixmap; + static TQColor s_sidePixmapColor; }; diff --git a/amarok/src/qstringx.h b/amarok/src/qstringx.h index 81fc1adf..36752fe1 100644 --- a/amarok/src/qstringx.h +++ b/amarok/src/qstringx.h @@ -5,11 +5,11 @@ #ifndef AMAROK_QSTRINGX_H #define AMAROK_QSTRINGX_H -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace Amarok { @@ -18,21 +18,21 @@ class QStringx : public QString { public: QStringx() {}; - QStringx( QChar ch ) : QString( ch ) {}; - QStringx( const QString& s ) : QString( s ) {}; - QStringx( const QByteArray& ba ) : QString( ba ) {}; - QStringx( const QChar* unicode, uint length ) : QString( unicode, length ) {}; - QStringx( const char* str ) : QString( str ) {}; + QStringx( TQChar ch ) : TQString( ch ) {}; + QStringx( const TQString& s ) : TQString( s ) {}; + QStringx( const TQByteArray& ba ) : TQString( ba ) {}; + QStringx( const TQChar* unicode, uint length ) : TQString( unicode, length ) {}; + QStringx( const char* str ) : TQString( str ) {}; virtual ~QStringx() {}; // the numbers following % obviously are not taken into account - QString args( const QStringList& args ) const + TQString args( const TQStringList& args ) const { - const QStringList text = QStringList::split( QRegExp( "%\\d+" ), *this, true ); + const TQStringList text = TQStringList::split( TQRegExp( "%\\d+" ), *this, true ); - QValueListConstIterator itrText = text.begin(); - QValueListConstIterator itrArgs = args.begin(); - QString merged = (*itrText); + TQValueListConstIterator itrText = text.begin(); + TQValueListConstIterator itrArgs = args.begin(); + TQString merged = (*itrText); ++itrText; while ( itrText != text.end() && itrArgs != args.end() ) { @@ -47,24 +47,24 @@ public: } // %something gets replaced by the value corresponding to key "something" in args - QString namedArgs( const QMap args, bool opt=false ) const + TQString namedArgs( const TQMap args, bool opt=false ) const { - QRegExp rxArg( "%[a-zA-Z0-9]+" ); + TQRegExp rxArg( "%[a-zA-Z0-9]+" ); - QString result; + TQString result; int start = 0; for( int pos = rxArg.search( *this ); pos != -1; pos = rxArg.search( *this, start ) ) { int len = rxArg.matchedLength(); - QString p = rxArg.capturedTexts()[0].mid(1, len-1); + TQString p = rxArg.capturedTexts()[0].mid(1, len-1); result += mid( start, pos-start ); - if( args[p] != QString::null ) + if( args[p] != TQString::null ) result += args[p]; else if( opt ) - return QString(); + return TQString(); start = pos + len; } @@ -76,12 +76,12 @@ public: // %something gets replaced by the value corresponding to key "something" in args, // however, if key "something" is not available, // then replace everything within surrounding { } by an empty string - QString namedOptArgs( const QMap args ) const + TQString namedOptArgs( const TQMap args ) const { - QRegExp rxOptArg( "\\{.*%[a-zA-Z0-9_]+.*\\}" ); + TQRegExp rxOptArg( "\\{.*%[a-zA-Z0-9_]+.*\\}" ); rxOptArg.setMinimal( true ); - QString result; + TQString result; int start = 0; for( int pos = rxOptArg.search( *this ); pos != -1; diff --git a/amarok/src/queuemanager.cpp b/amarok/src/queuemanager.cpp index dd2708a6..313a734f 100644 --- a/amarok/src/queuemanager.cpp +++ b/amarok/src/queuemanager.cpp @@ -26,21 +26,21 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include ////////////////////////////////////////////////////////////////////////////////////////// /// CLASS QueueItem ////////////////////////////////////////////////////////////////////////////////////////// void -QueueItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align ) +QueueItem::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align ) { KListViewItem::paintCell( p, cg, column, width, align ); - QString str = QString::number( ( static_cast( listView() ) )->itemIndex( this ) + 1 ); + TQString str = TQString::number( ( static_cast( listView() ) )->itemIndex( this ) + 1 ); //draw the symbol's outline uint fw = p->fontMetrics().width( str ) + 2; @@ -64,12 +64,12 @@ QueueItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, /// CLASS QueueList ////////////////////////////////////////////////////////////////////////////////////////// -QueueList::QueueList( QWidget *parent, const char *name ) +QueueList::QueueList( TQWidget *parent, const char *name ) : KListView( parent, name ) { addColumn( i18n("Name") ); - setResizeMode( QListView::LastColumn ); - setSelectionMode( QListView::Extended ); + setResizeMode( TQListView::LastColumn ); + setSelectionMode( TQListView::Extended ); setSorting( -1 ); setAcceptDrops( true ); @@ -79,14 +79,14 @@ QueueList::QueueList( QWidget *parent, const char *name ) } void -QueueList::viewportPaintEvent( QPaintEvent *e ) +QueueList::viewportPaintEvent( TQPaintEvent *e ) { if( e ) KListView::viewportPaintEvent( e ); if( !childCount() && e ) { - QPainter p( viewport() ); - QString minimumText(i18n( + TQPainter p( viewport() ); + TQString minimumText(i18n( "
        " "

        The Queue Manager

        " "To create a queue, " @@ -94,7 +94,7 @@ QueueList::viewportPaintEvent( QPaintEvent *e ) "drop them here.

        " "Drag and drop tracks within the manager to resort queue orders." "
        " ) ); - QSimpleRichText t( minimumText, QApplication::font() ); + TQSimpleRichText t( minimumText, TQApplication::font() ); if ( t.width()+30 >= viewport()->width() || t.height()+30 >= viewport()->height() ) //too big, giving up @@ -107,12 +107,12 @@ QueueList::viewportPaintEvent( QPaintEvent *e ) p.setBrush( colorGroup().background() ); p.drawRoundRect( x, y, w+30, h+30, (8*200)/w, (8*200)/h ); - t.draw( &p, x+15, y+15, QRect(), colorGroup() ); + t.draw( &p, x+15, y+15, TQRect(), colorGroup() ); } } void -QueueList::keyPressEvent( QKeyEvent *e ) +QueueList::keyPressEvent( TQKeyEvent *e ) { switch( e->key() ) { @@ -133,7 +133,7 @@ QueueList::keyPressEvent( QKeyEvent *e ) bool QueueList::hasSelection() { - QListViewItemIterator it( this, QListViewItemIterator::Selected ); + TQListViewItemIterator it( this, TQListViewItemIterator::Selected ); if( !it.current() ) return false; @@ -141,11 +141,11 @@ QueueList::hasSelection() return true; } -QPtrList +TQPtrList QueueList::selectedItems() { - QPtrList selected; - QListViewItemIterator it( this, QListViewItemIterator::Selected ); + TQPtrList selected; + TQListViewItemIterator it( this, TQListViewItemIterator::Selected ); for( ; it.current(); ++it ) selected.append( it.current() ); @@ -156,17 +156,17 @@ QueueList::selectedItems() void QueueList::moveSelectedUp() // SLOT { - QPtrList selected = selectedItems(); + TQPtrList selected = selectedItems(); bool item_moved = false; // Whilst it would be substantially faster to do this: ((*it)->itemAbove())->move( *it ), // this would only work for sequentially ordered items - for( QListViewItem *item = selected.first(); item; item = selected.next() ) + for( TQListViewItem *item = selected.first(); item; item = selected.next() ) { if( item == itemAtIndex(0) ) continue; - QListViewItem *after; + TQListViewItem *after; item == itemAtIndex(1) ? after = 0: @@ -185,12 +185,12 @@ QueueList::moveSelectedUp() // SLOT void QueueList::moveSelectedDown() // SLOT { - QPtrList list = selectedItems(); + TQPtrList list = selectedItems(); bool item_moved = false; - for( QListViewItem *item = list.last(); item; item = list.prev() ) + for( TQListViewItem *item = list.last(); item; item = list.prev() ) { - QListViewItem *after = item->nextSibling(); + TQListViewItem *after = item->nextSibling(); if( !after ) continue; @@ -211,9 +211,9 @@ QueueList::removeSelected() //SLOT setSelected( currentItem(), true ); bool item_removed = false; - QPtrList selected = selectedItems(); + TQPtrList selected = selectedItems(); - for( QListViewItem *item = selected.first(); item; item = selected.next() ) + for( TQListViewItem *item = selected.first(); item; item = selected.next() ) { delete item; item_removed = true; @@ -234,14 +234,14 @@ QueueList::clear() // SLOT } void -QueueList::contentsDragEnterEvent( QDragEnterEvent *e ) +QueueList::contentsDragEnterEvent( TQDragEnterEvent *e ) { debug() << "contentsDrageEnterEvent()" << endl; e->accept( e->source() == reinterpret_cast( Playlist::instance() )->viewport() ); } void -QueueList::contentsDragMoveEvent( QDragMoveEvent *e ) +QueueList::contentsDragMoveEvent( TQDragMoveEvent *e ) { debug() << "contentsDrageMoveEvent()" << endl; KListView::contentsDragMoveEvent( e ); @@ -252,7 +252,7 @@ QueueList::contentsDragMoveEvent( QDragMoveEvent *e ) } void -QueueList::contentsDropEvent( QDropEvent *e ) +QueueList::contentsDropEvent( TQDropEvent *e ) { debug() << "contentsDragDropEvent()" << endl; if( e->source() == viewport() ) @@ -262,8 +262,8 @@ QueueList::contentsDropEvent( QDropEvent *e ) } else { - QListViewItem *parent = 0; - QListViewItem *after; + TQListViewItem *parent = 0; + TQListViewItem *after; findDrop( e->pos(), parent, after ); @@ -278,7 +278,7 @@ QueueList::contentsDropEvent( QDropEvent *e ) QueueManager *QueueManager::s_instance = 0; -QueueManager::QueueManager( QWidget *parent, const char *name ) +QueueManager::QueueManager( TQWidget *parent, const char *name ) : KDialogBase( KDialogBase::Swallow, 0, parent, name, false, 0, Ok|Apply|Cancel ) { s_instance = this; @@ -289,27 +289,27 @@ QueueManager::QueueManager( QWidget *parent, const char *name ) kapp->setTopWidget( this ); setCaption( kapp->makeStdCaption( i18n("Queue Manager") ) ); - setInitialSize( QSize( 400, 260 ) ); + setInitialSize( TQSize( 400, 260 ) ); - QVBox *mainBox = new QVBox( this ); + TQVBox *mainBox = new TQVBox( this ); setMainWidget( mainBox ); - QHBox *box = new QHBox( mainWidget() ); + TQHBox *box = new TQHBox( mainWidget() ); box->setSpacing( 5 ); m_listview = new QueueList( box ); - QVBox *buttonBox = new QVBox( box ); - m_up = new KPushButton( KGuiItem( QString::null, "up" ), buttonBox ); - m_down = new KPushButton( KGuiItem( QString::null, "down" ), buttonBox ); - m_remove = new KPushButton( KGuiItem( QString::null, Amarok::icon( "dequeue_track" ) ), buttonBox ); - m_add = new KPushButton( KGuiItem( QString::null, Amarok::icon( "queue_track" ) ), buttonBox ); - m_clear = new KPushButton( KGuiItem( QString::null, Amarok::icon( "playlist_clear" ) ), buttonBox ); + TQVBox *buttonBox = new TQVBox( box ); + m_up = new KPushButton( KGuiItem( TQString::null, "up" ), buttonBox ); + m_down = new KPushButton( KGuiItem( TQString::null, "down" ), buttonBox ); + m_remove = new KPushButton( KGuiItem( TQString::null, Amarok::icon( "dequeue_track" ) ), buttonBox ); + m_add = new KPushButton( KGuiItem( TQString::null, Amarok::icon( "queue_track" ) ), buttonBox ); + m_clear = new KPushButton( KGuiItem( TQString::null, Amarok::icon( "playlist_clear" ) ), buttonBox ); - QToolTip::add( m_up, i18n( "Move up" ) ); - QToolTip::add( m_down, i18n( "Move down" ) ); - QToolTip::add( m_remove, i18n( "Remove" ) ); - QToolTip::add( m_add, i18n( "Enqueue track" ) ); - QToolTip::add( m_clear, i18n( "Clear queue" ) ); + TQToolTip::add( m_up, i18n( "Move up" ) ); + TQToolTip::add( m_down, i18n( "Move down" ) ); + TQToolTip::add( m_remove, i18n( "Remove" ) ); + TQToolTip::add( m_add, i18n( "Enqueue track" ) ); + TQToolTip::add( m_clear, i18n( "Clear queue" ) ); m_up->setEnabled( false ); m_down->setEnabled( false ); @@ -317,19 +317,19 @@ QueueManager::QueueManager( QWidget *parent, const char *name ) m_add->setEnabled( false ); m_clear->setEnabled( false ); - connect( m_up, SIGNAL( clicked() ), m_listview, SLOT( moveSelectedUp() ) ); - connect( m_down, SIGNAL( clicked() ), m_listview, SLOT( moveSelectedDown() ) ); - connect( m_remove, SIGNAL( clicked() ), this, SLOT( removeSelected() ) ); - connect( m_add, SIGNAL( clicked() ), this, SLOT( addItems() ) ); - connect( m_clear, SIGNAL( clicked() ), m_listview, SLOT( clear() ) ); + connect( m_up, TQT_SIGNAL( clicked() ), m_listview, TQT_SLOT( moveSelectedUp() ) ); + connect( m_down, TQT_SIGNAL( clicked() ), m_listview, TQT_SLOT( moveSelectedDown() ) ); + connect( m_remove, TQT_SIGNAL( clicked() ), this, TQT_SLOT( removeSelected() ) ); + connect( m_add, TQT_SIGNAL( clicked() ), this, TQT_SLOT( addItems() ) ); + connect( m_clear, TQT_SIGNAL( clicked() ), m_listview, TQT_SLOT( clear() ) ); Playlist *pl = Playlist::instance(); - connect( pl, SIGNAL( selectionChanged() ), SLOT( updateButtons() ) ); - connect( m_listview, SIGNAL( selectionChanged() ), SLOT( updateButtons() ) ); - connect( pl, SIGNAL( queueChanged(const PLItemList &, const PLItemList &) ), - SLOT( changeQueuedItems(const PLItemList &, const PLItemList &) ) ); - connect( this, SIGNAL( applyClicked()), SLOT( applyNow() ) ); - connect( m_listview, SIGNAL( changed() ), this, SLOT ( changed() ) ); + connect( pl, TQT_SIGNAL( selectionChanged() ), TQT_SLOT( updateButtons() ) ); + connect( m_listview, TQT_SIGNAL( selectionChanged() ), TQT_SLOT( updateButtons() ) ); + connect( pl, TQT_SIGNAL( queueChanged(const PLItemList &, const PLItemList &) ), + TQT_SLOT( changeQueuedItems(const PLItemList &, const PLItemList &) ) ); + connect( this, TQT_SIGNAL( applyClicked()), TQT_SLOT( applyNow() ) ); + connect( m_listview, TQT_SIGNAL( changed() ), this, TQT_SLOT ( changed() ) ); s_instance->enableButtonApply(false); insertItems(); @@ -349,7 +349,7 @@ QueueManager::applyNow() } void -QueueManager::addItems( QListViewItem *after ) +QueueManager::addItems( TQListViewItem *after ) { /* HACK!!!!! We can know which items where dragged since they should still be selected @@ -363,17 +363,17 @@ QueueManager::addItems( QListViewItem *after ) if( !after ) after = m_listview->lastChild(); - QPtrList list = Playlist::instance()->selectedItems(); + TQPtrList list = Playlist::instance()->selectedItems(); bool item_added = false; - for( QListViewItem *item = list.first(); item; item = list.next() ) + for( TQListViewItem *item = list.first(); item; item = list.next() ) { #define item static_cast(item) - QValueList current = m_map.values(); + TQValueList current = m_map.values(); if( current.find( item ) == current.end() ) //avoid duplication { - QString title = i18n("%1 - %2").arg( item->artist(), item->title() ); + TQString title = i18n("%1 - %2").arg( item->artist(), item->title() ); after = new QueueItem( m_listview, after, title ); m_map[ after ] = item; @@ -389,9 +389,9 @@ QueueManager::addItems( QListViewItem *after ) void QueueManager::changeQueuedItems( const PLItemList &in, const PLItemList &out ) //SLOT { - QPtrListIterator it(in); + TQPtrListIterator it(in); for( it.toFirst(); it; ++it ) addQueuedItem( *it ); - it = QPtrListIterator(out); + it = TQPtrListIterator(out); for( it.toFirst(); it; ++it ) removeQueuedItem( *it ); } @@ -403,7 +403,7 @@ QueueManager::addQueuedItem( PlaylistItem *item ) const int index = pl->m_nextTracks.findRef( item ); - QListViewItem *after; + TQListViewItem *after; if( !index ) after = 0; else { @@ -413,10 +413,10 @@ QueueManager::addQueuedItem( PlaylistItem *item ) after = m_listview->itemAtIndex( find ); } - QValueList current = m_map.values(); - QValueListIterator newItem = current.find( item ); + TQValueList current = m_map.values(); + TQValueListIterator newItem = current.find( item ); - QString title = i18n("%1 - %2").arg( item->artist(), item->title() ); + TQString title = i18n("%1 - %2").arg( item->artist(), item->title() ); if( newItem == current.end() ) //avoid duplication { @@ -431,18 +431,18 @@ QueueManager::removeQueuedItem( PlaylistItem *item ) Playlist *pl = Playlist::instance(); if( !pl ) return; //should never happen - QValueList current = m_map.values(); - QValueListIterator newItem = current.find( item ); + TQValueList current = m_map.values(); + TQValueListIterator newItem = current.find( item ); - QString title = i18n("%1 - %2").arg( item->artist(), item->title() ); + TQString title = i18n("%1 - %2").arg( item->artist(), item->title() ); - QListViewItem *removableItem = m_listview->findItem( title, 0 ); + TQListViewItem *removableItem = m_listview->findItem( title, 0 ); if( removableItem ) { //Remove the key from the map, so we can re-queue the item - QMapIterator end( m_map.end() ); - for( QMapIterator it = m_map.begin(); it != end; ++it ) + TQMapIterator end( m_map.end() ); + for( TQMapIterator it = m_map.begin(); it != end; ++it ) { if( it.data() == item ) { @@ -459,11 +459,11 @@ QueueManager::removeQueuedItem( PlaylistItem *item ) /// Playlist uses this to determine the altered queue and reflect the changes. -QPtrList +TQPtrList QueueManager::newQueue() { - QPtrList queue; - for( QListViewItem *key = m_listview->firstChild(); key; key = key->nextSibling() ) + TQPtrList queue; + for( TQListViewItem *key = m_listview->firstChild(); key; key = key->nextSibling() ) { queue.append( m_map[ key ] ); } @@ -473,12 +473,12 @@ QueueManager::newQueue() void QueueManager::insertItems() { - QPtrList list = Playlist::instance()->m_nextTracks; - QListViewItem *last = 0; + TQPtrList list = Playlist::instance()->m_nextTracks; + TQListViewItem *last = 0; for( PlaylistItem *item = list.first(); item; item = list.next() ) { - QString title = i18n("%1 - %2").arg( item->artist(), item->title() ); + TQString title = i18n("%1 - %2").arg( item->artist(), item->title() ); last = new QueueItem( m_listview, last, title ); m_map[ last ] = item; @@ -497,14 +497,14 @@ QueueManager::changed() // SLOT void QueueManager::removeSelected() //SLOT { - QPtrList selected = m_listview->selectedItems(); + TQPtrList selected = m_listview->selectedItems(); bool item_removed = false; - for( QListViewItem *item = selected.first(); item; item = selected.next() ) + for( TQListViewItem *item = selected.first(); item; item = selected.next() ) { //Remove the key from the map, so we can re-queue the item - QMapIterator it = m_map.find( item ); + TQMapIterator it = m_map.find( item ); m_map.remove( it ); diff --git a/amarok/src/queuemanager.h b/amarok/src/queuemanager.h index fe721620..072b8fb0 100644 --- a/amarok/src/queuemanager.h +++ b/amarok/src/queuemanager.h @@ -19,18 +19,18 @@ #include //baseclass #include //baseclass -#include +#include class KPushButton; class QueueItem : public KListViewItem { public: - QueueItem( QListView *parent, QListViewItem *after, QString t ) + QueueItem( TQListView *parent, TQListViewItem *after, TQString t ) : KListViewItem( parent, after, t ) { }; - void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align ); + void paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align ); }; @@ -41,12 +41,12 @@ class QueueList : public KListView friend class QueueManager; public: - QueueList( QWidget *parent, const char *name = 0 ); + QueueList( TQWidget *parent, const char *name = 0 ); ~QueueList() {}; bool hasSelection(); bool isEmpty() { return ( childCount() == 0 ); } - QPtrList selectedItems(); + TQPtrList selectedItems(); public slots: void moveSelectedUp(); @@ -55,11 +55,11 @@ class QueueList : public KListView virtual void clear(); private: - void contentsDragEnterEvent( QDragEnterEvent *e ); - void contentsDragMoveEvent( QDragMoveEvent* e ); - void contentsDropEvent( QDropEvent *e ); - void keyPressEvent( QKeyEvent *e ); - void viewportPaintEvent( QPaintEvent* ); + void contentsDragEnterEvent( TQDragEnterEvent *e ); + void contentsDragMoveEvent( TQDragMoveEvent* e ); + void contentsDropEvent( TQDropEvent *e ); + void keyPressEvent( TQKeyEvent *e ); + void viewportPaintEvent( TQPaintEvent* ); signals: void changed(); @@ -70,16 +70,16 @@ class QueueManager : public KDialogBase Q_OBJECT public: - QueueManager( QWidget *parent = 0, const char *name = 0 ); + QueueManager( TQWidget *parent = 0, const char *name = 0 ); ~QueueManager(); - QPtrList newQueue(); + TQPtrList newQueue(); static QueueManager *instance() { return s_instance; } public slots: void applyNow(); - void addItems( QListViewItem *after = 0 ); /// For the add button (uses selected playlist tracks) + void addItems( TQListViewItem *after = 0 ); /// For the add button (uses selected playlist tracks) void changeQueuedItems( const PLItemList &in, const PLItemList &out ); /// For keeping queue/dequeue in sync void updateButtons(); @@ -92,7 +92,7 @@ class QueueManager : public KDialogBase void addQueuedItem( PlaylistItem *item ); void removeQueuedItem( PlaylistItem *item ); - QMap m_map; + TQMap m_map; QueueList *m_listview; KPushButton *m_up; KPushButton *m_down; diff --git a/amarok/src/refreshimages.cpp b/amarok/src/refreshimages.cpp index 61d3897b..8b9dfe90 100644 --- a/amarok/src/refreshimages.cpp +++ b/amarok/src/refreshimages.cpp @@ -9,13 +9,13 @@ #include "refreshimages.h" #include "statusbar.h" -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -27,17 +27,17 @@ RefreshImages::RefreshImages() { //"SELECT asin, locale, filename FROM amazon WHERE refetchdate > %1 ;" - const QStringList staleImages = CollectionDB::instance()->staleImages(); - QStringList::ConstIterator it = staleImages.begin(); - QStringList::ConstIterator end = staleImages.end(); + const TQStringList staleImages = CollectionDB::instance()->staleImages(); + TQStringList::ConstIterator it = staleImages.begin(); + TQStringList::ConstIterator end = staleImages.end(); while( it != end ) { - QString asin=*it; + TQString asin=*it; it++; - QString locale = *it; + TQString locale = *it; it++; - QString md5sum = *it; + TQString md5sum = *it; if ( asin.isEmpty() || locale.isEmpty() || md5sum.isEmpty() ) { //somehow we have entries without ASIN @@ -50,8 +50,8 @@ RefreshImages::RefreshImages() continue; } - QString url = - QString("http://webservices.amazon.%1/onca/xml?Service=AWSECommerceService&SubscriptionId=%2&Operation=ItemLookup&ItemId=%3&ResponseGroup=Small,Images") + TQString url = + TQString("http://webservices.amazon.%1/onca/xml?Service=AWSECommerceService&SubscriptionId=%2&Operation=ItemLookup&ItemId=%3&ResponseGroup=Small,Images") .arg(localeToTLD(locale)) .arg("0RQSQ0B8CRY7VX2VF3G2") //Ian Monroe .arg(asin); @@ -66,7 +66,7 @@ RefreshImages::RefreshImages() it++; //iterate to the next set m_jobInfo[md5sum] = JobInfo( asin, locale, it == end ); - connect( job, SIGNAL( result( KIO::Job* ) ), SLOT( finishedXmlFetch( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), TQT_SLOT( finishedXmlFetch( KIO::Job* ) ) ); } } @@ -83,18 +83,18 @@ RefreshImages::finishedXmlFetch( KIO::Job* xmlJob ) //SLOT } KIO::StoredTransferJob* const storedJob = static_cast( xmlJob ); - const QString xml = QString::fromUtf8( storedJob->data().data(), storedJob->data().size() ); + const TQString xml = TQString::fromUtf8( storedJob->data().data(), storedJob->data().size() ); - QDomDocument doc; + TQDomDocument doc; if ( !doc.setContent( xml ) ) return; - QStringList imageSizes; + TQStringList imageSizes; imageSizes << "LargeImage" << "MediumImage" << "SmallImage"; - QString imageUrl; + TQString imageUrl; foreach( imageSizes ) { - QDomNode imageNode = doc.documentElement() + TQDomNode imageNode = doc.documentElement() .namedItem( "Items" ) .namedItem( "Item" ) .namedItem( *it ); @@ -123,7 +123,7 @@ RefreshImages::finishedXmlFetch( KIO::Job* xmlJob ) //SLOT .namedItem( "Items" ) .namedItem( "Item" ) .namedItem( "DetailPageURL" ).firstChild().toText().data(); - connect( imageJob, SIGNAL( result(KIO::Job*) ), SLOT( finishedImageFetch(KIO::Job*) ) ); + connect( imageJob, TQT_SIGNAL( result(KIO::Job*) ), TQT_SLOT( finishedImageFetch(KIO::Job*) ) ); } void RefreshImages::finishedImageFetch(KIO::Job* imageJob) @@ -135,7 +135,7 @@ void RefreshImages::finishedImageFetch(KIO::Job* imageJob) return; } - QImage img; + TQImage img; img.loadFromData(static_cast(imageJob)->data()); img.setText( "amazon-url", 0, m_jobInfo[imageJob->name()].m_detailUrl); img.save( Amarok::saveLocation("albumcovers/large/") + imageJob->name(), "PNG"); @@ -148,7 +148,7 @@ void RefreshImages::finishedImageFetch(KIO::Job* imageJob) deleteLater(); } -QString RefreshImages::localeToTLD(const QString& locale) +TQString RefreshImages::localeToTLD(const TQString& locale) { if(locale=="us") return "com"; diff --git a/amarok/src/refreshimages.h b/amarok/src/refreshimages.h index 02064fdb..7d7678a0 100644 --- a/amarok/src/refreshimages.h +++ b/amarok/src/refreshimages.h @@ -4,22 +4,22 @@ #ifndef AMAROK_REFRESHIMAGES_H #define AMAROK_REFRESHIMAGES_H -#include +#include namespace KIO { class StoredTransferJob; class Job; } -class QStringList; +class TQStringList; class JobInfo { public: JobInfo() : m_last(false) { } //for QMap - JobInfo(const QString& asin, const QString& locale, bool last) : + JobInfo(const TQString& asin, const TQString& locale, bool last) : m_asin(asin), m_locale(locale), m_last(last) { } - QString m_asin; - QString m_locale; - QString m_detailUrl; + TQString m_asin; + TQString m_locale; + TQString m_detailUrl; bool m_last; }; @@ -32,7 +32,7 @@ class RefreshImages : public QObject void finishedXmlFetch( KIO::Job* ); void finishedImageFetch( KIO::Job* ); private: - static QString localeToTLD(const QString& locale); - QMap m_jobInfo; + static TQString localeToTLD(const TQString& locale); + TQMap m_jobInfo; }; #endif diff --git a/amarok/src/scancontroller.cpp b/amarok/src/scancontroller.cpp index 7a981dd9..60c18f10 100644 --- a/amarok/src/scancontroller.cpp +++ b/amarok/src/scancontroller.cpp @@ -30,9 +30,9 @@ #include "scancontroller.h" #include "statusbar.h" -#include -#include -#include +#include +#include +#include #include #include @@ -55,15 +55,15 @@ void ScanController::setInstance( ScanController* curr ) currController = curr; } -ScanController::ScanController( CollectionDB* parent, bool incremental, const QStringList& folders ) +ScanController::ScanController( CollectionDB* parent, bool incremental, const TQStringList& folders ) : DependentJob( parent, "CollectionScanner" ) - , QXmlDefaultHandler() + , TQXmlDefaultHandler() , m_scanner( new Amarok::ProcIO() ) - , m_folders( QDeepCopy( folders ) ) + , m_folders( TQDeepCopy( folders ) ) , m_incremental( incremental ) , m_hasChanged( false ) - , m_source( new QXmlInputSource() ) - , m_reader( new QXmlSimpleReader() ) + , m_source( new TQXmlInputSource() ) + , m_reader( new TQXmlSimpleReader() ) , m_waitingBundle( 0 ) , m_lastCommandPaused( false ) , m_isPaused( false ) @@ -76,9 +76,9 @@ ScanController::ScanController( CollectionDB* parent, bool incremental, const QS m_reader->setContentHandler( this ); m_reader->parse( m_source, true ); - connect( this, SIGNAL( scanDone( bool ) ), MountPointManager::instance(), SLOT( updateStatisticsURLs( bool ) ) ); + connect( this, TQT_SIGNAL( scanDone( bool ) ), MountPointManager::instance(), TQT_SLOT( updateStatisticsURLs( bool ) ) ); - connect( m_scanner, SIGNAL( readReady( KProcIO* ) ), SLOT( slotReadReady() ) ); + connect( m_scanner, TQT_SIGNAL( readReady( KProcIO* ) ), TQT_SLOT( slotReadReady() ) ); *m_scanner << "amarokcollectionscanner"; *m_scanner << "--nocrashhandler"; // We want to be able to catch SIGSEGV @@ -132,7 +132,7 @@ ScanController::completeJob( void ) { m_fileMapsMutex.lock(); - QMap::Iterator it; + TQMap::Iterator it; if( !m_incremental ) { CollectionDB::instance()->emitFilesAdded( m_filesAdded ); @@ -173,31 +173,31 @@ ScanController::initIncremental() DEBUG_BLOCK connect( CollectionDB::instance(), - SIGNAL( fileMoved( const QString &, const QString & ) ), - SLOT( slotFileMoved( const QString &, const QString & ) ) ); + TQT_SIGNAL( fileMoved( const TQString &, const TQString & ) ), + TQT_SLOT( slotFileMoved( const TQString &, const TQString & ) ) ); connect( CollectionDB::instance(), - SIGNAL( fileMoved( const QString &, const QString &, const QString & ) ), - SLOT( slotFileMoved( const QString &, const QString & ) ) ); + TQT_SIGNAL( fileMoved( const TQString &, const TQString &, const TQString & ) ), + TQT_SLOT( slotFileMoved( const TQString &, const TQString & ) ) ); IdList list = MountPointManager::instance()->getMountedDeviceIds(); - QString deviceIds; + TQString deviceIds; foreachType( IdList, list ) { if ( !deviceIds.isEmpty() ) deviceIds += ','; - deviceIds += QString::number(*it); + deviceIds += TQString::number(*it); } - const QStringList values = CollectionDB::instance()->query( - QString( "SELECT deviceid, dir, changedate FROM directories WHERE deviceid IN (%1);" ) + const TQStringList values = CollectionDB::instance()->query( + TQString( "SELECT deviceid, dir, changedate FROM directories WHERE deviceid IN (%1);" ) .arg( deviceIds ) ); foreach( values ) { int id = (*it).toInt(); - const QString folder = MountPointManager::instance()->getAbsolutePath( id, (*++it) ); - const QString mtime = *++it; + const TQString folder = MountPointManager::instance()->getAbsolutePath( id, (*++it) ); + const TQString mtime = *++it; - const QFileInfo info( folder ); + const TQFileInfo info( folder ); if( info.exists() ) { if( info.lastModified().toTime_t() != mtime.toUInt() ) @@ -266,9 +266,9 @@ main_loop: else { m_dataMutex.lock(); - QDeepCopy data = m_xmlData; + TQDeepCopy data = m_xmlData; m_source->setData( data ); - m_xmlData = QString::null; + m_xmlData = TQString::null; m_dataMutex.unlock(); @@ -334,7 +334,7 @@ main_loop: void ScanController::slotReadReady() { - QString line; + TQString line; m_dataMutex.lock(); @@ -378,7 +378,7 @@ ScanController::requestAcknowledged() } void -ScanController::slotFileMoved( const QString &/*src*/, const QString &/*dest*/) +ScanController::slotFileMoved( const TQString &/*src*/, const TQString &/*dest*/) { //why is this needed? QBob, take a look at this /* @@ -400,7 +400,7 @@ ScanController::notifyThisBundle( MetaBundle* bundle ) } bool -ScanController::startElement( const QString&, const QString& localName, const QString&, const QXmlAttributes& attrs ) +ScanController::startElement( const TQString&, const TQString& localName, const TQString&, const TQXmlAttributes& attrs ) { // List of entity names: // @@ -465,8 +465,8 @@ ScanController::startElement( const QString&, const QString& localName, const QS } else if( localName == "folder" ) { - const QString folder = attrs.value( "path" ); - const QFileInfo info( folder ); + const TQString folder = attrs.value( "path" ); + const TQFileInfo info( folder ); // Update dir statistics for rescanning purposes if( info.exists() ) @@ -478,15 +478,15 @@ ScanController::startElement( const QString&, const QString& localName, const QS } else if( localName == "playlist" ) - QApplication::postEvent( PlaylistBrowser::instance(), new PlaylistFoundEvent( attrs.value( "path" ) ) ); + TQApplication::postEvent( PlaylistBrowser::instance(), new PlaylistFoundEvent( attrs.value( "path" ) ) ); else if( localName == "compilation" ) CollectionDB::instance()->checkCompilations( attrs.value( "path" ), !m_incremental); else if( localName == "image" ) { // Deserialize CoverBundle list - QStringList list = QStringList::split( "AMAROK_MAGIC", attrs.value( "list" ), true ); - QValueList< QPair > covers; + TQStringList list = TQStringList::split( "AMAROK_MAGIC", attrs.value( "list" ), true ); + TQValueList< QPair > covers; for( uint i = 0; i < list.count(); ) { covers += qMakePair( list[i], list[i + 1] ); @@ -505,36 +505,36 @@ ScanController::startElement( const QString&, const QString& localName, const QS void -ScanController::customEvent( QCustomEvent* e ) +ScanController::customEvent( TQCustomEvent* e ) { if( e->type() == RestartEventType ) { debug() << "RestartEvent received." << endl; - QFile log( Amarok::saveLocation( QString::null ) + "collection_scan.log" ); + TQFile log( Amarok::saveLocation( TQString::null ) + "collection_scan.log" ); if ( !log.open( IO_ReadOnly ) ) ::warning() << "Failed opening log file " << log.name() << endl; else { - QCString path = QCString(log.readAll()); - m_crashedFiles << QString::fromUtf8( path, path.length() ); + TQCString path = TQCString(log.readAll()); + m_crashedFiles << TQString::fromUtf8( path, path.length() ); } m_dataMutex.lock(); - m_xmlData = QString::null; + m_xmlData = TQString::null; delete m_source; - m_source = new QXmlInputSource(); + m_source = new TQXmlInputSource(); m_dataMutex.unlock(); delete m_reader; - m_reader = new QXmlSimpleReader(); + m_reader = new TQXmlSimpleReader(); m_reader->setContentHandler( this ); m_reader->parse( m_source, true ); delete m_scanner; // Reusing doesn't work, so we have to destroy and reinstantiate m_scanner = new Amarok::ProcIO(); - connect( m_scanner, SIGNAL( readReady( KProcIO* ) ), SLOT( slotReadReady() ) ); + connect( m_scanner, TQT_SIGNAL( readReady( KProcIO* ) ), TQT_SLOT( slotReadReady() ) ); *m_scanner << "amarokcollectionscanner"; *m_scanner << "--nocrashhandler"; // We want to be able to catch SIGSEGV diff --git a/amarok/src/scancontroller.h b/amarok/src/scancontroller.h index 7b46af0a..edff21dc 100644 --- a/amarok/src/scancontroller.h +++ b/amarok/src/scancontroller.h @@ -20,8 +20,8 @@ #ifndef AMAROK_SCANCONTROLLER_H #define AMAROK_SCANCONTROLLER_H -#include -#include //baseclass +#include +#include //baseclass #include "threadmanager.h" //baseclass @@ -50,25 +50,25 @@ class ScanController : public ThreadManager::DependentJob, public QXmlDefaultHan public: static const int RestartEventType = 8891; - class RestartEvent : public QCustomEvent { + class RestartEvent : public TQCustomEvent { public: - RestartEvent() : QCustomEvent( RestartEventType ) {} + RestartEvent() : TQCustomEvent( RestartEventType ) {} }; static const int PlaylistFoundEventType = 8890; - class PlaylistFoundEvent : public QCustomEvent { + class PlaylistFoundEvent : public TQCustomEvent { public: - PlaylistFoundEvent( QString path ) - : QCustomEvent( PlaylistFoundEventType ) + PlaylistFoundEvent( TQString path ) + : TQCustomEvent( PlaylistFoundEventType ) , m_path( path ) {} - QString path() { return m_path; } + TQString path() { return m_path; } private: - QString m_path; + TQString m_path; }; public: - ScanController( CollectionDB* parent, bool incremental, const QStringList& folders = QStringList() ); + ScanController( CollectionDB* parent, bool incremental, const TQStringList& folders = TQStringList() ); ~ScanController(); static ScanController* instance(); @@ -89,7 +89,7 @@ class ScanController : public ThreadManager::DependentJob, public QXmlDefaultHan bool requestPause(); bool requestUnpause(); void requestAcknowledged(); - void slotFileMoved( const QString &src, const QString &dest ); + void slotFileMoved( const TQString &src, const TQString &dest ); private slots: void slotReadReady(); @@ -99,34 +99,34 @@ class ScanController : public ThreadManager::DependentJob, public QXmlDefaultHan virtual bool doJob(); static void setInstance( ScanController* instance ); - bool startElement( const QString&, const QString &localName, const QString&, const QXmlAttributes &attrs ); - void customEvent( QCustomEvent* ); + bool startElement( const TQString&, const TQString &localName, const TQString&, const TQXmlAttributes &attrs ); + void customEvent( TQCustomEvent* ); // Member variables: static const uint MAX_RESTARTS = 80; static const uint MAX_FAILURE_PERCENTAGE = 5; KProcIO* m_scanner; - QStringList m_folders; - QStringList m_foldersToRemove; + TQStringList m_folders; + TQStringList m_foldersToRemove; bool m_incremental; bool m_hasChanged; - QString m_xmlData; - QMutex m_dataMutex; - QXmlInputSource* m_source; - QXmlSimpleReader* m_reader; + TQString m_xmlData; + TQMutex m_dataMutex; + TQXmlInputSource* m_source; + TQXmlSimpleReader* m_reader; - QStringList m_crashedFiles; + TQStringList m_crashedFiles; // Every file that the collection scanner finds is marked // here, as well as the source of all files that the AFT code // detects as having been moved. These are the files that // have definitely not been deleted. The key is the absolute // path. - QMap m_filesAdded; - QMap m_filesDeleted; - QMutex m_fileMapsMutex; + TQMap m_filesAdded; + TQMap m_filesDeleted; + TQMutex m_fileMapsMutex; static ScanController* currController; diff --git a/amarok/src/scriptmanager.cpp b/amarok/src/scriptmanager.cpp index da318fae..ea2a89eb 100644 --- a/amarok/src/scriptmanager.cpp +++ b/amarok/src/scriptmanager.cpp @@ -35,13 +35,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -78,17 +78,17 @@ namespace Amarok { * This constructor is needed so that the correct codec is used. KProcIO defaults * to latin1, while the scanner uses UTF-8. */ - ProcIO::ProcIO() : KProcIO( QTextCodec::codecForName( "UTF-8" ) ) {} + ProcIO::ProcIO() : KProcIO( TQTextCodec::codecForName( "UTF-8" ) ) {} QString - proxyForUrl(const QString& url) + proxyForUrl(const TQString& url) { KURL kurl( url ); - QString proxy; + TQString proxy; if ( KProtocolManager::proxyForURL( kurl ) != - QString::fromLatin1( "DIRECT" ) ) { + TQString::fromLatin1( "DIRECT" ) ) { KProtocolManager::slaveProtocol ( kurl, proxy ); } @@ -96,7 +96,7 @@ namespace Amarok { } QString - proxyForProtocol(const QString& protocol) + proxyForProtocol(const TQString& protocol) { return KProtocolManager::proxyFor( protocol ); } @@ -114,16 +114,16 @@ namespace Amarok { class AmarokScriptNewStuff : public KNewStuff { public: - AmarokScriptNewStuff(const QString &type, QWidget *parentWidget=0) + AmarokScriptNewStuff(const TQString &type, TQWidget *parentWidget=0) : KNewStuff( type, parentWidget ) {} - bool install( const QString& fileName ) + bool install( const TQString& fileName ) { return ScriptManager::instance()->slotInstallScript( fileName ); } - virtual bool createUploadFile( const QString& ) { return false; } //make compile on kde 3.5 + virtual bool createUploadFile( const TQString& ) { return false; } //make compile on kde 3.5 }; @@ -134,8 +134,8 @@ class AmarokScriptNewStuff : public KNewStuff ScriptManager* ScriptManager::s_instance = 0; -ScriptManager::ScriptManager( QWidget *parent, const char *name ) - : KDialogBase( parent, name, false, QString::null, Close, Close, true ) +ScriptManager::ScriptManager( TQWidget *parent, const char *name ) + : KDialogBase( parent, name, false, TQString::null, Close, Close, true ) , EngineObserver( EngineController::instance() ) , m_gui( new ScriptManagerBase( this ) ) { @@ -179,17 +179,17 @@ ScriptManager::ScriptManager( QWidget *parent, const char *name ) m_scoreCategory ->setOpen( config->readBoolEntry( "Score category State" ) ); m_transcodeCategory->setOpen( config->readBoolEntry( "Transcode category open" ) ); - connect( m_gui->listView, SIGNAL( currentChanged( QListViewItem* ) ), SLOT( slotCurrentChanged( QListViewItem* ) ) ); - connect( m_gui->listView, SIGNAL( doubleClicked ( QListViewItem*, const QPoint&, int ) ), SLOT( slotRunScript() ) ); - connect( m_gui->listView, SIGNAL( contextMenuRequested ( QListViewItem*, const QPoint&, int ) ), SLOT( slotShowContextMenu( QListViewItem*, const QPoint& ) ) ); + connect( m_gui->listView, TQT_SIGNAL( currentChanged( TQListViewItem* ) ), TQT_SLOT( slotCurrentChanged( TQListViewItem* ) ) ); + connect( m_gui->listView, TQT_SIGNAL( doubleClicked ( TQListViewItem*, const TQPoint&, int ) ), TQT_SLOT( slotRunScript() ) ); + connect( m_gui->listView, TQT_SIGNAL( contextMenuRequested ( TQListViewItem*, const TQPoint&, int ) ), TQT_SLOT( slotShowContextMenu( TQListViewItem*, const TQPoint& ) ) ); - connect( m_gui->installButton, SIGNAL( clicked() ), SLOT( slotInstallScript() ) ); - connect( m_gui->retrieveButton, SIGNAL( clicked() ), SLOT( slotRetrieveScript() ) ); - connect( m_gui->uninstallButton, SIGNAL( clicked() ), SLOT( slotUninstallScript() ) ); - connect( m_gui->runButton, SIGNAL( clicked() ), SLOT( slotRunScript() ) ); - connect( m_gui->stopButton, SIGNAL( clicked() ), SLOT( slotStopScript() ) ); - connect( m_gui->configureButton, SIGNAL( clicked() ), SLOT( slotConfigureScript() ) ); - connect( m_gui->aboutButton, SIGNAL( clicked() ), SLOT( slotAboutScript() ) ); + connect( m_gui->installButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotInstallScript() ) ); + connect( m_gui->retrieveButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotRetrieveScript() ) ); + connect( m_gui->uninstallButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotUninstallScript() ) ); + connect( m_gui->runButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotRunScript() ) ); + connect( m_gui->stopButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotStopScript() ) ); + connect( m_gui->configureButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotConfigureScript() ) ); + connect( m_gui->aboutButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotAboutScript() ) ); m_gui->installButton ->setIconSet( SmallIconSet( Amarok::icon( "files" ) ) ); m_gui->retrieveButton ->setIconSet( SmallIconSet( Amarok::icon( "download" ) ) ); @@ -199,14 +199,14 @@ ScriptManager::ScriptManager( QWidget *parent, const char *name ) m_gui->configureButton->setIconSet( SmallIconSet( Amarok::icon( "configure" ) ) ); m_gui->aboutButton ->setIconSet( SmallIconSet( Amarok::icon( "info" ) ) ); - QSize sz = sizeHint(); + TQSize sz = sizeHint(); setMinimumSize( kMax( 350, sz.width() ), kMax( 250, sz.height() ) ); resize( sizeHint() ); - connect( this, SIGNAL(lyricsScriptChanged()), ContextBrowser::instance(), SLOT( lyricsScriptChanged() ) ); + connect( this, TQT_SIGNAL(lyricsScriptChanged()), ContextBrowser::instance(), TQT_SLOT( lyricsScriptChanged() ) ); // Delay this call via eventloop, because it's a bit slow and would block - QTimer::singleShot( 0, this, SLOT( findScripts() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( findScripts() ) ); } @@ -214,7 +214,7 @@ ScriptManager::~ScriptManager() { DEBUG_BLOCK - QStringList runningScripts; + TQStringList runningScripts; ScriptMap::Iterator it; ScriptMap::Iterator end( m_scripts.end() ); for( it = m_scripts.begin(); it != end; ++it ) { @@ -243,7 +243,7 @@ ScriptManager::~ScriptManager() //////////////////////////////////////////////////////////////////////////////// bool -ScriptManager::runScript( const QString& name, bool silent ) +ScriptManager::runScript( const TQString& name, bool silent ) { if( !m_scripts.contains( name ) ) return false; @@ -254,7 +254,7 @@ ScriptManager::runScript( const QString& name, bool silent ) bool -ScriptManager::stopScript( const QString& name ) +ScriptManager::stopScript( const TQString& name ) { if( !m_scripts.contains( name ) ) return false; @@ -269,7 +269,7 @@ ScriptManager::stopScript( const QString& name ) QStringList ScriptManager::listRunningScripts() { - QStringList runningScripts; + TQStringList runningScripts; foreachType( ScriptMap, m_scripts ) if( it.data().process ) runningScripts << it.key(); @@ -279,56 +279,56 @@ ScriptManager::listRunningScripts() void -ScriptManager::customMenuClicked( const QString& message ) +ScriptManager::customMenuClicked( const TQString& message ) { notifyScripts( "customMenuClicked: " + message ); } QString -ScriptManager::specForScript( const QString& name ) +ScriptManager::specForScript( const TQString& name ) { if( !m_scripts.contains( name ) ) - return QString(); - QFileInfo info( m_scripts[name].url.path() ); - const QString specPath = info.dirPath() + '/' + info.baseName( true ) + ".spec"; + return TQString(); + TQFileInfo info( m_scripts[name].url.path() ); + const TQString specPath = info.dirPath() + '/' + info.baseName( true ) + ".spec"; return specPath; } void -ScriptManager::notifyFetchLyrics( const QString& artist, const QString& title ) +ScriptManager::notifyFetchLyrics( const TQString& artist, const TQString& title ) { - const QString args = KURL::encode_string( artist ) + ' ' + KURL::encode_string( title ); + const TQString args = KURL::encode_string( artist ) + ' ' + KURL::encode_string( title ); notifyScripts( "fetchLyrics " + args ); } void -ScriptManager::notifyFetchLyricsByUrl( const QString& url ) +ScriptManager::notifyFetchLyricsByUrl( const TQString& url ) { notifyScripts( "fetchLyricsByUrl " + url ); } -void ScriptManager::notifyTranscode( const QString& srcUrl, const QString& filetype ) +void ScriptManager::notifyTranscode( const TQString& srcUrl, const TQString& filetype ) { notifyScripts( "transcode " + srcUrl + ' ' + filetype ); } void -ScriptManager::notifyPlaylistChange( const QString& change) +ScriptManager::notifyPlaylistChange( const TQString& change) { notifyScripts( "playlistChange: " + change ); } void -ScriptManager::requestNewScore( const QString &url, double prevscore, int playcount, int length, float percentage, const QString &reason ) +ScriptManager::requestNewScore( const TQString &url, double prevscore, int playcount, int length, float percentage, const TQString &reason ) { - const QString script = ensureScoreScriptRunning(); + const TQString script = ensureScoreScriptRunning(); if( script.isNull() ) { Amarok::StatusBar::instance()->longMessage( @@ -338,7 +338,7 @@ ScriptManager::requestNewScore( const QString &url, double prevscore, int playco } m_scripts[script].process->writeStdin( - QString( "requestNewScore %6 %1 %2 %3 %4 %5" ) + TQString( "requestNewScore %6 %1 %2 %3 %4 %5" ) .arg( prevscore ) .arg( playcount ) .arg( length ) @@ -354,19 +354,19 @@ ScriptManager::requestNewScore( const QString &url, double prevscore, int playco void ScriptManager::findScripts() //SLOT { - const QStringList allFiles = kapp->dirs()->findAllResources( "data", "amarok/scripts/*", true ); + const TQStringList allFiles = kapp->dirs()->findAllResources( "data", "amarok/scripts/*", true ); // Add found scripts to listview: { foreach( allFiles ) - if( QFileInfo( *it ).isExecutable() ) + if( TQFileInfo( *it ).isExecutable() ) loadScript( *it ); } // Handle auto-run: KConfig* const config = Amarok::config( "ScriptManager" ); - const QStringList runningScripts = config->readListEntry( "Running Scripts" ); + const TQStringList runningScripts = config->readListEntry( "Running Scripts" ); { foreach( runningScripts ) @@ -383,7 +383,7 @@ ScriptManager::findScripts() //SLOT void -ScriptManager::slotCurrentChanged( QListViewItem* item ) +ScriptManager::slotCurrentChanged( TQListViewItem* item ) { const bool isCategory = item == m_generalCategory || item == m_lyricsCategory || @@ -391,7 +391,7 @@ ScriptManager::slotCurrentChanged( QListViewItem* item ) item == m_transcodeCategory; if( item && !isCategory ) { - const QString name = item->text( 0 ); + const TQString name = item->text( 0 ); m_gui->uninstallButton->setEnabled( true ); m_gui->runButton->setEnabled( !m_scripts[name].process ); m_gui->stopButton->setEnabled( m_scripts[name].process ); @@ -409,12 +409,12 @@ ScriptManager::slotCurrentChanged( QListViewItem* item ) bool -ScriptManager::slotInstallScript( const QString& path ) +ScriptManager::slotInstallScript( const TQString& path ) { - QString _path = path; + TQString _path = path; if( path.isNull() ) { - _path = KFileDialog::getOpenFileName( QString::null, + _path = KFileDialog::getOpenFileName( TQString::null, "*.amarokscript.tar *.amarokscript.tar.bz2 *.amarokscript.tar.gz|" + i18n( "Script Packages (*.amarokscript.tar, *.amarokscript.tar.bz2, *.amarokscript.tar.gz)" ) , this @@ -428,12 +428,12 @@ ScriptManager::slotInstallScript( const QString& path ) return false; } - QString destination = Amarok::saveLocation( "scripts/" ); + TQString destination = Amarok::saveLocation( "scripts/" ); const KArchiveDirectory* const archiveDir = archive.directory(); // Prevent installing a script that's already installed - const QString scriptFolder = destination + archiveDir->entries().first(); - if( QFile::exists( scriptFolder ) ) { + const TQString scriptFolder = destination + archiveDir->entries().first(); + if( TQFile::exists( scriptFolder ) ) { KMessageBox::error( 0, i18n( "A script with the name '%1' is already installed. " "Please uninstall it first." ).arg( archiveDir->entries().first() ) ); return false; @@ -461,12 +461,12 @@ ScriptManager::slotInstallScript( const QString& path ) void -ScriptManager::recurseInstall( const KArchiveDirectory* archiveDir, const QString& destination ) +ScriptManager::recurseInstall( const KArchiveDirectory* archiveDir, const TQString& destination ) { - const QStringList entries = archiveDir->entries(); + const TQStringList entries = archiveDir->entries(); foreach( entries ) { - const QString entry = *it; + const TQString entry = *it; const KArchiveEntry* const archEntry = archiveDir->entry( entry ); if( archEntry->isDirectory() ) { @@ -474,9 +474,9 @@ ScriptManager::recurseInstall( const KArchiveDirectory* archiveDir, const QStrin recurseInstall( dir, destination + entry + '/' ); } else { - ::chmod( QFile::encodeName( destination + entry ), archEntry->permissions() ); + ::chmod( TQFile::encodeName( destination + entry ), archEntry->permissions() ); - if( QFileInfo( destination + entry ).isExecutable() ) { + if( TQFileInfo( destination + entry ).isExecutable() ) { loadScript( destination + entry ); m_installSuccess = true; } @@ -500,7 +500,7 @@ ScriptManager::slotRetrieveScript() d->setType( "amarok/script" ); // you have to do this by hand when providing your own Engine KNS::ProviderLoader *p = new KNS::ProviderLoader( this ); - QObject::connect( p, SIGNAL( providersLoaded(Provider::List*) ), d, SLOT( slotProviders (Provider::List *) ) ); + TQObject::connect( p, TQT_SIGNAL( providersLoaded(Provider::List*) ), d, TQT_SLOT( slotProviders (Provider::List *) ) ); p->load( "amarok/script", "http://amarok.kde.org/knewstuff/amarokscripts-providers.xml" ); d->exec(); @@ -510,7 +510,7 @@ ScriptManager::slotRetrieveScript() void ScriptManager::slotUninstallScript() { - const QString name = m_gui->listView->currentItem()->text( 0 ); + const TQString name = m_gui->listView->currentItem()->text( 0 ); if( KMessageBox::warningContinueCancel( 0, i18n( "Are you sure you want to uninstall the script '%1'?" ).arg( name ), i18n("Uninstall Script"), i18n("Uninstall") ) == KMessageBox::Cancel ) return; @@ -522,8 +522,8 @@ ScriptManager::slotUninstallScript() // find if the script is installed in the global or local scripts directory KURL scriptsDirURL; - QStringList dirs = KGlobal::dirs()->findDirs( "data", "amarok/scripts/" ); - for ( QStringList::Iterator it = dirs.begin(); it != dirs.end(); ++it ) { + TQStringList dirs = KGlobal::dirs()->findDirs( "data", "amarok/scripts/" ); + for ( TQStringList::Iterator it = dirs.begin(); it != dirs.end(); ++it ) { scriptsDirURL = KURL::fromPathOrURL( *it ); if ( scriptsDirURL.isParentOf( scriptDirURL ) ) break; @@ -542,7 +542,7 @@ ScriptManager::slotUninstallScript() return; } - QStringList keys; + TQStringList keys; // Find all scripts that were in the uninstalled directory { @@ -567,17 +567,17 @@ ScriptManager::slotRunScript( bool silent ) { if( !m_gui->runButton->isEnabled() ) return false; - QListViewItem* const li = m_gui->listView->currentItem(); - const QString name = li->text( 0 ); + TQListViewItem* const li = m_gui->listView->currentItem(); + const TQString name = li->text( 0 ); - if( m_scripts[name].type == "lyrics" && lyricsScriptRunning() != QString::null ) { + if( m_scripts[name].type == "lyrics" && lyricsScriptRunning() != TQString::null ) { if( !silent ) KMessageBox::sorry( 0, i18n( "Another lyrics script is already running. " "You may only run one lyrics script at a time." ) ); return false; } - if( m_scripts[name].type == "transcode" && transcodeScriptRunning() != QString::null ) { + if( m_scripts[name].type == "transcode" && transcodeScriptRunning() != TQString::null ) { if( !silent ) KMessageBox::sorry( 0, i18n( "Another transcode script is already running. " "You may only run one transcode script at a time." ) ); @@ -593,9 +593,9 @@ ScriptManager::slotRunScript( bool silent ) *script << url.path(); script->setWorkingDirectory( Amarok::saveLocation( "scripts-data/" ) ); - connect( script, SIGNAL( receivedStderr( KProcess*, char*, int ) ), SLOT( slotReceivedStderr( KProcess*, char*, int ) ) ); - connect( script, SIGNAL( receivedStdout( KProcess*, char*, int ) ), SLOT( slotReceivedStdout( KProcess*, char*, int ) ) ); - connect( script, SIGNAL( processExited( KProcess* ) ), SLOT( scriptFinished( KProcess* ) ) ); + connect( script, TQT_SIGNAL( receivedStderr( KProcess*, char*, int ) ), TQT_SLOT( slotReceivedStderr( KProcess*, char*, int ) ) ); + connect( script, TQT_SIGNAL( receivedStdout( KProcess*, char*, int ) ), TQT_SLOT( slotReceivedStdout( KProcess*, char*, int ) ) ); + connect( script, TQT_SIGNAL( processExited( KProcess* ) ), TQT_SLOT( scriptFinished( KProcess* ) ) ); if( script->start( KProcess::NotifyOnExit ) ) { @@ -630,29 +630,29 @@ ScriptManager::slotRunScript( bool silent ) void ScriptManager::slotStopScript() { - QListViewItem* const li = m_gui->listView->currentItem(); - const QString name = li->text( 0 ); + TQListViewItem* const li = m_gui->listView->currentItem(); + const TQString name = li->text( 0 ); // Just a sanity check if( m_scripts.find( name ) == m_scripts.end() ) return; terminateProcess( &m_scripts[name].process ); - m_scripts[name].log = QString::null; + m_scripts[name].log = TQString::null; slotCurrentChanged( m_gui->listView->currentItem() ); - li->setPixmap( 0, QPixmap() ); + li->setPixmap( 0, TQPixmap() ); } void ScriptManager::slotConfigureScript() { - const QString name = m_gui->listView->currentItem()->text( 0 ); + const TQString name = m_gui->listView->currentItem()->text( 0 ); if( !m_scripts[name].process ) return; const KURL url = m_scripts[name].url; - QDir::setCurrent( url.directory() ); + TQDir::setCurrent( url.directory() ); m_scripts[name].process->writeStdin( "configure" ); } @@ -661,9 +661,9 @@ ScriptManager::slotConfigureScript() void ScriptManager::slotAboutScript() { - const QString name = m_gui->listView->currentItem()->text( 0 ); - QFile readme( m_scripts[name].url.directory( false ) + "README" ); - QFile license( m_scripts[name].url.directory( false ) + "COPYING" ); + const TQString name = m_gui->listView->currentItem()->text( 0 ); + TQFile readme( m_scripts[name].url.directory( false ) + "README" ); + TQFile license( m_scripts[name].url.directory( false ) + "COPYING" ); if( !readme.open( IO_ReadOnly ) ) { KMessageBox::sorry( 0, i18n( "There is no information available for this script." ) ); @@ -671,26 +671,26 @@ ScriptManager::slotAboutScript() } KAboutDialog* about = new KAboutDialog( KAboutDialog::AbtTabbed|KAboutDialog::AbtProduct, - QString::null, + TQString::null, KDialogBase::Ok, KDialogBase::Ok, this ); kapp->setTopWidget( about ); about->setCaption( kapp->makeStdCaption( i18n( "About %1" ).arg( name ) ) ); about->setProduct( "", "", "", "" ); // Get rid of the confusing KDE version text - QLabel* product = static_cast( about->mainWidget()->child( "version" ) ); + TQLabel* product = static_cast( about->mainWidget()->child( "version" ) ); if( product ) product->setText( i18n( "%1 Amarok Script" ).arg( name ) ); about->addTextPage( i18n( "About" ), readme.readAll(), true ); if( license.open( IO_ReadOnly ) ) about->addLicensePage( i18n( "License" ), license.readAll() ); - about->setInitialSize( QSize( 500, 350 ) ); + about->setInitialSize( TQSize( 500, 350 ) ); about->show(); } void -ScriptManager::slotShowContextMenu( QListViewItem* item, const QPoint& pos ) +ScriptManager::slotShowContextMenu( TQListViewItem* item, const TQPoint& pos ) { const bool isCategory = item == m_generalCategory || item == m_lyricsCategory || @@ -720,7 +720,7 @@ ScriptManager::slotShowContextMenu( QListViewItem* item, const QPoint& pos ) break; case SHOW_LOG: - QString line; + TQString line; while( it.data().process->readln( line ) != -1 ) it.data().log += line; @@ -729,12 +729,12 @@ ScriptManager::slotShowContextMenu( QListViewItem* item, const QPoint& pos ) editor->setCaption( kapp->makeStdCaption( i18n( "Output Log for %1" ).arg( it.key() ) ) ); editor->setReadOnly( true ); - QFont font( "fixed" ); + TQFont font( "fixed" ); font.setFixedPitch( true ); - font.setStyleHint( QFont::TypeWriter ); + font.setStyleHint( TQFont::TypeWriter ); editor->setFont( font ); - editor->setTextFormat( QTextEdit::PlainText ); + editor->setTextFormat( TQTextEdit::PlainText ); editor->resize( 500, 380 ); editor->show(); break; @@ -746,7 +746,7 @@ ScriptManager::slotShowContextMenu( QListViewItem* item, const QPoint& pos ) void ScriptManager::slotReceivedStdout( KProcess*, char* buf, int len ) { - debug() << QString::fromLatin1( buf, len ) << endl; + debug() << TQString::fromLatin1( buf, len ) << endl; } @@ -759,7 +759,7 @@ ScriptManager::slotReceivedStderr( KProcess* process, char* buf, int len ) for( it = m_scripts.begin(); it != end; ++it ) if( it.data().process == process ) break; - const QString text = QString::fromLatin1( buf, len ); + const TQString text = TQString::fromLatin1( buf, len ); error() << it.key() << ":\n" << text << endl; if( it.data().log.length() > 20000 ) @@ -786,8 +786,8 @@ ScriptManager::scriptFinished( KProcess* process ) //SLOT // Destroy script process delete it.data().process; it.data().process = 0; - it.data().log = QString::null; - it.data().li->setPixmap( 0, QPixmap() ); + it.data().log = TQString::null; + it.data().li->setPixmap( 0, TQPixmap() ); slotCurrentChanged( m_gui->listView->currentItem() ); } @@ -797,9 +797,9 @@ ScriptManager::scriptFinished( KProcess* process ) //SLOT //////////////////////////////////////////////////////////////////////////////// QStringList -ScriptManager::scriptsOfType( const QString &type ) const +ScriptManager::scriptsOfType( const TQString &type ) const { - QStringList scripts; + TQStringList scripts; foreachType( ScriptMap, m_scripts ) if( it.data().type == type ) scripts += it.key(); @@ -809,37 +809,37 @@ ScriptManager::scriptsOfType( const QString &type ) const QString -ScriptManager::scriptRunningOfType( const QString &type ) const +ScriptManager::scriptRunningOfType( const TQString &type ) const { foreachType( ScriptMap, m_scripts ) if( it.data().process ) if( it.data().type == type ) return it.key(); - return QString(); + return TQString(); } QString ScriptManager::ensureScoreScriptRunning() { - QString s = scoreScriptRunning(); + TQString s = scoreScriptRunning(); if( !s.isNull() ) return s; if( runScript( AmarokConfig::lastScoreScript(), true /*silent*/ ) ) return AmarokConfig::lastScoreScript(); - const QString def = i18n( "Score" ) + ": " + "Default"; + const TQString def = i18n( "Score" ) + ": " + "Default"; if( runScript( def, true ) ) return def; - const QStringList scripts = scoreScripts(); - for( QStringList::const_iterator it = scripts.begin(), end = scripts.end(); it != end; ++it ) + const TQStringList scripts = scoreScripts(); + for( TQStringList::const_iterator it = scripts.begin(), end = scripts.end(); it != end; ++it ) if( runScript( *it, true ) ) return *it; - return QString(); + return TQString(); } @@ -857,7 +857,7 @@ ScriptManager::terminateProcess( KProcIO** proc ) void -ScriptManager::notifyScripts( const QString& message ) +ScriptManager::notifyScripts( const TQString& message ) { foreachType( ScriptMap, m_scripts ) { KProcIO* const proc = it.data().process; @@ -867,18 +867,18 @@ ScriptManager::notifyScripts( const QString& message ) void -ScriptManager::loadScript( const QString& path ) +ScriptManager::loadScript( const TQString& path ) { if( !path.isEmpty() ) { const KURL url = KURL::fromPathOrURL( path ); - QString name = url.fileName(); - QString type = "generic"; + TQString name = url.fileName(); + TQString type = "generic"; // Read and parse .spec file, if exists - QFileInfo info( path ); + TQFileInfo info( path ); KListViewItem* li = 0; - const QString specPath = info.dirPath() + '/' + info.baseName( true ) + ".spec"; - if( QFile::exists( specPath ) ) { + const TQString specPath = info.dirPath() + '/' + info.baseName( true ) + ".spec"; + if( TQFile::exists( specPath ) ) { KConfig spec( specPath, true, false ); if( spec.hasKey( "name" ) ) name = spec.readEntry( "name" ); @@ -896,7 +896,7 @@ ScriptManager::loadScript( const QString& path ) if( !li ) li = new KListViewItem( m_generalCategory, name ); - li->setPixmap( 0, QPixmap() ); + li->setPixmap( 0, TQPixmap() ); ScriptItem item; item.url = url; @@ -946,7 +946,7 @@ ScriptManager::engineNewMetaData( const MetaBundle& /*bundle*/, bool /*trackChan void ScriptManager::engineVolumeChanged( int newVolume ) { - notifyScripts( "volumeChange: " + QString::number( newVolume ) ); + notifyScripts( "volumeChange: " + TQString::number( newVolume ) ); } #include "scriptmanager.moc" diff --git a/amarok/src/scriptmanager.h b/amarok/src/scriptmanager.h index 5d872cf0..bf926859 100644 --- a/amarok/src/scriptmanager.h +++ b/amarok/src/scriptmanager.h @@ -24,14 +24,14 @@ #include "engineobserver.h" //baseclass #include "playlistwindow.h" -#include +#include #include //baseclass #include class MetaBundle; class ScriptManagerBase; -class QListViewItem; +class TQListViewItem; class KArchiveDirectory; class KProcess; class KProcIO; @@ -60,7 +60,7 @@ class ScriptManager : public KDialogBase, public EngineObserver friend class AmarokScriptNewStuff; public: - ScriptManager( QWidget *parent = 0, const char *name = 0 ); + ScriptManager( TQWidget *parent = 0, const char *name = 0 ); virtual ~ScriptManager(); static ScriptManager* instance() { return s_instance ? s_instance : new ScriptManager( PlaylistWindow::self() ); } @@ -70,53 +70,53 @@ class ScriptManager : public KDialogBase, public EngineObserver * @param name The name of the script. * @return True if successful. */ - bool runScript( const QString& name, bool silent = false ); + bool runScript( const TQString& name, bool silent = false ); /** * Stops the script with the given name. Used by the DCOP handler. * @param name The name of the script. * @return True if successful. */ - bool stopScript( const QString& name ); + bool stopScript( const TQString& name ); /** Returns a list of all currently running scripts. Used by the DCOP handler. */ - QStringList listRunningScripts(); + TQStringList listRunningScripts(); /** Custom Menu Click */ - void customMenuClicked( const QString& message ); + void customMenuClicked( const TQString& message ); /** Returns the path of the spec file of the given script */ - QString specForScript( const QString& name ); + TQString specForScript( const TQString& name ); - /** Return name of the lyrics script currently running, or QString::null if none */ - QString lyricsScriptRunning() const; + /** Return name of the lyrics script currently running, or TQString::null if none */ + TQString lyricsScriptRunning() const; /** Returns a list of all lyrics scripts */ - QStringList lyricsScripts() const; + TQStringList lyricsScripts() const; /** Sends a fetchLyrics notification to all scripts */ - void notifyFetchLyrics( const QString& artist, const QString& title ); + void notifyFetchLyrics( const TQString& artist, const TQString& title ); /** Sends a fetchLyrics notification to retrieve lyrics from a specific page */ - void notifyFetchLyricsByUrl( const QString& url ); + void notifyFetchLyricsByUrl( const TQString& url ); /** Sends a playlistChange notification to all scripts */ - void notifyPlaylistChange( const QString& change ); + void notifyPlaylistChange( const TQString& change ); - /** Return name of the transcode script currently running, or QString::null if none */ - QString transcodeScriptRunning() const; + /** Return name of the transcode script currently running, or TQString::null if none */ + TQString transcodeScriptRunning() const; /** Sends a transcode notification to all scripts */ - void notifyTranscode( const QString& srcUrl, const QString& filetype ); + void notifyTranscode( const TQString& srcUrl, const TQString& filetype ); - /** Return name of the scoring script currently running, or QString::null if none */ - QString scoreScriptRunning() const; + /** Return name of the scoring script currently running, or TQString::null if none */ + TQString scoreScriptRunning() const; /** Returns a list of all scoring scripts */ - QStringList scoreScripts() const; + TQStringList scoreScripts() const; /** Asks the current score script to give a new score based on the parameters. */ - void requestNewScore( const QString &url, double prevscore, int playcount, int length, float percentage, const QString &reason ); + void requestNewScore( const TQString &url, double prevscore, int playcount, int length, float percentage, const TQString &reason ); signals: /** Emitted when the lyrics script changes, so that a lyrics retry can be made */ @@ -127,16 +127,16 @@ class ScriptManager : public KDialogBase, public EngineObserver void findScripts(); /** Enables/disables the buttons */ - void slotCurrentChanged( QListViewItem* ); + void slotCurrentChanged( TQListViewItem* ); - bool slotInstallScript( const QString& path = QString::null ); + bool slotInstallScript( const TQString& path = TQString::null ); void slotRetrieveScript(); void slotUninstallScript(); bool slotRunScript( bool silent = false ); void slotStopScript(); void slotConfigureScript(); void slotAboutScript(); - void slotShowContextMenu( QListViewItem*, const QPoint& ); + void slotShowContextMenu( TQListViewItem*, const TQPoint& ); void slotReceivedStdout( KProcess*, char*, int ); void slotReceivedStderr( KProcess*, char*, int ); @@ -144,24 +144,24 @@ class ScriptManager : public KDialogBase, public EngineObserver private: /** Returns all scripts of the given \p type */ - QStringList scriptsOfType( const QString &type ) const; + TQStringList scriptsOfType( const TQString &type ) const; /** Returns the first running script found of \p type */ - QString scriptRunningOfType( const QString &type ) const; + TQString scriptRunningOfType( const TQString &type ) const; - QString ensureScoreScriptRunning(); + TQString ensureScoreScriptRunning(); /** Terminates a process with SIGTERM and deletes the KProcIO object */ void terminateProcess( KProcIO** proc ); /** Sends a string message to all running scripts */ - void notifyScripts( const QString& message ); + void notifyScripts( const TQString& message ); /** Adds a script to the listview */ - void loadScript( const QString& path ); + void loadScript( const TQString& path ); /** Copies the file permissions from the tarball and loads the script */ - void recurseInstall( const KArchiveDirectory* archiveDir, const QString& destination ); + void recurseInstall( const KArchiveDirectory* archiveDir, const TQString& destination ); /** EngineObserver reimplementations **/ void engineStateChanged( Engine::State state, Engine::State oldState = Engine::Empty ); @@ -174,37 +174,37 @@ class ScriptManager : public KDialogBase, public EngineObserver static ScriptManager* s_instance; ScriptManagerBase* m_gui; - QListViewItem* m_generalCategory; - QListViewItem* m_lyricsCategory; - QListViewItem* m_scoreCategory; - QListViewItem* m_transcodeCategory; + TQListViewItem* m_generalCategory; + TQListViewItem* m_lyricsCategory; + TQListViewItem* m_scoreCategory; + TQListViewItem* m_transcodeCategory; bool m_installSuccess; struct ScriptItem { KURL url; - QString type; + TQString type; KProcIO* process; - QListViewItem* li; - QString log; + TQListViewItem* li; + TQString log; ScriptItem() : process( 0 ), li( 0 ) {} }; - typedef QMap ScriptMap; + typedef TQMap ScriptMap; ScriptMap m_scripts; }; -inline QStringList ScriptManager::lyricsScripts() const { return scriptsOfType( "lyrics" ); } +inline TQStringList ScriptManager::lyricsScripts() const { return scriptsOfType( "lyrics" ); } -inline QString ScriptManager::lyricsScriptRunning() const { return scriptRunningOfType( "lyrics" ); } +inline TQString ScriptManager::lyricsScriptRunning() const { return scriptRunningOfType( "lyrics" ); } -inline QString ScriptManager::transcodeScriptRunning() const { return scriptRunningOfType( "transcode" ); } +inline TQString ScriptManager::transcodeScriptRunning() const { return scriptRunningOfType( "transcode" ); } -inline QStringList ScriptManager::scoreScripts() const { return scriptsOfType( "score" ); } +inline TQStringList ScriptManager::scoreScripts() const { return scriptsOfType( "score" ); } -inline QString ScriptManager::scoreScriptRunning() const { return scriptRunningOfType( "score" ); } +inline TQString ScriptManager::scoreScriptRunning() const { return scriptRunningOfType( "score" ); } #endif /* AMAROK_SCRIPTMANAGER_H */ diff --git a/amarok/src/scripts/graphequalizer/eqdialog.ui.h b/amarok/src/scripts/graphequalizer/eqdialog.ui.h index c36287ed..b52cec76 100644 --- a/amarok/src/scripts/graphequalizer/eqdialog.ui.h +++ b/amarok/src/scripts/graphequalizer/eqdialog.ui.h @@ -16,18 +16,18 @@ void EqDialog::init() { //kdDebug() << "start" << endl; - QCanvas* canvas = new QCanvas(); + TQCanvas* canvas = new TQCanvas(); canvas->resize(400, 200); - canvasView->setVScrollBarMode(QScrollView::AlwaysOff); - canvasView->setHScrollBarMode(QScrollView::AlwaysOff); + canvasView->setVScrollBarMode(TQScrollView::AlwaysOff); + canvasView->setHScrollBarMode(TQScrollView::AlwaysOff); canvasView->setCanvas(canvas); canvasView->init(); - QByteArray send_data, reply_data; - QCString reply_type; + TQByteArray send_data, reply_data; + TQCString reply_type; //kdDebug() << "continue" << endl; if(!KApplication::dcopClient()->call("amarok","player","equalizerEnabled()", send_data, reply_type, reply_data,true,1000)); //kdDebug() << "called" << endl; - QDataStream answer(reply_data, IO_ReadOnly); + TQDataStream answer(reply_data, IO_ReadOnly); //kdDebug() << "answer created" << answer << endl; bool eqEnabled; answer >> eqEnabled; @@ -39,8 +39,8 @@ void EqDialog::init() void EqDialog::eqGroupBox_toggled( bool eqEnabled) { - QByteArray data; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); arg << eqEnabled; KApplication::dcopClient()->send("amarok", "player", "setEqualizerEnabled(bool)" , data); } diff --git a/amarok/src/scripts/graphequalizer/equalizercanvasview.cpp b/amarok/src/scripts/graphequalizer/equalizercanvasview.cpp index ab5b01d9..b8c1939f 100644 --- a/amarok/src/scripts/graphequalizer/equalizercanvasview.cpp +++ b/amarok/src/scripts/graphequalizer/equalizercanvasview.cpp @@ -6,9 +6,9 @@ #include "equalizercanvasview.h" -#include -#include -#include +#include +#include +#include #include #include @@ -16,11 +16,11 @@ #include #include -EqualizerCanvasView::EqualizerCanvasView(QWidget *parent = 0, const char *name = 0) - : QCanvasView(parent, name) +EqualizerCanvasView::EqualizerCanvasView(TQWidget *parent = 0, const char *name = 0) + : TQCanvasView(parent, name) { m_pen.setWidth(5); - m_circleList = new QPtrList(); + m_circleList = new TQPtrList(); } //called after setCanvas @@ -28,14 +28,14 @@ void EqualizerCanvasView::init() { -// QCanvasLine* line = new QCanvasLine(this->canvas()); +// TQCanvasLine* line = new TQCanvasLine(this->canvas()); // line->setPoints(0,100,400,100); -// line->setPen(QPen(m_pen)); -// line->setBrush(QBrush(Qt::black)); - QCanvasLine* lineLeft = makeLine(QPoint(0,canvas()->height()/2) - ,QPoint(canvas()->width()/2,canvas()->height()/2)); - QCanvasLine* lineRight= makeLine(QPoint(canvas()->width()/2,canvas()->height()/2) - ,QPoint(canvas()->width(),canvas()->height()/2)); +// line->setPen(TQPen(m_pen)); +// line->setBrush(TQBrush(Qt::black)); + TQCanvasLine* lineLeft = makeLine(TQPoint(0,canvas()->height()/2) + ,TQPoint(canvas()->width()/2,canvas()->height()/2)); + TQCanvasLine* lineRight= makeLine(TQPoint(canvas()->width()/2,canvas()->height()/2) + ,TQPoint(canvas()->width(),canvas()->height()/2)); EqualizerCircle* circleMid = new EqualizerCircle(canvas()->width()/2 ,canvas()->height()/2 ,canvas() @@ -52,9 +52,9 @@ EqualizerCanvasView::init() } void -EqualizerCanvasView::contentsMousePressEvent(QMouseEvent *event) +EqualizerCanvasView::contentsMousePressEvent(TQMouseEvent *event) { - QCanvasItemList items = canvas()->collisions(event->pos()); + TQCanvasItemList items = canvas()->collisions(event->pos()); if (items.empty()) m_selectedItem = 0; else @@ -63,18 +63,18 @@ EqualizerCanvasView::contentsMousePressEvent(QMouseEvent *event) void -EqualizerCanvasView::contentsMouseDoubleClickEvent(QMouseEvent *event) +EqualizerCanvasView::contentsMouseDoubleClickEvent(TQMouseEvent *event) { if (event->button() == LeftButton && m_selectedItem - && m_selectedItem->rtti() == QCanvasLine::RTTI) + && m_selectedItem->rtti() == TQCanvasLine::RTTI) { - QCanvasLine* line = (QCanvasLine*) m_selectedItem; + TQCanvasLine* line = (TQCanvasLine*) m_selectedItem; int y = getY(event->x()); EqualizerCircle* circle = new EqualizerCircle(event->x(), y ,canvas() - ,makeLine(line->startPoint(),QPoint(event->x(),event->y())) - ,makeLine(QPoint(event->x(),event->y()),line->endPoint()) + ,makeLine(line->startPoint(),TQPoint(event->x(),event->y())) + ,makeLine(TQPoint(event->x(),event->y()),line->endPoint()) ,m_circleList); //kdDebug() << event->x() << 'x' << y << " cursor at " << event->x() << 'x' << event->y() << endl; circle->show(); @@ -85,11 +85,11 @@ EqualizerCanvasView::contentsMouseDoubleClickEvent(QMouseEvent *event) } } void -EqualizerCanvasView::contentsMouseMoveEvent(QMouseEvent *event) +EqualizerCanvasView::contentsMouseMoveEvent(TQMouseEvent *event) { if ((event->state() & LeftButton) && m_selectedItem ) { // kdDebug() << "dragging " << m_selectedItem->rtti() << endl; - if (m_selectedItem->rtti() == QCanvasEllipse::RTTI) + if (m_selectedItem->rtti() == TQCanvasEllipse::RTTI) { EqualizerCircle* circle = (EqualizerCircle*) m_selectedItem; circle->setLocation(event->pos()); @@ -98,9 +98,9 @@ EqualizerCanvasView::contentsMouseMoveEvent(QMouseEvent *event) } } void -EqualizerCanvasView::contentsMouseReleaseEvent(QMouseEvent */*event*/) +EqualizerCanvasView::contentsMouseReleaseEvent(TQMouseEvent */*event*/) { - if (m_selectedItem && m_selectedItem->rtti() == QCanvasEllipse::RTTI) + if (m_selectedItem && m_selectedItem->rtti() == TQCanvasEllipse::RTTI) { emit eqChanged(); } @@ -124,15 +124,15 @@ EqualizerCanvasView::getY(int xCoord) // kdDebug() << b << " = " << slope <<" * "<< x1 << " - " << y1 << endl; // double y = double(xCoord)*slope - b; // kdDebug() << y << " = " << xCoord << '*' << slope << " - " << b << endl; - //QPointArray* yAxis = new QPointArray(canvas->height()); + //TQPointArray* yAxis = new TQPointArray(canvas->height()); //yAxis->makeEllipse(xCoord, canvas()->height()/2,1,canvas->height()); //canvas()->collisions(yAxis,0,false); //delete yAxis; - QMemArray collidedPoints(20); + TQMemArray collidedPoints(20); unsigned int collisionNum = 0; for(int i=0; iheight();i++) { - QCanvasItemList list = canvas()->collisions(QPoint(xCoord,i)); + TQCanvasItemList list = canvas()->collisions(TQPoint(xCoord,i)); if( ! list.isEmpty()) { if(collidedPoints.size() <= collisionNum) @@ -145,25 +145,25 @@ EqualizerCanvasView::getY(int xCoord) return collidedPoints[collisionNum] - collisionNum/2; } -QCanvasLine* -EqualizerCanvasView::makeLine(QPoint startPoint, QPoint endPoint) +TQCanvasLine* +EqualizerCanvasView::makeLine(TQPoint startPoint, TQPoint endPoint) { - QCanvasLine* line = new QCanvasLine(canvas()); + TQCanvasLine* line = new TQCanvasLine(canvas()); line->setPoints(startPoint.x(), startPoint.y(), endPoint.x(), endPoint.y()); line->setZ(-50); - line->setPen(QPen(m_pen)); + line->setPen(TQPen(m_pen)); line->show(); return line; } -QValueList +TQValueList EqualizerCanvasView::currentSettings() { int step = canvas()->width()/10; int i; - QValueList ret; + TQValueList ret; ret << (int)(m_circleList->first()->y() - 100)*-1; for(i=1; i<9; i++) ret << (getY(i*step) - 100)*-1; @@ -175,13 +175,13 @@ EqualizerCanvasView::currentSettings() ////////////////////// //EqualizerCircle ////////////////////// -EqualizerCircle::EqualizerCircle(int x, int y, QCanvas *canvas, QCanvasLine* line1, QCanvasLine* line2, -QPtrList* circleList ) -: QCanvasEllipse(15, 15, canvas) +EqualizerCircle::EqualizerCircle(int x, int y, TQCanvas *canvas, TQCanvasLine* line1, TQCanvasLine* line2, +TQPtrList* circleList ) +: TQCanvasEllipse(15, 15, canvas) { m_line1 = line1; m_line2 = line2; - setBrush(QBrush(Qt::blue)); + setBrush(TQBrush(Qt::blue)); move(x,y); m_circleList = circleList; @@ -212,11 +212,11 @@ QPtrList* circleList ) m_circleList->at(circleIndex+1)->setLine(LEFT,m_line2); } -void EqualizerCircle::setLocation(const QPoint &newLocation) +void EqualizerCircle::setLocation(const TQPoint &newLocation) { unsigned int circleIndex = m_circleList->find(this); double xMin, xMax; - QPoint correctedLoc(newLocation); + TQPoint correctedLoc(newLocation); if(m_line1 == 0 || m_line2 == 0) {//if the line is on the edges of the board, make it only move vertically correctedLoc.setX( (int) x()); @@ -263,7 +263,7 @@ void EqualizerCircle::setLocation(const QPoint &newLocation) canvas()->update(); } -void EqualizerCircle::setLine(WhichLine lineNum, QCanvasLine* line) +void EqualizerCircle::setLine(WhichLine lineNum, TQCanvasLine* line) { if(lineNum == LEFT) m_line1 = line; @@ -273,11 +273,11 @@ void EqualizerCircle::setLine(WhichLine lineNum, QCanvasLine* line) void CallAmarok::updateEq() { - QByteArray data; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); arg << m_preampSlider->value() *-1; - QValueList cs = m_canvasView->currentSettings(); - QValueList::iterator it; + TQValueList cs = m_canvasView->currentSettings(); + TQValueList::iterator it; for ( it = cs.begin(); it != cs.end(); ++it ) arg << (*it); KApplication::dcopClient()->send("amarok", "player", diff --git a/amarok/src/scripts/graphequalizer/equalizercanvasview.h b/amarok/src/scripts/graphequalizer/equalizercanvasview.h index 1f8d8828..2a2352f5 100644 --- a/amarok/src/scripts/graphequalizer/equalizercanvasview.h +++ b/amarok/src/scripts/graphequalizer/equalizercanvasview.h @@ -9,9 +9,9 @@ #ifdef HAVE_CONFIG_H #include -#include -#include -#include +#include +#include +#include #endif @@ -24,16 +24,16 @@ public: enum { RTTI = 1001 }; - EqualizerCircle(int x, int y, QCanvas *canvas, QCanvasLine* line1, QCanvasLine* line2, QPtrList* circleList ); - void setLocation(const QPoint &newLocation); + EqualizerCircle(int x, int y, TQCanvas *canvas, TQCanvasLine* line1, TQCanvasLine* line2, TQPtrList* circleList ); + void setLocation(const TQPoint &newLocation); int rtti() { return RTTI; } private: enum WhichLine { LEFT = 1, RIGHT = 2 }; - void setLine(WhichLine lineNum, QCanvasLine* line); + void setLine(WhichLine lineNum, TQCanvasLine* line); - QCanvasLine *m_line1; - QCanvasLine *m_line2; - QPtrList* m_circleList; + TQCanvasLine *m_line1; + TQCanvasLine *m_line2; + TQPtrList* m_circleList; }; /** @@ -44,30 +44,30 @@ class EqualizerCanvasView : public QCanvasView { Q_OBJECT public: - EqualizerCanvasView(QWidget *parent, const char *name); + EqualizerCanvasView(TQWidget *parent, const char *name); void init(); - void contentsMousePressEvent(QMouseEvent *event); - void contentsMouseDoubleClickEvent(QMouseEvent *event); - void contentsMouseMoveEvent(QMouseEvent *event); - void contentsMouseReleaseEvent(QMouseEvent *event); - QValueList currentSettings(); + void contentsMousePressEvent(TQMouseEvent *event); + void contentsMouseDoubleClickEvent(TQMouseEvent *event); + void contentsMouseMoveEvent(TQMouseEvent *event); + void contentsMouseReleaseEvent(TQMouseEvent *event); + TQValueList currentSettings(); signals: void eqChanged(); private: int getY(int xCoord); - QCanvasLine* makeLine(QPoint startPoint, QPoint endPoint); - QPen m_pen; - QCanvasItem* m_selectedItem; - QPtrList* m_circleList; + TQCanvasLine* makeLine(TQPoint startPoint, TQPoint endPoint); + TQPen m_pen; + TQCanvasItem* m_selectedItem; + TQPtrList* m_circleList; }; class CallAmarok : public QObject { Q_OBJECT public: - CallAmarok(QObject* parent, const char *name, - EqualizerCanvasView* canvasView, QSlider* preampSlider) - : QObject(parent, name) + CallAmarok(TQObject* parent, const char *name, + EqualizerCanvasView* canvasView, TQSlider* preampSlider) + : TQObject(parent, name) { m_canvasView = canvasView; m_preampSlider = preampSlider; @@ -75,7 +75,7 @@ public: public slots: void updateEq(); private: - QSlider* m_preampSlider; + TQSlider* m_preampSlider; EqualizerCanvasView* m_canvasView; }; diff --git a/amarok/src/scripts/graphequalizer/equalizerdialog.cpp b/amarok/src/scripts/graphequalizer/equalizerdialog.cpp index 4ebe22d0..6cf5348a 100644 --- a/amarok/src/scripts/graphequalizer/equalizerdialog.cpp +++ b/amarok/src/scripts/graphequalizer/equalizerdialog.cpp @@ -20,22 +20,22 @@ #include "equalizerdialog.h" #include "equalizercanvasview.h" -#include -#include -#include +#include +#include +#include EqualizerDialog::EqualizerDialog() { - QBoxLayout* overallLayout = new QHBoxLayout(this, 5, -1, "overallLayout"); - QBoxLayout* sliderLayout = new QVBoxLayout(this, 5, -1, "sliderLayout"); + TQBoxLayout* overallLayout = new TQHBoxLayout(this, 5, -1, "overallLayout"); + TQBoxLayout* sliderLayout = new TQVBoxLayout(this, 5, -1, "sliderLayout"); - QSlider* preampSlider = new QSlider(-100,100,1,0,QSlider::Vertical,this, "preampSlider"); - QLabel* preampLabel = new QLabel("Pre-amp",this,"preampLabel"); + TQSlider* preampSlider = new TQSlider(-100,100,1,0,TQSlider::Vertical,this, "preampSlider"); + TQLabel* preampLabel = new TQLabel("Pre-amp",this,"preampLabel"); sliderLayout->addWidget(preampSlider); sliderLayout->addWidget(preampLabel); - QCanvas* canvas = new QCanvas(); + TQCanvas* canvas = new TQCanvas(); canvas->resize(400, 200); EqualizerCanvasView* canvasView = new EqualizerCanvasView(canvas, this, "canvasView"); diff --git a/amarok/src/scripts/graphequalizer/equalizerdialog.h b/amarok/src/scripts/graphequalizer/equalizerdialog.h index 81f20195..0b4b0f02 100644 --- a/amarok/src/scripts/graphequalizer/equalizerdialog.h +++ b/amarok/src/scripts/graphequalizer/equalizerdialog.h @@ -20,7 +20,7 @@ #ifndef EQUALIZERDIALOG_H #define EQUALIZERDIALOG_H -#include +#include /** diff --git a/amarok/src/scripts/graphequalizer/main.cpp b/amarok/src/scripts/graphequalizer/main.cpp index 6f540427..05c00232 100644 --- a/amarok/src/scripts/graphequalizer/main.cpp +++ b/amarok/src/scripts/graphequalizer/main.cpp @@ -3,7 +3,7 @@ * Released under GPL 2 or later, see COPYING */ -#include "eqdialog.h" +#include "etqdialog.h" #include "equalizercanvasview.h" #include "stdinreader.h" #include @@ -13,11 +13,11 @@ #include -#include -#include +#include +#include -#include -#include +#include +#include static const char description[] = @@ -34,7 +34,7 @@ int main(int argc, char **argv) KApplication app; EqDialog *mainWin = new EqDialog(); // mainWin = new EqualizerGraph(0,"equalizerdialog"); -// QCanvas canvas; +// TQCanvas canvas; // canvas.resize(400, 200); // EqualizerCanvasView* eq = new EqualizerCanvasView(&canvas,mainWin,"eqcanvasview"); // mainWin->getHLayout()->addWidget(eq); @@ -42,9 +42,9 @@ int main(int argc, char **argv) mainWin->show(); StdinReader* listen = new StdinReader(mainWin, "ioListener"); CallAmarok* ca = new CallAmarok(mainWin,"ca", mainWin->canvasView,mainWin->preampSlider); - mainWin->connect(listen, SIGNAL(openWindow()), mainWin, SLOT(show())); - mainWin->connect(mainWin->canvasView,SIGNAL(eqChanged()),ca, SLOT(updateEq())); - mainWin->connect(mainWin->preampSlider,SIGNAL(sliderReleased()),ca, SLOT(updateEq())); + mainWin->connect(listen, TQT_SIGNAL(openWindow()), mainWin, TQT_SLOT(show())); + mainWin->connect(mainWin->canvasView,TQT_SIGNAL(eqChanged()),ca, TQT_SLOT(updateEq())); + mainWin->connect(mainWin->preampSlider,TQT_SIGNAL(sliderReleased()),ca, TQT_SLOT(updateEq())); return app.exec(); } diff --git a/amarok/src/scripts/graphequalizer/stdinreader.h b/amarok/src/scripts/graphequalizer/stdinreader.h index 20b583ae..16ff12b4 100644 --- a/amarok/src/scripts/graphequalizer/stdinreader.h +++ b/amarok/src/scripts/graphequalizer/stdinreader.h @@ -5,19 +5,19 @@ * Copyright (C) 2005 by Ian Monroe * Released under GPL 2 or later, see COPYING */ -#include -#include +#include +#include #include class StdinReader : public QObject { Q_OBJECT public: - StdinReader(QObject * parent = 0, const char * name = 0) - :QObject(parent,name) + StdinReader(TQObject * parent = 0, const char * name = 0) + :TQObject(parent,name) { - QSocketNotifier* streamListener = new QSocketNotifier(0, QSocketNotifier::Read, this, "stdinWatcher"); - connect(streamListener, SIGNAL(activated(int)), this, SLOT(dataRecieved()) ); + TQSocketNotifier* streamListener = new TQSocketNotifier(0, TQSocketNotifier::Read, this, "stdinWatcher"); + connect(streamListener, TQT_SIGNAL(activated(int)), this, TQT_SLOT(dataRecieved()) ); } ~StdinReader() { } @@ -28,8 +28,8 @@ Q_OBJECT { //separate stdin pointer necesary for OS X for reasons unknown FILE * stdin_ptr = stdin; - QString signal; - QTextIStream( stdin_ptr ) >> signal; + TQString signal; + TQTextIStream( stdin_ptr ) >> signal; if(signal == "configure") emit openWindow(); } diff --git a/amarok/src/scrobbler.cpp b/amarok/src/scrobbler.cpp index 61837e55..424c4f97 100644 --- a/amarok/src/scrobbler.cpp +++ b/amarok/src/scrobbler.cpp @@ -20,8 +20,8 @@ #include -#include -#include +#include +#include #include #include @@ -66,23 +66,23 @@ Scrobbler::~Scrobbler() /** * Queries similar artists from Audioscrobbler. */ -void Scrobbler::similarArtists( const QString & artist ) +void Scrobbler::similarArtists( const TQString & artist ) { - QString safeArtist = QDeepCopy( artist ); + TQString safeArtist = TQDeepCopy( artist ); if ( AmarokConfig::retrieveSimilarArtists() ) { // Request looks like this: // http://ws.audioscrobbler.com/1.0/artist/Metallica/similar.xml - m_similarArtistsBuffer = QByteArray(); + m_similarArtistsBuffer = TQByteArray(); m_artist = artist; m_similarArtistsJob = KIO::get( "http://ws.audioscrobbler.com/1.0/artist/" + safeArtist + "/similar.xml", false, false ); - connect( m_similarArtistsJob, SIGNAL( result( KIO::Job* ) ), - this, SLOT( audioScrobblerSimilarArtistsResult( KIO::Job* ) ) ); - connect( m_similarArtistsJob, SIGNAL( data( KIO::Job*, const QByteArray& ) ), - this, SLOT( audioScrobblerSimilarArtistsData( KIO::Job*, const QByteArray& ) ) ); + connect( m_similarArtistsJob, TQT_SIGNAL( result( KIO::Job* ) ), + this, TQT_SLOT( audioScrobblerSimilarArtistsResult( KIO::Job* ) ) ); + connect( m_similarArtistsJob, TQT_SIGNAL( data( KIO::Job*, const TQByteArray& ) ), + this, TQT_SLOT( audioScrobblerSimilarArtistsData( KIO::Job*, const TQByteArray& ) ) ); } } @@ -115,17 +115,17 @@ void Scrobbler::audioScrobblerSimilarArtistsResult( KIO::Job* job ) //SLOT // // - QDomDocument document; + TQDomDocument document; if ( !document.setContent( m_similarArtistsBuffer ) ) { debug() << "Couldn't read similar artists response" << endl; return; } - QDomNodeList values = document.elementsByTagName( "similarartists" ) + TQDomNodeList values = document.elementsByTagName( "similarartists" ) .item( 0 ).childNodes(); - QStringList suggestions; + TQStringList suggestions; for ( uint i = 0; i < values.count() && i < 30; i++ ) // limit to top 30 artists suggestions << values.item( i ).namedItem( "name" ).toElement().text(); @@ -140,7 +140,7 @@ void Scrobbler::audioScrobblerSimilarArtistsResult( KIO::Job* job ) //SLOT /** * Called when similar artists data is received for the TransferJob. */ -void Scrobbler::audioScrobblerSimilarArtistsData( KIO::Job* job, const QByteArray& data ) //SLOT +void Scrobbler::audioScrobblerSimilarArtistsData( KIO::Job* job, const TQByteArray& data ) //SLOT { if ( m_similarArtistsJob != job ) return; //not the right job, so let's ignore it @@ -260,9 +260,9 @@ void Scrobbler::applySettings() SubmitItem::SubmitItem( - const QString& artist, - const QString& album, - const QString& title, + const TQString& artist, + const TQString& album, + const TQString& title, int length, bool now) { @@ -270,11 +270,11 @@ SubmitItem::SubmitItem( m_album = album; m_title = title; m_length = length; - m_playStartTime = now ? QDateTime::currentDateTime( Qt::UTC ).toTime_t() : 0; + m_playStartTime = now ? TQDateTime::currentDateTime( Qt::UTC ).toTime_t() : 0; } -SubmitItem::SubmitItem( const QDomElement& element ) +SubmitItem::SubmitItem( const TQDomElement& element ) { m_artist = element.namedItem( "artist" ).toElement().text(); m_album = element.namedItem( "album" ).toElement().text(); @@ -305,34 +305,34 @@ bool SubmitItem::operator==( const SubmitItem& item ) } -QDomElement SubmitItem::toDomElement( QDomDocument& document ) const +TQDomElement SubmitItem::toDomElement( TQDomDocument& document ) const { - QDomElement item = document.createElement( "item" ); + TQDomElement item = document.createElement( "item" ); // TODO: In the future, it might be good to store url too //item.setAttribute("url", item->url().url()); - QDomElement artist = document.createElement( "artist" ); - QDomText artistText = document.createTextNode( m_artist ); + TQDomElement artist = document.createElement( "artist" ); + TQDomText artistText = document.createTextNode( m_artist ); artist.appendChild( artistText ); item.appendChild( artist ); - QDomElement album = document.createElement( "album" ); - QDomText albumText = document.createTextNode( m_album ); + TQDomElement album = document.createElement( "album" ); + TQDomText albumText = document.createTextNode( m_album ); album.appendChild( albumText ); item.appendChild( album ); - QDomElement title = document.createElement( "title" ); - QDomText titleText = document.createTextNode( m_title ); + TQDomElement title = document.createElement( "title" ); + TQDomText titleText = document.createTextNode( m_title ); title.appendChild( titleText ); item.appendChild( title ); - QDomElement length = document.createElement( "length" ); - QDomText lengthText = document.createTextNode( QString::number( m_length ) ); + TQDomElement length = document.createElement( "length" ); + TQDomText lengthText = document.createTextNode( TQString::number( m_length ) ); length.appendChild( lengthText ); item.appendChild( length ); - QDomElement playtime = document.createElement( "playtime" ); - QDomText playtimeText = document.createTextNode( QString::number( m_playStartTime ) ); + TQDomElement playtime = document.createElement( "playtime" ); + TQDomText playtimeText = document.createTextNode( TQString::number( m_playStartTime ) ); playtime.appendChild( playtimeText ); item.appendChild( playtime ); @@ -345,7 +345,7 @@ QDomElement SubmitItem::toDomElement( QDomDocument& document ) const //////////////////////////////////////////////////////////////////////////////// -int SubmitQueue::compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 ) +int SubmitQueue::compareItems( TQPtrCollection::Item item1, TQPtrCollection::Item item2 ) { SubmitItem *sItem1 = static_cast( item1 ); SubmitItem *sItem2 = static_cast( item2 ); @@ -372,10 +372,10 @@ int SubmitQueue::compareItems( QPtrCollection::Item item1, QPtrCollection::Item // CLASS ScrobblerSubmitter //////////////////////////////////////////////////////////////////////////////// -QString ScrobblerSubmitter::PROTOCOL_VERSION = "1.1"; -QString ScrobblerSubmitter::CLIENT_ID = "ark"; -QString ScrobblerSubmitter::CLIENT_VERSION = "1.4"; -QString ScrobblerSubmitter::HANDSHAKE_URL = "http://post.audioscrobbler.com/?hs=true"; +TQString ScrobblerSubmitter::PROTOCOL_VERSION = "1.1"; +TQString ScrobblerSubmitter::CLIENT_ID = "ark"; +TQString ScrobblerSubmitter::CLIENT_VERSION = "1.4"; +TQString ScrobblerSubmitter::HANDSHAKE_URL = "http://post.audioscrobbler.com/?hs=true"; ScrobblerSubmitter::ScrobblerSubmitter() @@ -393,7 +393,7 @@ ScrobblerSubmitter::ScrobblerSubmitter() , m_lastSubmissionFinishTime( 0 ) , m_fakeQueueLength( 0 ) { - connect( &m_timer, SIGNAL(timeout()), this, SLOT(scheduledTimeReached()) ); + connect( &m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(scheduledTimeReached()) ); readSubmitQueue(); } @@ -403,7 +403,7 @@ ScrobblerSubmitter::~ScrobblerSubmitter() // need to rescue current submit. This may meant it gets submitted twice, // but last.fm handles that, and it's better than losing it when you quit // while a submit is happening - for ( QPtrDictIterator it( m_ongoingSubmits ); it.current(); ++it ) + for ( TQPtrDictIterator it( m_ongoingSubmits ); it.current(); ++it ) m_submitQueue.inSort( it.current() ); m_ongoingSubmits.clear(); @@ -421,8 +421,8 @@ ScrobblerSubmitter::~ScrobblerSubmitter() */ void ScrobblerSubmitter::performHandshake() { - QString handshakeUrl = QString::null; - uint currentTime = QDateTime::currentDateTime( Qt::UTC ).toTime_t(); + TQString handshakeUrl = TQString::null; + uint currentTime = TQDateTime::currentDateTime( Qt::UTC ).toTime_t(); if ( PROTOCOL_VERSION == "1.1" ) { @@ -434,7 +434,7 @@ void ScrobblerSubmitter::performHandshake() // &u= handshakeUrl = HANDSHAKE_URL + - QString( + TQString( "&p=%1" "&c=%2" "&v=%3" @@ -457,7 +457,7 @@ void ScrobblerSubmitter::performHandshake() // &a= handshakeUrl = HANDSHAKE_URL + - QString( + TQString( "&p=%1" "&c=%2" "&v=%3" @@ -485,7 +485,7 @@ void ScrobblerSubmitter::performHandshake() m_inProgress = true; KIO::TransferJob* job = KIO::storedGet( handshakeUrl, false, false ); - connect( job, SIGNAL( result( KIO::Job* ) ), SLOT( audioScrobblerHandshakeResult( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), TQT_SLOT( audioScrobblerHandshakeResult( KIO::Job* ) ) ); } @@ -512,7 +512,7 @@ void ScrobblerSubmitter::submitItem( SubmitItem* item ) */ void ScrobblerSubmitter::performSubmit() { - QString data; + TQString data; // Audioscrobbler accepts max 10 tracks on one submit. SubmitItem* items[10]; @@ -561,17 +561,17 @@ void ScrobblerSubmitter::performSubmit() data += '&'; items[submitCounter] = itemFromQueue; - QDateTime playStartTime = QDateTime(); + TQDateTime playStartTime = TQDateTime(); playStartTime.setTime_t( itemFromQueue->playStartTime() ); - const QString count = QString::number( submitCounter ); + const TQString count = TQString::number( submitCounter ); data += "a[" + count + "]=" + KURL::encode_string_no_slash( itemFromQueue->artist(), 106 /*utf-8*/ ) + "&t[" + count + "]=" + KURL::encode_string_no_slash( itemFromQueue->title(), 106 /*utf-8*/ ) + "&b[" + count + "]=" + KURL::encode_string_no_slash( itemFromQueue->album(), 106 /*utf-8*/ ) + "&m[" + count + "]=" + - "&l[" + count + "]=" + QString::number( itemFromQueue->length() ) + + "&l[" + count + "]=" + TQString::number( itemFromQueue->length() ) + "&i[" + count + "]=" + KURL::encode_string_no_slash( playStartTime.toString( "yyyy-MM-dd hh:mm:ss" ) ); } } @@ -600,17 +600,17 @@ void ScrobblerSubmitter::performSubmit() Amarok::StatusBar::instance()->newProgressOperation( job ) .setDescription( i18n( "Submitting to last.fm" ) ); - connect( job, SIGNAL( result( KIO::Job* ) ), - this, SLOT( audioScrobblerSubmitResult( KIO::Job* ) ) ); - connect( job, SIGNAL( data( KIO::Job*, const QByteArray& ) ), - this, SLOT( audioScrobblerSubmitData( KIO::Job*, const QByteArray& ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), + this, TQT_SLOT( audioScrobblerSubmitResult( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( data( KIO::Job*, const TQByteArray& ) ), + this, TQT_SLOT( audioScrobblerSubmitData( KIO::Job*, const TQByteArray& ) ) ); } /** * Configures the username/password and whether to scrobble */ -void ScrobblerSubmitter::configure( const QString& username, const QString& password, bool enabled ) +void ScrobblerSubmitter::configure( const TQString& username, const TQString& password, bool enabled ) { if ( username != m_username || password != m_password ) m_needHandshake = true; @@ -665,7 +665,7 @@ void ScrobblerSubmitter::scheduledTimeReached() */ void ScrobblerSubmitter::audioScrobblerHandshakeResult( KIO::Job* job ) //SLOT { - m_prevSubmitTime = QDateTime::currentDateTime( Qt::UTC ).toTime_t(); + m_prevSubmitTime = TQDateTime::currentDateTime( Qt::UTC ).toTime_t(); m_inProgress = false; if ( job->error() ) { @@ -675,7 +675,7 @@ void ScrobblerSubmitter::audioScrobblerHandshakeResult( KIO::Job* job ) //SLOT } KIO::StoredTransferJob* const storedJob = static_cast( job ); - m_submitResultBuffer = QString::fromUtf8( storedJob->data().data(), storedJob->data().size() ); + m_submitResultBuffer = TQString::fromUtf8( storedJob->data().data(), storedJob->data().size() ); // debug() // << "Handshake result received: " @@ -689,7 +689,7 @@ void ScrobblerSubmitter::audioScrobblerHandshakeResult( KIO::Job* job ) //SLOT { m_challenge = m_submitResultBuffer.section( "\n", 1, 1 ); m_submitUrl = m_submitResultBuffer.section( "\n", 2, 2 ); - QString interval = m_submitResultBuffer.section( "\n", 3, 3 ); + TQString interval = m_submitResultBuffer.section( "\n", 3, 3 ); if ( interval.startsWith( "INTERVAL" ) ) m_interval = interval.mid( 9 ).toUInt(); @@ -704,7 +704,7 @@ void ScrobblerSubmitter::audioScrobblerHandshakeResult( KIO::Job* job ) //SLOT m_challenge = m_submitResultBuffer.section( "\n", 1, 1 ); m_submitUrl = m_submitResultBuffer.section( "\n", 2, 2 ); - QString interval = m_submitResultBuffer.section( "\n", 3, 3 ); + TQString interval = m_submitResultBuffer.section( "\n", 3, 3 ); if ( interval.startsWith( "INTERVAL" ) ) m_interval = interval.mid( 9 ).toUInt(); } @@ -712,12 +712,12 @@ void ScrobblerSubmitter::audioScrobblerHandshakeResult( KIO::Job* job ) //SLOT // INTERVAL n (protocol 1.1) else if ( m_submitResultBuffer.startsWith( "FAILED" ) ) { - QString reason = m_submitResultBuffer.mid( 0, m_submitResultBuffer.find( "\n" ) ); + TQString reason = m_submitResultBuffer.mid( 0, m_submitResultBuffer.find( "\n" ) ); if ( reason.length() > 6 ) reason = reason.mid( 7 ).stripWhiteSpace(); warning() << "Handshake failed (" << reason << ")" << endl; - QString interval = m_submitResultBuffer.section( "\n", 1, 1 ); + TQString interval = m_submitResultBuffer.section( "\n", 1, 1 ); if ( interval.startsWith( "INTERVAL" ) ) m_interval = interval.mid( 9 ).toUInt(); } @@ -727,7 +727,7 @@ void ScrobblerSubmitter::audioScrobblerHandshakeResult( KIO::Job* job ) //SLOT m_submitResultBuffer.startsWith( "BADAUTH" ) ) { warning() << "Handshake failed (Authentication failed)" << endl; - QString interval = m_submitResultBuffer.section( "\n", 1, 1 ); + TQString interval = m_submitResultBuffer.section( "\n", 1, 1 ); if ( interval.startsWith( "INTERVAL" ) ) m_interval = interval.mid( 9 ).toUInt(); } @@ -745,7 +745,7 @@ void ScrobblerSubmitter::audioScrobblerHandshakeResult( KIO::Job* job ) //SLOT */ void ScrobblerSubmitter::audioScrobblerSubmitResult( KIO::Job* job ) //SLOT { - m_prevSubmitTime = QDateTime::currentDateTime( Qt::UTC ).toTime_t(); + m_prevSubmitTime = TQDateTime::currentDateTime( Qt::UTC ).toTime_t(); m_inProgress = false; if ( job->error() ) { @@ -763,7 +763,7 @@ void ScrobblerSubmitter::audioScrobblerSubmitResult( KIO::Job* job ) //SLOT if (m_submitResultBuffer.startsWith( "OK" ) ) { debug() << "Submit successful" << endl; - QString interval = m_submitResultBuffer.section( "\n", 1, 1 ); + TQString interval = m_submitResultBuffer.section( "\n", 1, 1 ); if ( interval.startsWith( "INTERVAL" ) ) m_interval = interval.mid( 9 ).toUInt(); @@ -773,13 +773,13 @@ void ScrobblerSubmitter::audioScrobblerSubmitResult( KIO::Job* job ) //SLOT // INTERVAL n (protocol 1.1) else if ( m_submitResultBuffer.startsWith( "FAILED" ) ) { - QString reason = m_submitResultBuffer.mid( 0, m_submitResultBuffer.find( "\n" ) ); + TQString reason = m_submitResultBuffer.mid( 0, m_submitResultBuffer.find( "\n" ) ); if ( reason.length() > 6 ) reason = reason.mid( 7 ).stripWhiteSpace(); warning() << "Submit failed (" << reason << ")" << endl; - QString interval = m_submitResultBuffer.section( "\n", 1, 1 ); + TQString interval = m_submitResultBuffer.section( "\n", 1, 1 ); if ( interval.startsWith( "INTERVAL" ) ) m_interval = interval.mid( 9 ).toUInt(); @@ -791,11 +791,11 @@ void ScrobblerSubmitter::audioScrobblerSubmitResult( KIO::Job* job ) //SLOT { warning() << "Submit failed (Authentication failed)" << endl; - QString interval = m_submitResultBuffer.section( "\n", 1, 1 ); + TQString interval = m_submitResultBuffer.section( "\n", 1, 1 ); if ( interval.startsWith( "INTERVAL" ) ) m_interval = interval.mid( 9 ).toUInt(); - m_challenge = QString::null; + m_challenge = TQString::null; enqueueJob( job ); } else @@ -810,10 +810,10 @@ void ScrobblerSubmitter::audioScrobblerSubmitResult( KIO::Job* job ) //SLOT * Receives the data from the TransferJob. */ void ScrobblerSubmitter::audioScrobblerSubmitData( - KIO::Job*, const QByteArray& data ) //SLOT + KIO::Job*, const TQByteArray& data ) //SLOT { // Append new chunk of string - m_submitResultBuffer += QString::fromUtf8( data, data.size() ); + m_submitResultBuffer += TQString::fromUtf8( data, data.size() ); } @@ -891,7 +891,7 @@ SubmitItem* ScrobblerSubmitter::dequeueItem() SubmitItem* item = 0; if( m_lastSubmissionFinishTime > 0 && !m_holdFakeQueue && m_fakeQueue.getFirst() ) { - uint limit = QDateTime::currentDateTime( Qt::UTC ).toTime_t(); + uint limit = TQDateTime::currentDateTime( Qt::UTC ).toTime_t(); if ( m_submitQueue.getFirst() ) if ( m_submitQueue.getFirst()->playStartTime() <= limit ) @@ -995,7 +995,7 @@ void ScrobblerSubmitter::finishJob( KIO::Job* job ) */ void ScrobblerSubmitter::announceSubmit( SubmitItem *item, int tracks, bool success ) const { - QString _long, _short; + TQString _long, _short; if ( success ) { @@ -1038,7 +1038,7 @@ void ScrobblerSubmitter::announceSubmit( SubmitItem *item, int tracks, bool succ void ScrobblerSubmitter::saveSubmitQueue() { - QFile file( m_savePath ); + TQFile file( m_savePath ); if( !file.open( IO_WriteOnly ) ) { @@ -1047,10 +1047,10 @@ void ScrobblerSubmitter::saveSubmitQueue() } if ( m_lastSubmissionFinishTime == 0 ) - m_lastSubmissionFinishTime = QDateTime::currentDateTime( Qt::UTC ).toTime_t(); + m_lastSubmissionFinishTime = TQDateTime::currentDateTime( Qt::UTC ).toTime_t(); - QDomDocument newdoc; - QDomElement submitQueue = newdoc.createElement( "submit" ); + TQDomDocument newdoc; + TQDomElement submitQueue = newdoc.createElement( "submit" ); submitQueue.setAttribute( "product", "Amarok" ); submitQueue.setAttribute( "version", APP_VERSION ); submitQueue.setAttribute( "lastSubmissionFinishTime", m_lastSubmissionFinishTime ); @@ -1059,22 +1059,22 @@ void ScrobblerSubmitter::saveSubmitQueue() for ( uint idx = 0; idx < m_submitQueue.count(); idx++ ) { SubmitItem *item = m_submitQueue.at( idx ); - QDomElement i = item->toDomElement( newdoc ); + TQDomElement i = item->toDomElement( newdoc ); submitQueue.appendChild( i ); } m_fakeQueue.first(); for ( uint idx = 0; idx < m_fakeQueue.count(); idx++ ) { SubmitItem *item = m_fakeQueue.at( idx ); - QDomElement i = item->toDomElement( newdoc ); + TQDomElement i = item->toDomElement( newdoc ); submitQueue.appendChild( i ); } - QDomNode submitNode = newdoc.importNode( submitQueue, true ); + TQDomNode submitNode = newdoc.importNode( submitQueue, true ); newdoc.appendChild( submitNode ); - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); stream << "\n"; stream << newdoc.toString(); file.close(); @@ -1084,7 +1084,7 @@ void ScrobblerSubmitter::saveSubmitQueue() void ScrobblerSubmitter::readSubmitQueue() { m_savePath = Amarok::saveLocation() + "submit.xml"; - QFile file( m_savePath ); + TQFile file( m_savePath ); if ( !file.open( IO_ReadOnly ) ) { @@ -1092,10 +1092,10 @@ void ScrobblerSubmitter::readSubmitQueue() return; } - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); - QDomDocument d; + TQDomDocument d; if( !d.setContent( stream.read() ) ) { debug() << "Couldn't read file: " << m_savePath << endl; @@ -1108,9 +1108,9 @@ void ScrobblerSubmitter::readSubmitQueue() if(last && last > m_lastSubmissionFinishTime) m_lastSubmissionFinishTime = last; - const QString ITEM( "item" ); //so we don't construct these QStrings all the time + const TQString ITEM( "item" ); //so we don't construct these QStrings all the time - for( QDomNode n = d.namedItem( "submit" ).firstChild(); !n.isNull() && n.nodeName() == ITEM; n = n.nextSibling() ) + for( TQDomNode n = d.namedItem( "submit" ).firstChild(); !n.isNull() && n.nodeName() == ITEM; n = n.nextSibling() ) enqueueItem( new SubmitItem( n.toElement() ) ); m_submitQueue.first(); @@ -1127,7 +1127,7 @@ bool ScrobblerSubmitter::schedule( bool failure ) if ( m_inProgress || !canSubmit() ) return false; - uint when, currentTime = QDateTime::currentDateTime( Qt::UTC ).toTime_t(); + uint when, currentTime = TQDateTime::currentDateTime( Qt::UTC ).toTime_t(); if ( currentTime - m_prevSubmitTime > m_interval ) when = 0; else @@ -1143,7 +1143,7 @@ bool ScrobblerSubmitter::schedule( bool failure ) if ( m_needHandshake || m_challenge.isEmpty() ) { - m_challenge = QString::null; + m_challenge = TQString::null; m_needHandshake = false; if ( when == 0 ) diff --git a/amarok/src/scrobbler.h b/amarok/src/scrobbler.h index 9373c253..663dc90f 100644 --- a/amarok/src/scrobbler.h +++ b/amarok/src/scrobbler.h @@ -8,23 +8,23 @@ #define AMAROK_SCROBBLER_H #include "engineobserver.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include //some setups require this #undef PROTOCOL_VERSION namespace KIO { class Job; } -class QStringList; +class TQStringList; class SubmitItem; class SubmitQueue; class ScrobblerSubmitter; -class Scrobbler : public QObject, public EngineObserver +class Scrobbler : public TQObject, public EngineObserver { friend class MediaDevice; @@ -33,11 +33,11 @@ class Scrobbler : public QObject, public EngineObserver public: static Scrobbler *instance(); - void similarArtists( const QString & /*artist*/ ); + void similarArtists( const TQString & /*artist*/ ); void applySettings(); signals: - void similarArtistsFetched( const QString& artist, const QStringList& suggestions ); + void similarArtistsFetched( const TQString& artist, const TQStringList& suggestions ); public slots: void subTrack( long currentPos, long startPos, long endPos ); // cuefiles can update length without track change @@ -52,14 +52,14 @@ class Scrobbler : public QObject, public EngineObserver private slots: void audioScrobblerSimilarArtistsResult( KIO::Job* /*job*/ ); void audioScrobblerSimilarArtistsData( - KIO::Job* /*job*/, const QByteArray& /*data*/ ); + KIO::Job* /*job*/, const TQByteArray& /*data*/ ); private: - QTimer m_timer; //works around xine bug + TQTimer m_timer; //works around xine bug //http://sourceforge.net/tracker/index.php?func=detail&aid=1401026&group_id=9655&atid=109655 - QByteArray m_similarArtistsBuffer; + TQByteArray m_similarArtistsBuffer; KIO::Job* m_similarArtistsJob; - QString m_artist; + TQString m_artist; bool m_validForSending; long m_startPos; ScrobblerSubmitter* m_submitter; @@ -73,42 +73,42 @@ class SubmitItem public: SubmitItem( - const QString& /*artist*/, - const QString& /*album*/, - const QString& /*title*/, + const TQString& /*artist*/, + const TQString& /*album*/, + const TQString& /*title*/, int /*length*/, bool now = true ); - SubmitItem( const QDomElement& /* domElement */ ); + SubmitItem( const TQDomElement& /* domElement */ ); SubmitItem(); bool operator==( const SubmitItem& item ); - void setArtist( const QString& artist ) { m_artist = artist; } - void setAlbum( const QString& album ) { m_album = album; } - void setTitle( const QString& title ) { m_title = title; } - const QString artist() const { return m_artist; } - const QString album() const { return m_album; } - const QString title() const { return m_title; } + void setArtist( const TQString& artist ) { m_artist = artist; } + void setAlbum( const TQString& album ) { m_album = album; } + void setTitle( const TQString& title ) { m_title = title; } + const TQString artist() const { return m_artist; } + const TQString album() const { return m_album; } + const TQString title() const { return m_title; } int length() const { return m_length; } uint playStartTime() const { return m_playStartTime; } - QDomElement toDomElement( QDomDocument& /* document */ ) const; + TQDomElement toDomElement( TQDomDocument& /* document */ ) const; bool valid() const { return !m_artist.isEmpty() && !m_title.isEmpty() && m_length >= 30; } private: - QString m_artist; - QString m_album; - QString m_title; + TQString m_artist; + TQString m_album; + TQString m_title; int m_length; uint m_playStartTime; }; -class SubmitQueue : public QPtrList +class SubmitQueue : public TQPtrList { protected: - int compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 ); + int compareItems( TQPtrCollection::Item item1, TQPtrCollection::Item item2 ); }; @@ -117,17 +117,17 @@ class ScrobblerSubmitter : public QObject Q_OBJECT public: - static QString PROTOCOL_VERSION; - static QString CLIENT_ID; - static QString CLIENT_VERSION; - static QString HANDSHAKE_URL; + static TQString PROTOCOL_VERSION; + static TQString CLIENT_ID; + static TQString CLIENT_VERSION; + static TQString HANDSHAKE_URL; ScrobblerSubmitter(); ~ScrobblerSubmitter(); void submitItem( SubmitItem* /* item */ ); - void configure( const QString& /*username*/, const QString& /* password*/, bool /*enabled*/ ); + void configure( const TQString& /*username*/, const TQString& /* password*/, bool /*enabled*/ ); void syncComplete(); @@ -136,7 +136,7 @@ class ScrobblerSubmitter : public QObject void audioScrobblerHandshakeResult( KIO::Job* /*job*/ ); void audioScrobblerSubmitResult( KIO::Job* /*job*/ ); void audioScrobblerSubmitData( - KIO::Job* /*job*/, const QByteArray& /*data*/ ); + KIO::Job* /*job*/, const TQByteArray& /*data*/ ); private: bool canSubmit() const; @@ -157,12 +157,12 @@ class ScrobblerSubmitter : public QObject static const int MIN_BACKOFF = 60; static const int MAX_BACKOFF = 60 * 60; - QString m_submitResultBuffer; - QString m_username; - QString m_password; - QString m_submitUrl; - QString m_challenge; - QString m_savePath; + TQString m_submitResultBuffer; + TQString m_username; + TQString m_password; + TQString m_submitUrl; + TQString m_challenge; + TQString m_savePath; bool m_scrobblerEnabled; bool m_holdFakeQueue; bool m_inProgress; @@ -173,11 +173,11 @@ class ScrobblerSubmitter : public QObject uint m_lastSubmissionFinishTime; uint m_fakeQueueLength; - QPtrDict m_ongoingSubmits; + TQPtrDict m_ongoingSubmits; SubmitQueue m_submitQueue; // songs played by Amarok SubmitQueue m_fakeQueue; // songs for which play times have to be faked (e.g. when submitting from media device) - QTimer m_timer; + TQTimer m_timer; }; diff --git a/amarok/src/sliderwidget.cpp b/amarok/src/sliderwidget.cpp index d86b7af6..453efff6 100644 --- a/amarok/src/sliderwidget.cpp +++ b/amarok/src/sliderwidget.cpp @@ -26,13 +26,13 @@ #include "enginecontroller.h" #include "sliderwidget.h" -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -41,8 +41,8 @@ #include #include -Amarok::Slider::Slider( Qt::Orientation orientation, QWidget *parent, uint max ) - : QSlider( orientation, parent ) +Amarok::Slider::Slider( Qt::Orientation orientation, TQWidget *parent, uint max ) + : TQSlider( orientation, parent ) , m_sliding( false ) , m_outside( false ) , m_prevValue( 0 ) @@ -51,7 +51,7 @@ Amarok::Slider::Slider( Qt::Orientation orientation, QWidget *parent, uint max ) } void -Amarok::Slider::wheelEvent( QWheelEvent *e ) +Amarok::Slider::wheelEvent( TQWheelEvent *e ) { if( orientation() == Qt::Vertical ) { // Will be handled by the parent widget @@ -61,26 +61,26 @@ Amarok::Slider::wheelEvent( QWheelEvent *e ) // Position Slider (horizontal) int step = e->delta() * 1500 / 18; - int nval = QSlider::value() + step; + int nval = TQSlider::value() + step; nval = QMAX(nval, minValue()); nval = QMIN(nval, maxValue()); - QSlider::setValue( nval ); + TQSlider::setValue( nval ); emit sliderReleased( value() ); } void -Amarok::Slider::mouseMoveEvent( QMouseEvent *e ) +Amarok::Slider::mouseMoveEvent( TQMouseEvent *e ) { if ( m_sliding ) { //feels better, but using set value of 20 is bad of course - QRect rect( -20, -20, width()+40, height()+40 ); + TQRect rect( -20, -20, width()+40, height()+40 ); if ( orientation() == Horizontal && !rect.contains( e->pos() ) ) { if ( !m_outside ) - QSlider::setValue( m_prevValue ); + TQSlider::setValue( m_prevValue ); m_outside = true; } else { m_outside = false; @@ -88,33 +88,33 @@ Amarok::Slider::mouseMoveEvent( QMouseEvent *e ) emit sliderMoved( value() ); } } - else QSlider::mouseMoveEvent( e ); + else TQSlider::mouseMoveEvent( e ); } void -Amarok::Slider::slideEvent( QMouseEvent *e ) +Amarok::Slider::slideEvent( TQMouseEvent *e ) { - QSlider::setValue( orientation() == Horizontal - ? ((QApplication::reverseLayout()) - ? QRangeControl::valueFromPosition( width() - (e->pos().x() - sliderRect().width()/2), width() + sliderRect().width() ) - : QRangeControl::valueFromPosition( e->pos().x() - sliderRect().width()/2, width() - sliderRect().width() ) ) - : QRangeControl::valueFromPosition( e->pos().y() - sliderRect().height()/2, height() - sliderRect().height() ) ); + TQSlider::setValue( orientation() == Horizontal + ? ((TQApplication::reverseLayout()) + ? TQRangeControl::valueFromPosition( width() - (e->pos().x() - sliderRect().width()/2), width() + sliderRect().width() ) + : TQRangeControl::valueFromPosition( e->pos().x() - sliderRect().width()/2, width() - sliderRect().width() ) ) + : TQRangeControl::valueFromPosition( e->pos().y() - sliderRect().height()/2, height() - sliderRect().height() ) ); } void -Amarok::Slider::mousePressEvent( QMouseEvent *e ) +Amarok::Slider::mousePressEvent( TQMouseEvent *e ) { m_sliding = true; - m_prevValue = QSlider::value(); + m_prevValue = TQSlider::value(); if ( !sliderRect().contains( e->pos() ) ) mouseMoveEvent( e ); } void -Amarok::Slider::mouseReleaseEvent( QMouseEvent* ) +Amarok::Slider::mouseReleaseEvent( TQMouseEvent* ) { - if( !m_outside && QSlider::value() != m_prevValue ) + if( !m_outside && TQSlider::value() != m_prevValue ) emit sliderReleased( value() ); m_sliding = false; @@ -127,7 +127,7 @@ Amarok::Slider::setValue( int newValue ) //don't adjust the slider while the user is dragging it! if ( !m_sliding || m_outside ) - QSlider::setValue( adjustValue( newValue ) ); + TQSlider::setValue( adjustValue( newValue ) ); else m_prevValue = newValue; } @@ -141,7 +141,7 @@ Amarok::Slider::setValue( int newValue ) #define MARGIN 3 Amarok::PrettySlider::PrettySlider( Qt::Orientation orientation, SliderMode mode, - QWidget *parent, uint max ) + TQWidget *parent, uint max ) : Amarok::Slider( orientation, parent, max ) , m_mode( mode ) , m_showingMoodbar( false ) @@ -149,22 +149,22 @@ Amarok::PrettySlider::PrettySlider( Qt::Orientation orientation, SliderMode mode if( m_mode == Pretty) { setWFlags( Qt::WNoAutoErase ); - setFocusPolicy( QWidget::NoFocus ); + setFocusPolicy( TQWidget::NoFocus ); } // We only have to connect this *once*, since our MetaBundle // doesn't get destroyed until we do. - connect( &m_bundle.moodbar(), SIGNAL( jobEvent( int ) ), - SLOT( moodbarJobEvent( int ) ) ); + connect( &m_bundle.moodbar(), TQT_SIGNAL( jobEvent( int ) ), + TQT_SLOT( moodbarJobEvent( int ) ) ); // We want to know if we should reset our moodbar data - connect( App::instance(), SIGNAL( moodbarPrefs( bool, bool, int, bool ) ), - SLOT( slotMoodbarPrefs( bool, bool, int, bool ) ) ); + connect( App::instance(), TQT_SIGNAL( moodbarPrefs( bool, bool, int, bool ) ), + TQT_SLOT( slotMoodbarPrefs( bool, bool, int, bool ) ) ); } void -Amarok::PrettySlider::mousePressEvent( QMouseEvent *e ) +Amarok::PrettySlider::mousePressEvent( TQMouseEvent *e ) { Amarok::Slider::mousePressEvent( e ); @@ -172,25 +172,25 @@ Amarok::PrettySlider::mousePressEvent( QMouseEvent *e ) } void -Amarok::PrettySlider::slideEvent( QMouseEvent *e ) +Amarok::PrettySlider::slideEvent( TQMouseEvent *e ) { if( m_mode == Pretty || m_showingMoodbar ) - QSlider::setValue( orientation() == Horizontal - ? QRangeControl::valueFromPosition( e->pos().x(), width()-2 ) - : QRangeControl::valueFromPosition( e->pos().y(), height()-2 ) ); + TQSlider::setValue( orientation() == Horizontal + ? TQRangeControl::valueFromPosition( e->pos().x(), width()-2 ) + : TQRangeControl::valueFromPosition( e->pos().y(), height()-2 ) ); else Amarok::Slider::slideEvent( e ); } namespace Amarok { namespace ColorScheme { - extern QColor Background; - extern QColor Foreground; + extern TQColor Background; + extern TQColor Foreground; } } void -Amarok::PrettySlider::paintEvent( QPaintEvent *e ) +Amarok::PrettySlider::paintEvent( TQPaintEvent *e ) { const int w = orientation() == Qt::Horizontal ? width() : height(); const int pos = int( double( w-2 ) / maxValue() * Slider::value() ); @@ -199,7 +199,7 @@ Amarok::PrettySlider::paintEvent( QPaintEvent *e ) m_showingMoodbar = ( !m_bundle.url().isEmpty() && m_bundle.moodbar().dataExists() && AmarokConfig::showMoodbar() ); - QPixmap mood; + TQPixmap mood; if( m_showingMoodbar ) { if( m_mode == Normal ) @@ -214,8 +214,8 @@ Amarok::PrettySlider::paintEvent( QPaintEvent *e ) return; } - QPixmap buf( size() ); - QPainter p( &buf, this ); + TQPixmap buf( size() ); + TQPainter p( &buf, this ); buf.fill( parentWidget()->backgroundColor() ); @@ -229,7 +229,7 @@ Amarok::PrettySlider::paintEvent( QPaintEvent *e ) { p.translate( 0, MARGIN ); p.setPen( Amarok::ColorScheme::Foreground ); - p.fillRect( 0, 0, pos, h, QColor( Amarok::ColorScheme::Background ) ); + p.fillRect( 0, 0, pos, h, TQColor( Amarok::ColorScheme::Background ) ); p.drawRect( 0, 0, w, h ); p.translate( 0, -MARGIN ); } @@ -247,7 +247,7 @@ Amarok::PrettySlider::paintEvent( QPaintEvent *e ) // if( m_mode == Pretty ) { - QPointArray pa( 3 ); + TQPointArray pa( 3 ); pa.setPoint( 0, pos - 3, 1 ); pa.setPoint( 1, pos + 3, 1 ); pa.setPoint( 2, pos, 5 ); @@ -257,7 +257,7 @@ Amarok::PrettySlider::paintEvent( QPaintEvent *e ) else if( m_mode == Normal ) { - QPointArray pa( 3 ); + TQPointArray pa( 3 ); pa.setPoint( 0, pos - 5, 1 ); pa.setPoint( 1, pos + 5, 1 ); pa.setPoint( 2, pos, 9 ); @@ -341,8 +341,8 @@ Amarok::PrettySlider::sizeHint() const constPolish(); return (orientation() == Horizontal - ? QSize( maxValue(), THICKNESS + MARGIN ) - : QSize( THICKNESS + MARGIN, maxValue() )).expandedTo( QApplit ication::globalStrut() ); + ? TQSize( maxValue(), THICKNESS + MARGIN ) + : TQSize( THICKNESS + MARGIN, maxValue() )).expandedTo( QApplit ication::globalStrut() ); } #endif @@ -350,26 +350,26 @@ Amarok::PrettySlider::sizeHint() const /// CLASS VolumeSlider ////////////////////////////////////////////////////////////////////////////////////////// -Amarok::VolumeSlider::VolumeSlider( QWidget *parent, uint max ) +Amarok::VolumeSlider::VolumeSlider( TQWidget *parent, uint max ) : Amarok::Slider( Qt::Horizontal, parent, max ) , m_animCount( 0 ) - , m_animTimer( new QTimer( this ) ) - , m_pixmapInset( QPixmap( locate( "data","amarok/images/volumeslider-inset.png" ) ) ) + , m_animTimer( new TQTimer( this ) ) + , m_pixmapInset( TQPixmap( locate( "data","amarok/images/volumeslider-inset.png" ) ) ) { setWFlags( getWFlags() | WNoAutoErase ); - setFocusPolicy( QWidget::NoFocus ); + setFocusPolicy( TQWidget::NoFocus ); // BEGIN Calculate handle animation pixmaps for mouse-over effect - QImage pixmapHandle ( locate( "data","amarok/images/volumeslider-handle.png" ) ); - QImage pixmapHandleGlow( locate( "data","amarok/images/volumeslider-handle_glow.png" ) ); + TQImage pixmapHandle ( locate( "data","amarok/images/volumeslider-handle.png" ) ); + TQImage pixmapHandleGlow( locate( "data","amarok/images/volumeslider-handle_glow.png" ) ); float opacity = 0.0; const float step = 1.0 / ANIM_MAX; - QImage dst; + TQImage dst; for ( int i = 0; i < ANIM_MAX; ++i ) { dst = pixmapHandle; KImageEffect::blend( pixmapHandleGlow, dst, opacity ); - m_handlePixmaps.append( QPixmap( dst ) ); + m_handlePixmaps.append( TQPixmap( dst ) ); opacity += step; } // END @@ -379,19 +379,19 @@ Amarok::VolumeSlider::VolumeSlider( QWidget *parent, uint max ) setMinimumWidth( m_pixmapInset.width() ); setMinimumHeight( m_pixmapInset.height() ); - connect( m_animTimer, SIGNAL( timeout() ), this, SLOT( slotAnimTimer() ) ); + connect( m_animTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotAnimTimer() ) ); } void Amarok::VolumeSlider::generateGradient() { - //QImage temp( locate( "data","amarok/images/volumeslider-gradient.png" ) ); + //TQImage temp( locate( "data","amarok/images/volumeslider-gradient.png" ) ); //KIconEffect::colorize( temp, colorGroup().highlight(), 1.0 ); - const QPixmap temp( locate( "data","amarok/images/volumeslider-gradient.png" ) ); - const QBitmap mask( temp.createHeuristicMask() ); + const TQPixmap temp( locate( "data","amarok/images/volumeslider-gradient.png" ) ); + const TQBitmap mask( temp.createHeuristicMask() ); - m_pixmapGradient = QPixmap( m_pixmapInset.size() ); + m_pixmapGradient = TQPixmap( m_pixmapInset.size() ); KPixmapEffect::gradient( m_pixmapGradient, colorGroup().background(), colorGroup().highlight(), KPixmapEffect::HorizontalGradient ); m_pixmapGradient.setMask( mask ); @@ -414,7 +414,7 @@ Amarok::VolumeSlider::slotAnimTimer() //SLOT } void -Amarok::VolumeSlider::mousePressEvent( QMouseEvent *e ) +Amarok::VolumeSlider::mousePressEvent( TQMouseEvent *e ) { if( e->button() != RightButton ) { Amarok::Slider::mousePressEvent( e ); @@ -423,7 +423,7 @@ Amarok::VolumeSlider::mousePressEvent( QMouseEvent *e ) } void -Amarok::VolumeSlider::contextMenuEvent( QContextMenuEvent *e ) +Amarok::VolumeSlider::contextMenuEvent( TQContextMenuEvent *e ) { KPopupMenu menu; menu.insertTitle( i18n( "Volume" ) ); @@ -438,44 +438,44 @@ Amarok::VolumeSlider::contextMenuEvent( QContextMenuEvent *e ) { menu.insertSeparator(); menu.insertItem( SmallIconSet( "equalizer" ), i18n( "&Equalizer" ), - kapp, SLOT( slotConfigEqualizer() ) ); + kapp, TQT_SLOT( slotConfigEqualizer() ) ); } const int n = menu.exec( mapToGlobal( e->pos() ) ); if( n >= 0 ) { - QSlider::setValue( n ); + TQSlider::setValue( n ); emit sliderReleased( n ); } } void -Amarok::VolumeSlider::slideEvent( QMouseEvent *e ) +Amarok::VolumeSlider::slideEvent( TQMouseEvent *e ) { - QSlider::setValue( QRangeControl::valueFromPosition( e->pos().x(), width()-2 ) ); + TQSlider::setValue( TQRangeControl::valueFromPosition( e->pos().x(), width()-2 ) ); } void -Amarok::VolumeSlider::wheelEvent( QWheelEvent *e ) +Amarok::VolumeSlider::wheelEvent( TQWheelEvent *e ) { const uint step = e->delta() / Amarok::VOLUME_SENSITIVITY; - QSlider::setValue( QSlider::value() + step ); + TQSlider::setValue( TQSlider::value() + step ); emit sliderReleased( value() ); } void -Amarok::VolumeSlider::paintEvent( QPaintEvent * ) +Amarok::VolumeSlider::paintEvent( TQPaintEvent * ) { - QPixmap buf( size() ); + TQPixmap buf( size() ); // Erase background if( parentWidget()->backgroundPixmap() ) buf.fill( parentWidget(), pos() ); else { buf.fill( colorGroup().background() ); -// QPainter p( &buf ); -// p.fillRect( rect(), qApp->palette().brush( QPalette::Active, QColorGroup::Background ) ); +// TQPainter p( &buf ); +// p.fillRect( rect(), qApp->palette().brush( TQPalette::Active, TQColorGroup::Background ) ); } const int padding = 7; @@ -486,26 +486,26 @@ Amarok::VolumeSlider::paintEvent( QPaintEvent * ) bitBlt( &buf, offset - m_handlePixmaps[0].width() / 2 + padding, 0, &m_handlePixmaps[m_animCount] ); // Draw percentage number - QPainter p( &buf ); - p.setPen( palette().color( QPalette::Disabled, QColorGroup::Text ).dark() ); - QFont font; + TQPainter p( &buf ); + p.setPen( palette().color( TQPalette::Disabled, TQColorGroup::Text ).dark() ); + TQFont font; font.setPixelSize( 9 ); p.setFont( font ); - const QRect rect( 0, 0, 34, 15 ); - p.drawText( rect, Qt::AlignRight | Qt::AlignVCenter, QString::number( value() ) + '%' ); + const TQRect rect( 0, 0, 34, 15 ); + p.drawText( rect, Qt::AlignRight | Qt::AlignVCenter, TQString::number( value() ) + '%' ); p.end(); bitBlt( this, 0, 0, &buf ); } void -Amarok::VolumeSlider::hideEvent( QHideEvent* ) +Amarok::VolumeSlider::hideEvent( TQHideEvent* ) { setBackgroundMode( PaletteBackground ); // Required to prevent erasing } void -Amarok::VolumeSlider::showEvent( QShowEvent* ) +Amarok::VolumeSlider::showEvent( TQShowEvent* ) { // HACK To prevent ugly uninitialised background when the window is shown, // needed because we use NoBackground to prevent flickering while painting @@ -513,7 +513,7 @@ Amarok::VolumeSlider::showEvent( QShowEvent* ) } void -Amarok::VolumeSlider::enterEvent( QEvent* ) +Amarok::VolumeSlider::enterEvent( TQEvent* ) { m_animEnter = true; m_animCount = 0; @@ -522,7 +522,7 @@ Amarok::VolumeSlider::enterEvent( QEvent* ) } void -Amarok::VolumeSlider::leaveEvent( QEvent* ) +Amarok::VolumeSlider::leaveEvent( TQEvent* ) { // This can happen if you enter and leave the widget quickly if ( m_animCount == 0 ) @@ -533,7 +533,7 @@ Amarok::VolumeSlider::leaveEvent( QEvent* ) } void -Amarok::VolumeSlider::paletteChange( const QPalette& ) +Amarok::VolumeSlider::paletteChange( const TQPalette& ) { generateGradient(); } diff --git a/amarok/src/sliderwidget.h b/amarok/src/sliderwidget.h index 6a27f08a..1fa7d63a 100644 --- a/amarok/src/sliderwidget.h +++ b/amarok/src/sliderwidget.h @@ -26,12 +26,12 @@ #include #include -#include -#include -#include +#include +#include +#include -class QPalette; -class QTimer; +class TQPalette; +class TQTimer; namespace Amarok { @@ -40,14 +40,14 @@ namespace Amarok Q_OBJECT public: - Slider( Qt::Orientation, QWidget*, uint max = 0 ); + Slider( Qt::Orientation, TQWidget*, uint max = 0 ); virtual void setValue( int ); //WARNING non-virtual - and thus only really intended for internal use //this is a major flaw in the class presently, however it suits our //current needs fine - int value() const { return adjustValue( QSlider::value() ); } + int value() const { return adjustValue( TQSlider::value() ); } signals: //we emit this when the user has specifically changed the slider @@ -56,11 +56,11 @@ namespace Amarok void sliderReleased( int ); protected: - virtual void wheelEvent( QWheelEvent* ); - virtual void mouseMoveEvent( QMouseEvent* ); - virtual void mouseReleaseEvent( QMouseEvent* ); - virtual void mousePressEvent( QMouseEvent* ); - virtual void slideEvent( QMouseEvent* ); + virtual void wheelEvent( TQWheelEvent* ); + virtual void mouseMoveEvent( TQMouseEvent* ); + virtual void mouseReleaseEvent( TQMouseEvent* ); + virtual void mousePressEvent( TQMouseEvent* ); + virtual void slideEvent( TQMouseEvent* ); bool m_sliding; @@ -92,14 +92,14 @@ namespace Amarok } SliderMode; PrettySlider( Qt::Orientation orientation, SliderMode mode, - QWidget *parent, uint max = 0 ); + TQWidget *parent, uint max = 0 ); virtual void newBundle( const MetaBundle &bundle ); protected: - virtual void paintEvent( QPaintEvent *e ); - virtual void slideEvent( QMouseEvent* ); - virtual void mousePressEvent( QMouseEvent* ); + virtual void paintEvent( TQPaintEvent *e ); + virtual void slideEvent( TQMouseEvent* ); + virtual void mousePressEvent( TQMouseEvent* ); protected slots: void moodbarJobEvent( int newState ); @@ -119,19 +119,19 @@ namespace Amarok Q_OBJECT public: - VolumeSlider( QWidget *parent, uint max = 0 ); + VolumeSlider( TQWidget *parent, uint max = 0 ); protected: - virtual void paintEvent( QPaintEvent* ); - virtual void hideEvent( QHideEvent* ); - virtual void showEvent( QShowEvent* ); - virtual void enterEvent( QEvent* ); - virtual void leaveEvent( QEvent* ); - virtual void paletteChange( const QPalette& ); - virtual void slideEvent( QMouseEvent* ); - virtual void mousePressEvent( QMouseEvent* ); - virtual void contextMenuEvent( QContextMenuEvent* ); - virtual void wheelEvent( QWheelEvent *e ); + virtual void paintEvent( TQPaintEvent* ); + virtual void hideEvent( TQHideEvent* ); + virtual void showEvent( TQShowEvent* ); + virtual void enterEvent( TQEvent* ); + virtual void leaveEvent( TQEvent* ); + virtual void paletteChange( const TQPalette& ); + virtual void slideEvent( TQMouseEvent* ); + virtual void mousePressEvent( TQMouseEvent* ); + virtual void contextMenuEvent( TQContextMenuEvent* ); + virtual void wheelEvent( TQWheelEvent *e ); private slots: virtual void slotAnimTimer(); @@ -148,12 +148,12 @@ namespace Amarok bool m_animEnter; int m_animCount; - QTimer* m_animTimer; + TQTimer* m_animTimer; - QPixmap m_pixmapInset; + TQPixmap m_pixmapInset; KPixmap m_pixmapGradient; - QValueVector m_handlePixmaps; + TQValueVector m_handlePixmaps; }; } diff --git a/amarok/src/smartplaylisteditor.cpp b/amarok/src/smartplaylisteditor.cpp index ad8a92d3..3ff864ee 100644 --- a/amarok/src/smartplaylisteditor.cpp +++ b/amarok/src/smartplaylisteditor.cpp @@ -19,18 +19,18 @@ #include #include -#include -#include -#include //loadEditWidgets() -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include //loadEditWidgets() +#include +#include +#include +#include +#include +#include +#include +#include +#include enum Fields { @@ -57,14 +57,14 @@ enum Fields }; -QStringList m_fields; -QStringList m_dbFields; -QStringList m_expandableFields; -QStringList m_expandableDbFields; +TQStringList m_fields; +TQStringList m_dbFields; +TQStringList m_expandableFields; +TQStringList m_expandableDbFields; -SmartPlaylistEditor::SmartPlaylistEditor( QString defaultName, QWidget *parent, const char *name ) +SmartPlaylistEditor::SmartPlaylistEditor( TQString defaultName, TQWidget *parent, const char *name ) : KDialogBase( parent, name, true, i18n("Create Smart Playlist"), Ok|Cancel, Ok, true ) { @@ -74,25 +74,25 @@ SmartPlaylistEditor::SmartPlaylistEditor( QString defaultName, QWidget *parent, } -SmartPlaylistEditor::SmartPlaylistEditor( QWidget *parent, QDomElement xml, const char *name) +SmartPlaylistEditor::SmartPlaylistEditor( TQWidget *parent, TQDomElement xml, const char *name) : KDialogBase( parent, name, true, i18n("Edit Smart Playlist"), Ok|Cancel, Ok, true ) { init( xml.attribute( "name" ) ); // matches - QDomNodeList matchesList = xml.elementsByTagName( "matches" ); + TQDomNodeList matchesList = xml.elementsByTagName( "matches" ); bool matchedANY = false, matchedALL = false; m_matchAllCheck->setChecked( true ); m_matchAnyCheck->setChecked( true ); for (int i = 0, m = matchesList.count(); isetChecked( true ); - QDomElement orderby = orderbyList.item(0).toElement(); // we only allow one orderby node + TQDomElement orderby = orderbyList.item(0).toElement(); // we only allow one orderby node //random is always the last one. int dbfield = orderby.attribute( "field" ) == "random" ? m_dbFields.count() : m_dbFields.findIndex( orderby.attribute( "field" ) ); @@ -141,10 +141,10 @@ SmartPlaylistEditor::SmartPlaylistEditor( QWidget *parent, QDomElement xml, cons } // expand by - QDomNodeList expandbyList = xml.elementsByTagName( "expandby" ); + TQDomNodeList expandbyList = xml.elementsByTagName( "expandby" ); if ( expandbyList.count() ) { m_expandCheck->setChecked( true ); - QDomElement expandby = expandbyList.item(0).toElement(); // we only allow one orderby node + TQDomElement expandby = expandbyList.item(0).toElement(); // we only allow one orderby node int dbfield = m_expandableFields.findIndex( expandby.attribute( "field" ) ); m_expandCombo->setCurrentItem( dbfield ); @@ -152,7 +152,7 @@ SmartPlaylistEditor::SmartPlaylistEditor( QWidget *parent, QDomElement xml, cons } -void SmartPlaylistEditor::init(QString defaultName) +void SmartPlaylistEditor::init(TQString defaultName) { makeVBoxMainWidget(); @@ -176,34 +176,34 @@ void SmartPlaylistEditor::init(QString defaultName) m_expandableDbFields.clear(); m_expandableDbFields << "artist.name" << "composer.name" << "album.name" << "genre.name" << "year.name" << "labels.name"; - QHBox *hbox = new QHBox( mainWidget() ); + TQHBox *hbox = new TQHBox( mainWidget() ); hbox->setSpacing( 5 ); - new QLabel( i18n("Playlist name:"), hbox ); + new TQLabel( i18n("Playlist name:"), hbox ); m_nameLineEdit = new KLineEdit( defaultName, hbox ); - QFrame *sep = new QFrame( mainWidget() ); - sep->setFrameStyle( QFrame::HLine | QFrame::Sunken ); + TQFrame *sep = new TQFrame( mainWidget() ); + sep->setFrameStyle( TQFrame::HLine | TQFrame::Sunken ); //match box (any) - QHBox *matchAnyBox = new QHBox( mainWidget() ); - m_matchAnyCheck = new QCheckBox( i18n("Match Any of the following conditions" ), matchAnyBox ); - matchAnyBox->setStretchFactor( new QWidget( matchAnyBox ), 1 ); + TQHBox *matchAnyBox = new TQHBox( mainWidget() ); + m_matchAnyCheck = new TQCheckBox( i18n("Match Any of the following conditions" ), matchAnyBox ); + matchAnyBox->setStretchFactor( new TQWidget( matchAnyBox ), 1 ); //criteria box - m_criteriaAnyGroupBox = new QVGroupBox( QString::null, mainWidget() ); + m_criteriaAnyGroupBox = new TQVGroupBox( TQString::null, mainWidget() ); //match box (all) - QHBox *matchAllBox = new QHBox( mainWidget() ); - m_matchAllCheck = new QCheckBox( i18n("Match All of the following conditions" ), matchAllBox ); - matchAllBox->setStretchFactor( new QWidget( matchAllBox ), 1 ); + TQHBox *matchAllBox = new TQHBox( mainWidget() ); + m_matchAllCheck = new TQCheckBox( i18n("Match All of the following conditions" ), matchAllBox ); + matchAllBox->setStretchFactor( new TQWidget( matchAllBox ), 1 ); //criteria box - m_criteriaAllGroupBox = new QVGroupBox( QString::null, mainWidget() ); + m_criteriaAllGroupBox = new TQVGroupBox( TQString::null, mainWidget() ); //order box - QHBox *hbox2 = new QHBox( mainWidget() ); - m_orderCheck = new QCheckBox( i18n("Order by"), hbox2 ); - QHBox *orderBox = new QHBox( hbox2 ); + TQHBox *hbox2 = new TQHBox( mainWidget() ); + m_orderCheck = new TQCheckBox( i18n("Order by"), hbox2 ); + TQHBox *orderBox = new TQHBox( hbox2 ); orderBox->setSpacing( 5 ); //fields combo m_orderCombo = new KComboBox( orderBox ); @@ -212,38 +212,38 @@ void SmartPlaylistEditor::init(QString defaultName) //order type m_orderTypeCombo = new KComboBox( orderBox ); updateOrderTypes(0); // populate the new m_orderTypeCombo - hbox2->setStretchFactor( new QWidget( hbox2 ), 1 ); + hbox2->setStretchFactor( new TQWidget( hbox2 ), 1 ); //limit box - QHBox *hbox1 = new QHBox( mainWidget() ); - m_limitCheck = new QCheckBox( i18n("Limit to"), hbox1 ); - QHBox *limitBox = new QHBox( hbox1 ); + TQHBox *hbox1 = new TQHBox( mainWidget() ); + m_limitCheck = new TQCheckBox( i18n("Limit to"), hbox1 ); + TQHBox *limitBox = new TQHBox( hbox1 ); limitBox->setSpacing( 5 ); m_limitSpin = new KIntSpinBox( limitBox ); m_limitSpin->setMinValue( 1 ); m_limitSpin->setMaxValue( 100000 ); m_limitSpin->setValue( 15 ); - new QLabel( i18n("tracks"), limitBox ); - hbox1->setStretchFactor( new QWidget( hbox1 ), 1 ); + new TQLabel( i18n("tracks"), limitBox ); + hbox1->setStretchFactor( new TQWidget( hbox1 ), 1 ); //Expand By - QHBox *hbox3 = new QHBox( mainWidget() ); - m_expandCheck = new QCheckBox( i18n("Expand by"), hbox3 ); - QHBox *expandBox = new QHBox( hbox3 ); + TQHBox *hbox3 = new TQHBox( mainWidget() ); + m_expandCheck = new TQCheckBox( i18n("Expand by"), hbox3 ); + TQHBox *expandBox = new TQHBox( hbox3 ); expandBox->setSpacing( 5 ); m_expandCombo = new KComboBox( expandBox ); m_expandCombo->insertStringList( m_expandableFields ); - hbox3->setStretchFactor( new QWidget( hbox3 ), 1 ); + hbox3->setStretchFactor( new TQWidget( hbox3 ), 1 ); //add stretch - static_cast(mainWidget())->setStretchFactor(new QWidget(mainWidget()), 1); + static_cast(mainWidget())->setStretchFactor(new TQWidget(mainWidget()), 1); - connect( m_matchAnyCheck, SIGNAL( toggled(bool) ), m_criteriaAnyGroupBox, SLOT( setEnabled(bool) ) ); - connect( m_matchAllCheck, SIGNAL( toggled(bool) ), m_criteriaAllGroupBox, SLOT( setEnabled(bool) ) ); - connect( m_orderCheck, SIGNAL( toggled(bool) ), orderBox, SLOT( setEnabled(bool) ) ); - connect( m_limitCheck, SIGNAL( toggled(bool) ), limitBox, SLOT( setEnabled(bool) ) ); - connect( m_expandCheck, SIGNAL( toggled(bool) ), expandBox, SLOT( setEnabled(bool) ) ); - connect( m_orderCombo, SIGNAL( activated(int) ), this, SLOT( updateOrderTypes(int) ) ); + connect( m_matchAnyCheck, TQT_SIGNAL( toggled(bool) ), m_criteriaAnyGroupBox, TQT_SLOT( setEnabled(bool) ) ); + connect( m_matchAllCheck, TQT_SIGNAL( toggled(bool) ), m_criteriaAllGroupBox, TQT_SLOT( setEnabled(bool) ) ); + connect( m_orderCheck, TQT_SIGNAL( toggled(bool) ), orderBox, TQT_SLOT( setEnabled(bool) ) ); + connect( m_limitCheck, TQT_SIGNAL( toggled(bool) ), limitBox, TQT_SLOT( setEnabled(bool) ) ); + connect( m_expandCheck, TQT_SIGNAL( toggled(bool) ), expandBox, TQT_SLOT( setEnabled(bool) ) ); + connect( m_orderCombo, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( updateOrderTypes(int) ) ); m_criteriaAnyGroupBox->setEnabled( false ); m_criteriaAllGroupBox->setEnabled( false ); @@ -272,14 +272,14 @@ void SmartPlaylistEditor::addCriteriaAll() m_criteriaEditorAllList.first()->enableRemove( m_criteriaEditorAllList.count() > 1 ); } -void SmartPlaylistEditor::addCriteriaAny( QDomElement &xml ) +void SmartPlaylistEditor::addCriteriaAny( TQDomElement &xml ) { CriteriaEditor *criteria = new CriteriaEditor( this, m_criteriaAnyGroupBox, criteriaAny, xml ); m_criteriaEditorAnyList.append( criteria ); m_criteriaEditorAnyList.first()->enableRemove( m_criteriaEditorAnyList.count() > 1 ); } -void SmartPlaylistEditor::addCriteriaAll( QDomElement &xml ) +void SmartPlaylistEditor::addCriteriaAll( TQDomElement &xml ) { CriteriaEditor *criteria = new CriteriaEditor( this, m_criteriaAllGroupBox, criteriaAll, xml ); m_criteriaEditorAllList.append( criteria ); @@ -326,14 +326,14 @@ void SmartPlaylistEditor::updateOrderTypes( int index ) m_orderTypeCombo->updateGeometry(); } -QDomElement SmartPlaylistEditor::result() +TQDomElement SmartPlaylistEditor::result() { - QDomDocument doc; - QDomNode node = doc.namedItem( "smartplaylists" ); - QDomElement nodeE; + TQDomDocument doc; + TQDomNode node = doc.namedItem( "smartplaylists" ); + TQDomElement nodeE; nodeE = node.toElement(); - QDomElement smartplaylist = doc.createElement( "smartplaylist" ); + TQDomElement smartplaylist = doc.createElement( "smartplaylist" ); smartplaylist.setAttribute( "name", name() ); @@ -345,7 +345,7 @@ QDomElement SmartPlaylistEditor::result() // Matches if( m_matchAnyCheck->isChecked() ) { - QDomElement matches = doc.createElement("matches"); + TQDomElement matches = doc.createElement("matches"); smartplaylist.appendChild( matches ); // Iterate through all criteria list CriteriaEditor *criteriaeditor = m_criteriaEditorAnyList.first(); @@ -358,7 +358,7 @@ QDomElement SmartPlaylistEditor::result() if( m_matchAllCheck->isChecked() ) { - QDomElement matches = doc.createElement("matches"); + TQDomElement matches = doc.createElement("matches"); smartplaylist.appendChild( matches ); // Iterate through all criteria list CriteriaEditor *criteriaeditor = m_criteriaEditorAllList.first(); @@ -371,13 +371,13 @@ QDomElement SmartPlaylistEditor::result() // Order By if( m_orderCheck->isChecked() ) { - QDomElement orderby = doc.createElement("orderby"); + TQDomElement orderby = doc.createElement("orderby"); if (m_orderCombo->currentItem() != m_orderCombo->count()-1) { orderby.setAttribute( "field", m_dbFields[ m_orderCombo->currentItem() ] ); orderby.setAttribute( "order", m_orderTypeCombo->currentItem() == 1 ? "DESC" : "ASC" ); } else { orderby.setAttribute( "field", "random" ); - QString order; + TQString order; if ( m_orderTypeCombo->currentItem() == 0 ) order = "random"; else if ( m_orderTypeCombo->currentItem() == 1 ) @@ -391,7 +391,7 @@ QDomElement SmartPlaylistEditor::result() } if( m_expandCheck->isChecked() ) { - QDomElement expandBy = doc.createElement("expandby"); + TQDomElement expandBy = doc.createElement("expandby"); expandBy.setAttribute( "field", m_expandableFields[ m_expandCombo->currentItem() ] ); smartplaylist.appendChild( expandBy ); } @@ -403,8 +403,8 @@ QDomElement SmartPlaylistEditor::result() // CLASS CriteriaEditor //////////////////////////////////////////////////////////////////////////// -CriteriaEditor::CriteriaEditor( SmartPlaylistEditor *editor, QWidget *parent, int criteriaType, QDomElement criteria ) - : QHBox( parent ) +CriteriaEditor::CriteriaEditor( SmartPlaylistEditor *editor, TQWidget *parent, int criteriaType, TQDomElement criteria ) + : TQHBox( parent ) , m_playlistEditor( editor ) , m_currentValueType( -1 ) { @@ -415,35 +415,35 @@ CriteriaEditor::CriteriaEditor( SmartPlaylistEditor *editor, QWidget *parent, in m_criteriaCombo = new KComboBox( this ); - m_editBox = new QHBox( this ); + m_editBox = new TQHBox( this ); m_editBox->setSpacing( 5 ); setStretchFactor( m_editBox, 1 ); - m_addButton = new QToolButton( this ); + m_addButton = new TQToolButton( this ); m_addButton->setUsesTextLabel( true ); m_addButton->setTextLabel("+"); - m_removeButton = new QToolButton( this ); + m_removeButton = new TQToolButton( this ); m_removeButton->setUsesTextLabel( true ); m_removeButton->setTextLabel("-"); - connect( m_fieldCombo, SIGNAL( activated(int) ), SLOT( slotFieldSelected(int) ) ); - connect( m_criteriaCombo, SIGNAL( activated(int) ), SLOT( loadEditWidgets() ) ); + connect( m_fieldCombo, TQT_SIGNAL( activated(int) ), TQT_SLOT( slotFieldSelected(int) ) ); + connect( m_criteriaCombo, TQT_SIGNAL( activated(int) ), TQT_SLOT( loadEditWidgets() ) ); if (criteriaType == SmartPlaylistEditor::criteriaAny) { - connect( m_addButton, SIGNAL( clicked() ), editor, SLOT( addCriteriaAny() ) ); - connect( m_removeButton, SIGNAL( clicked() ), SLOT( slotRemoveCriteriaAny() ) ); + connect( m_addButton, TQT_SIGNAL( clicked() ), editor, TQT_SLOT( addCriteriaAny() ) ); + connect( m_removeButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotRemoveCriteriaAny() ) ); } else { - connect( m_addButton, SIGNAL( clicked() ), editor, SLOT( addCriteriaAll() ) ); - connect( m_removeButton, SIGNAL( clicked() ), SLOT( slotRemoveCriteriaAll() ) ); + connect( m_addButton, TQT_SIGNAL( clicked() ), editor, TQT_SLOT( addCriteriaAll() ) ); + connect( m_removeButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotRemoveCriteriaAll() ) ); } if ( !criteria.isNull() ) { int field = m_dbFields.findIndex( criteria.attribute( "field" ) ); - QString condition = criteria.attribute("condition"); + TQString condition = criteria.attribute("condition"); - QStringList values; //List of the values (only one item, unless condition is "is between") - QDomNodeList domvalueList = criteria.elementsByTagName( "value" ); + TQStringList values; //List of the values (only one item, unless condition is "is between") + TQDomNodeList domvalueList = criteria.elementsByTagName( "value" ); for (int j = 0, c=domvalueList.count() ; jsetValue( values.first().toInt() ); - QString period = criteria.attribute("period"); + TQString period = criteria.attribute("period"); if (period=="days" || period.isEmpty() ) m_dateCombo->setCurrentItem(0); else if (period=="months") @@ -493,7 +493,7 @@ CriteriaEditor::CriteriaEditor( SmartPlaylistEditor *editor, QWidget *parent, in m_dateCombo->setCurrentItem(2); } else { - QDateTime dt; + TQDateTime dt; dt.setTime_t( values.first().toUInt() ); m_dateEdit1->setDate( dt.date() ); if( condition == i18n("is between") ) { @@ -508,7 +508,7 @@ CriteriaEditor::CriteriaEditor( SmartPlaylistEditor *editor, QWidget *parent, in m_intSpinBox1->setValue( values.first().toInt() ); if( condition == i18n("is between") ) m_intSpinBox2->setValue( values.last().toInt() ); - QString period = criteria.attribute( "period" ); + TQString period = criteria.attribute( "period" ); if ( period == "seconds" || period.isEmpty() ) //for compatibility m_lengthCombo->setCurrentItem( 0 ); else if ( period == "minutes" ) @@ -530,16 +530,16 @@ CriteriaEditor::~CriteriaEditor() { } -QDomElement CriteriaEditor::getDomSearchCriteria( QDomDocument &doc ) +TQDomElement CriteriaEditor::getDomSearchCriteria( TQDomDocument &doc ) { - QDomElement criteria = doc.createElement( "criteria" ); - QString field = m_dbFields[ m_fieldCombo->currentItem() ]; - QString condition = m_criteriaCombo->currentText(); + TQDomElement criteria = doc.createElement( "criteria" ); + TQString field = m_dbFields[ m_fieldCombo->currentItem() ]; + TQString condition = m_criteriaCombo->currentText(); criteria.setAttribute( "condition", condition ); criteria.setAttribute( "field", field ); - QStringList values; + TQStringList values; // Get the proper value(s) switch( getValueType( m_fieldCombo->currentItem() ) ) { case String: // fall through @@ -549,48 +549,48 @@ QDomElement CriteriaEditor::getDomSearchCriteria( QDomDocument &doc ) case Year: // fall through case Number: { - values << QString::number( m_intSpinBox1->value() ); + values << TQString::number( m_intSpinBox1->value() ); if( condition == i18n("is between") ) - values << QString::number( m_intSpinBox2->value() ); + values << TQString::number( m_intSpinBox2->value() ); break; } case Rating: { - values << QString::number( indexToRating( m_comboBox->currentItem() ) ); + values << TQString::number( indexToRating( m_comboBox->currentItem() ) ); if( condition == i18n("is between") ) - values << QString::number( indexToRating( m_comboBox2->currentItem() ) ); + values << TQString::number( indexToRating( m_comboBox2->currentItem() ) ); break; } case Date: { if( condition == i18n("is in the last") || condition == i18n("is not in the last") ) { - values << QString::number( m_intSpinBox1->value() ); + values << TQString::number( m_intSpinBox1->value() ); // 0 = days; 1=months; 2=years criteria.setAttribute( "period", !m_dateCombo->currentItem() ? "days" : (m_dateCombo->currentItem() == 1 ? "months" : "years") ); } else { - values << QString::number( QDateTime( m_dateEdit1->date() ).toTime_t() ); + values << TQString::number( TQDateTime( m_dateEdit1->date() ).toTime_t() ); if( condition == i18n("is between") ) { - values << QString::number( QDateTime( m_dateEdit2->date() ).toTime_t() ); + values << TQString::number( TQDateTime( m_dateEdit2->date() ).toTime_t() ); } } break; } case Length: { - values << QString::number( m_intSpinBox1->value() ); + values << TQString::number( m_intSpinBox1->value() ); // 0 = seconds, 1=minutes, 2=hours criteria.setAttribute( "period", !m_lengthCombo->currentItem() ? "seconds" : (m_lengthCombo->currentItem() == 1 ? "minutes" : "hours") ); if( condition == i18n( "is between" ) ) { - values << QString::number( m_intSpinBox2->value() ); + values << TQString::number( m_intSpinBox2->value() ); } break; } default: ; } foreach( values ) { - QDomElement value = doc.createElement( "value" ); - QDomText t = doc.createTextNode( *it ); + TQDomElement value = doc.createElement( "value" ); + TQDomText t = doc.createTextNode( *it ); value.appendChild( t ); criteria.appendChild( value ); } @@ -598,21 +598,21 @@ QDomElement CriteriaEditor::getDomSearchCriteria( QDomDocument &doc ) } -QString CriteriaEditor::getSearchCriteria() +TQString CriteriaEditor::getSearchCriteria() { - QString searchCriteria; - QString field = m_dbFields[ m_fieldCombo->currentItem() ]; - QString criteria = m_criteriaCombo->currentText(); + TQString searchCriteria; + TQString field = m_dbFields[ m_fieldCombo->currentItem() ]; + TQString criteria = m_criteriaCombo->currentText(); if( field.isEmpty() ) - return QString(); + return TQString(); if ( ( field=="statistics.playcounter" || field=="statistics.rating" || field=="statistics.percentage" || field=="statistics.accessdate" || field=="statistics.createdate") ) searchCriteria += "COALESCE(" + field + ",0)"; else searchCriteria += field; - QString value; + TQString value; switch( getValueType( m_fieldCombo->currentItem() ) ) { case String: case AutoCompletionString: @@ -620,15 +620,15 @@ QString CriteriaEditor::getSearchCriteria() break; case Year: //fall through case Number: - value = QString::number( m_intSpinBox1->value() ); + value = TQString::number( m_intSpinBox1->value() ); if( criteria == i18n("is between") ) - value += " AND " + QString::number( m_intSpinBox2->value() ); + value += " AND " + TQString::number( m_intSpinBox2->value() ); break; case Rating: { - value = QString::number( indexToRating( m_comboBox->currentItem() ) ); + value = TQString::number( indexToRating( m_comboBox->currentItem() ) ); if( criteria == i18n("is between") ) - value += " AND " + QString::number( indexToRating( m_comboBox2->currentItem() ) ); + value += " AND " + TQString::number( indexToRating( m_comboBox2->currentItem() ) ); break; } case Date: @@ -641,17 +641,17 @@ QString CriteriaEditor::getSearchCriteria() else if( m_dateCombo->currentItem() == 1 ) //months time=86400*30*n; else time=86400*365*n; //years - value += "(*CurrentTimeT*)" + QString(" - %1 AND ").arg(time) + "(*CurrentTimeT*)"; + value += "(*CurrentTimeT*)" + TQString(" - %1 AND ").arg(time) + "(*CurrentTimeT*)"; } else { - QDateTime datetime1( m_dateEdit1->date() ); - value += QString::number( datetime1.toTime_t() ); + TQDateTime datetime1( m_dateEdit1->date() ); + value += TQString::number( datetime1.toTime_t() ); if( criteria == i18n("is between") ) { - QDateTime datetime2( m_dateEdit2->date() ); - value += " AND " + QString::number( datetime2.toTime_t() ); + TQDateTime datetime2( m_dateEdit2->date() ); + value += " AND " + TQString::number( datetime2.toTime_t() ); } else - value += " AND " + QString::number( datetime1.addDays( 1 ).toTime_t() ); + value += " AND " + TQString::number( datetime1.addDays( 1 ).toTime_t() ); } break; } @@ -665,7 +665,7 @@ QString CriteriaEditor::getSearchCriteria() time = 60*n; else time = 3600*n; //hours - value = QString::number( time ); + value = TQString::number( time ); if( criteria == i18n("is between") ) { int n2 = m_intSpinBox2->value(); int time2; @@ -675,7 +675,7 @@ QString CriteriaEditor::getSearchCriteria() time2 = 60*n2; else time2 = 3600*n2; //hours - value += " AND " + QString::number( time2 ); + value += " AND " + TQString::number( time2 ); } break; } @@ -744,7 +744,7 @@ QString CriteriaEditor::getSearchCriteria() } -void CriteriaEditor::setSearchCriteria( const QString & ) +void CriteriaEditor::setSearchCriteria( const TQString & ) { //TODO } @@ -785,7 +785,7 @@ void CriteriaEditor::slotFieldSelected( int field ) //enable auto-completion for artist, album, composer, label, mountpoint and genre if( valueType == AutoCompletionString ) { - QStringList items; + TQStringList items; m_comboBox->clear(); m_comboBox->completionObject()->clear(); @@ -807,9 +807,9 @@ void CriteriaEditor::slotFieldSelected( int field ) * Copyright Kévin Ottens, Bernhard Rosenkraenzer, and from looking * at the commit messages a few other guys who didn't add their name to the header. */ - QString device = (*it)->realDeviceName(); - QString fs = (*it)->mountType(); - QString mountpoint = (*it)->mountPoint(); + TQString device = (*it)->realDeviceName(); + TQString fs = (*it)->mountType(); + TQString mountpoint = (*it)->mountPoint(); if ( fs != "swap" && fs != "tmpfs" && fs != "sysfs" @@ -862,9 +862,9 @@ void CriteriaEditor::loadEditWidgets() /* Store lastCriteria. This information is used above to decide whether it's necessary to change the Widgets */ m_lastCriteria = m_criteriaCombo->currentText(); - QObjectList* list = m_editBox->queryList( "QWidget" ); - for( QObject *obj = list->first(); obj; obj = list->next() ) - static_cast(obj)->deleteLater(); + TQObjectList* list = m_editBox->queryList( "TQWidget" ); + for( TQObject *obj = list->first(); obj; obj = list->next() ) + static_cast(obj)->deleteLater(); delete list; @@ -883,7 +883,7 @@ void CriteriaEditor::loadEditWidgets() m_comboBox = new KComboBox( true, m_editBox ); m_lineEdit = static_cast( m_comboBox->lineEdit() ); m_lineEdit->setFocus(); - m_comboBox->setMinimumSize( QSize( 240, 20 ) ); + m_comboBox->setMinimumSize( TQSize( 240, 20 ) ); m_comboBox->show(); break; } @@ -896,7 +896,7 @@ void CriteriaEditor::loadEditWidgets() m_intSpinBox1 = new KIntSpinBox( m_editBox ); int maxValue = 1000; if( yearField ) { - maxValue = QDate::currentDate().year(); + maxValue = TQDate::currentDate().year(); m_intSpinBox1->setValue( maxValue ); } m_intSpinBox1->setMaxValue( maxValue ); @@ -904,12 +904,12 @@ void CriteriaEditor::loadEditWidgets() m_intSpinBox1->show(); if( m_criteriaCombo->currentText() == i18n("is between") ) { - m_rangeLabel = new QLabel( i18n("and"), m_editBox ); + m_rangeLabel = new TQLabel( i18n("and"), m_editBox ); m_rangeLabel->setAlignment( AlignCenter ); m_rangeLabel->show(); m_intSpinBox2 = new KIntSpinBox( m_editBox ); if( yearField ) { - maxValue = QDate::currentDate().year(); + maxValue = TQDate::currentDate().year(); m_intSpinBox2->setValue( maxValue ); } m_intSpinBox2->setMaxValue( maxValue ); @@ -920,13 +920,13 @@ void CriteriaEditor::loadEditWidgets() case Rating: { - const QStringList list = MetaBundle::ratingList(); + const TQStringList list = MetaBundle::ratingList(); m_comboBox = new KComboBox( false, m_editBox ); m_comboBox->insertStringList( list ); m_comboBox->show(); if( m_criteriaCombo->currentText() == i18n("is between") ) { - m_rangeLabel = new QLabel( i18n("and"), m_editBox ); + m_rangeLabel = new TQLabel( i18n("and"), m_editBox ); m_rangeLabel->setAlignment( AlignCenter ); m_rangeLabel->show(); m_comboBox2 = new KComboBox( false, m_editBox ); @@ -950,14 +950,14 @@ void CriteriaEditor::loadEditWidgets() m_dateCombo->show(); } else { - m_dateEdit1 = new QDateEdit( QDate::currentDate(), m_editBox); + m_dateEdit1 = new QDateEdit( TQDate::currentDate(), m_editBox); m_dateEdit1->setFocus(); m_dateEdit1->show(); if( m_criteriaCombo->currentText() == i18n("is between") ) { - m_rangeLabel = new QLabel( i18n("and"), m_editBox ); + m_rangeLabel = new TQLabel( i18n("and"), m_editBox ); m_rangeLabel->setAlignment( AlignCenter ); m_rangeLabel->show(); - m_dateEdit2 = new QDateEdit( QDate::currentDate(), m_editBox); + m_dateEdit2 = new QDateEdit( TQDate::currentDate(), m_editBox); m_dateEdit2->show(); } } @@ -973,7 +973,7 @@ void CriteriaEditor::loadEditWidgets() m_intSpinBox1->setFocus(); m_intSpinBox1->show(); if( m_criteriaCombo->currentText() == i18n("is between") ) { - m_rangeLabel = new QLabel( i18n("and"), m_editBox ); + m_rangeLabel = new TQLabel( i18n("and"), m_editBox ); m_rangeLabel->setAlignment( AlignCenter ); m_rangeLabel->show(); m_intSpinBox2 = new KIntSpinBox( m_editBox ); @@ -993,12 +993,12 @@ void CriteriaEditor::loadEditWidgets() } -void CriteriaEditor::loadCriteriaList( int valueType, QString condition ) +void CriteriaEditor::loadCriteriaList( int valueType, TQString condition ) { if( m_currentValueType == valueType && condition.isNull() ) return; - QStringList items; + TQStringList items; switch( valueType ) { case String: diff --git a/amarok/src/smartplaylisteditor.h b/amarok/src/smartplaylisteditor.h index a505f340..daa18b36 100644 --- a/amarok/src/smartplaylisteditor.h +++ b/amarok/src/smartplaylisteditor.h @@ -7,19 +7,19 @@ #define SMARTPLAYLISTEDITOR_H #include //baseclass -#include -#include //baseclass -#include //definition required +#include +#include //baseclass +#include //definition required #include //inline function class KComboBox; class KIntSpinBox; class KLineEdit; -class QCheckBox; +class TQCheckBox; class QDateEdit; -class QLabel; -class QToolButton; -class QVGroupBox; +class TQLabel; +class TQToolButton; +class TQVGroupBox; class CriteriaEditor; @@ -29,53 +29,53 @@ Q_OBJECT friend class CriteriaEditor; public: - SmartPlaylistEditor( QString playlist_name, QWidget *parent, const char *name=0 ); - SmartPlaylistEditor( QWidget *parent, QDomElement xml, const char *name=0 ); + SmartPlaylistEditor( TQString playlist_name, TQWidget *parent, const char *name=0 ); + SmartPlaylistEditor( TQWidget *parent, TQDomElement xml, const char *name=0 ); - QDomElement result(); + TQDomElement result(); - QString name() const { return m_nameLineEdit->text().replace( "\n", " " ); } + TQString name() const { return m_nameLineEdit->text().replace( "\n", " " ); } enum CriteriaType { criteriaAll = 0, criteriaAny = 1 }; public slots: void addCriteriaAny(); - void addCriteriaAny( QDomElement &xml); + void addCriteriaAny( TQDomElement &xml); void removeCriteriaAny( CriteriaEditor *criteria); void addCriteriaAll(); - void addCriteriaAll( QDomElement &xml); + void addCriteriaAll( TQDomElement &xml); void removeCriteriaAll( CriteriaEditor *criteria); private slots: void updateOrderTypes( int index ); private: - void init(QString defaultName); + void init(TQString defaultName); void updateMatchWidgets(); KLineEdit *m_nameLineEdit; - QCheckBox *m_matchAnyCheck; - QCheckBox *m_matchAllCheck; + TQCheckBox *m_matchAnyCheck; + TQCheckBox *m_matchAllCheck; // matching boxes - QVGroupBox *m_criteriaAnyGroupBox; - QVGroupBox *m_criteriaAllGroupBox; + TQVGroupBox *m_criteriaAnyGroupBox; + TQVGroupBox *m_criteriaAllGroupBox; //limit widgets - QCheckBox *m_limitCheck; + TQCheckBox *m_limitCheck; KIntSpinBox *m_limitSpin; //order by widgets - QCheckBox *m_orderCheck; + TQCheckBox *m_orderCheck; KComboBox *m_orderCombo; KComboBox *m_orderTypeCombo; //expand by - QCheckBox *m_expandCheck; + TQCheckBox *m_expandCheck; KComboBox *m_expandCombo; - QPtrList m_criteriaEditorAnyList; - QPtrList m_criteriaEditorAllList; + TQPtrList m_criteriaEditorAnyList; + TQPtrList m_criteriaEditorAllList; }; @@ -84,11 +84,11 @@ class CriteriaEditor : public QHBox { Q_OBJECT public: - CriteriaEditor( SmartPlaylistEditor *editor, QWidget *parent, int criteriaType, QDomElement criteria = QDomElement() ); + CriteriaEditor( SmartPlaylistEditor *editor, TQWidget *parent, int criteriaType, TQDomElement criteria = TQDomElement() ); ~CriteriaEditor(); - QString getSearchCriteria(); - void setSearchCriteria( const QString &str ); - QDomElement getDomSearchCriteria( QDomDocument &doc ); + TQString getSearchCriteria(); + void setSearchCriteria( const TQString &str ); + TQDomElement getDomSearchCriteria( TQDomDocument &doc ); void enableRemove( bool ); private slots: @@ -102,22 +102,22 @@ Q_OBJECT private: enum ValueType { String, AutoCompletionString, Number, Year, Date, Rating, Length }; - void loadCriteriaList( int valueType, QString condition = QString::null ); + void loadCriteriaList( int valueType, TQString condition = TQString::null ); int getValueType( int fieldIndex ); inline int indexToRating( int ); inline int ratingToIndex( int ); SmartPlaylistEditor *m_playlistEditor; int m_currentValueType; - QString m_lastCriteria; + TQString m_lastCriteria; KComboBox *m_fieldCombo; KComboBox *m_criteriaCombo; - QToolButton *m_addButton; - QToolButton *m_removeButton; + TQToolButton *m_addButton; + TQToolButton *m_removeButton; //editing widgets - QHBox *m_editBox; + TQHBox *m_editBox; KLineEdit *m_lineEdit; KComboBox *m_comboBox; KComboBox *m_comboBox2; @@ -126,7 +126,7 @@ Q_OBJECT QDateEdit *m_dateEdit1; QDateEdit *m_dateEdit2; KComboBox *m_dateCombo; - QLabel *m_rangeLabel; + TQLabel *m_rangeLabel; KComboBox *m_lengthCombo; }; diff --git a/amarok/src/socketserver.cpp b/amarok/src/socketserver.cpp index a58eabed..2886ff57 100644 --- a/amarok/src/socketserver.cpp +++ b/amarok/src/socketserver.cpp @@ -21,7 +21,7 @@ #include //Vis::Selector #include //Vis::Selector #include //locateLocal() -#include //Vis::Selector ctor +#include //Vis::Selector ctor #include "socketserver.h" #include #include @@ -38,8 +38,8 @@ /// @class Amarok::SocketServer -Amarok::SocketServer::SocketServer( const QString &socketName, QObject *parent ) - : QServerSocket( parent ) +Amarok::SocketServer::SocketServer( const TQString &socketName, TQObject *parent ) + : TQServerSocket( parent ) { m_sockfd = ::socket( AF_UNIX, SOCK_STREAM, 0 ); @@ -85,7 +85,7 @@ Amarok::SocketServer::~SocketServer() /// @class Vis::SocketServer -Vis::SocketServer::SocketServer( QObject *parent ) +Vis::SocketServer::SocketServer( TQObject *parent ) : Amarok::SocketServer( "amarok.visualization_socket", parent ) {} @@ -101,9 +101,9 @@ Vis::SocketServer::newConnection( int sockfd ) /// @class Vis::SocketNotifier Vis::SocketNotifier::SocketNotifier( int sockfd ) - : QSocketNotifier( sockfd, QSocketNotifier::Read, this ) + : TQSocketNotifier( sockfd, TQSocketNotifier::Read, this ) { - connect( this, SIGNAL(activated( int )), SLOT(request( int )) ); + connect( this, TQT_SIGNAL(activated( int )), TQT_SLOT(request( int )) ); } void @@ -114,7 +114,7 @@ Vis::SocketNotifier::request( int sockfd ) //slot if( nbytes > 0 ) { - QCString result( buf ); + TQCString result( buf ); if( result == "REG" ) { @@ -145,16 +145,16 @@ Vis::SocketNotifier::request( int sockfd ) //slot Vis::Selector* Vis::Selector::instance() { - QWidget *parent = reinterpret_cast( pApp->playlistWindow() ); - QObject *o = parent->child( "Vis::Selector::instance" ); + TQWidget *parent = reinterpret_cast( pApp->playlistWindow() ); + TQObject *o = parent->child( "Vis::Selector::instance" ); debug() << bool(o == 0) << endl; return o ? static_cast( o ) : new Selector( parent ); } -Vis::Selector::Selector( QWidget *parent ) - : QListView( parent, "Vis::Selector::instance", Qt::WType_Dialog ) +Vis::Selector::Selector( TQWidget *parent ) + : TQListView( parent, "Vis::Selector::instance", Qt::WType_Dialog ) , m_server( new SocketServer( this ) ) { Amarok::OverrideCursor waitcursor; @@ -166,15 +166,15 @@ Vis::Selector::Selector( QWidget *parent ) KWin::setState( winId(), NET::SkipTaskbar ); setSorting( 0 ); - setColumnWidthMode( 0, QListView::Maximum ); - QToolTip::add( viewport(), i18n( "Right-click on item for context menu" ) ); - addColumn( QString() ); - addColumn( QString() ); - reinterpret_cast(header())->hide(); + setColumnWidthMode( 0, TQListView::Maximum ); + TQToolTip::add( viewport(), i18n( "Right-click on item for context menu" ) ); + addColumn( TQString() ); + addColumn( TQString() ); + reinterpret_cast(header())->hide(); - connect( this, SIGNAL(contextMenuRequested( QListViewItem*, const QPoint&, int )), - this, SLOT(rightButton( QListViewItem*, const QPoint&, int )) ); + connect( this, TQT_SIGNAL(contextMenuRequested( TQListViewItem*, const TQPoint&, int )), + this, TQT_SLOT(rightButton( TQListViewItem*, const TQPoint&, int )) ); // Can I get a pointer to the data section of a QCString? char str[4096]; @@ -182,12 +182,12 @@ Vis::Selector::Selector( QWidget *parent ) str[ fread( static_cast( str ), sizeof(char), 4096, vis ) ] = '\0'; pclose( vis ); - const QStringList entries = QStringList::split( '\n', QString::fromLocal8Bit( str ) ); + const TQStringList entries = TQStringList::split( '\n', TQString::fromLocal8Bit( str ) ); - for( QStringList::ConstIterator it = entries.begin(); it != entries.end(); ++it ) + for( TQStringList::ConstIterator it = entries.begin(); it != entries.end(); ++it ) new Item( this, "amarok_libvisual", *it, "libvisual" ); - resize( sizeHint() + QSize(20,0) ); + resize( sizeHint() + TQSize(20,0) ); // Center the widget on screen move( parentWidget()->width()/2 - width()/2, parentWidget()->height()/2 - height()/2 ); } @@ -204,7 +204,7 @@ Vis::Selector::processExited( KProcess *proc ) void Vis::Selector::receivedStdout( KProcess */*proc*/, char* buffer, int length ) { - debug() << QString::fromLatin1( buffer, length ) << endl; + debug() << TQString::fromLatin1( buffer, length ) << endl; } void @@ -223,7 +223,7 @@ Vis::Selector::mapPID( int pid, int sockfd ) } void -Vis::Selector::rightButton( QListViewItem* qitem, const QPoint& pos, int ) +Vis::Selector::rightButton( TQListViewItem* qitem, const TQPoint& pos, int ) { //TODO if the vis is not running it cannot be configured and you shouldn't show the popupmenu! @@ -244,10 +244,10 @@ Vis::Selector::rightButton( QListViewItem* qitem, const QPoint& pos, int ) } } -#include -#include +#include +#include void -Vis::Selector::viewportPaintEvent( QPaintEvent *e ) +Vis::Selector::viewportPaintEvent( TQPaintEvent *e ) { if( childCount() == 0 ) { @@ -264,7 +264,7 @@ Vis::Selector::viewportPaintEvent( QPaintEvent *e ) "Please check these possibilities and restart Amarok." "" ), KDE::StatusBar::Sorry ); } - else { QListView::viewportPaintEvent( e ); } + else { TQListView::viewportPaintEvent( e ); } } @@ -286,9 +286,9 @@ Vis::Selector::Item::stateChange( bool ) //SLOT << Selector::instance()->m_server->path() << text( 0 ); - connect( m_proc, SIGNAL(processExited( KProcess* )), listView(), SLOT(processExited( KProcess* )) ); + connect( m_proc, TQT_SIGNAL(processExited( KProcess* )), listView(), TQT_SLOT(processExited( KProcess* )) ); // Shouldn't be necessary, but make visualizations work again when running with amarok binary - connect( m_proc, SIGNAL(receivedStdout (KProcess*, char*, int ) ), listView(), SLOT(receivedStdout (KProcess*, char*, int ) ) ); + connect( m_proc, TQT_SIGNAL(receivedStdout (KProcess*, char*, int ) ), listView(), TQT_SLOT(receivedStdout (KProcess*, char*, int ) ) ); debug() << "Starting visualization..\n"; if( m_proc->start( KProcess::NotifyOnExit, KProcess::AllOutput ) ) break; diff --git a/amarok/src/socketserver.h b/amarok/src/socketserver.h index b14ed3a3..281408f7 100644 --- a/amarok/src/socketserver.h +++ b/amarok/src/socketserver.h @@ -11,12 +11,12 @@ #ifndef VIS_SOCKETSERVER_H #define VIS_SOCKETSERVER_H -#include //stack allocated -#include //baseclass -#include //baseclass -#include //baseclass +#include //stack allocated +#include //baseclass +#include //baseclass +#include //baseclass -class QPoint; +class TQPoint; class KProcess; @@ -25,12 +25,12 @@ namespace Amarok class SocketServer : public QServerSocket { public: - SocketServer( const QString &socketName, QObject *parent ); + SocketServer( const TQString &socketName, TQObject *parent ); ~SocketServer(); protected: int m_sockfd; - QCString m_path; + TQCString m_path; }; } @@ -40,11 +40,11 @@ namespace Vis class SocketServer : public Amarok::SocketServer { public: - SocketServer( QObject* ); + SocketServer( TQObject* ); void newConnection( int ); - QCString path() const { return m_path; } + TQCString path() const { return m_path; } }; class SocketNotifier : public QSocketNotifier @@ -61,10 +61,10 @@ namespace Vis class Selector : public QListView { Q_OBJECT - Selector( QWidget *parent=0 ); + Selector( TQWidget *parent=0 ); SocketServer *m_server; - virtual void viewportPaintEvent( QPaintEvent* ); + virtual void viewportPaintEvent( TQPaintEvent* ); public: static Selector* instance(); @@ -77,8 +77,8 @@ namespace Vis class Item : public QCheckListItem { public: - Item( QListView *parent, const char *command, const QString &text, const QString &s2 ) - : QCheckListItem( parent, text, QCheckListItem::CheckBox ) + Item( TQListView *parent, const char *command, const TQString &text, const TQString &s2 ) + : TQCheckListItem( parent, text, TQCheckListItem::CheckBox ) , m_proc( 0 ) , m_sockfd( -1 ) , m_command( command ) { setText( 1, s2 ); } @@ -92,7 +92,7 @@ namespace Vis }; private slots: - void rightButton( QListViewItem*, const QPoint&, int ); + void rightButton( TQListViewItem*, const TQPoint&, int ); public slots: void processExited( KProcess* ); diff --git a/amarok/src/starmanager.cpp b/amarok/src/starmanager.cpp index d0ac9f8f..66c5ab6c 100644 --- a/amarok/src/starmanager.cpp +++ b/amarok/src/starmanager.cpp @@ -21,9 +21,9 @@ #include -#include -#include -#include +#include +#include +#include #include //KGlobal::dirs() @@ -60,8 +60,8 @@ StarManager::reinitStars( int height, int margin ) m_margin = margin; int hval = m_height + m_margin * 2 - 4 + ( ( m_height % 2 ) ? 1 : 0 ); - QImage star = QImage( locate( "data", "amarok/images/star.png" ) ).smoothScale( hval, hval, QImage::ScaleMin ); - QImage fullStar = QImage( locate( "data", "amarok/images/star.png" ) ); + TQImage star = TQImage( locate( "data", "amarok/images/star.png" ) ).smoothScale( hval, hval, TQImage::ScaleMin ); + TQImage fullStar = TQImage( locate( "data", "amarok/images/star.png" ) ); m_star = star.copy(); m_fullStar = fullStar.copy(); m_starPix.convertFromImage( star ); @@ -69,8 +69,8 @@ StarManager::reinitStars( int height, int margin ) m_greyedStar = star.copy(); KIconEffect::toGray( m_greyedStar, 1.0 ); m_greyedStarPix.convertFromImage( m_greyedStar ); - QImage half = QImage( locate( "data", "amarok/images/smallstar.png" ) ).smoothScale( hval, hval, QImage::ScaleMin ); - QImage fullHalf = QImage( locate( "data", "amarok/images/smallstar.png" ) ); + TQImage half = TQImage( locate( "data", "amarok/images/smallstar.png" ) ).smoothScale( hval, hval, TQImage::ScaleMin ); + TQImage fullHalf = TQImage( locate( "data", "amarok/images/smallstar.png" ) ); m_halfStar = half.copy(); m_fullHalfStar = fullHalf.copy(); if( AmarokConfig::customRatingsColors() ) @@ -78,8 +78,8 @@ StarManager::reinitStars( int height, int margin ) m_halfStarPix.convertFromImage( m_halfStar ); m_fullHalfStarPix.convertFromImage( m_fullHalfStar ); - QImage tempstar; - QImage temphalfstar; + TQImage tempstar; + TQImage temphalfstar; for( int i = 0; i < 5; i++ ) { tempstar = star.copy(); @@ -104,7 +104,7 @@ StarManager::reinitStars( int height, int margin ) emit ratingsColorsChanged(); } -QPixmap* +TQPixmap* StarManager::getStar( int num, bool full ) { if(full) @@ -115,7 +115,7 @@ StarManager::getStar( int num, bool full ) return &m_pixmaps[num - 1]; } -QImage& +TQImage& StarManager::getStarImage( int num, bool full ) { if(full) @@ -126,7 +126,7 @@ StarManager::getStarImage( int num, bool full ) return m_images[num - 1]; } -QPixmap* +TQPixmap* StarManager::getHalfStar( int num, bool full ) { if( full ) @@ -137,7 +137,7 @@ StarManager::getHalfStar( int num, bool full ) return &m_halfpixmaps[num - 1]; } -QImage& +TQImage& StarManager::getHalfStarImage( int num, bool full ) { if( full ) @@ -149,7 +149,7 @@ StarManager::getHalfStarImage( int num, bool full ) } bool -StarManager::setColor( int starNum, const QColor &color ) +StarManager::setColor( int starNum, const TQColor &color ) { if( starNum < 1 || starNum > 5 ) return false; @@ -158,7 +158,7 @@ StarManager::setColor( int starNum, const QColor &color ) } bool -StarManager::setHalfColor( const QColor &color ) +StarManager::setHalfColor( const TQColor &color ) { m_halfStarColor = color; return true; diff --git a/amarok/src/starmanager.h b/amarok/src/starmanager.h index f0e516ec..e73dc00b 100644 --- a/amarok/src/starmanager.h +++ b/amarok/src/starmanager.h @@ -14,8 +14,8 @@ #ifndef AMAROK_STAR_MANAGER_H #define AMAROK_STAR_MANAGER_H -#include -#include +#include +#include class StarManager : public QObject { @@ -27,15 +27,15 @@ class StarManager : public QObject ~StarManager(); static StarManager *instance(); - QPixmap* getStar( int num, bool full = false ); - QPixmap* getGreyStar() { return &m_greyedStarPix; } - QPixmap* getHalfStar( int num = -1, bool full = false ); - QImage& getStarImage( int num, bool full = false ); - QImage& getGreyStarImage() { return m_greyedStar; } - QImage& getHalfStarImage( int num = -1, bool full = false ); + TQPixmap* getStar( int num, bool full = false ); + TQPixmap* getGreyStar() { return &m_greyedStarPix; } + TQPixmap* getHalfStar( int num = -1, bool full = false ); + TQImage& getStarImage( int num, bool full = false ); + TQImage& getGreyStarImage() { return m_greyedStar; } + TQImage& getHalfStarImage( int num = -1, bool full = false ); - bool setColor( int starNum, const QColor &color ); - bool setHalfColor( const QColor &color ); + bool setColor( int starNum, const TQColor &color ); + bool setHalfColor( const TQColor &color ); void reinitStars( int height = -1, int margin = -1 ); @@ -48,24 +48,24 @@ class StarManager : public QObject int m_margin; //cached stars...why both? For faster conversion when drawing context browser - QPixmap m_starPix; - QImage m_star; - QPixmap m_fullStarPix; - QImage m_fullStar; - QPixmap m_greyedStarPix; - QImage m_greyedStar; - QPixmap m_halfStarPix; - QPixmap m_fullHalfStarPix; - QImage m_halfStar; - QImage m_fullHalfStar; - - QImage m_images[5]; - QImage m_halfimages[5]; - QPixmap m_pixmaps[5]; - QPixmap m_halfpixmaps[5]; - - QColor m_colors[5]; - QColor m_halfStarColor; + TQPixmap m_starPix; + TQImage m_star; + TQPixmap m_fullStarPix; + TQImage m_fullStar; + TQPixmap m_greyedStarPix; + TQImage m_greyedStar; + TQPixmap m_halfStarPix; + TQPixmap m_fullHalfStarPix; + TQImage m_halfStar; + TQImage m_fullHalfStar; + + TQImage m_images[5]; + TQImage m_halfimages[5]; + TQPixmap m_pixmaps[5]; + TQPixmap m_halfpixmaps[5]; + + TQColor m_colors[5]; + TQColor m_halfStarColor; }; #endif diff --git a/amarok/src/statistics.cpp b/amarok/src/statistics.cpp index d3fc7d61..33d1b23b 100644 --- a/amarok/src/statistics.cpp +++ b/amarok/src/statistics.cpp @@ -31,16 +31,16 @@ #include //startDrag() #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include ////////////////////////////////////////////////////////////////////////////////////////// /// CLASS Statistics @@ -48,9 +48,9 @@ Statistics *Statistics::s_instance = 0; -Statistics::Statistics( QWidget *parent, const char *name ) +Statistics::Statistics( TQWidget *parent, const char *name ) : KDialogBase( KDialogBase::Swallow, 0, parent, name, false, 0, Close ) - , m_timer( new QTimer( this ) ) + , m_timer( new TQTimer( this ) ) { s_instance = this; @@ -60,12 +60,12 @@ Statistics::Statistics( QWidget *parent, const char *name ) kapp->setTopWidget( this ); setCaption( kapp->makeStdCaption( i18n("Collection Statistics") ) ); - setInitialSize( QSize( 400, 550 ) ); + setInitialSize( TQSize( 400, 550 ) ); - QVBox *mainBox = new QVBox( this ); + TQVBox *mainBox = new TQVBox( this ); setMainWidget( mainBox ); - QVBox *box = new QVBox( mainWidget() ); + TQVBox *box = new TQVBox( mainWidget() ); box->setSpacing( 5 ); { // @@ -74,19 +74,19 @@ Statistics::Statistics( QWidget *parent, const char *name ) bar->setFlat( true ); //removes the ugly frame bar->setMovingEnabled( false ); //removes the ugly frame - QWidget *button = new KToolBarButton( "locationbar_erase", 1, bar ); + TQWidget *button = new KToolBarButton( "locationbar_erase", 1, bar ); m_lineEdit = new ClickLineEdit( i18n( "Enter search terms here" ), bar ); bar->setStretchableWidget( m_lineEdit ); - m_lineEdit->setFrame( QFrame::Sunken ); + m_lineEdit->setFrame( TQFrame::Sunken ); m_lineEdit->installEventFilter( this ); //we intercept keyEvents - connect( button, SIGNAL( clicked() ) , m_lineEdit , SLOT( clear() ) ); - connect( m_timer, SIGNAL( timeout() ) , SLOT( slotSetFilter() ) ); - connect( m_lineEdit, SIGNAL( textChanged( const QString& ) ), SLOT( slotSetFilterTimeout() ) ); - connect( m_lineEdit, SIGNAL( returnPressed() ) , SLOT( slotSetFilter() ) ); + connect( button, TQT_SIGNAL( clicked() ) , m_lineEdit , TQT_SLOT( clear() ) ); + connect( m_timer, TQT_SIGNAL( timeout() ) , TQT_SLOT( slotSetFilter() ) ); + connect( m_lineEdit, TQT_SIGNAL( textChanged( const TQString& ) ), TQT_SLOT( slotSetFilterTimeout() ) ); + connect( m_lineEdit, TQT_SIGNAL( returnPressed() ) , TQT_SLOT( slotSetFilter() ) ); - QToolTip::add( button, i18n( "Clear search field" ) ); + TQToolTip::add( button, i18n( "Clear search field" ) ); } // m_listView = new StatisticsList( box ); @@ -119,7 +119,7 @@ Statistics::slotSetFilter() //SLOT /// CLASS StatisticsList ////////////////////////////////////////////////////////////////////////////////////////// -StatisticsList::StatisticsList( QWidget *parent, const char *name ) +StatisticsList::StatisticsList( TQWidget *parent, const char *name ) : KListView( parent, name ) , m_currentItem( 0 ) , m_expanded( false ) @@ -127,18 +127,18 @@ StatisticsList::StatisticsList( QWidget *parent, const char *name ) header()->hide(); addColumn( i18n("Name") ); - setResizeMode( QListView::LastColumn ); - setSelectionMode( QListView::Extended ); + setResizeMode( TQListView::LastColumn ); + setSelectionMode( TQListView::Extended ); setSorting( -1 ); setAcceptDrops( false ); setDragEnabled( true ); - connect( this, SIGNAL( onItem( QListViewItem*) ), SLOT( startHover( QListViewItem* ) ) ); - connect( this, SIGNAL( onViewport() ), SLOT( clearHover() ) ); - connect( this, SIGNAL( clicked( QListViewItem*) ), SLOT( itemClicked( QListViewItem* ) ) ); - connect( this, SIGNAL( contextMenuRequested( QListViewItem *, const QPoint &, int ) ), - this, SLOT( showContextMenu( QListViewItem *, const QPoint &, int ) ) ); + connect( this, TQT_SIGNAL( onItem( TQListViewItem*) ), TQT_SLOT( startHover( TQListViewItem* ) ) ); + connect( this, TQT_SIGNAL( onViewport() ), TQT_SLOT( clearHover() ) ); + connect( this, TQT_SIGNAL( clicked( TQListViewItem*) ), TQT_SLOT( itemClicked( TQListViewItem* ) ) ); + connect( this, TQT_SIGNAL( contextMenuRequested( TQListViewItem *, const TQPoint &, int ) ), + this, TQT_SLOT( showContextMenu( TQListViewItem *, const TQPoint &, int ) ) ); if( CollectionDB::instance()->isEmpty() ) return; @@ -156,7 +156,7 @@ StatisticsList::startDrag() KURL::List list; KMultipleDrag *drag = new KMultipleDrag( this ); - QListViewItemIterator it( this, QListViewItemIterator::Selected ); + TQListViewItemIterator it( this, TQListViewItemIterator::Selected ); StatisticsDetailedItem *item = dynamic_cast(*it); @@ -168,16 +168,16 @@ StatisticsList::startDrag() list += KURL::fromPathOrURL( item->url() ); drag->addDragObject( new KURLDrag( list, viewport() ) ); drag->setPixmap( CollectionDB::createDragPixmap(list), - QPoint( CollectionDB::DRAGPIXMAP_OFFSET_X, + TQPoint( CollectionDB::DRAGPIXMAP_OFFSET_X, CollectionDB::DRAGPIXMAP_OFFSET_Y ) ); } else { - QTextDrag *textdrag = new QTextDrag( '\n' + item->getSQL(), 0 ); + TQTextDrag *textdrag = new TQTextDrag( '\n' + item->getSQL(), 0 ); textdrag->setSubtype( "amarok-sql" ); drag->addDragObject( textdrag ); drag->setPixmap( CollectionDB::createDragPixmapFromSQL( item->getSQL() ), - QPoint( CollectionDB::DRAGPIXMAP_OFFSET_X, + TQPoint( CollectionDB::DRAGPIXMAP_OFFSET_X, CollectionDB::DRAGPIXMAP_OFFSET_Y ) ); } @@ -215,7 +215,7 @@ StatisticsList::renderView() m_currentItem = 0; QueryBuilder qb; - QStringList a; + TQStringList a; qb.clear(); qb.addReturnFunctionValue( QueryBuilder::funcCount, QueryBuilder::tabSong, QueryBuilder::valURL ); @@ -239,7 +239,7 @@ StatisticsList::renderView() qb.setOptions( QueryBuilder::optRemoveDuplicates ); qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valArtistID ); //I can't get the correct value w/o using a subquery, and querybuilder doesn't support those - a = QString::number( qb.run().count() ); + a = TQString::number( qb.run().count() ); m_artistItem = new StatisticsItem( i18n("Favorite Artists"), this, m_mostplayedItem ); m_artistItem->setSubtext( i18n("%n artist", "%n artists", a[0].toInt()) ); @@ -251,7 +251,7 @@ StatisticsList::renderView() qb.setOptions( QueryBuilder::optRemoveDuplicates ); qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valAlbumID ); //I can't get the correct value w/o using a subquery, and querybuilder doesn't support those - a = QString::number( qb.run().count() ); + a = TQString::number( qb.run().count() ); m_albumItem = new StatisticsItem( i18n("Favorite Albums"), this, m_artistItem ); m_albumItem->setSubtext( i18n("%n album", "%n albums", a[0].toInt()) ); @@ -263,7 +263,7 @@ StatisticsList::renderView() qb.setOptions( QueryBuilder::optRemoveDuplicates ); qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valGenreID ); //I can't get the correct value w/o using a subquery, and querybuilder doesn't support those - a = QString::number( qb.run().count() ); + a = TQString::number( qb.run().count() ); m_genreItem = new StatisticsItem( i18n("Favorite Genres"), this, m_albumItem ); m_genreItem->setSubtext( i18n("%n genre", "%n genres", a[0].toInt()) ); @@ -272,7 +272,7 @@ StatisticsList::renderView() qb.addReturnFunctionValue( QueryBuilder::funcMin, QueryBuilder::tabStats, QueryBuilder::valCreateDate ); qb.setOptions( QueryBuilder::optRemoveDuplicates ); a = qb.run(); - QDateTime firstPlay = QDateTime::currentDateTime(); + TQDateTime firstPlay = TQDateTime::currentDateTime(); if ( a[0].toUInt() ) firstPlay.setTime_t( a[0].toUInt() ); @@ -288,7 +288,7 @@ StatisticsList::renderView() } void -StatisticsList::itemClicked( QListViewItem *item ) //SLOT +StatisticsList::itemClicked( TQListViewItem *item ) //SLOT { if( !item ) return; @@ -340,15 +340,15 @@ StatisticsList::expandInformation( StatisticsItem *item, bool refresh ) qb.setGoogleFilter( QueryBuilder::tabSong | QueryBuilder::tabArtist, m_filter ); qb.sortByFavorite(); qb.setLimit( 0, 50 ); - QStringList fave = qb.run(); + TQStringList fave = qb.run(); for( uint i=0; i < fave.count(); i += qb.countReturnValues() ) { - QString name = i18n("%1. %2 - %3").arg( QString::number(c), + TQString name = i18n("%1. %2 - %3").arg( TQString::number(c), fave[i].isEmpty() ? i18n( "Unknown" ) : fave[i], fave[i+1].isEmpty() ? i18n( "Unknown" ) : fave[i+1]); - QString score = locale->formatNumber( fave[i+3].toDouble(), 0 ); - QString rating = locale->formatNumber( fave[i+4].toDouble() / 2.0, 1 ); + TQString score = locale->formatNumber( fave[i+3].toDouble(), 0 ); + TQString rating = locale->formatNumber( fave[i+4].toDouble() / 2.0, 1 ); m_last = new StatisticsDetailedItem( name, subText( score, rating ), item, m_last ); m_last->setItemType( StatisticsDetailedItem::TRACK ); m_last->setUrl( fave[i+2] ); @@ -374,15 +374,15 @@ StatisticsList::expandInformation( StatisticsItem *item, bool refresh ) qb.setGoogleFilter( QueryBuilder::tabSong | QueryBuilder::tabArtist, m_filter ); qb.sortBy( QueryBuilder::tabStats, QueryBuilder::valPlayCounter, true ); qb.setLimit( 0, 50 ); - QStringList fave = qb.run(); + TQStringList fave = qb.run(); for( uint i=0; i < fave.count(); i += qb.countReturnValues() ) { - QString name = i18n("%1. %2 - %3").arg( QString::number(c), + TQString name = i18n("%1. %2 - %3").arg( TQString::number(c), fave[i].isEmpty() ? i18n( "Unknown" ) : fave[i], fave[i+1].isEmpty() ? i18n( "Unknown" ) : fave[i+1]); double plays = fave[i+3].toDouble(); - QString subtext = i18n("%1: %2").arg( i18n( "Playcount" ) ).arg( plays ); + TQString subtext = i18n("%1: %2").arg( i18n( "Playcount" ) ).arg( plays ); m_last = new StatisticsDetailedItem( name, subtext, item, m_last ); m_last->setItemType( StatisticsDetailedItem::TRACK ); m_last->setUrl( fave[i+2] ); @@ -409,17 +409,17 @@ StatisticsList::expandInformation( StatisticsItem *item, bool refresh ) qb.setGoogleFilter( QueryBuilder::tabArtist, m_filter ); qb.groupBy( QueryBuilder::tabArtist, QueryBuilder::valName); qb.setLimit( 0, 50 ); - QStringList fave = qb.run(); + TQStringList fave = qb.run(); for( uint i=0; i < fave.count(); i += qb.countReturnValues() ) { - QString name = i18n("%1. %2").arg( QString::number(c), + TQString name = i18n("%1. %2").arg( TQString::number(c), fave[i].isEmpty() ? i18n( "Unknown" ) : fave[i] ); - QString score = locale->formatNumber( fave[i+1].toDouble(), 2 ); - QString rating = locale->formatNumber( fave[i+2].toDouble() / 2.0, 2 ); + TQString score = locale->formatNumber( fave[i+1].toDouble(), 2 ); + TQString rating = locale->formatNumber( fave[i+2].toDouble() / 2.0, 2 ); m_last = new StatisticsDetailedItem( name, subText( score, rating ), item, m_last ); m_last->setItemType( StatisticsDetailedItem::ARTIST ); - QString url = QString("%1").arg( fave[i] ); + TQString url = TQString("%1").arg( fave[i] ); m_last->setUrl( url ); c++; } @@ -455,22 +455,22 @@ StatisticsList::expandInformation( StatisticsItem *item, bool refresh ) qb.groupBy( QueryBuilder::tabSong, QueryBuilder::valIsCompilation ); qb.setLimit( 0, 50 ); - QStringList fave = qb.run(); + TQStringList fave = qb.run(); - const QString trueValue = CollectionDB::instance()->boolT(); + const TQString trueValue = CollectionDB::instance()->boolT(); for( uint i=0; i < fave.count(); i += qb.countReturnValues() ) { const bool isSampler = (fave[i+6] == trueValue); - QString name = i18n("%1. %2 - %3").arg( QString::number(c), + TQString name = i18n("%1. %2 - %3").arg( TQString::number(c), fave[i].isEmpty() ? i18n( "Unknown" ) : fave[i], isSampler ? i18n( "Various Artists" ) : ( fave[i+1].isEmpty() ? i18n( "Unknown" ) : fave[i+1] ) ); - QString score = locale->formatNumber( fave[i+4].toDouble(), 2 ); - QString rating = locale->formatNumber( fave[i+5].toDouble() / 2.0, 2 ); + TQString score = locale->formatNumber( fave[i+4].toDouble(), 2 ); + TQString rating = locale->formatNumber( fave[i+5].toDouble() / 2.0, 2 ); m_last = new StatisticsDetailedItem( name, subText( score, rating ), item, m_last ); m_last->setItemType( StatisticsDetailedItem::ALBUM ); - QString url = QString("%1 @@@ %2").arg( isSampler ? "0" : fave[i+2], fave[i+3] ); + TQString url = TQString("%1 @@@ %2").arg( isSampler ? "0" : fave[i+2], fave[i+3] ); m_last->setUrl( url ); c++; } @@ -496,18 +496,18 @@ StatisticsList::expandInformation( StatisticsItem *item, bool refresh ) qb.sortByFavoriteAvg(); qb.groupBy( QueryBuilder::tabGenre, QueryBuilder::valName); qb.setLimit( 0, 50 ); - QStringList fave = qb.run(); + TQStringList fave = qb.run(); for( uint i=0; i < fave.count(); i += qb.countReturnValues() ) { - QString name = i18n("%1. %2").arg( QString::number(c), + TQString name = i18n("%1. %2").arg( TQString::number(c), fave[i].isEmpty() ? i18n( "Unknown" ) : fave[i] ); - QString score = locale->formatNumber( fave[i+1].toDouble(), 2 ); - QString rating = locale->formatNumber( fave[i+2].toDouble() / 2.0, 2 ); + TQString score = locale->formatNumber( fave[i+1].toDouble(), 2 ); + TQString rating = locale->formatNumber( fave[i+2].toDouble() / 2.0, 2 ); m_last = new StatisticsDetailedItem( name, subText( score, rating ), item, m_last ); m_last->setItemType( StatisticsDetailedItem::GENRE ); - QString url = QString("%1").arg( fave[i] ); + TQString url = TQString("%1").arg( fave[i] ); m_last->setUrl( url ); c++; } @@ -537,19 +537,19 @@ StatisticsList::expandInformation( StatisticsItem *item, bool refresh ) qb.groupBy( QueryBuilder::tabArtist, QueryBuilder::valID); qb.setOptions( QueryBuilder::optNoCompilations ); // samplers __need__ to be handled differently qb.setLimit( 0, 50 ); - QStringList newest = qb.run(); + TQStringList newest = qb.run(); for( uint i=0; i < newest.count(); i += qb.countReturnValues() ) { - QString name = i18n("%1. %2 - %3").arg( QString::number(c), + TQString name = i18n("%1. %2 - %3").arg( TQString::number(c), newest[i].isEmpty() ? i18n( "Unknown" ) : newest[i], newest[i+1].isEmpty() ? i18n( "Unknown" ) : newest[i+1] ); - QDateTime added = QDateTime(); + TQDateTime added = TQDateTime(); added.setTime_t( newest[i+4].toUInt() ); - QString subtext = i18n("Added: %1").arg( Amarok::verboseTimeSince( added ) ); + TQString subtext = i18n("Added: %1").arg( Amarok::verboseTimeSince( added ) ); m_last = new StatisticsDetailedItem( name, subtext, item, m_last ); m_last->setItemType( StatisticsDetailedItem::HISTORY ); - QString url = QString("%1 @@@ %2").arg( newest[i+2] ).arg( newest[i+3] ); + TQString url = TQString("%1 @@@ %2").arg( newest[i+2] ).arg( newest[i+3] ); m_last->setUrl( url ); c++; } @@ -560,7 +560,7 @@ StatisticsList::expandInformation( StatisticsItem *item, bool refresh ) delete locale; } -QString StatisticsList::subText( const QString &score, const QString &rating ) //static +TQString StatisticsList::subText( const TQString &score, const TQString &rating ) //static { if( AmarokConfig::useScores() && AmarokConfig::useRatings() ) return i18n( "Score: %1 Rating: %2" ).arg( score ).arg( rating ); @@ -569,11 +569,11 @@ QString StatisticsList::subText( const QString &score, const QString &rating ) / else if( AmarokConfig::useRatings() ) return i18n( "Rating: %1" ).arg( rating ); else - return QString(); + return TQString(); } void -StatisticsList::startHover( QListViewItem *item ) //SLOT +StatisticsList::startHover( TQListViewItem *item ) //SLOT { if( m_currentItem && item != m_currentItem ) static_cast(m_currentItem)->leaveHover(); @@ -598,21 +598,21 @@ StatisticsList::clearHover() //SLOT } void -StatisticsList::viewportPaintEvent( QPaintEvent *e ) +StatisticsList::viewportPaintEvent( TQPaintEvent *e ) { if( e ) KListView::viewportPaintEvent( e ); if( CollectionDB::instance()->isEmpty() && e ) { - QPainter p( viewport() ); - QString minimumText(i18n( + TQPainter p( viewport() ); + TQString minimumText(i18n( "
        " "

        Statistics

        " "You need a collection to use statistics! " "Create a collection and then start playing " "tracks to accumulate data on your play habits!" "
        " ) ); - QSimpleRichText t( minimumText, QApplication::font() ); + TQSimpleRichText t( minimumText, TQApplication::font() ); if ( t.width()+30 >= viewport()->width() || t.height()+30 >= viewport()->height() ) //too big, giving up @@ -625,12 +625,12 @@ StatisticsList::viewportPaintEvent( QPaintEvent *e ) p.setBrush( colorGroup().background() ); p.drawRoundRect( x, y, w+30, h+30, (8*200)/w, (8*200)/h ); - t.draw( &p, x+15, y+15, QRect(), colorGroup() ); + t.draw( &p, x+15, y+15, TQRect(), colorGroup() ); } } void -StatisticsList::showContextMenu( QListViewItem *item, const QPoint &p, int ) //SLOT +StatisticsList::showContextMenu( TQListViewItem *item, const TQPoint &p, int ) //SLOT { if( !item || item->rtti() == StatisticsItem::RTTI ) return; @@ -681,9 +681,9 @@ StatisticsList::showContextMenu( QListViewItem *item, const QPoint &p, int ) // /// CLASS StatisticsItem ////////////////////////////////////////////////////////////////////////////////////////// -StatisticsItem::StatisticsItem( QString text, StatisticsList *parent, KListViewItem *after, const char *name ) +StatisticsItem::StatisticsItem( TQString text, StatisticsList *parent, KListViewItem *after, const char *name ) : KListViewItem( static_cast(parent), after, name ) - , m_animTimer( new QTimer( this ) ) + , m_animTimer( new TQTimer( this ) ) , m_animCount( 0 ) , m_isActive( false ) , m_isExpanded( false ) @@ -694,13 +694,13 @@ StatisticsItem::StatisticsItem( QString text, StatisticsList *parent, KListViewI setText( 0, text ); - connect( m_animTimer, SIGNAL( timeout() ), this, SLOT( slotAnimTimer() ) ); + connect( m_animTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotAnimTimer() ) ); } void -StatisticsItem::setIcon( const QString &icon ) +StatisticsItem::setIcon( const TQString &icon ) { - QString path = kapp->iconLoader()->iconPath( icon, -KIcon::SizeHuge ); + TQString path = kapp->iconLoader()->iconPath( icon, -KIcon::SizeHuge ); path.replace( "32x32", "48x48" ); //HACK fucking KIconLoader only returns 32x32 max. Why? // debug() << "ICONPATH: " << path << endl; @@ -753,9 +753,9 @@ StatisticsItem::slotAnimTimer() } void -StatisticsItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align ) +StatisticsItem::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align ) { - QColor fillColor, textColor; + TQColor fillColor, textColor; if( m_isActive ) //glowing animation { @@ -773,7 +773,7 @@ StatisticsItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int w } //flicker-free drawing - static QPixmap buffer; + static TQPixmap buffer; buffer.resize( width, height() ); @@ -785,13 +785,13 @@ StatisticsItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int w buffer.fill( fillColor ); - QPainter pBuf( &buffer, true ); + TQPainter pBuf( &buffer, true ); KListView *lv = static_cast( listView() ); - QFont font( p->font() ); + TQFont font( p->font() ); font.setBold( true ); - QFontMetrics fm( p->fontMetrics() ); + TQFontMetrics fm( p->fontMetrics() ); int textHeight = height(); int text_x = 0; @@ -806,9 +806,9 @@ StatisticsItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int w } pBuf.setFont( font ); - QFontMetrics fmName( font ); + TQFontMetrics fmName( font ); - QString name = text(column); + TQString name = text(column); if( fmName.width( name ) + text_x + lv->itemMargin()*2 > width ) { const int _width = width - text_x - lv->itemMargin()*2; @@ -827,7 +827,7 @@ StatisticsItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int w if( m_isExpanded ) { - QPen pen( cg.highlight(), 1 ); + TQPen pen( cg.highlight(), 1 ); pBuf.setPen( pen ); int y = textHeight - 1; pBuf.drawLine( 0, y, width, y ); @@ -838,7 +838,7 @@ StatisticsItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int w } QColor -StatisticsItem::blendColors( const QColor& color1, const QColor& color2, int percent ) +StatisticsItem::blendColors( const TQColor& color1, const TQColor& color2, int percent ) { const float factor1 = ( 100 - ( float ) percent ) / 100; const float factor2 = ( float ) percent / 100; @@ -847,7 +847,7 @@ StatisticsItem::blendColors( const QColor& color1, const QColor& color2, int per const int g = static_cast( color1.green() * factor1 + color2.green() * factor2 ); const int b = static_cast( color1.blue() * factor1 + color2.blue() * factor2 ); - QColor result; + TQColor result; result.setRgb( r, g, b ); return result; @@ -857,7 +857,7 @@ StatisticsItem::blendColors( const QColor& color1, const QColor& color2, int per /// CLASS StatisticsDetailedItem ////////////////////////////////////////////////////////////////////////////////////////// -StatisticsDetailedItem::StatisticsDetailedItem( const QString &text, const QString &subtext, StatisticsItem *parent, +StatisticsDetailedItem::StatisticsDetailedItem( const TQString &text, const TQString &subtext, StatisticsItem *parent, StatisticsDetailedItem *after, const char *name ) : KListViewItem( parent, after, name ) , m_type( NONE ) @@ -871,12 +871,12 @@ StatisticsDetailedItem::StatisticsDetailedItem( const QString &text, const QStri } void -StatisticsDetailedItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align ) +StatisticsDetailedItem::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align ) { bool showDetails = !m_subText.isEmpty(); //flicker-free drawing - static QPixmap buffer; + static TQPixmap buffer; buffer.resize( width, height() ); if( buffer.isNull() ) @@ -885,7 +885,7 @@ StatisticsDetailedItem::paintCell( QPainter *p, const QColorGroup &cg, int colum return; } - QPainter pBuf( &buffer, true ); + TQPainter pBuf( &buffer, true ); // use alternate background #if KDE_VERSION < KDE_MAKE_VERSION(3,3,91) pBuf.fillRect( buffer.rect(), isSelected() ? cg.highlight() : backgroundColor() ); @@ -895,8 +895,8 @@ StatisticsDetailedItem::paintCell( QPainter *p, const QColorGroup &cg, int colum KListView *lv = static_cast( listView() ); - QFont font( p->font() ); - QFontMetrics fm( p->fontMetrics() ); + TQFont font( p->font() ); + TQFontMetrics fm( p->fontMetrics() ); int text_x = 0; int textHeight; @@ -917,9 +917,9 @@ StatisticsDetailedItem::paintCell( QPainter *p, const QColorGroup &cg, int colum } pBuf.setFont( font ); - QFontMetrics fmName( font ); + TQFontMetrics fmName( font ); - QString name = text(column); + TQString name = text(column); const int _width = width - text_x - lv->itemMargin()*2; if( fmName.width( name ) > _width ) { @@ -930,7 +930,7 @@ StatisticsDetailedItem::paintCell( QPainter *p, const QColorGroup &cg, int colum if( showDetails ) { - const QColorGroup _cg = listView()->palette().disabled(); + const TQColorGroup _cg = listView()->palette().disabled(); text_x = lv->treeStepSize() + 3; font.setItalic( true ); pBuf.setPen( isSelected() ? _cg.highlightedText() : _cg.text().dark() ); @@ -944,7 +944,7 @@ StatisticsDetailedItem::paintCell( QPainter *p, const QColorGroup &cg, int colum void StatisticsDetailedItem::setup() { - QFontMetrics fm( listView()->font() ); + TQFontMetrics fm( listView()->font() ); int margin = listView()->itemMargin()*2; int h = fm.lineSpacing(); if ( h % 2 > 0 ) @@ -959,8 +959,8 @@ QString StatisticsDetailedItem::getSQL() { QueryBuilder qb; - QString query = QString::null; - QString artist, album, track; // track is unused here + TQString query = TQString::null; + TQString artist, album, track; // track is unused here Amarok::albumArtistTrackFromUrl( url(), artist, album, track ); if( itemType() == StatisticsDetailedItem::ALBUM || itemType() == StatisticsDetailedItem::HISTORY ) @@ -978,7 +978,7 @@ StatisticsDetailedItem::getSQL() const uint artist_id = CollectionDB::instance()->artistID( url() ); qb.initSQLDrag(); - qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, QString::number( artist_id ) ); + qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, TQString::number( artist_id ) ); qb.sortBy( QueryBuilder::tabYear, QueryBuilder::valName ); qb.sortBy( QueryBuilder::tabAlbum, QueryBuilder::valName ); qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valDiscNumber ); @@ -990,7 +990,7 @@ StatisticsDetailedItem::getSQL() const uint genre_id = CollectionDB::instance()->genreID( url() ); qb.initSQLDrag(); - qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valGenreID, QString::number( genre_id ) ); + qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valGenreID, TQString::number( genre_id ) ); qb.sortBy( QueryBuilder::tabArtist, QueryBuilder::valName ); qb.sortBy( QueryBuilder::tabYear, QueryBuilder::valName ); qb.sortBy( QueryBuilder::tabAlbum, QueryBuilder::valName ); @@ -1009,8 +1009,8 @@ StatisticsDetailedItem::getURLs() return KURL::List( KURL::fromPathOrURL(url()) ); QueryBuilder qb; - QString query = QString::null; - QString artist, album, track; // track is unused here + TQString query = TQString::null; + TQString artist, album, track; // track is unused here Amarok::albumArtistTrackFromUrl( m_url, artist, album, track ); qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL ); @@ -1026,18 +1026,18 @@ StatisticsDetailedItem::getURLs() else if( itemType() == StatisticsDetailedItem::ARTIST ) { const uint artist_id = CollectionDB::instance()->artistID( url() ); - qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, QString::number( artist_id ) ); + qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, TQString::number( artist_id ) ); qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valTrack ); } else if( itemType() == StatisticsDetailedItem::GENRE ) { const uint genre_id = CollectionDB::instance()->genreID( url() ); - qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valGenreID, QString::number( genre_id ) ); + qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valGenreID, TQString::number( genre_id ) ); qb.sortBy( QueryBuilder::tabSong, QueryBuilder::valTrack ); } - QStringList values = qb.run(); + TQStringList values = qb.run(); KURL::List urls; foreach( values ) urls += KURL::fromPathOrURL( *it ); diff --git a/amarok/src/statistics.h b/amarok/src/statistics.h index cbad3711..1d3a370f 100644 --- a/amarok/src/statistics.h +++ b/amarok/src/statistics.h @@ -19,11 +19,11 @@ #include //baseclass #include //baseclass -#include +#include class ClickLineEdit; -class QColor; -class QTimer; +class TQColor; +class TQTimer; class StatisticsList; class StatisticsItem; @@ -34,7 +34,7 @@ class Statistics : public KDialogBase Q_OBJECT public: - Statistics( QWidget *parent = 0, const char *name = 0 ); + Statistics( TQWidget *parent = 0, const char *name = 0 ); ~Statistics(); static Statistics *instance() { return s_instance; } @@ -46,7 +46,7 @@ class Statistics : public KDialogBase private: StatisticsList *m_listView; ClickLineEdit *m_lineEdit; - QTimer *m_timer; + TQTimer *m_timer; static Statistics *s_instance; }; @@ -56,25 +56,25 @@ class StatisticsList : public KListView Q_OBJECT public: - StatisticsList( QWidget *parent, const char *name=0 ); + StatisticsList( TQWidget *parent, const char *name=0 ); ~StatisticsList() {}; - QString filter() { return m_filter; } - void setFilter( const QString &filter ) { m_filter = filter; } + TQString filter() { return m_filter; } + void setFilter( const TQString &filter ) { m_filter = filter; } void renderView(); void refreshView(); private slots: void clearHover(); - void itemClicked( QListViewItem *item ); - void showContextMenu( QListViewItem *item, const QPoint &p, int ); - void startHover( QListViewItem *item ); + void itemClicked( TQListViewItem *item ); + void showContextMenu( TQListViewItem *item, const TQPoint &p, int ); + void startHover( TQListViewItem *item ); private: void startDrag(); - void viewportPaintEvent( QPaintEvent* ); + void viewportPaintEvent( TQPaintEvent* ); void expandInformation( StatisticsItem *item, bool refresh=false ); - static QString subText( const QString &score, const QString &rating ); + static TQString subText( const TQString &score, const TQString &rating ); StatisticsItem *m_trackItem; StatisticsItem *m_mostplayedItem; @@ -83,23 +83,23 @@ class StatisticsList : public KListView StatisticsItem *m_genreItem; StatisticsItem *m_newestItem; - QListViewItem *m_currentItem; - QString m_filter; + TQListViewItem *m_currentItem; + TQString m_filter; bool m_expanded; }; /// The listview items which are the headers for the categories -class StatisticsItem : public QObject, public KListViewItem +class StatisticsItem : public TQObject, public KListViewItem { Q_OBJECT public: - StatisticsItem( QString text, StatisticsList *parent, KListViewItem *after=0, const char *name=0 ); + StatisticsItem( TQString text, StatisticsList *parent, KListViewItem *after=0, const char *name=0 ); ~StatisticsItem() {}; - void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align ); - void paintFocus( QPainter*, const QColorGroup& , const QRect& ) {}; //reimp - void setIcon( const QString &icon ); + void paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align ); + void paintFocus( TQPainter*, const TQColorGroup& , const TQRect& ) {}; //reimp + void setIcon( const TQString &icon ); void enterHover(); void leaveHover(); @@ -107,7 +107,7 @@ class StatisticsItem : public QObject, public KListViewItem void setExpanded( const bool b ) { m_isExpanded = b; } const bool isExpanded() { return m_isExpanded; } - void setSubtext( QString t ) { m_subText = t; } + void setSubtext( TQString t ) { m_subText = t; } int rtti() const { return RTTI; } static const int RTTI = 1000; //header item @@ -120,50 +120,50 @@ class StatisticsItem : public QObject, public KListViewItem void slotAnimTimer(); private: - QColor blendColors( const QColor& color1, const QColor& color2, int percent ); + TQColor blendColors( const TQColor& color1, const TQColor& color2, int percent ); - QTimer *m_animTimer; + TQTimer *m_animTimer; bool m_animEnter; int m_animCount; bool m_isActive; bool m_isExpanded; - QString m_subText; + TQString m_subText; }; /// Listview items for the children of expanded items (the actual results) class StatisticsDetailedItem : public KListViewItem { public: - StatisticsDetailedItem( const QString &text, const QString &subtext, StatisticsItem *parent, + StatisticsDetailedItem( const TQString &text, const TQString &subtext, StatisticsItem *parent, StatisticsDetailedItem *after=0, const char *name=0 ); ~StatisticsDetailedItem() {}; enum ItemType { NONE, TRACK, ARTIST, ALBUM, GENRE, HISTORY }; void setup(); - void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align ); + void paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align ); void setItemType( const ItemType t ) { m_type = t; } const ItemType itemType() { return m_type; } - void setUrl( QString &url ) { m_url = url; } - const QString url() { return m_url; } + void setUrl( TQString &url ) { m_url = url; } + const TQString url() { return m_url; } - void setSubtext( QString t ) { m_subText = t; } - QString getSQL(); //get the sql query for all the urls the item represents + void setSubtext( TQString t ) { m_subText = t; } + TQString getSQL(); //get the sql query for all the urls the item represents KURL::List getURLs(); - void paintFocus( QPainter*, const QColorGroup& , const QRect& ) {}; //reimp + void paintFocus( TQPainter*, const TQColorGroup& , const TQRect& ) {}; //reimp int rtti() const { return RTTI; } static const int RTTI = 1001; //detailed item private: ItemType m_type; - QString m_url; - QString m_subText; + TQString m_url; + TQString m_subText; }; diff --git a/amarok/src/statusbar/overlayWidget.cpp b/amarok/src/statusbar/overlayWidget.cpp index ce234359..7f120a53 100644 --- a/amarok/src/statusbar/overlayWidget.cpp +++ b/amarok/src/statusbar/overlayWidget.cpp @@ -20,14 +20,14 @@ #include "overlayWidget.h" #include "statusbar.h" -#include +#include namespace KDE { -OverlayWidget::OverlayWidget( QWidget *parent, QWidget *anchor, const char* name ) - : QFrame( parent->parentWidget(), name ) +OverlayWidget::OverlayWidget( TQWidget *parent, TQWidget *anchor, const char* name ) + : TQFrame( parent->parentWidget(), name ) , m_anchor( anchor ) , m_parent( parent ) { @@ -43,16 +43,16 @@ OverlayWidget::reposition() adjustSize(); // p is in the alignWidget's coordinates - QPoint p; + TQPoint p; p.setX( m_anchor->width() - width() ); p.setY( -height() ); // Position in the toplevelwidget's coordinates - QPoint pTopLevel = m_anchor->mapTo( topLevelWidget(), p ); + TQPoint pTopLevel = m_anchor->mapTo( topLevelWidget(), p ); // Position in the widget's parentWidget coordinates - QPoint pParent = parentWidget() ->mapFrom( topLevelWidget(), pTopLevel ); + TQPoint pParent = parentWidget() ->mapFrom( topLevelWidget(), pTopLevel ); // keep it on the screen if( pParent.x() < 0 ) pParent.rx() = 0; @@ -62,28 +62,28 @@ OverlayWidget::reposition() } // bool -// OverlayWidget::eventFilter( QObject* o, QEvent* e ) +// OverlayWidget::eventFilter( TQObject* o, TQEvent* e ) // { -// if ( e->type() == QEvent::Move || e->type() == QEvent::Resize ) +// if ( e->type() == TQEvent::Move || e->type() == TQEvent::Resize ) // reposition(); // -// return QFrame::eventFilter( o, e ); +// return TQFrame::eventFilter( o, e ); // } // void -// OverlayWidget::resizeEvent( QResizeEvent* ev ) +// OverlayWidget::resizeEvent( TQResizeEvent* ev ) // { // reposition(); -// QFrame::resizeEvent( ev ); +// TQFrame::resizeEvent( ev ); // } bool -OverlayWidget::event( QEvent *e ) +OverlayWidget::event( TQEvent *e ) { - if ( e->type() == QEvent::ChildInserted ) + if ( e->type() == TQEvent::ChildInserted ) adjustSize(); - return QFrame::event( e ); + return TQFrame::event( e ); } } diff --git a/amarok/src/statusbar/overlayWidget.h b/amarok/src/statusbar/overlayWidget.h index e3cfa08e..f9572794 100644 --- a/amarok/src/statusbar/overlayWidget.h +++ b/amarok/src/statusbar/overlayWidget.h @@ -20,7 +20,7 @@ #ifndef KDEOVERLAYWIDGET_H #define KDEOVERLAYWIDGET_H -#include +#include namespace KDE { @@ -31,17 +31,17 @@ namespace KDE * The widget is parented to the toplevelwidget of alignWidget, * this could be an issue if that widget has an autoAdd Layout */ - OverlayWidget( QWidget *parent, QWidget *anchor, const char *name = 0 ); + OverlayWidget( TQWidget *parent, TQWidget *anchor, const char *name = 0 ); virtual void reposition(); protected: -// virtual void resizeEvent( QResizeEvent* ); -// virtual bool eventFilter( QObject*, QEvent* ); - virtual bool event( QEvent* ); +// virtual void resizeEvent( TQResizeEvent* ); +// virtual bool eventFilter( TQObject*, TQEvent* ); + virtual bool event( TQEvent* ); private: - QWidget *m_anchor; - QWidget *m_parent; + TQWidget *m_anchor; + TQWidget *m_parent; }; } diff --git a/amarok/src/statusbar/popupMessage.cpp b/amarok/src/statusbar/popupMessage.cpp index a95404a4..31a0ae24 100644 --- a/amarok/src/statusbar/popupMessage.cpp +++ b/amarok/src/statusbar/popupMessage.cpp @@ -27,18 +27,18 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include namespace KDE { -PopupMessage::PopupMessage( QWidget *parent, QWidget *anchor, int timeout, const char *name ) +PopupMessage::PopupMessage( TQWidget *parent, TQWidget *anchor, int timeout, const char *name ) : OverlayWidget( parent, anchor, name ) , m_anchor( anchor ) , m_parent( parent ) @@ -51,45 +51,45 @@ PopupMessage::PopupMessage( QWidget *parent, QWidget *anchor, int timeout, const , m_timeout( timeout ) , m_showCounter( true ) { - setFrameStyle( QFrame::Panel | QFrame::Raised ); - setFrameShape( QFrame::StyledPanel ); + setFrameStyle( TQFrame::Panel | TQFrame::Raised ); + setFrameShape( TQFrame::StyledPanel ); setWFlags( Qt::WX11BypassWM ); - QPalette p = QToolTip::palette(); + TQPalette p = TQToolTip::palette(); setPalette( p ); - QHBoxLayout *hbox; - QLabel *label; + TQHBoxLayout *hbox; + TQLabel *label; KActiveLabel *alabel; - m_layout = new QVBoxLayout( this, 9 /*margin*/, 6 /*spacing*/ ); + m_layout = new TQVBoxLayout( this, 9 /*margin*/, 6 /*spacing*/ ); - hbox = new QHBoxLayout( m_layout, 12 ); + hbox = new TQHBoxLayout( m_layout, 12 ); - hbox->addWidget( m_countdownFrame = new QFrame( this, "counterVisual" ) ); + hbox->addWidget( m_countdownFrame = new TQFrame( this, "counterVisual" ) ); m_countdownFrame->setFixedWidth( fontMetrics().width( "X" ) ); - m_countdownFrame->setFrameStyle( QFrame::Plain | QFrame::Box ); + m_countdownFrame->setFrameStyle( TQFrame::Plain | TQFrame::Box ); m_countdownFrame->setPaletteForegroundColor( paletteBackgroundColor().dark() ); - label = new QLabel( this, "image" ); + label = new TQLabel( this, "image" ); hbox->add( label ); alabel = new KActiveLabel( this, "label" ); alabel->setTextFormat( Qt::RichText ); - alabel->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred ); + alabel->setSizePolicy( TQSizePolicy::MinimumExpanding, TQSizePolicy::Preferred ); alabel->setPalette( p ); hbox->add( alabel ); - hbox = new QHBoxLayout( m_layout ); + hbox = new TQHBoxLayout( m_layout ); - hbox->addItem( new QSpacerItem( 4, 4, QSizePolicy::Expanding, QSizePolicy::Preferred ) ); + hbox->addItem( new TQSpacerItem( 4, 4, TQSizePolicy::Expanding, TQSizePolicy::Preferred ) ); hbox->add( new KPushButton( KStdGuiItem::close(), this, "closeButton" ) ); - connect( child( "closeButton" ), SIGNAL(clicked()), SLOT(close()) ); + connect( child( "closeButton" ), TQT_SIGNAL(clicked()), TQT_SLOT(close()) ); } -void PopupMessage::addWidget( QWidget *widget ) +void PopupMessage::addWidget( TQWidget *widget ) { m_layout->add( widget ); adjustSize(); @@ -104,25 +104,25 @@ void PopupMessage::setShowCloseButton( const bool show ) void PopupMessage::setShowCounter( const bool show ) { m_showCounter = show; - static_cast(child( "counterVisual" ))->setShown( show ); + static_cast(child( "counterVisual" ))->setShown( show ); adjustSize(); } -void PopupMessage::setText( const QString &text ) +void PopupMessage::setText( const TQString &text ) { static_cast(child( "label" ))->setText( text ); adjustSize(); } -void PopupMessage::setImage( const QString &location ) +void PopupMessage::setImage( const TQString &location ) { - static_cast(child( "image" ))->setPixmap( QPixmap( location ) ); + static_cast(child( "image" ))->setPixmap( TQPixmap( location ) ); adjustSize(); } -void PopupMessage::setImage( const QPixmap &pix ) +void PopupMessage::setImage( const TQPixmap &pix ) { - static_cast(child( "image" ))->setPixmap( pix ); + static_cast(child( "image" ))->setPixmap( pix ); adjustSize(); } @@ -162,7 +162,7 @@ void PopupMessage::display() //SLOT // Protected //////////////////////////////////////////////////////////////////////// -void PopupMessage::timerEvent( QTimerEvent* ) +void PopupMessage::timerEvent( TQTimerEvent* ) { switch( m_maskEffect ) { @@ -188,10 +188,10 @@ void PopupMessage::countDown() return; } - QFrame *&h = m_countdownFrame; + TQFrame *&h = m_countdownFrame; if( m_counter < h->height() - 3 ) - QPainter( h ).fillRect( 2, 2, h->width() - 4, m_counter, palette().active().highlight() ); + TQPainter( h ).fillRect( 2, 2, h->width() - 4, m_counter, palette().active().highlight() ); if( !hasMouse() ) m_counter++; @@ -214,7 +214,7 @@ void PopupMessage::dissolveMask() if( m_stage == 1 ) { repaint( false ); - QPainter maskPainter(&m_mask); + TQPainter maskPainter(&m_mask); m_mask.fill(Qt::black); diff --git a/amarok/src/statusbar/popupMessage.h b/amarok/src/statusbar/popupMessage.h index ff1a430a..41245738 100644 --- a/amarok/src/statusbar/popupMessage.h +++ b/amarok/src/statusbar/popupMessage.h @@ -27,9 +27,9 @@ #include "overlayWidget.h" -#include -#include -#include +#include +#include +#include namespace KDE { @@ -47,17 +47,17 @@ namespace KDE * @param timeout : how long to wait before auto closing. A value of 0 means close * only on pressing the closeButton or close() is called. */ - PopupMessage( QWidget *parent, QWidget *anchor, int timeout = 5000 /*milliseconds*/, const char* name = 0 ); + PopupMessage( TQWidget *parent, TQWidget *anchor, int timeout = 5000 /*milliseconds*/, const char* name = 0 ); enum MaskEffect { Plain, Slide, Dissolve }; - void addWidget( QWidget *widget ); + void addWidget( TQWidget *widget ); void setShowCloseButton( const bool show ); void setShowCounter( const bool show ); - void setImage( const QString &location ); - void setImage( const QPixmap &pix ); + void setImage( const TQString &location ); + void setImage( const TQPixmap &pix ); void setMaskEffect( const MaskEffect type ) { m_maskEffect = type; } - void setText( const QString &text ); + void setText( const TQString &text ); void setTimeout( const int time ) { m_timeout = time; } public slots: @@ -65,7 +65,7 @@ namespace KDE void display(); protected: - void timerEvent( QTimerEvent* ); + void timerEvent( TQTimerEvent* ); void countDown(); /** @@ -84,11 +84,11 @@ namespace KDE void slideMask(); private: - QVBoxLayout *m_layout; - QFrame *m_countdownFrame; - QWidget *m_anchor; - QWidget *m_parent; - QBitmap m_mask; + TQVBoxLayout *m_layout; + TQFrame *m_countdownFrame; + TQWidget *m_anchor; + TQWidget *m_parent; + TQBitmap m_mask; MaskEffect m_maskEffect; int m_dissolveSize; diff --git a/amarok/src/statusbar/progressBar.cpp b/amarok/src/statusbar/progressBar.cpp index bb3507b0..9b6d1415 100644 --- a/amarok/src/statusbar/progressBar.cpp +++ b/amarok/src/statusbar/progressBar.cpp @@ -25,20 +25,20 @@ #include #include -#include +#include namespace KDE { -ProgressBar::ProgressBar( QWidget *parent, QLabel *label ) - : QProgressBar( parent ) +ProgressBar::ProgressBar( TQWidget *parent, TQLabel *label ) + : TQProgressBar( parent ) , m_label( label ) , m_done( false ) { DEBUG_FUNC_INFO - m_label->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); + m_label->setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum ); m_abort = new KPushButton( KStdGuiItem::cancel(), parent ); m_abort->hide(); m_abort->setText( i18n("Abort") ); @@ -52,7 +52,7 @@ ProgressBar::~ProgressBar() } ProgressBar& -ProgressBar::setDescription( const QString &text ) +ProgressBar::setDescription( const TQString &text ) { m_description = text; m_label->setText( text ); @@ -61,9 +61,9 @@ ProgressBar::setDescription( const QString &text ) } ProgressBar& -ProgressBar::setStatus( const QString &text ) +ProgressBar::setStatus( const TQString &text ) { - QString s = m_description; + TQString s = m_description; s += " ["; s += text; s += ']'; @@ -75,10 +75,10 @@ ProgressBar::setStatus( const QString &text ) } ProgressBar& -ProgressBar::setAbortSlot( QObject *receiver, const char *slot ) +ProgressBar::setAbortSlot( TQObject *receiver, const char *slot ) { - connect( m_abort, SIGNAL(clicked()), receiver, slot ); - connect( m_abort, SIGNAL(clicked()), this, SLOT(hide()) ); + connect( m_abort, TQT_SIGNAL(clicked()), receiver, slot ); + connect( m_abort, TQT_SIGNAL(clicked()), this, TQT_SLOT(hide()) ); m_abort->show(); parentWidget()->adjustSize(); @@ -87,10 +87,10 @@ ProgressBar::setAbortSlot( QObject *receiver, const char *slot ) } ProgressBar& -ProgressBar::setProgressSignal( QObject *sender, const char *signal ) +ProgressBar::setProgressSignal( TQObject *sender, const char *signal ) { setTotalSteps( 100 ); - connect( sender, signal, Amarok::StatusBar::instance(), SLOT( setProgress ( const QObject*, int ) ) ); + connect( sender, signal, Amarok::StatusBar::instance(), TQT_SLOT( setProgress ( const TQObject*, int ) ) ); return *this; } diff --git a/amarok/src/statusbar/progressBar.h b/amarok/src/statusbar/progressBar.h index c8c72190..a3328194 100644 --- a/amarok/src/statusbar/progressBar.h +++ b/amarok/src/statusbar/progressBar.h @@ -24,10 +24,10 @@ #ifndef KDE_PROGRESSBAR_H #define KDE_PROGRESSBAR_H -#include +#include -class QLabel; -class QPushButton; +class TQLabel; +class TQPushButton; namespace KDE { @@ -41,31 +41,31 @@ namespace KDE public: /** @param text a 1-6 word description of the progress operation */ - ProgressBar &setDescription( const QString &text ); + ProgressBar &setDescription( const TQString &text ); /** @param text eg. Scanning, Reading. The state of the operation */ - ProgressBar &setStatus( const QString &text ); + ProgressBar &setStatus( const TQString &text ); /** set the recipient slot for the abort button */ - ProgressBar &setAbortSlot( QObject *receiver, const char *slot ); + ProgressBar &setAbortSlot( TQObject *receiver, const char *slot ); - ProgressBar &setProgressSignal( QObject *sender, const char *signal ); + ProgressBar &setProgressSignal( TQObject *sender, const char *signal ); void setDone(); - QString description() const { return m_description; } + TQString description() const { return m_description; } protected: - ProgressBar( QWidget *parent, QLabel *label ); + ProgressBar( TQWidget *parent, TQLabel *label ); ~ProgressBar(); virtual void hide(); - QLabel *m_label; - QString m_description; + TQLabel *m_label; + TQString m_description; bool m_done; - QPushButton *m_abort; + TQPushButton *m_abort; }; } diff --git a/amarok/src/statusbar/queueLabel.cpp b/amarok/src/statusbar/queueLabel.cpp index 0ea8c3fb..6c3ae103 100644 --- a/amarok/src/statusbar/queueLabel.cpp +++ b/amarok/src/statusbar/queueLabel.cpp @@ -25,11 +25,11 @@ #include "queueLabel.h" #include "statusbar.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -39,18 +39,18 @@ static const uint MAX_TO_SHOW = 20; -QueueLabel::QueueLabel( QWidget *parent, const char *name ) - : QLabel( parent, name ) +QueueLabel::QueueLabel( TQWidget *parent, const char *name ) + : TQLabel( parent, name ) , m_timer( this ) , m_tooltip( 0 ) , m_tooltipShowing( false ) , m_tooltipHidden( false ) { - connect( this, SIGNAL( queueChanged( const PLItemList &, const PLItemList & ) ), - Playlist::instance(), SIGNAL( queueChanged( const PLItemList &, const PLItemList & ) ) ); + connect( this, TQT_SIGNAL( queueChanged( const PLItemList &, const PLItemList & ) ), + Playlist::instance(), TQT_SIGNAL( queueChanged( const PLItemList &, const PLItemList & ) ) ); - connect( CollectionDB::instance(), SIGNAL( coverChanged( const QString &, const QString & ) ), - this, SLOT( slotCoverChanged( const QString &, const QString & ) ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( coverChanged( const TQString &, const TQString & ) ), + this, TQT_SLOT( slotCoverChanged( const TQString &, const TQString & ) ) ); setNum( 0 ); } @@ -64,14 +64,14 @@ void QueueLabel::update() //SLOT getCover( queue.getFirst()->artist(), queue.getFirst()->album() ); } -void QueueLabel::slotCoverChanged( const QString &artist, const QString &album ) //SLOT +void QueueLabel::slotCoverChanged( const TQString &artist, const TQString &album ) //SLOT { PLItemList &queue = Playlist::instance()->m_nextTracks; if( isVisible() && queue.getFirst()->artist().string() == artist && queue.getFirst()->album().string() == album ) getCover( artist, album ); } -void QueueLabel::getCover( const QString &artist, const QString &album ) +void QueueLabel::getCover( const TQString &artist, const TQString &album ) { m_cover = CollectionDB::instance()->albumImage( artist, album, 50 ); if( m_cover == CollectionDB::instance()->notAvailCover( 50 ) ) @@ -89,15 +89,15 @@ void QueueLabel::setNum( int num ) { show(); - const QString text = QString::number( num ); + const TQString text = TQString::number( num ); const int h = 18; - QFont f = font(); + TQFont f = font(); f.setPixelSize( h - 2 ); f.setBold( true ); - const int w = kMax( h, QFontMetrics( f ).width( text ) + h/4 + 2 ); + const int w = kMax( h, TQFontMetrics( f ).width( text ) + h/4 + 2 ); - QPixmap pix( w, h ); - QPainter p( &pix ); + TQPixmap pix( w, h ); + TQPainter p( &pix ); p.setBrush( colorGroup().background() ); p.setPen( colorGroup().background() ); @@ -127,13 +127,13 @@ void QueueLabel::setNum( int num ) } } -void QueueLabel::enterEvent( QEvent* ) +void QueueLabel::enterEvent( TQEvent* ) { m_tooltipHidden = false; - QTimer::singleShot( 1000, this, SLOT(aboutToShow()) ); + TQTimer::singleShot( 1000, this, TQT_SLOT(aboutToShow()) ); } -void QueueLabel::leaveEvent( QEvent* ) +void QueueLabel::leaveEvent( TQEvent* ) { hideToolTip(); } @@ -145,7 +145,7 @@ void QueueLabel::aboutToShow() showToolTip(); } -void QueueLabel::mousePressEvent( QMouseEvent* mouseEvent ) +void QueueLabel::mousePressEvent( TQMouseEvent* mouseEvent ) { hideToolTip(); @@ -161,13 +161,13 @@ void QueueLabel::mousePressEvent( QMouseEvent* mouseEvent ) return; int length = 0; - for( QPtrListIterator it( queue ); *it; ++it ) + for( TQPtrListIterator it( queue ); *it; ++it ) { const int s = (*it)->length(); if( s > 0 ) length += s; } - QPtrList menus; + TQPtrList menus; menus.setAutoDelete( true ); KPopupMenu *menu = new KPopupMenu; menus.append( menu ); @@ -184,7 +184,7 @@ void QueueLabel::mousePressEvent( QMouseEvent* mouseEvent ) menu->insertSeparator(); uint i = 1; - QPtrListIterator it( queue ); + TQPtrListIterator it( queue ); it.toFirst(); while( i <= count ) @@ -207,9 +207,9 @@ void QueueLabel::mousePressEvent( QMouseEvent* mouseEvent ) int mx, my; const int mw = menu->sizeHint().width(), mh = menu->sizeHint().height(), - sy = mapFrom( Amarok::StatusBar::instance(), QPoint( 0, 0 ) ).y(), + sy = mapFrom( Amarok::StatusBar::instance(), TQPoint( 0, 0 ) ).y(), sheight = Amarok::StatusBar::instance()->height(); - const QRect dr = QApplication::desktop()->availableGeometry( this ); + const TQRect dr = TQApplication::desktop()->availableGeometry( this ); if( mapYToGlobal( sy ) - mh > dr.y() ) my = mapYToGlobal( sy ) - mh; @@ -220,7 +220,7 @@ void QueueLabel::mousePressEvent( QMouseEvent* mouseEvent ) mx = mapXToGlobal( 0 ) - ( mw - width() ) / 2; - int id = menu->exec( QPoint( mx, my ) ); + int id = menu->exec( TQPoint( mx, my ) ); if( id < 0 ) m_timer.start( 50, true ); else if( id == 0 ) //dequeue @@ -252,18 +252,18 @@ void QueueLabel::showToolTip() if( !item ) return; - QString text; + TQString text; if( count > 1 ) { int length = 0; - for( QPtrListIterator it( pl->m_nextTracks ); *it; ++it ) + for( TQPtrListIterator it( pl->m_nextTracks ); *it; ++it ) { const int s = (*it)->length(); if( s > 0 ) length += s; } if( length ) - text += QString("
        %1
        ") + text += TQString("
        %1
        ") .arg( i18n( "1 track (%1)", "%n tracks (%1)", count ) .arg( MetaBundle::prettyLength( length, true ) ) ); } @@ -291,14 +291,14 @@ void QueueLabel::hideToolTip() m_tooltipShowing = false; } -QString QueueLabel::veryNiceTitle( PlaylistItem* item, bool bold ) const +TQString QueueLabel::veryNiceTitle( PlaylistItem* item, bool bold ) const { - const QString artist = item->artist()->stripWhiteSpace(), + const TQString artist = item->artist()->stripWhiteSpace(), title = item->title().stripWhiteSpace(); if( !artist.isEmpty() && !title.isEmpty() ) return ( bold ? i18n( "%1 by %2" ) : i18n( "%1 by %2" ) ).arg( title ).arg( artist ); else - return QString( "%1" ).arg( MetaBundle::prettyTitle( item->filename() ) ); + return TQString( "%1" ).arg( MetaBundle::prettyTitle( item->filename() ) ); } diff --git a/amarok/src/statusbar/queueLabel.h b/amarok/src/statusbar/queueLabel.h index 61cd215f..71432fab 100644 --- a/amarok/src/statusbar/queueLabel.h +++ b/amarok/src/statusbar/queueLabel.h @@ -23,15 +23,15 @@ #include "playlistitem.h" #include "popupMessage.h" -#include -#include +#include +#include -class QueueLabel: public QLabel //homonym, heh heh +class QueueLabel: public TQLabel //homonym, heh heh { Q_OBJECT public: - QueueLabel( QWidget *parent, const char *name = 0 ); + QueueLabel( TQWidget *parent, const char *name = 0 ); signals: void queueChanged( const PLItemList &, const PLItemList & ); @@ -39,28 +39,28 @@ class QueueLabel: public QLabel //homonym, heh heh public slots: virtual void update(); virtual void setNum( int num ); - void enterEvent( QEvent * ); - void leaveEvent( QEvent * ); + void enterEvent( TQEvent * ); + void leaveEvent( TQEvent * ); private slots: void aboutToShow(); - void slotCoverChanged( const QString &artist, const QString &album ); + void slotCoverChanged( const TQString &artist, const TQString &album ); protected: - virtual void mousePressEvent( QMouseEvent* e ); + virtual void mousePressEvent( TQMouseEvent* e ); private: void showToolTip(); void hideToolTip(); - QString veryNiceTitle( PlaylistItem * item, bool bold = false ) const; - void getCover( const QString &artist, const QString &album ); + TQString veryNiceTitle( PlaylistItem * item, bool bold = false ) const; + void getCover( const TQString &artist, const TQString &album ); - inline int mapXToGlobal( int x ) { return mapToGlobal( QPoint( x, 0 ) ).x(); } - inline int mapYToGlobal( int y ) { return mapToGlobal( QPoint( 0, y ) ).y(); } + inline int mapXToGlobal( int x ) { return mapToGlobal( TQPoint( x, 0 ) ).x(); } + inline int mapYToGlobal( int y ) { return mapToGlobal( TQPoint( 0, y ) ).y(); } - QTimer m_timer; + TQTimer m_timer; - QString m_cover; + TQString m_cover; KDE::PopupMessage *m_tooltip; bool m_tooltipShowing; diff --git a/amarok/src/statusbar/selectLabel.h b/amarok/src/statusbar/selectLabel.h index ab72381b..1da2b668 100644 --- a/amarok/src/statusbar/selectLabel.h +++ b/amarok/src/statusbar/selectLabel.h @@ -30,10 +30,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include class SelectLabel : public QLabel { @@ -45,16 +45,16 @@ class SelectLabel : public QLabel void activated( int ); public: - SelectLabel( Amarok::SelectAction const*const action, QWidget *parent ) - : QLabel( parent ) + SelectLabel( Amarok::SelectAction const*const action, TQWidget *parent ) + : TQLabel( parent ) , m_action( action ) , m_tooltip( 0 ) , m_tooltipShowing( false ) , m_tooltipHidden( false ) { - connect( this, SIGNAL( activated( int ) ), action, SLOT( setCurrentItem( int ) ) ); - connect( action, SIGNAL( activated( int ) ), this, SLOT( setCurrentItem( int ) ) ); - connect( action, SIGNAL( enabled( bool ) ), this, SLOT( setEnabled( bool ) ) ); + connect( this, TQT_SIGNAL( activated( int ) ), action, TQT_SLOT( setCurrentItem( int ) ) ); + connect( action, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( setCurrentItem( int ) ) ); + connect( action, TQT_SIGNAL( enabled( bool ) ), this, TQT_SLOT( setEnabled( bool ) ) ); setCurrentItem( currentItem() ); } @@ -63,7 +63,7 @@ class SelectLabel : public QLabel inline bool isEnabled() const { return m_action->isEnabled(); } protected: - void mousePressEvent( QMouseEvent* ) + void mousePressEvent( TQMouseEvent* ) { bool shown = m_tooltipShowing; hideToolTip(); @@ -84,14 +84,14 @@ class SelectLabel : public QLabel } } - void enterEvent( QEvent* ) + void enterEvent( TQEvent* ) { //Show the tooltip after 1/2 second m_tooltipHidden = false; - QTimer::singleShot( 500, this, SLOT(aboutToShow()) ); + TQTimer::singleShot( 500, this, TQT_SLOT(aboutToShow()) ); } - void leaveEvent( QEvent* ) + void leaveEvent( TQEvent* ) { hideToolTip(); } @@ -106,7 +106,7 @@ class SelectLabel : public QLabel void setEnabled( bool /*on*/ ) { if( !m_action->currentIcon().isNull() ) - setPixmap( SmallIconSet( m_action->currentIcon() ).pixmap( QIconSet::Small, QIconSet::Disabled ) ); + setPixmap( SmallIconSet( m_action->currentIcon() ).pixmap( TQIconSet::Small, TQIconSet::Disabled ) ); } private slots: @@ -124,7 +124,7 @@ class SelectLabel : public QLabel m_tooltipShowing = true; - QString tip = i18n("%1: %2") + TQString tip = i18n("%1: %2") .arg( m_action->text().remove( '&' ) ) .arg( m_action->currentText().remove( '&' ) ); @@ -134,7 +134,7 @@ class SelectLabel : public QLabel m_action == Amarok::actionCollection()->action( "random_mode" ) ) //hack? { KSelectAction *a = static_cast( Amarok::actionCollection()->action( "favor_tracks" ) ); - tip += QString("

        ") + i18n("%1: %2") + tip += TQString("

        ") + i18n("%1: %2") .arg( a->text().remove( '&' ), a->currentText().remove( '&' ) ); } @@ -145,11 +145,11 @@ class SelectLabel : public QLabel m_tooltip->setShowCounter( false ); m_tooltip->setMaskEffect( KDE::PopupMessage::Plain ); m_tooltip->setText( tip ); - const QPixmap pix = KGlobal::iconLoader() + const TQPixmap pix = KGlobal::iconLoader() ->loadIconSet( m_action->currentIcon(), KIcon::Toolbar, KIcon::SizeHuge ) - .pixmap( QIconSet::Large, m_action->isEnabled() - ? QIconSet::Normal - : QIconSet::Disabled ); + .pixmap( TQIconSet::Large, m_action->isEnabled() + ? TQIconSet::Normal + : TQIconSet::Disabled ); m_tooltip->setImage( pix ); m_tooltip->reposition(); diff --git a/amarok/src/statusbar/squeezedtextlabel.cpp b/amarok/src/statusbar/squeezedtextlabel.cpp index d063e4a7..fda6cbf5 100644 --- a/amarok/src/statusbar/squeezedtextlabel.cpp +++ b/amarok/src/statusbar/squeezedtextlabel.cpp @@ -19,54 +19,54 @@ ***************************************************************************/ #include "squeezedtextlabel.h" -#include -#include //QCOORD_MAX -#include +#include +#include //QCOORD_MAX +#include #include namespace KDE { -SqueezedTextLabel::SqueezedTextLabel( const QString &text , QWidget *parent, const char *name ) - : QLabel ( parent, name ) { - setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed )); +SqueezedTextLabel::SqueezedTextLabel( const TQString &text , TQWidget *parent, const char *name ) + : TQLabel ( parent, name ) { + setSizePolicy(TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed )); fullText = text; squeezeTextToLabel(); } -SqueezedTextLabel::SqueezedTextLabel( QWidget *parent, const char *name ) - : QLabel ( parent, name ) { - setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed )); +SqueezedTextLabel::SqueezedTextLabel( TQWidget *parent, const char *name ) + : TQLabel ( parent, name ) { + setSizePolicy(TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed )); } -void SqueezedTextLabel::resizeEvent( QResizeEvent * ) { +void SqueezedTextLabel::resizeEvent( TQResizeEvent * ) { squeezeTextToLabel(); } -QSize SqueezedTextLabel::minimumSizeHint() const +TQSize SqueezedTextLabel::minimumSizeHint() const { - QSize sh = QLabel::minimumSizeHint(); + TQSize sh = TQLabel::minimumSizeHint(); sh.setWidth(-1); return sh; } -QSize SqueezedTextLabel::sizeHint() const +TQSize SqueezedTextLabel::sizeHint() const { - return QSize(contentsRect().width(), QLabel::sizeHint().height()); + return TQSize(contentsRect().width(), TQLabel::sizeHint().height()); } -void SqueezedTextLabel::setText( const QString &text ) { +void SqueezedTextLabel::setText( const TQString &text ) { fullText = text; squeezeTextToLabel(); } -//QSimpleRichText suck +//TQSimpleRichText suck //in more detail, we only want the widthUsed(), which doesn't normally work, see below class MySimpleRichText: public QSimpleRichText { public: - MySimpleRichText( const QString &text, const QFont &font ) - : QSimpleRichText( text, font ) + MySimpleRichText( const TQString &text, const TQFont &font ) + : TQSimpleRichText( text, font ) { setWidth( QCOORD_MAX ); //by default it's like 150-something, always. wtf? } @@ -76,7 +76,7 @@ void SqueezedTextLabel::squeezeTextToLabel() { if( MySimpleRichText( fullText, font() ).widthUsed() > width() ) { - QString text; + TQString text; const int w = width() - fontMetrics().width( "..." ); if( w < 0 ) { @@ -115,23 +115,23 @@ void SqueezedTextLabel::squeezeTextToLabel() } while( MySimpleRichText( text, font() ).widthUsed() > w && !text.isEmpty() ); text += "..."; } - QLabel::setText( text ); - QToolTip::remove( this ); - QToolTip::add( this, fullText ); + TQLabel::setText( text ); + TQToolTip::remove( this ); + TQToolTip::add( this, fullText ); } else { - QLabel::setText( fullText ); - QToolTip::remove( this ); - QToolTip::hide(); + TQLabel::setText( fullText ); + TQToolTip::remove( this ); + TQToolTip::hide(); } } void SqueezedTextLabel::setAlignment( int alignment ) { // save fullText and restore it - QString tmpFull(fullText); - QLabel::setAlignment(alignment); + TQString tmpFull(fullText); + TQLabel::setAlignment(alignment); fullText = tmpFull; } diff --git a/amarok/src/statusbar/squeezedtextlabel.h b/amarok/src/statusbar/squeezedtextlabel.h index a8686912..f1826638 100644 --- a/amarok/src/statusbar/squeezedtextlabel.h +++ b/amarok/src/statusbar/squeezedtextlabel.h @@ -21,30 +21,30 @@ #ifndef SQUEEZEDTEXTLABEL_H #define SQUEEZEDTEXTLABEL_H -#include +#include namespace KDE { //KSqueezedTextLabel, except it works with rich text and puts the ellipsis on the right, as it looks nicer //that way in our case. -class SqueezedTextLabel : public QLabel { +class SqueezedTextLabel : public TQLabel { Q_OBJECT public: - SqueezedTextLabel( QWidget *parent, const char *name = 0 ); - SqueezedTextLabel( const QString &text, QWidget *parent, const char *name = 0 ); + SqueezedTextLabel( TQWidget *parent, const char *name = 0 ); + SqueezedTextLabel( const TQString &text, TQWidget *parent, const char *name = 0 ); - virtual QSize minimumSizeHint() const; - virtual QSize sizeHint() const; + virtual TQSize minimumSizeHint() const; + virtual TQSize sizeHint() const; virtual void setAlignment( int ); public slots: - void setText( const QString & ); + void setText( const TQString & ); protected: - void resizeEvent( QResizeEvent * ); + void resizeEvent( TQResizeEvent * ); void squeezeTextToLabel(); - QString fullText; + TQString fullText; }; diff --git a/amarok/src/statusbar/statusBarBase.cpp b/amarok/src/statusbar/statusBarBase.cpp index 4768ffb8..78c8bd4a 100644 --- a/amarok/src/statusbar/statusBarBase.cpp +++ b/amarok/src/statusbar/statusBarBase.cpp @@ -32,22 +32,22 @@ #include #include -#include -#include //writeLogFile() -#include //writeLogFile() -#include -#include -#include -#include -#include //polish() -#include -#include -#include -#include //class CloseButton -#include -#include -#include //QToolTip::palette() -#include +#include +#include //writeLogFile() +#include //writeLogFile() +#include +#include +#include +#include +#include //polish() +#include +#include +#include +#include //class CloseButton +#include +#include +#include //TQToolTip::palette() +#include //segregated classes #include "popupMessage.h" @@ -59,22 +59,22 @@ namespace KDE { namespace SingleShotPool { - static void startTimer( int timeout, QObject *receiver, const char *slot ) + static void startTimer( int timeout, TQObject *receiver, const char *slot ) { - QTimer *timer = static_cast( receiver->child( slot ) ); + TQTimer *timer = static_cast( receiver->child( slot ) ); if( !timer ) { - timer = new QTimer( receiver, slot ); - receiver->connect( timer, SIGNAL(timeout()), slot ); + timer = new TQTimer( receiver, slot ); + receiver->connect( timer, TQT_SIGNAL(timeout()), slot ); } timer->start( timeout, true ); } - static inline bool isActive( QObject *parent, const char *slot ) + static inline bool isActive( TQObject *parent, const char *slot ) { - QTimer *timer = static_cast( parent->child( slot ) ); + TQTimer *timer = static_cast( parent->child( slot ) ); - return timer && timer->isA( "QTimer" ) && timer->isActive(); + return timer && timer->isA( "TQTimer" ) && timer->isActive(); } } @@ -82,24 +82,24 @@ namespace SingleShotPool //TODO allow for uncertain progress periods -StatusBar::StatusBar( QWidget *parent, const char *name ) - : QWidget( parent, name ) +StatusBar::StatusBar( TQWidget *parent, const char *name ) + : TQWidget( parent, name ) , m_logCounter( -1 ) { - QBoxLayout *mainlayout = new QHBoxLayout( this, 2, /*spacing*/5 ); + TQBoxLayout *mainlayout = new TQHBoxLayout( this, 2, /*spacing*/5 ); //we need extra spacing due to the way we paint the surrounding boxes - QBoxLayout *layout = new QHBoxLayout( mainlayout, /*spacing*/5 ); + TQBoxLayout *layout = new TQHBoxLayout( mainlayout, /*spacing*/5 ); - QHBox *statusBarTextBox = new QHBox( this, "statusBarTextBox" ); + TQHBox *statusBarTextBox = new TQHBox( this, "statusBarTextBox" ); m_mainTextLabel = new KDE::SqueezedTextLabel( statusBarTextBox, "mainTextLabel" ); - QToolButton *shortLongButton = new QToolButton( statusBarTextBox, "shortLongButton" ); + TQToolButton *shortLongButton = new TQToolButton( statusBarTextBox, "shortLongButton" ); shortLongButton->hide(); - QHBox *mainProgressBarBox = new QHBox( this, "progressBox" ); - QToolButton *b1 = new QToolButton( mainProgressBarBox, "cancelButton" ); - m_mainProgressBar = new QProgressBar( mainProgressBarBox, "mainProgressBar" ); - QToolButton *b2 = new QToolButton( mainProgressBarBox, "showAllProgressDetails" ); + TQHBox *mainProgressBarBox = new TQHBox( this, "progressBox" ); + TQToolButton *b1 = new TQToolButton( mainProgressBarBox, "cancelButton" ); + m_mainProgressBar = new TQProgressBar( mainProgressBarBox, "mainProgressBar" ); + TQToolButton *b2 = new TQToolButton( mainProgressBarBox, "showAllProgressDetails" ); mainProgressBarBox->setSpacing( 2 ); mainProgressBarBox->hide(); @@ -108,33 +108,33 @@ StatusBar::StatusBar( QWidget *parent, const char *name ) layout->setStretchFactor( statusBarTextBox, 3 ); layout->setStretchFactor( mainProgressBarBox, 1 ); - m_otherWidgetLayout = new QHBoxLayout( mainlayout, /*spacing*/5 ); + m_otherWidgetLayout = new TQHBoxLayout( mainlayout, /*spacing*/5 ); mainlayout->setStretchFactor( layout, 6 ); mainlayout->setStretchFactor( m_otherWidgetLayout, 4 ); shortLongButton->setIconSet( SmallIconSet( "edit_add" ) ); - QToolTip::add( shortLongButton, i18n( "Show details" ) ); - connect( shortLongButton, SIGNAL(clicked()), SLOT(showShortLongDetails()) ); + TQToolTip::add( shortLongButton, i18n( "Show details" ) ); + connect( shortLongButton, TQT_SIGNAL(clicked()), TQT_SLOT(showShortLongDetails()) ); b1->setIconSet( SmallIconSet( "cancel" ) ); b2->setIconSet( SmallIconSet( "2uparrow") ); b2->setToggleButton( true ); - QToolTip::add( b1, i18n( "Abort all background-operations" ) ); - QToolTip::add( b2, i18n( "Show progress detail" ) ); - connect( b1, SIGNAL(clicked()), SLOT(abortAllProgressOperations()) ); - connect( b2, SIGNAL(toggled( bool )), SLOT(toggleProgressWindow( bool )) ); + TQToolTip::add( b1, i18n( "Abort all background-operations" ) ); + TQToolTip::add( b2, i18n( "Show progress detail" ) ); + connect( b1, TQT_SIGNAL(clicked()), TQT_SLOT(abortAllProgressOperations()) ); + connect( b2, TQT_SIGNAL(toggled( bool )), TQT_SLOT(toggleProgressWindow( bool )) ); m_popupProgress = new OverlayWidget( this, mainProgressBarBox, "popupProgress" ); m_popupProgress->setMargin( 1 ); - m_popupProgress->setFrameStyle( QFrame::Panel | QFrame::Raised ); - m_popupProgress->setFrameShape( QFrame::StyledPanel ); - m_popupProgress->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); - (new QGridLayout( m_popupProgress, 1 /*rows*/, 3 /*cols*/, 6, 3 ))->setAutoAdd( true ); + m_popupProgress->setFrameStyle( TQFrame::Panel | TQFrame::Raised ); + m_popupProgress->setFrameShape( TQFrame::StyledPanel ); + m_popupProgress->setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum ); + (new TQGridLayout( m_popupProgress, 1 /*rows*/, 3 /*cols*/, 6, 3 ))->setAutoAdd( true ); } void -StatusBar::addWidget( QWidget *widget ) +StatusBar::addWidget( TQWidget *widget ) { m_otherWidgetLayout->add( widget ); } @@ -145,68 +145,68 @@ StatusBar::addWidget( QWidget *widget ) void StatusBar::polish() { - QWidget::polish(); + TQWidget::polish(); int h = 0; - QObjectList *list = queryList( "QWidget", 0, false, false ); + TQObjectList *list = queryList( "TQWidget", 0, false, false ); - for( QObject * o = list->first(); o; o = list->next() ) { - int _h = static_cast( o ) ->minimumSizeHint().height(); + for( TQObject * o = list->first(); o; o = list->next() ) { + int _h = static_cast( o ) ->minimumSizeHint().height(); if ( _h > h ) h = _h; -// debug() << o->className() << ", " << o->name() << ": " << _h << ": " << static_cast(o)->minimumHeight() << endl; +// debug() << o->className() << ", " << o->name() << ": " << _h << ": " << static_cast(o)->minimumHeight() << endl; - if ( o->inherits( "QLabel" ) ) - static_cast(o)->setIndent( 4 ); + if ( o->inherits( "TQLabel" ) ) + static_cast(o)->setIndent( 4 ); } h -= 4; // it's too big usually - for ( QObject * o = list->first(); o; o = list->next() ) - static_cast(o)->setFixedHeight( h ); + for ( TQObject * o = list->first(); o; o = list->next() ) + static_cast(o)->setFixedHeight( h ); delete list; } void -StatusBar::paintEvent( QPaintEvent* ) +StatusBar::paintEvent( TQPaintEvent* ) { - QObjectList *list = queryList( "QWidget", 0, false, false ); - QPainter p( this ); + TQObjectList *list = queryList( "TQWidget", 0, false, false ); + TQPainter p( this ); - for( QObject * o = list->first(); o; o = list->next() ) { - QWidget *w = static_cast( o ); + for( TQObject * o = list->first(); o; o = list->next() ) { + TQWidget *w = static_cast( o ); if ( !w->isVisible() ) continue; style().drawPrimitive( - QStyle::PE_StatusBarSection, + TQStyle::PE_StatusBarSection, &p, - QRect( w->x() - 1, w->y() - 1, w->width() + 2, w->height() + 2 ), + TQRect( w->x() - 1, w->y() - 1, w->width() + 2, w->height() + 2 ), colorGroup(), - QStyle::Style_Default, - QStyleOption( w ) ); + TQStyle::Style_Default, + TQStyleOption( w ) ); } delete list; } bool -StatusBar::event( QEvent *e ) +StatusBar::event( TQEvent *e ) { - if ( e->type() == QEvent::LayoutHint ) + if ( e->type() == TQEvent::LayoutHint ) update(); - return QWidget::event( e ); + return TQWidget::event( e ); } /// Messaging system void -StatusBar::setMainText( const QString &text ) +StatusBar::setMainText( const TQString &text ) { SHOULD_BE_GUI @@ -217,14 +217,14 @@ StatusBar::setMainText( const QString &text ) } void -StatusBar::shortMessage( const QString &text, bool longShort ) +StatusBar::shortMessage( const TQString &text, bool longShort ) { SHOULD_BE_GUI m_mainTextLabel->setText( text ); - m_mainTextLabel->setPalette( QToolTip::palette() ); + m_mainTextLabel->setPalette( TQToolTip::palette() ); - SingleShotPool::startTimer( longShort ? 8000 : 5000, this, SLOT(resetMainText()) ); + SingleShotPool::startTimer( longShort ? 8000 : 5000, 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, SLOT(resetMainText()) ) ) + if( SingleShotPool::isActive( this, TQT_SLOT(resetMainText()) ) ) return; m_mainTextLabel->unsetPalette(); @@ -262,7 +262,7 @@ StatusBar::resetMainText() } void -StatusBar::shortLongMessage( const QString &_short, const QString &_long, int type ) +StatusBar::shortLongMessage( const TQString &_short, const TQString &_long, int type ) { SHOULD_BE_GUI @@ -279,7 +279,7 @@ StatusBar::shortLongMessage( const QString &_short, const QString &_long, int ty } void -StatusBar::longMessage( const QString &text, int type ) +StatusBar::longMessage( const TQString &text, int type ) { SHOULD_BE_GUI @@ -288,10 +288,10 @@ StatusBar::longMessage( const QString &text, int type ) PopupMessage *message; message = new PopupMessage( this, m_mainTextLabel ); - connect( message, SIGNAL(destroyed(QObject *)), this, SLOT(popupDeleted(QObject *)) ); + connect( message, TQT_SIGNAL(destroyed(TQObject *)), this, TQT_SLOT(popupDeleted(TQObject *)) ); message->setText( text ); - QString image; + TQString image; switch( type ) { @@ -328,24 +328,24 @@ StatusBar::longMessage( const QString &text, int type ) } void -StatusBar::popupDeleted( QObject *obj ) +StatusBar::popupDeleted( TQObject *obj ) { - m_messageQueue.remove( static_cast( obj ) ); + m_messageQueue.remove( static_cast( obj ) ); } void -StatusBar::longMessageThreadSafe( const QString &text, int /*type*/ ) +StatusBar::longMessageThreadSafe( const TQString &text, int /*type*/ ) { - QCustomEvent * e = new QCustomEvent( 1000 ); - e->setData( new QString( text ) ); - QApplication::postEvent( this, e ); + TQCustomEvent * e = new TQCustomEvent( 1000 ); + e->setData( new TQString( text ) ); + TQApplication::postEvent( this, e ); } void -StatusBar::customEvent( QCustomEvent *e ) +StatusBar::customEvent( TQCustomEvent *e ) { if(e->type() == 1000 ){ - QString *s = static_cast( e->data() ); + TQString *s = static_cast( e->data() ); longMessage( *s ); delete s; }else if(e->type() == 2000 ){ @@ -367,7 +367,7 @@ StatusBar::allDone() } ProgressBar& -StatusBar::newProgressOperation( QObject *owner ) +StatusBar::newProgressOperation( TQObject *owner ) { SHOULD_BE_GUI @@ -380,16 +380,16 @@ StatusBar::newProgressOperation( QObject *owner ) pruneProgressBars(); else toggleProgressWindowButton()->show(); - QLabel *label = new QLabel( m_popupProgress ); + TQLabel *label = new TQLabel( m_popupProgress ); m_progressMap.insert( owner, new ProgressBar( m_popupProgress, label ) ); m_popupProgress->reposition(); - connect( owner, SIGNAL(destroyed( QObject* )), SLOT(endProgressOperation( QObject* )) ); + connect( owner, TQT_SIGNAL(destroyed( TQObject* )), TQT_SLOT(endProgressOperation( TQObject* )) ); // so we can show the correct progress information // after the ProgressBar is setup - SingleShotPool::startTimer( 0, this, SLOT(updateProgressAppearance()) ); + SingleShotPool::startTimer( 0, this, TQT_SLOT(updateProgressAppearance()) ); progressBox()->show(); cancelButton()->setEnabled( true ); @@ -402,14 +402,14 @@ StatusBar::newProgressOperation( KIO::Job *job ) { SHOULD_BE_GUI - ProgressBar & bar = newProgressOperation( static_cast( job ) ); + ProgressBar & bar = newProgressOperation( static_cast( job ) ); bar.setTotalSteps( 100 ); if(!allDone()) toggleProgressWindowButton()->show(); - connect( job, SIGNAL(result( KIO::Job* )), SLOT(endProgressOperation()) ); - //TODO connect( job, SIGNAL(infoMessage( KIO::Job *job, const QString& )), SLOT() ); - connect( job, SIGNAL(percent( KIO::Job*, unsigned long )), SLOT(setProgress( KIO::Job*, unsigned long )) ); + connect( job, TQT_SIGNAL(result( KIO::Job* )), TQT_SLOT(endProgressOperation()) ); + //TODO connect( job, TQT_SIGNAL(infoMessage( KIO::Job *job, const TQString& )), TQT_SLOT() ); + connect( job, TQT_SIGNAL(percent( KIO::Job*, unsigned long )), TQT_SLOT(setProgress( KIO::Job*, unsigned long )) ); return bar; } @@ -417,20 +417,20 @@ StatusBar::newProgressOperation( KIO::Job *job ) void StatusBar::endProgressOperation() { - QObject *owner = const_cast( sender() ); //HACK deconsting it + TQObject *owner = const_cast( sender() ); //HACK deconsting it KIO::Job *job = dynamic_cast( 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( QString::null, job->errorString(), Error ); + shortLongMessage( TQString::null, job->errorString(), Error ); endProgressOperation( owner ); } void -StatusBar::endProgressOperation( QObject *owner ) +StatusBar::endProgressOperation( TQObject *owner ) { //the owner of this progress operation has been deleted //we need to stop listening for progress from it @@ -439,7 +439,7 @@ StatusBar::endProgressOperation( QObject *owner ) if ( !m_progressMap.contains( owner ) ) { - SingleShotPool::startTimer( 2000, this, SLOT(hideMainProgressBar()) ); + SingleShotPool::startTimer( 2000, this, TQT_SLOT(hideMainProgressBar()) ); return ; } @@ -447,7 +447,7 @@ StatusBar::endProgressOperation( QObject *owner ) if( allDone() && !m_popupProgress->isShown() ) { cancelButton()->setEnabled( false ); - SingleShotPool::startTimer( 2000, this, SLOT(hideMainProgressBar()) ); + SingleShotPool::startTimer( 2000, this, TQT_SLOT(hideMainProgressBar()) ); } updateTotalProgress(); @@ -471,7 +471,7 @@ StatusBar::toggleProgressWindow( bool show ) //slot m_popupProgress->setShown( show ); if( !show ) - SingleShotPool::startTimer( 2000, this, SLOT(hideMainProgressBar()) ); + SingleShotPool::startTimer( 2000, this, TQT_SLOT(hideMainProgressBar()) ); } void @@ -481,7 +481,7 @@ StatusBar::showShortLongDetails() longMessage( m_shortLongText, m_shortLongType ); m_shortLongType = Information; - m_shortLongText = QString::null; + m_shortLongText = TQString::null; shortLongButton()->hide(); } @@ -515,11 +515,11 @@ StatusBar::setProgress( int steps ) void StatusBar::setProgress( KIO::Job *job, unsigned long percent ) { - setProgress( static_cast( job ), percent ); + setProgress( static_cast( job ), percent ); } void -StatusBar::setProgress( const QObject *owner, int steps ) +StatusBar::setProgress( const TQObject *owner, int steps ) { if ( !m_progressMap.contains( owner ) ) return ; @@ -530,7 +530,7 @@ StatusBar::setProgress( const QObject *owner, int steps ) } void -StatusBar::incrementProgressTotalSteps( const QObject *owner, int inc ) +StatusBar::incrementProgressTotalSteps( const TQObject *owner, int inc ) { if ( !m_progressMap.contains( owner ) ) return ; @@ -541,7 +541,7 @@ StatusBar::incrementProgressTotalSteps( const QObject *owner, int inc ) } void -StatusBar::setProgressStatus( const QObject *owner, const QString &text ) +StatusBar::setProgressStatus( const TQObject *owner, const TQString &text ) { if ( !m_progressMap.contains( owner ) ) return ; @@ -555,7 +555,7 @@ void StatusBar::incrementProgress() } void -StatusBar::incrementProgress( const QObject *owner ) +StatusBar::incrementProgress( const TQObject *owner ) { if ( !m_progressMap.contains( owner ) ) return; @@ -627,24 +627,24 @@ StatusBar::pruneProgressBars() /// Method which writes to a rotating log file. void -StatusBar::writeLogFile( const QString &text ) +StatusBar::writeLogFile( const TQString &text ) { if( text.isEmpty() ) return; const int counter = 4; // number of logs to keep const uint maxSize = 30000; // approximately 1000 lines per log file int c = counter; - QString logBase = Amarok::saveLocation() + "statusbar.log."; - QFile file; + TQString logBase = Amarok::saveLocation() + "statusbar.log."; + TQFile file; if( m_logCounter < 0 ) //find which log to write to { for( ; c > 0; c-- ) { - QString log = logBase + QString::number(c); + TQString log = logBase + TQString::number(c); file.setName( log ); - if( QFile::exists( log ) && file.size() <= maxSize ) + if( TQFile::exists( log ) && file.size() <= maxSize ) break; } if( c == 0 ) file.setName( logBase + '0' ); @@ -652,7 +652,7 @@ StatusBar::writeLogFile( const QString &text ) } else { - file.setName( logBase + QString::number(m_logCounter) ); + file.setName( logBase + TQString::number(m_logCounter) ); } if( file.size() > maxSize ) @@ -660,16 +660,16 @@ StatusBar::writeLogFile( const QString &text ) m_logCounter++; m_logCounter = m_logCounter % counter; - file.setName( logBase + QString::number(m_logCounter) ); + file.setName( logBase + TQString::number(m_logCounter) ); // if we have overflown the log, then we want to overwrite the previous content if( !file.open( IO_WriteOnly ) ) return; } else if( !file.open( IO_WriteOnly|IO_Append ) ) return; - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); - stream << "[" << KGlobal::locale()->formatDateTime( QDateTime::currentDateTime() ) << "] " << text << endl; + stream << "[" << KGlobal::locale()->formatDateTime( TQDateTime::currentDateTime() ) << "] " << text << endl; } } //namespace KDE diff --git a/amarok/src/statusbar/statusBarBase.h b/amarok/src/statusbar/statusBarBase.h index 04429167..cc03b7b2 100644 --- a/amarok/src/statusbar/statusBarBase.h +++ b/amarok/src/statusbar/statusBarBase.h @@ -22,12 +22,12 @@ #include "progressBar.h" //convenience #include "amarok_export.h" -#include //baseclass -#include //stack allocated -#include //stack allocated +#include //baseclass +#include //stack allocated +#include //stack allocated -class QLabel; -class QTimer; +class TQLabel; +class TQTimer; namespace KIO { class Job; } @@ -37,30 +37,30 @@ namespace KIO { class Job; } namespace KDE { class OverlayWidget; - typedef QMap ProgressMap; + typedef TQMap ProgressMap; /** * @class KDE::StatusBar * @short advanced statusBar * @author Max Howell * - * Like a normal QStatusBar, but add widgets directly: + * Like a normal TQStatusBar, but add widgets directly: * - * new QLabel( text, statusbar ); + * new TQLabel( text, statusbar ); * * The statusbar has some handy progress monitoring behaviour, use like so: * * statusbar->newProgressOperation( myObject ) * .setDescription( i18n("MyProgressOperation") ) * .setStatus( i18n("Stage1") ) - * .setAbortSlot( myObject, SLOT(abort()) ) + * .setAbortSlot( myObject, TQT_SLOT(abort()) ) * .setTotalSteps( 100 ); * * The newProgressOperation function returns a KDE::ProgressBar, which is - * a QProgressBar with some additional functions that return ProgressBar&, + * a TQProgressBar with some additional functions that return ProgressBar&, * so you can chain the mutators like above. @see KDE::ProgressBar * - * After this point you can use setProgress( QObject*, int steps ) to update + * After this point you can use setProgress( TQObject*, int steps ) to update * the progress for this progress operation. Only one progress operation per * QObject! * @@ -81,7 +81,7 @@ namespace KDE Q_OBJECT public: - StatusBar( QWidget *parent, const char *name = "mainStatusBar" ); + StatusBar( TQWidget *parent, const char *name = "mainStatusBar" ); enum MessageType { Information, Question, Sorry, Warning, Error, ShowAgainCheckBox, None }; @@ -90,27 +90,27 @@ namespace KDE * undefined - the application will probably crash. * @param owner controls progress for this operation * @return the progressBar so you can configure its parameters - * @see setProgress( QObject*, int ) - * @see incrementProgress( QObject* ) - * @see setProgressStatus( const QObject*, const QString& ) + * @see setProgress( TQObject*, int ) + * @see incrementProgress( TQObject* ) + * @see setProgressStatus( const TQObject*, const TQString& ) */ - ProgressBar &newProgressOperation( QObject *owner ); + ProgressBar &newProgressOperation( TQObject *owner ); /** * Monitor progress for a KIO::Job, very handy. */ ProgressBar &newProgressOperation( KIO::Job* ); - void incrementProgressTotalSteps( const QObject *owner, int inc = 1 ); - void incrementProgress( const QObject *owner ); - void setProgressStatus( const QObject *owner, const QString &text ); + void incrementProgressTotalSteps( const TQObject *owner, int inc = 1 ); + void incrementProgress( const TQObject *owner ); + void setProgressStatus( const TQObject *owner, const TQString &text ); public slots: /** * The statusbar has a region where you can display a mainMessage. * It persists after all other message-types are displayed */ - void setMainText( const QString &text ); + void setMainText( const TQString &text ); /// resets mainText if you've done a shortMessage void resetMainText(); @@ -121,45 +121,45 @@ namespace KDE * Generally you should use these, as it is very easy for a user to not notice * statusBar messages. */ - void longMessage( const QString &text, int type = Information ) LIBAMAROK_EXPORT ; + void longMessage( const TQString &text, int type = Information ) LIBAMAROK_EXPORT ; - void longMessageThreadSafe( const QString &text, int type = Information ); + void longMessageThreadSafe( const TQString &text, int type = Information ); /** * Shows a short message, with a button that can be pushed to show a long * message */ - void shortLongMessage( const QString &_short, const QString &_long, int type = Information ); + void shortLongMessage( const TQString &_short, const TQString &_long, int type = Information ); /** * Set a temporary message over the mainText label, for 5 seconds. * ONLY USE FOR STATUS MESSAGES! ie "Buffering...", "Connecting to source..." */ - void shortMessage( const QString &text, bool longShort = false ); + void shortMessage( const TQString &text, bool longShort = false ); /** Stop anticipating progress from sender() */ void endProgressOperation(); /** Stop anticipating progress from @param owner */ - void endProgressOperation( QObject *owner ); + void endProgressOperation( TQObject *owner ); /** - * Convenience function works like setProgress( QObject*, int ) + * Convenience function works like setProgress( TQObject*, int ) * Uses the return value from sender() to determine the owner of * the progress bar in question */ void setProgress( int steps ); - void setProgress( const QObject *owner, int steps ); + void setProgress( const TQObject *owner, int steps ); /** - * Convenience function works like setTotalSteps( QObject*, int ) + * Convenience function works like setTotalSteps( TQObject*, int ) * Uses the return value from sender() to determine the owner of * the progress bar in question */ //void setTotalSteps( int totalSteps ); /** - * Convenience function works like incrementProgress( QObject* ) + * Convenience function works like incrementProgress( TQObject* ) * Uses the return value from sender() to determine the owner of * the progress bar in question */ @@ -176,13 +176,13 @@ namespace KDE void hideMainProgressBar(); void updateProgressAppearance(); void showShortLongDetails(); - void popupDeleted( QObject* ); + void popupDeleted( TQObject* ); protected: virtual void polish(); - virtual void customEvent( QCustomEvent* ); - virtual void paintEvent( QPaintEvent* ); - virtual bool event( QEvent* ); + virtual void customEvent( TQCustomEvent* ); + virtual void paintEvent( TQPaintEvent* ); + virtual bool event( TQEvent* ); /** * You must parent the widget to the statusbar, we won't do that @@ -190,17 +190,17 @@ namespace KDE * Currently you must add widgets before the statusbar gets shown * for the first time, because we are not currently very flexible. */ - void addWidget( QWidget *widget ); + void addWidget( TQWidget *widget ); - QLabel *m_mainTextLabel; + TQLabel *m_mainTextLabel; private: struct Message { Message() : type( KDE::StatusBar::None ), offset( 0 ) {} - Message( const QString &_text, const MessageType _type ) : text( _text ), type( _type ), offset( 0 ) {} + Message( const TQString &_text, const MessageType _type ) : text( _text ), type( _type ), offset( 0 ) {} - QString text; + TQString text; MessageType type; int offset; @@ -209,25 +209,25 @@ namespace KDE void updateTotalProgress(); bool allDone(); ///@return true if all progress operations are complete void pruneProgressBars(); /// deletes old progress bars - void writeLogFile( const QString &text ); + void writeLogFile( const TQString &text ); int m_logCounter; - QWidget *cancelButton() { return static_cast( child( "cancelButton" ) ); } - QWidget *toggleProgressWindowButton() { return static_cast( child( "showAllProgressDetails" ) ); } - QWidget *progressBox() { return static_cast( child( "progressBox" ) ); } - QWidget *shortLongButton() { return static_cast( child( "shortLongButton" ) ); } + TQWidget *cancelButton() { return static_cast( child( "cancelButton" ) ); } + TQWidget *toggleProgressWindowButton() { return static_cast( child( "showAllProgressDetails" ) ); } + TQWidget *progressBox() { return static_cast( child( "progressBox" ) ); } + TQWidget *shortLongButton() { return static_cast( child( "shortLongButton" ) ); } OverlayWidget *m_popupProgress; - QProgressBar *m_mainProgressBar; + TQProgressBar *m_mainProgressBar; ProgressMap m_progressMap; - QValueList m_messageQueue; - QString m_mainText; - QString m_shortLongText; + TQValueList m_messageQueue; + TQString m_mainText; + TQString m_shortLongText; int m_shortLongType; - QLayout *m_otherWidgetLayout; + TQLayout *m_otherWidgetLayout; }; } #endif diff --git a/amarok/src/statusbar/statusbar.cpp b/amarok/src/statusbar/statusbar.cpp index 1a845f55..6020f01f 100644 --- a/amarok/src/statusbar/statusbar.cpp +++ b/amarok/src/statusbar/statusbar.cpp @@ -31,9 +31,9 @@ #include #include -#include -#include -#include +#include +#include +#include // stuff that must be included last //#include "startupTips.h" @@ -55,22 +55,22 @@ KAction *action( const char *name ) { return Amarok::actionCollection()->action( StatusBar* StatusBar::s_instance = 0; -StatusBar::StatusBar( QWidget *parent, const char *name ) +StatusBar::StatusBar( TQWidget *parent, const char *name ) : KDE::StatusBar( parent, name ) , EngineObserver( EngineController::instance() ) , m_timeLength( 9 ) - , m_pauseTimer( new QTimer( this ) ) + , m_pauseTimer( new TQTimer( this ) ) { s_instance = this; //static member // total songs count - m_itemCountLabel = new QLabel( this ); + m_itemCountLabel = new TQLabel( this ); m_itemCountLabel->setAlignment( Qt::AlignCenter ); - m_itemCountLabel->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Fixed ); + m_itemCountLabel->setSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Fixed ); //positionBox - QWidget *positionBox = new QWidget( this, "positionBox" ); - QBoxLayout *box = new QHBoxLayout( positionBox, 1, 3 ); + TQWidget *positionBox = new TQWidget( this, "positionBox" ); + TQBoxLayout *box = new TQHBoxLayout( positionBox, 1, 3 ); m_slider = new Amarok::PrettySlider( Qt::Horizontal, Amarok::PrettySlider::Normal, positionBox ); @@ -84,8 +84,8 @@ StatusBar::StatusBar( QWidget *parent, const char *name ) m_slider->setMinimumWidth( m_timeLabel2->width() ); // TODO Both labels need tooltips (string freeze?) - QWidget *hbox = new QWidget( this ); - QBoxLayout *layout = new QHBoxLayout( hbox, 0, 2 ); + TQWidget *hbox = new TQWidget( this ); + TQBoxLayout *layout = new TQHBoxLayout( hbox, 0, 2 ); layout->addSpacing( 3 ); layout->addWidget( m_queueLabel = new QueueLabel( hbox ) ); layout->addWidget( new SelectLabel( static_cast( Amarok::action( "repeat" ) ), hbox ) ); @@ -109,15 +109,15 @@ StatusBar::StatusBar( QWidget *parent, const char *name ) if( !AmarokConfig::leftTimeDisplayEnabled() ) m_timeLabel->hide(); - connect( m_slider, SIGNAL(sliderReleased( int )), EngineController::instance(), SLOT(seek( int )) ); - connect( m_slider, SIGNAL(valueChanged( int )), SLOT(drawTimeDisplay( int )) ); + connect( m_slider, TQT_SIGNAL(sliderReleased( int )), EngineController::instance(), TQT_SLOT(seek( int )) ); + connect( m_slider, TQT_SIGNAL(valueChanged( int )), TQT_SLOT(drawTimeDisplay( int )) ); // set us up the bomb engineStateChanged( Engine::Empty ); //slotItemCountChanged( 0 ); // for great justice! - connect( m_pauseTimer, SIGNAL(timeout()), SLOT(slotPauseTimer()) ); + connect( m_pauseTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotPauseTimer()) ); slotItemCountChanged( 0, 0, 0, 0, 0, 0 ); @@ -141,7 +141,7 @@ StatusBar::engineStateChanged( Engine::State state, Engine::State /*oldState*/ ) m_slider->newBundle( MetaBundle() ); // Set an empty bundle m_timeLabel->setEnabled( false ); //must be done after the setValue() above, due to a signal connection m_timeLabel2->setEnabled( false ); - setMainText( QString::null ); + setMainText( TQString::null ); break; case Engine::Paused: @@ -164,12 +164,12 @@ StatusBar::engineStateChanged( Engine::State state, Engine::State /*oldState*/ ) void StatusBar::engineNewMetaData( const MetaBundle &bundle, bool /*trackChanged*/ ) { - #define escapeHTML(s) QString(s).replace( "&", "&" ).replace( "<", "<" ).replace( ">", ">" ) - QString title = escapeHTML( bundle.title() ); - QString prettyTitle = escapeHTML( bundle.prettyTitle() ); - QString artist = escapeHTML( bundle.artist() ); - QString album = escapeHTML( bundle.album() ); - QString length = escapeHTML( bundle.prettyLength() ); + #define escapeHTML(s) TQString(s).replace( "&", "&" ).replace( "<", "<" ).replace( ">", ">" ) + TQString title = escapeHTML( bundle.title() ); + TQString prettyTitle = escapeHTML( bundle.prettyTitle() ); + TQString artist = escapeHTML( bundle.artist() ); + TQString album = escapeHTML( bundle.album() ); + TQString length = escapeHTML( bundle.prettyLength() ); #undef escapeHTML if ( bundle.artist() == "Mike Oldfield" && bundle.title() == "Amarok" ) { @@ -219,7 +219,7 @@ StatusBar::slotItemCountChanged( int newCount, int newLength, //total { const bool hasSel = ( selCount > 1 ), hasVis = ( visCount != newCount ); - QString text = ( hasSel && hasVis ) ? i18n( "%1 selected of %2 visible tracks" ) + TQString text = ( hasSel && hasVis ) ? i18n( "%1 selected of %2 visible tracks" ) .arg( selCount ).arg( visCount ) : ( hasVis && newCount == 1 ) ? i18n( "0 visible of 1 track" ) : ( hasVis ) ? i18n( "%1 visible of %2 tracks" ).arg( visCount).arg( newCount ) @@ -242,7 +242,7 @@ StatusBar::slotItemCountChanged( int newCount, int newLength, //total else m_itemCountLabel->setText( text ); - QToolTip::add( m_itemCountLabel, i18n( "Play-time: %1" ).arg( MetaBundle::veryPrettyTime( getValue ) ) ); + TQToolTip::add( m_itemCountLabel, i18n( "Play-time: %1" ).arg( MetaBundle::veryPrettyTime( getValue ) ) ); } void @@ -295,8 +295,8 @@ StatusBar::drawTimeDisplay( int ms ) //SLOT seconds2 = 0; } - QString s1 = MetaBundle::prettyTime( seconds ); - QString s2 = MetaBundle::prettyTime( seconds2 ); + TQString s1 = MetaBundle::prettyTime( seconds ); + TQString s2 = MetaBundle::prettyTime( seconds2 ); // when the left label shows the remaining time and it's not a stream if( AmarokConfig::leftTimeDisplayRemaining() && trackLength > 0 ) { @@ -367,7 +367,7 @@ MessageQueue::instance() } void -MessageQueue::addMessage(const QString& message) +MessageQueue::addMessage(const TQString& message) { if(m_queueMessages) m_messages.push(message); diff --git a/amarok/src/statusbar/statusbar.h b/amarok/src/statusbar/statusbar.h index 97fe7f36..06d4711e 100644 --- a/amarok/src/statusbar/statusbar.h +++ b/amarok/src/statusbar/statusbar.h @@ -24,9 +24,9 @@ #include "statusBarBase.h" //baseclass #include "queueLabel.h" -#include +#include -class QTimer; +class TQTimer; namespace Amarok { @@ -40,7 +40,7 @@ namespace Amarok LIBAMAROK_EXPORT static StatusBar* s_instance; public: - StatusBar( QWidget *parent, const char *name = 0 ); + StatusBar( TQWidget *parent, const char *name = 0 ); static StatusBar* instance() { return s_instance; } @@ -61,13 +61,13 @@ namespace Amarok void slotPauseTimer(); private: - QLabel *m_timeLabel; - QLabel *m_timeLabel2; + TQLabel *m_timeLabel; + TQLabel *m_timeLabel2; int m_timeLength; - QLabel *m_itemCountLabel; + TQLabel *m_itemCountLabel; QueueLabel *m_queueLabel; Amarok::PrettySlider *m_slider; - QTimer *m_pauseTimer; + TQTimer *m_pauseTimer; }; /** * Is used to queue up longMessages for the StatusBar before the StatusBar @@ -77,11 +77,11 @@ namespace Amarok { public: static MessageQueue* instance(); - void addMessage ( const QString & ); + void addMessage ( const TQString & ); void sendMessages(); private: MessageQueue(); - QValueStack m_messages; + TQValueStack m_messages; bool m_queueMessages; }; diff --git a/amarok/src/statusbar/timeLabel.h b/amarok/src/statusbar/timeLabel.h index d24f0c0a..511e1883 100644 --- a/amarok/src/statusbar/timeLabel.h +++ b/amarok/src/statusbar/timeLabel.h @@ -20,18 +20,18 @@ #ifndef AMAROK_TIMELABEL_H #define AMAROK_TIMELABEL_H -#include +#include class TimeLabel : public QLabel { public: - TimeLabel( QWidget *parent ) : QLabel( " 0:00:00 ", parent ) + TimeLabel( TQWidget *parent ) : TQLabel( " 0:00:00 ", parent ) { setFont( KGlobalSettings::fixedFont() ); - setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Fixed ); + setSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Fixed ); } - virtual void mousePressEvent( QMouseEvent * ) + virtual void mousePressEvent( TQMouseEvent * ) { if( AmarokConfig::leftTimeDisplayEnabled() ) { diff --git a/amarok/src/statusbar/toggleLabel.h b/amarok/src/statusbar/toggleLabel.h index 2ae2619f..08447308 100644 --- a/amarok/src/statusbar/toggleLabel.h +++ b/amarok/src/statusbar/toggleLabel.h @@ -30,10 +30,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include class ToggleLabel : public QLabel { @@ -45,16 +45,16 @@ class ToggleLabel : public QLabel void toggled( bool ); public: - ToggleLabel( KToggleAction const*const action, QWidget *parent ) - : QLabel( parent ) + ToggleLabel( KToggleAction const*const action, TQWidget *parent ) + : TQLabel( parent ) , m_action( action ) , m_tooltip( 0 ) , m_tooltipShowing( false ) , m_tooltipHidden( false ) { - connect( this, SIGNAL(toggled( bool )), action, SLOT(setChecked( bool )) ); - connect( action, SIGNAL(toggled( bool )), this, SLOT(setChecked( bool )) ); - connect( action, SIGNAL(enabled( bool )), this, SLOT(setEnabled( bool )) ); + connect( this, TQT_SIGNAL(toggled( bool )), action, TQT_SLOT(setChecked( bool )) ); + connect( action, TQT_SIGNAL(toggled( bool )), this, TQT_SLOT(setChecked( bool )) ); + connect( action, TQT_SIGNAL(enabled( bool )), this, TQT_SLOT(setEnabled( bool )) ); setChecked( isChecked() ); } @@ -63,7 +63,7 @@ class ToggleLabel : public QLabel inline bool isEnabled() const { return m_action->isEnabled(); } protected: - void mousePressEvent( QMouseEvent* ) + void mousePressEvent( TQMouseEvent* ) { hideToolTip(); const bool b = !isChecked(); @@ -74,14 +74,14 @@ class ToggleLabel : public QLabel } } - void enterEvent( QEvent* ) + void enterEvent( TQEvent* ) { //Show the tooltip after 1/2 second m_tooltipHidden = false; - QTimer::singleShot( 500, this, SLOT(aboutToShow()) ); + TQTimer::singleShot( 500, this, TQT_SLOT(aboutToShow()) ); } - void leaveEvent( QEvent* ) + void leaveEvent( TQEvent* ) { hideToolTip(); } @@ -89,7 +89,7 @@ class ToggleLabel : public QLabel public slots: void setChecked( bool on ) { - setPixmap( m_action->iconSet().pixmap( QIconSet::Small, on ? QIconSet::Normal : QIconSet::Disabled ) ); + setPixmap( m_action->iconSet().pixmap( TQIconSet::Small, on ? TQIconSet::Normal : TQIconSet::Disabled ) ); } void setEnabled( bool /*on*/ ) { } @@ -109,13 +109,13 @@ class ToggleLabel : public QLabel m_tooltipShowing = true; - QString tip = m_action->isChecked() ? i18n("%1: on") : i18n("%1: off"); + TQString tip = m_action->isChecked() ? i18n("%1: on") : i18n("%1: off"); if( !isEnabled() ) tip += i18n(" 
         Disabled"); tip += " "; - const QString path = KGlobal::iconLoader()->iconPath( m_action->icon(), -KIcon::SizeHuge ); + const TQString path = KGlobal::iconLoader()->iconPath( m_action->icon(), -KIcon::SizeHuge ); m_tooltip = new KDE::PopupMessage( parentWidget()->parentWidget(), parentWidget(), 0 /*timeout*/ ); diff --git a/amarok/src/systray.cpp b/amarok/src/systray.cpp index 996c39cb..98c591f5 100644 --- a/amarok/src/systray.cpp +++ b/amarok/src/systray.cpp @@ -13,8 +13,8 @@ #include "enginecontroller.h" #include "systray.h" -#include -#include +#include +#include #include #include #include @@ -26,12 +26,12 @@ namespace Amarok static QPixmap loadOverlay( const char *iconName, int iconWidth ) { - return QImage( locate( "data", QString( "amarok/images/b_%1.png" ).arg( iconName ) ), "PNG" ).smoothScale( ((iconWidth/2)-(iconWidth/20)), ((iconWidth/2)-(iconWidth/20)) ); + return TQImage( locate( "data", TQString( "amarok/images/b_%1.png" ).arg( iconName ) ), "PNG" ).smoothScale( ((iconWidth/2)-(iconWidth/20)), ((iconWidth/2)-(iconWidth/20)) ); } } -Amarok::TrayIcon::TrayIcon( QWidget *playerWidget ) +Amarok::TrayIcon::TrayIcon( TQWidget *playerWidget ) : KSystemTray( playerWidget ) , EngineObserver( EngineController::instance() ) , trackLength( 0 ) @@ -53,7 +53,7 @@ Amarok::TrayIcon::TrayIcon( QWidget *playerWidget ) //seems to be necessary KAction *quit = actionCollection()->action( "file_quit" ); quit->disconnect(); - connect( quit, SIGNAL(activated()), kapp, SLOT(quit()) ); + connect( quit, TQT_SIGNAL(activated()), kapp, TQT_SLOT(quit()) ); baseIcon = KSystemTray::loadSizedIcon( "amarok", width() ); playOverlay = Amarok::loadOverlay( "play", width() ); @@ -65,17 +65,17 @@ Amarok::TrayIcon::TrayIcon( QWidget *playerWidget ) } bool -Amarok::TrayIcon::event( QEvent *e ) +Amarok::TrayIcon::event( TQEvent *e ) { switch( e->type() ) { - case QEvent::Drop: - case QEvent::Wheel: - case QEvent::DragEnter: + case TQEvent::Drop: + case TQEvent::Wheel: + case TQEvent::DragEnter: return Amarok::genericEventHandler( this, e ); - case QEvent::Timer: - if( static_cast(e)->timerId() != blinkTimerID ) + case TQEvent::Timer: + if( static_cast(e)->timerId() != blinkTimerID ) return KSystemTray::event( e ); // if we're playing, blink icon @@ -87,8 +87,8 @@ Amarok::TrayIcon::event( QEvent *e ) return true; - case QEvent::MouseButtonPress: - if( static_cast(e)->button() == Qt::MidButton ) + case TQEvent::MouseButtonPress: + if( static_cast(e)->button() == Qt::MidButton ) { EngineController::instance()->playPause(); @@ -102,7 +102,7 @@ Amarok::TrayIcon::event( QEvent *e ) } } -void Amarok::TrayIcon::resizeEvent ( QResizeEvent * ) +void Amarok::TrayIcon::resizeEvent ( TQResizeEvent * ) { // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes baseIcon = KSystemTray::loadSizedIcon( "amarok", width() ); @@ -116,8 +116,8 @@ void Amarok::TrayIcon::resizeEvent ( QResizeEvent * ) } playOverlay = Amarok::loadOverlay( "play", width() ); pauseOverlay = Amarok::loadOverlay( "pause", width() ); - grayedIcon = QPixmap(); - alternateIcon = QPixmap(); + grayedIcon = TQPixmap(); + alternateIcon = TQPixmap(); paintIcon( -1, true ); } @@ -173,7 +173,7 @@ Amarok::TrayIcon::engineTrackPositionChanged( long position, bool /*userSeek*/ ) } void -Amarok::TrayIcon::paletteChange( const QPalette & op ) +Amarok::TrayIcon::paletteChange( const TQPalette & op ) { if ( palette().active().highlight() == op.active().highlight() || alternateIcon.isNull() ) return; @@ -197,7 +197,7 @@ Amarok::TrayIcon::paintIcon( int mergePixels, bool force ) // make up the grayed icon if ( grayedIcon.isNull() ) { - QImage tmpTrayIcon = baseIcon.convertToImage(); + TQImage tmpTrayIcon = baseIcon.convertToImage(); KIconEffect::semiTransparent( tmpTrayIcon ); grayedIcon = tmpTrayIcon; } @@ -205,11 +205,11 @@ Amarok::TrayIcon::paintIcon( int mergePixels, bool force ) // make up the alternate icon (use hilight color but more saturated) if ( alternateIcon.isNull() ) { - QImage tmpTrayIcon = baseIcon.convertToImage(); + TQImage tmpTrayIcon = baseIcon.convertToImage(); // eros: this looks cool with dark red blue or green but sucks with // other colors (such as kde default's pale pink..). maybe the effect // or the blended color has to be changed.. - QColor saturatedColor = palette().active().highlight(); + TQColor saturatedColor = palette().active().highlight(); int hue, sat, value; saturatedColor.getHsv( &hue, &sat, &value ); saturatedColor.setHsv( hue, sat > 200 ? 200 : sat, value < 100 ? 100 : value ); @@ -223,14 +223,14 @@ Amarok::TrayIcon::paintIcon( int mergePixels, bool force ) return blendOverlay( alternateIcon ); // mix [ grayed <-> colored ] icons - QPixmap tmpTrayPixmap = alternateIcon; + TQPixmap tmpTrayPixmap = alternateIcon; copyBlt( &tmpTrayPixmap, 0,0, &grayedIcon, 0,0, alternateIcon.width(), mergePixels>0 ? mergePixels-1 : 0 ); blendOverlay( tmpTrayPixmap ); } void -Amarok::TrayIcon::blendOverlay( QPixmap &sourcePixmap ) +Amarok::TrayIcon::blendOverlay( TQPixmap &sourcePixmap ) { if ( !overlayVisible || !overlay || overlay->isNull() ) return setPixmap( sourcePixmap ); // @since 3.2 @@ -244,7 +244,7 @@ Amarok::TrayIcon::blendOverlay( QPixmap &sourcePixmap ) opY = sourcePixmap.height() - opH; // get the rectangle where blending will take place - QPixmap sourceCropped( opW, opH, sourcePixmap.depth() ); + TQPixmap sourceCropped( opW, opH, sourcePixmap.depth() ); copyBlt( &sourceCropped, 0,0, &sourcePixmap, opX,opY, opW,opH ); //speculative fix for a bactrace we received @@ -253,13 +253,13 @@ Amarok::TrayIcon::blendOverlay( QPixmap &sourcePixmap ) return setPixmap( sourcePixmap ); // blend the overlay image over the cropped rectangle - QImage blendedImage = sourceCropped.convertToImage(); - QImage overlayImage = overlay->convertToImage(); + TQImage blendedImage = sourceCropped.convertToImage(); + TQImage overlayImage = overlay->convertToImage(); KIconEffect::overlay( blendedImage, overlayImage ); sourceCropped.convertFromImage( blendedImage ); // put back the blended rectangle to the original image - QPixmap sourcePixmapCopy = sourcePixmap; + TQPixmap sourcePixmapCopy = sourcePixmap; copyBlt( &sourcePixmapCopy, opX,opY, &sourceCropped, 0,0, opW,opH ); setPixmap( sourcePixmapCopy ); // @since 3.2 diff --git a/amarok/src/systray.h b/amarok/src/systray.h index bd26eb28..fe9380d8 100644 --- a/amarok/src/systray.h +++ b/amarok/src/systray.h @@ -11,7 +11,7 @@ #include "engineobserver.h" //baseclass #include -#include +#include class App; @@ -20,7 +20,7 @@ namespace Amarok { class TrayIcon : public KSystemTray, public EngineObserver { public: - TrayIcon( QWidget* ); + TrayIcon( TQWidget* ); friend class ::App; protected: @@ -29,23 +29,23 @@ protected: virtual void engineNewMetaData( const MetaBundle &bundle, bool trackChanged ); virtual void engineTrackPositionChanged( long position, bool /*userSeek*/ ); // get notified of 'highlight' color change - virtual void paletteChange( const QPalette & oldPalette ); - void resizeEvent ( QResizeEvent * ); + virtual void paletteChange( const TQPalette & oldPalette ); + void resizeEvent ( TQResizeEvent * ); private: - bool event( QEvent* ); + bool event( TQEvent* ); void setLastFm( bool ); // repaints trayIcon showing progress (and overlay if present) void paintIcon( int mergePixels = -1, bool force = false ); // blend an overlay icon over 'sourcePixmap' and repaint trayIcon - void blendOverlay( QPixmap &sourcePixmap ); + void blendOverlay( TQPixmap &sourcePixmap ); long trackLength, mergeLevel; - QPixmap baseIcon, grayedIcon, alternateIcon; - QPixmap playOverlay, pauseOverlay; - QPixmap *overlay; // the current overlay (may be NULL) - int blinkTimerID; // timer ID returned by QObject::startTimer() + TQPixmap baseIcon, grayedIcon, alternateIcon; + TQPixmap playOverlay, pauseOverlay; + TQPixmap *overlay; // the current overlay (may be NULL) + int blinkTimerID; // timer ID returned by TQObject::startTimer() bool overlayVisible;// used for blinking / hiding overlay /** whether the last.fm icons are visible **/ bool m_lastFmMode; diff --git a/amarok/src/tagdialog.cpp b/amarok/src/tagdialog.cpp index 5974df88..b3bf5294 100644 --- a/amarok/src/tagdialog.cpp +++ b/amarok/src/tagdialog.cpp @@ -20,16 +20,16 @@ #include //TagLib::File::isWritable -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -49,19 +49,19 @@ class TagDialogWriter : public ThreadManager::Job { public: - TagDialogWriter( const QMap tagsToChange ); + TagDialogWriter( const TQMap tagsToChange ); bool doJob(); void completeJob(); private: - QValueList m_failed; - QValueList m_tags; + TQValueList m_failed; + TQValueList m_tags; bool m_updateView; int m_successCount; int m_failCount; - QStringList m_failedURLs; + TQStringList m_failedURLs; }; -TagDialog::TagDialog( const KURL& url, QWidget* parent ) +TagDialog::TagDialog( const KURL& url, TQWidget* parent ) : TagDialogBase( parent ) , m_bundle( url, true ) , m_playlistItem( 0 ) @@ -71,7 +71,7 @@ TagDialog::TagDialog( const KURL& url, QWidget* parent ) } -TagDialog::TagDialog( const KURL::List list, QWidget* parent ) +TagDialog::TagDialog( const KURL::List list, TQWidget* parent ) : TagDialogBase( parent ) , m_bundle() , m_playlistItem( 0 ) @@ -82,7 +82,7 @@ TagDialog::TagDialog( const KURL::List list, QWidget* parent ) } -TagDialog::TagDialog( const MetaBundle& mb, PlaylistItem* item, QWidget* parent ) +TagDialog::TagDialog( const MetaBundle& mb, PlaylistItem* item, TQWidget* parent ) : TagDialogBase( parent ) , m_bundle( mb ) , m_playlistItem( item ) @@ -111,7 +111,7 @@ TagDialog::setTab( int id ) void TagDialog::cancelPressed() //SLOT { - QApplication::restoreOverrideCursor(); // restore the cursor before closing the dialog + TQApplication::restoreOverrideCursor(); // restore the cursor before closing the dialog reject(); } @@ -122,7 +122,7 @@ TagDialog::accept() //SLOT pushButton_ok->setEnabled( false ); //visual feedback saveTags(); - QDialog::accept(); + TQDialog::accept(); } @@ -236,17 +236,17 @@ TagDialog::checkModified() //SLOT } void -TagDialog::loadCover( const QString &artist, const QString &album ) +TagDialog::loadCover( const TQString &artist, const TQString &album ) { if ( m_bundle.artist() != artist || m_bundle.album()!=album ) return; // draw the album cover on the dialog - QString cover = CollectionDB::instance()->albumImage( m_bundle ); + TQString cover = CollectionDB::instance()->albumImage( m_bundle ); if( m_currentCover != cover ) { - pixmap_cover->setPixmap( QPixmap( cover, "PNG" ) ); + pixmap_cover->setPixmap( TQPixmap( cover, "PNG" ) ); m_currentCover = cover; } pixmap_cover->setInformation( m_bundle.artist(), m_bundle.album() ); @@ -294,17 +294,17 @@ TagDialog::musicbrainzQuery() //SLOT m_mbTrack = m_bundle.url(); KTRMLookup* ktrm = new KTRMLookup( m_mbTrack.path(), true ); - connect( ktrm, SIGNAL( sigResult( KTRMResultList, QString ) ), SLOT( queryDone( KTRMResultList, QString ) ) ); - connect( pushButton_cancel, SIGNAL( clicked() ), ktrm, SLOT( deleteLater() ) ); + connect( ktrm, TQT_SIGNAL( sigResult( KTRMResultList, TQString ) ), TQT_SLOT( queryDone( KTRMResultList, TQString ) ) ); + connect( pushButton_cancel, TQT_SIGNAL( clicked() ), ktrm, TQT_SLOT( deleteLater() ) ); pushButton_musicbrainz->setEnabled( false ); pushButton_musicbrainz->setText( i18n( "Generating audio fingerprint..." ) ); - QApplication::setOverrideCursor( KCursor::workingCursor() ); + TQApplication::setOverrideCursor( KCursor::workingCursor() ); #endif } void -TagDialog::queryDone( KTRMResultList results, QString error ) //SLOT +TagDialog::queryDone( KTRMResultList results, TQString error ) //SLOT { #if HAVE_TUNEPIMP @@ -316,7 +316,7 @@ TagDialog::queryDone( KTRMResultList results, QString error ) //SLOT { TrackPickerDialog* t = new TrackPickerDialog( m_mbTrack.filename(), results, this ); t->show(); - connect( t, SIGNAL( finished() ), SLOT( resetMusicbrainz() ) ); // clear m_mbTrack + connect( t, TQT_SIGNAL( finished() ), TQT_SLOT( resetMusicbrainz() ) ); // clear m_mbTrack } else { KMessageBox::sorry( this, i18n( "The track was not found in the MusicBrainz database." ) ); @@ -324,7 +324,7 @@ TagDialog::queryDone( KTRMResultList results, QString error ) //SLOT } } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); pushButton_musicbrainz->setEnabled( true ); pushButton_musicbrainz->setText( m_buttonMbText ); #else @@ -387,19 +387,19 @@ void TagDialog::init() kTabWidget->addTab( labelsTab, i18n( "Labels" ) ); kTabWidget->setCurrentPage( config->readNumEntry( "CurrentTab", 0 ) ); - const QStringList artists = CollectionDB::instance()->artistList(); + const TQStringList artists = CollectionDB::instance()->artistList(); kComboBox_artist->insertStringList( artists ); kComboBox_artist->completionObject()->insertItems( artists ); kComboBox_artist->completionObject()->setIgnoreCase( true ); kComboBox_artist->setCompletionMode( KGlobalSettings::CompletionPopup ); - const QStringList albums = CollectionDB::instance()->albumList(); + const TQStringList albums = CollectionDB::instance()->albumList(); kComboBox_album->insertStringList( albums ); kComboBox_album->completionObject()->insertItems( albums ); kComboBox_album->completionObject()->setIgnoreCase( true ); kComboBox_album->setCompletionMode( KGlobalSettings::CompletionPopup ); - const QStringList composers = CollectionDB::instance()->composerList(); + const TQStringList composers = CollectionDB::instance()->composerList(); kComboBox_composer->insertStringList( composers ); kComboBox_composer->completionObject()->insertItems( composers ); kComboBox_composer->completionObject()->setIgnoreCase( true ); @@ -407,28 +407,28 @@ void TagDialog::init() kComboBox_rating->insertStringList( MetaBundle::ratingList() ); -// const QStringList genres = MetaBundle::genreList(); - const QStringList genres = CollectionDB::instance()->genreList(); +// const TQStringList genres = MetaBundle::genreList(); + const TQStringList genres = CollectionDB::instance()->genreList(); kComboBox_genre->insertStringList( genres ); kComboBox_genre->completionObject()->insertItems( genres ); kComboBox_genre->completionObject()->setIgnoreCase( true ); - const QStringList labels = CollectionDB::instance()->labelList(); + const TQStringList labels = CollectionDB::instance()->labelList(); //TODO: figure out a way to add auto-completion support to kTestEdit_selectedLabels //m_labelCloud = new KHTMLPart( labels_favouriteLabelsFrame ); m_labelCloud = new HTMLView( labels_favouriteLabelsFrame ); - m_labelCloud->view()->setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Ignored, false ); - m_labelCloud->view()->setVScrollBarMode( QScrollView::AlwaysOff ); - m_labelCloud->view()->setHScrollBarMode( QScrollView::AlwaysOff ); + m_labelCloud->view()->setSizePolicy( TQSizePolicy::Ignored, TQSizePolicy::Ignored, false ); + m_labelCloud->view()->setVScrollBarMode( TQScrollView::AlwaysOff ); + m_labelCloud->view()->setHScrollBarMode( TQScrollView::AlwaysOff ); - new QVBoxLayout( labels_favouriteLabelsFrame ); + new TQVBoxLayout( labels_favouriteLabelsFrame ); labels_favouriteLabelsFrame->layout()->add( m_labelCloud->view() ); - const QStringList favoriteLabels = CollectionDB::instance()->favoriteLabels(); - QString html = generateHTML( favoriteLabels ); + const TQStringList favoriteLabels = CollectionDB::instance()->favoriteLabels(); + TQString html = generateHTML( favoriteLabels ); m_labelCloud->set( html ); - connect( m_labelCloud->browserExtension(), SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ), - this, SLOT( openURLRequest( const KURL & ) ) ); + connect( m_labelCloud->browserExtension(), TQT_SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ), + this, TQT_SLOT( openURLRequest( const KURL & ) ) ); // looks better to have a blank label than 0, we can't do this in // the UI file due to bug in Designer @@ -449,64 +449,64 @@ void TagDialog::init() } //HACK due to deficiency in Qt that will be addressed in version 4 - // QSpinBox doesn't emit valueChanged if you edit the value with + // TQSpinBox doesn't emit valueChanged if you edit the value with // the lineEdit until you change the keyboard focus - connect( kIntSpinBox_year->child( "qt_spinbox_edit" ), SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); - connect( kIntSpinBox_track->child( "qt_spinbox_edit" ), SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); - connect( kIntSpinBox_score->child( "qt_spinbox_edit" ), SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); - connect( kIntSpinBox_discNumber->child( "qt_spinbox_edit" ), SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); + connect( kIntSpinBox_year->child( "qt_spinbox_edit" ), TQT_SIGNAL(textChanged( const TQString& )), TQT_SLOT(checkModified()) ); + connect( kIntSpinBox_track->child( "qt_spinbox_edit" ), TQT_SIGNAL(textChanged( const TQString& )), TQT_SLOT(checkModified()) ); + connect( kIntSpinBox_score->child( "qt_spinbox_edit" ), TQT_SIGNAL(textChanged( const TQString& )), TQT_SLOT(checkModified()) ); + connect( kIntSpinBox_discNumber->child( "qt_spinbox_edit" ), TQT_SIGNAL(textChanged( const TQString& )), TQT_SLOT(checkModified()) ); // Connects for modification check - connect( kLineEdit_title, SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); - connect( kComboBox_composer,SIGNAL(activated( int )), SLOT(checkModified()) ); - connect( kComboBox_composer,SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); - connect( kComboBox_artist, SIGNAL(activated( int )), SLOT(checkModified()) ); - connect( kComboBox_artist, SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); - connect( kComboBox_album, SIGNAL(activated( int )), SLOT(checkModified()) ); - connect( kComboBox_album, SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); - connect( kComboBox_genre, SIGNAL(activated( int )), SLOT(checkModified()) ); - connect( kComboBox_genre, SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); - connect( kComboBox_rating, SIGNAL(activated( int )), SLOT(checkModified()) ); - connect( kComboBox_rating, SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); - connect( kIntSpinBox_track, SIGNAL(valueChanged( int )), SLOT(checkModified()) ); - connect( kIntSpinBox_year, SIGNAL(valueChanged( int )), SLOT(checkModified()) ); - connect( kIntSpinBox_score, SIGNAL(valueChanged( int )), SLOT(checkModified()) ); - connect( kTextEdit_comment, SIGNAL(textChanged()), SLOT(checkModified()) ); - connect( kTextEdit_lyrics, SIGNAL(textChanged()), SLOT(checkModified()) ); - connect( kTextEdit_selectedLabels, SIGNAL(textChanged()), SLOT(checkModified()) ); + connect( kLineEdit_title, TQT_SIGNAL(textChanged( const TQString& )), TQT_SLOT(checkModified()) ); + connect( kComboBox_composer,TQT_SIGNAL(activated( int )), TQT_SLOT(checkModified()) ); + connect( kComboBox_composer,TQT_SIGNAL(textChanged( const TQString& )), TQT_SLOT(checkModified()) ); + connect( kComboBox_artist, TQT_SIGNAL(activated( int )), TQT_SLOT(checkModified()) ); + connect( kComboBox_artist, TQT_SIGNAL(textChanged( const TQString& )), TQT_SLOT(checkModified()) ); + connect( kComboBox_album, TQT_SIGNAL(activated( int )), TQT_SLOT(checkModified()) ); + connect( kComboBox_album, TQT_SIGNAL(textChanged( const TQString& )), TQT_SLOT(checkModified()) ); + connect( kComboBox_genre, TQT_SIGNAL(activated( int )), TQT_SLOT(checkModified()) ); + connect( kComboBox_genre, TQT_SIGNAL(textChanged( const TQString& )), TQT_SLOT(checkModified()) ); + connect( kComboBox_rating, TQT_SIGNAL(activated( int )), TQT_SLOT(checkModified()) ); + connect( kComboBox_rating, TQT_SIGNAL(textChanged( const TQString& )), TQT_SLOT(checkModified()) ); + connect( kIntSpinBox_track, TQT_SIGNAL(valueChanged( int )), TQT_SLOT(checkModified()) ); + connect( kIntSpinBox_year, TQT_SIGNAL(valueChanged( int )), TQT_SLOT(checkModified()) ); + connect( kIntSpinBox_score, TQT_SIGNAL(valueChanged( int )), TQT_SLOT(checkModified()) ); + connect( kTextEdit_comment, TQT_SIGNAL(textChanged()), TQT_SLOT(checkModified()) ); + connect( kTextEdit_lyrics, TQT_SIGNAL(textChanged()), TQT_SLOT(checkModified()) ); + connect( kTextEdit_selectedLabels, TQT_SIGNAL(textChanged()), TQT_SLOT(checkModified()) ); // Remember original button text m_buttonMbText = pushButton_musicbrainz->text(); - connect( pushButton_cancel, SIGNAL(clicked()), SLOT(cancelPressed()) ); - connect( pushButton_ok, SIGNAL(clicked()), SLOT(accept()) ); - connect( pushButton_open, SIGNAL(clicked()), SLOT(openPressed()) ); - connect( pushButton_previous, SIGNAL(clicked()), SLOT(previousTrack()) ); - connect( pushButton_next, SIGNAL(clicked()), SLOT(nextTrack()) ); - connect( checkBox_perTrack, SIGNAL(clicked()), SLOT(perTrack()) ); + connect( pushButton_cancel, TQT_SIGNAL(clicked()), TQT_SLOT(cancelPressed()) ); + connect( pushButton_ok, TQT_SIGNAL(clicked()), TQT_SLOT(accept()) ); + connect( pushButton_open, TQT_SIGNAL(clicked()), TQT_SLOT(openPressed()) ); + connect( pushButton_previous, TQT_SIGNAL(clicked()), TQT_SLOT(previousTrack()) ); + connect( pushButton_next, TQT_SIGNAL(clicked()), TQT_SLOT(nextTrack()) ); + connect( checkBox_perTrack, TQT_SIGNAL(clicked()), TQT_SLOT(perTrack()) ); // set an icon for the open-in-konqui button pushButton_open->setIconSet( SmallIconSet( Amarok::icon( "files" ) ) ); //Update lyrics on Context Browser - connect( this, SIGNAL(lyricsChanged( const QString& )), ContextBrowser::instance(), SLOT( lyricsChanged( const QString& ) ) ); + connect( this, TQT_SIGNAL(lyricsChanged( const TQString& )), ContextBrowser::instance(), TQT_SLOT( lyricsChanged( const TQString& ) ) ); //Update cover - connect( CollectionDB::instance(), SIGNAL( coverFetched( const QString&, const QString& ) ), - this, SLOT( loadCover( const QString&, const QString& ) ) ); - connect( CollectionDB::instance(), SIGNAL( coverChanged( const QString&, const QString& ) ), - this, SLOT( loadCover( const QString&, const QString& ) ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( coverFetched( const TQString&, const TQString& ) ), + this, TQT_SLOT( loadCover( const TQString&, const TQString& ) ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( coverChanged( const TQString&, const TQString& ) ), + this, TQT_SLOT( loadCover( const TQString&, const TQString& ) ) ); #if HAVE_TUNEPIMP - connect( pushButton_musicbrainz, SIGNAL(clicked()), SLOT(musicbrainzQuery()) ); + connect( pushButton_musicbrainz, TQT_SIGNAL(clicked()), TQT_SLOT(musicbrainzQuery()) ); #else - QToolTip::add( pushButton_musicbrainz, i18n("Please install MusicBrainz to enable this functionality") ); + TQToolTip::add( pushButton_musicbrainz, i18n("Please install MusicBrainz to enable this functionality") ); #endif - connect( pushButton_guessTags, SIGNAL(clicked()), SLOT( guessFromFilename() ) ); - connect( pushButton_setFilenameSchemes, SIGNAL(clicked()), SLOT( setFileNameSchemes() ) ); + connect( pushButton_guessTags, TQT_SIGNAL(clicked()), TQT_SLOT( guessFromFilename() ) ); + connect( pushButton_setFilenameSchemes, TQT_SIGNAL(clicked()), TQT_SLOT( setFileNameSchemes() ) ); if( m_urlList.count() ) { //editing multiple tracks m_perTrack = false; @@ -555,15 +555,15 @@ void TagDialog::init() } -inline const QString TagDialog::unknownSafe( QString s ) { +inline const TQString TagDialog::unknownSafe( TQString s ) { return ( s.isNull() || s.isEmpty() || s == "?" || s == "-" ) ? i18n ( "Unknown" ) : s; } -const QStringList TagDialog::statisticsData() { +const TQStringList TagDialog::statisticsData() { - QStringList data, values; + TQStringList data, values; const uint artist_id = CollectionDB::instance()->artistID( m_bundle.artist() ); const uint album_id = CollectionDB::instance()->albumID ( m_bundle.album() ); @@ -573,7 +573,7 @@ const QStringList TagDialog::statisticsData() { // tracks by this artist qb.clear(); qb.addReturnFunctionValue( QueryBuilder::funcCount, QueryBuilder::tabSong, QueryBuilder::valTitle ); - qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, QString::number( artist_id ) ); + qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, TQString::number( artist_id ) ); values = qb.run(); data += i18n( "Tracks by this Artist" ); data += values[0]; @@ -582,20 +582,20 @@ const QStringList TagDialog::statisticsData() { // albums by this artist qb.clear(); qb.addReturnFunctionValue( QueryBuilder::funcCount, QueryBuilder::tabAlbum, QueryBuilder::valID ); - qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, QString::number( artist_id ) ); + qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, TQString::number( artist_id ) ); qb.groupBy( QueryBuilder::tabSong, QueryBuilder::valAlbumID ); qb.excludeMatch( QueryBuilder::tabAlbum, i18n( "Unknown" ) ); qb.setOptions( QueryBuilder::optNoCompilations ); values = qb.run(); data += i18n( "Albums by this Artist" ); - data += QString::number( values.count() ); + data += TQString::number( values.count() ); // Favorite track by this artist qb.clear(); qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valTitle ); qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valScore ); - qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, QString::number( artist_id ) ); + qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valArtistID, TQString::number( artist_id ) ); qb.sortByFavorite(); qb.setLimit( 0, 1 ); values = qb.run(); @@ -607,7 +607,7 @@ const QStringList TagDialog::statisticsData() { qb.clear(); qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valTitle ); qb.addReturnValue( QueryBuilder::tabStats, QueryBuilder::valScore ); - qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valAlbumID, QString::number( album_id ) ); + qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valAlbumID, TQString::number( album_id ) ); qb.sortByFavorite(); qb.setLimit( 0, 1 ); values = qb.run(); @@ -616,7 +616,7 @@ const QStringList TagDialog::statisticsData() { } // Related Artists - const QString sArtists = CollectionDB::instance()->similarArtists( m_bundle.artist(), 4 ).join(", "); + const TQString sArtists = CollectionDB::instance()->similarArtists( m_bundle.artist(), 4 ).join(", "); if ( !sArtists.isEmpty() ) { data += i18n( "Related Artists" ); data += sArtists; @@ -631,13 +631,13 @@ void TagDialog::readTags() setCaption( kapp->makeStdCaption( i18n("Track Information: %1 by %2").arg( m_bundle.title(), m_bundle.artist() ) ) ); - QString niceTitle; + TQString niceTitle; if ( m_bundle.album().isEmpty() ) { if( !m_bundle.title().isEmpty() ) { if( !m_bundle.artist().isEmpty() ) niceTitle = i18n( "%1 by %2" ).arg( m_bundle.title(), m_bundle.artist() ); else - niceTitle = QString( "%1" ).arg( m_bundle.title() ); + niceTitle = TQString( "%1" ).arg( m_bundle.title() ); } else niceTitle = m_bundle.prettyTitle(); } @@ -665,10 +665,10 @@ void TagDialog::readTags() kComboBox_composer->setEnabled( extended ); - QString summaryText, statisticsText; - const QString body2cols = i18n( "
        ", "" ); - const QString body1col = ""; - const QString emptyLine = ""; + TQString summaryText, statisticsText; + const TQString body2cols = i18n( "", "" ); + const TQString body1col = ""; + const TQString emptyLine = ""; summaryText = "
        Label:Value
        %1:%2
        %1
        Label:Value
        %1:%2
        %1
        "; summaryText += body2cols.arg( i18n("Length"), unknownSafe( m_bundle.prettyLength() ) ); @@ -679,11 +679,11 @@ void TagDialog::readTags() summaryText += "
        "; if( AmarokConfig::useScores() ) - summaryText += body2cols.arg( i18n("Score"), QString::number( static_cast( m_bundle.score() ) ) ); + summaryText += body2cols.arg( i18n("Score"), TQString::number( static_cast( m_bundle.score() ) ) ); if( AmarokConfig::useRatings() ) summaryText += body2cols.arg( i18n("Rating"), m_bundle.prettyRating() ); - summaryText += body2cols.arg( i18n("Playcount"), QString::number( m_bundle.playCount() ) ); + summaryText += body2cols.arg( i18n("Playcount"), TQString::number( m_bundle.playCount() ) ); summaryText += body2cols.arg( i18n("First Played"), m_bundle.playCount() ? KGlobal::locale()->formatDate( CollectionDB::instance()->getFirstPlay( m_bundle.url().path() ).date() , true ) : i18n("Never") ); summaryText += body2cols.arg( i18n("a single item (singular)", "Last Played"), @@ -694,7 +694,7 @@ void TagDialog::readTags() statisticsText = "
        "; - QStringList sData = statisticsData(); + TQStringList sData = statisticsData(); for ( uint i = 0; isetText( i18n( "Editing 1 file", "Editing %n files", songCount ) ); - const QString body = i18n( "", "" ); - QString statisticsText = "
        Label:Value
        %1:%2
        "; + const TQString body = i18n( "", "" ); + TQString statisticsText = "
        Label:Value
        %1:%2
        "; if( AmarokConfig::useRatings() ) { - statisticsText += body.arg( i18n( "Rated Songs" ) , QString::number( ratingCount ) ); + statisticsText += body.arg( i18n( "Rated Songs" ) , TQString::number( ratingCount ) ); if ( ratingCount ) - statisticsText += body.arg( i18n( "Average Rating" ) , QString::number( (float)ratingSum / (float)ratingCount/2.0, 'f', 1 ) ); + statisticsText += body.arg( i18n( "Average Rating" ) , TQString::number( (float)ratingSum / (float)ratingCount/2.0, 'f', 1 ) ); } if( AmarokConfig::useRatings() ) { - statisticsText += body.arg( i18n( "Scored Songs" ) , QString::number( scoreCount ) ); + statisticsText += body.arg( i18n( "Scored Songs" ) , TQString::number( scoreCount ) ); if ( scoreCount ) - statisticsText += body.arg( i18n( "Average Score" ) , QString::number( scoreSum / scoreCount, 'f', 1 ) ); + statisticsText += body.arg( i18n( "Average Score" ) , TQString::number( scoreSum / scoreCount, 'f', 1 ) ); } @@ -932,8 +932,8 @@ TagDialog::readMultipleTracks() statisticsLabel->setText( statisticsText ); - QStringList commonLabels = getCommonLabels(); - QString text; + TQStringList commonLabels = getCommonLabels(); + TQString text; foreach ( commonLabels ) { if ( !text.isEmpty() ) @@ -951,12 +951,12 @@ QStringList TagDialog::getCommonLabels() { DEBUG_BLOCK - QMap counterMap; + TQMap counterMap; const KURL::List::ConstIterator end = m_urlList.end(); KURL::List::ConstIterator iter = m_urlList.begin(); for(; iter != end; ++iter ) { - QStringList labels = labelsForURL( *iter ); + TQStringList labels = labelsForURL( *iter ); foreach( labels ) { if ( counterMap.contains( *it ) ) @@ -966,9 +966,9 @@ TagDialog::getCommonLabels() } } int n = m_urlList.count(); - QStringList result; - QMap::ConstIterator counterEnd( counterMap.end() ); - for(QMap::ConstIterator it = counterMap.begin(); it != counterEnd; ++it ) + TQStringList result; + TQMap::ConstIterator counterEnd( counterMap.end() ); + for(TQMap::ConstIterator it = counterMap.begin(); it != counterEnd; ++it ) { if ( it.data() == n ) result.append( it.key() ); @@ -977,7 +977,7 @@ TagDialog::getCommonLabels() } inline bool -equalString( const QString &a, const QString &b ) +equalString( const TQString &a, const TQString &b ) { return (a.isEmpty() && b.isEmpty()) ? true : a == b; } @@ -1035,7 +1035,7 @@ void TagDialog::storeTags( const KURL &kurl ) { int result = changes(); - QString url = kurl.path(); + TQString url = kurl.path(); if( result & TagDialog::TAGSCHANGED ) { MetaBundle mb( m_bundle ); @@ -1059,13 +1059,13 @@ TagDialog::storeTags( const KURL &kurl ) storedRatings.replace( url, kComboBox_rating->currentItem() ); if( result & TagDialog::LYRICSCHANGED ) { if ( kTextEdit_lyrics->text().isEmpty() ) - storedLyrics.replace( url, QString::null ); + storedLyrics.replace( url, TQString::null ); else { - QDomDocument doc; - QDomElement e = doc.createElement( "lyrics" ); + TQDomDocument doc; + TQDomElement e = doc.createElement( "lyrics" ); e.setAttribute( "artist", kComboBox_artist->currentText() ); e.setAttribute( "title", kLineEdit_title->text() ); - QDomText t = doc.createTextNode( kTextEdit_lyrics->text() ); + TQDomText t = doc.createTextNode( kTextEdit_lyrics->text() ); e.appendChild( t ); doc.appendChild( e ); storedLyrics.replace( url, doc.toString() ); @@ -1073,7 +1073,7 @@ TagDialog::storeTags( const KURL &kurl ) } if( result & TagDialog::LABELSCHANGED ) { generateDeltaForLabelList( labelListFromText( kTextEdit_selectedLabels->text() ) ); - QStringList tmpLabels; + TQStringList tmpLabels; if ( newLabels.find( url ) != newLabels.end() ) tmpLabels = newLabels[ url ]; else @@ -1104,7 +1104,7 @@ TagDialog::storeTags( const KURL &url, int changes, const MetaBundle &mb ) } void -TagDialog::storeLabels( const KURL &url, const QStringList &labels ) +TagDialog::storeLabels( const KURL &url, const TQStringList &labels ) { newLabels.replace( url.path(), labels ); } @@ -1121,13 +1121,13 @@ TagDialog::loadTags( const KURL &url ) void TagDialog::loadLyrics( const KURL &url ) { - QString xml = lyricsForURL(url.path() ); + TQString xml = lyricsForURL(url.path() ); - QDomDocument doc; + TQDomDocument doc; if( doc.setContent( xml ) ) m_lyrics = doc.documentElement().text(); else - m_lyrics = QString::null; + m_lyrics = TQString::null; } void @@ -1136,7 +1136,7 @@ TagDialog::loadLabels( const KURL &url ) DEBUG_BLOCK m_labels = labelsForURL( url ); originalLabels[ url.path() ] = m_labels; - QString text; + TQString text; foreach( m_labels ) { if ( !text.isEmpty() ) @@ -1190,7 +1190,7 @@ TagDialog::labelsForURL( const KURL &url ) return newLabels[ url.path() ]; if( originalLabels.find( url.path() ) != originalLabels.end() ) return originalLabels[ url.path() ]; - QStringList tmp = CollectionDB::instance()->getLabels( url.path(), CollectionDB::typeUser ); + TQStringList tmp = CollectionDB::instance()->getLabels( url.path(), CollectionDB::typeUser ); originalLabels[ url.path() ] = tmp; return tmp; } @@ -1207,22 +1207,22 @@ TagDialog::saveTags() storeTags(); } - QMap::ConstIterator endScore( storedScores.end() ); - for(QMap::ConstIterator it = storedScores.begin(); it != endScore; ++it ) { + TQMap::ConstIterator endScore( storedScores.end() ); + for(TQMap::ConstIterator it = storedScores.begin(); it != endScore; ++it ) { CollectionDB::instance()->setSongPercentage( it.key(), it.data() ); } - QMap::ConstIterator endRating( storedRatings.end() ); - for(QMap::ConstIterator it = storedRatings.begin(); it != endRating; ++it ) { + TQMap::ConstIterator endRating( storedRatings.end() ); + for(TQMap::ConstIterator it = storedRatings.begin(); it != endRating; ++it ) { CollectionDB::instance()->setSongRating( it.key(), it.data() ); } - QMap::ConstIterator endLyrics( storedLyrics.end() ); - for(QMap::ConstIterator it = storedLyrics.begin(); it != endLyrics; ++it ) { + TQMap::ConstIterator endLyrics( storedLyrics.end() ); + for(TQMap::ConstIterator it = storedLyrics.begin(); it != endLyrics; ++it ) { CollectionDB::instance()->setLyrics( it.key(), it.data(), CollectionDB::instance()->uniqueIdFromUrl( KURL( it.key() ) ) ); emit lyricsChanged( it.key() ); } - QMap::ConstIterator endLabels( newLabels.end() ); - for(QMap::ConstIterator it = newLabels.begin(); it != endLabels; ++it ) { + TQMap::ConstIterator endLabels( newLabels.end() ); + for(TQMap::ConstIterator it = newLabels.begin(); it != endLabels; ++it ) { CollectionDB::instance()->setLabels( it.key(), it.data(), CollectionDB::instance()->uniqueIdFromUrl( KURL( it.key() ) ), CollectionDB::typeUser ); } @@ -1307,13 +1307,13 @@ TagDialog::applyToAllTracks() } storeTags( *it, changed, mb ); - QStringList tmpLabels = labelsForURL( *it ); + TQStringList tmpLabels = labelsForURL( *it ); //apply delta - for( QStringList::Iterator iter = m_removedLabels.begin(); iter != m_removedLabels.end(); ++iter ) + for( TQStringList::Iterator iter = m_removedLabels.begin(); iter != m_removedLabels.end(); ++iter ) { tmpLabels.remove( *iter ); } - for( QStringList::Iterator iter = m_addedLabels.begin(); iter != m_addedLabels.end(); ++iter ) + for( TQStringList::Iterator iter = m_addedLabels.begin(); iter != m_addedLabels.end(); ++iter ) { if( tmpLabels.find( *iter ) == tmpLabels.end() ) tmpLabels.append( *iter ); @@ -1323,27 +1323,27 @@ TagDialog::applyToAllTracks() } QStringList -TagDialog::labelListFromText( const QString &text ) +TagDialog::labelListFromText( const TQString &text ) { - QStringList tmp = QStringList::split( ',', text ); + TQStringList tmp = TQStringList::split( ',', text ); //insert each string into a map to remove duplicates - QMap map; + TQMap map; foreach( tmp ) { - QString tmpString = (*it).stripWhiteSpace(); + TQString tmpString = (*it).stripWhiteSpace(); if ( !tmpString.isEmpty() ) map.replace( tmpString, 0 ); } - QStringList result; - QMap::ConstIterator endMap( map.end() ); - for(QMap::ConstIterator it = map.begin(); it != endMap; ++it ) { + TQStringList result; + TQMap::ConstIterator endMap( map.end() ); + for(TQMap::ConstIterator it = map.begin(); it != endMap; ++it ) { result.append( it.key() ); } return result; } void -TagDialog::generateDeltaForLabelList( const QStringList &list ) +TagDialog::generateDeltaForLabelList( const TQStringList &list ) { m_addedLabels.clear(); m_removedLabels.clear(); @@ -1361,34 +1361,34 @@ TagDialog::generateDeltaForLabelList( const QStringList &list ) } QString -TagDialog::generateHTML( const QStringList &labels ) +TagDialog::generateHTML( const TQStringList &labels ) { //the first column of each row is the label name, the second the number of assigned songs //loop through it to find the highest number of songs, can be removed if somebody figures out a better sql query - QMap > mapping; - QStringList sortedLabels; + TQMap > mapping; + TQStringList sortedLabels; int max = 1; foreach( labels ) { - QString label = *it; + TQString label = *it; sortedLabels << label.lower(); ++it; int value = ( *it ).toInt(); if ( value > max ) max = value; - mapping[label.lower()] = QPair( label, value ); + mapping[label.lower()] = QPair( label, value ); } sortedLabels.sort(); - QString html = ""; + TQString html = ""; foreach( sortedLabels ) { - QString key = *it; + TQString key = *it; //generate a number in the range 1..10 based on how much the label is used int labelUse = ( mapping[key].second * 10 ) / max; if ( labelUse == 0 ) labelUse = 1; - html.append( QString( "%3 " ) - .arg( QString::number( labelUse ), mapping[key].first, mapping[key].first ) ); + html.append( TQString( "%3 " ) + .arg( TQString::number( labelUse ), mapping[key].first, mapping[key].first ) ); } html.append( "" ); debug() << "Dumping HTML for label cloud: " << html << endl; @@ -1401,8 +1401,8 @@ TagDialog::openURLRequest(const KURL &url ) //SLOT DEBUG_BLOCK if ( url.protocol() == "label" ) { - QString text = kTextEdit_selectedLabels->text(); - QStringList currentLabels = labelListFromText( text ); + TQString text = kTextEdit_selectedLabels->text(); + TQStringList currentLabels = labelListFromText( text ); if ( currentLabels.contains( url.path() ) ) return; if ( !text.isEmpty() ) @@ -1415,7 +1415,7 @@ TagDialog::openURLRequest(const KURL &url ) //SLOT bool TagDialog::writeTag( MetaBundle &mb, bool updateCB ) { - QCString path = QFile::encodeName( mb.url().path() ); + TQCString path = TQFile::encodeName( mb.url().path() ); if ( !TagLib::File::isWritable( path ) ) { Amarok::StatusBar::instance()->longMessage( i18n( "The file %1 is not writable." ).arg( mb.url().fileName() ), KDE::StatusBar::Error ); @@ -1423,7 +1423,7 @@ TagDialog::writeTag( MetaBundle &mb, bool updateCB ) } //visual feedback - QApplication::setOverrideCursor( KCursor::waitCursor() ); + TQApplication::setOverrideCursor( KCursor::waitCursor() ); bool result = mb.save(); mb.updateFilesize(); @@ -1432,19 +1432,19 @@ TagDialog::writeTag( MetaBundle &mb, bool updateCB ) //update the collection db CollectionDB::instance()->updateTags( mb.url().path(), mb, updateCB ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return result; } -TagDialogWriter::TagDialogWriter( const QMap tagsToChange ) +TagDialogWriter::TagDialogWriter( const TQMap tagsToChange ) : ThreadManager::Job( "TagDialogWriter" ), m_successCount ( 0 ), m_failCount ( 0 ) { - QApplication::setOverrideCursor( KCursor::waitCursor() ); - QMap::ConstIterator end = tagsToChange.end(); - for(QMap::ConstIterator it = tagsToChange.begin(); it != end; ++it ) { + TQApplication::setOverrideCursor( KCursor::waitCursor() ); + TQMap::ConstIterator end = tagsToChange.end(); + for(TQMap::ConstIterator it = tagsToChange.begin(); it != end; ++it ) { MetaBundle mb = it.data(); mb.detach(); m_tags += mb; @@ -1455,7 +1455,7 @@ bool TagDialogWriter::doJob() { for( int i = 0, size=m_tags.size(); ilongMessageThreadSafe( i18n( "The file %1 is not writable." ).arg( m_tags[i].url().fileName() ), KDE::StatusBar::Error ); @@ -1486,7 +1486,7 @@ TagDialogWriter::completeJob() Playlist::instance()->updateMetaData( m_tags[i] ); } } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if ( m_successCount ) CollectionView::instance()->databaseChanged(); if ( m_failCount ) diff --git a/amarok/src/tagdialog.h b/amarok/src/tagdialog.h index 315ef7cb..3fc309d5 100644 --- a/amarok/src/tagdialog.h +++ b/amarok/src/tagdialog.h @@ -12,13 +12,13 @@ #include "ktrm.h" #include "metabundle.h" //stack alloc #include "tagdialogbase.h" //baseclass -#include "qwidget.h" +#include "tqwidget.h" #include //stack alloc -#include -#include -#include -#include +#include +#include +#include +#include #include @@ -39,9 +39,9 @@ class TagDialog : public TagDialogBase enum Changes { NOCHANGE=0, SCORECHANGED=1, TAGSCHANGED=2, LYRICSCHANGED=4, RATINGCHANGED=8, LABELSCHANGED=16 }; enum Tabs { SUMMARYTAB, TAGSTAB, LYRICSTAB, STATSTAB, LABELSTAB }; - TagDialog( const KURL& url, QWidget* parent = 0 ); - TagDialog( const KURL::List list, QWidget* parent = 0 ); - TagDialog( const MetaBundle& mb, PlaylistItem* item, QWidget* parent = 0 ); + TagDialog( const KURL& url, TQWidget* parent = 0 ); + TagDialog( const KURL::List list, TQWidget* parent = 0 ); + TagDialog( const MetaBundle& mb, PlaylistItem* item, TQWidget* parent = 0 ); ~TagDialog(); void setTab( int id ); @@ -49,7 +49,7 @@ class TagDialog : public TagDialogBase friend class TagSelect; signals: - void lyricsChanged( const QString& ); + void lyricsChanged( const TQString& ); public slots: void openURLRequest(const KURL &url ); @@ -63,12 +63,12 @@ class TagDialog : public TagDialogBase void perTrack(); void checkModified(); - void loadCover( const QString &artist, const QString &album ); + void loadCover( const TQString &artist, const TQString &album ); void musicbrainzQuery(); void guessFromFilename(); void setFileNameSchemes(); - void queryDone( KTRMResultList results, QString error ); + void queryDone( KTRMResultList results, TQString error ); void fillSelected( KTRMResult selected ); void resetMusicbrainz(); @@ -84,48 +84,48 @@ class TagDialog : public TagDialogBase void storeTags(); void storeTags( const KURL& url ); void storeTags( const KURL& url, int changes, const MetaBundle &mb ); - void storeLabels( const KURL &url, const QStringList &labels ); + void storeLabels( const KURL &url, const TQStringList &labels ); void loadTags( const KURL& url ); void loadLyrics( const KURL& url ); void loadLabels( const KURL &url ); MetaBundle bundleForURL( const KURL &url ); float scoreForURL( const KURL &url ); int ratingForURL( const KURL &url ); - QString lyricsForURL( const KURL &url ); - QStringList labelsForURL( const KURL &url ); - QStringList getCommonLabels(); + TQString lyricsForURL( const KURL &url ); + TQStringList labelsForURL( const KURL &url ); + TQStringList getCommonLabels(); void saveTags(); bool writeTag( MetaBundle &mb, bool updateCB=true ); - const QString unknownSafe( QString ); - const QStringList statisticsData(); + const TQString unknownSafe( TQString ); + const TQStringList statisticsData(); void applyToAllTracks(); - const QStringList filenameSchemes(); + const TQStringList filenameSchemes(); - QStringList labelListFromText( const QString &text ); - void generateDeltaForLabelList( const QStringList &list ); - QString generateHTML( const QStringList &labels ); + TQStringList labelListFromText( const TQString &text ); + void generateDeltaForLabelList( const TQStringList &list ); + TQString generateHTML( const TQStringList &labels ); MetaBundle m_bundle; KURL::List::iterator m_currentURL; - QString m_lyrics; + TQString m_lyrics; bool m_perTrack; PlaylistItem* m_playlistItem; - QMap storedTags; - QMap storedScores; - QMap storedRatings; - QMap storedLyrics; - QMap newLabels; - QMap originalLabels; + TQMap storedTags; + TQMap storedScores; + TQMap storedRatings; + TQMap storedLyrics; + TQMap newLabels; + TQMap originalLabels; KURL::List m_urlList; - QString m_buttonMbText; - QString m_path; - QString m_currentCover; - QStringList m_labels; - QStringList m_addedLabels; - QStringList m_removedLabels; + TQString m_buttonMbText; + TQString m_path; + TQString m_currentCover; + TQStringList m_labels; + TQStringList m_addedLabels; + TQStringList m_removedLabels; KURL m_mbTrack; - QString m_commaSeparatedLabels; + TQString m_commaSeparatedLabels; //KHTMLPart *m_labelCloud; HTMLView *m_labelCloud; }; diff --git a/amarok/src/tagguesser.cpp b/amarok/src/tagguesser.cpp index 9ecbd4aa..a0a9ff30 100644 --- a/amarok/src/tagguesser.cpp +++ b/amarok/src/tagguesser.cpp @@ -19,7 +19,7 @@ #include #include -FileNameScheme::FileNameScheme( const QString &s ) +FileNameScheme::FileNameScheme( const TQString &s ) : m_cod( s ) , m_titleField( -1 ) , m_artistField( -1 ) @@ -64,75 +64,75 @@ FileNameScheme::FileNameScheme( const QString &s ) m_regExp.setPattern( composeRegExp( s ) ); } -bool FileNameScheme::matches( const QString &fileName ) const +bool FileNameScheme::matches( const TQString &fileName ) const { /* Strip extension ('.mp3') because '.' may be part of a title, and thus * does not work as a separator. */ - QString stripped = fileName; + TQString stripped = fileName; stripped.truncate( stripped.findRev( '.' ) ); return m_regExp.exactMatch( stripped ); } -QString FileNameScheme::title() const +TQString FileNameScheme::title() const { if( m_titleField == -1 ) - return QString(); + return TQString(); return m_regExp.capturedTexts()[ m_titleField ]; } -QString FileNameScheme::artist() const +TQString FileNameScheme::artist() const { if( m_artistField == -1 ) - return QString(); + return TQString(); return m_regExp.capturedTexts()[ m_artistField ]; } -QString FileNameScheme::album() const +TQString FileNameScheme::album() const { if( m_albumField == -1 ) - return QString(); + return TQString(); return m_regExp.capturedTexts()[ m_albumField ]; } -QString FileNameScheme::track() const +TQString FileNameScheme::track() const { if( m_trackField == -1 ) - return QString(); + return TQString(); return m_regExp.capturedTexts()[ m_trackField ]; } -QString FileNameScheme::comment() const +TQString FileNameScheme::comment() const { if( m_commentField == -1 ) - return QString(); + return TQString(); return m_regExp.capturedTexts()[ m_commentField ]; } -QString FileNameScheme::year() const +TQString FileNameScheme::year() const { if( m_yearField == -1 ) - return QString(); + return TQString(); return m_regExp.capturedTexts()[ m_yearField ]; } -QString FileNameScheme::composer() const +TQString FileNameScheme::composer() const { if( m_composerField == -1 ) - return QString(); + return TQString(); return m_regExp.capturedTexts()[ m_composerField ]; } -QString FileNameScheme::genre() const +TQString FileNameScheme::genre() const { if( m_genreField == -1 ) - return QString(); + return TQString(); return m_regExp.capturedTexts()[ m_genreField ]; } -QString FileNameScheme::composeRegExp( const QString &s ) const +TQString FileNameScheme::composeRegExp( const TQString &s ) const { - QMap substitutions; + TQMap substitutions; KConfigGroup config(KGlobal::config(), "TagGuesser"); @@ -146,7 +146,7 @@ QString FileNameScheme::composeRegExp( const QString &s ) const substitutions[ "genre" ] = config.readEntry( "Genre regexp", "([\\w\\s'&_,\\.]+)" ); - QString regExp = QRegExp::escape( s.simplifyWhiteSpace() ); + TQString regExp = TQRegExp::escape( s.simplifyWhiteSpace() ); regExp = ".*" + regExp; regExp.replace( ' ', "\\s+" ); regExp = KMacroExpander::expandMacros( regExp, substitutions ); @@ -154,9 +154,9 @@ QString FileNameScheme::composeRegExp( const QString &s ) const return regExp; } -QStringList TagGuesser::schemeStrings() +TQStringList TagGuesser::schemeStrings() { - QStringList schemes; + TQStringList schemes; schemes = Amarok::config( "TagGuesser" )->readListEntry( "Filename schemes" ); @@ -193,7 +193,7 @@ QStringList TagGuesser::schemeStrings() return schemes; } -void TagGuesser::setSchemeStrings( const QStringList &schemes ) +void TagGuesser::setSchemeStrings( const TQStringList &schemes ) { KConfig *cfg = KGlobal::config(); { @@ -208,7 +208,7 @@ TagGuesser::TagGuesser() loadSchemes(); } -TagGuesser::TagGuesser( const QString &absFileName ) +TagGuesser::TagGuesser( const TQString &absFileName ) { loadSchemes(); guess( absFileName ); @@ -216,16 +216,16 @@ TagGuesser::TagGuesser( const QString &absFileName ) void TagGuesser::loadSchemes() { - const QStringList schemes = schemeStrings(); - QStringList::ConstIterator it = schemes.begin(); - QStringList::ConstIterator end = schemes.end(); + const TQStringList schemes = schemeStrings(); + TQStringList::ConstIterator it = schemes.begin(); + TQStringList::ConstIterator end = schemes.end(); for ( ; it != end; ++it ) m_schemes += FileNameScheme( *it ); } -void TagGuesser::guess( const QString &absFileName ) +void TagGuesser::guess( const TQString &absFileName ) { - m_title = m_artist = m_album = m_track = m_comment = m_year = m_composer = m_genre = QString::null; + m_title = m_artist = m_album = m_track = m_comment = m_year = m_composer = m_genre = TQString::null; FileNameScheme::List::ConstIterator it = m_schemes.begin(); FileNameScheme::List::ConstIterator end = m_schemes.end(); @@ -246,15 +246,15 @@ void TagGuesser::guess( const QString &absFileName ) } } -QString TagGuesser::capitalizeWords( const QString &s ) +TQString TagGuesser::capitalizeWords( const TQString &s ) { if( s.isEmpty() ) return s; - QString result = s; + TQString result = s; result[ 0 ] = result[ 0 ].upper(); - const QRegExp wordRegExp( "\\s\\w" ); + const TQRegExp wordRegExp( "\\s\\w" ); int i = result.find( wordRegExp ); while ( i > -1 ) { result[ i + 1 ] = result[ i + 1 ].upper(); diff --git a/amarok/src/tagguesser.h b/amarok/src/tagguesser.h index 39e951c6..8ee2e9a5 100644 --- a/amarok/src/tagguesser.h +++ b/amarok/src/tagguesser.h @@ -5,12 +5,12 @@ #ifndef TAGGUESSER_H #define TAGGUESSER_H -#include +#include class FileNameScheme { public: - typedef QValueList List; + typedef TQValueList List; FileNameScheme() : m_cod() @@ -24,26 +24,26 @@ class FileNameScheme , m_genreField( -1 ) { } - FileNameScheme( const QString &s ); + FileNameScheme( const TQString &s ); - bool matches( const QString &s ) const; + bool matches( const TQString &s ) const; - QString title() const; - QString artist() const; - QString album() const; - QString track() const; - QString comment() const; - QString year() const; - QString composer() const; - QString genre() const; + TQString title() const; + TQString artist() const; + TQString album() const; + TQString track() const; + TQString comment() const; + TQString year() const; + TQString composer() const; + TQString genre() const; - QString pattern() const { return m_cod; }; + TQString pattern() const { return m_cod; }; private: - QString composeRegExp( const QString &s ) const; - QString m_cod; + TQString composeRegExp( const TQString &s ) const; + TQString m_cod; - mutable QRegExp m_regExp; + mutable TQRegExp m_regExp; int m_titleField; int m_artistField; @@ -61,36 +61,36 @@ class TagGuesser enum Type { FileName = 0, MusicBrainz = 1 }; - static QStringList schemeStrings(); - static void setSchemeStrings( const QStringList &schemes ); + static TQStringList schemeStrings(); + static void setSchemeStrings( const TQStringList &schemes ); TagGuesser(); - TagGuesser( const QString &absFileName ); + TagGuesser( const TQString &absFileName ); - void guess( const QString &absFileName ); + void guess( const TQString &absFileName ); - QString title() const { return m_title; } - QString artist() const { return m_artist; } - QString album() const { return m_album; } - QString track() const { return m_track; } - QString comment() const { return m_comment; } - QString year() const { return m_year; } - QString composer() const { return m_composer; } - QString genre() const { return m_genre; } + TQString title() const { return m_title; } + TQString artist() const { return m_artist; } + TQString album() const { return m_album; } + TQString track() const { return m_track; } + TQString comment() const { return m_comment; } + TQString year() const { return m_year; } + TQString composer() const { return m_composer; } + TQString genre() const { return m_genre; } private: void loadSchemes(); - QString capitalizeWords( const QString &s ); + TQString capitalizeWords( const TQString &s ); FileNameScheme::List m_schemes; - QString m_title; - QString m_artist; - QString m_album; - QString m_track; - QString m_comment; - QString m_year; - QString m_composer; - QString m_genre; + TQString m_title; + TQString m_artist; + TQString m_album; + TQString m_track; + TQString m_comment; + TQString m_year; + TQString m_composer; + TQString m_genre; }; #endif /* TAGGUESSER_H */ diff --git a/amarok/src/tagguesserconfigdialog.ui.h b/amarok/src/tagguesserconfigdialog.ui.h index 494b4c48..875bab35 100644 --- a/amarok/src/tagguesserconfigdialog.ui.h +++ b/amarok/src/tagguesserconfigdialog.ui.h @@ -23,7 +23,7 @@ #include "tagguesser.h" -#include +#include #include #include @@ -35,36 +35,36 @@ void TagGuesserConfigDialog::init() setCaption( i18n( "Guess By Filename Configuration" ) ); lvSchemes->setItemsRenameable( true ); lvSchemes->setSorting( -1 ); - lvSchemes->setDefaultRenameAction( QListView::Accept ); + lvSchemes->setDefaultRenameAction( TQListView::Accept ); bMoveUp->setIconSet( SmallIconSet( "1uparrow" ) ); bMoveDown->setIconSet( SmallIconSet( "1downarrow" ) ); - const QStringList schemes = TagGuesser::schemeStrings(); - QStringList::ConstIterator it = schemes.begin(); - QStringList::ConstIterator end = schemes.end(); + const TQStringList schemes = TagGuesser::schemeStrings(); + TQStringList::ConstIterator it = schemes.begin(); + TQStringList::ConstIterator end = schemes.end(); for ( ; it != end; ++it ) { KListViewItem *item = new KListViewItem( lvSchemes, *it ); item->moveItem( lvSchemes->lastItem() ); } - connect( lvSchemes, SIGNAL( currentChanged( QListViewItem * ) ), - this, SLOT( slotCurrentChanged( QListViewItem * ) ) ); - connect( lvSchemes, SIGNAL( doubleClicked( QListViewItem *, const QPoint &, int ) ), - this, SLOT( slotRenameItem( QListViewItem *, const QPoint &, int ) ) ); - connect( bMoveUp, SIGNAL( clicked() ), this, SLOT( slotMoveUpClicked() ) ); - connect( bMoveDown, SIGNAL( clicked() ), this, SLOT( slotMoveDownClicked() ) ); - connect( bAdd, SIGNAL( clicked() ), this, SLOT( slotAddClicked() ) ); - connect( bModify, SIGNAL( clicked() ), this, SLOT( slotModifyClicked() ) ); - connect( bRemove, SIGNAL( clicked() ), this, SLOT( slotRemoveClicked() ) ); - connect( bOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( bCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( lvSchemes, TQT_SIGNAL( currentChanged( TQListViewItem * ) ), + this, TQT_SLOT( slotCurrentChanged( TQListViewItem * ) ) ); + connect( lvSchemes, TQT_SIGNAL( doubleClicked( TQListViewItem *, const TQPoint &, int ) ), + this, TQT_SLOT( slotRenameItem( TQListViewItem *, const TQPoint &, int ) ) ); + connect( bMoveUp, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotMoveUpClicked() ) ); + connect( bMoveDown, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotMoveDownClicked() ) ); + connect( bAdd, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAddClicked() ) ); + connect( bModify, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotModifyClicked() ) ); + connect( bRemove, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotRemoveClicked() ) ); + connect( bOk, TQT_SIGNAL( clicked() ), this, TQT_SLOT( accept() ) ); + connect( bCancel, TQT_SIGNAL( clicked() ), this, TQT_SLOT( reject() ) ); lvSchemes->setSelected( lvSchemes->firstChild(), true ); slotCurrentChanged( lvSchemes->currentItem() ); resize( 400, 300 ); } -void TagGuesserConfigDialog::slotCurrentChanged(QListViewItem *item) +void TagGuesserConfigDialog::slotCurrentChanged(TQListViewItem *item) { bMoveUp->setEnabled( item != 0 && item->itemAbove() != 0 ); bMoveDown->setEnabled( item != 0 && item->itemBelow() != 0 ); @@ -75,12 +75,12 @@ void TagGuesserConfigDialog::slotCurrentChanged(QListViewItem *item) void TagGuesserConfigDialog::accept() { if(lvSchemes->renameLineEdit()) { - QKeyEvent returnKeyPress(QEvent::KeyPress, Key_Return, 0, 0); + TQKeyEvent returnKeyPress(TQEvent::KeyPress, Key_Return, 0, 0); KApplication::sendEvent( lvSchemes->renameLineEdit(), &returnKeyPress ); } - QStringList schemes; - for ( QListViewItem *it = lvSchemes->firstChild(); it; it = it->nextSibling() ) + TQStringList schemes; + for ( TQListViewItem *it = lvSchemes->firstChild(); it; it = it->nextSibling() ) schemes += it->text(0); TagGuesser::setSchemeStrings( schemes ); KDialog::accept(); @@ -93,14 +93,14 @@ void TagGuesserConfigDialog::reject() } -void TagGuesserConfigDialog::slotRenameItem(QListViewItem *item, const QPoint &, int c) +void TagGuesserConfigDialog::slotRenameItem(TQListViewItem *item, const TQPoint &, int c) { lvSchemes->rename(item, c); } void TagGuesserConfigDialog::slotMoveUpClicked() { - QListViewItem *item = lvSchemes->currentItem(); + TQListViewItem *item = lvSchemes->currentItem(); if( item->itemAbove() == lvSchemes->firstChild() ) item->itemAbove()->moveItem(item); else @@ -111,7 +111,7 @@ void TagGuesserConfigDialog::slotMoveUpClicked() void TagGuesserConfigDialog::slotMoveDownClicked() { - QListViewItem *item = lvSchemes->currentItem(); + TQListViewItem *item = lvSchemes->currentItem(); item->moveItem( item->itemBelow() ); lvSchemes->ensureItemVisible(item); slotCurrentChanged(item); diff --git a/amarok/src/threadmanager.cpp b/amarok/src/threadmanager.cpp index 6da9dc11..cf4a90e5 100644 --- a/amarok/src/threadmanager.cpp +++ b/amarok/src/threadmanager.cpp @@ -8,7 +8,7 @@ #define DEBUG_PREFIX "ThreadManager" #include -#include +#include #include //we're emulating features of Qt 4, so this can be removed for Amarok 2.0 @@ -21,7 +21,7 @@ using Amarok::StatusBar; volatile uint ThreadManager::threadIdCounter = 1; //main thread grabs zero -QMutex* ThreadManager::threadIdMutex = new QMutex(); +TQMutex* ThreadManager::threadIdMutex = new TQMutex(); ThreadManager::ThreadManager() @@ -38,7 +38,7 @@ ThreadManager::~ThreadManager() #ifdef HAVE_INOTIFY // we don't delete the thread's job as amarok is gone // and the Job dtor may expect amarok to be there etc. - if ( (*it)->job() && (*it)->job()->name() == QCString( "INotify" ) ) + if ( (*it)->job() && (*it)->job()->name() == TQCString( "INotify" ) ) { debug() << "Forcibly terminating INotify thread...\n"; (*it)->terminate(); @@ -55,7 +55,7 @@ ThreadManager::~ThreadManager() } uint -ThreadManager::jobCount( const QCString &name ) +ThreadManager::jobCount( const TQCString &name ) { uint count = 0; @@ -95,7 +95,7 @@ ThreadManager::queueJobs( const JobList &jobs ) m_jobs += jobs; - const QCString name = jobs.front()->name(); + const TQCString name = jobs.front()->name(); const uint count = jobCount( name ); if ( count == jobs.count() ) @@ -109,7 +109,7 @@ ThreadManager::onlyOneJob( Job *job ) { SHOULD_BE_GUI - const QCString name = job->name(); + const TQCString name = job->name(); // first cause all current jobs with this name to be aborted abortAllJobsNamed( name ); @@ -126,7 +126,7 @@ ThreadManager::onlyOneJob( Job *job ) } int -ThreadManager::abortAllJobsNamed( const QCString &name ) +ThreadManager::abortAllJobsNamed( const TQCString &name ) { SHOULD_BE_GUI @@ -154,19 +154,19 @@ ThreadManager::gimmeThread() } bool -ThreadManager::event( QEvent *e ) +ThreadManager::event( TQEvent *e ) { switch( e->type() ) { case JobEvent: { Job *job = static_cast( e ); DebugStream d = debug() << "Job "; - const QCString name = job->name(); + const TQCString name = job->name(); Thread *thread = job->m_thread; - QApplication::postEvent( + TQApplication::postEvent( ThreadManager::instance(), - new QCustomEvent( ThreadManager::RestoreOverrideCursorEvent ) ); + new TQCustomEvent( ThreadManager::RestoreOverrideCursorEvent ) ); if ( !job->isAborted() ) { d << "completed"; @@ -192,7 +192,7 @@ ThreadManager::event( QEvent *e ) break; } - case QEvent::Timer: + case TQEvent::Timer: debug() << "Threads in pool: " << m_threads.count() << endl; // for( ThreadList::Iterator it = m_threads.begin(), end = m_threads.end(); it != end; ++it ) @@ -206,15 +206,15 @@ ThreadManager::event( QEvent *e ) case OverrideCursorEvent: // we have to do this for the PlaylistLoader case, as Qt uses the same // function for drag and drop operations. - if (qApp->type() != QApplication::Tty) - QApplication::setOverrideCursor( KCursor::workingCursor() ); + if (qApp->type() != TQApplication::Tty) + TQApplication::setOverrideCursor( KCursor::workingCursor() ); break; case RestoreOverrideCursorEvent: // we have to do this for the PlaylistLoader case, as Qt uses the same // function for drag and drop operations. - if (qApp->type() != QApplication::Tty) - QApplication::restoreOverrideCursor(); + if (qApp->type() != TQApplication::Tty) + TQApplication::restoreOverrideCursor(); break; default: @@ -237,7 +237,7 @@ static void create_current_thread_key() /// @class ThreadManager::Thread ThreadManager::Thread::Thread() - : QThread() + : TQThread() {} ThreadManager::Thread::~Thread() @@ -245,11 +245,11 @@ ThreadManager::Thread::~Thread() Q_ASSERT( finished() ); } -QThread* +TQThread* ThreadManager::Thread::getRunning() { pthread_once( ¤t_thread_key_once, create_current_thread_key ); - return reinterpret_cast( pthread_getspecific( current_thread_key ) ); + return reinterpret_cast( pthread_getspecific( current_thread_key ) ); } QString @@ -259,7 +259,7 @@ ThreadManager::Thread::threadId() return "None"; else { - QString s; + TQString s; return s.sprintf( "%p", getRunning() ); } } @@ -271,15 +271,15 @@ ThreadManager::Thread::runJob( Job *job ) job->m_parentThreadId = m_threadId; if ( job->isAborted() ) - QApplication::postEvent( ThreadManager::instance(), job ); + TQApplication::postEvent( ThreadManager::instance(), job ); else { m_job = job; start( Thread::IdlePriority ); //will wait() first if necessary - QApplication::postEvent( + TQApplication::postEvent( ThreadManager::instance(), - new QCustomEvent( ThreadManager::OverrideCursorEvent ) ); + new TQCustomEvent( ThreadManager::OverrideCursorEvent ) ); } } @@ -302,7 +302,7 @@ ThreadManager::Thread::run() if( m_job ) { m_job->m_aborted |= !m_job->doJob(); - QApplication::postEvent( ThreadManager::instance(), m_job ); + TQApplication::postEvent( ThreadManager::instance(), m_job ); } // almost always the thread doesn't finish until after the @@ -314,10 +314,10 @@ ThreadManager::Thread::run() /// @class ProgressEvent /// @short Used by ThreadManager::Job internally -class ProgressEvent : public QCustomEvent { +class ProgressEvent : public TQCustomEvent { public: ProgressEvent( int progress ) - : QCustomEvent( 30303 ) + : TQCustomEvent( 30303 ) , progress( progress ) {} const int progress; @@ -328,7 +328,7 @@ public: /// @class ThreadManager::Job ThreadManager::Job::Job( const char *name ) - : QCustomEvent( ThreadManager::JobEvent ) + : TQCustomEvent( ThreadManager::JobEvent ) , m_name( name ) , m_thread( 0 ) , m_percentDone( 0 ) @@ -352,7 +352,7 @@ ThreadManager::Job::setProgressTotalSteps( uint steps ) m_totalSteps = steps; - QApplication::postEvent( this, new ProgressEvent( -1 ) ); + TQApplication::postEvent( this, new ProgressEvent( -1 ) ); } void @@ -364,16 +364,16 @@ ThreadManager::Job::setProgress( uint steps ) if ( newPercent != m_percentDone ) { m_percentDone = newPercent; - QApplication::postEvent( this, new ProgressEvent( newPercent ) ); + TQApplication::postEvent( this, new ProgressEvent( newPercent ) ); } } void -ThreadManager::Job::setStatus( const QString &status ) +ThreadManager::Job::setStatus( const TQString &status ) { m_status = status; - QApplication::postEvent( this, new ProgressEvent( -2 ) ); + TQApplication::postEvent( this, new ProgressEvent( -2 ) ); } void @@ -383,7 +383,7 @@ ThreadManager::Job::incrementProgress() } void -ThreadManager::Job::customEvent( QCustomEvent *e ) +ThreadManager::Job::customEvent( TQCustomEvent *e ) { int progress = static_cast(e)->progress; @@ -396,7 +396,7 @@ ThreadManager::Job::customEvent( QCustomEvent *e ) case -1: StatusBar::instance()->newProgressOperation( this ) .setDescription( m_description ) - .setAbortSlot( this, SLOT(abort()) ) + .setAbortSlot( this, TQT_SLOT(abort()) ) .setTotalSteps( 100 ); break; @@ -407,20 +407,20 @@ ThreadManager::Job::customEvent( QCustomEvent *e ) -ThreadManager::DependentJob::DependentJob( QObject *dependent, const char *name ) +ThreadManager::DependentJob::DependentJob( TQObject *dependent, const char *name ) : Job( name ) , m_dependent( dependent ) { - connect( dependent, SIGNAL(destroyed()), SLOT(abort()) ); + connect( dependent, TQT_SIGNAL(destroyed()), TQT_SLOT(abort()) ); - QApplication::postEvent( dependent, new QCustomEvent( JobStartedEvent ) ); + TQApplication::postEvent( dependent, new TQCustomEvent( JobStartedEvent ) ); } void ThreadManager::DependentJob::completeJob() { //synchronous, so we don't get deleted twice - QApplication::sendEvent( m_dependent, this ); + TQApplication::sendEvent( m_dependent, this ); } #include "threadmanager.moc" diff --git a/amarok/src/threadmanager.h b/amarok/src/threadmanager.h index db747d03..8ac62455 100644 --- a/amarok/src/threadmanager.h +++ b/amarok/src/threadmanager.h @@ -7,13 +7,13 @@ #define THREADMANAGER_H #include "debug.h" -#include //baseclass -#include -#include -#include -#include -#include -#include +#include //baseclass +#include +#include +#include +#include +#include +#include #include "debug.h" #define DISABLE_GENERATED_MEMBER_FUNCTIONS_3( T ) \ @@ -44,7 +44,7 @@ class MyJob : public ThreadManager::Job { public: - MyJob( QObject *dependent ) : Job( dependent, "MyJob" ) {} + MyJob( TQObject *dependent ) : Job( dependent, "MyJob" ) {} virtual bool doJob() { //do some work in thread... @@ -77,9 +77,9 @@ /// This class is because moc "is really good" (no nested Q_OBJECT classes) -class JobBase : public QObject { +class JobBase : public TQObject { Q_OBJECT -protected: JobBase() : QObject(), m_aborted( false ) {} +protected: JobBase() : TQObject(), m_aborted( false ) {} public slots: void abort() { m_aborted = true; } protected: bool m_aborted; }; @@ -89,16 +89,16 @@ class ThreadManager : public QObject public: class Thread; friend class Thread; - typedef QValueList ThreadList; + typedef TQValueList ThreadList; class Job; friend class Job; - typedef QValueList JobList; + typedef TQValueList JobList; static ThreadManager *instance(); static void deleteInstance(); static volatile uint getNewThreadId(); - static QMutex *threadIdMutex; + static TQMutex *threadIdMutex; static volatile uint threadIdCounter; /** @@ -143,17 +143,17 @@ public: * * @return how many jobs were aborted, or -1 if no thread was found */ - int abortAllJobsNamed( const QCString &name ); + int abortAllJobsNamed( const TQCString &name ); /** * @return true if a Job with name is queued or is running */ - bool isJobPending( const QCString &name ) { return jobCount( name ) > 0; } + bool isJobPending( const TQCString &name ) { return jobCount( name ) > 0; } /** * @return the number of jobs running, pending, aborted and otherwise. */ - uint jobCount( const QCString &name ); + uint jobCount( const TQCString &name ); private: ThreadManager(); @@ -161,7 +161,7 @@ private: enum EventType { JobEvent = 20202, OverrideCursorEvent, RestoreOverrideCursorEvent }; - virtual bool event( QEvent* ); + virtual bool event( TQEvent* ); /// checks the pool for an available thread, creates a new one if required Thread *gimmeThread(); @@ -187,12 +187,12 @@ public: virtual void run(); void runJob( Job* ); - void msleep( int ms ) { QThread::msleep( ms ); } //we need to make this public for class Job + void msleep( int ms ) { TQThread::msleep( ms ); } //we need to make this public for class Job Job *job() const { return m_job; } - static QThread* getRunning(); - static QString threadId(); + static TQThread* getRunning(); + static TQString threadId(); const uint localThreadId() const { return m_threadId; } private: @@ -204,7 +204,7 @@ public: ~Thread(); //we can delete threads here only - friend bool ThreadManager::event( QEvent* ); + friend bool ThreadManager::event( TQEvent* ); protected: DISABLE_GENERATED_MEMBER_FUNCTIONS_3( Thread ) @@ -265,7 +265,7 @@ public: bool wasSuccessful() const { return !m_aborted; } /** - * Calls QThread::msleep( int ) + * Calls TQThread::msleep( int ) */ void msleep( int ms ) { m_thread->msleep( ms ); } @@ -273,12 +273,12 @@ public: * You should set @param description if you set progress information * do this in the ctor, or it won't have an effect */ - void setDescription( const QString &description ) { m_description = description; } + void setDescription( const TQString &description ) { m_description = description; } /** * If you set progress information, you should set this too, changing it when appropriate */ - void setStatus( const QString &status ); + void setStatus( const TQString &status ); /** * This shows the progressBar too, the user will be able to abort @@ -322,7 +322,7 @@ public: virtual void completeJob() = 0; /// be sure to call the base function in your reimplementation - virtual void customEvent( QCustomEvent* ); + virtual void customEvent( TQCustomEvent* ); private: char const * const m_name; @@ -334,8 +334,8 @@ public: uint m_totalSteps; uint m_parentThreadId; - QString m_description; - QString m_status; + TQString m_description; + TQString m_status; protected: DISABLE_GENERATED_MEMBER_FUNCTIONS_4( Job ) @@ -346,10 +346,10 @@ public: * @class DependentJob * @short A Job that depends on the existence of a QObject * - * This Job type is dependent on a QObject instance, if that instance is + * This Job type is dependent on a TQObject instance, if that instance is * deleted, this Job will be aborted and safely deleted. * - * ThreadManager::DependentJob (and Job, the baseclass) isa QCustomEvent, + * ThreadManager::DependentJob (and Job, the baseclass) isa TQCustomEvent, * and completeJob() is reimplemented to send the job to the dependent. * Of course you can still reimplement completeJob() yourself. * @@ -357,7 +357,7 @@ public: * the Job (not after it has started unfortunately), and a JobFinishedEvent * after the Job has finished. * - * The dependent is a QGuardedPtr, so you can reference the pointer returned + * The dependent is a TQGuardedPtr, so you can reference the pointer returned * from dependent() safely provided you always test for 0 first. However * safest of all is to not rely on that pointer at all! Pass required * data-members with the job, only operate on the dependent in @@ -366,7 +366,7 @@ public: * * It is only safe to have one dependent, if you depend on multiple objects * that might get deleted while you are running you should instead try to - * make the multiple objects children of one QObject and depend on the + * make the multiple objects children of one TQObject and depend on the * top-most parent or best of all would be to make copies of the data you * need instead of being dependent. */ @@ -374,14 +374,14 @@ public: class DependentJob : public Job { public: - DependentJob( QObject *dependent, const char *name ); + DependentJob( TQObject *dependent, const char *name ); virtual void completeJob(); - QObject *dependent() { return m_dependent; } + TQObject *dependent() { return m_dependent; } private: - const QGuardedPtr m_dependent; + const TQGuardedPtr m_dependent; protected: DISABLE_GENERATED_MEMBER_FUNCTIONS_4( DependentJob ) diff --git a/amarok/src/tooltip.cpp b/amarok/src/tooltip.cpp index a923c420..4b842c85 100644 --- a/amarok/src/tooltip.cpp +++ b/amarok/src/tooltip.cpp @@ -17,11 +17,11 @@ Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include "debug.h" @@ -30,30 +30,30 @@ class Amarok::ToolTip::Manager: public QObject { public: - Manager( QObject *parent ): QObject( parent ) { qApp->installEventFilter( this ); } + Manager( TQObject *parent ): TQObject( parent ) { qApp->installEventFilter( this ); } virtual ~Manager() { for( int n = Amarok::ToolTip::s_tooltips.count() - 1; n >= 0; --n ) delete Amarok::ToolTip::s_tooltips[n]; } - bool eventFilter( QObject*, QEvent *e ) + bool eventFilter( TQObject*, TQEvent *e ) { switch ( e->type() ) { - case QEvent::KeyPress: - case QEvent::KeyRelease: - case QEvent::MouseButtonPress: - case QEvent::MouseButtonRelease: - //case QEvent::MouseMove: - case QEvent::Wheel: + case TQEvent::KeyPress: + case TQEvent::KeyRelease: + case TQEvent::MouseButtonPress: + case TQEvent::MouseButtonRelease: + //case TQEvent::MouseMove: + case TQEvent::Wheel: ToolTip::hideTips(); break; - case QEvent::FocusIn: - case QEvent::Enter: - case QEvent::Leave: - case QEvent::FocusOut: - if( !dynamic_cast( qApp->widgetAt( QCursor::pos(), true ) ) ) + case TQEvent::FocusIn: + case TQEvent::Enter: + case TQEvent::Leave: + case TQEvent::FocusOut: + if( !dynamic_cast( qApp->widgetAt( TQCursor::pos(), true ) ) ) Amarok::ToolTip::hideTips(); default: break; } @@ -63,23 +63,23 @@ public: }; Amarok::ToolTip::Manager* Amarok::ToolTip::s_manager = 0; -QPoint Amarok::ToolTip::s_pos; -QRect Amarok::ToolTip::s_rect; -QString Amarok::ToolTip::s_text; -QValueList Amarok::ToolTip::s_tooltips; +TQPoint Amarok::ToolTip::s_pos; +TQRect Amarok::ToolTip::s_rect; +TQString Amarok::ToolTip::s_text; +TQValueList Amarok::ToolTip::s_tooltips; int Amarok::ToolTip::s_hack = 0; -void Amarok::ToolTip::add( ToolTipClient *client, QWidget *parent ) //static +void Amarok::ToolTip::add( ToolTipClient *client, TQWidget *parent ) //static { if( !s_manager ) s_manager = new Amarok::ToolTip::Manager( qApp ); new ToolTip( client, parent ); } -void Amarok::ToolTip::remove( QWidget *widget ) //static +void Amarok::ToolTip::remove( TQWidget *widget ) //static { for( int i = s_tooltips.count() - 1; i >= 0; --i ) - if( s_tooltips[i]->QToolTip::parentWidget() == widget ) + if( s_tooltips[i]->TQToolTip::parentWidget() == widget ) delete s_tooltips[i]; } @@ -87,15 +87,15 @@ void Amarok::ToolTip::hideTips() //static { for( int i = 0, n = s_tooltips.count(); i < n; ++i ) s_tooltips[i]->hideTip(); - QToolTip::hide(); + TQToolTip::hide(); } -QString Amarok::ToolTip::textFor( QWidget *widget, const QPoint &pos ) //static +TQString Amarok::ToolTip::textFor( TQWidget *widget, const TQPoint &pos ) //static { for( int i = 0, n = s_tooltips.count(); i < n; ++i ) - if( s_tooltips[i]->QToolTip::parentWidget() == widget ) + if( s_tooltips[i]->TQToolTip::parentWidget() == widget ) return s_tooltips[i]->m_client->toolTipText( widget, pos ).first; - return QToolTip::textFor( widget, pos ); + return TQToolTip::textFor( widget, pos ); } void Amarok::ToolTip::updateTip() //static @@ -103,9 +103,9 @@ void Amarok::ToolTip::updateTip() //static for( int i = 0, n = s_tooltips.count(); i < n; ++i ) if( s_tooltips[i]->isVisible() ) { - QWidget* const w = s_tooltips[i]->QToolTip::parentWidget(); - QPair p = s_tooltips[i]->m_client->toolTipText( w, w->mapFromGlobal( s_pos ) ); - QString prev = s_text; + TQWidget* const w = s_tooltips[i]->TQToolTip::parentWidget(); + QPair p = s_tooltips[i]->m_client->toolTipText( w, w->mapFromGlobal( s_pos ) ); + TQString prev = s_text; if( prev != p.first ) { s_text = p.first; @@ -116,14 +116,14 @@ void Amarok::ToolTip::updateTip() //static } } -Amarok::ToolTip::ToolTip( ToolTipClient *client, QWidget *parent ) - : QFrame( 0, 0, WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WStyle_StaysOnTop | WX11BypassWM | WNoAutoErase ), - QToolTip( parent ), +Amarok::ToolTip::ToolTip( ToolTipClient *client, TQWidget *parent ) + : TQFrame( 0, 0, WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WStyle_StaysOnTop | WX11BypassWM | WNoAutoErase ), + TQToolTip( parent ), m_client( client ) { s_tooltips.append( this ); - QFrame::setPalette( QToolTip::palette() ); - connect( &m_timer, SIGNAL( timeout() ), this, SLOT( hideTip() ) ); + TQFrame::setPalette( TQToolTip::palette() ); + connect( &m_timer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( hideTip() ) ); } Amarok::ToolTip::~ToolTip() @@ -131,14 +131,14 @@ Amarok::ToolTip::~ToolTip() s_tooltips.remove( this ); } -void Amarok::ToolTip::maybeTip( const QPoint &pos ) +void Amarok::ToolTip::maybeTip( const TQPoint &pos ) { - s_pos = QToolTip::parentWidget()->mapToGlobal( pos ); - QString prev = s_text; - QPair p = m_client->toolTipText( QToolTip::parentWidget(), pos ); + s_pos = TQToolTip::parentWidget()->mapToGlobal( pos ); + TQString prev = s_text; + QPair p = m_client->toolTipText( TQToolTip::parentWidget(), pos ); s_text = p.first; s_rect = p.second; - if( QToolTip::parentWidget() && !s_text.isEmpty() ) + if( TQToolTip::parentWidget() && !s_text.isEmpty() ) { if( s_text != prev ) hideTips(); @@ -166,51 +166,51 @@ void Amarok::ToolTip::hideTip() { if( !isVisible() ) return; - QFrame::hide(); - QToolTip::parentWidget()->update(); + TQFrame::hide(); + TQToolTip::parentWidget()->update(); m_timer.stop(); s_hack = 0; } -void Amarok::ToolTip::drawContents( QPainter *painter ) +void Amarok::ToolTip::drawContents( TQPainter *painter ) { - QPixmap buf( width(), height() ); - QPainter p( &buf ); + TQPixmap buf( width(), height() ); + TQPainter p( &buf ); buf.fill( colorGroup().background() ); p.setPen( colorGroup().foreground() ); p.drawRect( buf.rect() ); - QSimpleRichText text( s_text, QToolTip::parentWidget()->font() ); + TQSimpleRichText text( s_text, TQToolTip::parentWidget()->font() ); text.setWidth( width() ); p.translate( 0, height() / 2 - text.height() / 2); - QPoint pos = s_rect.isNull() ? QPoint(2, -1) - : s_hack == 1 ? QPoint(4, -2) - : QPoint(2, -2); //HACK positioning - p.setFont( QToolTip::parentWidget()->font() ); + TQPoint pos = s_rect.isNull() ? TQPoint(2, -1) + : s_hack == 1 ? TQPoint(4, -2) + : TQPoint(2, -2); //HACK positioning + p.setFont( TQToolTip::parentWidget()->font() ); text.draw( &p, pos.x(), pos.y(), rect(), colorGroup() ); painter->drawPixmap( 0, 0, buf ); } -QSize Amarok::ToolTip::sizeHint() const +TQSize Amarok::ToolTip::sizeHint() const { if( !s_rect.isNull() ) return s_rect.size(); else { - QSimpleRichText text( s_text, QToolTip::parentWidget()->font() ); + TQSimpleRichText text( s_text, TQToolTip::parentWidget()->font() ); text.setWidth( 500 ); //is this reasonable? - return QSize( text.widthUsed() - 2, text.height() ); + return TQSize( text.widthUsed() - 2, text.height() ); } } void Amarok::ToolTip::position() { - const QRect drect = QApplication::desktop()->availableGeometry( QToolTip::parentWidget() ); - const QSize size = sizeHint(); + const TQRect drect = TQApplication::desktop()->availableGeometry( TQToolTip::parentWidget() ); + const TQSize size = sizeHint(); const int width = size.width(), height = size.height(); - QPoint pos; + TQPoint pos; if( !s_rect.isNull() ) { pos = s_rect.topLeft(); @@ -221,7 +221,7 @@ void Amarok::ToolTip::position() } else { - const QRect r = QRect( QToolTip::parentWidget()->mapToGlobal( QToolTip::parentWidget()->pos() ), QToolTip::parentWidget()->size() ); + const TQRect r = TQRect( TQToolTip::parentWidget()->mapToGlobal( TQToolTip::parentWidget()->pos() ), TQToolTip::parentWidget()->size() ); pos = r.bottomRight(); if( pos.y() + height > drect.bottom() ) pos.setY( kMax( drect.top(), r.top() - height ) ); diff --git a/amarok/src/tooltip.h b/amarok/src/tooltip.h index 34d16693..5eb3020e 100644 --- a/amarok/src/tooltip.h +++ b/amarok/src/tooltip.h @@ -20,10 +20,10 @@ #ifndef AMAROK_TOOLTIP_H #define AMAROK_TOOLTIP_H -#include -#include -#include -#include +#include +#include +#include +#include namespace Amarok { @@ -31,18 +31,18 @@ namespace Amarok class ToolTipClient { public: - virtual QPair toolTipText( QWidget *widget, const QPoint &pos ) const = 0; + virtual QPair toolTipText( TQWidget *widget, const TQPoint &pos ) const = 0; }; -class ToolTip: public QFrame, public QToolTip +class ToolTip: public TQFrame, public QToolTip { Q_OBJECT public: - static void add( ToolTipClient *client, QWidget *parent ); - static void remove( QWidget *parent ); + static void add( ToolTipClient *client, TQWidget *parent ); + static void remove( TQWidget *parent ); static void hideTips(); - static QString textFor( QWidget *widget, const QPoint &pos = QPoint() ); + static TQString textFor( TQWidget *widget, const TQPoint &pos = TQPoint() ); static void updateTip(); private slots: @@ -50,25 +50,25 @@ private slots: void hideTip(); private: - ToolTip( ToolTipClient *client, QWidget *parent ); + ToolTip( ToolTipClient *client, TQWidget *parent ); virtual ~ToolTip(); void position(); ToolTipClient *m_client; - QTimer m_timer; - static QPoint s_pos; - static QRect s_rect; - static QString s_text; - static QValueList s_tooltips; + TQTimer m_timer; + static TQPoint s_pos; + static TQRect s_rect; + static TQString s_text; + static TQValueList s_tooltips; class Manager; friend class Manager; static Manager* s_manager; public: - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; protected: - virtual void maybeTip( const QPoint &pos ); - virtual void drawContents( QPainter *painter ); + virtual void maybeTip( const TQPoint &pos ); + virtual void drawContents( TQPainter *painter ); public: static int s_hack; diff --git a/amarok/src/trackpickerdialog.cpp b/amarok/src/trackpickerdialog.cpp index f8259e22..5288a811 100644 --- a/amarok/src/trackpickerdialog.cpp +++ b/amarok/src/trackpickerdialog.cpp @@ -17,7 +17,7 @@ #if HAVE_TUNEPIMP -#include +#include #include #include @@ -26,7 +26,7 @@ #include "trackpickerdialog.h" #include "trackpickerdialogbase.h" -#define NUMBER(x) (x == 0 ? QString::null : QString::number(x)) +#define NUMBER(x) (x == 0 ? TQString::null : TQString::number(x)) class TrackPickerItem : public KListViewItem { @@ -36,8 +36,8 @@ public: result.title(), result.artist(), result.album(), NUMBER(result.track()), NUMBER(result.year())), m_result(result) { -//QString year; -//if(result.year() == QString::empty()) year = "xx"; +//TQString year; +//if(result.year() == TQString::empty()) year = "xx"; //else year = result.year(); //setText(5,"xx"); } @@ -51,8 +51,8 @@ private: // public methods //////////////////////////////////////////////////////////////////////////////// -TrackPickerDialog::TrackPickerDialog(const QString &name, const KTRMResultList &results, QWidget *parent) - : KDialogBase(parent, name.latin1(), true, QString::null, Ok | Cancel, Ok, true) +TrackPickerDialog::TrackPickerDialog(const TQString &name, const KTRMResultList &results, TQWidget *parent) + : KDialogBase(parent, name.latin1(), true, TQString::null, Ok | Cancel, Ok, true) { kapp->setTopWidget( this ); setCaption( kapp->makeStdCaption( i18n("MusicBrainz Results") ) ); @@ -78,7 +78,7 @@ TrackPickerDialog::TrackPickerDialog(const QString &name, const KTRMResultList & m_base->trackList->setSelected(m_base->trackList->firstChild(), true); // m_base->trackList->triggerUpdate(); setMinimumWidth(kMax(300, width())); - connect(this, SIGNAL( sigSelectionMade( KTRMResult ) ), parent, SLOT( fillSelected( KTRMResult ) ) ); + connect(this, TQT_SIGNAL( sigSelectionMade( KTRMResult ) ), parent, TQT_SLOT( fillSelected( KTRMResult ) ) ); } diff --git a/amarok/src/trackpickerdialog.h b/amarok/src/trackpickerdialog.h index 98c09aa4..5edea974 100644 --- a/amarok/src/trackpickerdialog.h +++ b/amarok/src/trackpickerdialog.h @@ -35,7 +35,7 @@ signals: void sigSelectionMade( KTRMResult ); public: - TrackPickerDialog(const QString &name, const KTRMResultList &results, QWidget *parent = 0); + TrackPickerDialog(const TQString &name, const KTRMResultList &results, TQWidget *parent = 0); KTRMResult result() const; diff --git a/amarok/src/tracktooltip.cpp b/amarok/src/tracktooltip.cpp index 17fc936b..8cdc4010 100644 --- a/amarok/src/tracktooltip.cpp +++ b/amarok/src/tracktooltip.cpp @@ -25,7 +25,7 @@ #include "playlist.h" #include "playlistitem.h" #include "podcastbundle.h" -#include +#include #include @@ -40,25 +40,25 @@ TrackToolTip *TrackToolTip::instance() TrackToolTip::TrackToolTip(): m_haspos( false ) { - connect( CollectionDB::instance(), SIGNAL( coverChanged( const QString &, const QString & ) ), - this, SLOT( slotCoverChanged( const QString &, const QString & ) ) ); - connect( CollectionDB::instance(), SIGNAL( imageFetched( const QString & ) ), - this, SLOT( slotImageChanged( const QString & ) ) ); - connect( Playlist::instance(), SIGNAL( columnsChanged() ), this, SLOT( slotUpdate() ) ); - connect( CollectionDB::instance(), SIGNAL( scoreChanged( const QString&, float ) ), - this, SLOT( slotUpdate( const QString& ) ) ); - connect( CollectionDB::instance(), SIGNAL( ratingChanged( const QString&, int ) ), - this, SLOT( slotUpdate( const QString& ) ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( coverChanged( const TQString &, const TQString & ) ), + this, TQT_SLOT( slotCoverChanged( const TQString &, const TQString & ) ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( imageFetched( const TQString & ) ), + this, TQT_SLOT( slotImageChanged( const TQString & ) ) ); + connect( Playlist::instance(), TQT_SIGNAL( columnsChanged() ), this, TQT_SLOT( slotUpdate() ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( scoreChanged( const TQString&, float ) ), + this, TQT_SLOT( slotUpdate( const TQString& ) ) ); + connect( CollectionDB::instance(), TQT_SIGNAL( ratingChanged( const TQString&, int ) ), + this, TQT_SLOT( slotUpdate( const TQString& ) ) ); // Only connect this once -- m_tags exists for the lifetime of this instance - connect( &m_tags.moodbar(), SIGNAL( jobEvent( int ) ), - SLOT( slotMoodbarEvent() ) ); + connect( &m_tags.moodbar(), TQT_SIGNAL( jobEvent( int ) ), + TQT_SLOT( slotMoodbarEvent() ) ); // This is so the moodbar can be re-rendered when AlterMood is changed - connect( App::instance(), SIGNAL( moodbarPrefs( bool, bool, int, bool ) ), - SLOT( slotMoodbarEvent() ) ); + connect( App::instance(), TQT_SIGNAL( moodbarPrefs( bool, bool, int, bool ) ), + TQT_SLOT( slotMoodbarEvent() ) ); clear(); } -void TrackToolTip::addToWidget( QWidget *widget ) +void TrackToolTip::addToWidget( TQWidget *widget ) { if( widget && !m_widgets.containsRef( widget ) ) { @@ -67,7 +67,7 @@ void TrackToolTip::addToWidget( QWidget *widget ) } } -void TrackToolTip::removeFromWidget( QWidget *widget ) +void TrackToolTip::removeFromWidget( TQWidget *widget ) { if( widget && m_widgets.containsRef( widget ) ) { @@ -84,12 +84,12 @@ void TrackToolTip::setTrack( const MetaBundle &tags, bool force ) if( force || m_tags != tags || m_tags.url() != tags.url() ) { m_haspos = false; - m_tooltip = QString::null; + m_tooltip = TQString::null; - QStringList left, right; - const QString tableRow = ""; + TQStringList left, right; + const TQString tableRow = ""; - QString filename = "", title = ""; //special case these, put the first one encountered on top + TQString filename = "", title = ""; //special case these, put the first one encountered on top Playlist *playlist = Playlist::instance(); const int n = playlist->numVisibleColumns(); @@ -102,7 +102,7 @@ void TrackToolTip::setTrack( const MetaBundle &tags, bool force ) const float score = CollectionDB::instance()->getSongPercentage( tags.url().path() ); if( score > 0.f ) { - right << QString::number( score, 'f', 2 ); // 2 digits after decimal point + right << TQString::number( score, 'f', 2 ); // 2 digits after decimal point left << playlist->columnText( column ); } } @@ -111,17 +111,17 @@ void TrackToolTip::setTrack( const MetaBundle &tags, bool force ) const int rating = CollectionDB::instance()->getSongRating( tags.url().path() ); if( rating > 0 ) { - QString s; + TQString s; for( int i = 0; i < rating / 2; ++i ) - s += QString( "" ) + s += TQString( "" ) .arg( locate( "data", "amarok/images/star.png" ) ) - .arg( QFontMetrics( QToolTip::font() ).height() ) - .arg( QFontMetrics( QToolTip::font() ).height() ); + .arg( TQFontMetrics( TQToolTip::font() ).height() ) + .arg( TQFontMetrics( TQToolTip::font() ).height() ); if( rating % 2 ) - s += QString( "" ) + s += TQString( "" ) .arg( locate( "data", "amarok/images/smallstar.png" ) ) - .arg( QFontMetrics( QToolTip::font() ).height() ) - .arg( QFontMetrics( QToolTip::font() ).height() ); + .arg( TQFontMetrics( TQToolTip::font() ).height() ) + .arg( TQFontMetrics( TQToolTip::font() ).height() ); right << s; left << playlist->columnText( column ); } @@ -149,20 +149,20 @@ void TrackToolTip::setTrack( const MetaBundle &tags, bool force ) // moodbar is saved in m_moodbarURL so we don't have // to re-save it every second. left << playlist->columnText( column ); - QString filename = ::locateLocal( "data", + TQString filename = ::locateLocal( "data", "amarok/mood_tooltip.png" ); - int height = QFontMetrics( QToolTip::font() ).height() - 2; + int height = TQFontMetrics( TQToolTip::font() ).height() - 2; if( m_moodbarURL != tags.url().url() ) { - QPixmap moodbar + TQPixmap moodbar = const_cast( tags ).moodbar().draw( MOODBAR_WIDTH, height ); moodbar.save( filename, "PNG", 100 ); m_moodbarURL = tags.url().url(); } - right << QString( "" ) + right << TQString( "" ) .arg( filename ).arg( height ).arg( MOODBAR_WIDTH ); } break; @@ -177,7 +177,7 @@ void TrackToolTip::setTrack( const MetaBundle &tags, bool force ) const int count = CollectionDB::instance()->getPlayCount( tags.url().path() ); if( count > 0 ) { - right << QString::number( count ); + right << TQString::number( count ); left << playlist->columnText( column ); } } @@ -193,7 +193,7 @@ void TrackToolTip::setTrack( const MetaBundle &tags, bool force ) title = tags.prettyText( column ); else if( column != PlaylistItem::Length ) { - const QString tag = tags.prettyText( column ); + const TQString tag = tags.prettyText( column ); if( !tag.isEmpty() ) { right << tag; @@ -229,14 +229,14 @@ void TrackToolTip::setTrack( const MetaBundle &tags, bool force ) { m_cover = CollectionDB::instance()->albumImage( tags, true, 150 ); if ( m_cover == CollectionDB::instance()->notAvailCover() ) - m_cover = QString::null; + m_cover = TQString::null; } m_tooltip += "
        %1:%2
        %1:%2
        "; if (tags.title().isEmpty() || tags.artist().isEmpty()) // no title or no artist, so we add prettyTitle - m_tooltip += QString ("") + m_tooltip += TQString ("") .arg(tags.veryNiceTitle()); for( uint x = 0; x < left.count(); ++x ) if ( !right[x].isEmpty() ) @@ -262,7 +262,7 @@ void TrackToolTip::setPos( int pos ) void TrackToolTip::clear() { m_pos = 0; - m_cover = QString::null; + m_cover = TQString::null; m_tooltip = i18n( "Amarok - rediscover your music" ); m_tags = MetaBundle(); m_tags.setUrl( KURL() ); @@ -270,24 +270,24 @@ void TrackToolTip::clear() updateWidgets(); } -QPair TrackToolTip::toolTipText( QWidget*, const QPoint& ) const +QPair TrackToolTip::toolTipText( TQWidget*, const TQPoint& ) const { - return QPair( tooltip(), QRect() ); + return QPair( tooltip(), TQRect() ); } -void TrackToolTip::slotCoverChanged( const QString &artist, const QString &album ) +void TrackToolTip::slotCoverChanged( const TQString &artist, const TQString &album ) { if( artist == m_tags.artist() && album == m_tags.album() ) { m_cover = CollectionDB::instance()->albumImage( m_tags, true, 150 ); if( m_cover == CollectionDB::instance()->notAvailCover() ) - m_cover = QString::null; + m_cover = TQString::null; updateWidgets(); } } -void TrackToolTip::slotImageChanged( const QString &remoteURL ) +void TrackToolTip::slotImageChanged( const TQString &remoteURL ) { PodcastEpisodeBundle peb; if( CollectionDB::instance()->getPodcastEpisodeBundle( m_tags.url().url(), &peb ) ) @@ -299,7 +299,7 @@ void TrackToolTip::slotImageChanged( const QString &remoteURL ) { m_cover = CollectionDB::instance()->podcastImage( remoteURL ); if( m_cover == CollectionDB::instance()->notAvailCover() ) - m_cover = QString::null; + m_cover = TQString::null; updateWidgets(); } @@ -308,7 +308,7 @@ void TrackToolTip::slotImageChanged( const QString &remoteURL ) } } -void TrackToolTip::slotUpdate( const QString &url ) +void TrackToolTip::slotUpdate( const TQString &url ) { if( url.isNull() || url == m_tags.url().path() ) setTrack( m_tags, true ); @@ -318,7 +318,7 @@ void TrackToolTip::slotMoodbarEvent( void ) { // Clear this so the moodbar gets redrawn - m_moodbarURL = QString::null; + m_moodbarURL = TQString::null; // Reset the moodbar in case AlterMood has changed m_tags.moodbar().reset(); @@ -326,13 +326,13 @@ TrackToolTip::slotMoodbarEvent( void ) } -QString TrackToolTip::tooltip() const +TQString TrackToolTip::tooltip() const { - QString tip = m_tooltip;; + TQString tip = m_tooltip;; if( !m_tags.isEmpty() ) { if( !m_cover.isEmpty() ) - tip = tip.arg( QString( "
        %1
        %1
        " ).arg( m_cover ) ); else diff --git a/amarok/src/tracktooltip.h b/amarok/src/tracktooltip.h index 8b35b41d..196b8a41 100644 --- a/amarok/src/tracktooltip.h +++ b/amarok/src/tracktooltip.h @@ -6,7 +6,7 @@ */ /* - tracktooltip.h - Provides an interface to a plain QWidget, which is independent of KDE (bypassed to X11) + tracktooltip.h - Provides an interface to a plain TQWidget, which is independent of KDE (bypassed to X11) begin: Tue 10 Feb 2004 copyright: (C) 2004 by Christian Muehlhaeuser email: chris@chris.de @@ -15,15 +15,15 @@ #ifndef TRACKTOOLTIP_H #define TRACKTOOLTIP_H -#include -#include +#include +#include #include #include "tooltip.h" -class QWidget; +class TQWidget; -class TrackToolTip: public QObject, public Amarok::ToolTipClient +class TrackToolTip: public TQObject, public Amarok::ToolTipClient { Q_OBJECT @@ -31,34 +31,34 @@ class TrackToolTip: public QObject, public Amarok::ToolTipClient TrackToolTip(); static TrackToolTip* instance(); - void addToWidget( QWidget *widget ); - void removeFromWidget( QWidget *widget ); + void addToWidget( TQWidget *widget ); + void removeFromWidget( TQWidget *widget ); void setTrack( const MetaBundle &tags, bool force = false ); void setPos( int pos ); void clear(); public: - virtual QPair toolTipText( QWidget*, const QPoint& ) const; + virtual QPair toolTipText( TQWidget*, const TQPoint& ) const; private slots: - void slotCoverChanged( const QString &artist, const QString &album ); - void slotImageChanged( const QString &remoteURL ); - void slotUpdate( const QString &url = QString::null ); + void slotCoverChanged( const TQString &artist, const TQString &album ); + void slotImageChanged( const TQString &remoteURL ); + void slotUpdate( const TQString &url = TQString::null ); void slotMoodbarEvent( void ); private: - QString tooltip() const; + TQString tooltip() const; void updateWidgets(); static TrackToolTip *s_instance; - QPtrList m_widgets; + TQPtrList m_widgets; MetaBundle m_tags; int m_pos; - QString m_cover; - QString m_tooltip; + TQString m_cover; + TQString m_tooltip; bool m_haspos; - QString m_moodbarURL; + TQString m_moodbarURL; }; #endif diff --git a/amarok/src/transferdialog.cpp b/amarok/src/transferdialog.cpp index 65bf8971..27d346d3 100644 --- a/amarok/src/transferdialog.cpp +++ b/amarok/src/transferdialog.cpp @@ -14,11 +14,11 @@ #include "mediabrowser.h" #include "transferdialog.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -28,7 +28,7 @@ #include TransferDialog::TransferDialog( MediaDevice *mdev ) - : KDialogBase( Amarok::mainWindow(), "transferdialog", true, QString::null, Ok|Cancel, Ok ) + : KDialogBase( Amarok::mainWindow(), "transferdialog", true, TQString::null, Ok|Cancel, Ok ) { m_dev = mdev; m_accepted = false; @@ -37,35 +37,35 @@ TransferDialog::TransferDialog( MediaDevice *mdev ) kapp->setTopWidget( this ); setCaption( kapp->makeStdCaption( i18n( "Transfer Queue to Device" ) ) ); - QVBox* vbox = makeVBoxMainWidget(); + TQVBox* vbox = makeVBoxMainWidget(); vbox->setSpacing( KDialog::spacingHint() ); - QString transferDir = mdev->getTransferDir(); + TQString transferDir = mdev->getTransferDir(); - QGroupBox *location = new QGroupBox( 1, Qt::Vertical, i18n( "Music Location" ), vbox ); + TQGroupBox *location = new TQGroupBox( 1, Qt::Vertical, i18n( "Music Location" ), vbox ); - new QLabel( i18n( "Your music will be transferred to:\n%1" ) + new TQLabel( i18n( "Your music will be transferred to:\n%1" ) .arg( transferDir ), location ); - QVBox *vbox2 = new QVBox( vbox ); - QSpacerItem *spacer = new QSpacerItem( 0, 25 ); - QLayout *vlayout = vbox2->layout(); + TQVBox *vbox2 = new TQVBox( vbox ); + TQSpacerItem *spacer = new TQSpacerItem( 0, 25 ); + TQLayout *vlayout = vbox2->layout(); if( vlayout ) vlayout->addItem( spacer ); - new QLabel( i18n( "You can have your music automatically grouped in\n" + new TQLabel( i18n( "You can have your music automatically grouped in\n" "a variety of ways. Each grouping will create\n" "directories based upon the specified criteria.\n"), vbox ); - QGroupBox *sorting = new QGroupBox( 6, Qt::Vertical, i18n( "Groupings" ), vbox ); - m_label1 = new QLabel( i18n( "Select first grouping:\n" ), sorting ); + TQGroupBox *sorting = new TQGroupBox( 6, Qt::Vertical, i18n( "Groupings" ), vbox ); + m_label1 = new TQLabel( i18n( "Select first grouping:\n" ), sorting ); m_sort1 = new KComboBox( sorting ); - m_label2 = new QLabel( i18n( "Select second grouping:\n" ), sorting ); + m_label2 = new TQLabel( i18n( "Select second grouping:\n" ), sorting ); m_sort2 = new KComboBox( sorting ); - m_label3 = new QLabel( i18n( "Select third grouping:\n" ), sorting ); + m_label3 = new TQLabel( i18n( "Select third grouping:\n" ), sorting ); m_sort3 = new KComboBox( sorting ); - m_combolist = new QPtrList(); + m_combolist = new TQPtrList(); m_combolist->append( m_sort1 ); m_combolist->append( m_sort2 ); m_combolist->append( m_sort3 ); @@ -89,21 +89,21 @@ TransferDialog::TransferDialog( MediaDevice *mdev ) m_label3->setDisabled( m_sort2->currentItem() == 0 ); m_sort3->setDisabled( m_sort2->currentItem() == 0 ); - connect( m_sort1, SIGNAL( activated(int) ), SLOT( sort1_activated(int)) ); - connect( m_sort2, SIGNAL( activated(int) ), SLOT( sort2_activated(int)) ); + connect( m_sort1, TQT_SIGNAL( activated(int) ), TQT_SLOT( sort1_activated(int)) ); + connect( m_sort2, TQT_SIGNAL( activated(int) ), TQT_SLOT( sort2_activated(int)) ); - QVBox *vbox3 = new QVBox( vbox ); - QSpacerItem *spacer2 = new QSpacerItem( 0, 25 ); - QLayout *vlayout2 = vbox3->layout(); + TQVBox *vbox3 = new TQVBox( vbox ); + TQSpacerItem *spacer2 = new TQSpacerItem( 0, 25 ); + TQLayout *vlayout2 = vbox3->layout(); if( vlayout2 ) vlayout2->addItem( spacer2 ); - QGroupBox *options = new QGroupBox( 6, Qt::Vertical, i18n( "Options" ), vbox ); + TQGroupBox *options = new TQGroupBox( 6, Qt::Vertical, i18n( "Options" ), vbox ); - QCheckBox *convertSpaces = new QCheckBox( i18n( "Convert spaces to underscores" ), options ); + TQCheckBox *convertSpaces = new TQCheckBox( i18n( "Convert spaces to underscores" ), options ); convertSpaces->setChecked( mdev->getSpacesToUnderscores() ); - connect( convertSpaces, SIGNAL( toggled(bool) ), this, SLOT( convertSpaces_toggled(bool) ) ); + connect( convertSpaces, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT( convertSpaces_toggled(bool) ) ); } void diff --git a/amarok/src/transferdialog.h b/amarok/src/transferdialog.h index 57a14d1e..d9a5c03f 100644 --- a/amarok/src/transferdialog.h +++ b/amarok/src/transferdialog.h @@ -15,9 +15,9 @@ #include "mediabrowser.h" #include "amarok_export.h" -#include -#include -#include +#include +#include +#include #include class KComboBox; @@ -49,10 +49,10 @@ class LIBAMAROK_EXPORT TransferDialog : public KDialogBase KComboBox *m_sort1; KComboBox *m_sort2; KComboBox *m_sort3; - QLabel *m_label1; - QLabel *m_label2; - QLabel *m_label3; - QPtrList *m_combolist; + TQLabel *m_label1; + TQLabel *m_label2; + TQLabel *m_label3; + TQPtrList *m_combolist; int m_sort1LastIndex; int m_sort2LastIndex; }; diff --git a/amarok/src/xmlloader.cpp b/amarok/src/xmlloader.cpp index 4d945cda..5793e9de 100644 --- a/amarok/src/xmlloader.cpp +++ b/amarok/src/xmlloader.cpp @@ -18,7 +18,7 @@ */ -#include +#include #include "xmlloader.h" #include "xmlloader_p.h" @@ -32,7 +32,7 @@ MetaBundle::XmlLoader::XmlLoader(): m_aborted( false ), m_target( 0 ) MetaBundle::XmlLoader::~XmlLoader() {} -bool MetaBundle::XmlLoader::load( QXmlInputSource *source, QObject *target ) +bool MetaBundle::XmlLoader::load( TQXmlInputSource *source, TQObject *target ) { m_target = target; return m_reader.parse( source, false ); @@ -43,22 +43,22 @@ void MetaBundle::XmlLoader::abort() m_aborted = true; } -QString MetaBundle::XmlLoader::lastError() const +TQString MetaBundle::XmlLoader::lastError() const { return m_lastError; } -BundleList MetaBundle::XmlLoader::loadBundles( QXmlInputSource *source, bool *ok ) //static +BundleList MetaBundle::XmlLoader::loadBundles( TQXmlInputSource *source, bool *ok ) //static { return SimpleLoader( source, ok ).bundles; } -void MetaBundle::XmlLoader::loadInThread( QXmlInputSource *source, QObject *target ) //static +void MetaBundle::XmlLoader::loadInThread( TQXmlInputSource *source, TQObject *target ) //static { ( new ThreadedLoader( source, target ) )->start(); } -void MetaBundle::XmlLoader::newAttribute( const QString &key, const QString &value ) +void MetaBundle::XmlLoader::newAttribute( const TQString &key, const TQString &value ) { if( key == "url" ) m_bundle.setUrl( value ); @@ -67,10 +67,10 @@ void MetaBundle::XmlLoader::newAttribute( const QString &key, const QString &val else if( key == "compilation" ) m_bundle.setCompilation( MetaBundle::CompilationYes ); else - m_attributes << QPair( key, value ); + m_attributes << QPair( key, value ); } -void MetaBundle::XmlLoader::newTag( const QString &name, const QString &value ) +void MetaBundle::XmlLoader::newTag( const TQString &name, const TQString &value ) { static int start = 0; //most of the time, the columns should be in order for( int i = start; i < NUM_COLUMNS; ++i ) @@ -142,21 +142,21 @@ void MetaBundle::XmlLoader::bundleLoaded() if( m_target ) { BundleLoadedEvent e( m_bundle, m_attributes ); - QApplication::sendEvent( m_target, &e ); + TQApplication::sendEvent( m_target, &e ); } } -void MetaBundle::XmlLoader::errorEncountered( const QString &, int, int ) +void MetaBundle::XmlLoader::errorEncountered( const TQString &, int, int ) { emit error( m_lastError ); if( m_target ) { BundleLoadedEvent e( m_lastError ); - QApplication::sendEvent( m_target, &e ); + TQApplication::sendEvent( m_target, &e ); } } -bool MetaBundle::XmlLoader::startElement( const QString &, const QString &localName, const QString &, const QXmlAttributes &atts ) +bool MetaBundle::XmlLoader::startElement( const TQString &, const TQString &localName, const TQString &, const TQXmlAttributes &atts ) { if( localName == "item" ) { @@ -165,7 +165,7 @@ bool MetaBundle::XmlLoader::startElement( const QString &, const QString &localN for( int i = 0, n = atts.count(); i < n; ++i ) newAttribute( atts.localName( i ), atts.value( i ) ); - m_currentElement = QString::null; + m_currentElement = TQString::null; } else m_currentElement = localName; @@ -173,7 +173,7 @@ bool MetaBundle::XmlLoader::startElement( const QString &, const QString &localN return true; } -bool MetaBundle::XmlLoader::endElement( const QString &, const QString &localName, const QString & ) +bool MetaBundle::XmlLoader::endElement( const TQString &, const TQString &localName, const TQString & ) { if( localName == "item" ) { @@ -184,12 +184,12 @@ bool MetaBundle::XmlLoader::endElement( const QString &, const QString &localNam return false; } - m_currentElement = QString::null; + m_currentElement = TQString::null; return true; } -bool MetaBundle::XmlLoader::characters( const QString &ch ) +bool MetaBundle::XmlLoader::characters( const TQString &ch ) { if( m_currentElement.isNull() ) return true; @@ -207,13 +207,13 @@ bool MetaBundle::XmlLoader::endDocument() return !m_aborted; } -bool MetaBundle::XmlLoader::fatalError( const QXmlParseException &e ) +bool MetaBundle::XmlLoader::fatalError( const TQXmlParseException &e ) { if( !m_bundle.isEmpty() ) bundleLoaded(); - m_lastError = QString( "Error loading XML: \"%1\", at line %2, column %3." ) - .arg( e.message(), QString::number( e.lineNumber() ), QString::number( e.columnNumber() ) ); + m_lastError = TQString( "Error loading XML: \"%1\", at line %2, column %3." ) + .arg( e.message(), TQString::number( e.lineNumber() ), TQString::number( e.columnNumber() ) ); errorEncountered( e.message(), e.lineNumber(), e.columnNumber() ); return false; diff --git a/amarok/src/xmlloader.h b/amarok/src/xmlloader.h index c82b31d6..f85db8bc 100644 --- a/amarok/src/xmlloader.h +++ b/amarok/src/xmlloader.h @@ -21,9 +21,9 @@ #ifndef AMAROK_XML_LOADER_H #define AMAROK_XML_LOADER_H -#include -#include -#include +#include +#include +#include #include "metabundle.h" /** @@ -44,10 +44,10 @@ */ /** The type used for extra XML attributes not recognized. */ -typedef QValueList< QPair > XmlAttributeList; +typedef TQValueList< QPair > XmlAttributeList; -class MetaBundle::XmlLoader: public QObject, public QXmlDefaultHandler +class MetaBundle::XmlLoader: public TQObject, public QXmlDefaultHandler { Q_OBJECT public: @@ -56,25 +56,25 @@ class MetaBundle::XmlLoader: public QObject, public QXmlDefaultHandler { public: /** The type() of BundleLoadedEvents. */ - static const int Type = QEvent::User + 127; + static const int Type = TQEvent::User + 127; /** Whether an error occurred. If yes, both bundle and extraAttributes are empty. */ bool error; /** A description of the error, if there was one. */ - QString errorMessage; + TQString errorMessage; /** The loaded bundle. */ MetaBundle bundle; /** Any extra attributes not recognized. */ - QValueList< QPair > extraAttributes; + TQValueList< QPair > extraAttributes; public: BundleLoadedEvent( const MetaBundle &b, const XmlAttributeList &a ) - : QCustomEvent( Type ), error( false ), bundle( b ), extraAttributes( a ) { } - BundleLoadedEvent( const QString &error ) - : QCustomEvent( Type ), error( true ), errorMessage( error ) { } + : TQCustomEvent( Type ), error( false ), bundle( b ), extraAttributes( a ) { } + BundleLoadedEvent( const TQString &error ) + : TQCustomEvent( Type ), error( true ), errorMessage( error ) { } }; public: @@ -98,13 +98,13 @@ class MetaBundle::XmlLoader: public QObject, public QXmlDefaultHandler * @see newBundle * @see BundleLoadedEvent */ - bool load( QXmlInputSource *source, QObject *target = 0 ); + bool load( TQXmlInputSource *source, TQObject *target = 0 ); /** Aborts loading. */ void abort(); /** Returns the last error encountered; empty if there hasn't been an error. */ - QString lastError() const; + TQString lastError() const; /** * Load bundles from \p source. If a fatal error occurs, processing @@ -115,7 +115,7 @@ class MetaBundle::XmlLoader: public QObject, public QXmlDefaultHandler and to true otherwise * @return the list of loaded bundles */ - static BundleList loadBundles( QXmlInputSource *source, bool *ok = 0 ); + static BundleList loadBundles( TQXmlInputSource *source, bool *ok = 0 ); /** * Load bundles from \p source in a separate thread. The loaded bundles @@ -127,7 +127,7 @@ class MetaBundle::XmlLoader: public QObject, public QXmlDefaultHandler * @param target the object to post BundleLoadedEvents to * @see BundleLoadedEvent */ - static void loadInThread( QXmlInputSource *source, QObject *target ); + static void loadInThread( TQXmlInputSource *source, TQObject *target ); signals: /** @@ -138,13 +138,13 @@ class MetaBundle::XmlLoader: public QObject, public QXmlDefaultHandler void newBundle( const MetaBundle &bundle, const XmlAttributeList &extraAttributes ); /** Emitted when an error occurs. */ - void error( const QString &errorMessage ); + void error( const TQString &errorMessage ); protected: - virtual void newAttribute( const QString &key, const QString &value ); - virtual void newTag( const QString &name, const QString &value ); + virtual void newAttribute( const TQString &key, const TQString &value ); + virtual void newTag( const TQString &name, const TQString &value ); virtual void bundleLoaded(); - virtual void errorEncountered( const QString &message, int line, int column ); + virtual void errorEncountered( const TQString &message, int line, int column ); protected: /** The bundle currently being loaded. */ @@ -154,22 +154,22 @@ class MetaBundle::XmlLoader: public QObject, public QXmlDefaultHandler XmlAttributeList m_attributes; /** The message from the last error encountered, empty if there hasn't been an error. */ - QString m_lastError; + TQString m_lastError; /** Whether we have been abort()ed. */ bool m_aborted; private: - QXmlSimpleReader m_reader; - QString m_currentElement; - QObject *m_target; + TQXmlSimpleReader m_reader; + TQString m_currentElement; + TQObject *m_target; protected: - virtual bool startElement( const QString&, const QString&, const QString &, const QXmlAttributes& ); - virtual bool endElement( const QString &namespaceURI, const QString &localName, const QString &qName ); - virtual bool characters( const QString &ch ); + virtual bool startElement( const TQString&, const TQString&, const TQString &, const TQXmlAttributes& ); + virtual bool endElement( const TQString &namespaceURI, const TQString &localName, const TQString &qName ); + virtual bool characters( const TQString &ch ); virtual bool endDocument(); - virtual bool fatalError( const QXmlParseException &exception ); + virtual bool fatalError( const TQXmlParseException &exception ); public: //fucking moc, these should be private class ThreadedLoader; diff --git a/amarok/src/xmlloader_p.h b/amarok/src/xmlloader_p.h index d9baca9e..925676bc 100644 --- a/amarok/src/xmlloader_p.h +++ b/amarok/src/xmlloader_p.h @@ -20,34 +20,34 @@ #ifndef AMAROK_XMLLOADER_P_H #define AMAROK_XMLLOADER_P_H -#include -#include +#include +#include -class MetaBundle::XmlLoader::ThreadedLoader: public QObject, public QThread +class MetaBundle::XmlLoader::ThreadedLoader: public TQObject, public QThread { Q_OBJECT - QObject *m_target; - QXmlInputSource *m_source; + TQObject *m_target; + TQXmlInputSource *m_source; private slots: void bundleLoaded( const MetaBundle &bundle, const XmlAttributeList &attributes ) { - QApplication::postEvent( m_target, new BundleLoadedEvent( bundle, attributes ) ); + TQApplication::postEvent( m_target, new BundleLoadedEvent( bundle, attributes ) ); } public: - ThreadedLoader( QXmlInputSource *source, QObject *target ): m_target( target ), m_source( source ) { } + ThreadedLoader( TQXmlInputSource *source, TQObject *target ): m_target( target ), m_source( source ) { } protected: virtual void run() { { XmlLoader loader; - connect( &loader, SIGNAL( newBundle( const MetaBundle&, const XmlAttributeList& ) ), - this, SLOT( bundleLoaded( const MetaBundle&, const XmlAttributeList& ) ) ); + connect( &loader, TQT_SIGNAL( newBundle( const MetaBundle&, const XmlAttributeList& ) ), + this, TQT_SLOT( bundleLoaded( const MetaBundle&, const XmlAttributeList& ) ) ); bool success = loader.load( m_source ); if( !success ) - QApplication::postEvent( m_target, new BundleLoadedEvent( loader.m_lastError ) ); + TQApplication::postEvent( m_target, new BundleLoadedEvent( loader.m_lastError ) ); } delete this; @@ -61,11 +61,11 @@ class MetaBundle::XmlLoader::SimpleLoader: public QObject public: BundleList bundles; - SimpleLoader( QXmlInputSource *source, bool *ok ) + SimpleLoader( TQXmlInputSource *source, bool *ok ) { XmlLoader loader; - connect( &loader, SIGNAL( newBundle( const MetaBundle&, const XmlAttributeList& ) ), - this, SLOT( bundleLoaded( const MetaBundle&, const XmlAttributeList& ) ) ); + connect( &loader, TQT_SIGNAL( newBundle( const MetaBundle&, const XmlAttributeList& ) ), + this, TQT_SLOT( bundleLoaded( const MetaBundle&, const XmlAttributeList& ) ) ); const bool success = loader.load( source ); if( ok ) (*ok) = success; diff --git a/amarok/src/xspfplaylist.cpp b/amarok/src/xspfplaylist.cpp index a991eb4f..beb1f388 100644 --- a/amarok/src/xspfplaylist.cpp +++ b/amarok/src/xspfplaylist.cpp @@ -8,7 +8,7 @@ XSPFPlaylist::XSPFPlaylist( ) { - QDomElement root = createElement( "playlist" ); + TQDomElement root = createElement( "playlist" ); root.setAttribute( "version", 1 ); root.setAttribute( "xmlns", "http://xspf.org/ns/0/" ); @@ -18,17 +18,17 @@ XSPFPlaylist::XSPFPlaylist( ) appendChild( root ); } -XSPFPlaylist::XSPFPlaylist( QTextStream &stream ) +XSPFPlaylist::XSPFPlaylist( TQTextStream &stream ) { loadXSPF( stream ); } bool -XSPFPlaylist::loadXSPF( QTextStream &stream ) +XSPFPlaylist::loadXSPF( TQTextStream &stream ) { - QString errorMsg; + TQString errorMsg; int errorLine, errorColumn; - stream.setEncoding( QTextStream::UnicodeUTF8 ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); if (!setContent(stream.read(), &errorMsg, &errorLine, &errorColumn)) { debug() << "[XSPFPlaylist]: Error loading xml file: " "(" << errorMsg << ")" @@ -84,7 +84,7 @@ XSPFPlaylist::image() QDateTime XSPFPlaylist::date() { - return QDateTime::fromString( documentElement().namedItem( "date" ).firstChild().nodeValue(), Qt::ISODate ); + return TQDateTime::fromString( documentElement().namedItem( "date" ).firstChild().nodeValue(), Qt::ISODate ); } KURL @@ -96,7 +96,7 @@ XSPFPlaylist::license() KURL::List XSPFPlaylist::attribution() { - QDomNode node = documentElement().namedItem( "attribution" ); + TQDomNode node = documentElement().namedItem( "attribution" ); KURL::List list; while ( !node.isNull() ) @@ -119,12 +119,12 @@ XSPFPlaylist::link() } void -XSPFPlaylist::setTitle( QString title ) +XSPFPlaylist::setTitle( TQString title ) { if ( documentElement().namedItem( "title" ).isNull() ) { - QDomNode node = createElement( "title" ); - QDomNode subNode = createTextNode( title ); + TQDomNode node = createElement( "title" ); + TQDomNode subNode = createTextNode( title ); node.appendChild( subNode ); documentElement().insertBefore( node, documentElement().namedItem( "trackList" ) ); } @@ -133,12 +133,12 @@ XSPFPlaylist::setTitle( QString title ) } void -XSPFPlaylist::setCreator( QString creator ) +XSPFPlaylist::setCreator( TQString creator ) { if ( documentElement().namedItem( "creator" ).isNull() ) { - QDomNode node = createElement( "creator" ); - QDomNode subNode = createTextNode( creator ); + TQDomNode node = createElement( "creator" ); + TQDomNode subNode = createTextNode( creator ); node.appendChild( subNode ); documentElement().insertBefore( node, documentElement().namedItem( "trackList" ) ); } @@ -147,12 +147,12 @@ XSPFPlaylist::setCreator( QString creator ) } void -XSPFPlaylist::setAnnotation( QString annotation ) +XSPFPlaylist::setAnnotation( TQString annotation ) { if ( documentElement().namedItem( "annotation" ).isNull() ) { - QDomNode node = createElement( "annotation" ); - QDomNode subNode = createTextNode( annotation ); + TQDomNode node = createElement( "annotation" ); + TQDomNode subNode = createTextNode( annotation ); node.appendChild( subNode ); documentElement().insertBefore( node, documentElement().namedItem( "trackList" ) ); } @@ -165,8 +165,8 @@ XSPFPlaylist::setInfo( KURL info ) { if ( documentElement().namedItem( "info" ).isNull() ) { - QDomNode node = createElement( "info" ); - QDomNode subNode = createTextNode( info.url() ); + TQDomNode node = createElement( "info" ); + TQDomNode subNode = createTextNode( info.url() ); node.appendChild( subNode ); documentElement().insertBefore( node, documentElement().namedItem( "trackList" ) ); } @@ -179,8 +179,8 @@ XSPFPlaylist::setLocation( KURL location ) { if ( documentElement().namedItem( "location" ).isNull() ) { - QDomNode node = createElement( "location" ); - QDomNode subNode = createTextNode( location.url() ); + TQDomNode node = createElement( "location" ); + TQDomNode subNode = createTextNode( location.url() ); node.appendChild( subNode ); documentElement().insertBefore( node, documentElement().namedItem( "trackList" ) ); } @@ -189,12 +189,12 @@ XSPFPlaylist::setLocation( KURL location ) } void -XSPFPlaylist::setIdentifier( QString identifier ) +XSPFPlaylist::setIdentifier( TQString identifier ) { if ( documentElement().namedItem( "identifier" ).isNull() ) { - QDomNode node = createElement( "identifier" ); - QDomNode subNode = createTextNode( identifier ); + TQDomNode node = createElement( "identifier" ); + TQDomNode subNode = createTextNode( identifier ); node.appendChild( subNode ); documentElement().insertBefore( node, documentElement().namedItem( "trackList" ) ); } @@ -207,8 +207,8 @@ XSPFPlaylist::setImage( KURL image ) { if ( documentElement().namedItem( "image" ).isNull() ) { - QDomNode node = createElement( "image" ); - QDomNode subNode = createTextNode( image.url() ); + TQDomNode node = createElement( "image" ); + TQDomNode subNode = createTextNode( image.url() ); node.appendChild( subNode ); documentElement().insertBefore( node, documentElement().namedItem( "trackList" ) ); } @@ -217,15 +217,15 @@ XSPFPlaylist::setImage( KURL image ) } void -XSPFPlaylist::setDate( QDateTime date ) +XSPFPlaylist::setDate( TQDateTime date ) { /* date needs timezone info to be compliant with the standard (ex. 2005-01-08T17:10:47-05:00 ) */ if ( documentElement().namedItem( "date" ).isNull() ) { - QDomNode node = createElement( "date" ); - QDomNode subNode = createTextNode( date.toString( "yyyy-MM-ddThh:mm:ss" ) ); + TQDomNode node = createElement( "date" ); + TQDomNode subNode = createTextNode( date.toString( "yyyy-MM-ddThh:mm:ss" ) ); node.appendChild( subNode ); documentElement().insertBefore( node, documentElement().namedItem( "trackList" ) ); } @@ -238,8 +238,8 @@ XSPFPlaylist::setLicense( KURL license ) { if ( documentElement().namedItem( "license" ).isNull() ) { - QDomNode node = createElement( "license" ); - QDomNode subNode = createTextNode( license.url() ); + TQDomNode node = createElement( "license" ); + TQDomNode subNode = createTextNode( license.url() ); node.appendChild( subNode ); documentElement().insertBefore( node, documentElement().namedItem( "trackList" ) ); } @@ -255,16 +255,16 @@ XSPFPlaylist::setAttribution( KURL attribution, bool append ) if ( append ) { - QDomNode subNode = createElement( "location" ); - QDomNode subSubNode = createTextNode( attribution.url() ); + TQDomNode subNode = createElement( "location" ); + TQDomNode subSubNode = createTextNode( attribution.url() ); subNode.appendChild( subSubNode ); documentElement().namedItem( "attribution" ).insertBefore( subNode, documentElement().namedItem( "attribution" ).firstChild() ); } else { - QDomNode node = createElement( "attribution" ); - QDomNode subNode = createElement( "location" ); - QDomNode subSubNode = createTextNode( attribution.url() ); + TQDomNode node = createElement( "attribution" ); + TQDomNode subNode = createElement( "location" ); + TQDomNode subSubNode = createTextNode( attribution.url() ); subNode.appendChild( subSubNode ); node.appendChild( subNode ); documentElement().replaceChild( node, documentElement().namedItem( "attribution" ) ); @@ -276,8 +276,8 @@ XSPFPlaylist::setLink( KURL link ) { if ( documentElement().namedItem( "link" ).isNull() ) { - QDomNode node = createElement( "link" ); - QDomNode subNode = createTextNode( link.url() ); + TQDomNode node = createElement( "link" ); + TQDomNode subNode = createTextNode( link.url() ); node.appendChild( subNode ); documentElement().insertBefore( node, documentElement().namedItem( "trackList" ) ); } @@ -291,9 +291,9 @@ XSPFPlaylist::trackList() { XSPFtrackList list; - QDomNode trackList = documentElement().namedItem( "trackList" ); - QDomNode subNode = trackList.firstChild(); - QDomNode subSubNode; + TQDomNode trackList = documentElement().namedItem( "trackList" ); + TQDomNode subNode = trackList.firstChild(); + TQDomNode subSubNode; while ( !subNode.isNull() ) { @@ -342,7 +342,7 @@ XSPFPlaylist::setTrackList( XSPFtrackList trackList, bool append ) if ( documentElement().namedItem( "trackList" ).isNull() ) documentElement().appendChild( createElement( "trackList" ) ); - QDomNode node = createElement( "trackList" ); + TQDomNode node = createElement( "trackList" ); XSPFtrackList::iterator it; @@ -350,21 +350,21 @@ XSPFPlaylist::setTrackList( XSPFtrackList trackList, bool append ) { XSPFtrack track = (*it); - QDomNode subNode = createElement( "track" ); - - QDomNode location = createElement( "location" ); - QDomNode identifier = createElement( "identifier" ); - QDomNode title = createElement( "title" ); - QDomNode creator = createElement( "creator" ); - QDomNode annotation = createElement( "annotation" ); - QDomNode info = createElement( "info" ); - QDomNode image = createElement( "image" ); - QDomNode album = createElement( "album" ); - QDomNode trackNum = createElement( "trackNum" ); - QDomNode duration = createElement( "duration" ); - QDomNode link = createElement( "link" ); - // QDomNode meta - // QDomNode extension + TQDomNode subNode = createElement( "track" ); + + TQDomNode location = createElement( "location" ); + TQDomNode identifier = createElement( "identifier" ); + TQDomNode title = createElement( "title" ); + TQDomNode creator = createElement( "creator" ); + TQDomNode annotation = createElement( "annotation" ); + TQDomNode info = createElement( "info" ); + TQDomNode image = createElement( "image" ); + TQDomNode album = createElement( "album" ); + TQDomNode trackNum = createElement( "trackNum" ); + TQDomNode duration = createElement( "duration" ); + TQDomNode link = createElement( "link" ); + // TQDomNode meta + // TQDomNode extension if ( !track.location.url().isNull() ) location.appendChild( createTextNode( track.location.url() ) ); @@ -383,9 +383,9 @@ XSPFPlaylist::setTrackList( XSPFtrackList trackList, bool append ) if ( !track.album.isNull() ) album.appendChild( createTextNode( track.album ) ); if ( track.trackNum > 0 ) - trackNum.appendChild( createTextNode( QString::number( track.trackNum ) ) ); + trackNum.appendChild( createTextNode( TQString::number( track.trackNum ) ) ); if ( track.duration > 0 ) - duration.appendChild( createTextNode( QString::number( track.duration ) ) ); + duration.appendChild( createTextNode( TQString::number( track.duration ) ) ); if ( !track.link.url().isNull() ) link.appendChild( createTextNode( track.link.url() ) ); diff --git a/amarok/src/xspfplaylist.h b/amarok/src/xspfplaylist.h index b419f234..48cb815d 100644 --- a/amarok/src/xspfplaylist.h +++ b/amarok/src/xspfplaylist.h @@ -7,12 +7,12 @@ class AtomicString; -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include @@ -23,10 +23,10 @@ class AtomicString; typedef struct { KURL location; - QString identifier; - QString title; + TQString identifier; + TQString title; AtomicString creator; - QString annotation; + TQString annotation; KURL info; KURL image; AtomicString album; @@ -37,38 +37,38 @@ typedef struct { // extension } XSPFtrack; -typedef QValueList < XSPFtrack > XSPFtrackList; +typedef TQValueList < XSPFtrack > XSPFtrackList; class XSPFPlaylist : public QDomDocument { public: XSPFPlaylist(); - XSPFPlaylist( QTextStream &stream ); + XSPFPlaylist( TQTextStream &stream ); public: /* convenience functions */ - QString title(); - QString creator(); - QString annotation(); + TQString title(); + TQString creator(); + TQString annotation(); KURL info(); KURL location(); - QString identifier(); + TQString identifier(); KURL image(); - QDateTime date(); + TQDateTime date(); KURL license(); KURL::List attribution(); KURL link(); // meta(); // extension(); - void setTitle( QString title ); - void setCreator( QString creator ); - void setAnnotation( QString annotation ); + void setTitle( TQString title ); + void setCreator( TQString creator ); + void setAnnotation( TQString annotation ); void setInfo( KURL info ); void setLocation( KURL location ); - void setIdentifier( QString identifier ); + void setIdentifier( TQString identifier ); void setImage( KURL image ); - void setDate( QDateTime date ); + void setDate( TQDateTime date ); void setLicense( KURL license ); void setAttribution( KURL attribution, bool append = true ); void setLink( KURL link ); @@ -80,7 +80,7 @@ public: private: - bool loadXSPF( QTextStream& ); + bool loadXSPF( TQTextStream& ); }; #endif // XSPFPlaylist_H
        " + tip = tip.arg( TQString( "
        " "" "