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 15 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();
}
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<int> gains;
TQValueList<int> 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<QVariant> variantList = configItem->property().toList();
QValueList<QVariant>::Iterator it = variantList.begin();
TQValueList<TQVariant> variantList = configItem->property().toList();
TQValueList<TQVariant>::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 );
}

@ -20,14 +20,14 @@
#ifndef AMAROK_DCOP_HANDLER_H
#define AMAROK_DCOP_HANDLER_H
#include <qobject.h>
#include <tqobject.h>
#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

@ -22,7 +22,7 @@
#include <dcopobject.h>
#include <kurl.h>
#include <qstringlist.h>
#include <tqstringlist.h>
///////////////////////////////////////////////////////////////////////
// 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; ///<Return the current sound engine.
virtual QString genre() = 0; ///< Return the genre of the currently playing track.
virtual QString lyrics() = 0; ///< Return the lyrics of the currently playing track.
virtual QString lyricsByPath( QString path ) = 0; ///< Return the lyrics of a track by path.
virtual QString lastfmStation() = 0; ///< Return the lastfm stream that we are playing, if we are playing one
virtual TQString album() = 0; ///< Return the album of the currently playing track.
virtual TQString artist() = 0; ///< Return the artist of the currently playing track.
virtual TQString bitrate() = 0; ///< Return the bitrate of the currently playing track (XX kbps).
virtual TQString comment() = 0; ///< Return the comment of the currently playing track.
virtual TQString coverImage() = 0; ///< Return the encoded URL of the current track's cover image
virtual TQString currentTime() = 0; ///< Return the position of the currently playing track ([h:]mm:ss format).
virtual TQString encodedURL() = 0; ///< Return the encoded URL of the currently playing track.
virtual TQString engine() = 0; ///<Return the current sound engine.
virtual TQString genre() = 0; ///< Return the genre of the currently playing track.
virtual TQString lyrics() = 0; ///< Return the lyrics of the currently playing track.
virtual TQString lyricsByPath( TQString path ) = 0; ///< Return the lyrics of a track by path.
virtual TQString lastfmStation() = 0; ///< Return the lastfm stream that we are playing, if we are playing one
/* Compatibility method (used by mediacontrol as well). DO NOT TOUCH! */
virtual QString nowPlaying() = 0; ///< The title of now playing media.
virtual QString path() = 0; ///< Return the unencoded path of the currently playing track.
virtual QString setContextStyle(const QString& ) = 0; ///< Set the CSS style for the context browser
virtual QString title() = 0; ///< Return the title of the currently playing track.
virtual QString totalTime() = 0; ///< Return the total length of the currently playing track ([h:]mm:ss format).
virtual QString track() = 0; ///< Return the track number.
virtual QString type() = 0; ///< Return the file type.
virtual QString year() = 0; ///< Return the year of the currently playing track.
virtual TQString nowPlaying() = 0; ///< The title of now playing media.
virtual TQString path() = 0; ///< Return the unencoded path of the currently playing track.
virtual TQString setContextStyle(const TQString& ) = 0; ///< Set the CSS style for the context browser
virtual TQString title() = 0; ///< Return the title of the currently playing track.
virtual TQString totalTime() = 0; ///< Return the total length of the currently playing track ([h:]mm:ss format).
virtual TQString track() = 0; ///< Return the track number.
virtual TQString type() = 0; ///< Return the file type.
virtual TQString year() = 0; ///< Return the year of the currently playing track.
virtual void configEqualizer() = 0; ///< Toggle equalizer config dialog.
virtual void enableOSD(bool enable) = 0; ///< Switch OSD display on or off.
virtual void enableRandomMode(bool enable) = 0; ///< Switch Random Mode on or off.
@ -96,23 +96,23 @@ k_dcop:
virtual void seekRelative(int s) = 0; ///< Seek to a position relative to the current track position.
virtual void setEqualizer(int, int, int, int, int, int, int, int, int, int, int) = 0; ///< Set the equalizer bands
virtual void setEqualizerEnabled( bool active ) = 0; ///< Toggle equalizer.
virtual void setEqualizerPreset( QString name ) = 0; ///< Set the equalizer preset
virtual void setLyricsByPath( const QString& url, const QString& lyrics ) = 0; ///< Set the lyrics of a track by it's path.
virtual void setEqualizerPreset( TQString name ) = 0; ///< Set the equalizer preset
virtual void setLyricsByPath( const TQString& url, const TQString& lyrics ) = 0; ///< Set the lyrics of a track by it's path.
virtual void setBpm( float bpm ) = 0; ///< Set the bpm of the currently playing track.
virtual void setBpmByPath( const QString &url, float bpm ) = 0; ///< Set the bpm of a track by it's path.
virtual void setBpmByPath( const TQString &url, float bpm ) = 0; ///< Set the bpm of a track by it's path.
virtual void setScore( float score ) = 0; ///< Set the score of the currently playing track.
virtual void setScoreByPath( const QString &url, float score ) = 0; ///< Set the score of a track by it's path.
virtual void setScoreByPath( const TQString &url, float score ) = 0; ///< Set the score of a track by it's path.
virtual void setRating( int rating ) = 0; ///< Set the rating of the currently playing track.
virtual void setRatingByPath( const QString &url, int rating ) = 0; ///< Set the rating of a track by it's path.
virtual void setRatingByPath( const TQString &url, int rating ) = 0; ///< Set the rating of a track by it's path.
virtual void setVolume(int volume) = 0; ///< Set volume in range 0-100%.
virtual void setVolumeRelative(int ticks) = 0; ///< Set volume relatively by ticks. Can be positive or negative.
virtual void showBrowser( QString browser ) = 0; ///<Shows browsers in the playlist window.
virtual void showBrowser( TQString browser ) = 0; ///<Shows browsers in the playlist window.
virtual void showOSD() = 0; ///< Show the OSD display on the screen.
virtual void stop() = 0; ///< Equivalent to pressing "Stop" button.
virtual void transferDeviceFiles() = 0; ///< Transfer files to media device.
virtual void volumeDown() = 0; ///< Decrease volume by a reasonable step.
virtual void volumeUp() = 0; ///< Increase volume by a reasonable step.
virtual void transferCliArgs( QStringList args ) = 0;
virtual void transferCliArgs( TQStringList args ) = 0;
};
@ -123,27 +123,27 @@ class AmarokPlaylistInterface : virtual public DCOPObject
k_dcop:
virtual int getActiveIndex() = 0; ///< Return the index of the currently active track. -1 if none.
virtual int getTotalTrackCount() = 0; ///< Return number of tracks in playlist. 0 if none.
virtual QString saveCurrentPlaylist() = 0; ///< Saves the current playlist to current.xml and returns its path.
virtual TQString saveCurrentPlaylist() = 0; ///< Saves the current playlist to current.xml and returns its path.
/* These two methods are used by mediacontrol. DO NOT TOUCH! */
virtual void addMedia(const KURL &) = 0; ///< Add audio media specified by the url.
virtual void queueMedia(const KURL &) = 0; ///< Queue audio media specified by the url.
virtual void addMediaList(const KURL::List &) = 0; ///< Add some audio media specified by the url.
virtual void clearPlaylist() = 0; ///< Clears the playlist.
virtual QString currentTrackUniqueId() = 0; ///< Return the current track's unique ID
virtual TQString currentTrackUniqueId() = 0; ///< Return the current track's unique ID
virtual void playByIndex(int) = 0; ///< Starts playing the track at the specified index.
virtual void playMedia(const KURL &) = 0; ///< Add audio media specified by the url.
virtual void popupMessage(const QString&) = 0; ///< Shows a temporary popup message.
virtual void popupMessage(const TQString&) = 0; ///< Shows a temporary popup message.
virtual void removeCurrentTrack() = 0; ///< Removes the current-track item from the playlist.
virtual void removeByIndex(int) = 0; ///< Removes the item at the specified index from the playlist.
virtual void repopulate() = 0; ///< Repopulate the playlist with random tracks.
virtual void saveM3u(const QString& path, bool relativePaths) = 0; ///< Saves the current playlist as m3u.
virtual void saveM3u(const TQString& path, bool relativePaths) = 0; ///< Saves the current playlist as m3u.
///< path = path for saving, relativePaths = whether to write relative paths.
virtual void setStopAfterCurrent( bool ) = 0; ///< Enables/disables the "Stop After Current Track" feature.
virtual void shortStatusMessage(const QString&) = 0; ///< Shows a temporary message on the statusbar.
virtual void shortStatusMessage(const TQString&) = 0; ///< Shows a temporary message on the statusbar.
virtual void shufflePlaylist() = 0; ///< Shuffles the playlist.
virtual void togglePlaylist() = 0; ///< Toggle the Playlist-window.
virtual QStringList filenames() = 0; ///< Show filnames of all enqueued tracks.
virtual TQStringList filenames() = 0; ///< Show filnames of all enqueued tracks.
};
@ -152,10 +152,10 @@ class AmarokPlaylistBrowserInterface : virtual public DCOPObject
K_DCOP
k_dcop:
virtual void addPodcast(const QString &) = 0; ///< Add a podcast entry to the playlist browser.
virtual void addPodcast(const TQString &) = 0; ///< Add a podcast entry to the playlist browser.
virtual void scanPodcasts() = 0; ///< Scan all podcasts for updates.
virtual void addPlaylist(const QString &) = 0; ///< Add a playlist to the playlist browser.
virtual int loadPlaylist(const QString &) = 0; ///< load a playlist to the playlist.
virtual void addPlaylist(const TQString &) = 0; ///< Add a playlist to the playlist browser.
virtual int loadPlaylist(const TQString &) = 0; ///< load a playlist to the playlist.
};
@ -167,7 +167,7 @@ k_dcop:
virtual void showCurrentTrack() = 0; ///< Show the current track in the context browser.
virtual void showLyrics() = 0; ///< Show the lyrics tab in the context browser.
virtual void showWiki() = 0; ///< Show the wikipedia tab in the context browser.
virtual void showLyrics( const QCString& lyrics ) = 0; ///< Renders the lyrics (plan text) in the Lyrics tab.
virtual void showLyrics( const TQCString& lyrics ) = 0; ///< Renders the lyrics (plan text) in the Lyrics tab.
};
@ -182,22 +182,22 @@ k_dcop:
virtual int totalCompilations() = 0; ///< Returns the total of compilations in the collection.
virtual int totalGenres() = 0; ///< Returns the total of genres in the collection.
virtual int totalTracks() = 0; ///< Returns the total of tracks in the collection.
virtual bool isDirInCollection( const QString& ) = 0; ///< Returns whether is given directory is in the collection.
virtual bool moveFile( const QString &oldURL, const QString &newURL, bool overwrite ) = 0; ///<Physically move then migrateFile.
virtual QStringList query(const QString& sql) = 0; ///< Queries the database via SQL.
virtual QStringList similarArtists( int artists ) = 0; ///< Return similar artists of the current tracks, limit to int artists.
virtual void migrateFile( const QString &oldURL, const QString &newURL ) = 0; ///<Move a file in the collection, keeping stats intact.
virtual bool isDirInCollection( const TQString& ) = 0; ///< Returns whether is given directory is in the collection.
virtual bool moveFile( const TQString &oldURL, const TQString &newURL, bool overwrite ) = 0; ///<Physically move then migrateFile.
virtual TQStringList query(const TQString& sql) = 0; ///< Queries the database via SQL.
virtual TQStringList similarArtists( int artists ) = 0; ///< Return similar artists of the current tracks, limit to int artists.
virtual void migrateFile( const TQString &oldURL, const TQString &newURL ) = 0; ///<Move a file in the collection, keeping stats intact.
virtual void scanCollection() = 0; ///< Scan the collection.
virtual void scanCollectionChanges() = 0; ///< Scan the collection for changes only.
virtual void disableAutoScoring( bool disable ) = 0; ///< Disable updating track stats on track change.
virtual void scanPause() = 0; ///< Pause collection scanner.
virtual void scanUnpause() = 0; ///< Unpause collection scanner.
virtual void scannerAcknowledged() = 0; ///< Called by the scanner to acknowledge the request.
virtual int addLabels( const QString &url, const QStringList &labels ) = 0; ///< Add user-defined labels to the song with the given url. Returns the number of labels which were not already assigned to the track.
virtual void removeLabels( const QString &url, const QStringList &oldLabels ) = 0; ///< Remove user-defined labels from the song with the given url.
virtual int deviceId( const QString &url ) = 0; ///< Returns the device id for the URL.
virtual QString relativePath( const QString &url ) = 0; ///< Returns the relative path used in Amarok's database
virtual QString absolutePath( int deviceid, const QString &relativePath ) = 0; ///< Returns the absolute path
virtual int addLabels( const TQString &url, const TQStringList &labels ) = 0; ///< Add user-defined labels to the song with the given url. Returns the number of labels which were not already assigned to the track.
virtual void removeLabels( const TQString &url, const TQStringList &oldLabels ) = 0; ///< Remove user-defined labels from the song with the given url.
virtual int deviceId( const TQString &url ) = 0; ///< Returns the device id for the URL.
virtual TQString relativePath( const TQString &url ) = 0; ///< Returns the relative path used in Amarok's database
virtual TQString absolutePath( int deviceid, const TQString &relativePath ) = 0; ///< Returns the absolute path
};
@ -206,15 +206,15 @@ class AmarokScriptInterface : virtual public DCOPObject
K_DCOP
k_dcop:
virtual bool runScript(const QString& name) = 0; ///< Starts the script with the given name. Returns true on success.
virtual bool stopScript(const QString& name) = 0; ///< Stops the script with the given name. Returns true on success.
virtual QStringList listRunningScripts() = 0; ///< Returns a list of all currently running scripts.
virtual void addCustomMenuItem(QString submenu, QString itemTitle ) = 0; ///< Enables and sets custom menu item title.
virtual void removeCustomMenuItem(QString submenu, QString itemTitle ) = 0; ///< Removes the custom menu item.
virtual QString readConfig(const QString& key) = 0; ///< returns a AmarokConfig configuration entry value from the given key
virtual QStringList readListConfig(const QString& key) = 0; ///< AmarokConfig lists must use this function
virtual QString proxyForUrl(const QString& url) = 0; ///< Returns the proxy that should be used for the given URL
virtual QString proxyForProtocol(const QString& protocol) = 0; ///< Returns the proxy that should be used for the given protocol
virtual bool runScript(const TQString& name) = 0; ///< Starts the script with the given name. Returns true on success.
virtual bool stopScript(const TQString& name) = 0; ///< Stops the script with the given name. Returns true on success.
virtual TQStringList listRunningScripts() = 0; ///< Returns a list of all currently running scripts.
virtual void addCustomMenuItem(TQString submenu, TQString itemTitle ) = 0; ///< Enables and sets custom menu item title.
virtual void removeCustomMenuItem(TQString submenu, TQString itemTitle ) = 0; ///< Removes the custom menu item.
virtual TQString readConfig(const TQString& key) = 0; ///< returns a AmarokConfig configuration entry value from the given key
virtual TQStringList readListConfig(const TQString& key) = 0; ///< AmarokConfig lists must use this function
virtual TQString proxyForUrl(const TQString& url) = 0; ///< Returns the proxy that should be used for the given URL
virtual TQString proxyForProtocol(const TQString& protocol) = 0; ///< Returns the proxy that should be used for the given protocol
};
@ -223,10 +223,10 @@ class AmarokDevicesInterface : virtual public DCOPObject
K_DCOP
k_dcop:
virtual void mediumAdded(QString name) = 0; ///< Called when there is a mediumAdded event
virtual void mediumRemoved(QString name) = 0; ///< Called when there is a mediumRemoved event
virtual void mediumChanged(QString name) = 0; ///< Called when there is a mediumChanged event
virtual QStringList showDeviceList() = 0; ///< Call to display the MediaDeviceManager's current device list
virtual void mediumAdded(TQString name) = 0; ///< Called when there is a mediumAdded event
virtual void mediumRemoved(TQString name) = 0; ///< Called when there is a mediumRemoved event
virtual void mediumChanged(TQString name) = 0; ///< Called when there is a mediumChanged event
virtual TQStringList showDeviceList() = 0; ///< Call to display the MediaDeviceManager's current device list
};
class AmarokMediaBrowserInterface : virtual public DCOPObject
@ -236,12 +236,12 @@ class AmarokMediaBrowserInterface : virtual public DCOPObject
k_dcop:
virtual void deviceConnect() = 0; ///< Connect the current media device
virtual void deviceDisconnect() = 0; ///< Disconnect the current media device
virtual void deviceSwitch( QString name ) = 0; ///< Switch the current media device
virtual QStringList deviceList() = 0; ///< List available media devices
virtual void deviceSwitch( TQString name ) = 0; ///< Switch the current media device
virtual TQStringList deviceList() = 0; ///< List available media devices
virtual void queue( KURL url ) = 0; ///< Add url to transfer queue
virtual void queueList( KURL::List url ) = 0; ///< Add list of urls to transfer queue
virtual void transfer() = 0; ///< Transfer items in queue to current device
virtual void transcodingFinished( QString src, QString dest ) = 0; ///< Announce that transcoding of job is finished
virtual void transcodingFinished( TQString src, TQString dest ) = 0; ///< Announce that transcoding of job is finished
};
#endif

