aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/fs/namespace_search.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/fs/namespace_search.c')
-rw-r--r--src/plugins/fs/namespace_search.c59
1 files changed, 42 insertions, 17 deletions
diff --git a/src/plugins/fs/namespace_search.c b/src/plugins/fs/namespace_search.c
index 9a31e23d..61db35d7 100644
--- a/src/plugins/fs/namespace_search.c
+++ b/src/plugins/fs/namespace_search.c
@@ -160,17 +160,20 @@ void on_searchNamespaceComboBoxEntry_changed_fs(GtkWidget * dummy,
160 rating); 160 rating);
161 gtk_widget_set_sensitive(spin, 161 gtk_widget_set_sensitive(spin,
162 TRUE); 162 TRUE);
163 keyword
164 = glade_xml_get_widget(getMainXML(),
165 "fssearchKeywordComboBoxEntry");
163 if (OK == NS_getNamespaceRoot(ectx, 166 if (OK == NS_getNamespaceRoot(ectx,
164 cfg, 167 cfg,
165 encStr, 168 encStr,
166 &root)) { 169 &root)) {
167 hash2enc(&root, 170 hash2enc(&root,
168 &enc); 171 &enc);
169 keyword
170 = glade_xml_get_widget(getMainXML(),
171 "fssearchKeywordComboBoxEntry");
172 gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(keyword))), 172 gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(keyword))),
173 (const gchar*) &enc); 173 (const gchar*) &enc);
174 } else {
175 gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(keyword))),
176 "");
174 } 177 }
175 } 178 }
176 } else { 179 } else {
@@ -204,6 +207,8 @@ static void * saveDiscovery(void * cls) {
204 GtkWidget * ncbe; 207 GtkWidget * ncbe;
205 char * desc; 208 char * desc;
206 size_t n; 209 size_t n;
210 int found;
211 char * encName;
207 212
208 DEBUG_BEGIN(); 213 DEBUG_BEGIN();
209 ncbe 214 ncbe
@@ -242,20 +247,40 @@ static void * saveDiscovery(void * cls) {
242 desc, 247 desc,
243 20, 248 20,
244 &enc); 249 &enc);
245 infoMessage(YES, 250 /* check if present! */
246 _("Namespace found: %s - %.*s\n"), 251 found = NO;
247 desc, 252 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model),
248 20, 253 &iter)) {
249 &enc); 254 do {
250 gtk_list_store_append(model, 255 gtk_tree_model_get(GTK_TREE_MODEL(model),
251 &iter); 256 &iter,
252 gtk_list_store_set(model, 257 NS_SEARCH_ENCNAME, &encName,
253 &iter, 258 -1);
254 NS_SEARCH_DESCRIPTION, name, 259 if ( (encName != NULL) &&
255 NS_SEARCH_ENCNAME, &enc, 260 (0 == strcmp(encName,
256 NS_SEARCH_METADATA, dmd, 261 (const char*) &enc)) )
257 NS_SEARCH_RATING, nni->rating, 262 found =YES;
258 -1); 263 FREENONNULL(encName);
264 } while ( (found == NO) &&
265 (gtk_tree_model_iter_next(GTK_TREE_MODEL(model),
266 &iter)) );
267 }
268 if (found == NO) {
269 infoMessage(YES,
270 _("Namespace found: %s - %.*s\n"),
271 desc,
272 20,
273 &enc);
274 gtk_list_store_append(model,
275 &iter);
276 gtk_list_store_set(model,
277 &iter,
278 NS_SEARCH_DESCRIPTION, name,
279 NS_SEARCH_ENCNAME, &enc,
280 NS_SEARCH_METADATA, dmd,
281 NS_SEARCH_RATING, nni->rating,
282 -1);
283 }
259 FREE(name); 284 FREE(name);
260 DEBUG_END(); 285 DEBUG_END();
261 286