|
|
|
@ -23,7 +23,8 @@
|
|
|
|
|
#include "processlistviewitem.h"
|
|
|
|
|
|
|
|
|
|
ProcessController::ProcessController(ProcessListViewItem * parent)
|
|
|
|
|
: TQObject(parent), myParent(parent), myStatus(false), myAutomatic(false), myProcess(new TQProcess(this))
|
|
|
|
|
: TQObject(parent), myParent(parent), myStatus(false), myAutomatic(false), myUnicodeEnabled(false),
|
|
|
|
|
myProcess(new TQProcess(this))
|
|
|
|
|
{
|
|
|
|
|
connect (myProcess, TQT_SIGNAL( readyReadStdout() ), (ProcessController *) this, TQT_SLOT( readStdout()) );
|
|
|
|
|
connect (myProcess, TQT_SIGNAL(processExited() ), (ProcessController *) this, TQT_SLOT( processExited()) );
|
|
|
|
@ -38,7 +39,15 @@ ProcessController::~ProcessController()
|
|
|
|
|
|
|
|
|
|
void ProcessController::readStdout()
|
|
|
|
|
{
|
|
|
|
|
TQString tempOutput = myProcess->readStdout();
|
|
|
|
|
TQString tempOutput;
|
|
|
|
|
if (myUnicodeEnabled)
|
|
|
|
|
{
|
|
|
|
|
tempOutput = TQString::fromUtf8(myProcess->readStdout());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
tempOutput = TQString::fromLocal8Bit(myProcess->readStdout());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( tempOutput.contains( "ripping..." ))
|
|
|
|
|
{
|
|
|
|
@ -77,14 +86,20 @@ void ProcessController::processExited()
|
|
|
|
|
emit stopRipSignal(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ProcessController::startRip(TQString destination, TQString time)
|
|
|
|
|
void ProcessController::startRip(TQString destination, TQString time, bool isUnicode)
|
|
|
|
|
{
|
|
|
|
|
myUnicodeEnabled = 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() )
|
|
|
|
|