[glib/wip/gapplication: 3/5] application: Fix ::action signal marshaller



commit aa971e204ad2b25b05091b157d99d72fa6fea15b
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Tue May 18 09:45:11 2010 +0100

    application: Fix ::action signal marshaller
    
    The ::action signal passes the action name and the timestamp, but its
    marshaller is defined as passing only an integer. It kind of worked just
    because it's passing a pointer to a C string.

 gio/gapplication.c      |    5 +++--
 gio/gio-marshal.list    |    1 +
 gio/tests/application.c |   10 ++++++++++
 3 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/gio/gapplication.c b/gio/gapplication.c
index c7dbd32..7879e0e 100644
--- a/gio/gapplication.c
+++ b/gio/gapplication.c
@@ -475,8 +475,9 @@ g_application_class_init (GApplicationClass *klass)
 		  G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE | G_SIGNAL_DETAILED,
 		  G_STRUCT_OFFSET (GApplicationClass, action),
                   NULL, NULL,
-                  _gio_marshal_VOID__INT,
-		  G_TYPE_NONE, 1,
+                  _gio_marshal_VOID__STRING_INT,
+		  G_TYPE_NONE, 2,
+                  G_TYPE_STRING,
                   G_TYPE_INT); 
  
    /**
diff --git a/gio/gio-marshal.list b/gio/gio-marshal.list
index 644dfdc..8924e40 100644
--- a/gio/gio-marshal.list
+++ b/gio/gio-marshal.list
@@ -10,3 +10,4 @@ VOID:STRING,STRING,BOXED
 VOID:BOOL,BOXED
 VOID:BOXED,BOXED
 VOID:INT
+VOID:STRING,INT
diff --git a/gio/tests/application.c b/gio/tests/application.c
index 71526d1..c934d80 100644
--- a/gio/tests/application.c
+++ b/gio/tests/application.c
@@ -18,8 +18,18 @@ static gboolean action_invoked = FALSE;
 
 static void
 on_app_action (GApplication *application,
+               const gchar  *action_name,
                guint         action_timestamp)
 {
+  if (g_test_verbose ())
+    g_print ("Action '%s' invoked (timestamp: %u, expected: %u)\n",
+             action_name,
+             action_timestamp,
+             timestamp);
+
+  g_assert_cmpstr (action_name, ==, "About");
+  g_assert_cmpint (action_timestamp, ==, timestamp);
+
   action_invoked = TRUE;
 }
 



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