]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-avatar.c
Make use of tp-glib debug system.
[empathy.git] / libempathy / empathy-avatar.c
index efce645bad477ca882e292fc14188a6b7e999982..41395d6e9880647d5fcdaf73607cd352ba2d6242 100644 (file)
@@ -1,7 +1,7 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * Copyright (C) 2006 Xavier Claessens <xclaesse@gmail.com>
- * Copyright (C) 2007 Collabora Ltd.
+ * Copyright (C) 2007-2008 Collabora Ltd.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * Authors: Xavier Claessens <xclaesse@gmail.com>
  */
 
+
 #include "config.h"
 
 #include <telepathy-glib/util.h>
 
 #include "empathy-avatar.h"
 #include "empathy-utils.h"
-#include "empathy-debug.h"
 
-#define DEBUG_DOMAIN "Avatar"
+#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
+#include "empathy-debug.h"
 
 GType
 empathy_avatar_get_type (void)
@@ -109,12 +110,11 @@ empathy_avatar_new (const guchar *data,
        filename = avatar_get_filename (token);
        if (!g_file_test (filename, G_FILE_TEST_EXISTS)) {
                if (!g_file_set_contents (filename, data, len, &error)) {
-                       empathy_debug (DEBUG_DOMAIN,
-                                      "Failed to save avatar in cache: %s",
-                                      error ? error->message : "No error given");
+                       DEBUG ("Failed to save avatar in cache: %s",
+                               error ? error->message : "No error given");
                        g_clear_error (&error);
                } else {
-                       empathy_debug (DEBUG_DOMAIN, "Avatar saved to %s", filename);
+                       DEBUG ("Avatar saved to %s", filename);
                }
        }
        g_free (filename);
@@ -137,15 +137,14 @@ empathy_avatar_new_from_cache (const gchar *token)
        filename = avatar_get_filename (token);
        if (g_file_test (filename, G_FILE_TEST_EXISTS)) {
                if (!g_file_get_contents (filename, &data, &len, &error)) {
-                       empathy_debug (DEBUG_DOMAIN,
-                                      "Failed to load avatar from cache: %s",
-                                      error ? error->message : "No error given");
+                       DEBUG ("Failed to load avatar from cache: %s",
+                               error ? error->message : "No error given");
                        g_clear_error (&error);
                }
        }
 
        if (data) {
-               empathy_debug (DEBUG_DOMAIN, "Avatar loaded from %s", filename);
+               DEBUG ("Avatar loaded from %s", filename);
                avatar = avatar_new (data, len, NULL, g_strdup (token));
        }