From 9cae93ee3034f37fb759f1a87875f15a676cd42e Mon Sep 17 00:00:00 2001 From: Qball Cow Date: Sun, 8 Nov 2009 20:51:58 +0100 Subject: [PATCH] Fix compile warning remove old code --- src/magnatune.c | 7 ++-- src/plugin.c | 105 -------------------------------------------------------- 2 files changed, 2 insertions(+), 110 deletions(-) diff --git a/src/magnatune.c b/src/magnatune.c index c176a62..83a5795 100644 --- a/src/magnatune.c +++ b/src/magnatune.c @@ -48,7 +48,7 @@ void magnatune_db_init() void magnatune_db_open() { gchar *path = NULL; - gchar *final = NULL; + const gchar *final = NULL; /** @@ -124,7 +124,7 @@ void magnatune_db_load_data(const char *data, const goffset length) gchar *path; - gchar *final = g_get_user_cache_dir(); + const gchar *final = g_get_user_cache_dir(); path = g_build_filename(final, "gmpc", "magnatune.sqlite3", NULL); if(magnatune_sqlhandle) { @@ -145,10 +145,8 @@ void magnatune_db_load_data(const char *data, const goffset length) gchar *temp =g_strdup_printf("Failed to store magnatune db: %s\n", error->message); playlist3_show_error_message(temp, ERROR_WARNING); g_free(temp); - printf("%s\n", error->message); g_error_free(error); } - printf("%s\n", path); } /* open the db if it is closed */ if(!magnatune_sqlhandle) { @@ -174,7 +172,6 @@ void magnatune_db_load_data(const char *data, const goffset length) sqlite3_exec(magnatune_sqlhandle, "CREATE INDEX albumsAlbumname ON albums(albumname);", NULL, NULL, &error); if(error)printf("%i: %s",__LINE__, error); -// g_idle_add(magnatune_end_download, NULL); g_free(path); } diff --git a/src/plugin.c b/src/plugin.c index 34d2e47..629510f 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -716,86 +716,10 @@ static void magnatune_redownload_reload_db() gtk_list_store_remove(GTK_LIST_STORE(model), &citer); } magnatune_download(); - //magnatune_get_genre_list(); } if(path) gtk_tree_path_free(path); } -/* -static void magnatune_cat_menu_add() -{ - GtkTreeIter citer; - GtkTreeSelection *sel = gtk_tree_view_get_selection(playlist3_get_category_tree_view()); - GtkTreeModel *model = (GtkTreeModel *)playlist3_get_category_tree_store(); - GtkTreePath *tpath; - int depth = 0; - if(!gtk_tree_selection_get_selected(sel,&model,&citer)) - { - return ; - } -*/ /** - * Get the level we are on. - */ -/* tpath = gtk_tree_model_get_path(model, &citer); - depth = gtk_tree_path_get_depth(tpath); - gtk_tree_path_free(tpath); -*/ /** Genre level */ -/* if(depth == 2) - { - GList *list, *node; - gchar *genre; - gtk_tree_model_get(model, &citer, PL3_CAT_INT_ID,&genre, -1); - if(genre) - { - list = magnatune_db_get_url_list(genre, NULL ,NULL); - for(node = list; node; node = node->next) - { - mpd_playlist_queue_add(connection, node->data); - } - mpd_playlist_queue_commit(connection); - g_list_foreach(list, (GFunc)g_free, NULL); - g_list_free(list); - g_free(genre); - } - } -*/ /** Artist */ -/* else if(depth == 3) - { - gchar *artist; - gchar *genre; - GtkTreeIter iter; - if(gtk_tree_model_iter_parent(model, &iter, &citer)) - { - GList *list, *node; - gtk_tree_model_get(model, &iter, PL3_CAT_INT_ID,&genre, -1); - gtk_tree_model_get(model, &citer, PL3_CAT_INT_ID,&artist, -1); - list = magnatune_db_get_url_list(genre, artist,NULL); - for(node = list; node; node = node->next) - { - mpd_playlist_queue_add(connection, node->data); - } - mpd_playlist_queue_commit(connection); - g_list_foreach(list, (GFunc)g_free, NULL); - g_list_free(list); - g_free(genre); - g_free(artist); - } - } - - - - -} -*/ -/* -static void magnatune_cat_menu_replace() -{ - mpd_playlist_clear(connection); - magnatune_cat_menu_add(); - mpd_player_play(connection); - -} -*/ static int magnatune_cat_menu_popup(GtkWidget *menu, int type, GtkWidget *tree, GdkEventButton *event) { GtkWidget *item; @@ -874,26 +798,12 @@ static int magnatune_button_handle_release_event_tag_add(GtkWidget *button, gpoi gtk_tree_model_get(model, &piter, MPDDATA_MODEL_COL_SONG_TITLE,&album,-1); } } - /* - list = magnatune_db_get_url_list(genre, artist, album); - for(;list; list = list->next) - { - mpd_playlist_queue_add(connection, list->data); - } - */ data = magnatune_db_get_song_list(genre,artist,album, TRUE); for(data = mpd_data_get_first(data);data;data = mpd_data_get_next(data)) { mpd_playlist_queue_add(connection, data->song->file); } mpd_playlist_queue_commit(connection); - /* - if(list) - { - g_list_foreach(list, (GFunc)g_free, NULL); - g_list_free(list); - } - */ if(genre) g_free(genre); if(artist) @@ -973,21 +883,6 @@ static int magnatune_button_release_event(GtkWidget *tree, GdkEventButton *event } return FALSE; } -/* -static void magnatune_cat_key_press(GtkWidget *tree, GdkEventKey *event, int selected_type) -{ - if(selected_type != plugin.id) return; - if(event->state&GDK_CONTROL_MASK && event->keyval == GDK_Insert) - { - magnatune_cat_menu_replace(); - } - else if(event->keyval == GDK_Insert) - { - magnatune_cat_menu_add(); - } - -} -*/ static int magnatune_key_press(GtkWidget *tree, GdkEventKey *event) { if(event->state&GDK_CONTROL_MASK && event->keyval == GDK_Insert) -- 2.11.4.GIT