]> git.0d.be Git - empathy.git/commitdiff
tpaw-utils: move empathy_implement_finish_* to tp-aw and rename them
authorMarco Barisione <marco.barisione@collabora.co.uk>
Thu, 9 May 2013 16:10:17 +0000 (17:10 +0100)
committerMarco Barisione <marco.barisione@collabora.co.uk>
Tue, 20 Aug 2013 10:03:06 +0000 (11:03 +0100)
All the code was initially written for wocky which is under LGPL.

https://bugzilla.gnome.org/show_bug.cgi?id=699492

libempathy/empathy-client-factory.c
libempathy/empathy-individual-manager.c
libempathy/empathy-sasl-mechanisms.c
libempathy/empathy-utils.h
src/empathy-audio-src.c
src/empathy-mic-monitor.c
tp-account-widgets/tpaw-avatar-chooser.c
tp-account-widgets/tpaw-keyring.c
tp-account-widgets/tpaw-user-info.c
tp-account-widgets/tpaw-utils.h

index 39760998c54cfad4ab36ed37b1dbb957284701e7..e82b8620be404db6511db7a8a68980c65f231adf 100644 (file)
@@ -22,6 +22,8 @@
 #include "config.h"
 #include "empathy-client-factory.h"
 
+#include <tp-account-widgets/tpaw-utils.h>
+
 #include "empathy-tp-chat.h"
 #include "empathy-utils.h"
 