@ -18,10 +18,10 @@
#include <klocale.h>
#include <ktempfile.h>
#include <qfile.h>
#include <qregexp.h>
#include <qtextstream.h>
#include <qglobal.h> //qVersion()
#include <tqfile.h>
#include <tqregexp.h>
#include <tqtextstream.h>
#include <tqglobal.h> //qVersion()
#include <cstdio> //popen, fread
#include <iostream>
@ -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<void*>( 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 <qlabel.h>
#include <qlayout.h>
#include <qvbox.h>
#include <tqlabel.h>
#include <tqlayout.h>
#include <tqvbox.h>
#include <kdialog.h>
#include <kpushbutton.h>
#include <kstdguiitem.h>
@ -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*/(
"<p>" "Amarok has crashed! We are terribly sorry about this :("
"<p>" "However you now have an opportunity to help us fix this crash so that it doesn't "
"happen again! Click <b>Send Email</b> and Amarok will prepare an email that you "
@ -286,16 +286,16 @@ Amarok::CrashHandlerWidget::CrashHandlerWidget()
"as soon as possible."
"<p>" "Thanks for choosing Amarok.<br>" ), 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<QPushButton*>(child("email"))->setDefault( true );
static_cast<TQPushButton*>(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() );

@ -18,7 +18,7 @@
#include "analyzerbase.h"
#include <cmath> //interpolate()
#include "enginecontroller.h"
#include <qevent.h> //event()
#include <tqevent.h> //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 <vector> <qpixmap.h> <qwdiget.h> are pre-included
// 5. for convenience <vector> <tqpixmap.h> <qwdiget.h> 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<QWidget>;
template class Analyzer::Base<TQWidget>;
#endif
template<class W>
Analyzer::Base<W>::Base( QWidget *parent, uint timeout, uint scopeSize )
Analyzer::Base<W>::Base( TQWidget *parent, uint timeout, uint scopeSize )
: W( parent )
, m_timeout( timeout )
, m_fht( new FHT(scopeSize) )
{}
template<class W> bool
Analyzer::Base<W>::event( QEvent *e )
Analyzer::Base<W>::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<W>::event( QEvent *e )
break;
}
return QWidget::event( e );
return TQWidget::event( e );
}
template<class W> void
@ -188,12 +188,12 @@ Analyzer::Base<W>::demo() //virtual
Analyzer::Base2D::Base2D( QWidget *parent, uint timeout, uint scopeSize )
: Base<QWidget>( parent, timeout, scopeSize )
Analyzer::Base2D::Base2D( TQWidget *parent, uint timeout, uint scopeSize )
: Base<TQWidget>( 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<QGLWidget>( parent, timeout, scopeSize )
Analyzer::Base3D::Base3D( TQWidget *parent, uint timeout, uint scopeSize )
: Base<TQGLWidget>( parent, timeout, scopeSize )
{
connect( &m_timer, SIGNAL( timeout() ), SLOT( draw() ) );
connect( &m_timer, TQT_SIGNAL( timeout() ), TQT_SLOT( draw() ) );
}
#endif

@ -12,13 +12,13 @@
#endif
#include "fht.h" //stack allocated and convenience
#include <qpixmap.h> //stack allocated and convenience
#include <qtimer.h> //stack allocated
#include <qwidget.h> //baseclass
#include <tqpixmap.h> //stack allocated and convenience
#include <tqtimer.h> //stack allocated
#include <tqwidget.h> //baseclass
#include <vector> //included for convenience
#ifdef HAVE_QGLWIDGET
#include <qgl.h> //baseclass
#include <tqgl.h> //baseclass
#ifdef Q_WS_MACX
#include <OpenGL/gl.h> //included for convenience
#include <OpenGL/glu.h> //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<QWidget>
class Base2D : public Base<TQWidget>
{
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<QGLWidget>
class Base3D : public Base<TQGLWidget>
{
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<QGLWidget>( w, i1, i2 ) {}
Base3D( TQWidget *w, uint i1, uint i2 ) : Base<TQGLWidget>( 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 *);
};

@ -32,17 +32,17 @@
#include "glanalyzer3.h"
#endif
#include <qlabel.h>
#include <tqlabel.h>
#include <klocale.h>
//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<QLabel *>(analyzer)->setAlignment( Qt::AlignCenter );
analyzer = new TQLabel( i18n( "Click for Analyzers" ), parent ); //blank analyzer to satisfy Grue
static_cast<TQLabel *>(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<QLabel *>(analyzer)->setAlignment( Qt::AlignCenter );
analyzer = new TQLabel( i18n( "Click for Analyzers" ), parent ); //blank analyzer to satisfy Grue
static_cast<TQLabel *>(analyzer)->setAlignment( Qt::AlignCenter );
break;
default:

@ -14,10 +14,10 @@
#include "baranalyzer.h"
#include <cmath> //log10(), etc.
#include "debug.h"
#include <qpainter.h>
#include <tqpainter.h>
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 ) );
}

