From 4ac92bd6d0a3633d70bf25a989d85da4a914c4bf Mon Sep 17 00:00:00 2001 From: Eric Petit Date: Thu, 12 Jan 2006 18:45:41 +0000 Subject: [PATCH] Update 2005-12-01 --- configure | 34 ++++++++++++++++++++-------------- gtk/main.c | 7 ++++++- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/configure b/configure index b54fa9054..0bdde054d 100755 --- a/configure +++ b/configure @@ -47,24 +47,30 @@ gtk_test() { if pkg-config gtk+-2.0 > /dev/null 2>&1 then - cat > testconf.c << EOF - #include - int main() - { - gtk_main(); - } -EOF - if $CC `pkg-config gtk+-2.0 --cflags --libs` -o testconf testconf.c > /dev/null 2>&1 + if expr `pkg-config --modversion gtk+-2.0` '>=' 2.6.0 > /dev/null 2>&1 then - echo "GTK+: yes" - GTK=yes - GTKCCFLAGS=`pkg-config gtk+-2.0 --cflags` - GTKLINKLIBS=`pkg-config gtk+-2.0 --libs` + cat > testconf.c << EOF + #include + int main() + { + gtk_main(); + } +EOF + if $CC `pkg-config gtk+-2.0 --cflags --libs` -o testconf testconf.c > /dev/null 2>&1 + then + echo "GTK+: yes" + GTK=yes + GTKCCFLAGS=`pkg-config gtk+-2.0 --cflags` + GTKLINKLIBS=`pkg-config gtk+-2.0 --libs` + else + echo "GTK+: no" + GTK=no + fi + rm -f testconf.c testconf else - echo "GTK+: no" + echo "GTK+: no (2.6.0 or later is required)" GTK=no fi - rm -f testconf.c testconf else echo "GTK+: no" GTK=no diff --git a/gtk/main.c b/gtk/main.c index c3846f523..f18dc225f 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -472,6 +472,11 @@ updatemodel(gpointer gdata) { } free(st); + /* remove any excess rows */ + if(gtk_tree_model_iter_next(GTK_TREE_MODEL(data->model), &iter)) + while(gtk_list_store_remove(data->model, &iter)) + ; + return TRUE; } @@ -592,8 +597,8 @@ actionclick(GtkWidget *widget, gpointer gdata) { tr_torrentStop(data->tr, index); free(sb); tr_torrentClose(data->tr, index); - gtk_list_store_remove(GTK_LIST_STORE(model), &iter); savetorrents(data->tr, data->wind, -1, NULL); + updatemodel(data); break; case ACT_INFO: makeinfowind(data, index);