Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 60c3578e431f5f39e18492b0b2d16569 > files > 5

soundconverter-1.5.4-10.fc16.src.rpm

diff -Nur soundconverter-1.5.4-orig/src/soundconverter.py soundconverter-1.5.4/src/soundconverter.py
--- soundconverter-1.5.4-orig/src/soundconverter.py	2011-01-06 21:47:14.000000000 +0100
+++ soundconverter-1.5.4/src/soundconverter.py	2011-06-21 12:38:01.825025454 +0200
@@ -456,6 +456,21 @@
 		audio_profiles_list.append(profile)
 		audio_profiles_dict[description] = profile
 
+gconfsc = '/apps/SoundConverter'
+forceprefs = False
+if _GCONF.get_string(gconfsc+'/output-mime-type') == 'gst-profile':
+       pdesc = _GCONF.get_string(gconfsc+'/audio-profile')
+       desclist = []
+       for p in audio_profiles_list:
+               description, extension, pipeline = p
+               desclist.append(description)
+       if pdesc not in desclist:
+               if desclist:
+                       _GCONF.set_string(gconfsc+'/audio-profile',desclist[0])
+               _GCONF.set_string(gconfsc+'/output-mime-type','audio/x-vorbis')
+               _GCONF.set_int(gconfsc+'/delete-original',0)
+               forceprefs = True
+
 # logging & debugging
 
 def log(*args):
@@ -1979,7 +1994,10 @@
 		self.gconf.clear_cache()
 		output_type = self.get_string('output-mime-type')
 		profile = self.get_string('audio-profile')
-		profile_ext = audio_profiles_dict[profile][1] if profile else ''
+		if audio_profiles_dict.has_key(profile):
+			profile_ext = audio_profiles_dict[profile][1]
+		else:
+			profile_ext = ''
 		output_suffix = {
 						'audio/x-vorbis': '.ogg',
 						'audio/x-flac': '.flac',
@@ -2863,6 +2881,8 @@
 	#TODO
 	gobject.idle_add(win.filelist.add_uris, input_files)
 	win.set_sensitive()
+	if forceprefs:
+		win.prefs.run()
 	#gtk.threads_enter()
 	gtk.main()
 	#gtk.threads_leave()