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



commit a65ce968ed466674a91df7cd4ebb930cb8d85fc7
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 37758a4..98a29b7 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 f87d5f2..cf70f40 100644
--- a/src/mbentityview.c
+++ b/src/mbentityview.c
@@ -308,6 +308,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,
@@ -315,7 +317,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,
@@ -324,18 +328,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);
@@ -478,9 +493,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 f4f6ee1..c3fd3ae 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 c697636..8a10697 100755
--- a/src/musicbrainz_dialog.c
+++ b/src/musicbrainz_dialog.c
@@ -1344,8 +1344,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]