@ -14,7 +14,7 @@ typedef std::vector<uint> 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<uint> 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<int> roofVector; //positions of roofs
std::vector<uint> 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

@ -19,17 +19,17 @@
#include <klocale.h> //mousePressEvent
#include <kpopupmenu.h> //mousePressEvent
#include <qevent.h> //mousePressEvent
#include <qpainter.h> //paletteChange()
#include <tqevent.h> //mousePressEvent
#include <tqpainter.h> //paletteChange()
#include <stdlib.h>
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<uint>
, m_fade_bars( FADE_SIZE ) //vector<QPixmap>
, m_fade_bars( FADE_SIZE ) //vector<TQPixmap>
, m_fade_pos( 1 << 8, 50 ) //vector<uint>
, m_fade_intensity( 1 << 8, 32 ) //vector<uint>
{
@ -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<int>(_amount)
// #define STAMP debug() << (QValueList<int>() << fh << fs << fv) << endl;
// #define STAMP1( string ) debug() << string << ": " << (QValueList<int>() << fh << fs << fv) << endl;
// #define STAMP2( string, value ) debug() << string << "=" << value << ": " << (QValueList<int>() << fh << fs << fv) << endl;
// #define STAMP debug() << (TQValueList<int>() << fh << fs << fv) << endl;
// #define STAMP1( string ) debug() << string << ": " << (TQValueList<int>() << fh << fs << fv) << endl;
// #define STAMP2( string, value ) debug() << string << "=" << value << ": " << (TQValueList<int>() << 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,

@ -6,11 +6,11 @@
#define BLOCKANALYZER_H
#include "analyzerbase.h"
#include <qcolor.h>
#include <tqcolor.h>
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<float> m_store; //current bar heights
std::vector<float> m_yscale;
//FIXME why can't I namespace these? c++ issue?
std::vector<QPixmap> m_fade_bars;
std::vector<TQPixmap> m_fade_bars;
std::vector<uint> m_fade_pos;
std::vector<int> m_fade_intensity;

@ -4,13 +4,13 @@
#include "amarok.h"
#include "boomanalyzer.h"
#include <cmath>
#include <qlabel.h>
#include <qlayout.h>
#include <qpainter.h>
#include <qslider.h>
#include <qspinbox.h>
#include <tqlabel.h>
#include <tqlayout.h>
#include <tqpainter.h>
#include <tqslider.h>
#include <tqspinbox.h>
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;

@ -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<float> peak_height;
std::vector<float> 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;
}
}

