[devhelp] app: add g_returns to public methods



commit 1948434fc275b4f6ba45138847abdccf03e2d1bc
Author: Ignacio Casal Quinteiro <ignacio casal nice-software com>
Date:   Tue Aug 13 08:41:08 2013 +0200

    app: add g_returns to public methods

 src/dh-app.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/dh-app.c b/src/dh-app.c
index 5af1056..dfd8139 100644
--- a/src/dh-app.c
+++ b/src/dh-app.c
@@ -55,6 +55,8 @@ dh_app_peek_first_window (DhApp *app)
 {
         GList *l;
 
+        g_return_val_if_fail (DH_IS_APP (app), NULL);
+
         for (l = gtk_application_get_windows (GTK_APPLICATION (app));
              l;
              l = g_list_next (l)) {
@@ -75,6 +77,8 @@ dh_app_peek_assistant (DhApp *app)
 {
         GList *l;
 
+        g_return_val_if_fail (DH_IS_APP (app), NULL);
+
         for (l = gtk_application_get_windows (GTK_APPLICATION (app));
              l;
              l = g_list_next (l)) {
@@ -115,12 +119,16 @@ _dh_app_has_app_menu (DhApp *app)
 void
 dh_app_new_window (DhApp *app)
 {
+        g_return_if_fail (DH_IS_APP (app));
+
         g_action_group_activate_action (G_ACTION_GROUP (app), "new-window", NULL);
 }
 
 void
 dh_app_quit (DhApp *app)
 {
+        g_return_if_fail (DH_IS_APP (app));
+
         g_action_group_activate_action (G_ACTION_GROUP (app), "quit", NULL);
 }
 
@@ -128,6 +136,8 @@ void
 dh_app_search (DhApp *app,
                const gchar *keyword)
 {
+        g_return_if_fail (DH_IS_APP (app));
+
         g_action_group_activate_action (G_ACTION_GROUP (app), "search", g_variant_new_string (keyword));
 }
 
@@ -135,12 +145,16 @@ void
 dh_app_search_assistant (DhApp *app,
                          const gchar *keyword)
 {
+        g_return_if_fail (DH_IS_APP (app));
+
         g_action_group_activate_action (G_ACTION_GROUP (app), "search-assistant", g_variant_new_string 
(keyword));
 }
 
 void
 dh_app_raise (DhApp *app)
 {
+        g_return_if_fail (DH_IS_APP (app));
+
         g_action_group_activate_action (G_ACTION_GROUP (app), "raise", NULL);
 }
 


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