[Xfce4-commits] <xfce4-settings:jeromeg/clipboard-daemon> Add some assertions.

Jérôme Guelfucci noreply at xfce.org
Thu Nov 19 00:48:10 CET 2009


Updating branch refs/heads/jeromeg/clipboard-daemon
         to 889a9bedfb718900bd496eaa267f20f788b96be2 (commit)
       from f96050f02c32bcdc904118529c64f4a8578af4da (commit)

commit 889a9bedfb718900bd496eaa267f20f788b96be2
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date:   Wed Nov 18 09:49:22 2009 +0100

    Add some assertions.

 xfce4-settings-helper/xfce-clipboard-manager.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/xfce4-settings-helper/xfce-clipboard-manager.c b/xfce4-settings-helper/xfce-clipboard-manager.c
index bd0197e..a32eb06 100644
--- a/xfce4-settings-helper/xfce-clipboard-manager.c
+++ b/xfce4-settings-helper/xfce-clipboard-manager.c
@@ -80,6 +80,8 @@ default_clipboard_store (XfceClipboardManager *manager)
   gint              n_atoms;
   gint              i;
 
+  g_return_if_fail (XFCE_IS_CLIPBOARD_MANAGER (manager));
+
   if (!gtk_clipboard_wait_for_targets (manager->priv->default_clipboard, &atoms, &n_atoms))
     return;
 
@@ -120,6 +122,8 @@ default_clipboard_get_func (GtkClipboard *clipboard,
   GSList           *list;
   GtkSelectionData *selection_data_cache = NULL;
 
+  g_return_if_fail (XFCE_IS_CLIPBOARD_MANAGER (manager));
+
   list = manager->priv->default_cache;
 
   for (; list->next != NULL; list = list->next)
@@ -158,6 +162,8 @@ default_clipboard_restore (XfceClipboardManager *manager)
   GtkSelectionData *sdata;
   GSList           *list;
 
+  g_return_if_fail (XFCE_IS_CLIPBOARD_MANAGER (manager));
+
   target_list = gtk_target_list_new (NULL, 0);
   list = manager->priv->default_cache;
 
@@ -180,6 +186,8 @@ static void
 default_clipboard_owner_change (XfceClipboardManager *manager,
                                 GdkEventOwnerChange *event)
 {
+  g_return_if_fail (XFCE_IS_CLIPBOARD_MANAGER (manager));
+
   if (event->send_event == TRUE)
     return;
 
@@ -218,6 +226,8 @@ primary_clipboard_owner_change (XfceClipboardManager *manager,
 {
   gchar *text;
 
+  g_return_if_fail (XFCE_IS_CLIPBOARD_MANAGER (manager));
+
   if (event->send_event == TRUE)
     return;
 
@@ -302,6 +312,8 @@ start_clipboard_idle_cb (XfceClipboardManager *manager)
 gboolean
 xfce_clipboard_manager_start (XfceClipboardManager *manager)
 {
+  g_return_if_fail (XFCE_IS_CLIPBOARD_MANAGER (manager));
+
   g_idle_add ((GSourceFunc) start_clipboard_idle_cb, manager);
 
   return TRUE;
@@ -310,6 +322,8 @@ xfce_clipboard_manager_start (XfceClipboardManager *manager)
 void
 xfce_clipboard_manager_stop (XfceClipboardManager *manager)
 {
+  g_return_if_fail (XFCE_IS_CLIPBOARD_MANAGER (manager));
+
   g_debug ("Stopping clipboard manager");
 
   g_signal_handlers_disconnect_by_func (manager->priv->default_clipboard,



More information about the Xfce4-commits mailing list