[gtranslator] Minor cleanup



commit ac5863d089e6ade729391d7fd469bac10f28323b
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Sat Apr 2 18:32:37 2011 +0200

    Minor cleanup

 src/gtr-msg.c |   41 +++++++++++++++++++++--------------------
 src/gtr-po.c  |   18 +++++++++---------
 src/gtr-po.h  |    2 --
 3 files changed, 30 insertions(+), 31 deletions(-)
---
diff --git a/src/gtr-msg.c b/src/gtr-msg.c
index f257084..25b4ba7 100644
--- a/src/gtr-msg.c
+++ b/src/gtr-msg.c
@@ -39,32 +39,34 @@
 
 
 G_DEFINE_TYPE (GtrMsg, gtr_msg, G_TYPE_OBJECT)
-     struct _GtrMsgPrivate
-     {
-       po_message_iterator_t iterator;
 
-       po_message_t message;
+struct _GtrMsgPrivate
+{
+  po_message_iterator_t iterator;
+
+  po_message_t message;
 
-       GtrMsgStatus status;
+  GtrMsgStatus status;
 
-       GtkTreeRowReference *row_reference;
+  GtkTreeRowReference *row_reference;
 
-       gint po_position;
-     };
+  gint po_position;
+};
 
-     enum
-     {
-       PROP_0,
-       PROP_GETTEXT_ITER,
-       PROP_GETTEXT_MSG
-     };
+enum
+{
+  PROP_0,
+  PROP_GETTEXT_ITER,
+  PROP_GETTEXT_MSG
+};
 
-     static gchar *message_error = NULL;
+static gchar *message_error = NULL;
 
-     static void
-       gtr_msg_set_property (GObject * object,
-                             guint prop_id,
-                             const GValue * value, GParamSpec * pspec)
+static void
+gtr_msg_set_property (GObject * object,
+                      guint prop_id,
+                      const GValue * value,
+                      GParamSpec * pspec)
 {
   GtrMsg *msg = GTR_MSG (object);
 
@@ -653,7 +655,6 @@ on_gettext_po_xerror2 (gint severity,
   g_warning ("Error: %s.\n %s", message_text1, message_text2);
 }
 
-
 /**
  * gtr_msg_check:
  * @msg: a #GtrMsg
diff --git a/src/gtr-po.c b/src/gtr-po.c
index 8c6595e..c06c372 100644
--- a/src/gtr-po.c
+++ b/src/gtr-po.c
@@ -295,7 +295,6 @@ po_file_is_empty (po_file_t file)
   return TRUE;
 }
 
-
 /**
  * is_read_only:
  * @location: a GFile Object that represents the file to check
@@ -311,7 +310,6 @@ is_read_only (const gchar * filename)
   GFileInfo *info;
   GFile *location;
 
-
   location = g_file_new_for_path (filename);
 
   if (!g_file_query_exists (location, NULL))
@@ -667,6 +665,8 @@ gtr_po_set_location (GtrPo * po, GFile * location)
 GtrPoState
 gtr_po_get_state (GtrPo * po)
 {
+  g_return_val_if_fail (GTR_IS_PO (po), 0);
+
   return po->priv->state;
 }
 
@@ -680,6 +680,8 @@ gtr_po_get_state (GtrPo * po)
 void
 gtr_po_set_state (GtrPo * po, GtrPoState state)
 {
+  g_return_if_fail (GTR_IS_PO (po));
+
   po->priv->state = state;
 
   g_object_notify (G_OBJECT (po), "state");
@@ -703,10 +705,13 @@ gtr_po_get_write_perms (GtrPo * po)
 GList *
 gtr_po_get_messages (GtrPo * po)
 {
+  g_return_val_if_fail (GTR_IS_PO (po), NULL);
+
   return po->priv->messages;
 }
 
 /**
+ * FIXME: this is hack, we should fix it
  * gtr_po_set_messages:
  * @po: a #GtrPo
  * @messages: a pointer to a new messages list.
@@ -716,6 +721,8 @@ gtr_po_get_messages (GtrPo * po)
 void
 gtr_po_set_messages (GtrPo * po, GList * messages)
 {
+  g_return_if_fail (GTR_IS_PO (po));
+
   po->priv->messages = messages;
 }
 
@@ -731,7 +738,6 @@ gtr_po_get_current_message (GtrPo * po)
   return po->priv->current;
 }
 
-
 /**
  * gtr_po_update_current_message:
  * @po: a #GtrPo
@@ -940,12 +946,6 @@ gtr_po_get_header (GtrPo * po)
   return po->priv->header;
 }
 
-void
-gtr_po_set_header (GtrPo * po, GtrHeader * header)
-{
-  po->priv->header = header;
-}
-
 /**
  * gtr_po_get_translated_count:
  * @po: a #GtrPo
diff --git a/src/gtr-po.h b/src/gtr-po.h
index cfae9e9..99c5734 100644
--- a/src/gtr-po.h
+++ b/src/gtr-po.h
@@ -143,8 +143,6 @@ gtr_po_get_type (void)
 
      GtrHeader *gtr_po_get_header (GtrPo * po);
 
-     void gtr_po_set_header (GtrPo * po, GtrHeader * header);
-
 gint
 gtr_po_get_translated_count (GtrPo * po);
 



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