diff options
Diffstat (limited to 'src/plugins/fs/meta.c')
-rw-r--r-- | src/plugins/fs/meta.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/plugins/fs/meta.c b/src/plugins/fs/meta.c index bd62b62b..e8264554 100644 --- a/src/plugins/fs/meta.c +++ b/src/plugins/fs/meta.c | |||
@@ -33,7 +33,7 @@ | |||
33 | 33 | ||
34 | static int publishMetaData(EXTRACTOR_KeywordType type, | 34 | static int publishMetaData(EXTRACTOR_KeywordType type, |
35 | const char * data, | 35 | const char * data, |
36 | void * cls) { | 36 | void * cls) { |
37 | GtkListStore * store = cls; | 37 | GtkListStore * store = cls; |
38 | const char * stype; | 38 | const char * stype; |
39 | GtkTreeIter iter; | 39 | GtkTreeIter iter; |
@@ -87,10 +87,10 @@ void createMetaDataListTreeView(GladeXML * xml, | |||
87 | NULL); | 87 | NULL); |
88 | gtk_tree_view_set_model(GTK_TREE_VIEW(metaList), | 88 | gtk_tree_view_set_model(GTK_TREE_VIEW(metaList), |
89 | GTK_TREE_MODEL(metamodel)); | 89 | GTK_TREE_MODEL(metamodel)); |
90 | if (init != NULL) | 90 | if (init != NULL) |
91 | ECRS_getMetaData(init, | 91 | ECRS_getMetaData(init, |
92 | &publishMetaData, | 92 | &publishMetaData, |
93 | metamodel); | 93 | metamodel); |
94 | if ( (previewName == NULL) || | 94 | if ( (previewName == NULL) || |
95 | (init == NULL) ) | 95 | (init == NULL) ) |
96 | return; | 96 | return; |
@@ -107,11 +107,11 @@ void createMetaDataListTreeView(GladeXML * xml, | |||
107 | gdk_pixbuf_loader_write(loader, | 107 | gdk_pixbuf_loader_write(loader, |
108 | (const guchar*) thumb, | 108 | (const guchar*) thumb, |
109 | ts, | 109 | ts, |
110 | NULL); | 110 | NULL); |
111 | pixbuf = gdk_pixbuf_loader_get_pixbuf(loader); | 111 | pixbuf = gdk_pixbuf_loader_get_pixbuf(loader); |
112 | g_object_ref(pixbuf); | 112 | g_object_ref(pixbuf); |
113 | gdk_pixbuf_loader_close(loader, | 113 | gdk_pixbuf_loader_close(loader, |
114 | NULL); | 114 | NULL); |
115 | if (pixbuf != NULL) { | 115 | if (pixbuf != NULL) { |
116 | gtk_image_set_from_pixbuf(GTK_IMAGE(preview), | 116 | gtk_image_set_from_pixbuf(GTK_IMAGE(preview), |
117 | pixbuf); | 117 | pixbuf); |
@@ -169,7 +169,7 @@ void createMetaTypeComboBox(GladeXML * xml, | |||
169 | GtkCellRenderer * renderer; | 169 | GtkCellRenderer * renderer; |
170 | GtkListStore * keywordTypeModel; | 170 | GtkListStore * keywordTypeModel; |
171 | GtkTreeIter iter; | 171 | GtkTreeIter iter; |
172 | EXTRACTOR_KeywordType type; | 172 | EXTRACTOR_KeywordType type; |
173 | 173 | ||
174 | keywordTypeModel | 174 | keywordTypeModel |
175 | = gtk_list_store_new(KTYPE_NUM, | 175 | = gtk_list_store_new(KTYPE_NUM, |
@@ -179,15 +179,15 @@ void createMetaTypeComboBox(GladeXML * xml, | |||
179 | name); | 179 | name); |
180 | gtk_combo_box_set_model(GTK_COMBO_BOX(metaType), | 180 | gtk_combo_box_set_model(GTK_COMBO_BOX(metaType), |
181 | GTK_TREE_MODEL(keywordTypeModel)); | 181 | GTK_TREE_MODEL(keywordTypeModel)); |
182 | for (type=0;type<EXTRACTOR_getHighestKeywordTypeNumber();type++) { | 182 | for (type=0;type<EXTRACTOR_getHighestKeywordTypeNumber();type++) { |
183 | stype = EXTRACTOR_getKeywordTypeAsString(type); | 183 | stype = EXTRACTOR_getKeywordTypeAsString(type); |
184 | gtk_list_store_append(keywordTypeModel, | 184 | gtk_list_store_append(keywordTypeModel, |
185 | &iter); | 185 | &iter); |
186 | gtk_list_store_set(keywordTypeModel, | 186 | gtk_list_store_set(keywordTypeModel, |
187 | &iter, | 187 | &iter, |
188 | KTYPE_STRING, stype, | 188 | KTYPE_STRING, stype, |
189 | KTYPE_TYPE, type, | 189 | KTYPE_TYPE, type, |
190 | -1); | 190 | -1); |
191 | } | 191 | } |
192 | renderer = gtk_cell_renderer_text_new(); | 192 | renderer = gtk_cell_renderer_text_new(); |
193 | gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(metaType), | 193 | gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(metaType), |
@@ -208,7 +208,7 @@ void handleKeywordListUpdate(GladeXML * xml, | |||
208 | GtkWidget * entryLine; | 208 | GtkWidget * entryLine; |
209 | GtkListStore * keymodel; | 209 | GtkListStore * keymodel; |
210 | GtkTreeIter iter; | 210 | GtkTreeIter iter; |
211 | 211 | ||
212 | keywordList = glade_xml_get_widget(xml, | 212 | keywordList = glade_xml_get_widget(xml, |
213 | keywordListName); | 213 | keywordListName); |
214 | keymodel | 214 | keymodel |
@@ -222,11 +222,11 @@ void handleKeywordListUpdate(GladeXML * xml, | |||
222 | gtk_list_store_set(keymodel, | 222 | gtk_list_store_set(keymodel, |
223 | &iter, | 223 | &iter, |
224 | 0, keyword, | 224 | 0, keyword, |
225 | -1); | 225 | -1); |
226 | gtk_entry_set_text(GTK_ENTRY(entryLine), ""); | 226 | gtk_entry_set_text(GTK_ENTRY(entryLine), ""); |
227 | } | 227 | } |
228 | 228 | ||
229 | void handleMetaDataListUpdate(GladeXML * xml, | 229 | void handleMetaDataListUpdate(GladeXML * xml, |
230 | const char * typeInputLineName, | 230 | const char * typeInputLineName, |
231 | const char * valueInputLineName, | 231 | const char * valueInputLineName, |
232 | const char * metaDataListName) { | 232 | const char * metaDataListName) { |
@@ -239,19 +239,19 @@ void handleMetaDataListUpdate(GladeXML * xml, | |||
239 | GtkListStore * typemodel; | 239 | GtkListStore * typemodel; |
240 | GtkTreeIter iter; | 240 | GtkTreeIter iter; |
241 | char * stype; | 241 | char * stype; |
242 | 242 | ||
243 | metaList = glade_xml_get_widget(xml, | 243 | metaList = glade_xml_get_widget(xml, |
244 | metaDataListName); | 244 | metaDataListName); |
245 | metamodel | 245 | metamodel |
246 | = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(metaList))); | 246 | = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(metaList))); |
247 | 247 | ||
248 | entryLine = glade_xml_get_widget(xml, | 248 | entryLine = glade_xml_get_widget(xml, |
249 | valueInputLineName); | 249 | valueInputLineName); |
250 | value = gtk_entry_get_text(GTK_ENTRY(entryLine)); | 250 | value = gtk_entry_get_text(GTK_ENTRY(entryLine)); |
251 | if ( (value == NULL) || (strlen(value) == 0) ) | 251 | if ( (value == NULL) || (strlen(value) == 0) ) |
252 | return; | 252 | return; |
253 | typeCB = glade_xml_get_widget(xml, | 253 | typeCB = glade_xml_get_widget(xml, |
254 | typeInputLineName); | 254 | typeInputLineName); |
255 | typemodel | 255 | typemodel |
256 | = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(typeCB))); | 256 | = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(typeCB))); |
257 | if (! gtk_combo_box_get_active_iter(GTK_COMBO_BOX(typeCB), | 257 | if (! gtk_combo_box_get_active_iter(GTK_COMBO_BOX(typeCB), |
@@ -261,7 +261,7 @@ void handleMetaDataListUpdate(GladeXML * xml, | |||
261 | &iter, | 261 | &iter, |
262 | KTYPE_STRING, &stype, | 262 | KTYPE_STRING, &stype, |
263 | KTYPE_TYPE, &type, | 263 | KTYPE_TYPE, &type, |
264 | -1); | 264 | -1); |
265 | gtk_list_store_append(metamodel, | 265 | gtk_list_store_append(metamodel, |
266 | &iter); | 266 | &iter); |
267 | gtk_list_store_set(metamodel, | 267 | gtk_list_store_set(metamodel, |
@@ -269,7 +269,7 @@ void handleMetaDataListUpdate(GladeXML * xml, | |||
269 | META_TYPE, type, | 269 | META_TYPE, type, |
270 | META_STYPE, stype, | 270 | META_STYPE, stype, |
271 | META_VALUE, value, | 271 | META_VALUE, value, |
272 | -1); | 272 | -1); |
273 | gtk_entry_set_text(GTK_ENTRY(entryLine), ""); | 273 | gtk_entry_set_text(GTK_ENTRY(entryLine), ""); |
274 | } | 274 | } |
275 | 275 | ||
@@ -303,17 +303,17 @@ struct ECRS_MetaData * getMetaDataFromList(GladeXML * xml, | |||
303 | } while (gtk_tree_model_iter_next(metamodel, | 303 | } while (gtk_tree_model_iter_next(metamodel, |
304 | &iter)); | 304 | &iter)); |
305 | } | 305 | } |
306 | if (previewName == NULL) | 306 | if (previewName == NULL) |
307 | return meta; | 307 | return meta; |
308 | 308 | ||
309 | preview = glade_xml_get_widget(xml, | 309 | preview = glade_xml_get_widget(xml, |
310 | previewName); | 310 | previewName); |
311 | 311 | ||
312 | if (GTK_IMAGE_PIXBUF == | 312 | if (GTK_IMAGE_PIXBUF == |
313 | gtk_image_get_storage_type(GTK_IMAGE(preview))) { | 313 | gtk_image_get_storage_type(GTK_IMAGE(preview))) { |
314 | size_t length; | 314 | size_t length; |
315 | char * thumb; | 315 | char * thumb; |
316 | 316 | ||
317 | pixbuf = gtk_image_get_pixbuf(GTK_IMAGE(preview)); | 317 | pixbuf = gtk_image_get_pixbuf(GTK_IMAGE(preview)); |
318 | if (pixbuf != NULL) { | 318 | if (pixbuf != NULL) { |
319 | thumb = NULL; | 319 | thumb = NULL; |
@@ -334,7 +334,7 @@ struct ECRS_MetaData * getMetaDataFromList(GladeXML * xml, | |||
334 | FREE(binary); | 334 | FREE(binary); |
335 | } | 335 | } |
336 | } | 336 | } |
337 | } | 337 | } |
338 | return meta; | 338 | return meta; |
339 | } | 339 | } |
340 | 340 | ||
@@ -352,7 +352,7 @@ struct ECRS_URI * getKeywordURIFromList(GladeXML * xml, | |||
352 | keyList = GTK_TREE_VIEW(glade_xml_get_widget(xml, | 352 | keyList = GTK_TREE_VIEW(glade_xml_get_widget(xml, |
353 | name)); | 353 | name)); |
354 | keymodel = gtk_tree_view_get_model(keyList); | 354 | keymodel = gtk_tree_view_get_model(keyList); |
355 | 355 | ||
356 | keywords = NULL; | 356 | keywords = NULL; |
357 | ksize = 0; | 357 | ksize = 0; |
358 | GROW(keywords, | 358 | GROW(keywords, |
@@ -375,9 +375,9 @@ struct ECRS_URI * getKeywordURIFromList(GladeXML * xml, | |||
375 | &iter)); | 375 | &iter)); |
376 | } | 376 | } |
377 | keywords[kpos] = NULL; | 377 | keywords[kpos] = NULL; |
378 | 378 | ||
379 | keywordURI = ECRS_keywordsToUri((const char**)keywords); | 379 | keywordURI = ECRS_keywordsToUri((const char**)keywords); |
380 | while (kpos > 0) | 380 | while (kpos > 0) |
381 | FREE(keywords[--kpos]); | 381 | FREE(keywords[--kpos]); |
382 | GROW(keywords, | 382 | GROW(keywords, |
383 | ksize, | 383 | ksize, |
@@ -403,7 +403,7 @@ int parseTimeInterval(const char * timeSpec, | |||
403 | else if (0 == strcmp(_("--no update--"), | 403 | else if (0 == strcmp(_("--no update--"), |
404 | timeSpec)) | 404 | timeSpec)) |
405 | *interval = ECRS_SBLOCK_UPDATE_NONE; | 405 | *interval = ECRS_SBLOCK_UPDATE_NONE; |
406 | else | 406 | else |
407 | return parseTime(timeSpec, | 407 | return parseTime(timeSpec, |
408 | interval); | 408 | interval); |
409 | return OK; | 409 | return OK; |