Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 7746ac8107117e08ab7876858cdc929b > files > 2

gnome-applet-alarm-clock-0.3.1-2.fc14.src.rpm

--- src/prefs.c	2010-05-04 20:30:12 +0000
+++ src/prefs.c	2010-09-06 10:25:34 +0000
@@ -226,6 +226,19 @@
 		g_debug ("Preferences: Autostart ENABLE!");
 
 		if (file != autostart_user_file) {
+			// Create ~/.config/autostart if it doesn't exist
+			f = g_file_get_parent (autostart_user_file);
+			if (!g_file_query_exists (f, NULL)) {
+				g_debug ("Preferences: creating user autostart dir...");
+				if (!g_file_make_directory_with_parents (f, NULL, &err)) {
+					filename = g_file_get_path (f);
+					g_warning ("Preferences: Could not mkdir '%s': %s", filename, err->message);
+					g_free (filename);
+					g_object_unref (f);
+					return;
+				}
+			}
+
 			// Copy .desktop to autostart_user_file
 			filename = g_build_filename (ALARM_CLOCK_DATADIR, "applications", PACKAGE ".desktop", NULL);
 			f = g_file_new_for_path (filename);
@@ -233,6 +246,8 @@
 			if (!g_file_copy (f, autostart_user_file, G_FILE_COPY_NONE, NULL, NULL, NULL, &err)) {
 				g_warning ("Preferences: Could not copy '%s' to user config dir: %s", filename, err->message);
 				g_error_free (err);
+				g_free (filename);
+				return;
 			}
 
 			g_free (filename);