1 /* tracker-tags-view.c generated by valac 0.18.1, the Vala compiler
2 * generated from tracker-tags-view.vala, do not modify */
3
4 /*
5 * Copyright (C) 2011, Martyn Russell <martyn@lanedo.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 * 02110-1301, USA.
21 */
22
23 #include <glib.h>
24 #include <glib-object.h>
25 #include <gtk/gtk.h>
26 #include <gio/gio.h>
27 #include <stdlib.h>
28 #include <string.h>
29 #include "libtracker-sparql/tracker-sparql.h"
30 #include <glib/gi18n-lib.h>
31 #include <pango/pango.h>
32 #include <gobject/gvaluecollector.h>
33
34
35 #define TYPE_TAG_DATA (tag_data_get_type ())
36 #define TAG_DATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG_DATA, TagData))
37 #define TAG_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG_DATA, TagDataClass))
38 #define IS_TAG_DATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG_DATA))
39 #define IS_TAG_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG_DATA))
40 #define TAG_DATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG_DATA, TagDataClass))
41
42 typedef struct _TagData TagData;
43 typedef struct _TagDataClass TagDataClass;
44 typedef struct _TagDataPrivate TagDataPrivate;
45
46 #define TYPE_TRACKER_TAGS_VIEW (tracker_tags_view_get_type ())
47 #define TRACKER_TAGS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TRACKER_TAGS_VIEW, TrackerTagsView))
48 #define TRACKER_TAGS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TRACKER_TAGS_VIEW, TrackerTagsViewClass))
49 #define IS_TRACKER_TAGS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TRACKER_TAGS_VIEW))
50 #define IS_TRACKER_TAGS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TRACKER_TAGS_VIEW))
51 #define TRACKER_TAGS_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TRACKER_TAGS_VIEW, TrackerTagsViewClass))
52
53 typedef struct _TrackerTagsView TrackerTagsView;
54 typedef struct _TrackerTagsViewClass TrackerTagsViewClass;
55 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
56 #define _g_free0(var) (var = (g_free (var), NULL))
57 typedef struct _ParamSpecTagData ParamSpecTagData;
58 typedef struct _TrackerTagsViewPrivate TrackerTagsViewPrivate;
59 #define __g_list_free__g_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_free0_ (var), NULL)))
60 #define _tag_data_unref0(var) ((var == NULL) ? NULL : (var = (tag_data_unref (var), NULL)))
61 #define __g_list_free__tag_data_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__tag_data_unref0_ (var), NULL)))
62
63 #define TRACKER_TAGS_VIEW_TYPE_COL (tracker_tags_view_col_get_type ())
64
65 #define TRACKER_TAGS_VIEW_TYPE_SELECTION (tracker_tags_view_selection_get_type ())
66 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
67 typedef struct _Block1Data Block1Data;
68 #define _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)))
69 typedef struct _TrackerTagsViewModelToggleRowData TrackerTagsViewModelToggleRowData;
70 typedef struct _Block2Data Block2Data;
71 typedef struct _TrackerTagsViewRemoveTagData TrackerTagsViewRemoveTagData;
72 typedef struct _TrackerTagsViewAddTagData TrackerTagsViewAddTagData;
73 typedef struct _Block3Data Block3Data;
74 typedef struct _TrackerTagsViewQueryTagsForFilesData TrackerTagsViewQueryTagsForFilesData;
75 typedef struct _TrackerTagsViewQueryTagsData TrackerTagsViewQueryTagsData;
76 typedef struct _TrackerTagsViewQueryFilesForTagIdData TrackerTagsViewQueryFilesForTagIdData;
77
78 struct _TagData {
79 GTypeInstance parent_instance;
80 volatile int ref_count;
81 TagDataPrivate * priv;
82 TrackerTagsView* tv;
83 GCancellable* cancellable;
84 gchar* tag_id;
85 GtkTreeIter iter;
86 gint items;
87 gboolean update;
88 gboolean selected;
89 };
90
91 struct _TagDataClass {
92 GTypeClass parent_class;
93 void (*finalize) (TagData *self);
94 };
95
96 struct _ParamSpecTagData {
97 GParamSpec parent_instance;
98 };
99
100 struct _TrackerTagsView {
101 GtkVBox parent_instance;
102 TrackerTagsViewPrivate * priv;
103 };
104
105 struct _TrackerTagsViewClass {
106 GtkVBoxClass parent_class;
107 };
108
109 struct _TrackerTagsViewPrivate {
110 TrackerSparqlConnection* connection;
111 GCancellable* cancellable;
112 GList* tag_data_requests;
113 GList* files;
114 GtkListStore* store;
115 GtkVBox* vbox;
116 GtkLabel* label;
117 GtkEntry* entry;
118 GtkButton* button_add;
119 GtkButton* button_remove;
120 GtkScrolledWindow* scrolled_window;
121 GtkTreeView* view;
122 };
123
124 typedef enum {
125 TRACKER_TAGS_VIEW_COL_SELECTION,
126 TRACKER_TAGS_VIEW_COL_TAG_ID,
127 TRACKER_TAGS_VIEW_COL_TAG_NAME,
128 TRACKER_TAGS_VIEW_COL_TAG_COUNT,
129 TRACKER_TAGS_VIEW_COL_TAG_COUNT_VALUE,
130 TRACKER_TAGS_VIEW_COL_N_COLUMNS
131 } TrackerTagsViewCol;
132
133 typedef enum {
134 TRACKER_TAGS_VIEW_SELECTION_INCONSISTENT = -1,
135 TRACKER_TAGS_VIEW_SELECTION_FALSE = 0,
136 TRACKER_TAGS_VIEW_SELECTION_TRUE = 1
137 } TrackerTagsViewSelection;
138
139 struct _Block1Data {
140 int _ref_count_;
141 TrackerTagsView * self;
142 GtkMessageDialog* msg;
143 };
144
145 struct _TrackerTagsViewModelToggleRowData {
146 int _state_;
147 GObject* _source_object_;
148 GAsyncResult* _res_;
149 GSimpleAsyncResult* _async_result;
150 TrackerTagsView* self;
151 GtkTreePath* path;
152 GtkTreeModel* model;
153 GtkTreeIter iter;
154 gchar* id;
155 gchar* tag;
156 gint selection;
157 GtkTreeView* _tmp0_;
158 GtkTreeModel* _tmp1_;
159 GtkTreeModel* _tmp2_;
160 GtkTreeModel* _tmp3_;
161 GtkTreePath* _tmp4_;
162 GtkTreeIter _tmp5_;
163 gboolean _tmp6_;
164 GtkTreeModel* _tmp7_;
165 GtkTreeIter _tmp8_;
166 TrackerTagsViewSelection _tmp9_;
167 gint _tmp10_;
168 TrackerTagsViewSelection _tmp11_;
169 gint new_value;
170 const gchar* _tmp12_;
171 gchar* _tmp13_;
172 gchar* tag_escaped;
173 gchar* _tmp14_;
174 gchar* filter;
175 gchar* query;
176 TagData* td;
177 gint _tmp15_;
178 const gchar* _tmp16_;
179 const gchar* _tmp17_;
180 gchar* _tmp18_;
181 const gchar* _tmp19_;
182 const gchar* _tmp20_;
183 gchar* _tmp21_;
184 const gchar* _tmp22_;
185 GtkTreeIter _tmp23_;
186 TagData* _tmp24_;
187 TagData* _tmp25_;
188 TagData* _tmp26_;
189 TagData* _tmp27_;
190 TrackerSparqlConnection* _tmp28_;
191 GtkEntry* _tmp29_;
192 const gchar* _tmp30_;
193 GtkTreeIter _tmp31_;
194 gint _tmp32_;
195 TagData* _tmp33_;
196 TagData* _tmp34_;
197 TagData* _tmp35_;
198 TrackerSparqlConnection* _tmp36_;
199 const gchar* _tmp37_;
200 TagData* _tmp38_;
201 GCancellable* _tmp39_;
202 TagData* _tmp40_;
203 GtkEntry* _tmp41_;
204 GError* e;
205 GError* _tmp42_;
206 const gchar* _tmp43_;
207 const gchar* _tmp44_;
208 GError* _tmp45_;
209 TagData* _tmp46_;
210 GtkEntry* _tmp47_;
211 GError * _inner_error_;
212 };
213
214 struct _Block2Data {
215 int _ref_count_;
216 TrackerTagsView * self;
217 GtkTreeIter found_iter;
218 gboolean found;
219 gchar* tag;
220 };
221
222 struct _TrackerTagsViewRemoveTagData {
223 int _state_;
224 GObject* _source_object_;
225 GAsyncResult* _res_;
226 GSimpleAsyncResult* _async_result;
227 TrackerTagsView* self;
228 TagData* td;
229 TrackerSparqlConnection* _tmp0_;
230 TagData* _tmp1_;
231 const gchar* _tmp2_;
232 TagData* _tmp3_;
233 TagData* _tmp5_;
234 const gchar* _tmp6_;
235 gchar* _tmp7_;
236 gchar* query;
237 TrackerSparqlConnection* _tmp8_;
238 const gchar* _tmp9_;
239 TagData* _tmp10_;
240 GCancellable* _tmp11_;
241 GtkListStore* _tmp12_;
242 TagData* _tmp13_;
243 GtkTreeIter _tmp14_;
244 GError* e;
245 GError* _tmp15_;
246 const gchar* _tmp16_;
247 const gchar* _tmp17_;
248 GError* _tmp18_;
249 TagData* _tmp19_;
250 GError * _inner_error_;
251 };
252
253 struct _TrackerTagsViewAddTagData {
254 int _state_;
255 GObject* _source_object_;
256 GAsyncResult* _res_;
257 GSimpleAsyncResult* _async_result;
258 TrackerTagsView* self;
259 gchar* tag;
260 gchar* query;
261 TrackerSparqlConnection* _tmp0_;
262 const gchar* _tmp1_;
263 GtkEntry* _tmp2_;
264 gboolean _tmp3_;
265 GList* _tmp4_;
266 GList* _tmp5_;
267 guint _tmp6_;
268 gboolean _tmp7_;
269 gchar* _tmp8_;
270 gchar* _tmp9_;
271 gchar* filter;
272 const gchar* _tmp10_;
273 gchar* _tmp11_;
274 gchar* tag_escaped;
275 GList* _tmp12_;
276 GList* url_collection;
277 GList* url_it;
278 gchar* _tmp13_;
279 gchar* url;
280 const gchar* _tmp14_;
281 const gchar* _tmp15_;
282 const gchar* _tmp16_;
283 gchar* _tmp17_;
284 gchar* _tmp18_;
285 gchar* _tmp19_;
286 const gchar* _tmp20_;
287 const gchar* _tmp21_;
288 const gchar* _tmp22_;
289 const gchar* _tmp23_;
290 const gchar* _tmp24_;
291 gchar* _tmp25_;
292 gchar* _tmp26_;
293 gchar* _tmp27_;
294 const gchar* _tmp28_;
295 gchar* _tmp29_;
296 gchar* tag_label_escaped;
297 const gchar* _tmp30_;
298 const gchar* _tmp31_;
299 gchar* _tmp32_;
300 GList* _tmp33_;
301 guint _tmp34_;
302 TagData* _tmp35_;
303 TagData* td;
304 TagData* _tmp36_;
305 TagData* _tmp37_;
306 TrackerSparqlConnection* _tmp38_;
307 const gchar* _tmp39_;
308 TagData* _tmp40_;
309 GCancellable* _tmp41_;
310 TagData* _tmp42_;
311 GtkEntry* _tmp43_;
312 GError* e;
313 GError* _tmp44_;
314 const gchar* _tmp45_;
315 const gchar* _tmp46_;
316 GError* _tmp47_;
317 TagData* _tmp48_;
318 GtkEntry* _tmp49_;
319 GError * _inner_error_;
320 };
321
322 struct _Block3Data {
323 int _ref_count_;
324 TrackerTagsView * self;
325 GtkListStore* store;
326 };
327
328 struct _TrackerTagsViewQueryTagsForFilesData {
329 int _state_;
330 GObject* _source_object_;
331 GAsyncResult* _res_;
332 GSimpleAsyncResult* _async_result;
333 TrackerTagsView* self;
334 GList* _tmp0_;
335 gchar* _tmp1_;
336 gchar* files_filter;
337 GList* _tmp2_;
338 GList* url_collection;
339 GList* url_it;
340 gchar* _tmp3_;
341 gchar* url;
342 const gchar* _tmp4_;
343 gint _tmp5_;
344 gint _tmp6_;
345 const gchar* _tmp7_;
346 gchar* _tmp8_;
347 const gchar* _tmp9_;
348 const gchar* _tmp10_;
349 gchar* _tmp11_;
350 gchar* _tmp12_;
351 gchar* _tmp13_;
352 const gchar* _tmp14_;
353 gchar* _tmp15_;
354 gchar* query;
355 TrackerSparqlConnection* _tmp16_;
356 const gchar* _tmp17_;
357 TrackerSparqlCursor* _tmp18_;
358 TrackerSparqlCursor* cursor;
359 TrackerSparqlCursor* _tmp19_;
360 gboolean _tmp20_;
361 gboolean _tmp21_;
362 TrackerSparqlCursor* _tmp22_;
363 const gchar* _tmp23_;
364 const gchar* id;
365 TrackerSparqlCursor* _tmp24_;
366 const gchar* _tmp25_;
367 const gchar* label;
368 const gchar* _tmp26_;
369 const gchar* _tmp27_;
370 GtkTreeIter iter;
371 const gchar* _tmp28_;
372 GtkTreeIter _tmp29_;
373 gboolean _tmp30_;
374 GtkListStore* _tmp31_;
375 GtkTreeIter _tmp32_;
376 GError* e;
377 GError* _tmp33_;
378 const gchar* _tmp34_;
379 const gchar* _tmp35_;
380 GError* _tmp36_;
381 GError * _inner_error_;
382 };
383
384 struct _TrackerTagsViewQueryTagsData {
385 int _state_;
386 GObject* _source_object_;
387 GAsyncResult* _res_;
388 GSimpleAsyncResult* _async_result;
389 TrackerTagsView* self;
390 gchar* _tmp0_;
391 gchar* query;
392 GtkListStore* _tmp1_;
393 TrackerSparqlConnection* _tmp2_;
394 const gchar* _tmp3_;
395 TrackerSparqlCursor* _tmp4_;
396 TrackerSparqlCursor* cursor;
397 TrackerSparqlCursor* _tmp5_;
398 gboolean _tmp6_;
399 gboolean _tmp7_;
400 TrackerSparqlCursor* _tmp8_;
401 const gchar* _tmp9_;
402 const gchar* id;
403 TrackerSparqlCursor* _tmp10_;
404 const gchar* _tmp11_;
405 const gchar* label;
406 const gchar* _tmp12_;
407 const gchar* _tmp13_;
408 GtkTreeIter iter;
409 GtkListStore* _tmp14_;
410 GtkTreeIter _tmp15_;
411 GtkListStore* _tmp16_;
412 GtkTreeIter _tmp17_;
413 const gchar* _tmp18_;
414 const gchar* _tmp19_;
415 const gchar* _tmp20_;
416 GtkTreeIter _tmp21_;
417 TagData* _tmp22_;
418 TagData* td;
419 TagData* _tmp23_;
420 TagData* _tmp24_;
421 TagData* _tmp25_;
422 GError* e;
423 GError* _tmp26_;
424 const gchar* _tmp27_;
425 const gchar* _tmp28_;
426 GError* _tmp29_;
427 GError * _inner_error_;
428 };
429
430 struct _TrackerTagsViewQueryFilesForTagIdData {
431 int _state_;
432 GObject* _source_object_;
433 GAsyncResult* _res_;
434 GSimpleAsyncResult* _async_result;
435 TrackerTagsView* self;
436 TagData* td;
437 TrackerSparqlConnection* _tmp0_;
438 TagData* _tmp1_;
439 const gchar* _tmp2_;
440 TagData* _tmp3_;
441 TagData* _tmp5_;
442 const gchar* _tmp6_;
443 gchar* _tmp7_;
444 gchar* query;
445 TrackerSparqlConnection* _tmp8_;
446 const gchar* _tmp9_;
447 TagData* _tmp10_;
448 GCancellable* _tmp11_;
449 TrackerSparqlCursor* _tmp12_;
450 TrackerSparqlCursor* cursor;
451 guint has_tag_in_selection;
452 guint files_with_tag;
453 GList* _tmp13_;
454 guint _tmp14_;
455 guint files_selected;
456 TrackerSparqlCursor* _tmp15_;
457 gboolean _tmp16_;
458 gboolean _tmp17_;
459 guint _tmp18_;
460 GList* _tmp19_;
461 GList* url_collection;
462 GList* url_it;
463 gchar* _tmp20_;
464 gchar* url;
465 TrackerSparqlCursor* _tmp21_;
466 const gchar* _tmp22_;
467 const gchar* url_returned;
468 const gchar* _tmp23_;
469 const gchar* _tmp24_;
470 const gchar* _tmp25_;
471 const gchar* _tmp26_;
472 const gchar* _tmp27_;
473 guint _tmp28_;
474 guint _tmp29_;
475 guint _tmp30_;
476 guint _tmp31_;
477 guint _tmp32_;
478 GtkListStore* _tmp33_;
479 TagData* _tmp34_;
480 GtkTreeIter _tmp35_;
481 guint _tmp36_;
482 guint _tmp37_;
483 GtkListStore* _tmp38_;
484 TagData* _tmp39_;
485 GtkTreeIter _tmp40_;
486 GtkListStore* _tmp41_;
487 TagData* _tmp42_;
488 GtkTreeIter _tmp43_;
489 guint _tmp44_;
490 gchar* _tmp45_;
491 gchar* str;
492 GtkListStore* _tmp46_;
493 TagData* _tmp47_;
494 GtkTreeIter _tmp48_;
495 const gchar* _tmp49_;
496 guint _tmp50_;
497 GError* e;
498 GError* _tmp51_;
499 const gchar* _tmp52_;
500 const gchar* _tmp53_;
501 GError* _tmp54_;
502 TagData* _tmp55_;
503 GError * _inner_error_;
504 };
505
506
507 static gpointer tag_data_parent_class = NULL;
508 static gpointer tracker_tags_view_parent_class = NULL;
509
510 gpointer tag_data_ref (gpointer instance);
511 void tag_data_unref (gpointer instance);
512 GParamSpec* param_spec_tag_data (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
513 void value_set_tag_data (GValue* value, gpointer v_object);
514 void value_take_tag_data (GValue* value, gpointer v_object);
515 gpointer value_get_tag_data (const GValue* value);
516 GType tag_data_get_type (void) G_GNUC_CONST;
517 GType tracker_tags_view_get_type (void) G_GNUC_CONST;
518 enum {
519 TAG_DATA_DUMMY_PROPERTY
520 };
521 TagData* tag_data_new (const gchar* _tag_id, GtkTreeIter* _iter, gboolean _update, gboolean _selected, gint _items, TrackerTagsView* _tv);
522 TagData* tag_data_construct (GType object_type, const gchar* _tag_id, GtkTreeIter* _iter, gboolean _update, gboolean _selected, gint _items, TrackerTagsView* _tv);
523 static void tag_data_finalize (TagData* obj);
524 #define TRACKER_TAGS_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_TRACKER_TAGS_VIEW, TrackerTagsViewPrivate))
525 enum {
526 TRACKER_TAGS_VIEW_DUMMY_PROPERTY
527 };
528 static void _g_free0_ (gpointer var);
529 static void _g_list_free__g_free0_ (GList* self);
530 static void _tag_data_unref0_ (gpointer var);
531 static void _g_list_free__tag_data_unref0_ (GList* self);
532 static GType tracker_tags_view_col_get_type (void) G_GNUC_UNUSED;
533 static GType tracker_tags_view_selection_get_type (void) G_GNUC_UNUSED;
534 #define TRACKER_TAGS_VIEW_UI_FILE "tracker-needle.ui"
535 TrackerTagsView* tracker_tags_view_new (GList* _files);
536 TrackerTagsView* tracker_tags_view_construct (GType object_type, GList* _files);
537 static void tracker_tags_view_create_ui (TrackerTagsView* self);
538 void tracker_tags_view_hide_label (TrackerTagsView* self);
539 void tracker_tags_view_set_files (TrackerTagsView* self, GList* _files);
540 static void tracker_tags_view_update_for_files (TrackerTagsView* self);
541 static void tracker_tags_view_show_error_dialog (TrackerTagsView* self, const gchar* action, GError* e);
542 static Block1Data* block1_data_ref (Block1Data* _data1_);
543 static void block1_data_unref (void * _userdata_);
544 static void __lambda3_ (Block1Data* _data1_);
545 static void ___lambda3__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
546 void tracker_tags_view_button_remove_clicked_cb (GtkButton* source, TrackerTagsView* self);
547 static void tracker_tags_view_remove_tag (TrackerTagsView* self, TagData* td, GAsyncReadyCallback _callback_, gpointer _user_data_);
548 static void tracker_tags_view_remove_tag_finish (TrackerTagsView* self, GAsyncResult* _res_);
549 void tracker_tags_view_button_add_clicked_cb (GtkButton* source, TrackerTagsView* self);
550 static void tracker_tags_view_add_tag (TrackerTagsView* self, const gchar* tag, GAsyncReadyCallback _callback_, gpointer _user_data_);
551 static void tracker_tags_view_add_tag_finish (TrackerTagsView* self, GAsyncResult* _res_);
552 void tracker_tags_view_entry_tag_activated_cb (GtkEntry* source, TrackerTagsView* self);
553 void tracker_tags_view_entry_tag_changed_cb (GtkEditable* source, TrackerTagsView* self);
554 static gboolean tracker_tags_view_find_tag (TrackerTagsView* self, const gchar* tag, GtkTreeIter* iter);
555 void tracker_tags_view_treeview_tags_cell_toggled_cb (GtkCellRendererToggle* source, const gchar* path_string, TrackerTagsView* self);
556 static void tracker_tags_view_model_toggle_row (TrackerTagsView* self, GtkTreePath* path, GAsyncReadyCallback _callback_, gpointer _user_data_);
557 static void tracker_tags_view_model_toggle_row_finish (TrackerTagsView* self, GAsyncResult* _res_);
558 void tracker_tags_view_treeview_tags_row_selected_cb (GtkTreeSelection* selection, TrackerTagsView* self);
559 void tracker_tags_view_treeview_tags_row_activated_cb (GtkTreeView* source, GtkTreePath* path, GtkTreeViewColumn* column, TrackerTagsView* self);
560 static void tracker_tags_view_treeview_tags_toggle_cell_data_func (GtkCellLayout* layout, GtkCellRenderer* cell, GtkTreeModel* model, GtkTreeIter* iter, TrackerTagsView* self);
561 static void _tracker_tags_view_entry_tag_changed_cb_gtk_editable_changed (GtkEditable* _sender, gpointer self);
562 static void _tracker_tags_view_button_add_clicked_cb_gtk_button_clicked (GtkButton* _sender, gpointer self);
563 static void _tracker_tags_view_button_remove_clicked_cb_gtk_button_clicked (GtkButton* _sender, gpointer self);
564 static void _tracker_tags_view_treeview_tags_cell_toggled_cb_gtk_cell_renderer_toggle_toggled (GtkCellRendererToggle* _sender, const gchar* path, gpointer self);
565 static void _tracker_tags_view_treeview_tags_toggle_cell_data_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self);
566 static void _tracker_tags_view_treeview_tags_row_selected_cb_gtk_tree_selection_changed (GtkTreeSelection* _sender, gpointer self);
567 static void _tracker_tags_view_treeview_tags_row_activated_cb_gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self);
568 static void tracker_tags_view_query_tags (TrackerTagsView* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
569 static void tracker_tags_view_query_tags_finish (TrackerTagsView* self, GAsyncResult* _res_);
570 static void tracker_tags_view_query_tags_for_files (TrackerTagsView* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
571 static void tracker_tags_view_query_tags_for_files_finish (TrackerTagsView* self, GAsyncResult* _res_);
572 static void tracker_tags_view_model_toggle_row_data_free (gpointer _data);
573 static gboolean tracker_tags_view_model_toggle_row_co (TrackerTagsViewModelToggleRowData* _data_);
574 static gchar* tracker_tags_view_sparql_get_escaped_string (TrackerTagsView* self, const gchar* str);
575 static gchar* tracker_tags_view_sparql_get_filter_string (TrackerTagsView* self, const gchar* tag);
576 static void tracker_tags_view_query_files_for_tag_id (TrackerTagsView* self, TagData* td, GAsyncReadyCallback _callback_, gpointer _user_data_);
577 static void tracker_tags_view_query_files_for_tag_id_finish (TrackerTagsView* self, GAsyncResult* _res_);
578 static void tracker_tags_view_model_toggle_row_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
579 static void tracker_tags_view_update_tag_data (TrackerTagsView* self, TagData* td);
580 static Block2Data* block2_data_ref (Block2Data* _data2_);
581 static void block2_data_unref (void * _userdata_);
582 static gboolean __lambda2_ (Block2Data* _data2_, GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* foreach_iter);
583 static gboolean ___lambda2__gtk_tree_model_foreach_func (GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, gpointer self);
584 static void tracker_tags_view_remove_tag_data_free (gpointer _data);
585 static gboolean tracker_tags_view_remove_tag_co (TrackerTagsViewRemoveTagData* _data_);
586 static void tracker_tags_view_remove_tag_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
587 static void tracker_tags_view_add_tag_data_free (gpointer _data);
588 static gboolean tracker_tags_view_add_tag_co (TrackerTagsViewAddTagData* _data_);
589 static void tracker_tags_view_add_tag_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
590 static void tracker_tags_view_untoggle_all (TrackerTagsView* self);
591 static Block3Data* block3_data_ref (Block3Data* _data3_);
592 static void block3_data_unref (void * _userdata_);
593 static gboolean __lambda4_ (Block3Data* _data3_, GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* foreach_iter);
594 static gboolean ___lambda4__gtk_tree_model_foreach_func (GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, gpointer self);
595 static void tracker_tags_view_query_tags_for_files_data_free (gpointer _data);
596 static gboolean tracker_tags_view_query_tags_for_files_co (TrackerTagsViewQueryTagsForFilesData* _data_);
597 static void tracker_tags_view_query_tags_for_files_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
598 static void tracker_tags_view_query_tags_data_free (gpointer _data);
599 static gboolean tracker_tags_view_query_tags_co (TrackerTagsViewQueryTagsData* _data_);
600 static void tracker_tags_view_query_tags_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
601 static void tracker_tags_view_query_files_for_tag_id_data_free (gpointer _data);
602 static gboolean tracker_tags_view_query_files_for_tag_id_co (TrackerTagsViewQueryFilesForTagIdData* _data_);
603 static void tracker_tags_view_query_files_for_tag_id_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
604 static void tracker_tags_view_finalize (GObject* obj);
605
606
607 static gpointer _g_object_ref0 (gpointer self) {
608 return self ? g_object_ref (self) : NULL;
609 }
610
611
612 TagData* tag_data_construct (GType object_type, const gchar* _tag_id, GtkTreeIter* _iter, gboolean _update, gboolean _selected, gint _items, TrackerTagsView* _tv) {
613 TagData* self = NULL;
614 TrackerTagsView* _tmp0_;
615 TrackerTagsView* _tmp1_;
616 GCancellable* _tmp2_;
617 const gchar* _tmp3_;
618 gchar* _tmp4_;
619 GtkTreeIter* _tmp5_;
620 gint _tmp7_;
621 gboolean _tmp8_;
622 gboolean _tmp9_;
623 g_return_val_if_fail (_tv != NULL, NULL);
624 self = (TagData*) g_type_create_instance (object_type);
625 g_debug ("tracker-tags-view.vala:33: Creating tag data");
626 _tmp0_ = _tv;
627 _tmp1_ = _g_object_ref0 (_tmp0_);
628 _g_object_unref0 (self->tv);
629 self->tv = _tmp1_;
630 _tmp2_ = g_cancellable_new ();
631 _g_object_unref0 (self->cancellable);
632 self->cancellable = _tmp2_;
633 _tmp3_ = _tag_id;
634 _tmp4_ = g_strdup (_tmp3_);
635 _g_free0 (self->tag_id);
636 self->tag_id = _tmp4_;
637 _tmp5_ = _iter;
638 if (_tmp5_ != NULL) {
639 GtkTreeIter* _tmp6_;
640 _tmp6_ = _iter;
641 self->iter = *_tmp6_;
642 }
643 _tmp7_ = _items;
644 self->items = _tmp7_;
645 _tmp8_ = _update;
646 self->update = _tmp8_;
647 _tmp9_ = _selected;
648 self->selected = _tmp9_;
649 return self;
650 }
651
652
653 TagData* tag_data_new (const gchar* _tag_id, GtkTreeIter* _iter, gboolean _update, gboolean _selected, gint _items, TrackerTagsView* _tv) {
654 return tag_data_construct (TYPE_TAG_DATA, _tag_id, _iter, _update, _selected, _items, _tv);
655 }
656
657
658 static void value_tag_data_init (GValue* value) {
659 value->data[0].v_pointer = NULL;
660 }
661
662
663 static void value_tag_data_free_value (GValue* value) {
664 if (value->data[0].v_pointer) {
665 tag_data_unref (value->data[0].v_pointer);
666 }
667 }
668
669
670 static void value_tag_data_copy_value (const GValue* src_value, GValue* dest_value) {
671 if (src_value->data[0].v_pointer) {
672 dest_value->data[0].v_pointer = tag_data_ref (src_value->data[0].v_pointer);
673 } else {
674 dest_value->data[0].v_pointer = NULL;
675 }
676 }
677
678
679 static gpointer value_tag_data_peek_pointer (const GValue* value) {
680 return value->data[0].v_pointer;
681 }
682
683
684 static gchar* value_tag_data_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
685 if (collect_values[0].v_pointer) {
686 TagData* object;
687 object = collect_values[0].v_pointer;
688 if (object->parent_instance.g_class == NULL) {
689 return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
690 } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
691 return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
692 }
693 value->data[0].v_pointer = tag_data_ref (object);
694 } else {
695 value->data[0].v_pointer = NULL;
696 }
697 return NULL;
698 }
699
700
701 static gchar* value_tag_data_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
702 TagData** object_p;
703 object_p = collect_values[0].v_pointer;
704 if (!object_p) {
705 return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
706 }
707 if (!value->data[0].v_pointer) {
708 *object_p = NULL;
709 } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
710 *object_p = value->data[0].v_pointer;
711 } else {
712 *object_p = tag_data_ref (value->data[0].v_pointer);
713 }
714 return NULL;
715 }
716
717
718 GParamSpec* param_spec_tag_data (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
719 ParamSpecTagData* spec;
720 g_return_val_if_fail (g_type_is_a (object_type, TYPE_TAG_DATA), NULL);
721 spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
722 G_PARAM_SPEC (spec)->value_type = object_type;
723 return G_PARAM_SPEC (spec);
724 }
725
726
727 gpointer value_get_tag_data (const GValue* value) {
728 g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TAG_DATA), NULL);
729 return value->data[0].v_pointer;
730 }
731
732
733 void value_set_tag_data (GValue* value, gpointer v_object) {
734 TagData* old;
735 g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TAG_DATA));
736 old = value->data[0].v_pointer;
737 if (v_object) {
738 g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_TAG_DATA));
739 g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
740 value->data[0].v_pointer = v_object;
741 tag_data_ref (value->data[0].v_pointer);
742 } else {
743 value->data[0].v_pointer = NULL;
744 }
745 if (old) {
746 tag_data_unref (old);
747 }
748 }
749
750
751 void value_take_tag_data (GValue* value, gpointer v_object) {
752 TagData* old;
753 g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TAG_DATA));
754 old = value->data[0].v_pointer;
755 if (v_object) {
756 g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_TAG_DATA));
757 g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
758 value->data[0].v_pointer = v_object;
759 } else {
760 value->data[0].v_pointer = NULL;
761 }
762 if (old) {
763 tag_data_unref (old);
764 }
765 }
766
767
768 static void tag_data_class_init (TagDataClass * klass) {
769 tag_data_parent_class = g_type_class_peek_parent (klass);
770 TAG_DATA_CLASS (klass)->finalize = tag_data_finalize;
771 }
772
773
774 static void tag_data_instance_init (TagData * self) {
775 self->ref_count = 1;
776 }
777
778
779 static void tag_data_finalize (TagData* obj) {
780 TagData * self;
781 GCancellable* _tmp0_;
782 self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_TAG_DATA, TagData);
783 _tmp0_ = self->cancellable;
784 if (_tmp0_ != NULL) {
785 GCancellable* _tmp1_;
786 _tmp1_ = self->cancellable;
787 g_cancellable_cancel (_tmp1_);
788 _g_object_unref0 (self->cancellable);
789 self->cancellable = NULL;
790 }
791 _g_object_unref0 (self->tv);
792 _g_object_unref0 (self->cancellable);
793 _g_free0 (self->tag_id);
794 }
795
796
797 GType tag_data_get_type (void) {
798 static volatile gsize tag_data_type_id__volatile = 0;
799 if (g_once_init_enter (&tag_data_type_id__volatile)) {
800 static const GTypeValueTable g_define_type_value_table = { value_tag_data_init, value_tag_data_free_value, value_tag_data_copy_value, value_tag_data_peek_pointer, "p", value_tag_data_collect_value, "p", value_tag_data_lcopy_value };
801 static const GTypeInfo g_define_type_info = { sizeof (TagDataClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tag_data_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TagData), 0, (GInstanceInitFunc) tag_data_instance_init, &g_define_type_value_table };
802 static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
803 GType tag_data_type_id;
804 tag_data_type_id = g_type_register_fundamental (g_type_fundamental_next (), "TagData", &g_define_type_info, &g_define_type_fundamental_info, 0);
805 g_once_init_leave (&tag_data_type_id__volatile, tag_data_type_id);
806 }
807 return tag_data_type_id__volatile;
808 }
809
810
811 gpointer tag_data_ref (gpointer instance) {
812 TagData* self;
813 self = instance;
814 g_atomic_int_inc (&self->ref_count);
815 return instance;
816 }
817
818
819 void tag_data_unref (gpointer instance) {
820 TagData* self;
821 self = instance;
822 if (g_atomic_int_dec_and_test (&self->ref_count)) {
823 TAG_DATA_GET_CLASS (self)->finalize (self);
824 g_type_free_instance ((GTypeInstance *) self);
825 }
826 }
827
828
829 static void _g_free0_ (gpointer var) {
830 var = (g_free (var), NULL);
831 }
832
833
834 static void _g_list_free__g_free0_ (GList* self) {
835 g_list_foreach (self, (GFunc) _g_free0_, NULL);
836 g_list_free (self);
837 }
838
839
840 static gpointer _tag_data_ref0 (gpointer self) {
841 return self ? tag_data_ref (self) : NULL;
842 }
843
844
845 static void _tag_data_unref0_ (gpointer var) {
846 (var == NULL) ? NULL : (var = (tag_data_unref (var), NULL));
847 }
848
849
850 static void _g_list_free__tag_data_unref0_ (GList* self) {
851 g_list_foreach (self, (GFunc) _tag_data_unref0_, NULL);
852 g_list_free (self);
853 }
854
855
856 static GType tracker_tags_view_col_get_type (void) {
857 static volatile gsize tracker_tags_view_col_type_id__volatile = 0;
858 if (g_once_init_enter (&tracker_tags_view_col_type_id__volatile)) {
859 static const GEnumValue values[] = {{TRACKER_TAGS_VIEW_COL_SELECTION, "TRACKER_TAGS_VIEW_COL_SELECTION", "selection"}, {TRACKER_TAGS_VIEW_COL_TAG_ID, "TRACKER_TAGS_VIEW_COL_TAG_ID", "tag-id"}, {TRACKER_TAGS_VIEW_COL_TAG_NAME, "TRACKER_TAGS_VIEW_COL_TAG_NAME", "tag-name"}, {TRACKER_TAGS_VIEW_COL_TAG_COUNT, "TRACKER_TAGS_VIEW_COL_TAG_COUNT", "tag-count"}, {TRACKER_TAGS_VIEW_COL_TAG_COUNT_VALUE, "TRACKER_TAGS_VIEW_COL_TAG_COUNT_VALUE", "tag-count-value"}, {TRACKER_TAGS_VIEW_COL_N_COLUMNS, "TRACKER_TAGS_VIEW_COL_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
860 GType tracker_tags_view_col_type_id;
861 tracker_tags_view_col_type_id = g_enum_register_static ("TrackerTagsViewCol", values);
862 g_once_init_leave (&tracker_tags_view_col_type_id__volatile, tracker_tags_view_col_type_id);
863 }
864 return tracker_tags_view_col_type_id__volatile;
865 }
866
867
868 static GType tracker_tags_view_selection_get_type (void) {
869 static volatile gsize tracker_tags_view_selection_type_id__volatile = 0;
870 if (g_once_init_enter (&tracker_tags_view_selection_type_id__volatile)) {
871 static const GEnumValue values[] = {{TRACKER_TAGS_VIEW_SELECTION_INCONSISTENT, "TRACKER_TAGS_VIEW_SELECTION_INCONSISTENT", "inconsistent"}, {TRACKER_TAGS_VIEW_SELECTION_FALSE, "TRACKER_TAGS_VIEW_SELECTION_FALSE", "false"}, {TRACKER_TAGS_VIEW_SELECTION_TRUE, "TRACKER_TAGS_VIEW_SELECTION_TRUE", "true"}, {0, NULL, NULL}};
872 GType tracker_tags_view_selection_type_id;
873 tracker_tags_view_selection_type_id = g_enum_register_static ("TrackerTagsViewSelection", values);
874 g_once_init_leave (&tracker_tags_view_selection_type_id__volatile, tracker_tags_view_selection_type_id);
875 }
876 return tracker_tags_view_selection_type_id__volatile;
877 }
878
879
880 TrackerTagsView* tracker_tags_view_construct (GType object_type, GList* _files) {
881 TrackerTagsView * self = NULL;
882 GList* _tmp4_;
883 GCancellable* _tmp5_;
884 GtkListStore* _tmp6_;
885 GError * _inner_error_ = NULL;
886 self = (TrackerTagsView*) g_object_new (object_type, NULL);
887 {
888 TrackerSparqlConnection* _tmp0_ = NULL;
889 TrackerSparqlConnection* _tmp1_;
890 _tmp0_ = tracker_sparql_connection_get (NULL, &_inner_error_);
891 _tmp1_ = _tmp0_;
892 if (_inner_error_ != NULL) {
893 goto __catch13_g_error;
894 }
895 _g_object_unref0 (self->priv->connection);
896 self->priv->connection = _tmp1_;
897 }
898 goto __finally13;
899 __catch13_g_error:
900 {
901 GError* e = NULL;
902 GError* _tmp2_;
903 const gchar* _tmp3_;
904 e = _inner_error_;
905 _inner_error_ = NULL;
906 _tmp2_ = e;
907 _tmp3_ = _tmp2_->message;
908 g_warning ("tracker-tags-view.vala:94: Could not get Sparql connection: %s", _tmp3_);
909 _g_error_free0 (e);
910 }
911 __finally13:
912 if (_inner_error_ != NULL) {
913 __g_list_free__g_free0_0 (_files);
914 g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
915 g_clear_error (&_inner_error_);
916 return NULL;
917 }
918 _tmp4_ = _files;
919 _files = NULL;
920 __g_list_free__g_free0_0 (self->priv->files);
921 self->priv->files = _tmp4_;
922 _tmp5_ = g_cancellable_new ();
923 _g_object_unref0 (self->priv->cancellable);
924 self->priv->cancellable = _tmp5_;
925 _tmp6_ = gtk_list_store_new ((gint) TRACKER_TAGS_VIEW_COL_N_COLUMNS, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT);
926 _g_object_unref0 (self->priv->store);
927 self->priv->store = _tmp6_;
928 tracker_tags_view_create_ui (self);
929 __g_list_free__g_free0_0 (_files);
930 return self;
931 }
932
933
934 TrackerTagsView* tracker_tags_view_new (GList* _files) {
935 return tracker_tags_view_construct (TYPE_TRACKER_TAGS_VIEW, _files);
936 }
937
938
939 void tracker_tags_view_hide_label (TrackerTagsView* self) {
940 GtkLabel* _tmp0_;
941 g_return_if_fail (self != NULL);
942 _tmp0_ = self->priv->label;
943 gtk_widget_hide ((GtkWidget*) _tmp0_);
944 }
945
946
947 void tracker_tags_view_set_files (TrackerTagsView* self, GList* _files) {
948 GList* _tmp0_;
949 GList* _tmp3_;
950 g_return_if_fail (self != NULL);
951 _tmp0_ = self->priv->files;
952 if (_tmp0_ != NULL) {
953 GList* _tmp1_;
954 _tmp1_ = self->priv->files;
955 {
956 GList* url_collection = NULL;
957 GList* url_it = NULL;
958 url_collection = _tmp1_;
959 for (url_it = url_collection; url_it != NULL; url_it = url_it->next) {
960 gchar* _tmp2_;
961 gchar* url = NULL;
962 _tmp2_ = g_strdup ((const gchar*) url_it->data);
963 url = _tmp2_;
964 {
965 _g_free0 (url);
966 url = NULL;
967 _g_free0 (url);
968 }
969 }
970 }
971 __g_list_free__g_free0_0 (self->priv->files);
972 self->priv->files = NULL;
973 }
974 _tmp3_ = _files;
975 if (_tmp3_ != NULL) {
976 GList* _tmp4_;
977 _tmp4_ = _files;
978 {
979 GList* url_collection = NULL;
980 GList* url_it = NULL;
981 url_collection = _tmp4_;
982 for (url_it = url_collection; url_it != NULL; url_it = url_it->next) {
983 gchar* _tmp5_;
984 gchar* url = NULL;
985 _tmp5_ = g_strdup ((const gchar*) url_it->data);
986 url = _tmp5_;
987 {
988 const gchar* _tmp6_;
989 gchar* _tmp7_;
990 _tmp6_ = url;
991 _tmp7_ = g_strdup (_tmp6_);
992 self->priv->files = g_list_prepend (self->priv->files, _tmp7_);
993 _g_free0 (url);
994 }
995 }
996 }
997 self->priv->files = g_list_reverse (self->priv->files);
998 }
999 tracker_tags_view_update_for_files (self);
1000 }
1001
1002
1003 static Block1Data* block1_data_ref (Block1Data* _data1_) {
1004 g_atomic_int_inc (&_data1_->_ref_count_);
1005 return _data1_;
1006 }
1007
1008
1009 static void block1_data_unref (void * _userdata_) {
1010 Block1Data* _data1_;
1011 _data1_ = (Block1Data*) _userdata_;
1012 if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
1013 TrackerTagsView * self;
1014 self = _data1_->self;
1015 _g_object_unref0 (_data1_->msg);
1016 _g_object_unref0 (self);
1017 g_slice_free (Block1Data, _data1_);
1018 }
1019 }
1020
1021
1022 static void __lambda3_ (Block1Data* _data1_) {
1023 TrackerTagsView * self;
variable 'self' set but not used
(emitted by gcc)
1024 self = _data1_->self;
1025 gtk_widget_destroy ((GtkWidget*) _data1_->msg);
1026 }
1027
1028
1029 static void ___lambda3__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
1030 __lambda3_ (self);
1031 }
1032
1033
1034 static void tracker_tags_view_show_error_dialog (TrackerTagsView* self, const gchar* action, GError* e) {
1035 Block1Data* _data1_;
1036 const gchar* _tmp0_ = NULL;
1037 GError* _tmp1_;
1038 const gchar* _tmp2_;
1039 const gchar* _tmp6_;
1040 gchar* _tmp7_;
1041 gchar* str;
1042 const gchar* _tmp8_;
1043 GtkMessageDialog* _tmp9_;
1044 g_return_if_fail (self != NULL);
1045 g_return_if_fail (action != NULL);
1046 _data1_ = g_slice_new0 (Block1Data);
1047 _data1_->_ref_count_ = 1;
1048 _data1_->self = g_object_ref (self);
1049 _tmp1_ = e;
1050 _tmp2_ = _tmp1_->message;
1051 if (_tmp2_ != NULL) {
1052 GError* _tmp3_;
1053 const gchar* _tmp4_;
1054 _tmp3_ = e;
1055 _tmp4_ = _tmp3_->message;
1056 _tmp0_ = _tmp4_;
1057 } else {
1058 const gchar* _tmp5_ = NULL;
1059 _tmp5_ = _ ("No error was given");
1060 _tmp0_ = _tmp5_;
1061 }
1062 _tmp6_ = _tmp0_;
1063 _tmp7_ = g_strdup (_tmp6_);
1064 str = _tmp7_;
1065 _tmp8_ = action;
1066 _tmp9_ = (GtkMessageDialog*) gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", _tmp8_);
1067 g_object_ref_sink (_tmp9_);
1068 _data1_->msg = _tmp9_;
1069 gtk_message_dialog_format_secondary_text (_data1_->msg, "%s", str);
1070 g_signal_connect_data ((GtkDialog*) _data1_->msg, "response", (GCallback) ___lambda3__gtk_dialog_response, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
1071 gtk_dialog_run ((GtkDialog*) _data1_->msg);
1072 _g_free0 (str);
1073 block1_data_unref (_data1_);
1074 _data1_ = NULL;
1075 }
1076
1077
1078 void tracker_tags_view_button_remove_clicked_cb (GtkButton* source, TrackerTagsView* self) {
1079 GtkTreeIter iter = {0};
1080 GtkTreeModel* model = NULL;
1081 GtkTreeView* _tmp0_;
1082 GtkTreeSelection* _tmp1_ = NULL;
1083 GtkTreeSelection* _tmp2_;
1084 GtkTreeSelection* selection;
1085 GtkTreeSelection* _tmp3_;
1086 GtkTreeModel* _tmp4_ = NULL;
1087 GtkTreeIter _tmp5_ = {0};
1088 gboolean _tmp6_ = FALSE;
1089 GtkTreeModel* _tmp7_;
1090 g_return_if_fail (self != NULL);
1091 g_return_if_fail (source != NULL);
1092 g_debug ("tracker-tags-view.vala:177: Remove clicked");
1093 _tmp0_ = self->priv->view;
1094 _tmp1_ = gtk_tree_view_get_selection (_tmp0_);
1095 _tmp2_ = _g_object_ref0 (_tmp1_);
1096 selection = _tmp2_;
1097 _tmp3_ = selection;
1098 _tmp6_ = gtk_tree_selection_get_selected (_tmp3_, &_tmp4_, &_tmp5_);
1099 _g_object_unref0 (model);
1100 _tmp7_ = _g_object_ref0 (_tmp4_);
1101 model = _tmp7_;
1102 iter = _tmp5_;
1103 if (_tmp6_) {
1104 gchar* id = NULL;
1105 GtkTreeModel* _tmp8_;
1106 GtkTreeIter _tmp9_;
1107 const gchar* _tmp10_;
1108 GtkTreeIter _tmp11_;
1109 TagData* _tmp12_;
1110 TagData* td;
1111 TagData* _tmp13_;
1112 TagData* _tmp14_;
1113 TagData* _tmp15_;
1114 _tmp8_ = model;
1115 _tmp9_ = iter;
1116 gtk_tree_model_get (_tmp8_, &_tmp9_, TRACKER_TAGS_VIEW_COL_TAG_ID, &id, -1, -1);
1117 _tmp10_ = id;
1118 _tmp11_ = iter;
1119 _tmp12_ = tag_data_new (_tmp10_, &_tmp11_, FALSE, TRUE, 1, self);
1120 td = _tmp12_;
1121 _tmp13_ = td;
1122 _tmp14_ = _tag_data_ref0 (_tmp13_);
1123 self->priv->tag_data_requests = g_list_prepend (self->priv->tag_data_requests, _tmp14_);
1124 _tmp15_ = td;
1125 tracker_tags_view_remove_tag (self, _tmp15_, NULL, NULL);
1126 _tag_data_unref0 (td);
1127 _g_free0 (id);
1128 }
1129 _g_object_unref0 (selection);
1130 _g_object_unref0 (model);
1131 }
1132
1133
1134 void tracker_tags_view_button_add_clicked_cb (GtkButton* source, TrackerTagsView* self) {
1135 GtkEntry* _tmp0_;
1136 const gchar* _tmp1_ = NULL;
1137 const gchar* tag;
1138 g_return_if_fail (self != NULL);
1139 g_return_if_fail (source != NULL);
1140 g_debug ("tracker-tags-view.vala:198: Add clicked");
1141 _tmp0_ = self->priv->entry;
1142 _tmp1_ = gtk_entry_get_text (_tmp0_);
1143 tag = _tmp1_;
1144 tracker_tags_view_add_tag (self, tag, NULL, NULL);
1145 }
1146
1147
1148 void tracker_tags_view_entry_tag_activated_cb (GtkEntry* source, TrackerTagsView* self) {
1149 GtkButton* _tmp0_;
1150 g_return_if_fail (self != NULL);
1151 g_return_if_fail (source != NULL);
1152 g_debug ("tracker-tags-view.vala:205: Entry activated");
1153 _tmp0_ = self->priv->button_add;
1154 gtk_widget_activate (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GTK_TYPE_WIDGET, GtkWidget));
1155 }
1156
1157
1158 void tracker_tags_view_entry_tag_changed_cb (GtkEditable* source, TrackerTagsView* self) {
1159 GtkEntry* _tmp0_;
1160 const gchar* _tmp1_ = NULL;
1161 const gchar* tag;
1162 GtkTreeIter iter = {0};
variable 'iter' set but not used
(emitted by gcc)
1163 const gchar* _tmp2_;
1164 GtkTreeIter _tmp3_ = {0};
1165 gboolean _tmp4_ = FALSE;
1166 g_return_if_fail (self != NULL);
1167 g_return_if_fail (source != NULL);
1168 g_debug ("tracker-tags-view.vala:211: Entry changed");
1169 _tmp0_ = self->priv->entry;
1170 _tmp1_ = gtk_entry_get_text (_tmp0_);
1171 tag = _tmp1_;
1172 _tmp2_ = tag;
1173 _tmp4_ = tracker_tags_view_find_tag (self, _tmp2_, &_tmp3_);
1174 iter = _tmp3_;
1175 if (_tmp4_) {
1176 GtkButton* _tmp5_;
1177 _tmp5_ = self->priv->button_add;
1178 gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GTK_TYPE_WIDGET, GtkWidget), FALSE);
1179 } else {
1180 gboolean _tmp6_ = FALSE;
1181 const gchar* _tmp7_;
1182 GtkButton* _tmp9_;
1183 gboolean _tmp10_;
1184 _tmp7_ = tag;
1185 if (_tmp7_ != NULL) {
1186 const gchar* _tmp8_;
1187 _tmp8_ = tag;
1188 _tmp6_ = g_strcmp0 (_tmp8_, "") != 0;
1189 } else {
1190 _tmp6_ = FALSE;
1191 }
1192 _tmp9_ = self->priv->button_add;
1193 _tmp10_ = _tmp6_;
1194 gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GTK_TYPE_WIDGET, GtkWidget), _tmp10_);
1195 }
1196 }
1197
1198
1199 void tracker_tags_view_treeview_tags_cell_toggled_cb (GtkCellRendererToggle* source, const gchar* path_string, TrackerTagsView* self) {
1200 const gchar* _tmp0_;
1201 GtkTreePath* _tmp1_;
1202 GtkTreePath* path;
1203 g_return_if_fail (self != NULL);
1204 g_return_if_fail (source != NULL);
1205 g_return_if_fail (path_string != NULL);
1206 g_debug ("tracker-tags-view.vala:225: Treeview row cell toggled");
1207 _tmp0_ = path_string;
1208 _tmp1_ = gtk_tree_path_new_from_string (_tmp0_);
1209 path = _tmp1_;
1210 tracker_tags_view_model_toggle_row (self, path, NULL, NULL);
1211 _gtk_tree_path_free0 (path);
1212 }
1213
1214
1215 void tracker_tags_view_treeview_tags_row_selected_cb (GtkTreeSelection* selection, TrackerTagsView* self) {
1216 GtkTreeIter iter = {0};
variable 'iter' set but not used
(emitted by gcc)
1217 GtkTreeModel* model = NULL;
1218 GtkTreeSelection* _tmp0_;
1219 GtkTreeModel* _tmp1_ = NULL;
1220 GtkTreeIter _tmp2_ = {0};
1221 gboolean _tmp3_ = FALSE;
1222 GtkTreeModel* _tmp4_;
1223 g_return_if_fail (self != NULL);
1224 g_return_if_fail (selection != NULL);
1225 g_debug ("tracker-tags-view.vala:232: Treeview row selected");
1226 _tmp0_ = selection;
1227 _tmp3_ = gtk_tree_selection_get_selected (_tmp0_, &_tmp1_, &_tmp2_);
1228 _g_object_unref0 (model);
1229 _tmp4_ = _g_object_ref0 (_tmp1_);
1230 model = _tmp4_;
1231 iter = _tmp2_;
1232 if (_tmp3_) {
1233 GtkButton* _tmp5_;
1234 _tmp5_ = self->priv->button_remove;
1235 gtk_widget_set_sensitive ((GtkWidget*) _tmp5_, TRUE);
1236 } else {
1237 GtkButton* _tmp6_;
1238 _tmp6_ = self->priv->button_remove;
1239 gtk_widget_set_sensitive ((GtkWidget*) _tmp6_, FALSE);
1240 }
1241 _g_object_unref0 (model);
1242 }
1243
1244
1245 void tracker_tags_view_treeview_tags_row_activated_cb (GtkTreeView* source, GtkTreePath* path, GtkTreeViewColumn* column, TrackerTagsView* self) {
1246 GtkTreePath* _tmp0_;
1247 g_return_if_fail (self != NULL);
1248 g_return_if_fail (source != NULL);
1249 g_return_if_fail (path != NULL);
1250 g_return_if_fail (column != NULL);
1251 g_debug ("tracker-tags-view.vala:246: Treeview row activated");
1252 _tmp0_ = path;
1253 tracker_tags_view_model_toggle_row (self, _tmp0_, NULL, NULL);
1254 }
1255
1256
1257 static void tracker_tags_view_treeview_tags_toggle_cell_data_func (GtkCellLayout* layout, GtkCellRenderer* cell, GtkTreeModel* model, GtkTreeIter* iter, TrackerTagsView* self) {
1258 gint selection = 0;
1259 GtkTreeModel* _tmp0_;
1260 GtkTreeIter _tmp1_;
1261 GtkCellRenderer* _tmp2_;
1262 GtkCellRenderer* _tmp3_;
1263 g_return_if_fail (self != NULL);
1264 g_return_if_fail (layout != NULL);
1265 g_return_if_fail (cell != NULL);
1266 g_return_if_fail (model != NULL);
1267 g_return_if_fail (iter != NULL);
1268 _tmp0_ = model;
1269 _tmp1_ = *iter;
1270 gtk_tree_model_get (_tmp0_, &_tmp1_, TRACKER_TAGS_VIEW_COL_SELECTION, &selection, -1, -1);
1271 _tmp2_ = cell;
1272 gtk_cell_renderer_toggle_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GTK_TYPE_CELL_RENDERER_TOGGLE, GtkCellRendererToggle), selection == ((gint) TRACKER_TAGS_VIEW_SELECTION_TRUE));
1273 _tmp3_ = cell;
1274 g_object_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GTK_TYPE_CELL_RENDERER_TOGGLE, GtkCellRendererToggle), "inconsistent", selection == ((gint) TRACKER_TAGS_VIEW_SELECTION_INCONSISTENT), NULL);
1275 }
1276
1277
1278 static void _tracker_tags_view_entry_tag_changed_cb_gtk_editable_changed (GtkEditable* _sender, gpointer self) {
1279 tracker_tags_view_entry_tag_changed_cb (_sender, self);
1280 }
1281
1282
1283 static void _tracker_tags_view_button_add_clicked_cb_gtk_button_clicked (GtkButton* _sender, gpointer self) {
1284 tracker_tags_view_button_add_clicked_cb (_sender, self);
1285 }
1286
1287
1288 static void _tracker_tags_view_button_remove_clicked_cb_gtk_button_clicked (GtkButton* _sender, gpointer self) {
1289 tracker_tags_view_button_remove_clicked_cb (_sender, self);
1290 }
1291
1292
1293 static void _tracker_tags_view_treeview_tags_cell_toggled_cb_gtk_cell_renderer_toggle_toggled (GtkCellRendererToggle* _sender, const gchar* path, gpointer self) {
1294 tracker_tags_view_treeview_tags_cell_toggled_cb (_sender, path, self);
1295 }
1296
1297
1298 static void _tracker_tags_view_treeview_tags_toggle_cell_data_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self) {
1299 tracker_tags_view_treeview_tags_toggle_cell_data_func (cell_layout, cell, tree_model, iter, self);
1300 }
1301
1302
1303 static void _tracker_tags_view_treeview_tags_row_selected_cb_gtk_tree_selection_changed (GtkTreeSelection* _sender, gpointer self) {
1304 tracker_tags_view_treeview_tags_row_selected_cb (_sender, self);
1305 }
1306
1307
1308 static void _tracker_tags_view_treeview_tags_row_activated_cb_gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self) {
1309 tracker_tags_view_treeview_tags_row_activated_cb (_sender, path, column, self);
1310 }
1311
1312
1313 static void tracker_tags_view_create_ui (TrackerTagsView* self) {
1314 GtkBuilder* _tmp0_;
1315 GtkBuilder* builder;
1316 GObject* _tmp5_ = NULL;
1317 GtkVBox* _tmp6_;
1318 GObject* _tmp7_ = NULL;
1319 GtkLabel* _tmp8_;
1320 GObject* _tmp9_ = NULL;
1321 GtkEntry* _tmp10_;
1322 GObject* _tmp11_ = NULL;
1323 GtkButton* _tmp12_;
1324 GObject* _tmp13_ = NULL;
1325 GtkButton* _tmp14_;
1326 GObject* _tmp15_ = NULL;
1327 GtkScrolledWindow* _tmp16_;
1328 GObject* _tmp17_ = NULL;
1329 GtkTreeView* _tmp18_;
1330 GtkEntry* _tmp19_;
1331 GtkButton* _tmp20_;
1332 GtkButton* _tmp21_;
1333 GtkTreeViewColumn* col = NULL;
1334 GtkCellRenderer* renderer = NULL;
1335 GtkCellRendererToggle* _tmp22_;
1336 GtkCellRenderer* _tmp23_;
1337 GtkCellRenderer* _tmp24_;
1338 GtkCellRenderer* _tmp25_;
1339 GtkCellRenderer* _tmp26_;
1340 GtkTreeViewColumn* _tmp27_;
1341 GtkTreeViewColumn* _tmp28_;
1342 GtkTreeViewColumn* _tmp29_;
1343 GtkTreeViewColumn* _tmp30_;
1344 GtkTreeViewColumn* _tmp31_;
1345 GtkTreeViewColumn* _tmp32_;
1346 GtkCellRenderer* _tmp33_;
1347 GtkTreeViewColumn* _tmp34_;
1348 GtkCellRenderer* _tmp35_;
1349 GtkTreeView* _tmp36_;
1350 GtkTreeViewColumn* _tmp37_;
1351 GtkCellRendererText* _tmp38_;
1352 GtkCellRenderer* _tmp39_;
1353 GtkCellRenderer* _tmp40_;
1354 GtkCellRenderer* _tmp41_;
1355 GtkCellRenderer* _tmp42_;
1356 GtkTreeViewColumn* _tmp43_;
1357 GtkTreeViewColumn* _tmp44_;
1358 const gchar* _tmp45_ = NULL;
1359 GtkTreeViewColumn* _tmp46_;
1360 GtkTreeViewColumn* _tmp47_;
1361 GtkTreeViewColumn* _tmp48_;
1362 GtkTreeViewColumn* _tmp49_;
1363 GtkCellRenderer* _tmp50_;
1364 GtkTreeViewColumn* _tmp51_;
1365 GtkCellRenderer* _tmp52_;
1366 GtkTreeView* _tmp53_;
1367 GtkTreeViewColumn* _tmp54_;
1368 GtkCellRendererText* _tmp55_;
1369 GtkCellRenderer* _tmp56_;
1370 GtkCellRenderer* _tmp57_;
1371 GtkTreeViewColumn* _tmp58_;
1372 GtkTreeViewColumn* _tmp59_;
1373 GtkTreeViewColumn* _tmp60_;
1374 GtkTreeViewColumn* _tmp61_;
1375 GtkTreeViewColumn* _tmp62_;
1376 GtkTreeViewColumn* _tmp63_;
1377 GtkCellRenderer* _tmp64_;
1378 GtkTreeViewColumn* _tmp65_;
1379 GtkCellRenderer* _tmp66_;
1380 GtkTreeView* _tmp67_;
1381 GtkTreeViewColumn* _tmp68_;
1382 GtkTreeView* _tmp69_;
1383 GtkTreeSelection* _tmp70_ = NULL;
1384 GtkTreeSelection* _tmp71_;
1385 GtkTreeSelection* selection;
1386 GtkListStore* _tmp72_;
1387 GtkTreeModel* _tmp73_;
1388 GtkTreeModel* model;
1389 GtkTreeSortable* _tmp74_;
1390 GtkTreeSortable* sortable;
1391 GtkTreeView* _tmp75_;
1392 GtkTreeView* _tmp76_;
1393 GtkVBox* _tmp77_;
1394 GtkVBox* _tmp78_;
1395 GError * _inner_error_ = NULL;
1396 g_return_if_fail (self != NULL);
1397 _tmp0_ = gtk_builder_new ();
1398 builder = _tmp0_;
1399 {
1400 g_debug ("tracker-tags-view.vala:263: Trying to use UI file:'%s'", SRCDIR TRACKER_TAGS_VIEW_UI_FILE);
1401 gtk_builder_add_from_file (builder, SRCDIR TRACKER_TAGS_VIEW_UI_FILE, &_inner_error_);
1402 if (_inner_error_ != NULL) {
1403 goto __catch14_g_error;
1404 }
1405 }
1406 goto __finally14;
1407 __catch14_g_error:
1408 {
1409 GError* e = NULL;
1410 e = _inner_error_;
1411 _inner_error_ = NULL;
1412 {
1413 g_debug ("tracker-tags-view.vala:268: Trying to use UI file:'%s'", TRACKER_UI_DIR TRACKER_TAGS_VIEW_UI_FILE);
1414 gtk_builder_add_from_file (builder, TRACKER_UI_DIR TRACKER_TAGS_VIEW_UI_FILE, &_inner_error_);
1415 if (_inner_error_ != NULL) {
1416 goto __catch15_g_error;
1417 }
1418 }
1419 goto __finally15;
1420 __catch15_g_error:
1421 {
1422 GError* e = NULL;
1423 GError* _tmp1_;
1424 const gchar* _tmp2_;
1425 GtkMessageDialog* _tmp3_;
1426 GtkMessageDialog* msg;
1427 GtkMessageDialog* _tmp4_;
1428 e = _inner_error_;
1429 _inner_error_ = NULL;
1430 _tmp1_ = e;
1431 _tmp2_ = _tmp1_->message;
1432 _tmp3_ = (GtkMessageDialog*) gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CANCEL, "Failed to load UI file, %s\n", _tmp2_);
1433 g_object_ref_sink (_tmp3_);
1434 msg = _tmp3_;
1435 _tmp4_ = msg;
1436 gtk_dialog_run ((GtkDialog*) _tmp4_);
1437 gtk_main_quit ();
1438 _g_object_unref0 (msg);
1439 _g_error_free0 (e);
1440 }
1441 __finally15:
1442 if (_inner_error_ != NULL) {
1443 _g_error_free0 (e);
1444 _g_error_free0 (e);
1445 _g_object_unref0 (builder);
1446 g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
1447 g_clear_error (&_inner_error_);
1448 return;
1449 }
1450 _g_error_free0 (e);
1451 }
1452 __finally14:
1453 if (_inner_error_ != NULL) {
1454 _g_object_unref0 (builder);
1455 g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
1456 g_clear_error (&_inner_error_);
1457 return;
1458 }
1459 _tmp5_ = gtk_builder_get_object (builder, "vbox_tags");
1460 _tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, GTK_TYPE_VBOX) ? ((GtkVBox*) _tmp5_) : NULL);
1461 _g_object_unref0 (self->priv->vbox);
1462 self->priv->vbox = _tmp6_;
1463 _tmp7_ = gtk_builder_get_object (builder, "label_tag");
1464 _tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, GTK_TYPE_LABEL) ? ((GtkLabel*) _tmp7_) : NULL);
1465 _g_object_unref0 (self->priv->label);
1466 self->priv->label = _tmp8_;
1467 _tmp9_ = gtk_builder_get_object (builder, "entry_tag");
1468 _tmp10_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, GTK_TYPE_ENTRY) ? ((GtkEntry*) _tmp9_) : NULL);
1469 _g_object_unref0 (self->priv->entry);
1470 self->priv->entry = _tmp10_;
1471 _tmp11_ = gtk_builder_get_object (builder, "button_add");
1472 _tmp12_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp11_, GTK_TYPE_BUTTON) ? ((GtkButton*) _tmp11_) : NULL);
1473 _g_object_unref0 (self->priv->button_add);
1474 self->priv->button_add = _tmp12_;
1475 _tmp13_ = gtk_builder_get_object (builder, "button_remove");
1476 _tmp14_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp13_, GTK_TYPE_BUTTON) ? ((GtkButton*) _tmp13_) : NULL);
1477 _g_object_unref0 (self->priv->button_remove);
1478 self->priv->button_remove = _tmp14_;
1479 _tmp15_ = gtk_builder_get_object (builder, "scrolled_window_tags");
1480 _tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, GTK_TYPE_SCROLLED_WINDOW) ? ((GtkScrolledWindow*) _tmp15_) : NULL);
1481 _g_object_unref0 (self->priv->scrolled_window);
1482 self->priv->scrolled_window = _tmp16_;
1483 _tmp17_ = gtk_builder_get_object (builder, "treeview_tags");
1484 _tmp18_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, GTK_TYPE_TREE_VIEW) ? ((GtkTreeView*) _tmp17_) : NULL);
1485 _g_object_unref0 (self->priv->view);
1486 self->priv->view = _tmp18_;
1487 _tmp19_ = self->priv->entry;
1488 g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, GTK_TYPE_EDITABLE, GtkEditable), "changed", (GCallback) _tracker_tags_view_entry_tag_changed_cb_gtk_editable_changed, self, 0);
1489 _tmp20_ = self->priv->button_add;
1490 g_signal_connect_object (_tmp20_, "clicked", (GCallback) _tracker_tags_view_button_add_clicked_cb_gtk_button_clicked, self, 0);
1491 _tmp21_ = self->priv->button_remove;
1492 g_signal_connect_object (_tmp21_, "clicked", (GCallback) _tracker_tags_view_button_remove_clicked_cb_gtk_button_clicked, self, 0);
1493 _tmp22_ = (GtkCellRendererToggle*) gtk_cell_renderer_toggle_new ();
1494 g_object_ref_sink (_tmp22_);
1495 _g_object_unref0 (renderer);
1496 renderer = (GtkCellRenderer*) _tmp22_;
1497 _tmp23_ = renderer;
1498 g_object_set (_tmp23_, "xpad", (guint) 5, NULL);
1499 _tmp24_ = renderer;
1500 g_object_set (_tmp24_, "ypad", (guint) 5, NULL);
1501 _tmp25_ = renderer;
1502 g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, GTK_TYPE_CELL_RENDERER_TOGGLE, GtkCellRendererToggle), "toggled", (GCallback) _tracker_tags_view_treeview_tags_cell_toggled_cb_gtk_cell_renderer_toggle_toggled, self, 0);
1503 _tmp26_ = renderer;
1504 gtk_cell_renderer_toggle_set_radio (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, GTK_TYPE_CELL_RENDERER_TOGGLE, GtkCellRendererToggle), FALSE);
1505 _tmp27_ = gtk_tree_view_column_new ();
1506 g_object_ref_sink (_tmp27_);
1507 _g_object_unref0 (col);
1508 col = _tmp27_;
1509 _tmp28_ = col;
1510 gtk_tree_view_column_set_title (_tmp28_, "-");
1511 _tmp29_ = col;
1512 gtk_tree_view_column_set_resizable (_tmp29_, FALSE);
1513 _tmp30_ = col;
1514 gtk_tree_view_column_set_sizing (_tmp30_, GTK_TREE_VIEW_COLUMN_FIXED);
1515 _tmp31_ = col;
1516 gtk_tree_view_column_set_fixed_width (_tmp31_, 25);
1517 _tmp32_ = col;
1518 _tmp33_ = renderer;
1519 gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp32_, _tmp33_, FALSE);
1520 _tmp34_ = col;
1521 _tmp35_ = renderer;
1522 gtk_cell_layout_set_cell_data_func ((GtkCellLayout*) _tmp34_, _tmp35_, _tracker_tags_view_treeview_tags_toggle_cell_data_func_gtk_cell_layout_data_func, g_object_ref (self), g_object_unref);
1523 _tmp36_ = self->priv->view;
1524 _tmp37_ = col;
1525 gtk_tree_view_append_column (_tmp36_, _tmp37_);
1526 _tmp38_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
1527 g_object_ref_sink (_tmp38_);
1528 _g_object_unref0 (renderer);
1529 renderer = (GtkCellRenderer*) _tmp38_;
1530 _tmp39_ = renderer;
1531 g_object_set (_tmp39_, "xpad", (guint) 5, NULL);
1532 _tmp40_ = renderer;
1533 g_object_set (_tmp40_, "ypad", (guint) 5, NULL);
1534 _tmp41_ = renderer;
1535 g_object_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, GTK_TYPE_CELL_RENDERER_TEXT, GtkCellRendererText), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
1536 _tmp42_ = renderer;
1537 g_object_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, GTK_TYPE_CELL_RENDERER_TEXT, GtkCellRendererText), "ellipsize-set", TRUE, NULL);
1538 _tmp43_ = gtk_tree_view_column_new ();
1539 g_object_ref_sink (_tmp43_);
1540 _g_object_unref0 (col);
1541 col = _tmp43_;
1542 _tmp44_ = col;
1543 _tmp45_ = _ ("Name");
1544 gtk_tree_view_column_set_title (_tmp44_, _tmp45_);
1545 _tmp46_ = col;
1546 gtk_tree_view_column_set_resizable (_tmp46_, TRUE);
1547 _tmp47_ = col;
1548 gtk_tree_view_column_set_sizing (_tmp47_, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
1549 _tmp48_ = col;
1550 gtk_tree_view_column_set_expand (_tmp48_, TRUE);
1551 _tmp49_ = col;
1552 _tmp50_ = renderer;
1553 gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp49_, _tmp50_, TRUE);
1554 _tmp51_ = col;
1555 _tmp52_ = renderer;
1556 gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp51_, _tmp52_, "text", (gint) TRACKER_TAGS_VIEW_COL_TAG_NAME);
1557 _tmp53_ = self->priv->view;
1558 _tmp54_ = col;
1559 gtk_tree_view_append_column (_tmp53_, _tmp54_);
1560 _tmp55_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
1561 g_object_ref_sink (_tmp55_);
1562 _g_object_unref0 (renderer);
1563 renderer = (GtkCellRenderer*) _tmp55_;
1564 _tmp56_ = renderer;
1565 g_object_set (_tmp56_, "xpad", (guint) 5, NULL);
1566 _tmp57_ = renderer;
1567 g_object_set (_tmp57_, "ypad", (guint) 5, NULL);
1568 _tmp58_ = gtk_tree_view_column_new ();
1569 g_object_ref_sink (_tmp58_);
1570 _g_object_unref0 (col);
1571 col = _tmp58_;
1572 _tmp59_ = col;
1573 gtk_tree_view_column_set_title (_tmp59_, "-");
1574 _tmp60_ = col;
1575 gtk_tree_view_column_set_resizable (_tmp60_, FALSE);
1576 _tmp61_ = col;
1577 gtk_tree_view_column_set_sizing (_tmp61_, GTK_TREE_VIEW_COLUMN_FIXED);
1578 _tmp62_ = col;
1579 gtk_tree_view_column_set_fixed_width (_tmp62_, 50);
1580 _tmp63_ = col;
1581 _tmp64_ = renderer;
1582 gtk_cell_layout_pack_end ((GtkCellLayout*) _tmp63_, _tmp64_, FALSE);
1583 _tmp65_ = col;
1584 _tmp66_ = renderer;
1585 gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp65_, _tmp66_, "text", (gint) TRACKER_TAGS_VIEW_COL_TAG_COUNT);
1586 _tmp67_ = self->priv->view;
1587 _tmp68_ = col;
1588 gtk_tree_view_append_column (_tmp67_, _tmp68_);
1589 _tmp69_ = self->priv->view;
1590 _tmp70_ = gtk_tree_view_get_selection (_tmp69_);
1591 _tmp71_ = _g_object_ref0 (_tmp70_);
1592 selection = _tmp71_;
1593 g_signal_connect_object (selection, "changed", (GCallback) _tracker_tags_view_treeview_tags_row_selected_cb_gtk_tree_selection_changed, self, 0);
1594 _tmp72_ = self->priv->store;
1595 _tmp73_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp72_, GTK_TYPE_TREE_MODEL) ? ((GtkTreeModel*) _tmp72_) : NULL);
1596 model = _tmp73_;
1597 _tmp74_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (model, GTK_TYPE_TREE_SORTABLE) ? ((GtkTreeSortable*) model) : NULL);
1598 sortable = _tmp74_;
1599 _tmp75_ = self->priv->view;
1600 gtk_tree_view_set_model (_tmp75_, model);
1601 _tmp76_ = self->priv->view;
1602 g_signal_connect_object (_tmp76_, "row-activated", (GCallback) _tracker_tags_view_treeview_tags_row_activated_cb_gtk_tree_view_row_activated, self, 0);
1603 gtk_tree_sortable_set_sort_column_id (sortable, 2, GTK_SORT_ASCENDING);
1604 _tmp77_ = self->priv->vbox;
1605 gtk_widget_unparent ((GtkWidget*) _tmp77_);
1606 _tmp78_ = self->priv->vbox;
1607 gtk_box_pack_start ((GtkBox*) G_TYPE_CHECK_INSTANCE_CAST (self, GTK_TYPE_VBOX, GtkVBox), (GtkWidget*) _tmp78_, TRUE, TRUE, (guint) 0);
1608 tracker_tags_view_update_for_files (self);
1609 tracker_tags_view_query_tags (self, NULL, NULL);
1610 _g_object_unref0 (sortable);
1611 _g_object_unref0 (model);
1612 _g_object_unref0 (selection);
1613 _g_object_unref0 (renderer);
1614 _g_object_unref0 (col);
1615 _g_object_unref0 (builder);
1616 }
1617
1618
1619 static void tracker_tags_view_update_for_files (TrackerTagsView* self) {
1620 GList* _tmp0_;
1621 g_return_if_fail (self != NULL);
1622 _tmp0_ = self->priv->files;
1623 if (_tmp0_ != NULL) {
1624 GList* _tmp1_;
1625 guint _tmp2_ = 0U;
1626 const gchar* _tmp3_ = NULL;
1627 GList* _tmp4_;
1628 guint _tmp5_ = 0U;
1629 gchar* _tmp6_ = NULL;
1630 gchar* str;
1631 GtkLabel* _tmp7_;
1632 const gchar* _tmp8_;
1633 GtkVBox* _tmp9_;
1634 _tmp1_ = self->priv->files;
1635 _tmp2_ = g_list_length (_tmp1_);
1636 _tmp3_ = g_dngettext (NULL, "_Set the tags you want to associate with the %d selected item:", "_Set the tags you want to associate with the %d selected items:", (gulong) _tmp2_);
1637 _tmp4_ = self->priv->files;
1638 _tmp5_ = g_list_length (_tmp4_);
1639 _tmp6_ = g_strdup_printf (_tmp3_, _tmp5_);
1640 str = _tmp6_;
1641 _tmp7_ = self->priv->label;
1642 _tmp8_ = str;
1643 gtk_label_set_text_with_mnemonic (_tmp7_, _tmp8_);
1644 _tmp9_ = self->priv->vbox;
1645 gtk_widget_set_sensitive ((GtkWidget*) _tmp9_, TRUE);
1646 _g_free0 (str);
1647 } else {
1648 GtkLabel* _tmp10_;
1649 const gchar* _tmp11_ = NULL;
1650 GtkVBox* _tmp12_;
1651 _tmp10_ = self->priv->label;
1652 _tmp11_ = _ ("No items currently selected");
1653 gtk_label_set_text (_tmp10_, _tmp11_);
1654 _tmp12_ = self->priv->vbox;
1655 gtk_widget_set_sensitive ((GtkWidget*) _tmp12_, FALSE);
1656 }
1657 tracker_tags_view_query_tags_for_files (self, NULL, NULL);
1658 }
1659
1660
1661 static void tracker_tags_view_model_toggle_row_data_free (gpointer _data) {
1662 TrackerTagsViewModelToggleRowData* _data_;
1663 _data_ = _data;
1664 _gtk_tree_path_free0 (_data_->path);
1665 _g_object_unref0 (_data_->self);
1666 g_slice_free (TrackerTagsViewModelToggleRowData, _data_);
1667 }
1668
1669
1670 static gpointer _gtk_tree_path_copy0 (gpointer self) {
1671 return self ? gtk_tree_path_copy (self) : NULL;
1672 }
1673
1674
1675 static void tracker_tags_view_model_toggle_row (TrackerTagsView* self, GtkTreePath* path, GAsyncReadyCallback _callback_, gpointer _user_data_) {
1676 TrackerTagsViewModelToggleRowData* _data_;
1677 TrackerTagsView* _tmp0_;
1678 GtkTreePath* _tmp1_;
1679 GtkTreePath* _tmp2_;
1680 _data_ = g_slice_new0 (TrackerTagsViewModelToggleRowData);
1681 _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, tracker_tags_view_model_toggle_row);
1682 g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, tracker_tags_view_model_toggle_row_data_free);
1683 _tmp0_ = _g_object_ref0 (self);
1684 _data_->self = _tmp0_;
1685 _tmp1_ = path;
1686 _tmp2_ = _gtk_tree_path_copy0 (_tmp1_);
1687 _gtk_tree_path_free0 (_data_->path);
1688 _data_->path = _tmp2_;
1689 tracker_tags_view_model_toggle_row_co (_data_);
1690 }
1691
1692
1693 static void tracker_tags_view_model_toggle_row_finish (TrackerTagsView* self, GAsyncResult* _res_) {
1694 TrackerTagsViewModelToggleRowData* _data_;
variable '_data_' set but not used
(emitted by gcc)
1695 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
1696 }
1697
1698
1699 static void tracker_tags_view_model_toggle_row_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
1700 TrackerTagsViewModelToggleRowData* _data_;
1701 _data_ = _user_data_;
1702 _data_->_source_object_ = source_object;
1703 _data_->_res_ = _res_;
1704 tracker_tags_view_model_toggle_row_co (_data_);
1705 }
1706
1707
1708 static gboolean tracker_tags_view_model_toggle_row_co (TrackerTagsViewModelToggleRowData* _data_) {
1709 switch (_data_->_state_) {
1710 case 0:
1711 goto _state_0;
1712 case 1:
1713 goto _state_1;
1714 default:
1715 g_assert_not_reached ();
1716 }
1717 _state_0:
1718 _data_->_tmp0_ = _data_->self->priv->view;
1719 _data_->_tmp1_ = NULL;
1720 _data_->_tmp1_ = gtk_tree_view_get_model (_data_->_tmp0_);
1721 _data_->_tmp2_ = _g_object_ref0 (_data_->_tmp1_);
1722 _g_object_unref0 (_data_->model);
1723 _data_->model = _data_->_tmp2_;
1724 _data_->_tmp3_ = _data_->model;
1725 _data_->_tmp4_ = _data_->path;
1726 memset (&_data_->_tmp5_, 0, sizeof (GtkTreeIter));
1727 _data_->_tmp6_ = FALSE;
1728 _data_->_tmp6_ = gtk_tree_model_get_iter (_data_->_tmp3_, &_data_->_tmp5_, _data_->_tmp4_);
1729 _data_->iter = _data_->_tmp5_;
1730 if (_data_->_tmp6_ == FALSE) {
1731 _g_free0 (_data_->tag);
1732 _g_free0 (_data_->id);
1733 _g_object_unref0 (_data_->model);
1734 if (_data_->_state_ == 0) {
1735 g_simple_async_result_complete_in_idle (_data_->_async_result);
1736 } else {
1737 g_simple_async_result_complete (_data_->_async_result);
1738 }
1739 g_object_unref (_data_->_async_result);
1740 return FALSE;
1741 }
1742 _data_->_tmp7_ = _data_->model;
1743 _data_->_tmp8_ = _data_->iter;
1744 gtk_tree_model_get (_data_->_tmp7_, &_data_->_tmp8_, TRACKER_TAGS_VIEW_COL_SELECTION, &_data_->selection, TRACKER_TAGS_VIEW_COL_TAG_ID, &_data_->id, TRACKER_TAGS_VIEW_COL_TAG_NAME, &_data_->tag, -1, -1);
1745 _data_->_tmp10_ = _data_->selection;
1746 if (_data_->_tmp10_ == ((gint) TRACKER_TAGS_VIEW_SELECTION_FALSE)) {
1747 _data_->_tmp9_ = TRACKER_TAGS_VIEW_SELECTION_TRUE;
1748 } else {
1749 _data_->_tmp9_ = TRACKER_TAGS_VIEW_SELECTION_FALSE;
1750 }
1751 _data_->_tmp11_ = _data_->_tmp9_;
1752 _data_->new_value = (gint) _data_->_tmp11_;
1753 _data_->_tmp12_ = _data_->tag;
1754 _data_->_tmp13_ = NULL;
1755 _data_->_tmp13_ = tracker_tags_view_sparql_get_escaped_string (_data_->self, _data_->_tmp12_);
1756 _data_->tag_escaped = _data_->_tmp13_;
1757 _data_->_tmp14_ = NULL;
1758 _data_->_tmp14_ = tracker_tags_view_sparql_get_filter_string (_data_->self, NULL);
1759 _data_->filter = _data_->_tmp14_;
1760 _data_->query = NULL;
1761 _data_->_tmp15_ = _data_->new_value;
1762 if (_data_->_tmp15_ != ((gint) TRACKER_TAGS_VIEW_SELECTION_FALSE)) {
1763 _data_->_tmp16_ = _data_->tag_escaped;
1764 _data_->_tmp17_ = _data_->filter;
1765 _data_->_tmp18_ = NULL;
1766 _data_->_tmp18_ = g_strdup_printf ("INSERT {\n" \
1767 " ?urn nao:hasTag ?label\n" \
1768 " } WHERE {\n" \
1769 " ?urn nie:url ?f .\n" \
1770 " ?label nao:prefLabel %s .\n" \
1771 " %s\n" \
1772 " }", _data_->_tmp16_, _data_->_tmp17_);
1773 _g_free0 (_data_->query);
1774 _data_->query = _data_->_tmp18_;
1775 } else {
1776 _data_->_tmp19_ = _data_->tag_escaped;
1777 _data_->_tmp20_ = _data_->filter;
1778 _data_->_tmp21_ = NULL;
1779 _data_->_tmp21_ = g_strdup_printf ("DELETE {\n" \
1780 " ?urn nao:hasTag ?label\n" \
1781 " } WHERE {\n" \
1782 " ?urn nie:url ?f .\n" \
1783 " ?label nao:prefLabel %s .\n" \
1784 " %s\n" \
1785 " }", _data_->_tmp19_, _data_->_tmp20_);
1786 _g_free0 (_data_->query);
1787 _data_->query = _data_->_tmp21_;
1788 _data_->_tmp22_ = _data_->id;
1789 _data_->_tmp23_ = _data_->iter;
1790 _data_->_tmp24_ = tag_data_new (_data_->_tmp22_, &_data_->_tmp23_, FALSE, TRUE, 1, _data_->self);
1791 _tag_data_unref0 (_data_->td);
1792 _data_->td = _data_->_tmp24_;
1793 _data_->_tmp25_ = _data_->td;
1794 _data_->_tmp26_ = _tag_data_ref0 (_data_->_tmp25_);
1795 _data_->self->priv->tag_data_requests = g_list_prepend (_data_->self->priv->tag_data_requests, _data_->_tmp26_);
1796 _data_->_tmp27_ = _data_->td;
1797 tracker_tags_view_query_files_for_tag_id (_data_->self, _data_->_tmp27_, NULL, NULL);
1798 }
1799 _g_free0 (_data_->filter);
1800 _data_->filter = NULL;
1801 _g_free0 (_data_->tag_escaped);
1802 _data_->tag_escaped = NULL;
1803 _data_->_tmp28_ = _data_->self->priv->connection;
1804 if (_data_->_tmp28_ == NULL) {
1805 g_warning ("tracker-tags-view.vala:446: Can't update tags, no SPARQL connection av" \
1806 "ailable");
1807 _tag_data_unref0 (_data_->td);
1808 _g_free0 (_data_->query);
1809 _g_free0 (_data_->filter);
1810 _g_free0 (_data_->tag_escaped);
1811 _g_free0 (_data_->tag);
1812 _g_free0 (_data_->id);
1813 _g_object_unref0 (_data_->model);
1814 if (_data_->_state_ == 0) {
1815 g_simple_async_result_complete_in_idle (_data_->_async_result);
1816 } else {
1817 g_simple_async_result_complete (_data_->_async_result);
1818 }
1819 g_object_unref (_data_->_async_result);
1820 return FALSE;
1821 }
1822 g_debug ("tracker-tags-view.vala:450: Updating tags for uris");
1823 _data_->_tmp29_ = _data_->self->priv->entry;
1824 gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp29_, FALSE);
1825 _data_->_tmp30_ = _data_->id;
1826 _data_->_tmp31_ = _data_->iter;
1827 _data_->_tmp32_ = _data_->new_value;
1828 _data_->_tmp33_ = tag_data_new (_data_->_tmp30_, &_data_->_tmp31_, TRUE, _data_->_tmp32_ != ((gint) TRACKER_TAGS_VIEW_SELECTION_FALSE), 1, _data_->self);
1829 _tag_data_unref0 (_data_->td);
1830 _data_->td = _data_->_tmp33_;
1831 _data_->_tmp34_ = _data_->td;
1832 _data_->_tmp35_ = _tag_data_ref0 (_data_->_tmp34_);
1833 _data_->self->priv->tag_data_requests = g_list_prepend (_data_->self->priv->tag_data_requests, _data_->_tmp35_);
1834 {
1835 _data_->_tmp36_ = _data_->self->priv->connection;
1836 _data_->_tmp37_ = _data_->query;
1837 _data_->_tmp38_ = _data_->td;
1838 _data_->_tmp39_ = _data_->_tmp38_->cancellable;
1839 _data_->_state_ = 1;
1840 tracker_sparql_connection_update_async (_data_->_tmp36_, _data_->_tmp37_, G_PRIORITY_DEFAULT, _data_->_tmp39_, tracker_tags_view_model_toggle_row_ready, _data_);
1841 return FALSE;
1842 _state_1:
1843 tracker_sparql_connection_update_finish (_data_->_tmp36_, _data_->_res_, &_data_->_inner_error_);
1844 if (_data_->_inner_error_ != NULL) {
1845 goto __catch16_g_error;
1846 }
1847 g_debug ("tracker-tags-view.vala:460: Updated tags");
1848 _data_->_tmp40_ = _data_->td;
1849 tracker_tags_view_update_tag_data (_data_->self, _data_->_tmp40_);
1850 _data_->_tmp41_ = _data_->self->priv->entry;
1851 gtk_entry_set_text (_data_->_tmp41_, "");
1852 }
1853 goto __finally16;
1854 __catch16_g_error:
1855 {
1856 _data_->e = _data_->_inner_error_;
1857 _data_->_inner_error_ = NULL;
1858 _data_->_tmp42_ = _data_->e;
1859 _data_->_tmp43_ = _data_->_tmp42_->message;
1860 g_warning ("tracker-tags-view.vala:465: Could not run Sparql update query: %s", _data_->_tmp43_);
1861 _data_->_tmp44_ = NULL;
1862 _data_->_tmp44_ = _ ("Could not update tags");
1863 _data_->_tmp45_ = _data_->e;
1864 tracker_tags_view_show_error_dialog (_data_->self, _data_->_tmp44_, _data_->_tmp45_);
1865 _g_error_free0 (_data_->e);
1866 }
1867 __finally16:
1868 if (_data_->_inner_error_ != NULL) {
1869 _tag_data_unref0 (_data_->td);
1870 _g_free0 (_data_->query);
1871 _g_free0 (_data_->filter);
1872 _g_free0 (_data_->tag_escaped);
1873 _g_free0 (_data_->tag);
1874 _g_free0 (_data_->id);
1875 _g_object_unref0 (_data_->model);
1876 g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
1877 g_clear_error (&_data_->_inner_error_);
1878 return FALSE;
1879 }
1880 _data_->_tmp46_ = _data_->td;
1881 _data_->self->priv->tag_data_requests = g_list_remove (_data_->self->priv->tag_data_requests, _data_->_tmp46_);
1882 _tag_data_unref0 (_data_->td);
1883 _data_->td = NULL;
1884 _data_->_tmp47_ = _data_->self->priv->entry;
1885 gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp47_, TRUE);
1886 _tag_data_unref0 (_data_->td);
1887 _g_free0 (_data_->query);
1888 _g_free0 (_data_->filter);
1889 _g_free0 (_data_->tag_escaped);
1890 _g_free0 (_data_->tag);
1891 _g_free0 (_data_->id);
1892 _g_object_unref0 (_data_->model);
1893 if (_data_->_state_ == 0) {
1894 g_simple_async_result_complete_in_idle (_data_->_async_result);
1895 } else {
1896 g_simple_async_result_complete (_data_->_async_result);
1897 }
1898 g_object_unref (_data_->_async_result);
1899 return FALSE;
1900 }
1901
1902
1903 static Block2Data* block2_data_ref (Block2Data* _data2_) {
1904 g_atomic_int_inc (&_data2_->_ref_count_);
1905 return _data2_;
1906 }
1907
1908
1909 static void block2_data_unref (void * _userdata_) {
1910 Block2Data* _data2_;
1911 _data2_ = (Block2Data*) _userdata_;
1912 if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
1913 TrackerTagsView * self;
1914 self = _data2_->self;
1915 _g_free0 (_data2_->tag);
1916 _g_object_unref0 (self);
1917 g_slice_free (Block2Data, _data2_);
1918 }
1919 }
1920
1921
1922 static gboolean __lambda2_ (Block2Data* _data2_, GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* foreach_iter) {
1923 TrackerTagsView * self;
variable 'self' set but not used
(emitted by gcc)
1924 gboolean result = FALSE;
1925 gchar* foreach_tag = NULL;
1926 GtkTreeModel* _tmp0_;
1927 GtkTreeIter _tmp1_;
1928 gboolean _tmp2_ = FALSE;
1929 const gchar* _tmp3_;
1930 gboolean _tmp6_;
1931 self = _data2_->self;
1932 g_return_val_if_fail (model != NULL, FALSE);
1933 g_return_val_if_fail (path != NULL, FALSE);
1934 g_return_val_if_fail (foreach_iter != NULL, FALSE);
1935 _tmp0_ = model;
1936 _tmp1_ = *foreach_iter;
1937 gtk_tree_model_get (_tmp0_, &_tmp1_, TRACKER_TAGS_VIEW_COL_TAG_NAME, &foreach_tag, -1, -1);
1938 _tmp3_ = foreach_tag;
1939 if (_tmp3_ != NULL) {
1940 const gchar* _tmp4_;
1941 const gchar* _tmp5_;
1942 _tmp4_ = foreach_tag;
1943 _tmp5_ = _data2_->tag;
1944 _tmp2_ = g_strcmp0 (_tmp4_, _tmp5_) == 0;
1945 } else {
1946 _tmp2_ = FALSE;
1947 }
1948 _tmp6_ = _tmp2_;
1949 if (_tmp6_) {
1950 GtkTreeIter _tmp7_;
1951 _data2_->found = TRUE;
1952 _tmp7_ = *foreach_iter;
1953 _data2_->found_iter = _tmp7_;
1954 result = TRUE;
1955 _g_free0 (foreach_tag);
1956 return result;
1957 }
1958 result = FALSE;
1959 _g_free0 (foreach_tag);
1960 return result;
1961 }
1962
1963
1964 static gboolean ___lambda2__gtk_tree_model_foreach_func (GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, gpointer self) {
1965 gboolean result;
1966 result = __lambda2_ (self, model, path, iter);
1967 return result;
1968 }
1969
1970
1971 static gboolean tracker_tags_view_find_tag (TrackerTagsView* self, const gchar* tag, GtkTreeIter* iter) {
1972 GtkTreeIter _vala_iter = {0};
1973 gboolean result = FALSE;
1974 Block2Data* _data2_;
1975 const gchar* _tmp0_;
1976 gchar* _tmp1_;
1977 GtkTreeIter _tmp2_ = {0};
1978 GtkTreeIter _tmp3_;
1979 gboolean _tmp4_ = FALSE;
1980 const gchar* _tmp5_;
1981 gboolean _tmp7_;
1982 GtkTreeView* _tmp8_;
1983 GtkTreeModel* _tmp9_ = NULL;
1984 GtkTreeModel* _tmp10_;
1985 GtkTreeModel* model;
1986 GtkTreeModel* _tmp11_;
1987 gboolean _tmp12_;
1988 g_return_val_if_fail (self != NULL, FALSE);
1989 g_return_val_if_fail (tag != NULL, FALSE);
1990 _data2_ = g_slice_new0 (Block2Data);
1991 _data2_->_ref_count_ = 1;
1992 _data2_->self = g_object_ref (self);
1993 _tmp0_ = tag;
1994 _tmp1_ = g_strdup (_tmp0_);
1995 _g_free0 (_data2_->tag);
1996 _data2_->tag = _tmp1_;
1997 _tmp2_.stamp = 0;
1998 _data2_->found_iter = _tmp2_;
1999 _tmp3_ = _data2_->found_iter;
2000 _vala_iter = _tmp3_;
2001 _tmp5_ = _data2_->tag;
2002 if (_tmp5_ == NULL) {
2003 _tmp4_ = TRUE;
2004 } else {
2005 const gchar* _tmp6_;
2006 _tmp6_ = _data2_->tag;
2007 _tmp4_ = g_strcmp0 (_tmp6_, "") == 0;
2008 }
2009 _tmp7_ = _tmp4_;
2010 if (_tmp7_) {
2011 result = FALSE;
2012 block2_data_unref (_data2_);
2013 _data2_ = NULL;
2014 if (iter) {
2015 *iter = _vala_iter;
2016 }
2017 return result;
2018 }
2019 _tmp8_ = self->priv->view;
2020 _tmp9_ = gtk_tree_view_get_model (_tmp8_);
2021 _tmp10_ = _g_object_ref0 (_tmp9_);
2022 model = _tmp10_;
2023 _data2_->found = FALSE;
2024 _tmp11_ = model;
2025 gtk_tree_model_foreach (_tmp11_, ___lambda2__gtk_tree_model_foreach_func, _data2_);
2026 _tmp12_ = _data2_->found;
2027 if (_tmp12_ == TRUE) {
2028 GtkTreeIter _tmp13_;
2029 _tmp13_ = _data2_->found_iter;
2030 _vala_iter = _tmp13_;
2031 result = TRUE;
2032 _g_object_unref0 (model);
2033 block2_data_unref (_data2_);
2034 _data2_ = NULL;
2035 if (iter) {
2036 *iter = _vala_iter;
2037 }
2038 return result;
2039 }
2040 result = FALSE;
2041 _g_object_unref0 (model);
2042 block2_data_unref (_data2_);
2043 _data2_ = NULL;
2044 if (iter) {
2045 *iter = _vala_iter;
2046 }
2047 return result;
2048 }
2049
2050
2051 static void tracker_tags_view_remove_tag_data_free (gpointer _data) {
2052 TrackerTagsViewRemoveTagData* _data_;
2053 _data_ = _data;
2054 _tag_data_unref0 (_data_->td);
2055 _g_object_unref0 (_data_->self);
2056 g_slice_free (TrackerTagsViewRemoveTagData, _data_);
2057 }
2058
2059
2060 static void tracker_tags_view_remove_tag (TrackerTagsView* self, TagData* td, GAsyncReadyCallback _callback_, gpointer _user_data_) {
2061 TrackerTagsViewRemoveTagData* _data_;
2062 TrackerTagsView* _tmp0_;
2063 TagData* _tmp1_;
2064 TagData* _tmp2_;
2065 _data_ = g_slice_new0 (TrackerTagsViewRemoveTagData);
2066 _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, tracker_tags_view_remove_tag);
2067 g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, tracker_tags_view_remove_tag_data_free);
2068 _tmp0_ = _g_object_ref0 (self);
2069 _data_->self = _tmp0_;
2070 _tmp1_ = td;
2071 _tmp2_ = _tag_data_ref0 (_tmp1_);
2072 _tag_data_unref0 (_data_->td);
2073 _data_->td = _tmp2_;
2074 tracker_tags_view_remove_tag_co (_data_);
2075 }
2076
2077
2078 static void tracker_tags_view_remove_tag_finish (TrackerTagsView* self, GAsyncResult* _res_) {
2079 TrackerTagsViewRemoveTagData* _data_;
variable '_data_' set but not used
(emitted by gcc)
2080 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
2081 }
2082
2083
2084 static void tracker_tags_view_remove_tag_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
2085 TrackerTagsViewRemoveTagData* _data_;
2086 _data_ = _user_data_;
2087 _data_->_source_object_ = source_object;
2088 _data_->_res_ = _res_;
2089 tracker_tags_view_remove_tag_co (_data_);
2090 }
2091
2092
2093 static gboolean tracker_tags_view_remove_tag_co (TrackerTagsViewRemoveTagData* _data_) {
2094 TagData* _tmp20_;
2095 switch (_data_->_state_) {
2096 case 0:
2097 goto _state_0;
2098 case 1:
2099 goto _state_1;
2100 default:
2101 g_assert_not_reached ();
2102 }
2103 _state_0:
2104 _data_->_tmp0_ = _data_->self->priv->connection;
2105 if (_data_->_tmp0_ == NULL) {
2106 TagData* _tmp4_;
2107 _data_->_tmp1_ = _data_->td;
2108 _data_->_tmp2_ = _data_->_tmp1_->tag_id;
2109 g_warning ("tracker-tags-view.vala:511: Can't remove tag '%s', no SPARQL connectio" \
2110 "n available", _data_->_tmp2_);
2111 _data_->_tmp3_ = _data_->td;
2112 _data_->self->priv->tag_data_requests = g_list_remove (_data_->self->priv->tag_data_requests, _data_->_tmp3_);
2113 _tmp4_ = _tag_data_ref0 (NULL);
2114 _tag_data_unref0 (_data_->td);
2115 _data_->td = _tmp4_;
2116 if (_data_->_state_ == 0) {
2117 g_simple_async_result_complete_in_idle (_data_->_async_result);
2118 } else {
2119 g_simple_async_result_complete (_data_->_async_result);
2120 }
2121 g_object_unref (_data_->_async_result);
2122 return FALSE;
2123 }
2124 _data_->_tmp5_ = _data_->td;
2125 _data_->_tmp6_ = _data_->_tmp5_->tag_id;
2126 _data_->_tmp7_ = NULL;
2127 _data_->_tmp7_ = g_strdup_printf ("DELETE { <%s> a rdfs:Resource }", _data_->_tmp6_);
2128 _data_->query = _data_->_tmp7_;
2129 {
2130 _data_->_tmp8_ = _data_->self->priv->connection;
2131 _data_->_tmp9_ = _data_->query;
2132 _data_->_tmp10_ = _data_->td;
2133 _data_->_tmp11_ = _data_->_tmp10_->cancellable;
2134 _data_->_state_ = 1;
2135 tracker_sparql_connection_update_async (_data_->_tmp8_, _data_->_tmp9_, G_PRIORITY_DEFAULT, _data_->_tmp11_, tracker_tags_view_remove_tag_ready, _data_);
2136 return FALSE;
2137 _state_1:
2138 tracker_sparql_connection_update_finish (_data_->_tmp8_, _data_->_res_, &_data_->_inner_error_);
2139 if (_data_->_inner_error_ != NULL) {
2140 goto __catch17_g_error;
2141 }
2142 g_debug ("tracker-tags-view.vala:522: Tag removed");
2143 _data_->_tmp12_ = _data_->self->priv->store;
2144 _data_->_tmp13_ = _data_->td;
2145 _data_->_tmp14_ = _data_->_tmp13_->iter;
2146 gtk_list_store_remove (_data_->_tmp12_, &_data_->_tmp14_);
2147 }
2148 goto __finally17;
2149 __catch17_g_error:
2150 {
2151 _data_->e = _data_->_inner_error_;
2152 _data_->_inner_error_ = NULL;
2153 _data_->_tmp15_ = _data_->e;
2154 _data_->_tmp16_ = _data_->_tmp15_->message;
2155 g_warning ("tracker-tags-view.vala:525: Could not run Sparql update query: %s", _data_->_tmp16_);
2156 _data_->_tmp17_ = NULL;
2157 _data_->_tmp17_ = _ ("Could not remove tag");
2158 _data_->_tmp18_ = _data_->e;
2159 tracker_tags_view_show_error_dialog (_data_->self, _data_->_tmp17_, _data_->_tmp18_);
2160 _g_error_free0 (_data_->e);
2161 }
2162 __finally17:
2163 if (_data_->_inner_error_ != NULL) {
2164 _g_free0 (_data_->query);
2165 g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
2166 g_clear_error (&_data_->_inner_error_);
2167 return FALSE;
2168 }
2169 _data_->_tmp19_ = _data_->td;
2170 _data_->self->priv->tag_data_requests = g_list_remove (_data_->self->priv->tag_data_requests, _data_->_tmp19_);
2171 _tmp20_ = _tag_data_ref0 (NULL);
2172 _tag_data_unref0 (_data_->td);
2173 _data_->td = _tmp20_;
2174 _g_free0 (_data_->query);
2175 if (_data_->_state_ == 0) {
2176 g_simple_async_result_complete_in_idle (_data_->_async_result);
2177 } else {
2178 g_simple_async_result_complete (_data_->_async_result);
2179 }
2180 g_object_unref (_data_->_async_result);
2181 return FALSE;
2182 }
2183
2184
2185 static void tracker_tags_view_add_tag_data_free (gpointer _data) {
2186 TrackerTagsViewAddTagData* _data_;
2187 _data_ = _data;
2188 _g_free0 (_data_->tag);
2189 _g_object_unref0 (_data_->self);
2190 g_slice_free (TrackerTagsViewAddTagData, _data_);
2191 }
2192
2193
2194 static void tracker_tags_view_add_tag (TrackerTagsView* self, const gchar* tag, GAsyncReadyCallback _callback_, gpointer _user_data_) {
2195 TrackerTagsViewAddTagData* _data_;
2196 TrackerTagsView* _tmp0_;
2197 const gchar* _tmp1_;
2198 gchar* _tmp2_;
2199 _data_ = g_slice_new0 (TrackerTagsViewAddTagData);
2200 _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, tracker_tags_view_add_tag);
2201 g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, tracker_tags_view_add_tag_data_free);
2202 _tmp0_ = _g_object_ref0 (self);
2203 _data_->self = _tmp0_;
2204 _tmp1_ = tag;
2205 _tmp2_ = g_strdup (_tmp1_);
2206 _g_free0 (_data_->tag);
2207 _data_->tag = _tmp2_;
2208 tracker_tags_view_add_tag_co (_data_);
2209 }
2210
2211
2212 static void tracker_tags_view_add_tag_finish (TrackerTagsView* self, GAsyncResult* _res_) {
2213 TrackerTagsViewAddTagData* _data_;
variable '_data_' set but not used
(emitted by gcc)
2214 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
2215 }
2216
2217
2218 static void tracker_tags_view_add_tag_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
2219 TrackerTagsViewAddTagData* _data_;
2220 _data_ = _user_data_;
2221 _data_->_source_object_ = source_object;
2222 _data_->_res_ = _res_;
2223 tracker_tags_view_add_tag_co (_data_);
2224 }
2225
2226
2227 static gboolean tracker_tags_view_add_tag_co (TrackerTagsViewAddTagData* _data_) {
2228 switch (_data_->_state_) {
2229 case 0:
2230 goto _state_0;
2231 case 1:
2232 goto _state_1;
2233 default:
2234 g_assert_not_reached ();
2235 }
2236 _state_0:
2237 _data_->query = NULL;
2238 _data_->_tmp0_ = _data_->self->priv->connection;
2239 if (_data_->_tmp0_ == NULL) {
2240 _data_->_tmp1_ = _data_->tag;
2241 g_warning ("tracker-tags-view.vala:537: Can't add tag '%s', no SPARQL connection a" \
2242 "vailable", _data_->_tmp1_);
2243 _g_free0 (_data_->query);
2244 if (_data_->_state_ == 0) {
2245 g_simple_async_result_complete_in_idle (_data_->_async_result);
2246 } else {
2247 g_simple_async_result_complete (_data_->_async_result);
2248 }
2249 g_object_unref (_data_->_async_result);
2250 return FALSE;
2251 }
2252 _data_->_tmp2_ = _data_->self->priv->entry;
2253 gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp2_, FALSE);
2254 _data_->_tmp4_ = _data_->self->priv->files;
2255 if (_data_->_tmp4_ != NULL) {
2256 _data_->_tmp5_ = _data_->self->priv->files;
2257 _data_->_tmp6_ = 0U;
2258 _data_->_tmp6_ = g_list_length (_data_->_tmp5_);
2259 _data_->_tmp3_ = _data_->_tmp6_ > ((guint) 0);
2260 } else {
2261 _data_->_tmp3_ = FALSE;
2262 }
2263 _data_->_tmp7_ = _data_->_tmp3_;
2264 if (_data_->_tmp7_) {
2265 _data_->_tmp8_ = g_strdup ("");
2266 _g_free0 (_data_->query);
2267 _data_->query = _data_->_tmp8_;
2268 _data_->_tmp9_ = NULL;
2269 _data_->_tmp9_ = tracker_tags_view_sparql_get_filter_string (_data_->self, NULL);
2270 _data_->filter = _data_->_tmp9_;
2271 _data_->_tmp10_ = _data_->tag;
2272 _data_->_tmp11_ = NULL;
2273 _data_->_tmp11_ = tracker_tags_view_sparql_get_escaped_string (_data_->self, _data_->_tmp10_);
2274 _data_->tag_escaped = _data_->_tmp11_;
2275 _data_->_tmp12_ = _data_->self->priv->files;
2276 {
2277 _data_->url_collection = _data_->_tmp12_;
2278 for (_data_->url_it = _data_->url_collection; _data_->url_it != NULL; _data_->url_it = _data_->url_it->next) {
2279 _data_->_tmp13_ = g_strdup ((const gchar*) _data_->url_it->data);
2280 _data_->url = _data_->_tmp13_;
2281 {
2282 _data_->_tmp14_ = _data_->query;
2283 _data_->_tmp15_ = _data_->url;
2284 _data_->_tmp16_ = _data_->url;
2285 _data_->_tmp17_ = NULL;
2286 _data_->_tmp17_ = g_strdup_printf ("INSERT {\n" \
2287 " _:file a nie:DataObject ;\n" \
2288 " nie:url '%s'\n" \
2289 " } WHERE {\n" \
2290 " OPTIONAL {\n" \
2291 " ?file a nie:DataObject ;\n" \
2292 " nie:url '%s'\n" \
2293 " } .\n" \
2294 " FILTER (!bound(?file))\n" \
2295 " }", _data_->_tmp15_, _data_->_tmp16_);
2296 _data_->_tmp18_ = _data_->_tmp17_;
2297 _data_->_tmp19_ = g_strconcat (_data_->_tmp14_, _data_->_tmp18_, NULL);
2298 _g_free0 (_data_->query);
2299 _data_->query = _data_->_tmp19_;
2300 _g_free0 (_data_->_tmp18_);
2301 _g_free0 (_data_->url);
2302 }
2303 }
2304 }
2305 _data_->_tmp20_ = _data_->query;
2306 _data_->_tmp21_ = _data_->tag_escaped;
2307 _data_->_tmp22_ = _data_->tag_escaped;
2308 _data_->_tmp23_ = _data_->tag_escaped;
2309 _data_->_tmp24_ = _data_->filter;
2310 _data_->_tmp25_ = NULL;
2311 _data_->_tmp25_ = g_strdup_printf ("INSERT {\n" \
2312 " _:tag a nao:Tag;\n" \
2313 " nao:prefLabel %s .\n" \
2314 " } WHERE {\n" \
2315 " OPTIONAL {\n" \
2316 " ?tag a nao:Tag ;\n" \
2317 " nao:prefLabel %s\n" \
2318 " } .\n" \
2319 " FILTER (!bound(?tag))\n" \
2320 " }\n" \
2321 " INSERT {\n" \
2322 " ?urn nao:hasTag ?label\n" \
2323 " } WHERE {\n" \
2324 " ?urn nie:url ?f .\n" \
2325 " ?label nao:prefLabel %s\n" \
2326 " %s\n" \
2327 " }", _data_->_tmp21_, _data_->_tmp22_, _data_->_tmp23_, _data_->_tmp24_);
2328 _data_->_tmp26_ = _data_->_tmp25_;
2329 _data_->_tmp27_ = g_strconcat (_data_->_tmp20_, _data_->_tmp26_, NULL);
2330 _g_free0 (_data_->query);
2331 _data_->query = _data_->_tmp27_;
2332 _g_free0 (_data_->_tmp26_);
2333 _g_free0 (_data_->tag_escaped);
2334 _g_free0 (_data_->filter);
2335 } else {
2336 _data_->_tmp28_ = _data_->tag;
2337 _data_->_tmp29_ = NULL;
2338 _data_->_tmp29_ = tracker_tags_view_sparql_get_escaped_string (_data_->self, _data_->_tmp28_);
2339 _data_->tag_label_escaped = _data_->_tmp29_;
2340 _data_->_tmp30_ = _data_->tag_label_escaped;
2341 _data_->_tmp31_ = _data_->tag_label_escaped;
2342 _data_->_tmp32_ = NULL;
2343 _data_->_tmp32_ = g_strdup_printf ("INSERT {\n" \
2344 " _:tag a nao:Tag ;\n" \
2345 " nao:prefLabel %s .\n" \
2346 " } WHERE {\n" \
2347 " OPTIONAL {\n" \
2348 " ?tag a nao:Tag ;\n" \
2349 " nao:prefLabel %s\n" \
2350 " } .\n" \
2351 " FILTER (!bound(?tag))\n" \
2352 " }", _data_->_tmp30_, _data_->_tmp31_);
2353 _g_free0 (_data_->query);
2354 _data_->query = _data_->_tmp32_;
2355 _g_free0 (_data_->tag_label_escaped);
2356 }
2357 _data_->_tmp33_ = _data_->self->priv->files;
2358 _data_->_tmp34_ = 0U;
2359 _data_->_tmp34_ = g_list_length (_data_->_tmp33_);
2360 _data_->_tmp35_ = tag_data_new (NULL, NULL, FALSE, TRUE, (gint) _data_->_tmp34_, _data_->self);
2361 _data_->td = _data_->_tmp35_;
2362 _data_->_tmp36_ = _data_->td;
2363 _data_->_tmp37_ = _tag_data_ref0 (_data_->_tmp36_);
2364 _data_->self->priv->tag_data_requests = g_list_prepend (_data_->self->priv->tag_data_requests, _data_->_tmp37_);
2365 {
2366 _data_->_tmp38_ = _data_->self->priv->connection;
2367 _data_->_tmp39_ = _data_->query;
2368 _data_->_tmp40_ = _data_->td;
2369 _data_->_tmp41_ = _data_->_tmp40_->cancellable;
2370 _data_->_state_ = 1;
2371 tracker_sparql_connection_update_async (_data_->_tmp38_, _data_->_tmp39_, G_PRIORITY_DEFAULT, _data_->_tmp41_, tracker_tags_view_add_tag_ready, _data_);
2372 return FALSE;
2373 _state_1:
2374 tracker_sparql_connection_update_finish (_data_->_tmp38_, _data_->_res_, &_data_->_inner_error_);
2375 if (_data_->_inner_error_ != NULL) {
2376 goto __catch18_g_error;
2377 }
2378 g_debug ("tracker-tags-view.vala:600: Updated tags");
2379 _data_->_tmp42_ = _data_->td;
2380 tracker_tags_view_update_tag_data (_data_->self, _data_->_tmp42_);
2381 _data_->_tmp43_ = _data_->self->priv->entry;
2382 gtk_entry_set_text (_data_->_tmp43_, "");
2383 }
2384 goto __finally18;
2385 __catch18_g_error:
2386 {
2387 _data_->e = _data_->_inner_error_;
2388 _data_->_inner_error_ = NULL;
2389 _data_->_tmp44_ = _data_->e;
2390 _data_->_tmp45_ = _data_->_tmp44_->message;
2391 g_warning ("tracker-tags-view.vala:606: Could not run Sparql update query: %s", _data_->_tmp45_);
2392 _data_->_tmp46_ = NULL;
2393 _data_->_tmp46_ = _ ("Could not update tags");
2394 _data_->_tmp47_ = _data_->e;
2395 tracker_tags_view_show_error_dialog (_data_->self, _data_->_tmp46_, _data_->_tmp47_);
2396 _g_error_free0 (_data_->e);
2397 }
2398 __finally18:
2399 if (_data_->_inner_error_ != NULL) {
2400 _tag_data_unref0 (_data_->td);
2401 _g_free0 (_data_->query);
2402 g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
2403 g_clear_error (&_data_->_inner_error_);
2404 return FALSE;
2405 }
2406 _data_->_tmp48_ = _data_->td;
2407 _data_->self->priv->tag_data_requests = g_list_remove (_data_->self->priv->tag_data_requests, _data_->_tmp48_);
2408 _tag_data_unref0 (_data_->td);
2409 _data_->td = NULL;
2410 _data_->_tmp49_ = _data_->self->priv->entry;
2411 gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp49_, TRUE);
2412 _tag_data_unref0 (_data_->td);
2413 _g_free0 (_data_->query);
2414 if (_data_->_state_ == 0) {
2415 g_simple_async_result_complete_in_idle (_data_->_async_result);
2416 } else {
2417 g_simple_async_result_complete (_data_->_async_result);
2418 }
2419 g_object_unref (_data_->_async_result);
2420 return FALSE;
2421 }
2422
2423
2424 static void tracker_tags_view_update_tag_data (TrackerTagsView* self, TagData* td) {
2425 GtkEntry* _tmp0_;
2426 const gchar* _tmp1_ = NULL;
2427 const gchar* tag;
2428 TagData* _tmp2_;
2429 gboolean _tmp3_;
2430 g_return_if_fail (self != NULL);
2431 g_return_if_fail (td != NULL);
2432 _tmp0_ = self->priv->entry;
2433 _tmp1_ = gtk_entry_get_text (_tmp0_);
2434 tag = _tmp1_;
2435 _tmp2_ = td;
2436 _tmp3_ = _tmp2_->update;
2437 if (_tmp3_ == FALSE) {
2438 GtkTreeIter iter = {0};
2439 GtkListStore* _tmp4_;
2440 GtkTreeIter _tmp5_ = {0};
2441 GtkListStore* _tmp6_;
2442 GtkTreeIter _tmp7_;
2443 TagData* _tmp8_;
2444 const gchar* _tmp9_;
2445 const gchar* _tmp10_;
2446 TagData* _tmp11_;
2447 gint _tmp12_;
2448 gchar* _tmp13_ = NULL;
2449 gchar* _tmp14_;
2450 TagData* _tmp15_;
2451 gint _tmp16_;
2452 g_debug ("tracker-tags-view.vala:622: Setting tag selection state to ON (new)");
2453 _tmp4_ = self->priv->store;
2454 gtk_list_store_append (_tmp4_, &_tmp5_);
2455 iter = _tmp5_;
2456 _tmp6_ = self->priv->store;
2457 _tmp7_ = iter;
2458 _tmp8_ = td;
2459 _tmp9_ = _tmp8_->tag_id;
2460 _tmp10_ = tag;
2461 _tmp11_ = td;
2462 _tmp12_ = _tmp11_->items;
2463 _tmp13_ = g_strdup_printf ("%d", _tmp12_);
2464 _tmp14_ = _tmp13_;
2465 _tmp15_ = td;
2466 _tmp16_ = _tmp15_->items;
2467 gtk_list_store_set (_tmp6_, &_tmp7_, TRACKER_TAGS_VIEW_COL_TAG_ID, _tmp9_, TRACKER_TAGS_VIEW_COL_TAG_NAME, _tmp10_, TRACKER_TAGS_VIEW_COL_TAG_COUNT, _tmp14_, TRACKER_TAGS_VIEW_COL_TAG_COUNT_VALUE, _tmp16_, TRACKER_TAGS_VIEW_COL_SELECTION, TRACKER_TAGS_VIEW_SELECTION_TRUE, -1, -1);
2468 _g_free0 (_tmp14_);
2469 } else {
2470 TagData* _tmp17_;
2471 gboolean _tmp18_;
2472 _tmp17_ = td;
2473 _tmp18_ = _tmp17_->selected;
2474 if (_tmp18_ == TRUE) {
2475 GtkListStore* _tmp19_;
2476 TagData* _tmp20_;
2477 GtkTreeIter _tmp21_;
2478 TagData* _tmp22_;
2479 TagData* _tmp23_;
2480 TagData* _tmp24_;
2481 g_debug ("tracker-tags-view.vala:633: Setting tag selection state to ON");
2482 _tmp19_ = self->priv->store;
2483 _tmp20_ = td;
2484 _tmp21_ = _tmp20_->iter;
2485 gtk_list_store_set (_tmp19_, &_tmp21_, TRACKER_TAGS_VIEW_COL_SELECTION, TRACKER_TAGS_VIEW_SELECTION_TRUE, -1, -1);
2486 _tmp22_ = td;
2487 _tmp23_ = _tag_data_ref0 (_tmp22_);
2488 self->priv->tag_data_requests = g_list_prepend (self->priv->tag_data_requests, _tmp23_);
2489 _tmp24_ = td;
2490 tracker_tags_view_query_files_for_tag_id (self, _tmp24_, NULL, NULL);
2491 } else {
2492 GtkListStore* _tmp25_;
2493 TagData* _tmp26_;
2494 GtkTreeIter _tmp27_;
2495 TagData* _tmp28_;
2496 TagData* _tmp29_;
2497 TagData* _tmp30_;
2498 g_debug ("tracker-tags-view.vala:640: Setting tag selection state to FALSE");
2499 _tmp25_ = self->priv->store;
2500 _tmp26_ = td;
2501 _tmp27_ = _tmp26_->iter;
2502 gtk_list_store_set (_tmp25_, &_tmp27_, TRACKER_TAGS_VIEW_COL_SELECTION, TRACKER_TAGS_VIEW_SELECTION_FALSE, -1, -1);
2503 _tmp28_ = td;
2504 _tmp29_ = _tag_data_ref0 (_tmp28_);
2505 self->priv->tag_data_requests = g_list_prepend (self->priv->tag_data_requests, _tmp29_);
2506 _tmp30_ = td;
2507 tracker_tags_view_query_files_for_tag_id (self, _tmp30_, NULL, NULL);
2508 }
2509 }
2510 }
2511
2512
2513 static Block3Data* block3_data_ref (Block3Data* _data3_) {
2514 g_atomic_int_inc (&_data3_->_ref_count_);
2515 return _data3_;
2516 }
2517
2518
2519 static void block3_data_unref (void * _userdata_) {
2520 Block3Data* _data3_;
2521 _data3_ = (Block3Data*) _userdata_;
2522 if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
2523 TrackerTagsView * self;
2524 self = _data3_->self;
2525 _g_object_unref0 (_data3_->store);
2526 _g_object_unref0 (self);
2527 g_slice_free (Block3Data, _data3_);
2528 }
2529 }
2530
2531
2532 static gboolean __lambda4_ (Block3Data* _data3_, GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* foreach_iter) {
2533 TrackerTagsView * self;
variable 'self' set but not used
(emitted by gcc)
2534 gboolean result = FALSE;
2535 GtkTreeIter _tmp0_;
2536 self = _data3_->self;
2537 g_return_val_if_fail (model != NULL, FALSE);
2538 g_return_val_if_fail (path != NULL, FALSE);
2539 g_return_val_if_fail (foreach_iter != NULL, FALSE);
2540 _tmp0_ = *foreach_iter;
2541 gtk_list_store_set (_data3_->store, &_tmp0_, TRACKER_TAGS_VIEW_COL_SELECTION, TRACKER_TAGS_VIEW_SELECTION_FALSE, -1, -1);
2542 result = FALSE;
2543 return result;
2544 }
2545
2546
2547 static gboolean ___lambda4__gtk_tree_model_foreach_func (GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, gpointer self) {
2548 gboolean result;
2549 result = __lambda4_ (self, model, path, iter);
2550 return result;
2551 }
2552
2553
2554 static void tracker_tags_view_untoggle_all (TrackerTagsView* self) {
2555 Block3Data* _data3_;
2556 GtkTreeView* _tmp0_;
2557 GtkTreeModel* _tmp1_ = NULL;
2558 GtkTreeModel* _tmp2_;
2559 GtkTreeModel* model;
2560 GtkListStore* _tmp3_;
2561 g_return_if_fail (self != NULL);
2562 _data3_ = g_slice_new0 (Block3Data);
2563 _data3_->_ref_count_ = 1;
2564 _data3_->self = g_object_ref (self);
2565 _tmp0_ = self->priv->view;
2566 _tmp1_ = gtk_tree_view_get_model (_tmp0_);
2567 _tmp2_ = _g_object_ref0 (_tmp1_);
2568 model = _tmp2_;
2569 _tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (model, GTK_TYPE_LIST_STORE, GtkListStore));
2570 _data3_->store = _tmp3_;
2571 gtk_tree_model_foreach (model, ___lambda4__gtk_tree_model_foreach_func, _data3_);
2572 _g_object_unref0 (model);
2573 block3_data_unref (_data3_);
2574 _data3_ = NULL;
2575 }
2576
2577
2578 static void tracker_tags_view_query_tags_for_files_data_free (gpointer _data) {
2579 TrackerTagsViewQueryTagsForFilesData* _data_;
2580 _data_ = _data;
2581 _g_object_unref0 (_data_->self);
2582 g_slice_free (TrackerTagsViewQueryTagsForFilesData, _data_);
2583 }
2584
2585
2586 static void tracker_tags_view_query_tags_for_files (TrackerTagsView* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
2587 TrackerTagsViewQueryTagsForFilesData* _data_;
2588 TrackerTagsView* _tmp0_;
2589 _data_ = g_slice_new0 (TrackerTagsViewQueryTagsForFilesData);
2590 _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, tracker_tags_view_query_tags_for_files);
2591 g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, tracker_tags_view_query_tags_for_files_data_free);
2592 _tmp0_ = _g_object_ref0 (self);
2593 _data_->self = _tmp0_;
2594 tracker_tags_view_query_tags_for_files_co (_data_);
2595 }
2596
2597
2598 static void tracker_tags_view_query_tags_for_files_finish (TrackerTagsView* self, GAsyncResult* _res_) {
2599 TrackerTagsViewQueryTagsForFilesData* _data_;
variable '_data_' set but not used
(emitted by gcc)
2600 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
2601 }
2602
2603
2604 static void tracker_tags_view_query_tags_for_files_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
2605 TrackerTagsViewQueryTagsForFilesData* _data_;
2606 _data_ = _user_data_;
2607 _data_->_source_object_ = source_object;
2608 _data_->_res_ = _res_;
2609 tracker_tags_view_query_tags_for_files_co (_data_);
2610 }
2611
2612
2613 static gboolean tracker_tags_view_query_tags_for_files_co (TrackerTagsViewQueryTagsForFilesData* _data_) {
2614 switch (_data_->_state_) {
2615 case 0:
2616 goto _state_0;
2617 case 1:
2618 goto _state_1;
2619 case 2:
2620 goto _state_2;
2621 default:
2622 g_assert_not_reached ();
2623 }
2624 _state_0:
2625 tracker_tags_view_untoggle_all (_data_->self);
2626 _data_->_tmp0_ = _data_->self->priv->files;
2627 if (_data_->_tmp0_ == NULL) {
2628 if (_data_->_state_ == 0) {
2629 g_simple_async_result_complete_in_idle (_data_->_async_result);
2630 } else {
2631 g_simple_async_result_complete (_data_->_async_result);
2632 }
2633 g_object_unref (_data_->_async_result);
2634 return FALSE;
2635 }
2636 _data_->_tmp1_ = g_strdup ("");
2637 _data_->files_filter = _data_->_tmp1_;
2638 _data_->_tmp2_ = _data_->self->priv->files;
2639 {
2640 _data_->url_collection = _data_->_tmp2_;
2641 for (_data_->url_it = _data_->url_collection; _data_->url_it != NULL; _data_->url_it = _data_->url_it->next) {
2642 _data_->_tmp3_ = g_strdup ((const gchar*) _data_->url_it->data);
2643 _data_->url = _data_->_tmp3_;
2644 {
2645 _data_->_tmp4_ = _data_->files_filter;
2646 _data_->_tmp5_ = strlen (_data_->_tmp4_);
2647 _data_->_tmp6_ = _data_->_tmp5_;
2648 if (_data_->_tmp6_ > 0) {
2649 _data_->_tmp7_ = _data_->files_filter;
2650 _data_->_tmp8_ = g_strconcat (_data_->_tmp7_, ",", NULL);
2651 _g_free0 (_data_->files_filter);
2652 _data_->files_filter = _data_->_tmp8_;
2653 }
2654 _data_->_tmp9_ = _data_->files_filter;
2655 _data_->_tmp10_ = _data_->url;
2656 _data_->_tmp11_ = NULL;
2657 _data_->_tmp11_ = g_strdup_printf ("'%s'", _data_->_tmp10_);
2658 _data_->_tmp12_ = _data_->_tmp11_;
2659 _data_->_tmp13_ = g_strconcat (_data_->_tmp9_, _data_->_tmp12_, NULL);
2660 _g_free0 (_data_->files_filter);
2661 _data_->files_filter = _data_->_tmp13_;
2662 _g_free0 (_data_->_tmp12_);
2663 _g_free0 (_data_->url);
2664 }
2665 }
2666 }
2667 _data_->_tmp14_ = _data_->files_filter;
2668 _data_->_tmp15_ = NULL;
2669 _data_->_tmp15_ = g_strdup_printf ("select ?tag nao:prefLabel(?tag) WHERE { ?urn nao:hasTag ?tag . FILTER(" \
2670 "nie:url(?urn) IN (%s)) } ORDER BY (?tag)", _data_->_tmp14_);
2671 _data_->query = _data_->_tmp15_;
2672 g_debug ("tracker-tags-view.vala:679: Getting tags for files selected...");
2673 {
2674 _data_->_tmp16_ = _data_->self->priv->connection;
2675 _data_->_tmp17_ = _data_->query;
2676 _data_->_state_ = 1;
2677 tracker_sparql_connection_query_async (_data_->_tmp16_, _data_->_tmp17_, NULL, tracker_tags_view_query_tags_for_files_ready, _data_);
2678 return FALSE;
2679 _state_1:
2680 _data_->_tmp18_ = NULL;
2681 _data_->_tmp18_ = tracker_sparql_connection_query_finish (_data_->_tmp16_, _data_->_res_, &_data_->_inner_error_);
2682 _data_->cursor = _data_->_tmp18_;
2683 if (_data_->_inner_error_ != NULL) {
2684 goto __catch19_g_error;
2685 }
2686 while (TRUE) {
2687 _data_->_tmp19_ = _data_->cursor;
2688 _data_->_state_ = 2;
2689 tracker_sparql_cursor_next_async (_data_->_tmp19_, NULL, tracker_tags_view_query_tags_for_files_ready, _data_);
2690 return FALSE;
2691 _state_2:
2692 _data_->_tmp20_ = FALSE;
2693 _data_->_tmp20_ = tracker_sparql_cursor_next_finish (_data_->_tmp19_, _data_->_res_, &_data_->_inner_error_);
2694 _data_->_tmp21_ = _data_->_tmp20_;
2695 if (_data_->_inner_error_ != NULL) {
2696 _g_object_unref0 (_data_->cursor);
2697 goto __catch19_g_error;
2698 }
2699 if (!_data_->_tmp21_) {
2700 break;
2701 }
2702 g_debug ("tracker-tags-view.vala:685: Toggling tags...");
2703 _data_->_tmp22_ = _data_->cursor;
2704 _data_->_tmp23_ = NULL;
2705 _data_->_tmp23_ = tracker_sparql_cursor_get_string (_data_->_tmp22_, 0, NULL);
2706 _data_->id = _data_->_tmp23_;
2707 _data_->_tmp24_ = _data_->cursor;
2708 _data_->_tmp25_ = NULL;
2709 _data_->_tmp25_ = tracker_sparql_cursor_get_string (_data_->_tmp24_, 1, NULL);
2710 _data_->label = _data_->_tmp25_;
2711 _data_->_tmp26_ = _data_->id;
2712 _data_->_tmp27_ = _data_->label;
2713 g_debug ("tracker-tags-view.vala:690: Enabling tag:'%s', label:'%s'", _data_->_tmp26_, _data_->_tmp27_);
2714 _data_->_tmp28_ = _data_->label;
2715 memset (&_data_->_tmp29_, 0, sizeof (GtkTreeIter));
2716 _data_->_tmp30_ = FALSE;
2717 _data_->_tmp30_ = tracker_tags_view_find_tag (_data_->self, _data_->_tmp28_, &_data_->_tmp29_);
2718 _data_->iter = _data_->_tmp29_;
2719 if (_data_->_tmp30_) {
2720 _data_->_tmp31_ = _data_->self->priv->store;
2721 _data_->_tmp32_ = _data_->iter;
2722 gtk_list_store_set (_data_->_tmp31_, &_data_->_tmp32_, TRACKER_TAGS_VIEW_COL_SELECTION, TRACKER_TAGS_VIEW_SELECTION_TRUE, -1, -1);
2723 }
2724 }
2725 _g_object_unref0 (_data_->cursor);
2726 }
2727 goto __finally19;
2728 __catch19_g_error:
2729 {
2730 _data_->e = _data_->_inner_error_;
2731 _data_->_inner_error_ = NULL;
2732 _data_->_tmp33_ = _data_->e;
2733 _data_->_tmp34_ = _data_->_tmp33_->message;
2734 g_warning ("tracker-tags-view.vala:700: Could not run Sparql query: %s", _data_->_tmp34_);
2735 _data_->_tmp35_ = NULL;
2736 _data_->_tmp35_ = _ ("Could not retrieve tags for the current selection");
2737 _data_->_tmp36_ = _data_->e;
2738 tracker_tags_view_show_error_dialog (_data_->self, _data_->_tmp35_, _data_->_tmp36_);
2739 _g_error_free0 (_data_->e);
2740 }
2741 __finally19:
2742 if (_data_->_inner_error_ != NULL) {
2743 _g_free0 (_data_->query);
2744 _g_free0 (_data_->files_filter);
2745 g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
2746 g_clear_error (&_data_->_inner_error_);
2747 return FALSE;
2748 }
2749 _g_free0 (_data_->query);
2750 _g_free0 (_data_->files_filter);
2751 if (_data_->_state_ == 0) {
2752 g_simple_async_result_complete_in_idle (_data_->_async_result);
2753 } else {
2754 g_simple_async_result_complete (_data_->_async_result);
2755 }
2756 g_object_unref (_data_->_async_result);
2757 return FALSE;
2758 }
2759
2760
2761 static void tracker_tags_view_query_tags_data_free (gpointer _data) {
2762 TrackerTagsViewQueryTagsData* _data_;
2763 _data_ = _data;
2764 _g_object_unref0 (_data_->self);
2765 g_slice_free (TrackerTagsViewQueryTagsData, _data_);
2766 }
2767
2768
2769 static void tracker_tags_view_query_tags (TrackerTagsView* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
2770 TrackerTagsViewQueryTagsData* _data_;
2771 TrackerTagsView* _tmp0_;
2772 _data_ = g_slice_new0 (TrackerTagsViewQueryTagsData);
2773 _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, tracker_tags_view_query_tags);
2774 g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, tracker_tags_view_query_tags_data_free);
2775 _tmp0_ = _g_object_ref0 (self);
2776 _data_->self = _tmp0_;
2777 tracker_tags_view_query_tags_co (_data_);
2778 }
2779
2780
2781 static void tracker_tags_view_query_tags_finish (TrackerTagsView* self, GAsyncResult* _res_) {
2782 TrackerTagsViewQueryTagsData* _data_;
variable '_data_' set but not used
(emitted by gcc)
2783 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
2784 }
2785
2786
2787 static void tracker_tags_view_query_tags_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
2788 TrackerTagsViewQueryTagsData* _data_;
2789 _data_ = _user_data_;
2790 _data_->_source_object_ = source_object;
2791 _data_->_res_ = _res_;
2792 tracker_tags_view_query_tags_co (_data_);
2793 }
2794
2795
2796 static gboolean tracker_tags_view_query_tags_co (TrackerTagsViewQueryTagsData* _data_) {
2797 switch (_data_->_state_) {
2798 case 0:
2799 goto _state_0;
2800 case 1:
2801 goto _state_1;
2802 case 2:
2803 goto _state_2;
2804 default:
2805 g_assert_not_reached ();
2806 }
2807 _state_0:
2808 _data_->_tmp0_ = g_strdup ("SELECT ?urn ?label WHERE { ?urn a nao:Tag ; nao:prefLabel ?label . } O" \
2809 "RDER BY ?label");
2810 _data_->query = _data_->_tmp0_;
2811 g_debug ("tracker-tags-view.vala:709: Clearing tags in store");
2812 _data_->_tmp1_ = _data_->self->priv->store;
2813 gtk_list_store_clear (_data_->_tmp1_);
2814 {
2815 _data_->_tmp2_ = _data_->self->priv->connection;
2816 _data_->_tmp3_ = _data_->query;
2817 _data_->_state_ = 1;
2818 tracker_sparql_connection_query_async (_data_->_tmp2_, _data_->_tmp3_, NULL, tracker_tags_view_query_tags_ready, _data_);
2819 return FALSE;
2820 _state_1:
2821 _data_->_tmp4_ = NULL;
2822 _data_->_tmp4_ = tracker_sparql_connection_query_finish (_data_->_tmp2_, _data_->_res_, &_data_->_inner_error_);
2823 _data_->cursor = _data_->_tmp4_;
2824 if (_data_->_inner_error_ != NULL) {
2825 goto __catch20_g_error;
2826 }
2827 while (TRUE) {
2828 _data_->_tmp5_ = _data_->cursor;
2829 _data_->_state_ = 2;
2830 tracker_sparql_cursor_next_async (_data_->_tmp5_, NULL, tracker_tags_view_query_tags_ready, _data_);
2831 return FALSE;
2832 _state_2:
2833 _data_->_tmp6_ = FALSE;
2834 _data_->_tmp6_ = tracker_sparql_cursor_next_finish (_data_->_tmp5_, _data_->_res_, &_data_->_inner_error_);
2835 _data_->_tmp7_ = _data_->_tmp6_;
2836 if (_data_->_inner_error_ != NULL) {
2837 _g_object_unref0 (_data_->cursor);
2838 goto __catch20_g_error;
2839 }
2840 if (!_data_->_tmp7_) {
2841 break;
2842 }
2843 g_debug ("tracker-tags-view.vala:717: Adding all tags...");
2844 _data_->_tmp8_ = _data_->cursor;
2845 _data_->_tmp9_ = NULL;
2846 _data_->_tmp9_ = tracker_sparql_cursor_get_string (_data_->_tmp8_, 0, NULL);
2847 _data_->id = _data_->_tmp9_;
2848 _data_->_tmp10_ = _data_->cursor;
2849 _data_->_tmp11_ = NULL;
2850 _data_->_tmp11_ = tracker_sparql_cursor_get_string (_data_->_tmp10_, 1, NULL);
2851 _data_->label = _data_->_tmp11_;
2852 _data_->_tmp12_ = _data_->id;
2853 _data_->_tmp13_ = _data_->label;
2854 g_debug ("tracker-tags-view.vala:722: Adding tag id:'%s' with label:'%s' to st" \
2855 "ore", _data_->_tmp12_, _data_->_tmp13_);
2856 _data_->_tmp14_ = _data_->self->priv->store;
2857 memset (&_data_->_tmp15_, 0, sizeof (GtkTreeIter));
2858 gtk_list_store_append (_data_->_tmp14_, &_data_->_tmp15_);
2859 _data_->iter = _data_->_tmp15_;
2860 _data_->_tmp16_ = _data_->self->priv->store;
2861 _data_->_tmp17_ = _data_->iter;
2862 _data_->_tmp18_ = _data_->id;
2863 _data_->_tmp19_ = _data_->label;
2864 gtk_list_store_set (_data_->_tmp16_, &_data_->_tmp17_, TRACKER_TAGS_VIEW_COL_TAG_ID, _data_->_tmp18_, TRACKER_TAGS_VIEW_COL_TAG_NAME, _data_->_tmp19_, TRACKER_TAGS_VIEW_COL_SELECTION, TRACKER_TAGS_VIEW_SELECTION_FALSE, -1, -1);
2865 _data_->_tmp20_ = _data_->id;
2866 _data_->_tmp21_ = _data_->iter;
2867 _data_->_tmp22_ = tag_data_new (_data_->_tmp20_, &_data_->_tmp21_, FALSE, TRUE, 1, _data_->self);
2868 _data_->td = _data_->_tmp22_;
2869 _data_->_tmp23_ = _data_->td;
2870 _data_->_tmp24_ = _tag_data_ref0 (_data_->_tmp23_);
2871 _data_->self->priv->tag_data_requests = g_list_prepend (_data_->self->priv->tag_data_requests, _data_->_tmp24_);
2872 _data_->_tmp25_ = _data_->td;
2873 tracker_tags_view_query_files_for_tag_id (_data_->self, _data_->_tmp25_, NULL, NULL);
2874 _tag_data_unref0 (_data_->td);
2875 }
2876 _g_object_unref0 (_data_->cursor);
2877 }
2878 goto __finally20;
2879 __catch20_g_error:
2880 {
2881 _data_->e = _data_->_inner_error_;
2882 _data_->_inner_error_ = NULL;
2883 _data_->_tmp26_ = _data_->e;
2884 _data_->_tmp27_ = _data_->_tmp26_->message;
2885 g_warning ("tracker-tags-view.vala:739: Could not run Sparql query: %s", _data_->_tmp27_);
2886 _data_->_tmp28_ = NULL;
2887 _data_->_tmp28_ = _ ("Could not add tag");
2888 _data_->_tmp29_ = _data_->e;
2889 tracker_tags_view_show_error_dialog (_data_->self, _data_->_tmp28_, _data_->_tmp29_);
2890 _g_error_free0 (_data_->e);
2891 }
2892 __finally20:
2893 if (_data_->_inner_error_ != NULL) {
2894 _g_free0 (_data_->query);
2895 g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
2896 g_clear_error (&_data_->_inner_error_);
2897 return FALSE;
2898 }
2899 _g_free0 (_data_->query);
2900 if (_data_->_state_ == 0) {
2901 g_simple_async_result_complete_in_idle (_data_->_async_result);
2902 } else {
2903 g_simple_async_result_complete (_data_->_async_result);
2904 }
2905 g_object_unref (_data_->_async_result);
2906 return FALSE;
2907 }
2908
2909
2910 static void tracker_tags_view_query_files_for_tag_id_data_free (gpointer _data) {
2911 TrackerTagsViewQueryFilesForTagIdData* _data_;
2912 _data_ = _data;
2913 _tag_data_unref0 (_data_->td);
2914 _g_object_unref0 (_data_->self);
2915 g_slice_free (TrackerTagsViewQueryFilesForTagIdData, _data_);
2916 }
2917
2918
2919 static void tracker_tags_view_query_files_for_tag_id (TrackerTagsView* self, TagData* td, GAsyncReadyCallback _callback_, gpointer _user_data_) {
2920 TrackerTagsViewQueryFilesForTagIdData* _data_;
2921 TrackerTagsView* _tmp0_;
2922 TagData* _tmp1_;
2923 TagData* _tmp2_;
2924 _data_ = g_slice_new0 (TrackerTagsViewQueryFilesForTagIdData);
2925 _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, tracker_tags_view_query_files_for_tag_id);
2926 g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, tracker_tags_view_query_files_for_tag_id_data_free);
2927 _tmp0_ = _g_object_ref0 (self);
2928 _data_->self = _tmp0_;
2929 _tmp1_ = td;
2930 _tmp2_ = _tag_data_ref0 (_tmp1_);
2931 _tag_data_unref0 (_data_->td);
2932 _data_->td = _tmp2_;
2933 tracker_tags_view_query_files_for_tag_id_co (_data_);
2934 }
2935
2936
2937 static void tracker_tags_view_query_files_for_tag_id_finish (TrackerTagsView* self, GAsyncResult* _res_) {
2938 TrackerTagsViewQueryFilesForTagIdData* _data_;
variable '_data_' set but not used
(emitted by gcc)
2939 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
2940 }
2941
2942
2943 static void tracker_tags_view_query_files_for_tag_id_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
2944 TrackerTagsViewQueryFilesForTagIdData* _data_;
2945 _data_ = _user_data_;
2946 _data_->_source_object_ = source_object;
2947 _data_->_res_ = _res_;
2948 tracker_tags_view_query_files_for_tag_id_co (_data_);
2949 }
2950
2951
2952 static gboolean tracker_tags_view_query_files_for_tag_id_co (TrackerTagsViewQueryFilesForTagIdData* _data_) {
2953 TagData* _tmp56_;
2954 switch (_data_->_state_) {
2955 case 0:
2956 goto _state_0;
2957 case 1:
2958 goto _state_1;
2959 case 2:
2960 goto _state_2;
2961 default:
2962 g_assert_not_reached ();
2963 }
2964 _state_0:
2965 _data_->_tmp0_ = _data_->self->priv->connection;
2966 if (_data_->_tmp0_ == NULL) {
2967 TagData* _tmp4_;
2968 _data_->_tmp1_ = _data_->td;
2969 _data_->_tmp2_ = _data_->_tmp1_->tag_id;
2970 g_warning ("tracker-tags-view.vala:746: Can't query files for tag id '%s', no SPAR" \
2971 "QL connection available", _data_->_tmp2_);
2972 _data_->_tmp3_ = _data_->td;
2973 _data_->self->priv->tag_data_requests = g_list_remove (_data_->self->priv->tag_data_requests, _data_->_tmp3_);
2974 _tmp4_ = _tag_data_ref0 (NULL);
2975 _tag_data_unref0 (_data_->td);
2976 _data_->td = _tmp4_;
2977 if (_data_->_state_ == 0) {
2978 g_simple_async_result_complete_in_idle (_data_->_async_result);
2979 } else {
2980 g_simple_async_result_complete (_data_->_async_result);
2981 }
2982 g_object_unref (_data_->_async_result);
2983 return FALSE;
2984 }
2985 _data_->_tmp5_ = _data_->td;
2986 _data_->_tmp6_ = _data_->_tmp5_->tag_id;
2987 _data_->_tmp7_ = NULL;
2988 _data_->_tmp7_ = g_strdup_printf ("SELECT ?url WHERE { ?urn a rdfs:Resource ; nie:url ?url ; nao:hasTag <" \
2989 "%s> . }", _data_->_tmp6_);
2990 _data_->query = _data_->_tmp7_;
2991 {
2992 _data_->_tmp8_ = _data_->self->priv->connection;
2993 _data_->_tmp9_ = _data_->query;
2994 _data_->_tmp10_ = _data_->td;
2995 _data_->_tmp11_ = _data_->_tmp10_->cancellable;
2996 _data_->_state_ = 1;
2997 tracker_sparql_connection_query_async (_data_->_tmp8_, _data_->_tmp9_, _data_->_tmp11_, tracker_tags_view_query_files_for_tag_id_ready, _data_);
2998 return FALSE;
2999 _state_1:
3000 _data_->_tmp12_ = NULL;
3001 _data_->_tmp12_ = tracker_sparql_connection_query_finish (_data_->_tmp8_, _data_->_res_, &_data_->_inner_error_);
3002 _data_->cursor = _data_->_tmp12_;
3003 if (_data_->_inner_error_ != NULL) {
3004 goto __catch21_g_error;
3005 }
3006 _data_->has_tag_in_selection = (guint) 0;
3007 _data_->files_with_tag = (guint) 0;
3008 _data_->_tmp13_ = _data_->self->priv->files;
3009 _data_->_tmp14_ = 0U;
3010 _data_->_tmp14_ = g_list_length (_data_->_tmp13_);
3011 _data_->files_selected = _data_->_tmp14_;
3012 while (TRUE) {
3013 _data_->_tmp15_ = _data_->cursor;
3014 _data_->_state_ = 2;
3015 tracker_sparql_cursor_next_async (_data_->_tmp15_, NULL, tracker_tags_view_query_files_for_tag_id_ready, _data_);
3016 return FALSE;
3017 _state_2:
3018 _data_->_tmp16_ = FALSE;
3019 _data_->_tmp16_ = tracker_sparql_cursor_next_finish (_data_->_tmp15_, _data_->_res_, &_data_->_inner_error_);
3020 _data_->_tmp17_ = _data_->_tmp16_;
3021 if (_data_->_inner_error_ != NULL) {
3022 _g_object_unref0 (_data_->cursor);
3023 goto __catch21_g_error;
3024 }
3025 if (!_data_->_tmp17_) {
3026 break;
3027 }
3028 _data_->_tmp18_ = _data_->files_with_tag;
3029 _data_->files_with_tag = _data_->_tmp18_ + 1;
3030 _data_->_tmp19_ = _data_->self->priv->files;
3031 {
3032 _data_->url_collection = _data_->_tmp19_;
3033 for (_data_->url_it = _data_->url_collection; _data_->url_it != NULL; _data_->url_it = _data_->url_it->next) {
3034 _data_->_tmp20_ = g_strdup ((const gchar*) _data_->url_it->data);
3035 _data_->url = _data_->_tmp20_;
3036 {
3037 _data_->_tmp21_ = _data_->cursor;
3038 _data_->_tmp22_ = NULL;
3039 _data_->_tmp22_ = tracker_sparql_cursor_get_string (_data_->_tmp21_, 0, NULL);
3040 _data_->url_returned = _data_->_tmp22_;
3041 _data_->_tmp23_ = _data_->url;
3042 _data_->_tmp24_ = _data_->url_returned;
3043 g_debug ("tracker-tags-view.vala:767: --> '%s' vs '%s'", _data_->_tmp23_, _data_->_tmp24_);
3044 _data_->_tmp25_ = _data_->url_returned;
3045 if (_data_->_tmp25_ == NULL) {
3046 _g_free0 (_data_->url);
3047 continue;
3048 }
3049 _data_->_tmp26_ = _data_->url_returned;
3050 _data_->_tmp27_ = _data_->url;
3051 if (g_strcmp0 (_data_->_tmp26_, _data_->_tmp27_) == 0) {
3052 _data_->_tmp28_ = _data_->has_tag_in_selection;
3053 _data_->has_tag_in_selection = _data_->_tmp28_ + 1;
3054 _g_free0 (_data_->url);
3055 break;
3056 }
3057 _g_free0 (_data_->url);
3058 }
3059 }
3060 }
3061 }
3062 _data_->_tmp29_ = _data_->has_tag_in_selection;
3063 _data_->_tmp30_ = _data_->files_with_tag;
3064 _data_->_tmp31_ = _data_->files_selected;
3065 g_debug ("tracker-tags-view.vala:780: Querying files with tag, in selection:%ld," \
3066 " in total:%ld, selected:%ld", (glong) _data_->_tmp29_, (glong) _data_->_tmp30_, (glong) _data_->_tmp31_);
3067 _data_->_tmp32_ = _data_->has_tag_in_selection;
3068 if (_data_->_tmp32_ == ((guint) 0)) {
3069 _data_->_tmp33_ = _data_->self->priv->store;
3070 _data_->_tmp34_ = _data_->td;
3071 _data_->_tmp35_ = _data_->_tmp34_->iter;
3072 gtk_list_store_set (_data_->_tmp33_, &_data_->_tmp35_, TRACKER_TAGS_VIEW_COL_SELECTION, TRACKER_TAGS_VIEW_SELECTION_FALSE, -1, -1);
3073 } else {
3074 _data_->_tmp36_ = _data_->files_selected;
3075 _data_->_tmp37_ = _data_->has_tag_in_selection;
3076 if (_data_->_tmp36_ != _data_->_tmp37_) {
3077 _data_->_tmp38_ = _data_->self->priv->store;
3078 _data_->_tmp39_ = _data_->td;
3079 _data_->_tmp40_ = _data_->_tmp39_->iter;
3080 gtk_list_store_set (_data_->_tmp38_, &_data_->_tmp40_, TRACKER_TAGS_VIEW_COL_SELECTION, TRACKER_TAGS_VIEW_SELECTION_INCONSISTENT, -1, -1);
3081 } else {
3082 _data_->_tmp41_ = _data_->self->priv->store;
3083 _data_->_tmp42_ = _data_->td;
3084 _data_->_tmp43_ = _data_->_tmp42_->iter;
3085 gtk_list_store_set (_data_->_tmp41_, &_data_->_tmp43_, TRACKER_TAGS_VIEW_COL_SELECTION, TRACKER_TAGS_VIEW_SELECTION_TRUE, -1, -1);
3086 }
3087 }
3088 _data_->_tmp44_ = _data_->files_with_tag;
3089 _data_->_tmp45_ = NULL;
3090 _data_->_tmp45_ = g_strdup_printf ("%ld", (glong) _data_->_tmp44_);
3091 _data_->str = _data_->_tmp45_;
3092 _data_->_tmp46_ = _data_->self->priv->store;
3093 _data_->_tmp47_ = _data_->td;
3094 _data_->_tmp48_ = _data_->_tmp47_->iter;
3095 _data_->_tmp49_ = _data_->str;
3096 _data_->_tmp50_ = _data_->files_with_tag;
3097 gtk_list_store_set (_data_->_tmp46_, &_data_->_tmp48_, TRACKER_TAGS_VIEW_COL_TAG_COUNT, _data_->_tmp49_, TRACKER_TAGS_VIEW_COL_TAG_COUNT_VALUE, _data_->_tmp50_, -1, -1);
3098 g_debug ("tracker-tags-view.vala:794: Tags for file updated");
3099 _g_free0 (_data_->str);
3100 _g_object_unref0 (_data_->cursor);
3101 }
3102 goto __finally21;
3103 __catch21_g_error:
3104 {
3105 _data_->e = _data_->_inner_error_;
3106 _data_->_inner_error_ = NULL;
3107 _data_->_tmp51_ = _data_->e;
3108 _data_->_tmp52_ = _data_->_tmp51_->message;
3109 g_warning ("tracker-tags-view.vala:796: Could not run Sparql query: %s", _data_->_tmp52_);
3110 _data_->_tmp53_ = NULL;
3111 _data_->_tmp53_ = _ ("Could not update tags for file");
3112 _data_->_tmp54_ = _data_->e;
3113 tracker_tags_view_show_error_dialog (_data_->self, _data_->_tmp53_, _data_->_tmp54_);
3114 _g_error_free0 (_data_->e);
3115 }
3116 __finally21:
3117 if (_data_->_inner_error_ != NULL) {
3118 _g_free0 (_data_->query);
3119 g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
3120 g_clear_error (&_data_->_inner_error_);
3121 return FALSE;
3122 }
3123 _data_->_tmp55_ = _data_->td;
3124 _data_->self->priv->tag_data_requests = g_list_remove (_data_->self->priv->tag_data_requests, _data_->_tmp55_);
3125 _tmp56_ = _tag_data_ref0 (NULL);
3126 _tag_data_unref0 (_data_->td);
3127 _data_->td = _tmp56_;
3128 _g_free0 (_data_->query);
3129 if (_data_->_state_ == 0) {
3130 g_simple_async_result_complete_in_idle (_data_->_async_result);
3131 } else {
3132 g_simple_async_result_complete (_data_->_async_result);
3133 }
3134 g_object_unref (_data_->_async_result);
3135 return FALSE;
3136 }
3137
3138
3139 static gchar* tracker_tags_view_sparql_get_filter_string (TrackerTagsView* self, const gchar* tag) {
3140 gchar* result = NULL;
3141 GList* _tmp0_;
3142 GList* _tmp1_;
3143 guint _tmp2_ = 0U;
3144 gchar* _tmp3_;
3145 gchar* filter;
3146 gboolean _tmp4_ = FALSE;
3147 const gchar* _tmp5_;
3148 gboolean _tmp7_;
3149 gboolean first;
3150 GList* _tmp10_;
3151 gboolean _tmp20_ = FALSE;
3152 const gchar* _tmp21_;
3153 gboolean _tmp23_;
3154 const gchar* _tmp29_;
3155 gchar* _tmp30_;
3156 g_return_val_if_fail (self != NULL, NULL);
3157 _tmp0_ = self->priv->files;
3158 _tmp1_ = self->priv->files;
3159 _tmp2_ = g_list_length (_tmp1_);
3160 g_return_val_if_fail ((_tmp0_ != NULL) && (_tmp2_ > ((guint) 0)), NULL);
3161 _tmp3_ = g_strdup ("FILTER (");
3162 filter = _tmp3_;
3163 _tmp5_ = tag;
3164 if (_tmp5_ != NULL) {
3165 const gchar* _tmp6_;
3166 _tmp6_ = tag;
3167 _tmp4_ = g_strcmp0 (_tmp6_, "") != 0;
3168 } else {
3169 _tmp4_ = FALSE;
3170 }
3171 _tmp7_ = _tmp4_;
3172 if (_tmp7_) {
3173 const gchar* _tmp8_;
3174 gchar* _tmp9_;
3175 _tmp8_ = filter;
3176 _tmp9_ = g_strconcat (_tmp8_, "(", NULL);
3177 _g_free0 (filter);
3178 filter = _tmp9_;
3179 }
3180 first = TRUE;
3181 _tmp10_ = self->priv->files;
3182 {
3183 GList* url_collection = NULL;
3184 GList* url_it = NULL;
3185 url_collection = _tmp10_;
3186 for (url_it = url_collection; url_it != NULL; url_it = url_it->next) {
3187 gchar* _tmp11_;
3188 gchar* url = NULL;
3189 _tmp11_ = g_strdup ((const gchar*) url_it->data);
3190 url = _tmp11_;
3191 {
3192 gboolean _tmp12_;
3193 const gchar* _tmp15_;
3194 const gchar* _tmp16_;
3195 gchar* _tmp17_ = NULL;
3196 gchar* _tmp18_;
3197 gchar* _tmp19_;
3198 _tmp12_ = first;
3199 if (!_tmp12_) {
3200 const gchar* _tmp13_;
3201 gchar* _tmp14_;
3202 _tmp13_ = filter;
3203 _tmp14_ = g_strconcat (_tmp13_, " || ", NULL);
3204 _g_free0 (filter);
3205 filter = _tmp14_;
3206 }
3207 _tmp15_ = filter;
3208 _tmp16_ = url;
3209 _tmp17_ = g_strdup_printf ("?f = \"%s\"", _tmp16_);
3210 _tmp18_ = _tmp17_;
3211 _tmp19_ = g_strconcat (_tmp15_, _tmp18_, NULL);
3212 _g_free0 (filter);
3213 filter = _tmp19_;
3214 _g_free0 (_tmp18_);
3215 first = FALSE;
3216 _g_free0 (url);
3217 }
3218 }
3219 }
3220 _tmp21_ = tag;
3221 if (_tmp21_ != NULL) {
3222 const gchar* _tmp22_;
3223 _tmp22_ = tag;
3224 _tmp20_ = g_strcmp0 (_tmp22_, "") != 0;
3225 } else {
3226 _tmp20_ = FALSE;
3227 }
3228 _tmp23_ = _tmp20_;
3229 if (_tmp23_) {
3230 const gchar* _tmp24_;
3231 const gchar* _tmp25_;
3232 gchar* _tmp26_ = NULL;
3233 gchar* _tmp27_;
3234 gchar* _tmp28_;
3235 _tmp24_ = filter;
3236 _tmp25_ = tag;
3237 _tmp26_ = g_strdup_printf (") && ?t = <%s>", _tmp25_);
3238 _tmp27_ = _tmp26_;
3239 _tmp28_ = g_strconcat (_tmp24_, _tmp27_, NULL);
3240 _g_free0 (filter);
3241 filter = _tmp28_;
3242 _g_free0 (_tmp27_);
3243 }
3244 _tmp29_ = filter;
3245 _tmp30_ = g_strconcat (_tmp29_, ")", NULL);
3246 _g_free0 (filter);
3247 filter = _tmp30_;
3248 result = filter;
3249 return result;
3250 }
3251
3252
3253 static gchar* tracker_tags_view_sparql_get_escaped_string (TrackerTagsView* self, const gchar* str) {
3254 gchar* result = NULL;
3255 const gchar* _tmp0_;
3256 gchar* _tmp1_ = NULL;
3257 gchar* escaped;
3258 gchar* _tmp2_ = NULL;
3259 g_return_val_if_fail (self != NULL, NULL);
3260 g_return_val_if_fail (str != NULL, NULL);
3261 _tmp0_ = str;
3262 _tmp1_ = tracker_sparql_escape_string (_tmp0_);
3263 escaped = _tmp1_;
3264 _tmp2_ = g_strdup_printf ("\"%s\"", escaped);
3265 result = _tmp2_;
3266 _g_free0 (escaped);
3267 return result;
3268 }
3269
3270
3271 static void tracker_tags_view_class_init (TrackerTagsViewClass * klass) {
3272 tracker_tags_view_parent_class = g_type_class_peek_parent (klass);
3273 g_type_class_add_private (klass, sizeof (TrackerTagsViewPrivate));
3274 G_OBJECT_CLASS (klass)->finalize = tracker_tags_view_finalize;
3275 }
3276
3277
3278 static void tracker_tags_view_instance_init (TrackerTagsView * self) {
3279 self->priv = TRACKER_TAGS_VIEW_GET_PRIVATE (self);
3280 }
3281
3282
3283 static void tracker_tags_view_finalize (GObject* obj) {
3284 TrackerTagsView * self;
3285 GCancellable* _tmp0_;
3286 GList* _tmp2_;
3287 GList* _tmp5_;
3288 self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_TRACKER_TAGS_VIEW, TrackerTagsView);
3289 _tmp0_ = self->priv->cancellable;
3290 if (_tmp0_ != NULL) {
3291 GCancellable* _tmp1_;
3292 _tmp1_ = self->priv->cancellable;
3293 g_cancellable_cancel (_tmp1_);
3294 _g_object_unref0 (self->priv->cancellable);
3295 self->priv->cancellable = NULL;
3296 }
3297 _tmp2_ = self->priv->files;
3298 if (_tmp2_ != NULL) {
3299 GList* _tmp3_;
3300 _tmp3_ = self->priv->files;
3301 {
3302 GList* url_collection = NULL;
3303 GList* url_it = NULL;
3304 url_collection = _tmp3_;
3305 for (url_it = url_collection; url_it != NULL; url_it = url_it->next) {
3306 gchar* _tmp4_;
3307 gchar* url = NULL;
3308 _tmp4_ = g_strdup ((const gchar*) url_it->data);
3309 url = _tmp4_;
3310 {
3311 _g_free0 (url);
3312 url = NULL;
3313 _g_free0 (url);
3314 }
3315 }
3316 }
3317 __g_list_free__g_free0_0 (self->priv->files);
3318 self->priv->files = NULL;
3319 }
3320 _tmp5_ = self->priv->tag_data_requests;
3321 if (_tmp5_ != NULL) {
3322 GList* _tmp6_;
3323 _tmp6_ = self->priv->tag_data_requests;
3324 {
3325 GList* td_collection = NULL;
3326 GList* td_it = NULL;
3327 td_collection = _tmp6_;
3328 for (td_it = td_collection; td_it != NULL; td_it = td_it->next) {
3329 TagData* _tmp7_;
3330 TagData* td = NULL;
3331 _tmp7_ = _tag_data_ref0 ((TagData*) td_it->data);
3332 td = _tmp7_;
3333 {
3334 _tag_data_unref0 (td);
3335 td = NULL;
3336 _tag_data_unref0 (td);
3337 }
3338 }
3339 }
3340 __g_list_free__tag_data_unref0_0 (self->priv->tag_data_requests);
3341 self->priv->tag_data_requests = NULL;
3342 }
3343 _g_object_unref0 (self->priv->connection);
3344 _g_object_unref0 (self->priv->cancellable);
3345 __g_list_free__tag_data_unref0_0 (self->priv->tag_data_requests);
3346 __g_list_free__g_free0_0 (self->priv->files);
3347 _g_object_unref0 (self->priv->store);
3348 _g_object_unref0 (self->priv->vbox);
3349 _g_object_unref0 (self->priv->label);
3350 _g_object_unref0 (self->priv->entry);
3351 _g_object_unref0 (self->priv->button_add);
3352 _g_object_unref0 (self->priv->button_remove);
3353 _g_object_unref0 (self->priv->scrolled_window);
3354 _g_object_unref0 (self->priv->view);
3355 G_OBJECT_CLASS (tracker_tags_view_parent_class)->finalize (obj);
3356 }
3357
3358
3359 GType tracker_tags_view_get_type (void) {
3360 static volatile gsize tracker_tags_view_type_id__volatile = 0;
3361 if (g_once_init_enter (&tracker_tags_view_type_id__volatile)) {
3362 static const GTypeInfo g_define_type_info = { sizeof (TrackerTagsViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tracker_tags_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TrackerTagsView), 0, (GInstanceInitFunc) tracker_tags_view_instance_init, NULL };
3363 GType tracker_tags_view_type_id;
3364 tracker_tags_view_type_id = g_type_register_static (GTK_TYPE_VBOX, "TrackerTagsView", &g_define_type_info, 0);
3365 g_once_init_leave (&tracker_tags_view_type_id__volatile, tracker_tags_view_type_id);
3366 }
3367 return tracker_tags_view_type_id__volatile;
3368 }