gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r3967 - gnunet-gtk/src/plugins/fs


From: grothoff
Subject: [GNUnet-SVN] r3967 - gnunet-gtk/src/plugins/fs
Date: Sun, 17 Dec 2006 17:56:25 -0800 (PST)

Author: grothoff
Date: 2006-12-17 17:56:21 -0800 (Sun, 17 Dec 2006)
New Revision: 3967

Modified:
   gnunet-gtk/src/plugins/fs/download.c
Log:
bugfix

Modified: gnunet-gtk/src/plugins/fs/download.c
===================================================================
--- gnunet-gtk/src/plugins/fs/download.c        2006-12-18 01:26:44 UTC (rev 
3966)
+++ gnunet-gtk/src/plugins/fs/download.c        2006-12-18 01:56:21 UTC (rev 
3967)
@@ -417,8 +417,11 @@
  */
 void fs_download_stopped(DownloadList * list) {
   GtkTreeIter iter;
+  GtkTreeIter piter;
   GtkTreePath * path;
   DownloadList * prev;
+  int valid;
+  GtkTreeModel * model;
 
   path = gtk_tree_row_reference_get_path(list->summaryViewRowReference);
   if (path == NULL) {
@@ -433,16 +436,36 @@
     gtk_tree_store_remove(download_summary,
                          &iter);
   }
+  FREE(list->filename);
+  ECRS_freeUri(list->uri);
+
+  /* if we have child-results in view, remove them! */
+  if (list->searchList != NULL) {
+    path = gtk_tree_row_reference_get_path(list->searchViewRowReference);
+    if (path == NULL) {
+      GE_BREAK(ectx, 0);
+    } else {
+      model = GTK_TREE_MODEL(list->searchList->tree);
+       gtk_tree_model_get_iter(model,
+                             &piter,
+                             path);
+      gtk_tree_path_free(path);
+      valid = gtk_tree_model_iter_children(model,
+                                          &iter,
+                                          &piter);
+      while (TRUE == valid) 
+       valid = gtk_tree_store_remove(GTK_TREE_STORE(model),
+                                     &iter);
+    }    
+  }
   if (list->searchViewRowReference != NULL) {
     gtk_tree_row_reference_free(list->searchViewRowReference);
     list->searchViewRowReference = NULL;
   }
-  FREE(list->filename);
-  ECRS_freeUri(list->uri);
 
-  if (download_head == list)
+  if (download_head == list) {
     download_head = list->next;
-  else {
+  } else {
     prev = download_head;
     while ( (prev != NULL) &&
            (prev->next != list) )





reply via email to

[Prev in Thread] Current Thread [Next in Thread]