Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 264231 | Differences between
and this patch

Collapse All | Expand All

(-)gimmix-0.5.6.1/src/gimmix-playlist.c (-13 / +27 lines)
Lines 667-677 Link Here
667
							"text", 1,
667
							"text", 1,
668
							NULL);
668
							NULL);
669
	
669
	
670
	dir_store 	= gtk_list_store_new (4, 
670
	dir_store 	= gtk_list_store_new (5, 
671
						GDK_TYPE_PIXBUF, 	/* icon (0) */
671
						GDK_TYPE_PIXBUF, 	/* icon (0) */
672
						G_TYPE_STRING, 		/* name (1) */
672
						G_TYPE_STRING, 		/* name (1) */
673
						G_TYPE_STRING,		/* path (2) */
673
						G_TYPE_STRING,		/* path (2) */
674
						G_TYPE_INT);		/* type DIR/SONG (3) */
674
						G_TYPE_INT,			/* type DIR/SONG (3) */
675
						G_TYPE_INT);		/* id (4) */
675
	
676
	
676
	pls_store 	= gtk_list_store_new (2, 
677
	pls_store 	= gtk_list_store_new (2, 
677
						GDK_TYPE_PIXBUF, 	/* icon (0) */
678
						GDK_TYPE_PIXBUF, 	/* icon (0) */
Lines 1190-1196 Link Here
1190
		if (data->type == MPD_DATA_TYPE_PLAYLIST)
1191
		if (data->type == MPD_DATA_TYPE_PLAYLIST)
1191
		{
1192
		{
1192
			gtk_list_store_append (pls_liststore, &pls_treeiter);
1193
			gtk_list_store_append (pls_liststore, &pls_treeiter);
1193
			name = data->playlist;
1194
			name = (char*) data->playlist;
1194
			gtk_list_store_set (pls_liststore, &pls_treeiter,
1195
			gtk_list_store_set (pls_liststore, &pls_treeiter,
1195
								0, pls_pixbuf,
1196
								0, pls_pixbuf,
1196
								1, name,
1197
								1, name,
Lines 1288-1293 Link Here
1288
								-1);
1289
								-1);
1289
			g_free (title);
1290
			g_free (title);
1290
		}
1291
		}
1292
		gtk_list_store_set (dir_store, &dir_iter, 4, data->song->id, -1);
1291
	}
1293
	}
1292
	
1294
	
1293
	mpd_data_free (data);
1295
	mpd_data_free (data);
Lines 1330-1360 Link Here
1330
	GList				*list;
1332
	GList				*list;
1331
	GtkTreeIter			iter;
1333
	GtkTreeIter			iter;
1332
	gchar				*path;
1334
	gchar				*path;
1333
	gchar				*song_path;
1334
	gint				type = -1;
1335
	gint				type = -1;
1336
	guint				id;
1335
1337
1336
	model = gtk_tree_view_get_model (GTK_TREE_VIEW(library_treeview));
1338
	model = gtk_tree_view_get_model (GTK_TREE_VIEW(library_treeview));
1337
	
1339
	
1338
	list = gtk_tree_selection_get_selected_rows (library_selection, &model);
1340
	list = gtk_tree_selection_get_selected_rows (library_selection, &model);
1339
	gtk_tree_model_get_iter (model, &iter, list->data);
1341
	gtk_tree_model_get_iter (model, &iter, list->data);
1340
	gtk_tree_model_get (model, &iter, 2, &path, 3, &type, -1);
1342
	gtk_tree_model_get (model, &iter, 2, &path, 3, &type, 4, &id, -1);
1341
1343
1342
	if (type == DIR)
1344
	if (type == DIR)
1343
	{
1345
	{
1344
		g_free (path);
1346
		g_free (path);
1345
		return;
1347
		return;
1346
	}
1348
	}
1347
	
1349
	#ifdef HAVE_TAGEDITOR
1348
	song_path = g_strdup_printf ("%s/%s", cfg_get_key_value(conf, "music_directory"), path);
1350
	gchar *song_path = g_strdup_printf ("%s/%s", cfg_get_key_value(conf, "music_directory"), path);
1349
	if (gimmix_tag_editor_populate (song_path))
1351
	if (gimmix_tag_editor_populate (song_path))
1350
	{	
1352
	{	
1351
		gtk_widget_show (tag_editor_window);
1353
		gtk_widget_show (tag_editor_window);
1352
	}
1354
	}
1353
	else
1355
	else
1356
	{
1354
		gimmix_tag_editor_error (invalid_dir_error);
1357
		gimmix_tag_editor_error (invalid_dir_error);
1355
		
1358
	}
1356
	g_free (path);
1357
	g_free (song_path);
1359
	g_free (song_path);
