summaryrefslogtreecommitdiffstats
path: root/amarok/src/loader
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-08-20 06:53:52 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-08-20 06:53:52 +0000
commit3a09386ad170dafdce88c5dcd70275cc7d4081e9 (patch)
tree0f9544da38cdb9c5cc20ad9d695588413b4cd5f9 /amarok/src/loader
parent36a9c1916513474b11c59a9060cbaf8770d1bbc0 (diff)
downloadamarok-3a09386ad170dafdce88c5dcd70275cc7d4081e9.tar.gz
amarok-3a09386ad170dafdce88c5dcd70275cc7d4081e9.zip
Initial TQt conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/amarok@1165727 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'amarok/src/loader')
-rw-r--r--amarok/src/loader/loader.cpp68
-rw-r--r--amarok/src/loader/loader.h16
2 files changed, 42 insertions, 42 deletions
diff --git a/amarok/src/loader/loader.cpp b/amarok/src/loader/loader.cpp
index a17584be..ec4b7b17 100644
--- a/amarok/src/loader/loader.cpp
+++ b/amarok/src/loader/loader.cpp
@@ -18,10 +18,10 @@
#include <cstdlib>
#include <iostream>
#include "loader.h"
-#include <qfile.h>
-#include <qmessagebox.h>
-#include <qprocess.h>
-#include <qstring.h>
+#include <tqfile.h>
+#include <tqmessagebox.h>
+#include <tqprocess.h>
+#include <tqstring.h>
#include <kinstance.h>
#include <kglobal.h>
#include <kstandarddirs.h>
@@ -37,9 +37,9 @@ int
main( int argc, char *argv[] )
{
//NOTE this list doesn't include argv[0] ("amarok")
- QStringList args;
+ TQStringList args;
for( int i = 1; i < argc; i++ )
- args += QString::fromLocal8Bit(argv[i]);
+ args += TQString::fromLocal8Bit(argv[i]);
const bool isRunning = amarokIsRunning();
@@ -50,26 +50,26 @@ main( int argc, char *argv[] )
{
// These arguments cannot be passed to Amarok, or Amarok will exit
// after processing them.
- QStringList longs; longs
+ TQStringList longs; longs
<< "-help" << "-help-qt" << "-help-kde" << "-help-all" << "-author" << "-version" << "-license" << "-v";
// both --arg and -arg are valid
{
- QStringList longlongs;
+ TQStringList longlongs;
foreach( longs )
- longlongs += QChar('-') + *it;
+ longlongs += TQChar('-') + *it;
longs += longlongs;
}
foreach( args ) {
- const QString arg = *it;
+ const TQString arg = *it;
foreach( longs )
if( arg == *it ) {
// this argument cannot be passed to the running amarokapp
// or KCmdLineArgs would exit the application
- QProcess proc( QString("amarokapp") );
+ TQProcess proc( TQString("amarokapp") );
proc.setCommunication( 0 ); //show everything
proc.addArgument( arg );
proc.start();
@@ -87,7 +87,7 @@ main( int argc, char *argv[] )
}
if ( isRunning ) {
- QStringList dcop_args;
+ TQStringList dcop_args;
dcop_args << "dcop" << "amarok" << "player" << "transferCliArgs" << "[";
// We transmit our DESKTOP_STARTUP_ID, so amarokapp can stop the startup animation
@@ -95,12 +95,12 @@ main( int argc, char *argv[] )
// relative URLs should be interpreted correctly by amarokapp
// so we need to pass the current working directory
- dcop_args << "--cwd" << QDir::currentDirPath();
+ dcop_args << "--cwd" << TQDir::currentDirPath();
dcop_args += args;
dcop_args += "]";
- QProcess proc( dcop_args );
+ TQProcess proc( dcop_args );
proc.start();
while( proc.isRunning() )
::usleep( 100 );
@@ -118,7 +118,7 @@ main( int argc, char *argv[] )
bool
amarokIsRunning()
{
- QProcess proc( QString( "dcop" ) );
+ TQProcess proc( TQString( "dcop" ) );
proc.start();
while( proc.isRunning() )
::usleep( 100 );
@@ -134,28 +134,28 @@ amarokIsRunning()
static int _argc = 0;
-Loader::Loader( QStringList args )
- : QApplication( _argc, 0 )
+Loader::Loader( TQStringList args )
+ : TQApplication( _argc, 0 )
, m_counter( 0 )
, m_splash( 0 )
{
// we transmit the startup_id, so amarokapp can stop the startup animation
- //FIXME QCString str( ::getenv( "DESKTOP_STARTUP_ID" ) );
+ //FIXME TQCString str( ::getenv( "DESKTOP_STARTUP_ID" ) );
- if( !QApplication::isSessionRestored())
+ if( !TQApplication::isSessionRestored())
{
KInstance instance("amarok"); // KGlobal::dirs() crashes without
if( isSplashEnabled() )
{
- m_splash = new KSplashScreen( QPixmap( KStandardDirs().findResource("data", "amarok/images/splash_screen.jpg")));
+ m_splash = new KSplashScreen( TQPixmap( KStandardDirs().findResource("data", "amarok/images/splash_screen.jpg")));
m_splash->show();
}
}
args.prepend( "amarokapp" );
- m_proc = new QProcess( args, this );
- m_proc->setCommunication( QProcess::Stdout );
+ m_proc = new TQProcess( args, this );
+ m_proc->setCommunication( TQProcess::Stdout );
std::cout << "Amarok: [Loader] Starting amarokapp..\n";
std::cout << "Amarok: [Loader] Don't run gdb, valgrind, etc. against this binary! Use amarokapp.\n";
@@ -164,11 +164,11 @@ Loader::Loader( QStringList args )
{
delete m_splash; // hide the splash
- QMessageBox::critical( 0, "Amarok",
+ TQMessageBox::critical( 0, "Amarok",
"Amarok could not be started!\n" //FIXME this needs to be translated
"This may be because the amarokapp binary is not in your PATH.\n"
"Try locating and running amarokapp from a terminal.",
- QMessageBox::Ok, 0 );
+ TQMessageBox::Ok, 0 );
std::exit( 1 ); //event-loop is not yet being processed
}
@@ -178,14 +178,14 @@ Loader::Loader( QStringList args )
Loader::~Loader()
{
- // must be deleted before QApplication closes our Xserver connection
- // thus we cannot make it a child of the QApplication and must
+ // must be deleted before TQApplication closes our Xserver connection
+ // thus we cannot make it a child of the TQApplication and must
// delete it manually
delete m_splash;
}
void
-Loader::timerEvent( QTimerEvent* )
+Loader::timerEvent( TQTimerEvent* )
{
if( m_proc->isRunning() )
{
@@ -195,19 +195,19 @@ Loader::timerEvent( QTimerEvent* )
while( m_proc->canReadLineStdout() )
if( m_proc->readLineStdout() == "STARTUP" )
- QApplication::exit( 0 );
+ TQApplication::exit( 0 );
}
else if( !m_proc->normalExit() ) {
// no reason to show messagebox, as amarokapp should start drkonqi
std::cerr << "Amarok: [Loader] amarokapp probably crashed!\n";
- QApplication::exit( 3 );
+ TQApplication::exit( 3 );
}
else
// if we get here, then either we didn't receive STARTUP through
// the pipe, or amarokapp exited normally before the STARTUP was
// written to stdout (possibly possible)
- QApplication::exit( 0 );
+ TQApplication::exit( 0 );
}
bool
@@ -215,16 +215,16 @@ isSplashEnabled()
{
//determine whether splash-screen is enabled in amarokrc
(void)KGlobal::config(); // the kubuntu special directory is not present without this
- QStringList dirs = KGlobal::dirs()->findAllResources( "config", "amarokrc" );
+ TQStringList dirs = KGlobal::dirs()->findAllResources( "config", "amarokrc" );
- for( QStringList::iterator path = dirs.begin();
+ for( TQStringList::iterator path = dirs.begin();
path != dirs.end();
++path )
{
- QFile file( *path );
+ TQFile file( *path );
if ( file.open( IO_ReadOnly ) )
{
- QString line;
+ TQString line;
while( file.readLine( line, 2000 ) != -1 )
if ( line.contains( "Show Splashscreen" ) )
{
diff --git a/amarok/src/loader/loader.h b/amarok/src/loader/loader.h
index e379dc7d..c8ce05d0 100644
--- a/amarok/src/loader/loader.h
+++ b/amarok/src/loader/loader.h
@@ -18,23 +18,23 @@
#ifndef LOADER_H
#define LOADER_H
-#include <qapplication.h>
+#include <tqapplication.h>
-class QProcess;
-class QStringList;
+class TQProcess;
+class TQStringList;
class Loader : public QApplication
{
public:
- Loader( QStringList );
+ Loader( TQStringList );
~Loader();
private:
- virtual void timerEvent( QTimerEvent* );
+ virtual void timerEvent( TQTimerEvent* );
- QProcess *m_proc;
+ TQProcess *m_proc;
int m_counter;
- QWidget *m_splash;
+ TQWidget *m_splash;
static const int INTERVAL = 10; //ms
};
@@ -43,6 +43,6 @@ static bool isSplashEnabled();
static bool amarokIsRunning();
#define foreach( x ) \
- for( QStringList::ConstIterator it = x.begin(), end = x.end(); it != end; ++it )
+ for( TQStringList::ConstIterator it = x.begin(), end = x.end(); it != end; ++it )
#endif