[gnome-main-menu/gnome-3: 5/6] switch to slab_key_file pieces ...
- From: Michael Meeks <michael src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-main-menu/gnome-3: 5/6] switch to slab_key_file pieces ...
- Date: Mon, 26 Sep 2011 14:50:38 +0000 (UTC)
commit 33c4a4a97b725587bed003b2d43b147a3d733889
Author: Michael Meeks <michael meeks suse com>
Date: Mon Sep 26 15:48:31 2011 +0100
switch to slab_key_file pieces ...
main-menu/src/hard-drive-status-tile.c | 4 +-
main-menu/src/main-menu-migration.c | 56 +++++++++++++-----------------
main-menu/src/main-menu-ui.c | 12 +++---
main-menu/src/network-status-tile.c | 2 +-
main-menu/src/trigger-panel-run-dialog.c | 8 ++--
5 files changed, 37 insertions(+), 45 deletions(-)
---
diff --git a/main-menu/src/hard-drive-status-tile.c b/main-menu/src/hard-drive-status-tile.c
index f36e026..3aea599 100644
--- a/main-menu/src/hard-drive-status-tile.c
+++ b/main-menu/src/hard-drive-status-tile.c
@@ -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");
diff --git a/main-menu/src/main-menu-migration.c b/main-menu/src/main-menu-migration.c
index cbf505f..caf0e11 100644
--- a/main-menu/src/main-menu-migration.c
+++ b/main-menu/src/main-menu-migration.c
@@ -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);
diff --git a/main-menu/src/main-menu-ui.c b/main-menu/src/main-menu-ui.c
index 61f22ad..eeddafa 100644
--- a/main-menu/src/main-menu-ui.c
+++ b/main-menu/src/main-menu-ui.c
@@ -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);
}
diff --git a/main-menu/src/network-status-tile.c b/main-menu/src/network-status-tile.c
index 655d9e7..96f55df 100644
--- a/main-menu/src/network-status-tile.c
+++ b/main-menu/src/network-status-tile.c
@@ -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);
}
diff --git a/main-menu/src/trigger-panel-run-dialog.c b/main-menu/src/trigger-panel-run-dialog.c
index 0416904..a236e50 100644
--- a/main-menu/src/trigger-panel-run-dialog.c
+++ b/main-menu/src/trigger-panel-run-dialog.c
@@ -25,12 +25,12 @@ run_dialog (GdkDisplay *display, GdkScreen *screen, guint32 timestamp)
ev.format = 32;
ev.data.l[0] = atom;
ev.data.l[1] = timestamp;
-
+
gdk_error_trap_push ();
-
+
XSendEvent (gdk_x11_display_get_xdisplay (display),
root, False, StructureNotifyMask, (XEvent*) &ev);
-
+
gdk_flush ();
gdk_error_trap_pop ();
}
@@ -40,7 +40,7 @@ main (int argc, char **argv)
{
gint lastentry = 0;
guint32 timestamp;
-
+
const gchar* startup_id = g_getenv ("DESKTOP_STARTUP_ID");
//printf ("startup id is %s\n", startup_id);
if (startup_id && (startup_id[0] != '\0'))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]