summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHib Eris <hib@hiberis.nl>2012-10-28 20:05:23 +0100
committerHib Eris <hib@hiberis.nl>2012-10-29 09:36:41 +0100
commit99e194e7cc76c420c42562e2c77876d225975430 (patch)
tree8d01e292c4211725e7193373dd689bc2e5001cff
parent63c75a23847f5e46c599ae5417f6b755a886ce48 (diff)
downloadgtk+-99e194e7cc76c420c42562e2c77876d225975430.tar.gz
Fix compiling for win32
https://bugzilla.gnome.org/show_bug.cgi?id=687066
-rw-r--r--gtk/gtk-launch.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gtk/gtk-launch.c b/gtk/gtk-launch.c
index 6d5be1ccad..7a15ffe8c9 100644
--- a/gtk/gtk-launch.c
+++ b/gtk/gtk-launch.c
@@ -28,7 +28,9 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
+#ifdef G_OS_UNIX
#include <gio/gdesktopappinfo.h>
+#endif
#include <gtk.h>
static gchar **args = NULL;
@@ -45,8 +47,10 @@ main (int argc, char *argv[])
GOptionContext *context = NULL;
gchar *summary;
gchar *app_name;
+#ifdef G_OS_UNIX
gchar *desktop_file_name;
- GDesktopAppInfo *info;
+#endif
+ GAppInfo *info = NULL;
GAppLaunchContext *launch_context;
GList *l;
GFile *f;
@@ -107,12 +111,17 @@ main (int argc, char *argv[])
gtk_init (&argc, &argv);
app_name = *args;
+#ifdef G_OS_UNIX
if (g_str_has_suffix (app_name, ".desktop"))
desktop_file_name = g_strdup (app_name);
else
desktop_file_name = g_strconcat (app_name, ".desktop", NULL);
- info = g_desktop_app_info_new (desktop_file_name);
+ info = G_APP_INFO (g_desktop_app_info_new (desktop_file_name));
g_free (desktop_file_name);
+#else
+#warning Please add support for creating AppInfo from id for your OS
+ g_printerr (_("Creating AppInfo from id not supported on non unix operating systems"));
+#endif
args++;
if (!info)
@@ -133,7 +142,7 @@ main (int argc, char *argv[])
}
launch_context = (GAppLaunchContext*) gdk_display_get_app_launch_context (gdk_display_get_default ());
- if (!g_app_info_launch (G_APP_INFO (info), l, launch_context, &error))
+ if (!g_app_info_launch (info, l, launch_context, &error))
{
/* Translators: the first %s is the program name, the second one */
/* is the error message. */