@ -85,7 +85,7 @@ void Convert::get( ConvertItem* item )
item - > fileListItem - > setText ( fileList - > columnByName ( i18n ( " State " ) ) , i18n ( " Getting file " ) + " ... 00 % " ) ;
KURL source ( item - > fileListItem - > options . filePathName . tq replace( " ? " , " %3f " ) ) ;
KURL source ( item - > fileListItem - > options . filePathName . replace( " ? " , " %3f " ) ) ;
KURL destination ( item - > tempInFile - > name ( ) ) ;
if ( source . isLocalFile ( ) & & destination . isLocalFile ( ) ) {
@ -219,9 +219,9 @@ void Convert::rip( ConvertItem* item )
item - > track = 0 ;
}
// if( plugin->rip.out_file. tq find("%p") != -1 ) {
// if( plugin->rip.out_file. find("%p") != -1 ) {
// TQString t_str = plugin->rip.out_file;
// t_str. tq replace( "%p", param );
// t_str. replace( "%p", param );
// param = plugin->rip.bin + " " + t_str;
// }
// else {
@ -229,7 +229,7 @@ void Convert::rip( ConvertItem* item )
// }
TQString t_str = plugin - > rip . out_file ;
t_str . tq replace( " %p " , param ) ;
t_str . replace( " %p " , param ) ;
param = config - > binaries [ plugin - > rip . bin ] + " " + t_str ;
param . simplifyWhiteSpace ( ) ;
@ -239,17 +239,17 @@ void Convert::rip( ConvertItem* item )
for ( TQStringList : : Iterator it = params . begin ( ) ; it ! = params . end ( ) ; + + it )
{
paramSplinter = * it ;
paramSplinter . tq replace( " %d " , item - > fileListItem - > device ) ;
paramSplinter . tq replace( " %t " , TQString ( ) . sprintf ( " %i " , item - > fileListItem - > track ) ) ;
paramSplinter . tq replace( " %n " , TQString ( ) . sprintf ( " %i " , cdManager - > getTrackCount ( item - > fileListItem - > device ) ) ) ;
paramSplinter . tq replace( " %o " , item - > tempWavFile - > name ( ) ) ;
paramSplinter . replace( " %d " , item - > fileListItem - > device ) ;
paramSplinter . replace( " %t " , TQString ( ) . sprintf ( " %i " , item - > fileListItem - > track ) ) ;
paramSplinter . replace( " %n " , TQString ( ) . sprintf ( " %i " , cdManager - > getTrackCount ( item - > fileListItem - > device ) ) ) ;
paramSplinter . replace( " %o " , item - > tempWavFile - > name ( ) ) ;
* ( item - > convertProcess ) < < paramSplinter ;
}
param . tq replace( " %d " , item - > fileListItem - > device ) ;
param . tq replace( " %t " , TQString ( ) . sprintf ( " %i " , item - > fileListItem - > track ) ) ;
param . tq replace( " %n " , TQString ( ) . sprintf ( " %i " , cdManager - > getTrackCount ( item - > fileListItem - > device ) ) ) ;
param . tq replace( " %o " , " \" " + item - > tempWavFile - > name ( ) + " \" " ) ;
param . replace( " %d " , item - > fileListItem - > device ) ;
param . replace( " %t " , TQString ( ) . sprintf ( " %i " , item - > fileListItem - > track ) ) ;
param . replace( " %n " , TQString ( ) . sprintf ( " %i " , cdManager - > getTrackCount ( item - > fileListItem - > device ) ) ) ;
param . replace( " %o " , " \" " + item - > tempWavFile - > name ( ) + " \" " ) ;
logger - > log ( item - > logID , param ) ;
//kdDebug() << " Executing: `" << param << "'" << endl;
@ -286,7 +286,7 @@ void Convert::decode( ConvertItem* item )
if ( ! plugin - > dec . overwrite . isEmpty ( ) ) param . append ( " " + plugin - > dec . overwrite ) ;
TQString t_str = plugin - > dec . in_out_files ;
t_str . tq replace( " %p " , param ) ;
t_str . replace( " %p " , param ) ;
param = config - > binaries [ plugin - > dec . bin ] + " " + t_str ;
param = param . simplifyWhiteSpace ( ) ;
@ -296,13 +296,13 @@ void Convert::decode( ConvertItem* item )
for ( TQStringList : : Iterator it = params . begin ( ) ; it ! = params . end ( ) ; + + it )
{
paramSplinter = * it ;
paramSplinter . tq replace( " %i " , item - > tempInFile - > name ( ) ) ;
paramSplinter . tq replace( " %o " , item - > tempWavFile - > name ( ) ) ;
paramSplinter . replace( " %i " , item - > tempInFile - > name ( ) ) ;
paramSplinter . replace( " %o " , item - > tempWavFile - > name ( ) ) ;
* ( item - > convertProcess ) < < paramSplinter ;
}
param . tq replace( " %i " , " \" " + item - > tempInFile - > name ( ) + " \" " ) ;
param . tq replace( " %o " , " \" " + item - > tempWavFile - > name ( ) + " \" " ) ;
param . replace( " %i " , " \" " + item - > tempInFile - > name ( ) + " \" " ) ;
param . replace( " %o " , " \" " + item - > tempWavFile - > name ( ) + " \" " ) ;
//item->log = param;
logger - > log ( item - > logID , param ) ;
@ -376,7 +376,7 @@ void Convert::encode( ConvertItem* item )
else
sStrength = TQString : : number ( int ( plugin - > enc . strength . range_min - compressionLevel * plugin - > enc . strength . step ) ) ;
}
if ( plugin - > enc . strength . separator ! = ' . ' ) sStrength . tq replace( TQChar ( ' . ' ) , plugin - > enc . strength . separator ) ;
if ( plugin - > enc . strength . separator ! = ' . ' ) sStrength . replace( TQChar ( ' . ' ) , plugin - > enc . strength . separator ) ;
}
else {
TQStringList : : Iterator it = plugin - > enc . strength . profiles . at ( compressionLevel ) ;
@ -420,8 +420,8 @@ void Convert::encode( ConvertItem* item )
//t_int -= t_int%plugin->enc.quality.step;
sQuality = TQString : : number ( t_int ) ;
}
if ( plugin - > enc . bin = = " oggenc " ) sQuality . tq replace( TQChar ( ' . ' ) , KGlobal : : locale ( ) - > decimalSymbol ( ) ) ; // HACK make oggenc usable with all langauges
else if ( plugin - > enc . lossy . quality . separator ! = ' . ' ) sQuality . tq replace( TQChar ( ' . ' ) , plugin - > enc . lossy . quality . separator ) ;
if ( plugin - > enc . bin = = " oggenc " ) sQuality . replace( TQChar ( ' . ' ) , KGlobal : : locale ( ) - > decimalSymbol ( ) ) ; // HACK make oggenc usable with all langauges
else if ( plugin - > enc . lossy . quality . separator ! = ' . ' ) sQuality . replace( TQChar ( ' . ' ) , plugin - > enc . lossy . quality . separator ) ;
}
else {
TQStringList : : Iterator it = plugin - > enc . lossy . quality . profiles . at ( rint ( item - > fileListItem - > options . encodingOptions . iQuality * plugin - > enc . lossy . quality . range_max / 100 ) ) ;
@ -486,7 +486,7 @@ void Convert::encode( ConvertItem* item )
}
TQString sInOutFiles = item - > fileListItem - > options . encodingOptions . sInOutFiles ;
param = sInOutFiles . tq replace( " %p " , param ) ;
param = sInOutFiles . replace( " %p " , param ) ;
// cosmetic surgery
param = param . simplifyWhiteSpace ( ) ;
@ -500,49 +500,49 @@ void Convert::encode( ConvertItem* item )
for ( TQStringList : : Iterator it = params . begin ( ) ; it ! = params . end ( ) ; + + it )
{
paramSplinter = * it ;
paramSplinter . tq replace( " %i " , inputFile ) ;
paramSplinter . tq replace( " %o " , item - > tempOutFile - > name ( ) ) ;
paramSplinter . tq replace( " %c " , sStrength ) ;
paramSplinter . tq replace( " %b " , sBitrate ) ;
paramSplinter . tq replace( " %q " , sQuality ) ;
paramSplinter . tq replace( " %m " , sMinBitrate ) ;
paramSplinter . tq replace( " %M " , sMaxBitrate ) ;
paramSplinter . tq replace( " %s " , sSamplingRate ) ;
paramSplinter . replace( " %i " , inputFile ) ;
paramSplinter . replace( " %o " , item - > tempOutFile - > name ( ) ) ;
paramSplinter . replace( " %c " , sStrength ) ;
paramSplinter . replace( " %b " , sBitrate ) ;
paramSplinter . replace( " %q " , sQuality ) ;
paramSplinter . replace( " %m " , sMinBitrate ) ;
paramSplinter . replace( " %M " , sMaxBitrate ) ;
paramSplinter . replace( " %s " , sSamplingRate ) ;
if ( item - > fileListItem - > tags ) {
paramSplinter . tq replace( " %ta " , ( item - > fileListItem - > tags - > artist ! = " " ) ? item - > fileListItem - > tags - > artist : i18n ( " Unknown " ) ) ;
paramSplinter . tq replace( " %tb " , ( item - > fileListItem - > tags - > album ! = " " ) ? item - > fileListItem - > tags - > album : i18n ( " Unknown " ) ) ;
paramSplinter . tq replace( " %tc " , ( item - > fileListItem - > tags - > comment ! = " " ) ? item - > fileListItem - > tags - > comment : i18n ( " Unknown " ) ) ;
paramSplinter . tq replace( " %td " , ( TQString : : number ( item - > fileListItem - > tags - > disc ) ! = " " ) ? TQString : : number ( item - > fileListItem - > tags - > disc ) : " 0 " ) ;
paramSplinter . tq replace( " %tg " , ( item - > fileListItem - > tags - > genre ! = " " ) ? item - > fileListItem - > tags - > genre : i18n ( " Unknown " ) ) ;
paramSplinter . tq replace( " %tn " , ( TQString : : number ( item - > fileListItem - > tags - > track ) ! = " " ) ? TQString : : number ( item - > fileListItem - > tags - > track ) : " 0 " ) ;
paramSplinter . tq replace( " %tp " , ( item - > fileListItem - > tags - > composer ! = " " ) ? item - > fileListItem - > tags - > composer : i18n ( " Unknown " ) ) ;
paramSplinter . tq replace( " %tt " , ( item - > fileListItem - > tags - > title ! = " " ) ? item - > fileListItem - > tags - > title : i18n ( " Unknown " ) ) ;
paramSplinter . tq replace( " %ty " , ( TQString : : number ( item - > fileListItem - > tags - > year ) ! = " " ) ? TQString : : number ( item - > fileListItem - > tags - > year ) : " 0 " ) ;
paramSplinter . replace( " %ta " , ( item - > fileListItem - > tags - > artist ! = " " ) ? item - > fileListItem - > tags - > artist : i18n ( " Unknown " ) ) ;
paramSplinter . replace( " %tb " , ( item - > fileListItem - > tags - > album ! = " " ) ? item - > fileListItem - > tags - > album : i18n ( " Unknown " ) ) ;
paramSplinter . replace( " %tc " , ( item - > fileListItem - > tags - > comment ! = " " ) ? item - > fileListItem - > tags - > comment : i18n ( " Unknown " ) ) ;
paramSplinter . replace( " %td " , ( TQString : : number ( item - > fileListItem - > tags - > disc ) ! = " " ) ? TQString : : number ( item - > fileListItem - > tags - > disc ) : " 0 " ) ;
paramSplinter . replace( " %tg " , ( item - > fileListItem - > tags - > genre ! = " " ) ? item - > fileListItem - > tags - > genre : i18n ( " Unknown " ) ) ;
paramSplinter . replace( " %tn " , ( TQString : : number ( item - > fileListItem - > tags - > track ) ! = " " ) ? TQString : : number ( item - > fileListItem - > tags - > track ) : " 0 " ) ;
paramSplinter . replace( " %tp " , ( item - > fileListItem - > tags - > composer ! = " " ) ? item - > fileListItem - > tags - > composer : i18n ( " Unknown " ) ) ;
paramSplinter . replace( " %tt " , ( item - > fileListItem - > tags - > title ! = " " ) ? item - > fileListItem - > tags - > title : i18n ( " Unknown " ) ) ;
paramSplinter . replace( " %ty " , ( TQString : : number ( item - > fileListItem - > tags - > year ) ! = " " ) ? TQString : : number ( item - > fileListItem - > tags - > year ) : " 0 " ) ;
}
if ( paramSplinter ! = " " & & paramSplinter ! = " " ) * ( item - > convertProcess ) < < paramSplinter ; // NOTE fixes wavpack encoding
}
param . tq replace( " %i " , " \" " + inputFile + " \" " ) ;
param . tq replace( " %o " , " \" " + item - > tempOutFile - > name ( ) + " \" " ) ;
param . tq replace( " %c " , sStrength ) ;
param . tq replace( " %b " , sBitrate ) ;
param . tq replace( " %q " , sQuality ) ;
param . tq replace( " %m " , sMinBitrate ) ;
param . tq replace( " %M " , sMaxBitrate ) ;
param . tq replace( " %s " , sSamplingRate ) ;
param . replace( " %i " , " \" " + inputFile + " \" " ) ;
param . replace( " %o " , " \" " + item - > tempOutFile - > name ( ) + " \" " ) ;
param . replace( " %c " , sStrength ) ;
param . replace( " %b " , sBitrate ) ;
param . replace( " %q " , sQuality ) ;
param . replace( " %m " , sMinBitrate ) ;
param . replace( " %M " , sMaxBitrate ) ;
param . replace( " %s " , sSamplingRate ) ;
if ( item - > fileListItem - > tags ) {
param . tq replace( " %ta " , " \" " + item - > fileListItem - > tags - > artist + " \" " ) ;
param . tq replace( " %tb " , " \" " + item - > fileListItem - > tags - > album + " \" " ) ;
param . tq replace( " %tc " , " \" " + item - > fileListItem - > tags - > comment + " \" " ) ;
param . tq replace( " %td " , TQString : : number ( item - > fileListItem - > tags - > disc ) ) ;
param . tq replace( " %tg " , " \" " + item - > fileListItem - > tags - > genre + " \" " ) ;
param . tq replace( " %tn " , TQString : : number ( item - > fileListItem - > tags - > track ) ) ;
param . tq replace( " %tp " , " \" " + item - > fileListItem - > tags - > composer + " \" " ) ;
param . tq replace( " %tt " , " \" " + item - > fileListItem - > tags - > title + " \" " ) ;
param . tq replace( " %ty " , TQString : : number ( item - > fileListItem - > tags - > year ) ) ;
param . replace( " %ta " , " \" " + item - > fileListItem - > tags - > artist + " \" " ) ;
param . replace( " %tb " , " \" " + item - > fileListItem - > tags - > album + " \" " ) ;
param . replace( " %tc " , " \" " + item - > fileListItem - > tags - > comment + " \" " ) ;
param . replace( " %td " , TQString : : number ( item - > fileListItem - > tags - > disc ) ) ;
param . replace( " %tg " , " \" " + item - > fileListItem - > tags - > genre + " \" " ) ;
param . replace( " %tn " , TQString : : number ( item - > fileListItem - > tags - > track ) ) ;
param . replace( " %tp " , " \" " + item - > fileListItem - > tags - > composer + " \" " ) ;
param . replace( " %tt " , " \" " + item - > fileListItem - > tags - > title + " \" " ) ;
param . replace( " %ty " , TQString : : number ( item - > fileListItem - > tags - > year ) ) ;
}
logger - > log ( item - > logID , param ) ;
@ -616,7 +616,7 @@ void Convert::put( ConvertItem* item )
else src = item - > tempWavFile - > name ( ) ;
item - > fileListItem - > setText ( fileList - > columnByName ( i18n ( " State " ) ) , i18n ( " Moving file " ) + " ... 00 % " ) ;
item - > outputFilePathName = OutputDirectory : : makePath ( OutputDirectory : : uniqueFileName ( OutputDirectory : : calcPath ( item - > fileListItem , config ) ) ) . tq replace( " %2f " , " %252f " ) ;
item - > outputFilePathName = OutputDirectory : : makePath ( OutputDirectory : : uniqueFileName ( OutputDirectory : : calcPath ( item - > fileListItem , config ) ) ) . replace( " %2f " , " %252f " ) ;
KURL source ( src ) ;
KURL destination ( item - > outputFilePathName ) ;
@ -651,7 +651,7 @@ void Convert::putCorrection( ConvertItem* item )
TQString src = item - > correctionOutFile ;
TQString dest = OutputDirectory : : makePath ( OutputDirectory : : calcPath ( item - > fileListItem , config , item - > correctionOutputExtension ) ) . tq replace( " %2f " , " %252f " ) ;
TQString dest = OutputDirectory : : makePath ( OutputDirectory : : calcPath ( item - > fileListItem , config , item - > correctionOutputExtension ) ) . replace( " %2f " , " %252f " ) ;
KURL source ( src ) ;
// KURL destination( dest );
@ -934,10 +934,10 @@ void Convert::processOutput( KProcess* proc, char* data, int )
if ( ( * item ) - > convertProcess = = proc )
{
TQString log_data = data ;
/* log_data. tq replace("\n","\\n");
log_data . tq replace( " \t " , " \\ t " ) ;
log_data . tq replace( " \r " , " \\ r " ) ;
log_data . tq replace( " \b " , " \\ b " ) ; */
/* log_data. replace("\n","\\n");
log_data . replace( " \t " , " \\ t " ) ;
log_data . replace( " \r " , " \\ r " ) ;
log_data . replace( " \b " , " \\ b " ) ; */
logger - > log ( ( * item ) - > logID , " " + i18n ( " Output " ) + " : " + log_data ) ;
//if( (*item)->readOutputTimer.elapsed() < /*config->pauseTime*/ 100 ) return; // TODO use config value
@ -951,26 +951,26 @@ void Convert::processOutput( KProcess* proc, char* data, int )
// TODO null pointer check
TQString outputPattern = plugin - > dec . output ;
//outputPattern. tq replace( "%i", "%p" ); // for compatibility with old plugins
//outputPattern. replace( "%i", "%p" ); // for compatibility with old plugins
if ( outputPattern . tq find( " %p " ) ! = - 1 ) {
outputPattern . tq replace( " %p " , " %i " ) ;
if ( outputPattern . find( " %p " ) ! = - 1 ) {
outputPattern . replace( " %p " , " %i " ) ;
sscanf ( data , outputPattern , & iPercent ) ;
}
else if ( outputPattern . tq find( " %t " ) ! = - 1 ) {
outputPattern . tq replace( " %t " , " %i " ) ;
else if ( outputPattern . find( " %t " ) ! = - 1 ) {
outputPattern . replace( " %t " , " %i " ) ;
sscanf ( data , outputPattern , & iTime ) ;
iPercent = iTime * 100 / ( * item ) - > fileListItem - > time ;
}
else if ( outputPattern . tq find( " %0 " ) ! = - 1 & & outputPattern . tq find( " %1 " ) ! = - 1 ) {
if ( outputPattern . tq find( " %0 " ) < outputPattern . tq find( " %1 " ) ) {
outputPattern . tq replace( " %0 " , " %i " ) ;
outputPattern . tq replace( " %1 " , " %i " ) ;
else if ( outputPattern . find( " %0 " ) ! = - 1 & & outputPattern . find( " %1 " ) ! = - 1 ) {
if ( outputPattern . find( " %0 " ) < outputPattern . find( " %1 " ) ) {
outputPattern . replace( " %0 " , " %i " ) ;
outputPattern . replace( " %1 " , " %i " ) ;
sscanf ( data , outputPattern , & iPos , & iNum ) ;
}
else {
outputPattern . tq replace( " %0 " , " %i " ) ;
outputPattern . tq replace( " %1 " , " %i " ) ;
outputPattern . replace( " %0 " , " %i " ) ;
outputPattern . replace( " %1 " , " %i " ) ;
sscanf ( data , outputPattern , & iNum , & iPos ) ;
}
if ( iPos ! = 0 & & iNum ! = 0 ) iPercent = iPos * 100 / iNum ;
@ -996,26 +996,26 @@ void Convert::processOutput( KProcess* proc, char* data, int )
else if ( ( * item ) - > fileListItem - > options . encodingOptions . sQualityMode = = i18n ( " Bitrate " ) & & ( * item ) - > fileListItem - > options . encodingOptions . sBitrateMode = = " cbr " ) outputPattern = plugin - > enc . lossy . bitrate . cbr . output ;
else if ( ( * item ) - > fileListItem - > options . encodingOptions . sQualityMode = = i18n ( " Bitrate " ) & & ( * item ) - > fileListItem - > options . encodingOptions . sBitrateMode = = " abr " ) outputPattern = plugin - > enc . lossy . bitrate . abr . output ;
//outputPattern. tq replace( "%i", "%p" ); // for compatibility with old plugins
//outputPattern. replace( "%i", "%p" ); // for compatibility with old plugins
if ( outputPattern . tq find( " %p " ) ! = - 1 ) {
outputPattern . tq replace( " %p " , " %i " ) ;
if ( outputPattern . find( " %p " ) ! = - 1 ) {
outputPattern . replace( " %p " , " %i " ) ;
sscanf ( data , outputPattern , & iPercent ) ;
}
else if ( outputPattern . tq find( " %t " ) ! = - 1 ) {
outputPattern . tq replace( " %t " , " %i " ) ;
else if ( outputPattern . find( " %t " ) ! = - 1 ) {
outputPattern . replace( " %t " , " %i " ) ;
sscanf ( data , outputPattern , & iTime ) ;
iPercent = iTime * 100 / ( * item ) - > fileListItem - > time ;
}
else if ( outputPattern . tq find( " %0 " ) ! = - 1 & & outputPattern . tq find( " %1 " ) ! = - 1 ) {
if ( outputPattern . tq find( " %0 " ) < outputPattern . tq find( " %1 " ) ) {
outputPattern . tq replace( " %0 " , " %i " ) ;
outputPattern . tq replace( " %1 " , " %i " ) ;
else if ( outputPattern . find( " %0 " ) ! = - 1 & & outputPattern . find( " %1 " ) ! = - 1 ) {
if ( outputPattern . find( " %0 " ) < outputPattern . find( " %1 " ) ) {
outputPattern . replace( " %0 " , " %i " ) ;
outputPattern . replace( " %1 " , " %i " ) ;
sscanf ( data , outputPattern , & iPos , & iNum ) ;
}
else {
outputPattern . tq replace( " %0 " , " %i " ) ;
outputPattern . tq replace( " %1 " , " %i " ) ;
outputPattern . replace( " %0 " , " %i " ) ;
outputPattern . replace( " %1 " , " %i " ) ;
sscanf ( data , outputPattern , & iNum , & iPos ) ;
}
if ( iPos ! = 0 & & iNum ! = 0 ) iPercent = iPos * 100 / iNum ;
@ -1038,27 +1038,27 @@ void Convert::processOutput( KProcess* proc, char* data, int )
TQString outputPattern ;
if ( ( * item ) - > fileListItem - > track ! = 0 ) outputPattern = plugin - > rip . output ;
else outputPattern = plugin - > rip . full_disc . output ;
//outputPattern. tq replace( "%i", "%p" ); // for compatibility with old plugins
//outputPattern. replace( "%i", "%p" ); // for compatibility with old plugins
if ( outputPattern . tq find( " %p " ) ! = - 1 | | outputPattern . tq find( " %a " ) ! = - 1 ) {
outputPattern . tq replace( " %p " , " %i " ) ;
outputPattern . tq replace( " %a " , " %i " ) ;
if ( outputPattern . find( " %p " ) ! = - 1 | | outputPattern . find( " %a " ) ! = - 1 ) {
outputPattern . replace( " %p " , " %i " ) ;
outputPattern . replace( " %a " , " %i " ) ;
sscanf ( data , outputPattern , & iPercent ) ;
}
else if ( outputPattern . tq find( " %t " ) ! = - 1 ) {
outputPattern . tq replace( " %t " , " %i " ) ;
else if ( outputPattern . find( " %t " ) ! = - 1 ) {
outputPattern . replace( " %t " , " %i " ) ;
sscanf ( data , outputPattern , & iTime ) ;
iPercent = iTime * 100 / ( * item ) - > fileListItem - > time ;
}
else if ( outputPattern . tq find( " %0 " ) ! = - 1 & & outputPattern . tq find( " %1 " ) ! = - 1 ) {
if ( outputPattern . tq find( " %0 " ) < outputPattern . tq find( " %1 " ) ) {
outputPattern . tq replace( " %0 " , " %i " ) ;
outputPattern . tq replace( " %1 " , " %i " ) ;
else if ( outputPattern . find( " %0 " ) ! = - 1 & & outputPattern . find( " %1 " ) ! = - 1 ) {
if ( outputPattern . find( " %0 " ) < outputPattern . find( " %1 " ) ) {
outputPattern . replace( " %0 " , " %i " ) ;
outputPattern . replace( " %1 " , " %i " ) ;
sscanf ( data , outputPattern , & iPos , & iNum ) ;
}
else {
outputPattern . tq replace( " %0 " , " %i " ) ;
outputPattern . tq replace( " %1 " , " %i " ) ;
outputPattern . replace( " %0 " , " %i " ) ;
outputPattern . replace( " %1 " , " %i " ) ;
sscanf ( data , outputPattern , & iNum , & iPos ) ;
}
if ( iPos ! = 0 & & iNum ! = 0 ) iPercent = iPos * 100 / iNum ;
@ -1068,7 +1068,7 @@ void Convert::processOutput( KProcess* proc, char* data, int )
{
// TODO guess progress, when no signal is received
( * item ) - > lastOutputTimer . start ( ) ;
if ( ( * item ) - > fileListItem - > track = = 0 & & plugin - > rip . full_disc . output . tq find( " %a " ) ! = - 1 ) {
if ( ( * item ) - > fileListItem - > track = = 0 & & plugin - > rip . full_disc . output . find( " %a " ) ! = - 1 ) {
if ( iPercent < ( * item ) - > lastPercent ) ( * item ) - > track + + ;
( * item ) - > lastPercent = iPercent ;
( * item ) - > percent = ( * item ) - > track * 100 / ( * item ) - > tracks + iPercent / ( * item ) - > tracks ;
@ -1469,9 +1469,9 @@ void Convert::remove( ConvertItem* item, int state )
if ( item - > fileListItem - > notify ! = " " ) {
TQString command = item - > fileListItem - > notify ;
command . tq replace( " %u " , item - > fileListItem - > url ) ;
command . tq replace( " %i " , item - > fileListItem - > options . filePathName . tq replace( " " , " %20 " ) ) ;
command . tq replace( " %o " , item - > outputFilePathName . tq replace( " " , " %20 " ) ) ;
command . replace( " %u " , item - > fileListItem - > url ) ;
command . replace( " %i " , item - > fileListItem - > options . filePathName . replace( " " , " %20 " ) ) ;
command . replace( " %o " , item - > outputFilePathName . replace( " " , " %20 " ) ) ;
logger - > log ( item - > logID , " " + i18n ( " Executing command: \" %1 \" " ) . tqarg ( command ) ) ;
notify . clearArguments ( ) ;
TQString paramSplinter ;
@ -1481,9 +1481,9 @@ void Convert::remove( ConvertItem* item, int state )
for ( TQStringList : : Iterator it = params . begin ( ) ; it ! = params . end ( ) ; + + it )
{
paramSplinter = * it ;
paramSplinter . tq replace( " %u " , item - > fileListItem - > url ) ;
paramSplinter . tq replace( " %i " , item - > fileListItem - > options . filePathName ) ;
paramSplinter . tq replace( " %o " , item - > outputFilePathName ) ;
paramSplinter . replace( " %u " , item - > fileListItem - > url ) ;
paramSplinter . replace( " %i " , item - > fileListItem - > options . filePathName ) ;
paramSplinter . replace( " %o " , item - > outputFilePathName ) ;
notify < < paramSplinter ;
}
notify . start ( KProcess : : DontCare ) ;