Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.4
padevchooser
padevchooser-no-symlinks.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File padevchooser-no-symlinks.patch of Package padevchooser
diff -upr padevchooser-0.9.4-orig//src/padevchooser.c padevchooser-0.9.4//src/padevchooser.c --- padevchooser-0.9.4-orig//src/padevchooser.c 2007-09-25 03:20:38.000000000 +0200 +++ padevchooser-0.9.4//src/padevchooser.c 2008-04-18 16:57:08.000000000 +0200 @@ -702,31 +702,56 @@ static void set_x11_props(void) { static void start_on_login_cb(GtkCheckButton *w) { gchar *c; + GnomeDesktopItem *ditem; + GError *error = NULL; - mkdir(g_get_user_config_dir(), 0777); c = g_build_filename(g_get_user_config_dir(), "autostart", NULL); - mkdir(c, 0777); + if (!g_file_test (c, G_FILE_TEST_IS_DIR)) { + g_mkdir_with_parents (c, 0777); + } g_free(c); - c = g_build_filename(g_get_user_config_dir(), "autostart", "padevchooser.desktop", NULL); + + ditem = gnome_desktop_item_new_from_file (DESKTOP_FILE, GNOME_DESKTOP_ITEM_LOAD_NO_TRANSLATIONS, &error); + if (!ditem) { + g_warning ("gnome_desktop_item_new_from_file() failed: %s", error->message); + g_error_free (error); + return; + } if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) { - if (symlink(DESKTOP_FILE, c) < 0 && errno != EEXIST) - g_warning("symlink() failed: %s", strerror(errno)); + gnome_desktop_item_set_boolean (ditem, "X-GNOME-Autostart-enabled", TRUE); + gnome_desktop_item_set_boolean (ditem, "Hidden", FALSE); } else { - if (unlink(c) < 0 && errno != ENOENT) - g_warning("unlink() failed: %s", strerror(errno)); + gnome_desktop_item_set_boolean (ditem, "X-GNOME-Autostart-enabled", FALSE); + gnome_desktop_item_set_boolean (ditem, "Hidden", TRUE); + } + + error = NULL; + c = g_strdup_printf ("file://%s/autostart/padevchooser-autostart.desktop", g_get_user_config_dir ()); + if (!gnome_desktop_item_save (ditem, c, TRUE, &error)) { + g_warning ("gnome_desktop_item_save() failed: %s", error->message); + g_error_free (error); } g_free(c); + gnome_desktop_item_unref (ditem); } static void init_start_on_login_check_button(GtkToggleButton *w) { - struct stat st; gchar *c; + GnomeDesktopItem *ditem; c = g_build_filename(g_get_user_config_dir(), "autostart", "padevchooser.desktop", NULL); - gtk_toggle_button_set_active(w, lstat(c, &st) >= 0); + + ditem = gnome_desktop_item_new_from_file (c, 0, NULL); + if (!ditem) { + ditem = gnome_desktop_item_new_from_file (DESKTOP_FILE, 0, NULL); + } + + gtk_toggle_button_set_active(w, gnome_desktop_item_get_boolean (ditem, "X-GNOME-Autostart-enabled")); + g_free(c); + gnome_desktop_item_unref (ditem); } static void check_button_cb(GtkCheckButton *w, const gchar *key) { Only in padevchooser-0.9.4//src: padevchooser.c~
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor