diff options
Diffstat (limited to 'src/plugins/fs/search.c')
-rw-r--r-- | src/plugins/fs/search.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/src/plugins/fs/search.c b/src/plugins/fs/search.c index 26e3844a..92329cb9 100644 --- a/src/plugins/fs/search.c +++ b/src/plugins/fs/search.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "gnunetgtk_common.h" | 28 | #include "gnunetgtk_common.h" |
29 | #include "search.h" | 29 | #include "search.h" |
30 | #include "status.h" | ||
30 | #include "helper.h" | 31 | #include "helper.h" |
31 | #include "fs.h" | 32 | #include "fs.h" |
32 | #include "meta.h" | 33 | #include "meta.h" |
@@ -1164,27 +1165,35 @@ on_fssearchbutton_clicked_fs (gpointer dummy2, GtkWidget * searchButton) | |||
1164 | &iter)) | 1165 | &iter)) |
1165 | { | 1166 | { |
1166 | char *descStr; | 1167 | char *descStr; |
1167 | char *ns; | 1168 | char *nsName; |
1168 | 1169 | ||
1169 | ns = NULL; | 1170 | nsName = NULL; |
1170 | descStr = NULL; | 1171 | descStr = NULL; |
1171 | gtk_tree_model_get (gtk_combo_box_get_model | 1172 | gtk_tree_model_get (gtk_combo_box_get_model |
1172 | (GTK_COMBO_BOX (searchNamespaceGtkCB)), &iter, | 1173 | (GTK_COMBO_BOX (searchNamespaceGtkCB)), &iter, |
1173 | NS_SEARCH_DESCRIPTION, &descStr, NS_SEARCH_ENCNAME, | 1174 | NS_SEARCH_DESCRIPTION, &descStr, NS_SEARCH_NAME, |
1174 | &ns, -1); | 1175 | &nsName, -1); |
1175 | 1176 | ||
1176 | if ((descStr != NULL) && (0 == strcmp (descStr, _("globally")))) | 1177 | if ((descStr != NULL) && (0 == strcmp (descStr, ""))) |
1177 | { | 1178 | { |
1178 | ns = NULL; | 1179 | nsName = NULL; |
1179 | } | 1180 | } |
1180 | else | 1181 | else |
1181 | { | 1182 | { |
1182 | if ((descStr == NULL) && (ns != NULL)) | 1183 | if ((descStr == NULL) && (nsName != NULL)) |
1183 | descStr = GNUNET_strdup (ns); | 1184 | descStr = GNUNET_strdup (nsName); |
1184 | } | 1185 | } |
1185 | if (ns != NULL) | 1186 | if (nsName != NULL) |
1186 | { | 1187 | { |
1187 | char *ustring; | 1188 | char *ustring; |
1189 | GNUNET_EncName enc; | ||
1190 | GNUNET_HashCode nsid; | ||
1191 | |||
1192 | GNUNET_GE_ASSERT(NULL, | ||
1193 | GNUNET_OK == | ||
1194 | GNUNET_pseudonym_name_to_id(ectx, cfg, | ||
1195 | nsName, &nsid)); | ||
1196 | GNUNET_hash_to_enc(&nsid, &enc); | ||
1188 | 1197 | ||
1189 | ustring = | 1198 | ustring = |
1190 | GNUNET_malloc (strlen (searchString) + sizeof (GNUNET_EncName) + | 1199 | GNUNET_malloc (strlen (searchString) + sizeof (GNUNET_EncName) + |
@@ -1192,7 +1201,7 @@ on_fssearchbutton_clicked_fs (gpointer dummy2, GtkWidget * searchButton) | |||
1192 | strlen (GNUNET_ECRS_SUBSPACE_INFIX) + 10); | 1201 | strlen (GNUNET_ECRS_SUBSPACE_INFIX) + 10); |
1193 | strcpy (ustring, GNUNET_ECRS_URI_PREFIX); | 1202 | strcpy (ustring, GNUNET_ECRS_URI_PREFIX); |
1194 | strcat (ustring, GNUNET_ECRS_SUBSPACE_INFIX); | 1203 | strcat (ustring, GNUNET_ECRS_SUBSPACE_INFIX); |
1195 | strcat (ustring, ns); | 1204 | strcat (ustring, (const char*)&enc); |
1196 | strcat (ustring, "/"); | 1205 | strcat (ustring, "/"); |
1197 | strcat (ustring, searchString); | 1206 | strcat (ustring, searchString); |
1198 | fsss.uri = GNUNET_ECRS_string_to_uri (ectx, ustring); | 1207 | fsss.uri = GNUNET_ECRS_string_to_uri (ectx, ustring); |
@@ -1208,8 +1217,8 @@ on_fssearchbutton_clicked_fs (gpointer dummy2, GtkWidget * searchButton) | |||
1208 | } | 1217 | } |
1209 | if (descStr != NULL) | 1218 | if (descStr != NULL) |
1210 | free (descStr); | 1219 | free (descStr); |
1211 | if (ns != NULL) | 1220 | if (nsName != NULL) |
1212 | free (ns); | 1221 | free (nsName); |
1213 | } | 1222 | } |
1214 | if (fsss.uri == NULL) | 1223 | if (fsss.uri == NULL) |
1215 | fsss.uri = GNUNET_ECRS_keyword_string_to_uri (ectx, searchString); | 1224 | fsss.uri = GNUNET_ECRS_keyword_string_to_uri (ectx, searchString); |