aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2005-06-05 10:29:40 +0000
committerChristian Grothoff <christian@grothoff.org>2005-06-05 10:29:40 +0000
commitf64f0d61c832c05acae8d28369b13674e434c954 (patch)
tree2432c6c16c70920ee11cb8de34af5e9bcce745d0
parenta637d1ec6b3492e41e2673fa9871350ba4347340 (diff)
downloadgnunet-gtk-f64f0d61c832c05acae8d28369b13674e434c954.tar.gz
gnunet-gtk-f64f0d61c832c05acae8d28369b13674e434c954.zip
bugfixes
-rw-r--r--src/search.c66
-rw-r--r--src/upload.c4
2 files changed, 67 insertions, 3 deletions
diff --git a/src/search.c b/src/search.c
index e0b02bf7..b28efdeb 100644
--- a/src/search.c
+++ b/src/search.c
@@ -209,6 +209,9 @@ void displaySearchResult(const ECRS_FileInfo * info,
209 const struct ECRS_URI * uri, 209 const struct ECRS_URI * uri,
210 GtkTreeRowReference * row) { 210 GtkTreeRowReference * row) {
211 SearchList * list; 211 SearchList * list;
212 struct ECRS_URI * euri;
213 unsigned int count;
214 GtkTreeIter iter;
212 215
213 list = head; 216 list = head;
214 while (list != NULL) { 217 while (list != NULL) {
@@ -224,6 +227,32 @@ void displaySearchResult(const ECRS_FileInfo * info,
224 addSearchResultToModel(info, 227 addSearchResultToModel(info,
225 list->treeview, 228 list->treeview,
226 row); 229 row);
230
231 if (! gtk_tree_model_get_iter_first(GTK_TREE_MODEL(summary),
232 &iter)) {
233 BREAK();
234 return;
235 }
236
237 do {
238 gtk_tree_model_get(GTK_TREE_MODEL(summary),
239 &iter,
240 1, &count,
241 2, &euri,
242 -1);
243 if (ECRS_equalsUri(euri,
244 uri)) {
245 count++;
246 gtk_list_store_set(GTK_LIST_STORE(summary),
247 &iter,
248 1, count,
249 -1);
250 return;
251 }
252
253 } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(summary),
254 &iter));
255 BREAK();
227} 256}
228 257
229void on_closeSearchButton_clicked(GtkWidget * searchPage, 258void on_closeSearchButton_clicked(GtkWidget * searchPage,
@@ -234,6 +263,8 @@ void on_closeSearchButton_clicked(GtkWidget * searchPage,
234 struct ECRS_URI * uri; 263 struct ECRS_URI * uri;
235 SearchList * list; 264 SearchList * list;
236 SearchList * prev; 265 SearchList * prev;
266 GtkTreeIter iter;
267 struct ECRS_URI * euri;
237 268
238 list = head; 269 list = head;
239 prev = NULL; 270 prev = NULL;
@@ -247,7 +278,6 @@ void on_closeSearchButton_clicked(GtkWidget * searchPage,
247 uri = list->uri; 278 uri = list->uri;
248 FSUI_stopSearch(ctx, 279 FSUI_stopSearch(ctx,
249 uri); 280 uri);
250 ECRS_freeUri(uri);
251 if (prev == NULL) 281 if (prev == NULL)
252 head = list->next; 282 head = list->next;
253 else 283 else
@@ -269,6 +299,30 @@ void on_closeSearchButton_clicked(GtkWidget * searchPage,
269 } else { 299 } else {
270 BREAK(); 300 BREAK();
271 } 301 }
302
303 if (! gtk_tree_model_get_iter_first(GTK_TREE_MODEL(summary),
304 &iter)) {
305 BREAK();
306 ECRS_freeUri(uri);
307 return;
308 }
309 do {
310 gtk_tree_model_get(GTK_TREE_MODEL(summary),
311 &iter,
312 2, &euri,
313 -1);
314 if (ECRS_equalsUri(euri,
315 uri)) {
316 gtk_list_store_remove(GTK_LIST_STORE(summary),
317 &iter);
318 ECRS_freeUri(euri);
319 ECRS_freeUri(uri);
320 return;
321 }
322 } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(summary),
323 &iter));
324 ECRS_freeUri(uri);
325 BREAK();
272} 326}
273 327
274static GtkWidget * makeResultFrame(GtkWidget ** treeview) { 328static GtkWidget * makeResultFrame(GtkWidget ** treeview) {
@@ -446,6 +500,16 @@ void on_fssearchbutton_clicked(gpointer dummy2,
446 list->uri 500 list->uri
447 = uri; 501 = uri;
448 head = list; 502 head = list;
503
504 gtk_list_store_append(summary,
505 &iter);
506 gtk_list_store_set(summary,
507 &iter,
508 0, tabtxt,
509 1, 0,
510 2, ECRS_dupUri(uri),
511 -1);
512
449 label = gtk_label_new(tabtxt); 513 label = gtk_label_new(tabtxt);
450 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), 514 gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
451 list->searchpage, 515 list->searchpage,
diff --git a/src/upload.c b/src/upload.c
index 0319ab76..2dc54ab6 100644
--- a/src/upload.c
+++ b/src/upload.c
@@ -118,7 +118,7 @@ void displayUploadUpdate(const char * mainName,
118 &child, 118 &child,
119 &iter); 119 &iter);
120 gtk_tree_store_set(GTK_TREE_STORE(summary), 120 gtk_tree_store_set(GTK_TREE_STORE(summary),
121 &iter, 121 &child,
122 0, filename, 122 0, filename,
123 1, progress, 123 1, progress,
124 2, NULL, 124 2, NULL,
@@ -637,6 +637,7 @@ void on_fsinsertuploadbutton_clicked(gpointer dummy,
637 getConfigurationInt("FS", 637 getConfigurationInt("FS",
638 "ANONYMITY"), /* FIXME */ 638 "ANONYMITY"), /* FIXME */
639 doIndex, 639 doIndex,
640 NO,
640 meta, 641 meta,
641 keywordURI); 642 keywordURI);
642 } 643 }
@@ -739,7 +740,6 @@ void fs_upload_start() {
739 GTK_TREE_MODEL(model)); 740 GTK_TREE_MODEL(model));
740 gtk_combo_box_entry_set_text_column(GTK_COMBO_BOX_ENTRY(uploadEntry), 741 gtk_combo_box_entry_set_text_column(GTK_COMBO_BOX_ENTRY(uploadEntry),
741 0); 742 0);
742
743} 743}
744 744
745void fs_upload_stop() { 745void fs_upload_stop() {