Summary: | "Encode File" dialog deletes files on error without any user request | ||
---|---|---|---|
Product: | [Applications] kaudiocreator | Reporter: | Christian Schuerer <csw> |
Component: | general | Assignee: | Gerd Fleischer <gerdfleischer> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | davidpjames, sven.burmeister |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Christian Schuerer
2006-01-07 00:26:41 UTC
I can confirm this on the same platform (well, Debian Sid anyway). The problem seems to be more generalized than the foregoing however. Even from CD, with a genre entry, KAudiocreator is deleting the ripped .wav before it can encode it into ogg or anything else. The upshot is that KAudiocreator is not useful at all at present. I just had some data-loss because of this bug too! Is this fixed in 3.5.2? Loosing data is a serious issue! Minimum expected behaviour would be to only delete files that were created by the app itself. More sensible would be to keep the file until the user wants to delete it, or the encoding was successful. SVN commit 602728 by larkang: Replace '~' by homedir-path before doing the filename expansion Don't the wav-files when using "Encode File" BUG: 115217 BUG: 119656 M +2 -0 encodefileimp.cpp M +4 -4 encoder.cpp M +4 -1 job.h --- branches/KDE/3.5/kdemultimedia/kaudiocreator/encodefileimp.cpp #602727:602728 @@ -62,6 +62,8 @@ newJob->track_artist = track_artist->text(); newJob->track_comment = track_comment->text(); + newJob->removeTempFile = false; + emit(startJob(newJob)); // Same message and *strings* from tracksimp.cpp --- branches/KDE/3.5/kdemultimedia/kaudiocreator/encoder.cpp #602727:602728 @@ -159,6 +159,7 @@ } QString desiredFile = Prefs::fileFormat(); + desiredFile.replace( QRegExp("~"), QDir::homeDirPath() ); { QMap <QString,QString> map; map.insert("extension", prefs->extension()); @@ -167,7 +168,6 @@ jobx.fix("/", "%2f"); // If the user wants anything regexp replaced do it now... desiredFile = jobx.replaceSpecialChars(desiredFile, false, map); - desiredFile.replace( QRegExp("~"), QDir::homeDirPath() ); } while ( QFile::exists( desiredFile ) ) { @@ -284,12 +284,10 @@ bool showDebugBox = false; if ( process->exitStatus() == 127 ) { KMessageBox::sorry(0, i18n("The selected encoder was not found.\nThe wav file has been removed. Command was: %1").arg(job->errorString), i18n("Encoding Failed")); - QFile::remove(job->location); emit(updateProgress(job->id, -1)); } else if ( QFile::exists(job->newLocation) ) { emit(jobIsDone(job, prefs->extension())); - QFile::remove(job->location); // fyi segfaults return 136 if ( process->exitStatus() != 0 ) { @@ -312,10 +310,12 @@ { showDebugBox = true; } - QFile::remove( job->location ); emit( updateProgress( job->id, -1 ) ); } + if ( job->removeTempFile ) + QFile::remove( job->location ); + if( showDebugBox ){ EncoderOutput dlg( 0, "Encoder Output" ); job->output = job->errorString + "\n\n\n" + job->output; --- branches/KDE/3.5/kdemultimedia/kaudiocreator/job.h #602727:602728 @@ -31,7 +31,7 @@ class Job{ public: - inline Job():id(-1),track_title(""),track_artist(""), track(-1),track_comment(""), year(-1), genre(i18n("Other")), group(""), album(""), comment(""), lastSongInAlbum(false), encoder(-1) {}; + inline Job():id(-1),track_title(""),track_artist(""), track(-1),track_comment(""), year(-1), genre(i18n("Other")), group(""), album(""), comment(""), lastSongInAlbum(false), removeTempFile(true), encoder(-1) {}; QString replaceSpecialChars(const QString &string, bool quote, QMap<QString,QString> map); @@ -65,6 +65,9 @@ // If this is the last track to be ripped then value is true. bool lastSongInAlbum; + // If the file should be removed when finished encoding + bool removeTempFile; + // output from the processing. QString output; |