[gnome-terminal] Update smclient from libegg
- From: Christian Persch <chpe src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-terminal] Update smclient from libegg
- Date: Fri, 26 Jun 2009 15:02:22 +0000 (UTC)
commit 572a8de1d860b4021a54228637bc96d19502312a
Author: Christian Persch <chpe gnome org>
Date: Fri Jun 26 17:01:15 2009 +0200
Update smclient from libegg
Pull in the latest smclient fixes from libegg. Call
egg_set_desktop_file_without_defaults() instead of
egg_set_desktop_file().
src/eggdesktopfile.c | 69 +++++++++++++++++++++++++++++++++++--------------
src/eggdesktopfile.h | 5 ++-
src/terminal.c | 2 +-
3 files changed, 53 insertions(+), 23 deletions(-)
---
diff --git a/src/eggdesktopfile.c b/src/eggdesktopfile.c
index ab0571f..af8a98e 100644
--- a/src/eggdesktopfile.c
+++ b/src/eggdesktopfile.c
@@ -1410,23 +1410,9 @@ egg_desktop_file_error_quark (void)
G_LOCK_DEFINE_STATIC (egg_desktop_file);
static EggDesktopFile *egg_desktop_file;
-/**
- * egg_set_desktop_file:
- * @desktop_file_path: path to the application's desktop file
- *
- * Creates an #EggDesktopFile for the application from the data at
- * @desktop_file_path. This will also call g_set_application_name()
- * with the localized application name from the desktop file, and
- * gtk_window_set_default_icon_name() or
- * gtk_window_set_default_icon_from_file() with the application's
- * icon. Other code may use additional information from the desktop
- * file.
- *
- * Note that for thread safety reasons, this function can only
- * be called once.
- **/
-void
-egg_set_desktop_file (const char *desktop_file_path)
+static void
+egg_set_desktop_file_internal (const char *desktop_file_path,
+ gboolean set_defaults)
{
GError *error = NULL;
@@ -1442,8 +1428,7 @@ egg_set_desktop_file (const char *desktop_file_path)
g_error_free (error);
}
-#if 0
- if (egg_desktop_file) {
+ if (set_defaults && egg_desktop_file != NULL) {
/* Set localized application name and default window icon */
if (egg_desktop_file->name)
g_set_application_name (egg_desktop_file->name);
@@ -1455,12 +1440,56 @@ egg_set_desktop_file (const char *desktop_file_path)
gtk_window_set_default_icon_name (egg_desktop_file->icon);
}
}
-#endif
G_UNLOCK (egg_desktop_file);
}
/**
+ * egg_set_desktop_file:
+ * @desktop_file_path: path to the application's desktop file
+ *
+ * Creates an #EggDesktopFile for the application from the data at
+ * @desktop_file_path. This will also call g_set_application_name()
+ * with the localized application name from the desktop file, and
+ * gtk_window_set_default_icon_name() or
+ * gtk_window_set_default_icon_from_file() with the application's
+ * icon. Other code may use additional information from the desktop
+ * file.
+ * See egg_set_desktop_file_without_defaults() for a variant of this
+ * function that does not set the application name and default window
+ * icon.
+ *
+ * Note that for thread safety reasons, this function can only
+ * be called once, and is mutually exclusive with calling
+ * egg_set_desktop_file_without_defaults().
+ **/
+void
+egg_set_desktop_file (const char *desktop_file_path)
+{
+ egg_set_desktop_file_internal (desktop_file_path, TRUE);
+}
+
+/**
+ * egg_set_desktop_file_without_defaults:
+ * @desktop_file_path: path to the application's desktop file
+ *
+ * Creates an #EggDesktopFile for the application from the data at
+ * @desktop_file_path.
+ * See egg_set_desktop_file() for a variant of this function that
+ * sets the application name and default window icon from the information
+ * in the desktop file.
+ *
+ * Note that for thread safety reasons, this function can only
+ * be called once, and is mutually exclusive with calling
+ * egg_set_desktop_file().
+ **/
+void
+egg_set_desktop_file_without_defaults (const char *desktop_file_path)
+{
+ egg_set_desktop_file_internal (desktop_file_path, FALSE);
+}
+
+/**
* egg_get_desktop_file:
*
* Gets the application's #EggDesktopFile, as set by
diff --git a/src/eggdesktopfile.h b/src/eggdesktopfile.h
index f8a3d3e..18fe463 100644
--- a/src/eggdesktopfile.h
+++ b/src/eggdesktopfile.h
@@ -150,8 +150,9 @@ typedef enum {
} EggDesktopFileError;
/* Global application desktop file */
-void egg_set_desktop_file (const char *desktop_file_path);
-EggDesktopFile *egg_get_desktop_file (void);
+void egg_set_desktop_file (const char *desktop_file_path);
+void egg_set_desktop_file_without_defaults (const char *desktop_file_path);
+EggDesktopFile *egg_get_desktop_file (void);
G_END_DECLS
diff --git a/src/terminal.c b/src/terminal.c
index c27abe1..1611a75 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -469,7 +469,7 @@ factory_disabled:
"applications",
PACKAGE ".desktop",
NULL);
- egg_set_desktop_file (desktop_file);
+ egg_set_desktop_file_without_defaults (desktop_file);
g_free (desktop_file);
}
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]