[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r1978 - gnunet-gtk/src/plugins/fs
From: |
grothoff |
Subject: |
[GNUnet-SVN] r1978 - gnunet-gtk/src/plugins/fs |
Date: |
Sat, 27 Aug 2005 16:36:07 -0700 (PDT) |
Author: grothoff
Date: 2005-08-27 16:36:06 -0700 (Sat, 27 Aug 2005)
New Revision: 1978
Modified:
gnunet-gtk/src/plugins/fs/search.c
Log:
sync
Modified: gnunet-gtk/src/plugins/fs/search.c
===================================================================
--- gnunet-gtk/src/plugins/fs/search.c 2005-08-27 23:17:58 UTC (rev 1977)
+++ gnunet-gtk/src/plugins/fs/search.c 2005-08-27 23:36:06 UTC (rev 1978)
@@ -600,6 +600,7 @@
GtkWidget * entry;
GtkWidget * spin;
GtkListStore * model;
+ GtkTreeModel * tmodel;
GtkTreeIter iter;
struct ECRS_URI * uri;
const char * ss;
@@ -608,6 +609,7 @@
gint i;
char * tabtxt;
SearchList * list;
+ const char * descStr;
searchKeywordGtkCB
= glade_xml_get_widget(getMainXML(),
@@ -635,17 +637,31 @@
searchNamespaceGtkCB
= glade_xml_get_widget(getMainXML(),
"searchNamespaceComboBoxEntry");
- entry = gtk_bin_get_child(GTK_BIN(searchNamespaceGtkCB));
- ns = gtk_entry_get_text(GTK_ENTRY(entry));
- if ( (ns != NULL) &&
- (0 == strcmp(ns,
- _("globally"))) )
+
+ tmodel = gtk_combo_box_get_model(GTK_COMBO_BOX(searchNamespaceGtkCB));
+ if (TRUE ==
gtk_combo_box_get_active_iter(GTK_COMBO_BOX(searchNamespaceGtkCB),
+ &iter)) {
ns = NULL;
+ descStr = NULL;
+ gtk_tree_model_get(tmodel,
+ &iter,
+ NS_SEARCH_DESCRIPTION, &descStr,
+ NS_SEARCH_ENCNAME, &ns,
+ -1);
+
+ if ( (descStr != NULL) &&
+ (0 == strcmp(descStr,
+ _("globally"))) ) {
+ ns = NULL;
+ } else {
+ GNUNET_ASSERT(strlen(ns) == sizeof(EncName) - 1);
+ if (descStr == NULL)
+ descStr = ns;
+ }
+ }
if (ns != NULL) {
char * ustring;
- GNUNET_ASSERT(strlen(ns) > sizeof(EncName));
- ns = &ns[strlen(ns) - sizeof(EncName) + 1];
ustring = MALLOC(strlen(ss) + sizeof(EncName) +
strlen(ECRS_URI_PREFIX) +
strlen(ECRS_SUBSPACE_INFIX) + 10);
@@ -669,11 +685,12 @@
if (ns == NULL) {
tabtxt = STRDUP(ss);
} else {
- tabtxt = MALLOC(strlen(ss) + strlen(ns) + 2);
+ GNUNET_ASSERT(descStr != NULL);
+ tabtxt = MALLOC(strlen(ss) + strlen(descStr) + 2);
SNPRINTF(tabtxt,
- strlen(ss) + strlen(ns) + 2,
+ strlen(ss) + strlen(descStr) + 2,
"%s/%s",
- ns,
+ descStr,
ss);
}
notebook
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r1978 - gnunet-gtk/src/plugins/fs,
grothoff <=