|
|
|
@ -25,6 +25,7 @@
|
|
|
|
|
ProcessController::ProcessController(ProcessListViewItem * parent)
|
|
|
|
|
: TQObject((TQObject *)parent), myParent(parent), myStatus(false), myAutomatic(false), myProcess(new TQProcess(this))
|
|
|
|
|
{
|
|
|
|
|
myUniEnabled = false;
|
|
|
|
|
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
|
|
|
|
@ -37,7 +38,13 @@ ProcessController::~ProcessController()
|
|
|
|
|
|
|
|
|
|
void ProcessController::readStdout()
|
|
|
|
|
{
|
|
|
|
|
TQString tempOutput = myProcess->readStdout();
|
|
|
|
|
TQString tempOutput;
|
|
|
|
|
if(myUniEnabled)
|
|
|
|
|
tempOutput = TQString::fromUtf8(myProcess->readStdout());
|
|
|
|
|
else
|
|
|
|
|
tempOutput = TQString::fromLatin1(myProcess->readStdout());
|
|
|
|
|
|
|
|
|
|
if( tempOutput.contains( "ripping..." ))
|
|
|
|
|
|
|
|
|
|
if( tempOutput.contains( "ripping..." ))
|
|
|
|
|
{
|
|
|
|
@ -69,14 +76,20 @@ void ProcessController::readStdout()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ProcessController::startRip(TQString destination, TQString time)
|
|
|
|
|
void ProcessController::startRip(TQString destination, TQString time, bool isUnicode)
|
|
|
|
|
{
|
|
|
|
|
myUniEnabled = isUnicode;
|
|
|
|
|
myStatus = true;
|
|
|
|
|
myParent->setText( 1, "Ripping" );
|
|
|
|
|
|
|
|
|
|
myProcess->clearArguments();
|
|
|
|
|
myProcess->addArgument( "streamripper" );
|
|
|
|
|
myProcess->addArgument( myUrl );
|
|
|
|
|
if( isUnicode )
|
|
|
|
|
{
|
|
|
|
|
myProcess->addArgument( "--codeset-filesys=UTF-8 " );
|
|
|
|
|
myProcess->addArgument( "--codeset-metadata=UTF-8 " );
|
|
|
|
|
}
|
|
|
|
|
myProcess->addArgument( "-d " );
|
|
|
|
|
myProcess->addArgument( destination );
|
|
|
|
|
if( time.toInt() )
|
|
|
|
|