Revision: 851 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=851&view=rev Author: eht16 Date: 2009-07-21 20:04:36 +0000 (Tue, 21 Jul 2009)
Log Message: ----------- Avoid using GHastTable from newer GLib versions to fix compilation with GLib 2.8.
Modified Paths: -------------- trunk/geany-plugins/addons/ChangeLog trunk/geany-plugins/addons/src/tasks.c
Modified: trunk/geany-plugins/addons/ChangeLog =================================================================== --- trunk/geany-plugins/addons/ChangeLog 2009-07-21 19:54:35 UTC (rev 850) +++ trunk/geany-plugins/addons/ChangeLog 2009-07-21 20:04:36 UTC (rev 851) @@ -1,3 +1,10 @@ +2009-07-21 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> + + * src/tasks.c: + Avoid using GHastTable from newer GLib versions to fix compilation + with GLib 2.8. + + 2009-07-17 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/ao_systray.c:
Modified: trunk/geany-plugins/addons/src/tasks.c =================================================================== --- trunk/geany-plugins/addons/src/tasks.c 2009-07-21 19:54:35 UTC (rev 850) +++ trunk/geany-plugins/addons/src/tasks.c 2009-07-21 20:04:36 UTC (rev 851) @@ -49,7 +49,7 @@
static gboolean tasks_button_cb(GtkWidget *widget, GdkEventButton *event, gpointer data); static gboolean tasks_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data); -static void free_editor_tasks(void *editor); +static void free_editor_tasks(gpointer key, gpointer value, gpointer data); static void scan_all_documents(void); static void scan_document_for_tasks(GeanyDocument *doc); static void create_tasks_tab(void); @@ -77,15 +77,12 @@ static void tasks_cleanup(void) { GtkWidget *notebook; - GList *editors, *editor; int page;
g_string_free(linebuf, TRUE);
- editors = g_hash_table_get_keys(globaltasks); - for(editor = g_list_first(editors); editor; editor = editor->next) - free_editor_tasks(editor); - g_hash_table_unref(globaltasks); + g_hash_table_foreach(globaltasks, free_editor_tasks, NULL); + g_hash_table_destroy(globaltasks);
notebook = ui_lookup_widget(geany->main_widgets->window, "notebook_info"); page = gtk_notebook_page_num(GTK_NOTEBOOK(notebook), notebook_page); @@ -109,7 +106,7 @@ {
if(tasks_enabled && doc->is_valid) - free_editor_tasks(doc->editor); + free_editor_tasks(doc->editor, NULL, NULL);
}
@@ -223,12 +220,12 @@ }
-static void free_editor_tasks(void *editor) +static void free_editor_tasks(gpointer key, gpointer value, gpointer data) { GList *tasklist, *entry; GeanyTask *task;
- tasklist = g_hash_table_lookup(globaltasks, editor); + tasklist = (value) ? value : g_hash_table_lookup(globaltasks, key); if(tasklist) { for(entry = g_list_first(tasklist); entry; entry = g_list_next(entry)) @@ -239,7 +236,7 @@ } g_list_free(tasklist); } - g_hash_table_remove(globaltasks, editor); + g_hash_table_remove(globaltasks, key);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org