[easytag/wip/musicbrainz-support] Removed FIXME. Added some more comments



commit 008c6afc2ae8381520db75e05a0d97664a48d7f5
Author: Abhinav <abhijangda hotmail com>
Date:   Sun Jun 1 09:00:34 2014 +0530

    Removed FIXME. Added some more comments

 data/musicbrainz_dialog.ui |   33 +++++++++++++++++----------------
 src/mb_search.c            |    8 --------
 src/mbentityview.c         |   21 +++++++++++++++++++--
 src/musicbrainz_dialog.c   |   26 +++++++++++++++++++-------
 4 files changed, 55 insertions(+), 33 deletions(-)
---
diff --git a/data/musicbrainz_dialog.ui b/data/musicbrainz_dialog.ui
index 2b036e1..ed2a2fe 100755
--- a/data/musicbrainz_dialog.ui
+++ b/data/musicbrainz_dialog.ui
@@ -1,6 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkImage" id="img_red_lines">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">easytag-red-lines</property>
+  </object>
+  <object class="GtkImage" id="img_unselect_all">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">easytag-unselect-all</property>
+  </object>
   <object class="GtkImage" id="findimage">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -26,6 +36,12 @@
     <property name="can_focus">False</property>
     <property name="stock">gtk-stop</property>
   </object>
+  <object class="GtkImage" id="image14">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">gtk-missing-image</property>
+    <property name="icon-size">5</property>
+  </object>
   <object class="GtkImage" id="image8">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -41,22 +57,6 @@
     <property name="can_focus">False</property>
     <property name="stock">easytag-invert-selection</property>
   </object>
-  <object class="GtkImage" id="img_red_lines">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="stock">easytag-red-lines</property>
-  </object>
-  <object class="GtkImage" id="img_unselect_all">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="stock">easytag-unselect-all</property>
-  </object>
-  <object class="GtkImage" id="image14">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="stock">gtk-missing-image</property>
-    <property name="icon-size">5</property>
-  </object>
   <object class="GtkDialog" id="mbDialog">
     <property name="can_focus">False</property>
     <property name="border_width">5</property>
@@ -666,6 +666,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">True</property>
+                            <property name="pack_type">end</property>
                             <property name="position">0</property>
                           </packing>
                         </child>
diff --git a/src/mb_search.c b/src/mb_search.c
index d9566fa..ceab283 100644
--- a/src/mb_search.c
+++ b/src/mb_search.c
@@ -21,14 +21,6 @@
 #include "mb_search.h"
 #include "musicbrainz_dialog.h"
 
-void
-et_set_cancel_error (GError **error)
-{
-    g_set_error (error, ET_MB5_SEARCH_ERROR,
-                 ET_MB5_SEARCH_ERROR_CANCELLED,
-                 "Operation cancelled by user");
-}
-
 /*
  * et_mb5_search_error_quark:
  *
diff --git a/src/mbentityview.c b/src/mbentityview.c
index fd230f6..72d642a 100644
--- a/src/mbentityview.c
+++ b/src/mbentityview.c
@@ -44,6 +44,12 @@ char *columns [MB_ENTITY_TYPE_COUNT][8] = {
     {"Name", "Album", "Artist", "Time", "Number"},
     };
 
+/*
+ * ET_MB_DISPLAY_RESULTS:
+ * @ET_MB_DISPLAY_RESULTS_ALL: Display all results.
+ * @ET_MB_DISPLAY_RESULTS_RED: Display Red Lines
+ * @ET_MB_DISPLAY_RESULTS_SEARCH: Display Search Results
+ */
 enum ET_MB_DISPLAY_RESULTS
 {
     ET_MB_DISPLAY_RESULTS_ALL = 0,
@@ -507,8 +513,6 @@ show_data_in_entity_view (EtMbEntityView *entity_view)
     g_free (types);
 
     gtk_tree_view_set_model (GTK_TREE_VIEW (priv->tree_view), priv->filter);
-    //TODO: see if this is required
-    //g_object_unref (priv->list_store);
     g_object_unref (priv->filter);
     add_iter_to_list_store (GTK_LIST_STORE (priv->list_store),
                             g_node_first_child (priv->mb_tree_current_node));
@@ -823,6 +827,13 @@ et_mb_entity_view_init (EtMbEntityView *entity_view)
                       G_CALLBACK (tree_view_row_activated), entity_view);
 }
 
