[easytag/wip/musicbrainz-support-merge: 30/55] Added Country and Date columns for Album



commit 80af61472f1add176d92eeb1be33907f6a09e2d8
Author: Abhinav <abhijangda hotmail com>
Date:   Tue Aug 12 17:01:50 2014 +0530

    Added Country and Date columns for Album

 src/mb_search.c          |    3 ++-
 src/mbentityview.c       |   33 ++++++++++++++++++++++++---------
 src/mbentityview.h       |    2 ++
 src/musicbrainz_dialog.c |    4 ++--
 4 files changed, 30 insertions(+), 12 deletions(-)
---
diff --git a/src/mb_search.c b/src/mb_search.c
index eb896d6..9a6c101 100755
--- a/src/mb_search.c
+++ b/src/mb_search.c
@@ -1315,9 +1315,10 @@ free_mb_tree (GNode **_node)
         {
             mb5_recording_delete ((Mb5Recording)et_entity->entity);
         }
+    
+        g_slice_free (EtMbEntity, et_entity);
     }
 
-    g_slice_free (EtMbEntity, et_entity);
     g_node_unlink (node);
     child = g_node_first_child (node);
 
diff --git a/src/mbentityview.c b/src/mbentityview.c
index 0bf2ae6..2579aaf 100644
--- a/src/mbentityview.c
+++ b/src/mbentityview.c
@@ -309,6 +309,8 @@ add_iter_to_list_store (GtkListStore *list_store, GNode *node)
                 gchar group[NAME_MAX_SIZE];
                 gchar name[NAME_MAX_SIZE];
                 gchar *album_artists;
+                gchar country[NAME_MAX_SIZE];
+                gchar date[NAME_MAX_SIZE];
 
                 release_group = mb5_release_get_releasegroup ((Mb5Release)entity);
                 mb5_releasegroup_get_primarytype (release_group, group,
@@ -316,7 +318,9 @@ add_iter_to_list_store (GtkListStore *list_store, GNode *node)
                 album_artists = et_mb5_release_get_artists_names (entity);
                 mb5_release_get_title ((Mb5Release)entity, name,
                                        sizeof (name));
-                
+                mb5_release_get_country (entity, country, sizeof (country));
+                mb5_release_get_date (entity, date, sizeof (date));
+
                 if (((EtMbEntity *)node->data)->is_red_line)
                 {
                     gtk_list_store_insert_with_values (list_store, &iter, -1,
@@ -325,18 +329,29 @@ add_iter_to_list_store (GtkListStore *list_store, GNode *node)
                                                        MB_ALBUM_COLUMNS_ARTIST,
                                                        album_artists,
                                                        MB_ALBUM_COLUMNS_TYPE,
-                                                       group,
+                                                       group, 
+                                                       MB_ALBUM_COLUMNS_COUNTRY,
+                                                       country,
+                                                       MB_ALBUM_COLUMNS_DATE,
+                                                       date,
                                                        MB_ALBUM_COLUMNS_N,
                                                        &red, -1);
                 }
                 else
                 {
                     gtk_list_store_insert_with_values (list_store, &iter, -1,
-                                        MB_ALBUM_COLUMNS_NAME, name,
-                                        MB_ALBUM_COLUMNS_ARTIST,
-                                        album_artists,
-                                        MB_ALBUM_COLUMNS_TYPE, group,
-                                        MB_ALBUM_COLUMNS_N, &black, -1);
+                                                       MB_ALBUM_COLUMNS_NAME,
+                                                       name,
+                                                       MB_ALBUM_COLUMNS_ARTIST,
+                                                       album_artists,
+                                                       MB_ALBUM_COLUMNS_TYPE,
+                                                       group,
+                                                       MB_ALBUM_COLUMNS_COUNTRY,
+                                                       country,
+                                                       MB_ALBUM_COLUMNS_DATE,
+                                                       date,                                                 
      
+                                                       MB_ALBUM_COLUMNS_N,
+                                                       &black, -1);
                 }
 
                 g_free (album_artists);
@@ -480,9 +495,9 @@ show_data_in_entity_view (EtMbEntityView *entity_view)
     int i, total_cols, type;
     GList *list_cols, *list;
     GType *types;
-    static const gchar *column_names[MB_ENTITY_KIND_COUNT][4] = {
+    static const gchar *column_names[MB_ENTITY_KIND_COUNT][5] = {
         {N_("Name"), N_("Gender"), N_("Type")},
-        {N_("Name"), N_("Artist"), N_("Type")},
+        {N_("Name"), N_("Artist"), N_("Type"), N_("Country"), N_("Date")},
         {N_("Name"), N_("Album"), N_("Artist"), N_("Time")},
         {N_("FreeDB ID"), N_("Title"), N_("Artist")}
     };
diff --git a/src/mbentityview.h b/src/mbentityview.h
index 1aae4c6..c16ed46 100755
--- a/src/mbentityview.h
+++ b/src/mbentityview.h
@@ -106,6 +106,8 @@ enum MB_ALBUM_COLUMNS
     MB_ALBUM_COLUMNS_NAME,
     MB_ALBUM_COLUMNS_ARTIST,
     MB_ALBUM_COLUMNS_TYPE,
+    MB_ALBUM_COLUMNS_COUNTRY,
+    MB_ALBUM_COLUMNS_DATE,
     MB_ALBUM_COLUMNS_N
 };
 
diff --git a/src/musicbrainz_dialog.c b/src/musicbrainz_dialog.c
index dcaae05..3355c53 100755
--- a/src/musicbrainz_dialog.c
+++ b/src/musicbrainz_dialog.c
@@ -1329,8 +1329,8 @@ btn_discid_search_clicked (GtkWidget *button, gpointer data)
                         0, _("Starting MusicBrainz Search"));
     mb_dialog_priv->async_result = g_simple_async_result_new (NULL,
                                                               discid_search_callback,
-                                                              NULL,
-                                                              btn_manual_find_clicked);
+                                                              thread_data,
+                                                              btn_discid_search_clicked);
     g_simple_async_result_run_in_thread (mb_dialog_priv->async_result,
                                          discid_search_thread_func, 0,
                                          mb5_search_cancellable);


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