Initial TQt conversion

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/amarok@1165727 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent 36a9c19165
commit 3a09386ad1

@ -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 )
{

@ -26,9 +26,9 @@
#include <ktar.h>
#include <kio/netaccess.h>
#include <qdir.h>
#include <qfileinfo.h>
#include <qtimer.h>
#include <tqdir.h>
#include <tqfileinfo.h>
#include <tqtimer.h>
////////////////////////////////////////////////////////////////////////////////
@ -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);

@ -26,7 +26,7 @@ email : fh@ez.no
#include "amarokconfig.h"
#include <klocale.h>
#include "qstringx.h"
#include <qtooltip.h>
#include <tqtooltip.h>
void Options5::init()
@ -35,26 +35,26 @@ void Options5::init()
m_pOSDPreview->setAlignment( static_cast<OSDWidget::Alignment>( 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(
"<h3>Tags Displayed in OSD</h3>"
@ -83,7 +83,7 @@ void Options5::init()
"<pre>%19</pre>"
"Will not show <b>Score: <i>%score</i></b> 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() );

@ -12,7 +12,7 @@
** destructor.
*****************************************************************************/
void Options8::updateServices( const QString &s )
void Options8::updateServices( const TQString &s )
{
bool empty = s.isEmpty();
groupBox2->setEnabled( !empty );

@ -18,8 +18,8 @@
#include "socketserver.h" //Vis::Selector::showInstance()
#include "threadmanager.h"
#include <qpixmap.h>
#include <qtooltip.h>
#include <tqpixmap.h>
#include <tqtooltip.h>
#include <kaction.h>
#include <khelpmenu.h>
@ -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<KToolBar*>(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<QPopupMenu*>(w)->changeItem( itemId( x ), text );
TQWidget *w = container( x );
if( w->inherits( "TQPopupMenu" ) )
static_cast<TQPopupMenu*>(w)->changeItem( itemId( x ), text );
//TODO KToolBar sucks so much
// else if( w->inherits( "KToolBar" ) )
// static_cast<KToolBar*>(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() + "<br /><br />" + 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<KToolBar*>(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<KToolBar*>(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<KToolBar*>(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*

@ -13,7 +13,7 @@
#include <kaction.h>
#include <kactionclasses.h>
#include <qguardedptr.h>
#include <tqguardedptr.h>
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<Amarok::VolumeSlider> m_slider;
TQGuardedPtr<Amarok::VolumeSlider> 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 */

@ -3,8 +3,8 @@
#ifndef AMAROK_H
#define AMAROK_H
#include <qnamespace.h>
#include <qstring.h>
#include <tqnamespace.h>
#include <tqstring.h>
#include <kurl.h> // recursiveUrlExpand
#include <kprocio.h> //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.

@ -43,7 +43,7 @@
#include "statusbar.h"
#include "lastfm.h"
#include <qfile.h>
#include <tqfile.h>
#include <dcopclient.h>
#include <kactioncollection.h>
@ -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();
}