+/*
+ * delete_bread_crumb_button:
+ * @button: Button to delete.
+ * @data: User data
+ *
+ * Callback function to delete a button from bread crumb.
+ */
 static void
 delete_bread_crumb_button (GtkWidget *button, gpointer data)
 {
@@ -1087,6 +1098,12 @@ et_mb_entity_view_refresh_current_level (EtMbEntityView *entity_view)
 {
 }
 
+/*
+ * et_mb_entity_view_destroy:
+ * @object: EtMbEntityView
+ *
+ * Overloaded destructor for EtMbEntityView.
+ */
 static void
 et_mb_entity_view_destroy (GtkWidget *object)
 {
diff --git a/src/musicbrainz_dialog.c b/src/musicbrainz_dialog.c
index 32ffa9d..ebbaba4 100644
--- a/src/musicbrainz_dialog.c
+++ b/src/musicbrainz_dialog.c
@@ -38,6 +38,13 @@
 static GNode *mb_tree_root;
 static GSimpleAsyncResult *async_result;
 
+/*
+ * ManualSearchThreadData:
+ * @text_to_search: Manual Search Text
+ * @type: Type of Entity
+ *
+ * Thread Data for storing Manual Search's data.
+ */
 typedef struct
 {
     gchar *text_to_search;
@@ -78,7 +85,8 @@ manual_search_callback (GObject *source, GAsyncResult *res,
     g_object_unref (res);
     g_free (user_data);
 
-    combo_box = GTK_COMBO_BOX_TEXT (gtk_builder_get_object (builder, "cbManualSearch"));
+    combo_box = GTK_COMBO_BOX_TEXT (gtk_builder_get_object (builder,
+                                                            "cbManualSearch"));
     gtk_combo_box_text_append_text (combo_box,
                                     gtk_combo_box_text_get_active_text (combo_box));
 }
@@ -165,7 +173,9 @@ manual_search_thread_func (GSimpleAsyncResult *res, GObject *obj,
 
     if (g_cancellable_is_cancelled (cancellable))
     {
-        et_set_cancel_error (&error);
+        g_set_error (&error, ET_MB5_SEARCH_ERROR,
+                     ET_MB5_SEARCH_ERROR_CANCELLED,
+                     "Operation cancelled by user");
         g_simple_async_report_gerror_in_idle (NULL,
                                               mb5_search_error_callback,
                                               NULL, error);
@@ -180,7 +190,9 @@ manual_search_thread_func (GSimpleAsyncResult *res, GObject *obj,
 
     if (g_cancellable_is_cancelled (cancellable))
     {
-        et_set_cancel_error (&error);
+        g_set_error (&error, ET_MB5_SEARCH_ERROR,
+                     ET_MB5_SEARCH_ERROR_CANCELLED,
+                     "Operation cancelled by user");
         g_simple_async_report_gerror_in_idle (NULL,
                                               mb5_search_error_callback,
                                               thread_data, error);
@@ -199,7 +211,9 @@ manual_search_thread_func (GSimpleAsyncResult *res, GObject *obj,
 
     if (g_cancellable_is_cancelled (cancellable))
     {
-        et_set_cancel_error (&error);
+        g_set_error (&error, ET_MB5_SEARCH_ERROR,
+                     ET_MB5_SEARCH_ERROR_CANCELLED,
+                     "Operation cancelled by user");
         g_simple_async_report_gerror_in_idle (NULL,
                                               mb5_search_error_callback,
                                               thread_data, error);
@@ -407,9 +421,6 @@ et_open_musicbrainz_dialog ()
     gtk_widget_set_size_request (mbDialog, 600, 500);
     gtk_box_pack_start (GTK_BOX (gtk_builder_get_object (builder, "centralBox")),
                         entityView, TRUE, TRUE, 2);
-    /* FIXME: This should not be needed. */
-    //gtk_box_reorder_child (GTK_BOX (gtk_builder_get_object (builder, "centralBox")),
-    //                       entityView, 0);
     g_signal_connect (gtk_builder_get_object (builder, "btnManualFind"),
                       "clicked", G_CALLBACK (btn_manual_find_clicked),
                       NULL);
@@ -438,6 +449,7 @@ et_open_musicbrainz_dialog ()
                             "changed",
                             G_CALLBACK (entry_tree_view_search_changed),
                             NULL);
+
     /* Fill Values in cb_manual_search_in */
     cb_manual_search_in = GTK_WIDGET (gtk_builder_get_object (builder,
                                                               "cbManualSearchIn"));


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