diff options
Diffstat (limited to 'plugins')
5 files changed, 19 insertions, 32 deletions
diff --git a/plugins/decoder/libsndfile/k3blibsndfiledecoder.cpp b/plugins/decoder/libsndfile/k3blibsndfiledecoder.cpp index ad094a6..6e00aa1 100644 --- a/plugins/decoder/libsndfile/k3blibsndfiledecoder.cpp +++ b/plugins/decoder/libsndfile/k3blibsndfiledecoder.cpp @@ -26,7 +26,7 @@ #include <kurl.h> #include <kdebug.h> #include <tdelocale.h> -#include <kinstance.h> +#include <tdeinstance.h> #include <math.h> diff --git a/plugins/encoder/lame/k3blameencoder.cpp b/plugins/encoder/lame/k3blameencoder.cpp index 9b08dcd..3be21df 100644 --- a/plugins/encoder/lame/k3blameencoder.cpp +++ b/plugins/encoder/lame/k3blameencoder.cpp @@ -23,7 +23,7 @@ #include <tdelocale.h> #include <tdeconfig.h> #include <kdebug.h> -#include <kinstance.h> +#include <tdeinstance.h> #include <knuminput.h> #include <kcombobox.h> #include <kdialogbase.h> diff --git a/plugins/encoder/sox/k3bsoxencoder.cpp b/plugins/encoder/sox/k3bsoxencoder.cpp index 631a9b9..1cc7c3a 100644 --- a/plugins/encoder/sox/k3bsoxencoder.cpp +++ b/plugins/encoder/sox/k3bsoxencoder.cpp @@ -34,6 +34,7 @@ #include <tqcombobox.h> #include <tqcheckbox.h> #include <tqlayout.h> +#include <tqregexp.h> #include <sys/types.h> #include <sys/wait.h> @@ -65,47 +66,33 @@ class K3bSoxProgram : public K3bExternalProgram if( !TQFile::exists( path ) ) return false; - K3bExternalBin* bin = 0; - // probe version TDEProcess vp; K3bProcessOutputCollector out( &vp ); vp << path << "-h"; if( vp.start( TDEProcess::Block, TDEProcess::AllOutput ) ) { - int pos = out.output().find( "sox: SoX Version" ); - if ( pos < 0 ) - pos = out.output().find( "sox: SoX v" ); // newer sox versions - int endPos = out.output().find( "\n", pos ); - if( pos > 0 && endPos > 0 ) { - pos += 17; - bin = new K3bExternalBin( this ); + TQRegExp versionRe ("sox: +(SoX )?(Version |v)([^\\n]+)"); + // Should match: + // * sox: Version 12.2.3 + // * sox: SoX Version 12.18.1 + // * sox: SoX v14.0.0 + // * sox: SoX v14.4.0 + int pos = versionRe.search( out.output() ); + if( pos > 0 ) { + TQString version = versionRe.cap(3); + + K3bExternalBin* bin = new K3bExternalBin( this ); + bin->path = path; - bin->version = out.output().mid( pos, endPos-pos ); + bin->version = version; addBin( bin ); return true; } - else { - pos = out.output().find( "sox: Version" ); - endPos = out.output().find( "\n", pos ); - if( pos > 0 && endPos > 0 ) { - pos += 13; - bin = new K3bExternalBin( this ); - bin->path = path; - bin->version = out.output().mid( pos, endPos-pos ); - - addBin( bin ); - - return true; - } - else - return false; - } } - else - return false; + return false; } }; diff --git a/plugins/project/audiometainforenamer/k3baudiometainforenamerplugin.cpp b/plugins/project/audiometainforenamer/k3baudiometainforenamerplugin.cpp index d4f4334..b6a15f2 100644 --- a/plugins/project/audiometainforenamer/k3baudiometainforenamerplugin.cpp +++ b/plugins/project/audiometainforenamer/k3baudiometainforenamerplugin.cpp @@ -26,7 +26,7 @@ #include <k3bpluginfactory.h> #include <kdebug.h> -#include <kinstance.h> +#include <tdeinstance.h> #include <tdemessagebox.h> #include <tdelocale.h> #include <tdefilemetainfo.h> diff --git a/plugins/project/audioprojectcddb/k3baudioprojectcddbplugin.cpp b/plugins/project/audioprojectcddb/k3baudioprojectcddbplugin.cpp index 7d254f8..ca5ef94 100644 --- a/plugins/project/audioprojectcddb/k3baudioprojectcddbplugin.cpp +++ b/plugins/project/audioprojectcddb/k3baudioprojectcddbplugin.cpp @@ -33,7 +33,7 @@ #include <kdebug.h> #include <tdeaction.h> -#include <kinstance.h> +#include <tdeinstance.h> #include <tdemessagebox.h> #include <tdelocale.h> #include <tdeconfig.h> |
