comparison pidgin/gtklog.c @ 15551:7ebe32203e67

If you delete the last log for a month, delete the month header as well.
author Richard Laager <rlaager@wiktel.com>
date Mon, 05 Feb 2007 03:37:10 +0000
parents fa13722c7756
children 3ae0ba9aee46
comparison
equal deleted inserted replaced
15550:fa13722c7756 15551:7ebe32203e67
218 gaim_notify_error(NULL, NULL, "Log Deletion Failed", 218 gaim_notify_error(NULL, NULL, "Log Deletion Failed",
219 "Check permissions and try again."); 219 "Check permissions and try again.");
220 } 220 }
221 else 221 else
222 { 222 {
223 gtk_tree_store_remove((GtkTreeStore *)data[0], (GtkTreeIter *)data[1]); 223 GtkTreeStore *treestore = data[0];
224 GtkTreeIter *iter = (GtkTreeIter *)data[1];
225 GtkTreePath *path = gtk_tree_model_get_path(GTK_TREE_MODEL(treestore), iter);
226 gboolean first = !gtk_tree_path_prev(path);
227
228 if (!gtk_tree_store_remove(treestore, iter) && first)
229 {
230 /* iter was the last child at its level */
231
232 if (gtk_tree_path_up(path))
233 {
234 gtk_tree_model_get_iter(GTK_TREE_MODEL(treestore), iter, path);
235 gtk_tree_store_remove(treestore, iter);
236 }
237 }
238 gtk_tree_path_free(path);
224 } 239 }
225 240
226 delete_log_cleanup_cb(data); 241 delete_log_cleanup_cb(data);
227 } 242 }
228 243