aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2005-08-27 23:36:06 +0000
committerChristian Grothoff <christian@grothoff.org>2005-08-27 23:36:06 +0000
commite056460ef09a66334b2e81ddfc04ad00ad5f549f (patch)
tree48ad6e56d4b49dc4808e77ed8fc3bdf40b65a030
parentf2abfd8ec27ed2e1a2edbec79e0e8a765e7eb49b (diff)
downloadgnunet-gtk-e056460ef09a66334b2e81ddfc04ad00ad5f549f.tar.gz
gnunet-gtk-e056460ef09a66334b2e81ddfc04ad00ad5f549f.zip
sync
-rw-r--r--src/plugins/fs/search.c37
1 files changed, 27 insertions, 10 deletions
diff --git a/src/plugins/fs/search.c b/src/plugins/fs/search.c
index 60eecbf1..e8006ac0 100644
--- a/src/plugins/fs/search.c
+++ b/src/plugins/fs/search.c
@@ -600,6 +600,7 @@ void on_fssearchbutton_clicked(gpointer dummy2,
600 GtkWidget * entry; 600 GtkWidget * entry;
601 GtkWidget * spin; 601 GtkWidget * spin;
602 GtkListStore * model; 602 GtkListStore * model;
603 GtkTreeModel * tmodel;
603 GtkTreeIter iter; 604 GtkTreeIter iter;
604 struct ECRS_URI * uri; 605 struct ECRS_URI * uri;
605 const char * ss; 606 const char * ss;
@@ -608,6 +609,7 @@ void on_fssearchbutton_clicked(gpointer dummy2,
608 gint i; 609 gint i;
609 char * tabtxt; 610 char * tabtxt;
610 SearchList * list; 611 SearchList * list;
612 const char * descStr;
611 613
612 searchKeywordGtkCB 614 searchKeywordGtkCB
613 = glade_xml_get_widget(getMainXML(), 615 = glade_xml_get_widget(getMainXML(),
@@ -635,17 +637,31 @@ void on_fssearchbutton_clicked(gpointer dummy2,
635 searchNamespaceGtkCB 637 searchNamespaceGtkCB
636 = glade_xml_get_widget(getMainXML(), 638 = glade_xml_get_widget(getMainXML(),
637 "searchNamespaceComboBoxEntry"); 639 "searchNamespaceComboBoxEntry");
638 entry = gtk_bin_get_child(GTK_BIN(searchNamespaceGtkCB)); 640
639 ns = gtk_entry_get_text(GTK_ENTRY(entry)); 641 tmodel = gtk_combo_box_get_model(GTK_COMBO_BOX(searchNamespaceGtkCB));
640 if ( (ns != NULL) && 642 if (TRUE == gtk_combo_box_get_active_iter(GTK_COMBO_BOX(searchNamespaceGtkCB),
641 (0 == strcmp(ns, 643 &iter)) {
642 _("globally"))) )
643 ns = NULL; 644 ns = NULL;
645 descStr = NULL;
646 gtk_tree_model_get(tmodel,
647 &iter,
648 NS_SEARCH_DESCRIPTION, &descStr,
649 NS_SEARCH_ENCNAME, &ns,
650 -1);
651
652 if ( (descStr != NULL) &&
653 (0 == strcmp(descStr,
654 _("globally"))) ) {
655 ns = NULL;
656 } else {
657 GNUNET_ASSERT(strlen(ns) == sizeof(EncName) - 1);
658 if (descStr == NULL)
659 descStr = ns;
660 }
661 }
644 if (ns != NULL) { 662 if (ns != NULL) {
645 char * ustring; 663 char * ustring;
646 664
647 GNUNET_ASSERT(strlen(ns) > sizeof(EncName));
648 ns = &ns[strlen(ns) - sizeof(EncName) + 1];
649 ustring = MALLOC(strlen(ss) + sizeof(EncName) + 665 ustring = MALLOC(strlen(ss) + sizeof(EncName) +
650 strlen(ECRS_URI_PREFIX) + 666 strlen(ECRS_URI_PREFIX) +
651 strlen(ECRS_SUBSPACE_INFIX) + 10); 667 strlen(ECRS_SUBSPACE_INFIX) + 10);
@@ -669,11 +685,12 @@ void on_fssearchbutton_clicked(gpointer dummy2,
669 if (ns == NULL) { 685 if (ns == NULL) {
670 tabtxt = STRDUP(ss); 686 tabtxt = STRDUP(ss);
671 } else { 687 } else {
672 tabtxt = MALLOC(strlen(ss) + strlen(ns) + 2); 688 GNUNET_ASSERT(descStr != NULL);
689 tabtxt = MALLOC(strlen(ss) + strlen(descStr) + 2);
673 SNPRINTF(tabtxt, 690 SNPRINTF(tabtxt,
674 strlen(ss) + strlen(ns) + 2, 691 strlen(ss) + strlen(descStr) + 2,
675 "%s/%s", 692 "%s/%s",
676 ns, 693 descStr,
677 ss); 694 ss);
678 } 695 }
679 notebook 696 notebook