[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdemultimedia/kaudiocreator
From:       Richard Lärkäng <richard () goteborg ! utfors ! se>
Date:       2006-11-06 17:25:41
Message-ID: 1162833941.623517.31475.nullmailer () svn ! kde ! org
[Download RAW message or body]

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;
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic