[kupfer] preferences: Autostart file should be installed without format specs



commit fd1c5488d6db9150dedefb11774dae7cf4211145
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Thu Apr 7 05:48:03 2011 +0200

    preferences: Autostart file should be installed without format specs
    
    The %F is passed on verbatim by some implementations (XFCE) which makes
    it more broken and the --no-splash option has no effect.
    
    We update the file to always remove any %F format specifiers.

 kupfer/ui/preferences.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/ui/preferences.py b/kupfer/ui/preferences.py
index 05974a9..c4ea3df 100644
--- a/kupfer/ui/preferences.py
+++ b/kupfer/ui/preferences.py
@@ -289,14 +289,18 @@ class PreferencesWindowController (pretty.OutputMixin):
 			# Read installed file and modify it
 			dfile = desktop.DesktopEntry(desktop_file_path)
 			executable = dfile.getExec()
+			## append no-splash
 			if "--no-splash" not in executable:
 				executable += " --no-splash"
-				dfile.set("Exec", executable)
+			dfile.set("Exec", executable)
 		else:
 			dfile = desktop.DesktopEntry(autostart_file)
 		activestr = str(bool(widget.get_active())).lower()
 		self.output_debug("Setting autostart to", activestr)
 		dfile.set(AUTOSTART_KEY, activestr)
+		## remove the format specifiers
+		executable = dfile.getExec().replace("%F", "")
+		dfile.set("Exec", executable)
 		dfile.write(filename=autostart_file)
 
 	def on_entrykeybinding_changed(self, widget):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]