1360
	#else
1361
	if (gimmix_tag_editor_populate (mpd_database_get_fileinfo(gmo,path)))
1362
	{
1363
		gtk_widget_show (tag_editor_window);
1364
	}
1365
	else
1366
	{
1367
		gimmix_tag_editor_error (_("An error occurred while trying to get song information. Please try again."));
1368
	}
1369
	#endif
1370
	g_free (path);
1371
	
1358
	
1372
	
1359
	/* free the list */
1373
	/* free the list */
1360
	g_list_foreach (list, (GFunc)gtk_tree_path_free, NULL);
1374
	g_list_foreach (list, (GFunc)gtk_tree_path_free, NULL);
Lines 1370-1376 Link Here
1370
	GList				*list;
1384
	GList				*list;
1371
	GtkTreeIter			iter;
1385
	GtkTreeIter			iter;
1372
	gchar				*path;
1386
	gchar				*path;
1373
	gchar				*song_path;
1387
	guint				id;
1374
1388
1375
	model = gtk_tree_view_get_model (GTK_TREE_VIEW(current_playlist_treeview));
1389
	model = gtk_tree_view_get_model (GTK_TREE_VIEW(current_playlist_treeview));
1376
	if (gtk_tree_selection_count_selected_rows(current_playlist_selection) != 1)
1390
	if (gtk_tree_selection_count_selected_rows(current_playlist_selection) != 1)
Lines 1378-1387 Link Here
1378
	
1392
	
1379
	list = gtk_tree_selection_get_selected_rows (current_playlist_selection, &model);
1393
	list = gtk_tree_selection_get_selected_rows (current_playlist_selection, &model);
1380
	gtk_tree_model_get_iter (model, &iter, list->data);
1394
	gtk_tree_model_get_iter (model, &iter, list->data);
1381
	gtk_tree_model_get (model, &iter, 1, &path, -1);
1395
	gtk_tree_model_get (model, &iter, 1, &path, 2, &id, -1);
1382
	
1396
	
1383
	#ifdef HAVE_TAGEDITOR
1397
	#ifdef HAVE_TAGEDITOR
1384
	song_path = g_strdup_printf ("%s/%s", cfg_get_key_value(conf, "music_directory"), path);
1398
	gchar *song_path = g_strdup_printf ("%s/%s", cfg_get_key_value(conf, "music_directory"), path);
1385
	if (gimmix_tag_editor_populate (song_path))
1399
	if (gimmix_tag_editor_populate (song_path))
1386
	{	
1400
	{	
1387
		gtk_widget_show (tag_editor_window);
1401
		gtk_widget_show (tag_editor_window);
Lines 1392-1398 Link Here
1392
	}
1406
	}
1393
	g_free (song_path);
1407
	g_free (song_path);
1394
	#else
1408
	#else
1395
	if (gimmix_tag_editor_populate (mpd_playlist_get_current_song(gmo)))
1409
	if (gimmix_tag_editor_populate (mpd_playlist_get_song(gmo,id)))
1396
	{
1410
	{
1397
		gtk_widget_show (tag_editor_window);
1411
		gtk_widget_show (tag_editor_window);
1398
	}
1412
	}
(-)gimmix-0.5.6.1/src/gimmix-tagedit.c (-4 / +16 lines)
Lines 278-287 Link Here
278
	comment = g_strdup (gtk_entry_get_text (GTK_ENTRY(tag_comment)));
278
	comment = g_strdup (gtk_entry_get_text (GTK_ENTRY(tag_comment)));
279
	genre = gtk_combo_box_get_active_text (GTK_COMBO_BOX(tag_genre));
279
	genre = gtk_combo_box_get_active_text (GTK_COMBO_BOX(tag_genre));
280
280
281
	taglib_tag_set_title (tag, g_strchomp(title));
281
	if (title)
282
	taglib_tag_set_artist (tag, g_strchomp(artist));
282
	{
283
	taglib_tag_set_album (tag, g_strchomp(album));
283
		taglib_tag_set_title (tag, g_strchomp(title));
284
	taglib_tag_set_comment (tag, g_strchomp(comment));
284
	}
285
	if (artist)
286
	{
287
		taglib_tag_set_artist (tag, g_strchomp(artist));
288
	}
289
	if (album)
290
	{
291
		taglib_tag_set_album (tag, g_strchomp(album));
292
	}
293
	if (comment)
294
	{
295
		taglib_tag_set_comment (tag, g_strchomp(comment));
296
	}
285
	taglib_tag_set_genre (tag, genre);
297
	taglib_tag_set_genre (tag, genre);
286
	
298
	
287
	/* update the mpd database */
299
	/* update the mpd database */

Return to bug 264231