]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-theme-adium.c
Updated Kannada translation
[empathy.git] / libempathy-gtk / empathy-theme-adium.c
index 31715c305058dc99da393ff11a7f4090a7e04bfc..a870702ac975094ffb9ba27c746ecf7522f7aee8 100644 (file)
 #include "empathy-theme-adium.h"
 
 #include <glib/gi18n-lib.h>
+#include <tp-account-widgets/tpaw-images.h>
+#include <tp-account-widgets/tpaw-time.h>
+#include <tp-account-widgets/tpaw-pixbuf-utils.h>
+#include <tp-account-widgets/tpaw-utils.h>
 
 #include "empathy-gsettings.h"
 #include "empathy-images.h"
 #include "empathy-plist.h"
 #include "empathy-smiley-manager.h"
-#include "empathy-time.h"
 #include "empathy-ui-utils.h"
 #include "empathy-utils.h"
 #include "empathy-webkit-utils.h"
@@ -248,7 +251,7 @@ theme_adium_parse_body (EmpathyThemeAdium *self,
   const gchar *text,
   const gchar *token)
 {
-  EmpathyStringParser *parsers;
+  TpawStringParser *parsers;
   GString *string;
 
   /* Check if we have to parse smileys */
@@ -268,7 +271,7 @@ theme_adium_parse_body (EmpathyThemeAdium *self,
       "<span id=\"message-token-%s\">",
       token);
 
-  empathy_string_parser_substr (text, -1, parsers, string);
+  tpaw_string_parser_substr (text, -1, parsers, string);
 
   if (!tp_str_empty (token))
     g_string_append (string, "</span>");
@@ -647,20 +650,20 @@ theme_adium_add_html (EmpathyThemeAdium *self,
 
           strftime_format = nsdate_to_strftime (self->priv->data, format);
           if (is_backlog)
-            dup_replace = empathy_time_to_string_local (timestamp,
+            dup_replace = tpaw_time_to_string_local (timestamp,
               strftime_format ? strftime_format :
-              EMPATHY_TIME_DATE_FORMAT_DISPLAY_SHORT);
+              TPAW_TIME_DATE_FORMAT_DISPLAY_SHORT);
           else
-            dup_replace = empathy_time_to_string_local (timestamp,
+            dup_replace = tpaw_time_to_string_local (timestamp,
               strftime_format ? strftime_format :
-              EMPATHY_TIME_FORMAT_DISPLAY_SHORT);
+              TPAW_TIME_FORMAT_DISPLAY_SHORT);
 
           replace = dup_replace;
         }
       else if (theme_adium_match (&cur, "%shortTime%"))
         {
-          dup_replace = empathy_time_to_string_local (timestamp,
-            EMPATHY_TIME_FORMAT_DISPLAY_SHORT);
+          dup_replace = tpaw_time_to_string_local (timestamp,
+            TPAW_TIME_FORMAT_DISPLAY_SHORT);
           replace = dup_replace;
         }
       else if (theme_adium_match (&cur, "%service%"))
@@ -729,9 +732,13 @@ theme_adium_add_html (EmpathyThemeAdium *self,
   bytes = g_resources_lookup_data ("/org/gnome/Empathy/Chat/empathy-chat.js",
       G_RESOURCE_LOOKUP_FLAGS_NONE,
       NULL);
-  js = (const gchar *) g_bytes_get_data (bytes, NULL);
-  g_string_prepend (string, js);
-  g_bytes_unref (bytes);
+
+  if (bytes != NULL)
+    {
+      js = (const gchar *) g_bytes_get_data (bytes, NULL);
+      g_string_prepend (string, js);
+      g_bytes_unref (bytes);
+    }
 
   script = g_string_free (string, FALSE);
   webkit_web_view_execute_script (WEBKIT_WEB_VIEW (self), script);
@@ -745,7 +752,7 @@ theme_adium_append_event_escaped (EmpathyThemeAdium *self,
 {
   theme_adium_add_html (self, "appendMessage",
       self->priv->data->status_html, escaped, NULL, NULL, NULL,
-      NULL, "event", empathy_time_get_current (), FALSE, FALSE, direction);
+      NULL, "event", tpaw_time_get_current (), FALSE, FALSE, direction);
 
   /* There is no last contact */
   if (self->priv->last_contact)
@@ -901,7 +908,7 @@ theme_adium_add_message (EmpathyThemeAdium *self,
   /* Get information */
   sender = empathy_message_get_sender (msg);
   account = empathy_contact_get_account (sender);
-  service_name = empathy_protocol_name_to_display_name
+  service_name = tpaw_protocol_name_to_display_name
     (tp_account_get_protocol_name (account));
   if (service_name == NULL)
     service_name = tp_account_get_protocol_name (account);
@@ -952,7 +959,7 @@ theme_adium_add_message (EmpathyThemeAdium *self,
         {
           if (!self->priv->data->default_avatar_filename)
             self->priv->data->default_avatar_filename =
-              empathy_filename_from_icon_name (EMPATHY_IMAGE_AVATAR_DEFAULT,
+              tpaw_filename_from_icon_name (TPAW_IMAGE_AVATAR_DEFAULT,
                        GTK_ICON_SIZE_DIALOG);
 
           avatar_filename = self->priv->data->default_avatar_filename;
@@ -1205,7 +1212,7 @@ empathy_theme_adium_edit_message (EmpathyThemeAdium *self,
     }
 
   /* set a tooltip */
-  timestamp = empathy_time_to_string_local (
+  timestamp = tpaw_time_to_string_local (
     empathy_message_get_timestamp (message),
     "%H:%M:%S");
   tooltip = g_strdup_printf (_("Message edited at %s"), timestamp);
@@ -1242,7 +1249,7 @@ empathy_theme_adium_edit_message (EmpathyThemeAdium *self,
         }
 
       g_free (style);
-      gtk_icon_info_free (icon_info);
+      g_object_unref (icon_info);
     }
 
   goto finally;