@ -24,7 +24,7 @@
#include <kdebug.h>
GLAnalyzer::GLAnalyzer( QWidget *parent )
GLAnalyzer::GLAnalyzer( TQWidget *parent )
: Analyzer::Base3D(parent, 15)
, m_oldy(32, -10.0f)
, m_peaks(32)

@ -48,7 +48,7 @@ private:
GLfloat x, y;
public:
GLAnalyzer(QWidget *);
GLAnalyzer(TQWidget *);
~GLAnalyzer();
void analyze( const Scope & );

@ -24,11 +24,11 @@
#include "glanalyzer2.h"
#include <kdebug.h>
#include <kstandarddirs.h>
#include <qimage.h>
#include <tqimage.h>
#include <sys/time.h>
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;

@ -22,14 +22,14 @@
#ifdef HAVE_QGLWIDGET
#include "analyzerbase.h"
#include <qstring.h>
#include <qptrlist.h>
#include <tqstring.h>
#include <tqptrlist.h>
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);
};

@ -24,7 +24,7 @@
#include "glanalyzer3.h"
#include <kdebug.h>
#include <kstandarddirs.h>
#include <qimage.h>
#include <tqimage.h>
#include <sys/time.h>
#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;

@ -22,17 +22,17 @@
#define GLBOUNCER_H
#include "analyzerbase.h"
#include <qstring.h>
#include <qptrlist.h>
#include <tqstring.h>
#include <tqptrlist.h>
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<Ball> balls;
TQPtrList<Ball> 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);
};

