diff options
author | ormorph <[email protected]> | 2023-12-08 21:22:21 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2023-12-08 22:06:56 +0900 |
commit | fbb41b9197d08dd3fab27f475030f649edfb9ba6 (patch) | |
tree | b213c4eed367f55aab4a8798c8faa5dffd34a65e /src/processcontroller.cpp | |
parent | 683560fce42d11b60361cb1ddbefeef2fab05e11 (diff) | |
download | kstreamripper-fbb41b9197d08dd3fab27f475030f649edfb9ba6.tar.gz kstreamripper-fbb41b9197d08dd3fab27f475030f649edfb9ba6.zip |
Add unicode stream support
Signed-off-by: ormorph <[email protected]>
Signed-off-by: Michele Calgaro <[email protected]>
(cherry picked from commit e1799206d95ffbe856dd9744111bca01b4b3835f)
Diffstat (limited to 'src/processcontroller.cpp')
-rw-r--r-- | src/processcontroller.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/processcontroller.cpp b/src/processcontroller.cpp index a065ed6..da5e15c 100644 --- a/src/processcontroller.cpp +++ b/src/processcontroller.cpp @@ -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() ) |