From d2627113ba347e79699e280edcd0813265ae780f Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 5 Jul 2011 19:56:36 +0000 Subject: [PATCH] TQt4 port kstreamripper This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kstreamripper@1239914 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- admin/kde.py | 24 +++++---- kde.py | 24 +++++---- src/SConscript | 2 +- src/addnewstream.ui | 22 ++++----- src/addnewstreamimpl.cpp | 12 ++--- src/addnewstreamimpl.h | 3 +- src/kstreamripper.cpp | 98 ++++++++++++++++++------------------- src/kstreamripper.h | 9 ++-- src/kstreamripperbase.ui | 64 ++++++++++++------------ src/processcontroller.cpp | 48 +++++++++--------- src/processcontroller.h | 33 +++++++------ src/processlistviewitem.cpp | 96 ++++++++++++++++++------------------ src/processlistviewitem.h | 57 ++++++++++----------- 13 files changed, 252 insertions(+), 240 deletions(-) diff --git a/admin/kde.py b/admin/kde.py index 3a061ed..237a0c9 100644 --- a/admin/kde.py +++ b/admin/kde.py @@ -80,21 +80,21 @@ def detect_kde(env): env.Exit(1) env['QTDIR'] = qtdir.strip() - ## Find the necessary programs uic and moc - print "Checking for uic : ", - uic = qtdir + "/bin/uic" + ## Find the necessary programs uic-tqt and moc + print "Checking for uic-tqt : ", + uic = qtdir + "/bin/uic-tqt" if os.path.isfile(uic): - print GREEN+"uic was found as "+uic+NORMAL + print GREEN+"uic-tqt was found as "+uic+NORMAL else: - uic = os.popen("which uic 2>/dev/null").read().strip() + uic = os.popen("which uic-tqt 2>/dev/null").read().strip() if len(uic): - print YELLOW+"uic was found as "+uic+NORMAL + print YELLOW+"uic-tqt was found as "+uic+NORMAL else: - uic = os.popen("which uic 2>/dev/null").read().strip() + uic = os.popen("which uic-tqt 2>/dev/null").read().strip() if len(uic): - print YELLOW+"uic was found as "+uic+NORMAL + print YELLOW+"uic-tqt was found as "+uic+NORMAL else: - print RED+"uic was not found - set QTDIR put it in your PATH ?"+NORMAL + print RED+"uic-tqt was not found - set QTDIR put it in your PATH ?"+NORMAL env.Exit(1) env['QT_UIC'] = uic @@ -128,6 +128,10 @@ def detect_kde(env): # Debian probably print YELLOW+"the qt headers were found in /usr/include/qt3/ "+NORMAL qtincludes = "/usr/include/qt3" + elif os.path.isfile("/usr/include/qt4/Qt/qglobal.h"): + # Debian probably + print YELLOW+"the qt headers were found in /usr/include/qt4/ "+NORMAL + qtincludes = "/usr/include/qt4" else: print RED+"the qt headers were not found"+NORMAL env.Exit(1) @@ -309,7 +313,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt env['QT_UIC_HFLAGS'] = '-L $QTPLUGINS -nounload' env['QT_UIC_CFLAGS'] = '$QT_UIC_HFLAGS -tr tr2i18n' - env['QT_LIBS'] = 'qt-mt' + env['QT_LIBS'] = 'tqt' env['LIBTOOL_FLAGS'] = '--silent --mode=compile --tag=CXX' diff --git a/kde.py b/kde.py index b08dac1..783f727 100644 --- a/kde.py +++ b/kde.py @@ -93,21 +93,21 @@ def detect_kde(env): env.Exit(1) env['QTDIR'] = qtdir.strip() - ## Find the necessary programs uic and moc - print "Checking for uic : ", - uic = qtdir + "/bin/uic" + ## Find the necessary programs uic-tqt and moc + print "Checking for uic-tqt : ", + uic = qtdir + "/bin/uic-tqt" if os.path.isfile(uic): - print GREEN+"uic was found as "+uic+NORMAL + print GREEN+"uic-tqt was found as "+uic+NORMAL else: - uic = os.popen("which uic 2>/dev/null").read().strip() + uic = os.popen("which uic-tqt 2>/dev/null").read().strip() if len(uic): - print YELLOW+"uic was found as "+uic+NORMAL + print YELLOW+"uic-tqt was found as "+uic+NORMAL else: - uic = os.popen("which uic 2>/dev/null").read().strip() + uic = os.popen("which uic-tqt 2>/dev/null").read().strip() if len(uic): - print YELLOW+"uic was found as "+uic+NORMAL + print YELLOW+"uic-tqt was found as "+uic+NORMAL else: - print RED+"uic was not found - set QTDIR put it in your PATH ?"+NORMAL + print RED+"uic-tqt was not found - set QTDIR put it in your PATH ?"+NORMAL env.Exit(1) env['QT_UIC'] = uic @@ -141,6 +141,10 @@ def detect_kde(env): # Debian probably print YELLOW + "the qt headers were found in /usr/include/qt3/ " + NORMAL qtincludes = "/usr/include/qt3" + elif os.path.isfile("/usr/include/qt4/Qt/qglobal.h"): + # Debian probably + print YELLOW + "the qt headers were found in /usr/include/qt4/ " + NORMAL + qtincludes = "/usr/include/qt4" else: print RED + "the qt headers were not found" + NORMAL env.Exit(1) @@ -424,7 +428,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt env['QT_DEBUG'] = 0 env['QT_UIC_HFLAGS'] = '-L $QTPLUGINS -nounload' env['QT_UIC_CFLAGS'] = '$QT_UIC_HFLAGS -tr tr2i18n' - env['QT_LIBS'] = 'qt-mt' + env['QT_LIBS'] = 'tqt' env['QT_UICIMPLPREFIX'] = '' env['QT_UICIMPLSUFFIX'] = '.cpp' diff --git a/src/SConscript b/src/SConscript index 5d40432..0964396 100644 --- a/src/SConscript +++ b/src/SConscript @@ -43,7 +43,7 @@ myenv.KDEprogram( "kstreamripper", kstreamripper_sources ) myenv.KDEaddpaths_includes( ['./', '../'] ) ## Necessary libraries to link against -myenv.KDEaddlibs( ['qt-mt', 'kio', 'kdeui'] ) +myenv.KDEaddlibs( ['tqt', 'kio', 'kdeui'] ) if env['KDEm2']>3: myenv.KDEaddlibs( ['kdnssd']) ############################# ## Data to install diff --git a/src/addnewstream.ui b/src/addnewstream.ui index 5b46733..e654833 100644 --- a/src/addnewstream.ui +++ b/src/addnewstream.ui @@ -1,6 +1,6 @@ AddNewStream - + AddNewStream @@ -22,7 +22,7 @@ unnamed - + frame3 @@ -36,7 +36,7 @@ unnamed - + d_nameLabel @@ -44,7 +44,7 @@ Name: - + d_descriptionLabel @@ -52,22 +52,22 @@ Description: - + d_nameEdit - + d_urlEdit - + d_descEdit - + d_urlLabel @@ -77,7 +77,7 @@ - + d_okButton @@ -91,7 +91,7 @@ Alt+O - + d_cancelButton @@ -104,5 +104,5 @@ - + diff --git a/src/addnewstreamimpl.cpp b/src/addnewstreamimpl.cpp index 033e44e..a1a891b 100644 --- a/src/addnewstreamimpl.cpp +++ b/src/addnewstreamimpl.cpp @@ -20,17 +20,17 @@ #include -#include -#include +#include +#include #include "addnewstreamimpl.h" -AddNewStreamImpl::AddNewStreamImpl( QWidget* parent, const char* name ) - : AddNewStream( parent,name, true ) +AddNewStreamImpl::AddNewStreamImpl( TQWidget* tqparent, const char* name ) + : AddNewStream( tqparent,name, true ) { - connect( d_okButton, SIGNAL( clicked()), this, SLOT( okButtonClicked()) ); - connect( d_cancelButton, SIGNAL( clicked()), this, SLOT( cancelButtonClicked()) ); + connect( d_okButton, TQT_SIGNAL( clicked()), this, TQT_SLOT( okButtonClicked()) ); + connect( d_cancelButton, TQT_SIGNAL( clicked()), this, TQT_SLOT( cancelButtonClicked()) ); } diff --git a/src/addnewstreamimpl.h b/src/addnewstreamimpl.h index 30bcb49..03c5294 100644 --- a/src/addnewstreamimpl.h +++ b/src/addnewstreamimpl.h @@ -26,10 +26,11 @@ class AddNewStreamImpl : public AddNewStream { Q_OBJECT + TQ_OBJECT public: - AddNewStreamImpl( QWidget* parent = 0, const char* name = 0 ); + AddNewStreamImpl( TQWidget* tqparent = 0, const char* name = 0 ); ~AddNewStreamImpl(); protected: diff --git a/src/kstreamripper.cpp b/src/kstreamripper.cpp index 9641df2..2c309c7 100644 --- a/src/kstreamripper.cpp +++ b/src/kstreamripper.cpp @@ -25,18 +25,18 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -48,16 +48,16 @@ -KStreamRipper::KStreamRipper( QWidget* parent, const char* name ) - : KStreamRipperBase( parent,name ) +KStreamRipper::KStreamRipper( TQWidget* tqparent, const char* name ) + : KStreamRipperBase( tqparent,name ) #if KDE_IS_VERSION(3,3,90) , m_browser("_shoutcast._tcp",0,true) #endif { - m_destEdit->setText( QDir::homeDirPath() ); + m_destEdit->setText( TQDir::homeDirPath() ); m_streamsListView->addColumn( "Name" ); - m_streamsListView->addColumn( "Status" ); + m_streamsListView->addColumn( "tqStatus" ); m_streamsListView->addColumn( "Size" ); //app config @@ -69,12 +69,12 @@ KStreamRipper::KStreamRipper( QWidget* parent, const char* name ) m_id3Checkbox->setChecked( appConfig->readBoolEntry( "Id3Tag", 1 )); //listview entrys - QStringList nameList,urlList,descList; + TQStringList nameList,urlList,descList; nameList = appConfig->readListEntry( "names" ); urlList = appConfig->readListEntry( "urls" ); descList = appConfig->readListEntry( "descs" ); - QStringList::iterator iter1, iter2, iter3; + TQStringList::iterator iter1, iter2, iter3; iter1 = nameList.begin(); iter2 = urlList.begin(); iter3 = descList.begin(); @@ -90,26 +90,26 @@ KStreamRipper::KStreamRipper( QWidget* parent, const char* name ) //CONNECTS //clicks - connect(m_addStreamButton, SIGNAL(clicked()), this, SLOT(addStreamButtonClicked())); - connect(m_deleteStreamButton, SIGNAL(clicked()), this, SLOT(deleteStreamButtonClicked())); - connect(m_tuneInButton, SIGNAL(clicked()), this, SLOT(tuneInButtonClicked())); - connect(m_ripButton, SIGNAL(clicked()), this, SLOT(ripButtonClicked())); - connect(m_stopRipButton, SIGNAL(clicked()), this, SLOT(stopRipButtonClicked())); - connect(m_browseButton, SIGNAL(clicked()), this, SLOT(browseButtonClicked())); - connect(m_aboutButton, SIGNAL(clicked()), this, SLOT(aboutButtonClicked())); - connect(m_quitButton, SIGNAL(clicked()), this, SLOT(quitButtonClicked())); + connect(m_addStreamButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(addStreamButtonClicked())); + connect(m_deleteStreamButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(deleteStreamButtonClicked())); + connect(m_tuneInButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(tuneInButtonClicked())); + connect(m_ripButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(ripButtonClicked())); + connect(m_stopRipButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(stopRipButtonClicked())); + connect(m_browseButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(browseButtonClicked())); + connect(m_aboutButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(aboutButtonClicked())); + connect(m_quitButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(quitButtonClicked())); //other - connect( m_streamsListView, SIGNAL(selectionChanged()), this, SLOT( selectedNewListItem()) ); - connect( m_DescriptionEdit, SIGNAL(textChanged(const QString&)), this, SLOT( descriptionChanged()) ); - connect( m_UrlEdit, SIGNAL(textChanged(const QString&)), this, SLOT( urlChanged()) ); + connect( m_streamsListView, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT( selectedNewListItem()) ); + connect( m_DescriptionEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT( descriptionChanged()) ); + connect( m_UrlEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT( urlChanged()) ); // zeroconf #if KDE_IS_VERSION(3,3,90) - connect(&m_browser, SIGNAL(serviceAdded(DNSSD::RemoteService::Ptr)), this, - SLOT(serviceAdded(DNSSD::RemoteService::Ptr))); - connect(&m_browser, SIGNAL(serviceRemoved(DNSSD::RemoteService::Ptr)), this, - SLOT(serviceRemoved(DNSSD::RemoteService::Ptr))); + connect(&m_browser, TQT_SIGNAL(serviceAdded(DNSSD::RemoteService::Ptr)), this, + TQT_SLOT(serviceAdded(DNSSD::RemoteService::Ptr))); + connect(&m_browser, TQT_SIGNAL(serviceRemoved(DNSSD::RemoteService::Ptr)), this, + TQT_SLOT(serviceRemoved(DNSSD::RemoteService::Ptr))); m_browser.startBrowse(); #endif } @@ -120,7 +120,7 @@ KStreamRipper::~KStreamRipper() } -void KStreamRipper::closeEvent( QCloseEvent *e ) +void KStreamRipper::closeEvent( TQCloseEvent *e ) { KConfig *appConfig = KGlobal::config(); @@ -131,8 +131,8 @@ void KStreamRipper::closeEvent( QCloseEvent *e ) //save the listview entrys - QStringList nameList,urlList,descList; - QListViewItemIterator iter( m_streamsListView ); + TQStringList nameList,urlList,descList; + TQListViewItemIterator iter( m_streamsListView ); while( iter.current() ) { @@ -159,7 +159,7 @@ void KStreamRipper::closeEvent( QCloseEvent *e ) void KStreamRipper::addStreamButtonClicked() { AddNewStreamImpl *test = new AddNewStreamImpl( this ); - connect( test, SIGNAL( finished( AddNewStreamImpl* )), this, SLOT( addStreamFinished( AddNewStreamImpl* )) ); + connect( test, TQT_SIGNAL( finished( AddNewStreamImpl* )), this, TQT_SLOT( addStreamFinished( AddNewStreamImpl* )) ); test->show(); } @@ -175,11 +175,11 @@ void KStreamRipper::tuneInButtonClicked() { if( m_streamsListView->currentItem() ) { - QString command = m_tuneInEdit->text().replace( "", m_UrlEdit->text() ); + TQString command = m_tuneInEdit->text().tqreplace( "", m_UrlEdit->text() ); - QStringList commands = QStringList::split( " ", command ); + TQStringList commands = TQStringList::split( " ", command ); - QProcess *process = new QProcess( this ); + TQProcess *process = new TQProcess( TQT_TQOBJECT(this) ); process->setArguments( commands ); process->start(); @@ -191,7 +191,7 @@ void KStreamRipper::tuneInButtonClicked() void KStreamRipper::serviceAdded(DNSSD::RemoteService::Ptr srv) { ProcessListViewItem * proc = new ProcessListViewItem( m_streamsListView, srv->serviceName(), "", ""); - proc->getProcessController()->setUrl( QString("http://%1:%2%3").arg(srv->hostName()).arg(srv->port()).arg(srv->textData()["path"]) ); + proc->getProcessController()->setUrl( TQString("http://%1:%2%3").tqarg(srv->hostName()).tqarg(srv->port()).tqarg(srv->textData()["path"]) ); proc->getProcessController()->setDescription( i18n("found by Zeroconf") ); proc->getProcessController()->setAutomatic(true); proc->getProcessController()->setService(srv); @@ -199,7 +199,7 @@ void KStreamRipper::serviceAdded(DNSSD::RemoteService::Ptr srv) } void KStreamRipper::serviceRemoved(DNSSD::RemoteService::Ptr srv) { - QListViewItemIterator iter( m_streamsListView ); + TQListViewItemIterator iter( m_streamsListView ); while( iter.current() ) { ProcessListViewItem * ProcItem = (ProcessListViewItem*)iter.current(); @@ -237,7 +237,7 @@ void KStreamRipper::stopRipButtonClicked() void KStreamRipper::browseButtonClicked() { - QString openDest = KFileDialog::getExistingDirectory( QDir::homeDirPath(), + TQString openDest = KFileDialog::getExistingDirectory( TQDir::homeDirPath(), this, "Select Destination..." ); m_destEdit->setText( openDest ); @@ -260,17 +260,17 @@ void KStreamRipper::selectedNewListItem() m_deleteStreamButton->setEnabled( false ); m_tuneInButton->setEnabled( false ); m_ripButton->setEnabled( false ); - m_DescriptionEdit->setText( QString::null ); + m_DescriptionEdit->setText( TQString() ); m_DescriptionEdit->setEnabled(false); m_UrlEdit->setEnabled(false); - m_UrlEdit->setText( QString::null ); + m_UrlEdit->setText( TQString() ); return; } ProcessController * ProcCtl = ((ProcessListViewItem*)m_streamsListView->currentItem())->getProcessController(); // reconfigure what the user is allowed to do based on if this process is ripping - m_ripButton->setEnabled( !ProcCtl->getStatus() ); - m_stopRipButton->setEnabled( ProcCtl->getStatus() ); + m_ripButton->setEnabled( !ProcCtl->gettqStatus() ); + m_stopRipButton->setEnabled( ProcCtl->gettqStatus() ); m_tuneInButton->setEnabled( true ); m_deleteStreamButton->setEnabled( !ProcCtl->getAutomatic() ); @@ -281,8 +281,8 @@ void KStreamRipper::selectedNewListItem() // maybe these are more elegant than the next two functions, assuming the slots are implemented in ProcessController - //connect(m_DescriptionEdit, SIGNAL(textChanged(const QString&)), (ProcessListViewItem*)m_streamsListView->currentItem()->getProcessController(), SIGNAL(descriptionChanged(const QString&)) - //connect(m_UrlEdit, SIGNAL(textChanged(const QString&)), (ProcessListViewItem*)m_streamsListView->currentItem()->getProcessController(), SIGNAL(urlChanged(const QString&)) + //connect(m_DescriptionEdit, TQT_SIGNAL(textChanged(const TQString&)), (ProcessListViewItem*)m_streamsListView->currentItem()->getProcessController(), TQT_SIGNAL(descriptionChanged(const TQString&)) + //connect(m_UrlEdit, TQT_SIGNAL(textChanged(const TQString&)), (ProcessListViewItem*)m_streamsListView->currentItem()->getProcessController(), TQT_SIGNAL(urlChanged(const TQString&)) } void KStreamRipper::descriptionChanged() diff --git a/src/kstreamripper.h b/src/kstreamripper.h index f1a5192..d08534d 100644 --- a/src/kstreamripper.h +++ b/src/kstreamripper.h @@ -27,25 +27,26 @@ #include #include #else -// damned moc will create slots regardless of #if macro +// damned tqmoc will create slots regardless of #if macro // this is hack to avoid undefined type namespace DNSSD { namespace RemoteService { typedef int Ptr; } } #endif class AddNewStreamImpl; -class QString; +class TQString; class KStreamRipper : public KStreamRipperBase { Q_OBJECT + TQ_OBJECT public: - KStreamRipper( QWidget* parent = 0, const char* name = 0 ); + KStreamRipper( TQWidget* tqparent = 0, const char* name = 0 ); ~KStreamRipper(); - virtual void closeEvent( QCloseEvent* ); + virtual void closeEvent( TQCloseEvent* ); #if KDE_IS_VERSION(3,3,90) DNSSD::ServiceBrowser m_browser; #endif diff --git a/src/kstreamripperbase.ui b/src/kstreamripperbase.ui index fc87901..e418251 100644 --- a/src/kstreamripperbase.ui +++ b/src/kstreamripperbase.ui @@ -1,6 +1,6 @@ KStreamRipperBase - + KStreamRipperBase @@ -29,14 +29,14 @@ Expanding - + 31 20 - + m_favoriteLabel @@ -44,15 +44,15 @@ Your Radio Streams: - + - layout10 + tqlayout10 unnamed - + m_aboutButton @@ -60,7 +60,7 @@ About - + m_quitButton @@ -80,14 +80,14 @@ Expanding - + 421 21 - + m_streamsGroup @@ -98,7 +98,7 @@ unnamed - + m_addStreamButton @@ -109,7 +109,7 @@ Alt+A - + m_deleteStreamButton @@ -123,7 +123,7 @@ Alt+D - + m_stopRipButton @@ -140,7 +140,7 @@ false - + m_tuneInButton @@ -154,7 +154,7 @@ Alt+T - + m_ripButton @@ -170,7 +170,7 @@ - + m_streamsListView @@ -184,7 +184,7 @@ Reject - + m_settingsGroup @@ -198,7 +198,7 @@ unnamed - + m_pathLabel @@ -206,7 +206,7 @@ Destination: - + m_timeToRip @@ -214,7 +214,7 @@ Time to Rip: - + m_id3Label @@ -222,7 +222,7 @@ Add ID3 Tag: - + m_id3Checkbox @@ -233,7 +233,7 @@ true - + m_tuneInLabel @@ -241,7 +241,7 @@ Tune in Command: - + m_secondsLabel @@ -249,7 +249,7 @@ seconds - + m_browseButton @@ -257,7 +257,7 @@ .... - + m_tuneInEdit @@ -265,7 +265,7 @@ xmms <url> - + m_timeEdit @@ -273,7 +273,7 @@ 0 - + m_destEdit @@ -283,7 +283,7 @@ - + m_Details @@ -294,7 +294,7 @@ unnamed - + m_StreamDesc @@ -302,7 +302,7 @@ Description: - + m_StreamURL @@ -310,7 +310,7 @@ URL: - + m_UrlEdit @@ -321,7 +321,7 @@ true - + m_DescriptionEdit @@ -333,5 +333,5 @@ - + diff --git a/src/processcontroller.cpp b/src/processcontroller.cpp index f0dfb6c..5713874 100644 --- a/src/processcontroller.cpp +++ b/src/processcontroller.cpp @@ -22,12 +22,12 @@ #include "processcontroller.h" #include "processlistviewitem.h" -ProcessController::ProcessController(ProcessListViewItem * parent) - : QObject((QObject *)parent), myParent(parent), myStatus(false), myAutomatic(false), myProcess(new QProcess(this)) +ProcessController::ProcessController(ProcessListViewItem * tqparent) + : TQObject((TQObject *)tqparent), myParent(tqparent), mytqStatus(false), myAutomatic(false), myProcess(new TQProcess(this)) { - connect (myProcess, SIGNAL( readyReadStdout() ), (ProcessController *) this, SLOT( readStdout()) ); - // connect (myProcess, SIGNAL( destroyed() ), myProcess, SLOT( kill()) ); - // this should work, according to http://doc.trolltech.com/3.2/qobject.html#~QObject but it doesn't + connect (myProcess, TQT_SIGNAL( readyReadStdout() ), (ProcessController *) this, TQT_SLOT( readStdout()) ); + // connect (myProcess, TQT_SIGNAL( destroyed() ), myProcess, TQT_SLOT( kill()) ); + // this should work, according to http://doc.trolltech.com/3.2/qobject.html#~TQObject but it doesn't } ProcessController::~ProcessController() @@ -37,41 +37,41 @@ ProcessController::~ProcessController() void ProcessController::readStdout() { - QString tempOutput = myProcess->readStdout(); + TQString tempOutput = myProcess->readStdout(); - if( tempOutput.contains( "ripping..." )) + if( tempOutput.tqcontains( "ripping..." )) { - QString songname = tempOutput.mid( tempOutput.find( "]" )+1, tempOutput.findRev( "[" ) - tempOutput.find( "]" ) - 1); + TQString songname = tempOutput.mid( tempOutput.tqfind( "]" )+1, tempOutput.tqfindRev( "[" ) - tempOutput.tqfind( "]" ) - 1); myParent->setText( 1, songname.stripWhiteSpace() ); - QString bytesR = tempOutput.mid( tempOutput.findRev( "[" )+1, tempOutput.findRev( "]" ) - tempOutput.findRev( "[" ) - 1); + TQString bytesR = tempOutput.mid( tempOutput.tqfindRev( "[" )+1, tempOutput.tqfindRev( "]" ) - tempOutput.tqfindRev( "[" ) - 1); myParent->setText( 2, bytesR.stripWhiteSpace() ); } - if( tempOutput.contains( "Connecting..." )) + if( tempOutput.tqcontains( "Connecting..." )) { myParent->setText( 1, "Connecting..." ); myParent->setText( 2, "" ); } - if( tempOutput.contains( "buffering" )) + if( tempOutput.tqcontains( "buffering" )) { myParent->setText( 1, "Buffering..." ); myParent->setText( 2, "" ); } - if( tempOutput.contains( "Time to stop is here" )) + if( tempOutput.tqcontains( "Time to stop is here" )) { myParent->setText( 1, "Complete" ); myParent->setText( 2, "" ); - //QTimer::singleShot( 1500, myParent, SLOT( setEmptyText(3) )); + //TQTimer::singleShot( 1500, myParent, TQT_SLOT( setEmptyText(3) )); } } -void ProcessController::startRip(QString destination, QString time) +void ProcessController::startRip(TQString destination, TQString time) { - myStatus = true; + mytqStatus = true; myParent->setText( 1, "Ripping" ); myProcess->clearArguments(); @@ -85,28 +85,28 @@ void ProcessController::startRip(QString destination, QString time) myProcess->addArgument( time ); } - myProcess->setCommunication( QProcess::Stdout | QProcess::Stderr | QProcess::DupStderr ); + myProcess->setCommunication( TQProcess::Stdout | TQProcess::Stderr | TQProcess::DupStderr ); myProcess->start(); } void ProcessController::stopRip() { - myStatus = false; + mytqStatus = false; myParent->setText( 1, "" ); myParent->setText( 2, "" ); myProcess->tryTerminate(); - QTimer::singleShot( 2000, myProcess, SLOT( kill() ) ); + TQTimer::singleShot( 2000, myProcess, TQT_SLOT( kill() ) ); } -bool ProcessController::getStatus() +bool ProcessController::gettqStatus() { - return myStatus; + return mytqStatus; } -QString ProcessController::getUrl() +TQString ProcessController::getUrl() { return myUrl; } @@ -132,17 +132,17 @@ DNSSD::RemoteService::Ptr ProcessController::getService() } #endif -QString ProcessController::getDescription() +TQString ProcessController::getDescription() { return myDescription; } -void ProcessController::setUrl(QString Url) +void ProcessController::setUrl(TQString Url) { myUrl = Url; } -void ProcessController::setDescription(QString Description) +void ProcessController::setDescription(TQString Description) { myDescription = Description; } diff --git a/src/processcontroller.h b/src/processcontroller.h index 22183df..51696f7 100644 --- a/src/processcontroller.h +++ b/src/processcontroller.h @@ -21,10 +21,10 @@ #ifndef PROCESSCONTROLLER_H #define PROCESSCONTROLLER_H -#include -#include -#include -#include +#include +#include +#include +#include #include #if KDE_IS_VERSION(3,3,90) #include @@ -32,25 +32,26 @@ class ProcessListViewItem; -class ProcessController : public QObject +class ProcessController : public TQObject { Q_OBJECT + TQ_OBJECT public: - ProcessController(ProcessListViewItem * parent); + ProcessController(ProcessListViewItem * tqparent); ~ProcessController(); - bool getStatus(); + bool gettqStatus(); bool getAutomatic(); void setAutomatic(bool a); #if KDE_IS_VERSION(3,3,90) DNSSD::RemoteService::Ptr getService(); void setService(DNSSD::RemoteService::Ptr service); #endif - void setUrl(QString Url); - void setDescription(QString Description); - QString getUrl(); - QString getDescription(); - void startRip(QString destination, QString time); + void setUrl(TQString Url); + void setDescription(TQString Description); + TQString getUrl(); + TQString getDescription(); + void startRip(TQString destination, TQString time); void stopRip(); protected slots: @@ -58,14 +59,14 @@ protected slots: private: ProcessListViewItem * myParent; - bool myStatus; + bool mytqStatus; bool myAutomatic; #if KDE_IS_VERSION(3,3,90) DNSSD::RemoteService::Ptr myService; #endif - QProcess * myProcess; - QString myUrl; - QString myDescription; + TQProcess * myProcess; + TQString myUrl; + TQString myDescription; }; #endif diff --git a/src/processlistviewitem.cpp b/src/processlistviewitem.cpp index d2c88cc..eda1ee9 100644 --- a/src/processlistviewitem.cpp +++ b/src/processlistviewitem.cpp @@ -24,76 +24,76 @@ #include "processlistviewitem.h" #include "processcontroller.h" -ProcessListViewItem::ProcessListViewItem( QListView * parent ) - : QListViewItem(parent), myProcessController(new ProcessController(this)) +ProcessListViewItem::ProcessListViewItem( TQListView * tqparent ) + : TQListViewItem(tqparent), myProcessController(new ProcessController(this)) { } -ProcessListViewItem::ProcessListViewItem( QListViewItem * parent ) - : QListViewItem(parent), myProcessController(new ProcessController(this)) +ProcessListViewItem::ProcessListViewItem( TQListViewItem * tqparent ) + : TQListViewItem(tqparent), myProcessController(new ProcessController(this)) { } -ProcessListViewItem::ProcessListViewItem( QListView * parent, QListViewItem * after ) - : QListViewItem(parent, after), myProcessController(new ProcessController(this)) +ProcessListViewItem::ProcessListViewItem( TQListView * tqparent, TQListViewItem * after ) + : TQListViewItem(tqparent, after), myProcessController(new ProcessController(this)) { } -ProcessListViewItem::ProcessListViewItem( QListViewItem * parent, QListViewItem * after ) - : QListViewItem(parent, after), myProcessController(new ProcessController(this)) +ProcessListViewItem::ProcessListViewItem( TQListViewItem * tqparent, TQListViewItem * after ) + : TQListViewItem(tqparent, after), myProcessController(new ProcessController(this)) { } -ProcessListViewItem::ProcessListViewItem( QListView * parent, - QString label1, - QString label2, - QString label3, - QString label4, - QString label5, - QString label6, - QString label7, - QString label8 ) - : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8), myProcessController(new ProcessController(this)) +ProcessListViewItem::ProcessListViewItem( TQListView * tqparent, + TQString label1, + TQString label2, + TQString label3, + TQString label4, + TQString label5, + TQString label6, + TQString label7, + TQString label8 ) + : TQListViewItem(tqparent, label1, label2, label3, label4, label5, label6, label7, label8), myProcessController(new ProcessController(this)) { } -ProcessListViewItem::ProcessListViewItem( QListViewItem * parent, - QString label1, - QString label2, - QString label3, - QString label4, - QString label5, - QString label6, - QString label7, - QString label8 ) - : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8), myProcessController(new ProcessController(this)) +ProcessListViewItem::ProcessListViewItem( TQListViewItem * tqparent, + TQString label1, + TQString label2, + TQString label3, + TQString label4, + TQString label5, + TQString label6, + TQString label7, + TQString label8 ) + : TQListViewItem(tqparent, label1, label2, label3, label4, label5, label6, label7, label8), myProcessController(new ProcessController(this)) { } -ProcessListViewItem::ProcessListViewItem( QListView * parent, QListViewItem * after, - QString label1, - QString label2, - QString label3, - QString label4, - QString label5, - QString label6, - QString label7, - QString label8 ) - : QListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8), +ProcessListViewItem::ProcessListViewItem( TQListView * tqparent, TQListViewItem * after, + TQString label1, + TQString label2, + TQString label3, + TQString label4, + TQString label5, + TQString label6, + TQString label7, + TQString label8 ) + : TQListViewItem(tqparent, after, label1, label2, label3, label4, label5, label6, label7, label8), myProcessController(new ProcessController(this)) { } -ProcessListViewItem::ProcessListViewItem( QListViewItem * parent, QListViewItem * after, - QString label1, - QString label2, - QString label3, - QString label4, - QString label5, - QString label6, - QString label7, - QString label8 ) - : QListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8), +ProcessListViewItem::ProcessListViewItem( TQListViewItem * tqparent, TQListViewItem * after, + TQString label1, + TQString label2, + TQString label3, + TQString label4, + TQString label5, + TQString label6, + TQString label7, + TQString label8 ) + : TQListViewItem(tqparent, after, label1, label2, label3, label4, label5, label6, label7, label8), myProcessController(new ProcessController(this)) { } diff --git a/src/processlistviewitem.h b/src/processlistviewitem.h index aaa3e74..672ac98 100644 --- a/src/processlistviewitem.h +++ b/src/processlistviewitem.h @@ -22,43 +22,44 @@ #ifndef PROCESSLISTVIEWITEM_H #define PROCESSLISTVIEWITEM_H -#include -#include -#include +#include +#include +#include class ProcessController; -class ProcessListViewItem : public QObject, public QListViewItem +class ProcessListViewItem : public TQObject, public TQListViewItem { Q_OBJECT + TQ_OBJECT public: - ProcessListViewItem( QListView * parent ); - ProcessListViewItem( QListViewItem * parent ); - ProcessListViewItem( QListView * parent, QListViewItem * after ); - ProcessListViewItem( QListViewItem * parent, QListViewItem * after ); + ProcessListViewItem( TQListView * tqparent ); + ProcessListViewItem( TQListViewItem * tqparent ); + ProcessListViewItem( TQListView * tqparent, TQListViewItem * after ); + ProcessListViewItem( TQListViewItem * tqparent, TQListViewItem * after ); - ProcessListViewItem( QListView * parent, - QString, QString = QString::null, - QString = QString::null, QString = QString::null, - QString = QString::null, QString = QString::null, - QString = QString::null, QString = QString::null ); - ProcessListViewItem( QListViewItem * parent, - QString, QString = QString::null, - QString = QString::null, QString = QString::null, - QString = QString::null, QString = QString::null, - QString = QString::null, QString = QString::null ); + ProcessListViewItem( TQListView * tqparent, + TQString, TQString = TQString(), + TQString = TQString(), TQString = TQString(), + TQString = TQString(), TQString = TQString(), + TQString = TQString(), TQString = TQString() ); + ProcessListViewItem( TQListViewItem * tqparent, + TQString, TQString = TQString(), + TQString = TQString(), TQString = TQString(), + TQString = TQString(), TQString = TQString(), + TQString = TQString(), TQString = TQString() ); - ProcessListViewItem( QListView * parent, QListViewItem * after, - QString, QString = QString::null, - QString = QString::null, QString = QString::null, - QString = QString::null, QString = QString::null, - QString = QString::null, QString = QString::null ); - ProcessListViewItem( QListViewItem * parent, QListViewItem * after, - QString, QString = QString::null, - QString = QString::null, QString = QString::null, - QString = QString::null, QString = QString::null, - QString = QString::null, QString = QString::null ); + ProcessListViewItem( TQListView * tqparent, TQListViewItem * after, + TQString, TQString = TQString(), + TQString = TQString(), TQString = TQString(), + TQString = TQString(), TQString = TQString(), + TQString = TQString(), TQString = TQString() ); + ProcessListViewItem( TQListViewItem * tqparent, TQListViewItem * after, + TQString, TQString = TQString(), + TQString = TQString(), TQString = TQString(), + TQString = TQString(), TQString = TQString(), + TQString = TQString(), TQString = TQString() ); ~ProcessListViewItem();