[gnome-panel] libgnome-panel: add gp_module_info_set_translation_domain



commit 84d1dcdc068d48fcad9dbde9cbf3372943945c77
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Tue Oct 25 17:25:38 2016 +0300

    libgnome-panel: add gp_module_info_set_translation_domain

 libgnome-panel/gp-module-info-private.h |    4 ++--
 libgnome-panel/gp-module-info.c         |   22 +++++++++++++++++-----
 libgnome-panel/gp-module-info.h         |   12 +++++++-----
 3 files changed, 26 insertions(+), 12 deletions(-)
---
diff --git a/libgnome-panel/gp-module-info-private.h b/libgnome-panel/gp-module-info-private.h
index 5ad3622..dd3f3cc 100644
--- a/libgnome-panel/gp-module-info-private.h
+++ b/libgnome-panel/gp-module-info-private.h
@@ -27,9 +27,9 @@ struct _GpModuleInfo
   gchar  *id;
   gchar  *version;
 
-  gchar  *translation_domain;
-
   gchar **applets;
+
+  gchar  *domain;
 };
 
 void gp_module_info_free (GpModuleInfo *info);
diff --git a/libgnome-panel/gp-module-info.c b/libgnome-panel/gp-module-info.c
index d1d2d20..3bee334 100644
--- a/libgnome-panel/gp-module-info.c
+++ b/libgnome-panel/gp-module-info.c
@@ -49,7 +49,6 @@ get_applets (va_list args)
  * gp_module_info_new:
  * @id: the id of this module
  * @version: the version of this module
- * @translation_domain: the translation domain or NULL
  *
  * Creates a new #GpModuleInfo.
  *
@@ -57,8 +56,7 @@ get_applets (va_list args)
  */
 GpModuleInfo *
 gp_module_info_new (const gchar *id,
-                    const gchar *version,
-                    const gchar *translation_domain)
+                    const gchar *version)
 {
   GpModuleInfo *info;
 
@@ -66,7 +64,6 @@ gp_module_info_new (const gchar *id,
 
   info->id = g_strdup (id);
   info->version = g_strdup (version);
-  info->translation_domain = g_strdup (translation_domain);
 
   return info;
 }
@@ -90,6 +87,21 @@ gp_module_info_set_applets (GpModuleInfo *info,
   va_end (args);
 }
 
+/**
+ * gp_module_info_set_translation_domain:
+ * @info: a #GpModuleInfo
+ * @domain: the translation domain or NULL
+ *
+ * Sets the translation domain.
+ */
+void
+gp_module_info_set_translation_domain (GpModuleInfo *info,
+                                       const gchar  *domain)
+{
+  g_free (info->domain);
+  info->domain = g_strdup (domain);
+}
+
 void
 gp_module_info_free (GpModuleInfo *info)
 {
@@ -98,8 +110,8 @@ gp_module_info_free (GpModuleInfo *info)
 
   g_free (info->id);
   g_free (info->version);
-  g_free (info->translation_domain);
   g_strfreev (info->applets);
+  g_free (info->domain);
 
   g_free (info);
 }
diff --git a/libgnome-panel/gp-module-info.h b/libgnome-panel/gp-module-info.h
index 6cf1044..af369c9 100644
--- a/libgnome-panel/gp-module-info.h
+++ b/libgnome-panel/gp-module-info.h
@@ -29,12 +29,14 @@ G_BEGIN_DECLS
  */
 typedef struct _GpModuleInfo GpModuleInfo;
 
-GpModuleInfo *gp_module_info_new         (const gchar *id,
-                                          const gchar  *version,
-                                          const gchar  *translation_domain);
+GpModuleInfo *gp_module_info_new                    (const gchar  *id,
+                                                     const gchar  *version);
 
-void          gp_module_info_set_applets (GpModuleInfo *info,
-                                          ...);
+void          gp_module_info_set_applets            (GpModuleInfo *info,
+                                                     ...);
+
+void          gp_module_info_set_translation_domain (GpModuleInfo *info,
+                                                     const gchar  *domain);
 
 G_END_DECLS
 


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