Commit 33c4a4a9 authored by Michael Meeks's avatar Michael Meeks

switch to slab_key_file pieces ...

parent b507af27
......@@ -322,7 +322,7 @@ tile_show_event_cb (GtkWidget * widget, gpointer user_data)
static void
open_hard_drive_tile (Tile * tile, TileEvent * event, TileAction * action)
{
GKeyFile *ditem;
SlabKeyFile *ditem;
gchar *fb_ditem_id;
fb_ditem_id = (gchar *) libslab_get_gconf_value (SYSTEM_MONITOR_GCONF_KEY);
......@@ -330,7 +330,7 @@ open_hard_drive_tile (Tile * tile, TileEvent * event, TileAction * action)
if (! fb_ditem_id)
fb_ditem_id = g_strdup ("gnome-system-monitor.desktop");
ditem = libslab_gnome_desktop_item_new_from_unknown_id (fb_ditem_id);
ditem = slab_key_file_new_from_unknown_id (fb_ditem_id);
if (! open_desktop_item_exec (ditem))
g_warning ("open_hard_drive_tile: couldn't exec item\n");
......
......@@ -93,7 +93,7 @@ migrate_system_gconf_to_bookmark_file ()
GList *gconf_system_list;
gint system_tile_type;
GKeyFile *ditem;
SlabKeyFile *ditem;
gchar *path;
const gchar *loc;
gchar *uri;
......@@ -163,13 +163,13 @@ migrate_system_gconf_to_bookmark_file ()
ditem = NULL;
if (system_tile_type == 0)
ditem = libslab_gnome_desktop_item_new_from_unknown_id (
ditem = slab_key_file_new_from_unknown_id (
(gchar *) libslab_get_gconf_value (HELP_ITEM_GCONF_KEY));
else if (system_tile_type == 1)
ditem = libslab_gnome_desktop_item_new_from_unknown_id (
ditem = slab_key_file_new_from_unknown_id (
(gchar *) libslab_get_gconf_value (CC_ITEM_GCONF_KEY));
else if (system_tile_type == 2)
ditem = libslab_gnome_desktop_item_new_from_unknown_id (
ditem = slab_key_file_new_from_unknown_id (
(gchar *) libslab_get_gconf_value (PM_ITEM_GCONF_KEY));
else if (system_tile_type == 3) {
screensavers = libslab_get_gconf_value (LOCKSCREEN_GCONF_KEY);
......@@ -182,42 +182,34 @@ migrate_system_gconf_to_bookmark_file ()
cmd_path = g_find_program_in_path (argv [0]);
if (cmd_path) {
ditem = g_key_file_new ();
ditem = slab_key_file_new ();
path = g_build_filename (
g_get_user_data_dir (), PACKAGE, "lockscreen.desktop", NULL);
g_key_file_set_string (
slab_key_file_set_string (
ditem, G_KEY_FILE_DESKTOP_GROUP,
G_KEY_FILE_DESKTOP_KEY_NAME, _("Lock Screen"));
g_key_file_set_string (
slab_key_file_set_string (
ditem, G_KEY_FILE_DESKTOP_GROUP,
G_KEY_FILE_DESKTOP_KEY_ICON, "gnome-lockscreen");
g_key_file_set_string (
slab_key_file_set_string (
ditem, G_KEY_FILE_DESKTOP_GROUP,
G_KEY_FILE_DESKTOP_KEY_EXEC, exec_string);
g_key_file_set_boolean (
ditem, G_KEY_FILE_DESKTOP_GROUP,
G_KEY_FILE_DESKTOP_KEY_TERMINAL, FALSE);
g_key_file_set_string (
slab_key_file_set_string (ditem, G_KEY_FILE_DESKTOP_GROUP,
G_KEY_FILE_DESKTOP_KEY_TERMINAL, "false");
slab_key_file_set_string (
ditem, G_KEY_FILE_DESKTOP_GROUP,
G_KEY_FILE_DESKTOP_KEY_TYPE,
G_KEY_FILE_DESKTOP_TYPE_APPLICATION);
g_key_file_set_string (
slab_key_file_set_string (
ditem, G_KEY_FILE_DESKTOP_GROUP,
G_KEY_FILE_DESKTOP_KEY_CATEGORIES, "GNOME;GTK;");
g_key_file_set_string (
slab_key_file_set_string (
ditem, G_KEY_FILE_DESKTOP_GROUP,
G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN, "GNOME;");
{ /* save */
gsize length;
gchar *flat_text = g_key_file_to_data (ditem,
&length, NULL);
g_file_set_contents (path, flat_text, length, NULL);
}
slab_key_file_save (ditem, path);
g_free (path);
break;
}
......@@ -231,12 +223,12 @@ migrate_system_gconf_to_bookmark_file ()
g_list_free (screensavers);
}
else if (system_tile_type == 4)
ditem = libslab_gnome_desktop_item_new_from_unknown_id (LOGOUT_DESKTOP_ITEM);
ditem = slab_key_file_new_from_unknown_id (LOGOUT_DESKTOP_ITEM);
else
ditem = NULL;
if (ditem) {
loc = libslab_keyfile_get_location (ditem);
loc = slab_key_file_get_location (ditem);
if (g_path_is_absolute (loc))
uri = g_filename_to_uri (loc, NULL, NULL);
......@@ -250,10 +242,10 @@ migrate_system_gconf_to_bookmark_file ()
g_bookmark_file_set_mime_type (bm_file, uri, "application/x-desktop");
g_bookmark_file_add_application (
bm_file, uri,
libslab_keyfile_get_locale (ditem, G_KEY_FILE_DESKTOP_KEY_NAME),
libslab_keyfile_get_locale (ditem, G_KEY_FILE_DESKTOP_KEY_EXEC));
slab_key_file_get_locale (ditem, G_KEY_FILE_DESKTOP_KEY_NAME),
slab_key_file_get_locale (ditem, G_KEY_FILE_DESKTOP_KEY_EXEC));
name = libslab_keyfile_get (ditem, G_KEY_FILE_DESKTOP_KEY_NAME);
name = slab_key_file_get (ditem, G_KEY_FILE_DESKTOP_KEY_NAME);
if (! strcmp (name, "Yelp"))
g_bookmark_file_set_title (bm_file, uri, _("Help"));
......@@ -294,7 +286,7 @@ migrate_user_apps_gconf_to_bookmark_file ()
GList *user_apps_list;
GKeyFile *ditem;
SlabKeyFile *ditem;
const gchar *loc;
gchar *uri;
......@@ -322,10 +314,10 @@ migrate_user_apps_gconf_to_bookmark_file ()
bm_file = g_bookmark_file_new ();
for (node = user_apps_list; node; node = node->next) {
ditem = libslab_gnome_desktop_item_new_from_unknown_id ((gchar *) node->data);
ditem = slab_key_file_new_from_unknown_id ((gchar *) node->data);
if (ditem) {
loc = libslab_keyfile_get_location (ditem);
loc = slab_key_file_get_location (ditem);
if (g_path_is_absolute (loc))
uri = g_filename_to_uri (loc, NULL, NULL);
......@@ -339,8 +331,8 @@ migrate_user_apps_gconf_to_bookmark_file ()
g_bookmark_file_set_mime_type (bm_file, uri, "application/x-desktop");
g_bookmark_file_add_application (
bm_file, uri,
libslab_keyfile_get_locale (ditem, G_KEY_FILE_DESKTOP_KEY_NAME),
libslab_keyfile_get_locale (ditem, G_KEY_FILE_DESKTOP_KEY_EXEC));
slab_key_file_get_locale (ditem, G_KEY_FILE_DESKTOP_KEY_NAME),
slab_key_file_get_locale (ditem, G_KEY_FILE_DESKTOP_KEY_EXEC));
}
g_free (uri);
......
......@@ -1209,20 +1209,20 @@ app_is_in_blacklist (const gchar *uri)
disable_term = GPOINTER_TO_INT (libslab_get_gconf_value (DISABLE_TERMINAL_GCONF_KEY));
blacklisted = disable_term && libslab_desktop_item_is_a_terminal (uri);
blacklisted = disable_term && slab_key_file_is_a_terminal (uri);
if (blacklisted)
return TRUE;
disable_logout = GPOINTER_TO_INT (libslab_get_gconf_value (DISABLE_LOGOUT_GCONF_KEY));
blacklisted = disable_logout && libslab_desktop_item_is_logout (uri);
blacklisted = disable_logout && slab_key_file_is_logout (uri);
if (blacklisted)
return TRUE;
disable_lockscreen = GPOINTER_TO_INT (libslab_get_gconf_value (DISABLE_LOCKSCREEN_GCONF_KEY));
/* Dont allow lock screen if root - same as gnome-panel */
blacklisted = libslab_desktop_item_is_lockscreen (uri) &&
blacklisted = slab_key_file_is_lockscreen (uri) &&
( (geteuid () == 0) || disable_lockscreen );
if (blacklisted)
......@@ -2278,7 +2278,7 @@ more_buttons_clicked_cb (GtkButton *button, gpointer user_data)
GTimeVal current_time;
guint32 current_time_millis;
GKeyFile *ditem;
SlabKeyFile *ditem;
gchar *ditem_id;
gchar *cmd_template;
......@@ -2325,10 +2325,10 @@ more_buttons_clicked_cb (GtkButton *button, gpointer user_data)
else
ditem_id = libslab_get_gconf_value (FILE_BROWSER_GCONF_KEY);
ditem = libslab_gnome_desktop_item_new_from_unknown_id (ditem_id);
ditem = slab_key_file_new_from_unknown_id (ditem_id);
if (ditem) {
libslab_gnome_desktop_item_launch_default (ditem);
slab_key_file_launch_default (ditem);
hide_slab_if_urgent_close (this);
}
......
......@@ -449,5 +449,5 @@ launch_network_config (const gchar * desktop_key)
if (!open_desktop_item_exec (desktop_item))
g_warning ("network_status_tile_open: couldn't exec item\n");
gnome_desktop_item_unref (desktop_item);
slab_key_file_unref (desktop_item);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment