From 3a09386ad170dafdce88c5dcd70275cc7d4081e9 Mon Sep 17 00:00:00 2001 From: tpearson Date: Fri, 20 Aug 2010 06:53:52 +0000 Subject: [PATCH] Initial TQt conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/amarok@1165727 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- amarok/src/Options1.ui.h | 20 +- amarok/src/Options2.ui.h | 38 +- amarok/src/Options5.ui.h | 44 +- amarok/src/Options8.ui.h | 2 +- amarok/src/actionclasses.cpp | 106 +- amarok/src/actionclasses.h | 40 +- amarok/src/amarok.h | 90 +- amarok/src/amarokcore/amarokdcophandler.cpp | 212 +- amarok/src/amarokcore/amarokdcophandler.h | 148 +- amarok/src/amarokcore/amarokdcopiface.h | 132 +- amarok/src/amarokcore/crashhandler.cpp | 90 +- amarok/src/analyzers/analyzerbase.cpp | 38 +- amarok/src/analyzers/analyzerbase.h | 54 +- amarok/src/analyzers/analyzerfactory.cpp | 18 +- amarok/src/analyzers/baranalyzer.cpp | 18 +- amarok/src/analyzers/baranalyzer.h | 14 +- amarok/src/analyzers/blockanalyzer.cpp | 62 +- amarok/src/analyzers/blockanalyzer.h | 24 +- amarok/src/analyzers/boomanalyzer.cpp | 44 +- amarok/src/analyzers/boomanalyzer.h | 12 +- amarok/src/analyzers/glanalyzer.cpp | 2 +- amarok/src/analyzers/glanalyzer.h | 2 +- amarok/src/analyzers/glanalyzer2.cpp | 10 +- amarok/src/analyzers/glanalyzer2.h | 8 +- amarok/src/analyzers/glanalyzer3.cpp | 10 +- amarok/src/analyzers/glanalyzer3.h | 12 +- amarok/src/analyzers/sonogram.cpp | 12 +- amarok/src/analyzers/sonogram.h | 4 +- amarok/src/analyzers/turbine.cpp | 4 +- amarok/src/analyzers/turbine.h | 2 +- amarok/src/app.cpp | 366 ++-- amarok/src/app.h | 4 +- amarok/src/atomicstring.cpp | 30 +- amarok/src/atomicstring.h | 38 +- amarok/src/atomicstring_unittest.cpp | 10 +- amarok/src/atomicurl.cpp | 20 +- amarok/src/atomicurl.h | 16 +- amarok/src/browserToolBar.h | 2 +- amarok/src/browserbar.cpp | 98 +- amarok/src/browserbar.h | 54 +- amarok/src/clicklineedit.cpp | 26 +- amarok/src/clicklineedit.h | 20 +- amarok/src/collectionbrowser.cpp | 766 +++---- amarok/src/collectionbrowser.h | 146 +- amarok/src/collectiondb.cpp | 1820 ++++++++--------- amarok/src/collectiondb.h | 510 ++--- .../collectionscanner/collectionscanner.cpp | 128 +- .../src/collectionscanner/collectionscanner.h | 26 +- .../collectionscannerdcophandler.cpp | 2 +- .../collectionscannerdcophandler.h | 4 +- amarok/src/collectionscanner/main.cpp | 6 +- amarok/src/colorgenerator.h | 2 +- amarok/src/columnlist.cpp | 66 +- amarok/src/columnlist.h | 10 +- amarok/src/configdialog.cpp | 120 +- amarok/src/configdialog.h | 30 +- amarok/src/contextbrowser.cpp | 992 ++++----- amarok/src/contextbrowser.h | 110 +- amarok/src/coverfetcher.cpp | 152 +- amarok/src/coverfetcher.h | 78 +- amarok/src/covermanager.cpp | 306 +-- amarok/src/covermanager.h | 98 +- amarok/src/cuefile.cpp | 34 +- amarok/src/cuefile.h | 26 +- amarok/src/database_refactor/collectiondb.cpp | 462 ++--- amarok/src/database_refactor/collectiondb.h | 146 +- amarok/src/database_refactor/dbenginebase.cpp | 32 +- amarok/src/database_refactor/dbenginebase.h | 56 +- .../sqlite/sqlite_dbengine.cpp | 28 +- .../sqlite/sqlite_dbengine.h | 20 +- amarok/src/dbsetup.ui.h | 4 +- amarok/src/debug.h | 50 +- amarok/src/deletedialog.cpp | 24 +- amarok/src/deletedialog.h | 14 +- .../massstorage/massstoragedevicehandler.cpp | 18 +- .../massstorage/massstoragedevicehandler.h | 14 +- amarok/src/device/nfs/nfsdevicehandler.cpp | 16 +- amarok/src/device/nfs/nfsdevicehandler.h | 14 +- amarok/src/device/smb/smbdevicehandler.cpp | 16 +- amarok/src/device/smb/smbdevicehandler.h | 14 +- amarok/src/deviceconfiguredialog.cpp | 52 +- amarok/src/deviceconfiguredialog.h | 12 +- amarok/src/devicemanager.cpp | 56 +- amarok/src/devicemanager.h | 22 +- amarok/src/directorylist.cpp | 90 +- amarok/src/directorylist.h | 36 +- amarok/src/dynamicmode.cpp | 78 +- amarok/src/dynamicmode.h | 22 +- amarok/src/editfilterdialog.cpp | 220 +- amarok/src/editfilterdialog.h | 80 +- amarok/src/engine/akode/akode-engine.cpp | 14 +- amarok/src/engine/akode/akode-engine.h | 2 +- .../src/engine/helix/helix-configdialog.cpp | 158 +- amarok/src/engine/helix/helix-configdialog.h | 46 +- amarok/src/engine/helix/helix-engine.cpp | 70 +- amarok/src/engine/helix/helix-engine.h | 18 +- amarok/src/engine/helix/helix-errors.cpp | 14 +- amarok/src/engine/helix/helix-errors.h | 4 +- .../helix-include/client/include/hxclsnk.h | 26 +- .../helix-include/common/container/hxbuffer.h | 8 +- .../helix-include/common/include/hxausvc.h | 164 +- .../helix-include/common/include/hxauth.h | 44 +- .../helix-include/common/include/hxccf.h | 6 +- .../helix-include/common/include/hxcom.h | 10 +- .../helix-include/common/include/hxcomm.h | 44 +- .../helix-include/common/include/hxcore.h | 200 +- .../helix-include/common/include/hxengin.h | 280 +-- .../helix-include/common/include/hxerror.h | 14 +- .../helix-include/common/include/hxfiles.h | 270 +-- .../helix-include/common/include/hxmon.h | 196 +- .../helix-include/common/include/hxplugn.h | 122 +- .../helix-include/common/include/hxprefs.h | 28 +- .../helix-include/common/include/hxtbuf.h | 4 +- .../helix-include/common/include/hxvalue.h | 36 +- .../helix-include/common/include/hxvsrc.h | 40 +- .../helix-include/common/include/hxwin.h | 214 +- .../helix-include/common/include/ihxpckts.h | 140 +- amarok/src/engine/helix/helix-sp/helix-sp.cpp | 4 +- .../src/engine/helix/helix-sp/hspadvisesink.h | 24 +- .../src/engine/helix/helix-sp/hspalsadevice.h | 22 +- amarok/src/engine/helix/helix-sp/hspauthmgr.h | 4 +- amarok/src/engine/helix/helix-sp/hspcontext.h | 12 +- amarok/src/engine/helix/helix-sp/hsperror.h | 4 +- amarok/src/engine/helix/helix-sp/hsphook.h | 24 +- .../src/engine/helix/helix-sp/hspvoladvise.h | 6 +- amarok/src/engine/kdemm/kdemmengine.cpp | 22 +- amarok/src/engine/kdemm/kdemmengine.h | 14 +- amarok/src/engine/mas/masengine.cpp | 22 +- amarok/src/engine/mas/masengine.h | 8 +- amarok/src/engine/nmm/HostList.cpp | 18 +- amarok/src/engine/nmm/HostList.h | 10 +- amarok/src/engine/nmm/HostListItem.cpp | 66 +- amarok/src/engine/nmm/HostListItem.h | 14 +- amarok/src/engine/nmm/NmmLocation.cpp | 6 +- amarok/src/engine/nmm/NmmLocation.h | 10 +- amarok/src/engine/nmm/ServerregistryPing.cpp | 16 +- amarok/src/engine/nmm/ServerregistryPing.h | 4 +- amarok/src/engine/nmm/nmm_configdialog.cpp | 58 +- amarok/src/engine/nmm/nmm_configdialog.h | 6 +- amarok/src/engine/nmm/nmm_engine.cpp | 74 +- amarok/src/engine/nmm/nmm_engine.h | 18 +- amarok/src/engine/xine/xine-config.cpp | 38 +- amarok/src/engine/xine/xine-config.h | 24 +- amarok/src/engine/xine/xine-engine.cpp | 126 +- amarok/src/engine/xine/xine-engine.h | 18 +- amarok/src/engine/yauap/yauap-engine.cpp | 40 +- amarok/src/engine/yauap/yauap-engine.h | 8 +- amarok/src/enginebase.h | 38 +- amarok/src/enginecontroller.cpp | 86 +- amarok/src/enginecontroller.h | 24 +- amarok/src/engineobserver.cpp | 16 +- amarok/src/engineobserver.h | 10 +- amarok/src/equalizergraph.cpp | 30 +- amarok/src/equalizergraph.h | 16 +- amarok/src/equalizerpresetmanager.cpp | 70 +- amarok/src/equalizerpresetmanager.h | 18 +- amarok/src/equalizersetup.cpp | 160 +- amarok/src/equalizersetup.h | 22 +- amarok/src/expression.cpp | 26 +- amarok/src/expression.h | 36 +- amarok/src/filebrowser.cpp | 156 +- amarok/src/filebrowser.h | 24 +- amarok/src/firstrunwizard.ui.h | 24 +- amarok/src/hintlineedit.cpp | 30 +- amarok/src/hintlineedit.h | 20 +- amarok/src/htmlview.cpp | 200 +- amarok/src/htmlview.h | 6 +- amarok/src/iconloader.cpp | 12 +- amarok/src/k3bexporter.cpp | 42 +- amarok/src/k3bexporter.h | 8 +- amarok/src/kbookmarkhandler.cpp | 6 +- amarok/src/kbookmarkhandler.h | 8 +- amarok/src/konquisidebar/universalamarok.cpp | 94 +- amarok/src/konquisidebar/universalamarok.h | 34 +- amarok/src/ktrm.cpp | 136 +- amarok/src/ktrm.h | 26 +- amarok/src/lastfm.cpp | 336 +-- amarok/src/lastfm.h | 158 +- amarok/src/loader/loader.cpp | 68 +- amarok/src/loader/loader.h | 16 +- .../magnatunealbumdownloader.cpp | 20 +- .../magnatunealbumdownloader.h | 10 +- .../magnatuneartistinfobox.cpp | 28 +- .../magnatunebrowser/magnatuneartistinfobox.h | 4 +- .../src/magnatunebrowser/magnatunebrowser.cpp | 104 +- .../src/magnatunebrowser/magnatunebrowser.h | 38 +- .../magnatunedatabasehandler.cpp | 114 +- .../magnatunedatabasehandler.h | 12 +- .../magnatunedownloaddialog.cpp | 8 +- .../magnatunedownloaddialog.h | 6 +- .../magnatunedownloadinfo.cpp | 28 +- .../magnatunebrowser/magnatunedownloadinfo.h | 32 +- .../magnatunebrowser/magnatunelistview.cpp | 8 +- .../src/magnatunebrowser/magnatunelistview.h | 2 +- .../magnatunelistviewitems.cpp | 8 +- .../magnatunepurchasedialog.cpp | 44 +- .../magnatunepurchasedialog.h | 10 +- .../magnatunepurchasehandler.cpp | 50 +- .../magnatunepurchasehandler.h | 16 +- .../magnatuneredownloaddialog.cpp | 12 +- .../magnatuneredownloaddialog.h | 8 +- .../magnatuneredownloadhandler.cpp | 42 +- .../magnatuneredownloadhandler.h | 12 +- .../src/magnatunebrowser/magnatunetypes.cpp | 52 +- amarok/src/magnatunebrowser/magnatunetypes.h | 92 +- .../magnatunebrowser/magnatunexmlparser.cpp | 48 +- .../src/magnatunebrowser/magnatunexmlparser.h | 24 +- amarok/src/mediabrowser.cpp | 648 +++--- amarok/src/mediabrowser.h | 254 +-- amarok/src/mediadevice/daap/daapclient.cpp | 162 +- amarok/src/mediadevice/daap/daapclient.h | 56 +- .../authentication/contentfetcher.cpp | 34 +- .../authentication/contentfetcher.h | 18 +- .../mediadevice/daap/daapreader/reader.cpp | 108 +- .../src/mediadevice/daap/daapreader/reader.h | 54 +- amarok/src/mediadevice/daap/daapserver.cpp | 12 +- amarok/src/mediadevice/daap/daapserver.h | 2 +- amarok/src/mediadevice/daap/proxy.cpp | 26 +- amarok/src/mediadevice/daap/proxy.h | 8 +- .../generic/genericmediadevice.cpp | 166 +- .../mediadevice/generic/genericmediadevice.h | 52 +- .../genericmediadeviceconfigdialog.ui.h | 76 +- amarok/src/mediadevice/ifp/ifpmediadevice.cpp | 122 +- amarok/src/mediadevice/ifp/ifpmediadevice.h | 32 +- .../src/mediadevice/ipod/ipodmediadevice.cpp | 318 +-- amarok/src/mediadevice/ipod/ipodmediadevice.h | 58 +- amarok/src/mediadevice/mtp/mtpmediadevice.cpp | 160 +- amarok/src/mediadevice/mtp/mtpmediadevice.h | 64 +- amarok/src/mediadevice/njb/njbmediadevice.cpp | 82 +- amarok/src/mediadevice/njb/njbmediadevice.h | 46 +- amarok/src/mediadevice/njb/playlist.cpp | 18 +- amarok/src/mediadevice/njb/playlist.h | 18 +- amarok/src/mediadevice/njb/track.cpp | 30 +- amarok/src/mediadevice/njb/track.h | 10 +- .../riokarma/riokarmamediadevice.cpp | 44 +- .../riokarma/riokarmamediadevice.h | 24 +- amarok/src/mediadevicemanager.cpp | 40 +- amarok/src/mediadevicemanager.h | 18 +- amarok/src/medium.cpp | 94 +- amarok/src/medium.h | 68 +- amarok/src/mediumpluginmanager.cpp | 120 +- amarok/src/mediumpluginmanager.h | 56 +- amarok/src/metabundle.cpp | 284 +-- amarok/src/metabundle.h | 180 +- amarok/src/metabundlesaver.cpp | 60 +- amarok/src/metabundlesaver.h | 12 +- amarok/src/metadata/tplugins.cpp | 4 +- amarok/src/moodbar.cpp | 156 +- amarok/src/moodbar.h | 40 +- amarok/src/mountpointmanager.cpp | 112 +- amarok/src/mountpointmanager.h | 44 +- amarok/src/multitabbar.cpp | 316 +-- amarok/src/multitabbar.h | 100 +- amarok/src/multitabbar_p.h | 26 +- amarok/src/mydiroperator.cpp | 8 +- amarok/src/mydiroperator.h | 4 +- amarok/src/organizecollectiondialog.ui.h | 56 +- amarok/src/osd.cpp | 230 +-- amarok/src/osd.h | 62 +- amarok/src/pixmapviewer.cpp | 24 +- amarok/src/pixmapviewer.h | 20 +- amarok/src/playerwindow.cpp | 246 +-- amarok/src/playerwindow.h | 106 +- amarok/src/playlist.cpp | 704 +++---- amarok/src/playlist.h | 210 +- amarok/src/playlistbrowser.cpp | 790 +++---- amarok/src/playlistbrowser.h | 186 +- amarok/src/playlistbrowseritem.cpp | 712 +++---- amarok/src/playlistbrowseritem.h | 258 +-- amarok/src/playlistitem.cpp | 118 +- amarok/src/playlistitem.h | 74 +- amarok/src/playlistloader.cpp | 252 +-- amarok/src/playlistloader.h | 70 +- amarok/src/playlistselection.cpp | 62 +- amarok/src/playlistselection.h | 20 +- amarok/src/playlistwindow.cpp | 280 +-- amarok/src/playlistwindow.h | 46 +- amarok/src/plugin/plugin.cpp | 6 +- amarok/src/plugin/plugin.h | 16 +- amarok/src/plugin/pluginconfig.h | 6 +- amarok/src/pluginmanager.cpp | 18 +- amarok/src/pluginmanager.h | 10 +- amarok/src/podcastbundle.h | 140 +- amarok/src/podcastsettings.cpp | 42 +- amarok/src/podcastsettings.h | 30 +- amarok/src/prettypopupmenu.cpp | 54 +- amarok/src/prettypopupmenu.h | 26 +- amarok/src/qstringx.h | 48 +- amarok/src/queuemanager.cpp | 170 +- amarok/src/queuemanager.h | 28 +- amarok/src/refreshimages.cpp | 48 +- amarok/src/refreshimages.h | 16 +- amarok/src/scancontroller.cpp | 80 +- amarok/src/scancontroller.h | 46 +- amarok/src/scriptmanager.cpp | 228 +-- amarok/src/scriptmanager.h | 86 +- .../src/scripts/graphequalizer/eqdialog.ui.h | 16 +- .../graphequalizer/equalizercanvasview.cpp | 88 +- .../graphequalizer/equalizercanvasview.h | 46 +- .../graphequalizer/equalizerdialog.cpp | 16 +- .../scripts/graphequalizer/equalizerdialog.h | 2 +- amarok/src/scripts/graphequalizer/main.cpp | 18 +- .../src/scripts/graphequalizer/stdinreader.h | 16 +- amarok/src/scrobbler.cpp | 170 +- amarok/src/scrobbler.h | 86 +- amarok/src/sliderwidget.cpp | 168 +- amarok/src/sliderwidget.h | 60 +- amarok/src/smartplaylisteditor.cpp | 284 +-- amarok/src/smartplaylisteditor.h | 66 +- amarok/src/socketserver.cpp | 58 +- amarok/src/socketserver.h | 28 +- amarok/src/starmanager.cpp | 30 +- amarok/src/starmanager.h | 56 +- amarok/src/statistics.cpp | 224 +- amarok/src/statistics.h | 66 +- amarok/src/statusbar/overlayWidget.cpp | 28 +- amarok/src/statusbar/overlayWidget.h | 14 +- amarok/src/statusbar/popupMessage.cpp | 66 +- amarok/src/statusbar/popupMessage.h | 28 +- amarok/src/statusbar/progressBar.cpp | 24 +- amarok/src/statusbar/progressBar.h | 24 +- amarok/src/statusbar/queueLabel.cpp | 68 +- amarok/src/statusbar/queueLabel.h | 28 +- amarok/src/statusbar/selectLabel.h | 40 +- amarok/src/statusbar/squeezedtextlabel.cpp | 54 +- amarok/src/statusbar/squeezedtextlabel.h | 18 +- amarok/src/statusbar/statusBarBase.cpp | 226 +- amarok/src/statusbar/statusBarBase.h | 94 +- amarok/src/statusbar/statusbar.cpp | 52 +- amarok/src/statusbar/statusbar.h | 18 +- amarok/src/statusbar/timeLabel.h | 8 +- amarok/src/statusbar/toggleLabel.h | 32 +- amarok/src/systray.cpp | 52 +- amarok/src/systray.h | 20 +- amarok/src/tagdialog.cpp | 324 +-- amarok/src/tagdialog.h | 70 +- amarok/src/tagguesser.cpp | 68 +- amarok/src/tagguesser.h | 74 +- amarok/src/tagguesserconfigdialog.ui.h | 46 +- amarok/src/threadmanager.cpp | 74 +- amarok/src/threadmanager.h | 68 +- amarok/src/tooltip.cpp | 118 +- amarok/src/tooltip.h | 36 +- amarok/src/trackpickerdialog.cpp | 14 +- amarok/src/trackpickerdialog.h | 2 +- amarok/src/tracktooltip.cpp | 96 +- amarok/src/tracktooltip.h | 32 +- amarok/src/transferdialog.cpp | 54 +- amarok/src/transferdialog.h | 14 +- amarok/src/xmlloader.cpp | 38 +- amarok/src/xmlloader.h | 54 +- amarok/src/xmlloader_p.h | 26 +- amarok/src/xspfplaylist.cpp | 116 +- amarok/src/xspfplaylist.h | 44 +- 354 files changed, 14246 insertions(+), 14246 deletions(-) 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_re
\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( "