@ -11,10 +11,10 @@
//
//
#include <qpainter.h>
#include <tqpainter.h>
#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();

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

@ -8,7 +8,7 @@
//
#include <cmath>
#include <qpainter.h>
#include <tqpainter.h>
#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;

@ -14,7 +14,7 @@
class TurbineAnalyzer : public BoomAnalyzer
{
public:
TurbineAnalyzer( QWidget *parent ) : BoomAnalyzer( parent ) {}
TurbineAnalyzer( TQWidget *parent ) : BoomAnalyzer( parent ) {}
void analyze( const Scope& );
};

@ -68,15 +68,15 @@ email : markey@web.de
#include <kaboutdata.h>
#include <kio/job.h>
#include <qevent.h> //genericEventHandler()
#include <qeventloop.h> //applySettings()
#include <qfile.h>
#include <qobjectlist.h> //applyColorScheme()
#include <qpalette.h> //applyColorScheme()
#include <qpixmap.h> //QPixmap::setDefaultOptimization()
#include <qpopupmenu.h> //genericEventHandler
#include <qtimer.h> //showHyperThreadingWarning()
#include <qtooltip.h> //default tooltip for trayicon
#include <tqevent.h> //genericEventHandler()
#include <tqeventloop.h> //applySettings()
#include <tqfile.h>
#include <tqobjectlist.h> //applyColorScheme()
#include <tqpalette.h> //applyColorScheme()
#include <tqpixmap.h> //TQPixmap::setDefaultOptimization()
#include <tqpopupmenu.h> //genericEventHandler
#include <tqtimer.h> //showHyperThreadingWarning()
#include <tqtooltip.h> //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 <dcopref.h>
#include <qstringlist.h>
#include <tqstringlist.h>
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( "<p>You are using a system with multiple CPUs. "
"Please note that Amarok may be unstable with this "
"configuration.</p>"
@ -576,14 +576,14 @@ void App::showHyperThreadingWarning() // SLOT
#include <taglib/id3v1tag.h>
#include <taglib/tbytevector.h>
#include <qtextcodec.h>
#include <tqtextcodec.h>
//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 )
} //</Context>
{ // 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<QWidget*>( playlistWindow()->child( "BrowserBar" ) );
QWidget* const contextBrowser = static_cast<QWidget*>( ContextBrowser::instance() );
TQWidget* const browserBar = static_cast<TQWidget*>( playlistWindow()->child( "BrowserBar" ) );
TQWidget* const contextBrowser = static_cast<TQWidget*>( 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<KListView*>(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<QDropEvent*>(e)
case TQEvent::DragEnter:
#define e static_cast<TQDropEvent*>(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<QWheelEvent*>(e)
#define e static_cast<TQWheelEvent*>(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<QCloseEvent*>(e)->accept(); //if we don't do this the info box appears on quit()!
static_cast<TQCloseEvent*>(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<QWidget*>( m_pPlayerWindow )
: static_cast<QWidget*>( m_pPlaylistWindow );
return AmarokConfig::showPlayerWindow() ? static_cast<TQWidget*>( m_pPlayerWindow )
: static_cast<TQWidget*>( 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;

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

@ -21,8 +21,8 @@
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <qdeepcopy.h>
#include <qstring.h>
#include <tqdeepcopy.h>
#include <tqstring.h>
#include <pthread.h>
#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<QString>( string );
(TQString &) (*s) = TQDeepCopy<TQString>( 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<QString> AtomicString::s_lazyDeletes;
QMutex AtomicString::s_storeMutex;
TQPtrList<TQString> AtomicString::s_lazyDeletes;
TQMutex AtomicString::s_storeMutex;

@ -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 <set>
#include "amarok_export.h"
#include <qstring.h>
#include <qptrlist.h>
#include <qmutex.h>
#include <tqstring.h>
#include <tqptrlist.h>
#include <tqmutex.h>
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<QString*, less> set_type;
typedef std::set<TQString*, less> set_type;
class Data;
friend class Data;
@ -183,9 +183,9 @@ private:
// static data
static set_type s_store; // main string store
static QPtrList<QString> s_lazyDeletes; // strings scheduled for deletion
static TQPtrList<TQString> 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

@ -11,7 +11,7 @@
void *
Worker(void *num) {
srand( reinterpret_cast<int>( 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];

@ -17,7 +17,7 @@
Boston, MA 02110-1301, USA.
*/
#include <qdeepcopy.h>
#include <tqdeepcopy.h>
#include <kurl.h>
#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; }

@ -26,7 +26,7 @@
#ifndef AMAROK_ATOMICURL_H
#define AMAROK_ATOMICURL_H
#include <qstring.h>
#include <tqstring.h>
#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

@ -18,7 +18,7 @@ namespace Browser
class ToolBar : public KToolBar
{
public:
ToolBar( QWidget *parent )
ToolBar( TQWidget *parent )
: KToolBar( parent, "NotMainToolBar" )
{
setMovingEnabled(false);

@ -20,11 +20,11 @@
#include <kiconloader.h> //multiTabBar icons
#include <klocale.h>
#include <qcursor.h> //for resize cursor
#include <qpainter.h>
#include <qsignalmapper.h> //m_mapper
#include <qstyle.h> //Amarok::Splitter
#include <qtooltip.h>
#include <tqcursor.h> //for resize cursor
#include <tqpainter.h>
#include <tqsignalmapper.h> //m_mapper
#include <tqstyle.h> //Amarok::Splitter
#include <tqtooltip.h>
// 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<BrowserBar*>(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<MultiTabBarTab> tabs = *m_tabBar->tabs();
TQPtrList<MultiTabBarTab> 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<MultiTabBarTab> tabs = *m_tabBar->tabs();
TQPtrList<MultiTabBarTab> 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

@ -14,59 +14,59 @@
#include "amarok_export.h" //LIBAMAROK_EXPORT
#include "engineobserver.h" //baseclass
#include <qwidget.h> //baseclass
#include <qvaluevector.h> //stack allocated
#include <qmap.h> //stack allocated
#include <qpushbutton.h>
#include <tqwidget.h> //baseclass
#include <tqvaluevector.h> //stack allocated
#include <tqmap.h> //stack allocated
#include <tqpushbutton.h>
typedef QValueVector<QWidget*> BrowserList;
typedef QMap<QString,int> BrowserIdMap;
typedef TQValueVector<TQWidget*> BrowserList;
typedef TQMap<TQString,int> 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;

@ -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 <kiconloader.h>
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"

@ -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;
};

File diff suppressed because it is too large Load Diff

@ -7,12 +7,12 @@
#ifndef AMAROK_COLLECTIONBROWSER_H
#define AMAROK_COLLECTIONBROWSER_H
#include <qlabel.h>
#include <qvaluelist.h> //stack allocated
#include <qvbox.h> //baseclass
#include <tqlabel.h>
#include <tqvaluelist.h> //stack allocated
#include <tqvbox.h> //baseclass
#include <klistview.h> //baseclass
#include <qstringlist.h> //stack allocated
#include <tqstringlist.h> //stack allocated
#include <kurl.h> //stack allocated
#include <kdialogbase.h> //baseclass
#include <kprogress.h>
@ -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<CollectionView*>( 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<CollectionItem*>( 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<QStringList> m_cacheOpenItemPaths;
QStringList m_cacheViewportTopItem;
QStringList m_cacheCurrentItem;
TQValueList<TQStringList> m_cacheOpenItemPaths;
TQStringList m_cacheViewportTopItem;
TQStringList m_cacheCurrentItem;
KURL::List m_organizeURLs;
bool m_organizeCopyMode;
bool m_organizingFileCancelled;
bool m_showDivider;
QValueList<int> m_flatColumnWidths;
TQValueList<int> 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 )
{

File diff suppressed because it is too large Load Diff

@ -18,17 +18,17 @@
#include "amarok_export.h"
#include <kurl.h>
#include <qdir.h> //stack allocated
#include <qdatetime.h>
#include <qimage.h>
#include <qmutex.h>
#include <qobject.h> //baseclass
#include <qptrqueue.h> //baseclass
#include <qsemaphore.h> //stack allocated
#include <qstringlist.h> //stack allocated
#include <qptrvector.h>
#include <qthread.h>
#include <qvaluestack.h>
#include <tqdir.h> //stack allocated
#include <tqdatetime.h>
#include <tqimage.h>
#include <tqmutex.h>
#include <tqobject.h> //baseclass
#include <tqptrqueue.h> //baseclass
#include <tqsemaphore.h> //stack allocated
#include <tqstringlist.h> //stack allocated
#include <tqptrvector.h>
#include <tqthread.h>
#include <tqvaluestack.h>
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<QString,QString> &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<TQString,TQString> &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<QString,QString> *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<TQString,TQString> *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<QString,QString> &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<TQString,TQString> &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<PodcastChannelBundle> getPodcastChannels();
int addPodcastFolder( const TQString &name, const int parent_id=0, const bool isOpen=false );
TQValueList<PodcastChannelBundle> getPodcastChannels();
PodcastEpisodeBundle getPodcastEpisodeById( int id );
QValueList<PodcastEpisodeBundle> getPodcastEpisodes( const KURL &parent, bool newOnly=false, int limit=-1 );
TQValueList<PodcastEpisodeBundle> 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<MetaBundle> bundlesByUrls( const KURL::List& urls );
TQValueList<MetaBundle> 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<QListViewItem*, CoverFetcher*> * 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<TQListViewItem*, CoverFetcher*> * 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<QString, QString> > info, const bool temporary );
QString notAvailCover( const bool withShadow = false, int width = 1 );
void addImageToAlbum( const TQString& image, TQValueList< QPair<TQString, TQString> > 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();