[gtk+/gtk-3-4] gtk-demo: Find gtk-demo-application.exe on win32



commit 16cb9a27a5862acbd7b2b97461d8646f51ba7e1c
Author: Alexander Larsson <alexl redhat com>
Date:   Fri Apr 20 16:00:48 2012 +0200

    gtk-demo: Find gtk-demo-application.exe on win32
    
    We need to append the ".exe" extension when looking for the
    application file on windows.

 demos/gtk-demo/application.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/demos/gtk-demo/application.c b/demos/gtk-demo/application.c
index 6b9d074..af4e4e4 100644
--- a/demos/gtk-demo/application.c
+++ b/demos/gtk-demo/application.c
@@ -427,6 +427,12 @@ on_name_vanished (GDBusConnection *connection,
     }
 }
 
+#ifdef G_OS_WIN32
+#define APP_EXTENSION ".exe"
+#else
+#define APP_EXTENSION
+#endif
+
 GtkWidget *
 do_application (GtkWidget *toplevel)
 {
@@ -445,8 +451,8 @@ do_application (GtkWidget *toplevel)
       const gchar *command;
       GError *error = NULL;
 
-      if (g_file_test ("./gtk3-demo-application", G_FILE_TEST_IS_EXECUTABLE))
-        command = "./gtk3-demo-application";
+      if (g_file_test ("./gtk3-demo-application" APP_EXTENSION, G_FILE_TEST_IS_EXECUTABLE))
+        command = "./gtk3-demo-application" APP_EXTENSION;
       else
         command = "gtk3-demo-application";
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]