@@ -274,6 +276,6 @@ empathy_client_factory_dup_contact_by_id_finish (
     GAsyncResult *result,
     GError **error)
 {
-  empathy_implement_finish_return_copy_pointer (self,
+  tpaw_implement_finish_return_copy_pointer (self,
       empathy_client_factory_dup_contact_by_id_async, g_object_ref);
 }
index 71960b5d2887d409a2049a689561b35721870d67..8518985318029207889c93e78cb2ab6183b6b598 100644 (file)
@@ -23,6 +23,8 @@
 #include "config.h"
 #include "empathy-individual-manager.h"
 
+#include <tp-account-widgets/tpaw-utils.h>
+
 #include "empathy-utils.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_CONTACT
@@ -946,6 +948,6 @@ empathy_individual_manager_unprepare_finish (
     GAsyncResult *result,
     GError **error)
 {
-  empathy_implement_finish_void (self,
+  tpaw_implement_finish_void (self,
       empathy_individual_manager_unprepare_async)
 }
index a6829c4504adc508316fcd3fc30c0a8d6f7872f4..75a924f0c9313d41bdee1a64f8433d4d8ddc81d3 100644 (file)
@@ -22,6 +22,7 @@
 #include "empathy-sasl-mechanisms.h"
 
 #include <libsoup/soup.h>
+#include <tp-account-widgets/tpaw-utils.h>
 
 #define DEBUG_FLAG EMPATHY_DEBUG_SASL
 #include "empathy-debug.h"
@@ -336,7 +337,7 @@ empathy_sasl_auth_finish (TpChannel *channel,
     GAsyncResult *result,
     GError **error)
 {
-  empathy_implement_finish_void (channel, empathy_sasl_auth_common_async);
+  tpaw_implement_finish_void (channel, empathy_sasl_auth_common_async);
 }
 
 gboolean
index fe194bdc167774fd6b911c42c45a7418c8ac1703..c62083241b5d3ac45ac43e459f8738f3b84522aa 100644 (file)
@@ -120,51 +120,6 @@ GVariant * empathy_boxed_to_variant (GType gtype,
     const gchar *variant_type,
     gpointer boxed);
 
-/* Copied from wocky/wocky-utils.h */
-
-#define empathy_implement_finish_void(source, tag) \
-    if (g_simple_async_result_propagate_error (\
-      G_SIMPLE_ASYNC_RESULT (result), error)) \
-      return FALSE; \
-    g_return_val_if_fail (g_simple_async_result_is_valid (result, \
-            G_OBJECT(source), tag), \
-        FALSE); \
-    return TRUE;
-
-#define empathy_implement_finish_copy_pointer(source, tag, copy_func, \
-    out_param) \
-    GSimpleAsyncResult *_simple; \
-    _simple = (GSimpleAsyncResult *) result; \
-    if (g_simple_async_result_propagate_error (_simple, error)) \
-      return FALSE; \
-    g_return_val_if_fail (g_simple_async_result_is_valid (result, \
-            G_OBJECT (source), tag), \
-        FALSE); \
-    if (out_param != NULL) \
-      *out_param = copy_func ( \
-          g_simple_async_result_get_op_res_gpointer (_simple)); \
-    return TRUE;
-
-#define empathy_implement_finish_return_copy_pointer(source, tag, copy_func) \
-    GSimpleAsyncResult *_simple; \
-    _simple = (GSimpleAsyncResult *) result; \
-    if (g_simple_async_result_propagate_error (_simple, error)) \
-      return NULL; \
-    g_return_val_if_fail (g_simple_async_result_is_valid (result, \
-            G_OBJECT (source), tag), \
-        NULL); \
-    return copy_func (g_simple_async_result_get_op_res_gpointer (_simple));
-
-#define empathy_implement_finish_return_pointer(source, tag) \
-    GSimpleAsyncResult *_simple; \
-    _simple = (GSimpleAsyncResult *) result; \
-    if (g_simple_async_result_propagate_error (_simple, error)) \
-      return NULL; \
-    g_return_val_if_fail (g_simple_async_result_is_valid (result, \
-            G_OBJECT (source), tag), \
-        NULL); \
-    return g_simple_async_result_get_op_res_gpointer (_simple);
-
 G_END_DECLS
 
 #endif /*  __EMPATHY_UTILS_H__ */
index bc3aa50cd77fcafe345af36b2eb9ab85a78d322c..fcca6621dad74d917eb61bdef0c02559775d4723 100644 (file)
@@ -21,6 +21,8 @@
 #include "config.h"
 #include "empathy-audio-src.h"
 
+#include <tp-account-widgets/tpaw-utils.h>
+
 #ifdef HAVE_GST1
 #include <gst/audio/streamvolume.h>
 #else
@@ -623,7 +625,7 @@ empathy_audio_src_change_microphone_finish (EmpathyGstAudioSrc *src,
     GAsyncResult *result,
     GError **error)
 {
-  empathy_implement_finish_void (src,
+  tpaw_implement_finish_void (src,
       empathy_audio_src_change_microphone_async);
 }
 
index ae2b0c071de60cb5fe185efb6c7df080d45706bd..a97f70e0d5d6c181156bba027838f3c1d3eaa0b2 100644 (file)
@@ -21,6 +21,7 @@
 #include "empathy-mic-monitor.h"
 
 #include <pulse/glib-mainloop.h>
+#include <tp-account-widgets/tpaw-utils.h>
 
 #include "empathy-utils.h"
 
@@ -475,7 +476,7 @@ empathy_mic_monitor_change_microphone_finish (EmpathyMicMonitor *self,
     GAsyncResult *result,
     GError **error)
 {
-  empathy_implement_finish_void (self,
+  tpaw_implement_finish_void (self,
       empathy_mic_monitor_change_microphone_async);
 }
 
@@ -613,7 +614,7 @@ empathy_mic_monitor_get_default_finish (EmpathyMicMonitor *self,
     GAsyncResult *result,
     GError **error)
 {
-  empathy_implement_finish_return_pointer (self,
+  tpaw_implement_finish_return_pointer (self,
       empathy_mic_monitor_get_default_async);
 }
 
@@ -677,6 +678,6 @@ empathy_mic_monitor_set_default_finish (EmpathyMicMonitor *self,
     GAsyncResult *result,
     GError **error)
 {
-  empathy_implement_finish_void (self,
+  tpaw_implement_finish_void (self,
       empathy_mic_monitor_set_default_async);
 }
index 7d28c4217bb98af4601243fff2480d428c1ac831..6813cb673f40f189b193fe1221e33ddee89e17c2 100644 (file)
@@ -27,6 +27,7 @@
 #include <tp-account-widgets/tpaw-camera-monitor.h>
 #include <tp-account-widgets/tpaw-gsettings.h>
 #include <tp-account-widgets/tpaw-images.h>
+#include <tp-account-widgets/tpaw-utils.h>
 
 #ifdef HAVE_CHEESE
 #include <cheese-avatar-chooser.h>
@@ -1218,5 +1219,5 @@ tpaw_avatar_chooser_apply_finish (TpawAvatarChooser *self,
     GAsyncResult *result,
     GError **error)
 {
-  empathy_implement_finish_void (self, tpaw_avatar_chooser_apply_async);
+  tpaw_implement_finish_void (self, tpaw_avatar_chooser_apply_async);
 }
index 94bbd93e0bfa17d0de6f39d423459c1ef7c1feea..0de6f8b5d85d5c523d80ff2477b3a57879434aec 100644 (file)
@@ -33,6 +33,7 @@
 #endif
 
 #include "empathy-utils.h"
+#include "tpaw-utils.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_OTHER
 #include "empathy-debug.h"
@@ -324,7 +325,7 @@ tpaw_keyring_get_account_password_finish (TpAccount *account,
     GAsyncResult *result,
     GError **error)
 {
-  empathy_implement_finish_return_pointer (account,
+  tpaw_implement_finish_return_pointer (account,
       tpaw_keyring_get_account_password_async);
 }
 
@@ -333,7 +334,7 @@ tpaw_keyring_get_room_password_finish (TpAccount *account,
     GAsyncResult *result,
     GError **error)
 {
-  empathy_implement_finish_return_pointer (account,
+  tpaw_implement_finish_return_pointer (account,
       tpaw_keyring_get_room_password_async);
 }
 
@@ -637,7 +638,7 @@ tpaw_keyring_set_account_password_finish (TpAccount *account,
     GAsyncResult *result,
     GError **error)
 {
-  empathy_implement_finish_void (account, tpaw_keyring_set_account_password_async);
+  tpaw_implement_finish_void (account, tpaw_keyring_set_account_password_async);
 }
 
 gboolean
@@ -645,7 +646,7 @@ tpaw_keyring_set_room_password_finish (TpAccount *account,
     GAsyncResult *result,
     GError **error)
 {
-  empathy_implement_finish_void (account, tpaw_keyring_set_room_password_async);
+  tpaw_implement_finish_void (account, tpaw_keyring_set_room_password_async);
 }
 
 /* delete */
@@ -716,5 +717,5 @@ tpaw_keyring_delete_account_password_finish (TpAccount *account,
     GAsyncResult *result,
     GError **error)
 {
-  empathy_implement_finish_void (account, tpaw_keyring_delete_account_password_async);
+  tpaw_implement_finish_void (account, tpaw_keyring_delete_account_password_async);
 }
index 9a4843fe96c84f8967db06bcdfd99f9e8193889d..5dddd88a0550ec0b0d1e1d21677c55d534d72f96 100644 (file)
@@ -25,6 +25,7 @@
 #include <tp-account-widgets/tpaw-calendar-button.h>
 #include <tp-account-widgets/tpaw-contactinfo-utils.h>
 #include <tp-account-widgets/tpaw-time.h>
+#include <tp-account-widgets/tpaw-utils.h>
 
 #include "empathy-utils.h"
 
@@ -772,5 +773,5 @@ tpaw_user_info_apply_finish (TpawUserInfo *self,
     GAsyncResult *result,
     GError **error)
 {
-  empathy_implement_finish_void (self, tpaw_user_info_apply_async);
+  tpaw_implement_finish_void (self, tpaw_user_info_apply_async);
 }
index d38a7a7b55e6c928c5c36ba7165719db80a10a96..c648ae804c3c8e8df927e3f54bcf3d4c9120f583 100644 (file)
@@ -38,6 +38,51 @@ const gchar *tpaw_service_name_to_display_name (const gchar *proto_name);
 
 void  tpaw_make_color_whiter (GdkRGBA *color);
 
+/* Copied from wocky/wocky-utils.h */
+
+#define tpaw_implement_finish_void(source, tag) \
+    if (g_simple_async_result_propagate_error (\
+      G_SIMPLE_ASYNC_RESULT (result), error)) \
+      return FALSE; \
+    g_return_val_if_fail (g_simple_async_result_is_valid (result, \
+            G_OBJECT(source), tag), \
+        FALSE); \
+    return TRUE;
+
+#define tpaw_implement_finish_copy_pointer(source, tag, copy_func, \
+    out_param) \
+    GSimpleAsyncResult *_simple; \
+    _simple = (GSimpleAsyncResult *) result; \
+    if (g_simple_async_result_propagate_error (_simple, error)) \
+      return FALSE; \
+    g_return_val_if_fail (g_simple_async_result_is_valid (result, \
+            G_OBJECT (source), tag), \
+        FALSE); \
+    if (out_param != NULL) \
+      *out_param = copy_func ( \
+          g_simple_async_result_get_op_res_gpointer (_simple)); \
+    return TRUE;
+
+#define tpaw_implement_finish_return_copy_pointer(source, tag, copy_func) \
+    GSimpleAsyncResult *_simple; \
+    _simple = (GSimpleAsyncResult *) result; \
+    if (g_simple_async_result_propagate_error (_simple, error)) \
+      return NULL; \
+    g_return_val_if_fail (g_simple_async_result_is_valid (result, \
+            G_OBJECT (source), tag), \
+        NULL); \
+    return copy_func (g_simple_async_result_get_op_res_gpointer (_simple));
+
+#define tpaw_implement_finish_return_pointer(source, tag) \
+    GSimpleAsyncResult *_simple; \
+    _simple = (GSimpleAsyncResult *) result; \
+    if (g_simple_async_result_propagate_error (_simple, error)) \
+      return NULL; \
+    g_return_val_if_fail (g_simple_async_result_is_valid (result, \
+            G_OBJECT (source), tag), \
+        NULL); \
+    return g_simple_async_result_get_op_res_gpointer (_simple);
+
 G_END_DECLS
 
 #endif /*  __TPAW_UTILS_H__ */