1198
1198
brasero_track_data_cfg_reset (priv->project);
1202
brasero_data_disc_convert_tree_paths_to_references (GtkTreeModel *model,
1206
GSList *retval = NULL;
1208
for (iter = treepaths; iter; iter = iter->next) {
1209
GtkTreePath *treepath;
1210
GtkTreeRowReference *reference;
1212
treepath = iter->data;
1213
reference = gtk_tree_row_reference_new (model, treepath);
1214
retval = g_slist_prepend (retval, reference);
1202
1221
brasero_data_disc_delete_selected (BraseroDisc *disc)
1204
1223
BraseroDataDiscPrivate *priv;
1205
1224
GtkTreeSelection *selection;
1206
1225
GtkTreePath *cursorpath;
1209
1230
priv = BRASERO_DATA_DISC_PRIVATE (disc);
1211
1232
/* we must start by the end for the treepaths to point to valid rows */
1212
1233
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->tree));
1213
1234
list = gtk_tree_selection_get_selected_rows (selection, NULL);
1214
list = g_list_reverse (list);
1216
1236
gtk_tree_view_get_cursor (GTK_TREE_VIEW (priv->tree),
1220
for (iter = list; iter; iter = iter->next) {
1240
/* Since we are going to modify the model by suppressing the selected
1241
* rows, take a safe approach and convert all tree paths into references */
1242
references = brasero_data_disc_convert_tree_paths_to_references (GTK_TREE_MODEL (priv->project), list);
1243
g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
1246
for (iter = references; iter; iter = iter->next) {
1247
GtkTreeRowReference *reference;
1221
1248
GtkTreePath *treepath;
1223
treepath = iter->data;
1250
reference = iter->data;
1251
treepath = gtk_tree_row_reference_get_path (reference);
1224
1253
if (cursorpath && !gtk_tree_path_compare (cursorpath, treepath)) {
1225
1254
GtkTreePath *tmp_path;
1238
1267
brasero_track_data_cfg_remove (BRASERO_TRACK_DATA_CFG (priv->project), treepath);
1239
gtk_tree_path_free (treepath);
1269
gtk_tree_row_reference_free (reference);
1270
gtk_tree_path_free (treepath);
1272
g_slist_free (references);
1243
1274
if (cursorpath)
1244
1275
gtk_tree_path_free (cursorpath);
2083
2114
priv = BRASERO_DATA_DISC_PRIVATE (self);
2116
/* Avoid minding signals that happen out of the tree area (like in the
2117
* headers for example) */
2118
if (event->window != gtk_tree_view_get_bin_window (GTK_TREE_VIEW (tree)))
2085
2121
if (gtk_widget_get_realized (priv->tree)) {
2086
2122
result = gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (priv->tree),