tracker-0.16.2/src/tracker-needle/tracker-view.c

Location Tool Test ID Function Issue
tracker-view.c:397:3 gcc deprecated-declarations tracker_view_construct 'gtk_scrolled_window_add_with_viewport' is deprecated (declared at /usr/include/gtk-3.0/gtk/gtkscrolledwindow.h:110): Use 'gtk_container_add' instead
tracker-view.c:870:7 gcc unused-but-set-variable tracker_view_background_renderer_func variable '_tmp22__length1' set but not used
tracker-view.c:1312:3 gcc deprecated-declarations tracker_view_file_size_renderer_func 'g_format_size_for_display' is deprecated (declared at /usr/include/glib-2.0/glib/gutils.h:231): Use 'g_format_size' instead
tracker-view.c:1453:4 gcc deprecated-declarations tracker_view_category_detail_renderer_func 'g_format_size_for_display' is deprecated (declared at /usr/include/glib-2.0/glib/gutils.h:231): Use 'g_format_size' instead
tracker-view.c:1766:16 gcc unused-but-set-variable __lambda5_ variable 'self' set but not used
tracker-view.c:1872:10 gcc tracker_view_context_menu_tags_clicked assignment from incompatible pointer type [enabled by default]

Incomplete coverage

Tool Failure ID Location Function Message Data
clang-analyzer no-output-found tracker-view.c Message(text='Unable to locate XML output from invoke-clang-analyzer') None
Failure running clang-analyzer ('no-output-found')
Message
Unable to locate XML output from invoke-clang-analyzer
   1 /* tracker-view.c generated by valac 0.18.1, the Vala compiler
   2  * generated from tracker-view.vala, do not modify */
   3 
   4 /**/
   5 /* Copyright 2010, 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 <glib/gi18n-lib.h>
  27 #include <stdlib.h>
  28 #include <string.h>
  29 #include <pango/pango.h>
  30 #include <float.h>
  31 #include <math.h>
  32 #include <gdk/gdk.h>
  33 
  34 
  35 #define TRACKER_TYPE_VIEW (tracker_view_get_type ())
  36 #define TRACKER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRACKER_TYPE_VIEW, TrackerView))
  37 #define TRACKER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TRACKER_TYPE_VIEW, TrackerViewClass))
  38 #define TRACKER_IS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRACKER_TYPE_VIEW))
  39 #define TRACKER_IS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TRACKER_TYPE_VIEW))
  40 #define TRACKER_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TRACKER_TYPE_VIEW, TrackerViewClass))
  41 
  42 typedef struct _TrackerView TrackerView;
  43 typedef struct _TrackerViewClass TrackerViewClass;
  44 typedef struct _TrackerViewPrivate TrackerViewPrivate;
  45 
  46 #define TRACKER_VIEW_TYPE_DISPLAY (tracker_view_display_get_type ())
  47 
  48 #define TRACKER_TYPE_RESULT_STORE (tracker_result_store_get_type ())
  49 #define TRACKER_RESULT_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRACKER_TYPE_RESULT_STORE, TrackerResultStore))
  50 #define TRACKER_RESULT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TRACKER_TYPE_RESULT_STORE, TrackerResultStoreClass))
  51 #define TRACKER_IS_RESULT_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRACKER_TYPE_RESULT_STORE))
  52 #define TRACKER_IS_RESULT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TRACKER_TYPE_RESULT_STORE))
  53 #define TRACKER_RESULT_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TRACKER_TYPE_RESULT_STORE, TrackerResultStoreClass))
  54 
  55 typedef struct _TrackerResultStore TrackerResultStore;
  56 typedef struct _TrackerResultStoreClass TrackerResultStoreClass;
  57 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
  58 #define _g_free0(var) (var = (g_free (var), NULL))
  59 #define _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)))
  60 
  61 #define TRACKER_QUERY_TYPE_TYPE (tracker_query_type_get_type ())
  62 #define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
  63 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
  64 #define __g_list_free__gtk_tree_path_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__gtk_tree_path_free0_ (var), NULL)))
  65 typedef struct _Block5Data Block5Data;
  66 
  67 #define TYPE_TRACKER_TAGS_VIEW (tracker_tags_view_get_type ())
  68 #define TRACKER_TAGS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TRACKER_TAGS_VIEW, TrackerTagsView))
  69 #define TRACKER_TAGS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TRACKER_TAGS_VIEW, TrackerTagsViewClass))
  70 #define IS_TRACKER_TAGS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TRACKER_TAGS_VIEW))
  71 #define IS_TRACKER_TAGS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TRACKER_TAGS_VIEW))
  72 #define TRACKER_TAGS_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TRACKER_TAGS_VIEW, TrackerTagsViewClass))
  73 
  74 typedef struct _TrackerTagsView TrackerTagsView;
  75 typedef struct _TrackerTagsViewClass TrackerTagsViewClass;
  76 #define __g_list_free__g_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_free0_ (var), NULL)))
  77 
  78 struct _TrackerView {
  79 	GtkScrolledWindow parent_instance;
  80 	TrackerViewPrivate * priv;
  81 };
  82 
  83 struct _TrackerViewClass {
  84 	GtkScrolledWindowClass parent_class;
  85 };
  86 
  87 typedef enum  {
  88 	TRACKER_VIEW_DISPLAY_NO_RESULTS,
  89 	TRACKER_VIEW_DISPLAY_CATEGORIES,
  90 	TRACKER_VIEW_DISPLAY_FILE_LIST,
  91 	TRACKER_VIEW_DISPLAY_FILE_ICONS
  92 } TrackerViewDisplay;
  93 
  94 struct _TrackerViewPrivate {
  95 	TrackerViewDisplay _display;
  96 	TrackerResultStore* _store;
  97 	GtkWidget* view;
  98 	GtkMenu* context_menu;
  99 };
 100 
 101 typedef enum  {
 102 	TRACKER_QUERY_TYPE_ALL,
 103 	TRACKER_QUERY_TYPE_CONTACTS,
 104 	TRACKER_QUERY_TYPE_APPLICATIONS,
 105 	TRACKER_QUERY_TYPE_MUSIC,
 106 	TRACKER_QUERY_TYPE_IMAGES,
 107 	TRACKER_QUERY_TYPE_VIDEOS,
 108 	TRACKER_QUERY_TYPE_DOCUMENTS,
 109 	TRACKER_QUERY_TYPE_MAIL,
 110 	TRACKER_QUERY_TYPE_CALENDAR,
 111 	TRACKER_QUERY_TYPE_FOLDERS,
 112 	TRACKER_QUERY_TYPE_BOOKMARKS
 113 } TrackerQueryType;
 114 
 115 struct _Block5Data {
 116 	int _ref_count_;
 117 	TrackerView * self;
 118 	GtkDialog* dialog;
 119 };
 120 
 121 
 122 static gpointer tracker_view_parent_class = NULL;
 123 
 124 GType tracker_view_get_type (void) G_GNUC_CONST;
 125 GType tracker_view_display_get_type (void) G_GNUC_CONST;
 126 GType tracker_result_store_get_type (void) G_GNUC_CONST;
 127 #define TRACKER_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRACKER_TYPE_VIEW, TrackerViewPrivate))
 128 enum  {
 129 	TRACKER_VIEW_DUMMY_PROPERTY,
 130 	TRACKER_VIEW_DISPLAY,
 131 	TRACKER_VIEW_STORE
 132 };
 133 static void tracker_view_store_row_changed (TrackerView* self, GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter);
 134 static gboolean tracker_view_row_selection_func (TrackerView* self, GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_selected);
 135 static void tracker_view_real_unmap (GtkWidget* base);
 136 TrackerResultStore* tracker_view_get_store (TrackerView* self);
 137 void tracker_result_store_cancel_search (TrackerResultStore* self);
 138 TrackerView* tracker_view_new (TrackerViewDisplay* _display, TrackerResultStore* store);
 139 TrackerView* tracker_view_construct (GType object_type, TrackerViewDisplay* _display, TrackerResultStore* store);
 140 static void tracker_view_set_display (TrackerView* self, TrackerViewDisplay value);
 141 static void _tracker_view_store_row_changed_gtk_tree_model_row_changed (GtkTreeModel* _sender, GtkTreePath* path, GtkTreeIter* iter, gpointer self);
 142 TrackerViewDisplay tracker_view_get_display (TrackerView* self);
 143 static void tracker_view_setup_model (TrackerView* self);
 144 static void tracker_view_setup_menus (TrackerView* self);
 145 static void tracker_view_background_renderer_func (TrackerView* self, GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter);
 146 static void _tracker_view_background_renderer_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self);
 147 static void tracker_view_text_renderer_func (TrackerView* self, GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter);
 148 static void _tracker_view_text_renderer_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self);
 149 static void tracker_view_file_date_renderer_func (TrackerView* self, GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter);
 150 static void _tracker_view_file_date_renderer_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self);
 151 static void tracker_view_file_size_renderer_func (TrackerView* self, GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter);
 152 static void _tracker_view_file_size_renderer_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self);
 153 static gboolean _tracker_view_row_selection_func_gtk_tree_selection_func (GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, gpointer self);
 154 static void tracker_view_category_detail_renderer_func (TrackerView* self, GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter);
 155 static void _tracker_view_category_detail_renderer_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self);
 156 GType tracker_query_type_get_type (void) G_GNUC_CONST;
 157 gchar* tracker_time_format_from_iso8601 (const gchar* s);
 158 gchar* tracker_time_format_from_seconds (const gchar* seconds_str);
 159 static gboolean tracker_view_view_button_press_event (TrackerView* self, GtkWidget* widget, GdkEventButton* event);
 160 static gboolean _tracker_view_view_button_press_event_gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self);
 161 static void tracker_view_context_menu_directory_clicked (TrackerView* self);
 162 static void _tracker_view_context_menu_directory_clicked_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
 163 static void tracker_view_context_menu_tags_clicked (TrackerView* self);
 164 static void _tracker_view_context_menu_tags_clicked_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
 165 static GtkTreePath* tracker_view_get_selected_path (TrackerView* self);
 166 static GtkTreeModel* tracker_view_get_model (TrackerView* self);
 167 static void _gtk_tree_path_free0_ (gpointer var);
 168 static void _g_list_free__gtk_tree_path_free0_ (GList* self);
 169 void tracker_model_launch_selected_parent_dir (GtkTreeModel* model, GtkTreePath* path, gint col);
 170 static Block5Data* block5_data_ref (Block5Data* _data5_);
 171 static void block5_data_unref (void * _userdata_);
 172 static void __lambda5_ (Block5Data* _data5_);
 173 static void ___lambda5__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
 174 TrackerTagsView* tracker_tags_view_new (GList* _files);
 175 TrackerTagsView* tracker_tags_view_construct (GType object_type, GList* _files);
 176 GType tracker_tags_view_get_type (void) G_GNUC_CONST;
 177 static void _g_free0_ (gpointer var);
 178 static void _g_list_free__g_free0_ (GList* self);
 179 void tracker_view_set_store (TrackerView* self, TrackerResultStore* value);
 180 static void tracker_view_finalize (GObject* obj);
 181 static void _vala_tracker_view_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
 182 static void _vala_tracker_view_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
 183 
 184 
 185 GType tracker_view_display_get_type (void) {
 186 	static volatile gsize tracker_view_display_type_id__volatile = 0;
 187 	if (g_once_init_enter (&tracker_view_display_type_id__volatile)) {
 188 		static const GEnumValue values[] = {{TRACKER_VIEW_DISPLAY_NO_RESULTS, "TRACKER_VIEW_DISPLAY_NO_RESULTS", "no-results"}, {TRACKER_VIEW_DISPLAY_CATEGORIES, "TRACKER_VIEW_DISPLAY_CATEGORIES", "categories"}, {TRACKER_VIEW_DISPLAY_FILE_LIST, "TRACKER_VIEW_DISPLAY_FILE_LIST", "file-list"}, {TRACKER_VIEW_DISPLAY_FILE_ICONS, "TRACKER_VIEW_DISPLAY_FILE_ICONS", "file-icons"}, {0, NULL, NULL}};
 189 		GType tracker_view_display_type_id;
 190 		tracker_view_display_type_id = g_enum_register_static ("TrackerViewDisplay", values);
 191 		g_once_init_leave (&tracker_view_display_type_id__volatile, tracker_view_display_type_id);
 192 	}
 193 	return tracker_view_display_type_id__volatile;
 194 }
 195 
 196 
 197 static void tracker_view_store_row_changed (TrackerView* self, GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter) {
 198 	GtkTreeModel* _tmp0_;
 199 	GtkTreeIter _tmp1_;
 200 	gint _tmp2_ = 0;
 201 	gint n_children;
 202 	gint _tmp3_;
 203 	g_return_if_fail (self != NULL);
 204 	g_return_if_fail (model != NULL);
 205 	g_return_if_fail (path != NULL);
 206 	g_return_if_fail (iter != NULL);
 207 	_tmp0_ = model;
 208 	_tmp1_ = *iter;
 209 	_tmp2_ = gtk_tree_model_iter_n_children (_tmp0_, &_tmp1_);
 210 	n_children = _tmp2_;
 211 	_tmp3_ = n_children;
 212 	if (_tmp3_ > 0) {
 213 		GtkWidget* _tmp4_;
 214 		GtkTreePath* _tmp5_;
 215 		_tmp4_ = self->priv->view;
 216 		_tmp5_ = path;
 217 		gtk_tree_view_expand_row (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GTK_TYPE_TREE_VIEW, GtkTreeView), _tmp5_, FALSE);
 218 	}
 219 }
 220 
 221 
 222 static gboolean tracker_view_row_selection_func (TrackerView* self, GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_selected) {
 223 	gboolean result = FALSE;
 224 	GtkTreePath* _tmp0_;
 225 	gint _tmp1_ = 0;
 226 	g_return_val_if_fail (self != NULL, FALSE);
 227 	g_return_val_if_fail (selection != NULL, FALSE);
 228 	g_return_val_if_fail (model != NULL, FALSE);
 229 	g_return_val_if_fail (path != NULL, FALSE);
 230 	_tmp0_ = path;
 231 	_tmp1_ = gtk_tree_path_get_depth (_tmp0_);
 232 	if (_tmp1_ == 1) {
 233 		result = FALSE;
 234 		return result;
 235 	}
 236 	result = TRUE;
 237 	return result;
 238 }
 239 
 240 
 241 static void tracker_view_real_unmap (GtkWidget* base) {
 242 	TrackerView * self;
 243 	TrackerResultStore* _tmp0_;
 244 	TrackerResultStore* _tmp1_;
 245 	self = (TrackerView*) base;
 246 	_tmp0_ = tracker_view_get_store (self);
 247 	_tmp1_ = _tmp0_;
 248 	if (_tmp1_ != NULL) {
 249 		TrackerResultStore* _tmp2_;
 250 		TrackerResultStore* _tmp3_;
 251 		_tmp2_ = tracker_view_get_store (self);
 252 		_tmp3_ = _tmp2_;
 253 		tracker_result_store_cancel_search (_tmp3_);
 254 	}
 255 	GTK_WIDGET_CLASS (tracker_view_parent_class)->unmap ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, GTK_TYPE_SCROLLED_WINDOW, GtkScrolledWindow));
 256 }
 257 
 258 
 259 static gpointer _g_object_ref0 (gpointer self) {
 260 	return self ? g_object_ref (self) : NULL;
 261 }
 262 
 263 
 264 static void _tracker_view_store_row_changed_gtk_tree_model_row_changed (GtkTreeModel* _sender, GtkTreePath* path, GtkTreeIter* iter, gpointer self) {
 265 	tracker_view_store_row_changed (self, _sender, path, iter);
 266 }
 267 
 268 
 269 static const gchar* string_to_string (const gchar* self) {
 270 	const gchar* result = NULL;
 271 	g_return_val_if_fail (self != NULL, NULL);
 272 	result = self;
 273 	return result;
 274 }
 275 
 276 
 277 TrackerView* tracker_view_construct (GType object_type, TrackerViewDisplay* _display, TrackerResultStore* store) {
 278 	TrackerView * self = NULL;
 279 	TrackerViewDisplay* _tmp0_;
 280 	TrackerResultStore* _tmp1_;
 281 	TrackerViewDisplay _tmp6_;
 282 	TrackerViewDisplay _tmp29_;
 283 	self = (TrackerView*) g_object_new (object_type, NULL);
 284 	gtk_scrolled_window_set_policy ((GtkScrolledWindow*) self, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
 285 	_tmp0_ = _display;
 286 	tracker_view_set_display (self, *_tmp0_);
 287 	_tmp1_ = store;
 288 	if (_tmp1_ != NULL) {
 289 		TrackerResultStore* _tmp2_;
 290 		TrackerResultStore* _tmp3_;
 291 		TrackerResultStore* _tmp4_;
 292 		TrackerResultStore* _tmp5_;
 293 		_tmp2_ = store;
 294 		_tmp3_ = _g_object_ref0 (_tmp2_);
 295 		_g_object_unref0 (self->priv->_store);
 296 		self->priv->_store = _tmp3_;
 297 		_tmp4_ = store;
 298 		g_signal_connect_object ((GtkTreeModel*) _tmp4_, "row-changed", (GCallback) _tracker_view_store_row_changed_gtk_tree_model_row_changed, self, 0);
 299 		_tmp5_ = store;
 300 		g_debug ("tracker-view.vala:101: using store:%p", _tmp5_);
 301 	}
 302 	_tmp6_ = self->priv->_display;
 303 	switch (_tmp6_) {
 304 		case TRACKER_VIEW_DISPLAY_NO_RESULTS:
 305 		{
 306 			GtkLabel* l = NULL;
 307 			GtkLabel* _tmp7_;
 308 			GtkLabel* _tmp8_;
 309 			const gchar* _tmp9_ = NULL;
 310 			gchar* _tmp10_;
 311 			gchar* results;
 312 			const gchar* _tmp11_ = NULL;
 313 			gchar* _tmp12_;
 314 			gchar* help_views;
 315 			const gchar* _tmp13_ = NULL;
 316 			gchar* _tmp14_;
 317 			gchar* help_search;
 318 			const gchar* _tmp15_;
 319 			const gchar* _tmp16_ = NULL;
 320 			const gchar* _tmp17_;
 321 			const gchar* _tmp18_ = NULL;
 322 			const gchar* _tmp19_;
 323 			const gchar* _tmp20_ = NULL;
 324 			gchar* _tmp21_ = NULL;
 325 			gchar* markup;
 326 			GtkLabel* _tmp22_;
 327 			GtkLabel* _tmp23_;
 328 			const gchar* _tmp24_;
 329 			GtkLabel* _tmp25_;
 330 			GtkWidget* _tmp26_;
 331 			_tmp7_ = (GtkLabel*) gtk_label_new ("");
 332 			g_object_ref_sink (_tmp7_);
 333 			_g_object_unref0 (l);
 334 			l = _tmp7_;
 335 			_tmp8_ = l;
 336 			gtk_label_set_justify (_tmp8_, GTK_JUSTIFY_CENTER);
 337 			_tmp9_ = _ ("No Search Results");
 338 			_tmp10_ = g_strdup (_tmp9_);
 339 			results = _tmp10_;
 340 			_tmp11_ = _ ("Select the view on the toolbar for the content you want, e.g. everythi" \
 341 "ng, files or just images");
 342 			_tmp12_ = g_strdup (_tmp11_);
 343 			help_views = _tmp12_;
 344 			_tmp13_ = _ ("Start to search using the entry box above");
 345 			_tmp14_ = g_strdup (_tmp13_);
 346 			help_search = _tmp14_;
 347 			_tmp15_ = results;
 348 			_tmp16_ = string_to_string (_tmp15_);
 349 			_tmp17_ = help_views;
 350 			_tmp18_ = string_to_string (_tmp17_);
 351 			_tmp19_ = help_search;
 352 			_tmp20_ = string_to_string (_tmp19_);
 353 			_tmp21_ = g_strconcat ("<big>", _tmp16_, "</big>\n\n", _tmp18_, "\n\n", _tmp20_, NULL);
 354 			markup = _tmp21_;
 355 			_tmp22_ = l;
 356 			gtk_label_set_use_markup (_tmp22_, TRUE);
 357 			_tmp23_ = l;
 358 			_tmp24_ = markup;
 359 			gtk_label_set_markup (_tmp23_, _tmp24_);
 360 			_tmp25_ = l;
 361 			_tmp26_ = _g_object_ref0 ((GtkWidget*) _tmp25_);
 362 			_g_object_unref0 (self->priv->view);
 363 			self->priv->view = _tmp26_;
 364 			_g_free0 (markup);
 365 			_g_free0 (help_search);
 366 			_g_free0 (help_views);
 367 			_g_free0 (results);
 368 			_g_object_unref0 (l);
 369 			break;
 370 		}
 371 		case TRACKER_VIEW_DISPLAY_CATEGORIES:
 372 		case TRACKER_VIEW_DISPLAY_FILE_LIST:
 373 		{
 374 			GtkTreeView* _tmp27_;
 375 			_tmp27_ = (GtkTreeView*) gtk_tree_view_new ();
 376 			g_object_ref_sink (_tmp27_);
 377 			_g_object_unref0 (self->priv->view);
 378 			self->priv->view = (GtkWidget*) _tmp27_;
 379 			break;
 380 		}
 381 		case TRACKER_VIEW_DISPLAY_FILE_ICONS:
 382 		{
 383 			GtkIconView* _tmp28_;
 384 			_tmp28_ = (GtkIconView*) gtk_icon_view_new ();
 385 			g_object_ref_sink (_tmp28_);
 386 			_g_object_unref0 (self->priv->view);
 387 			self->priv->view = (GtkWidget*) _tmp28_;
 388 			break;
 389 		}
 390 		default:
 391 		break;
 392 	}
 393 	_tmp29_ = self->priv->_display;
 394 	if (_tmp29_ == TRACKER_VIEW_DISPLAY_NO_RESULTS) {
 395 		GtkWidget* _tmp30_;
 396 		_tmp30_ = self->priv->view;
 397 		gtk_scrolled_window_add_with_viewport ((GtkScrolledWindow*) self, _tmp30_);
'gtk_scrolled_window_add_with_viewport' is deprecated (declared at /usr/include/gtk-3.0/gtk/gtkscrolledwindow.h:110): Use 'gtk_container_add' instead
(emitted by gcc)
398 } else { 399 GtkWidget* _tmp31_; 400 _tmp31_ = self->priv->view; 401 gtk_container_add ((GtkContainer*) self, _tmp31_); 402 tracker_view_setup_model (self); 403 tracker_view_setup_menus (self); 404 } 405 GTK_WIDGET_CLASS (tracker_view_parent_class)->show_all ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, GTK_TYPE_SCROLLED_WINDOW, GtkScrolledWindow)); 406 return self; 407 } 408 409 410 TrackerView* tracker_view_new (TrackerViewDisplay* _display, TrackerResultStore* store) { 411 return tracker_view_construct (TRACKER_TYPE_VIEW, _display, store); 412 } 413 414 415 static void _tracker_view_background_renderer_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self) { 416 tracker_view_background_renderer_func (self, cell_layout, cell, tree_model, iter); 417 } 418 419 420 static void _tracker_view_text_renderer_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self) { 421 tracker_view_text_renderer_func (self, cell_layout, cell, tree_model, iter); 422 } 423 424 425 static void _tracker_view_file_date_renderer_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self) { 426 tracker_view_file_date_renderer_func (self, cell_layout, cell, tree_model, iter); 427 } 428 429 430 static void _tracker_view_file_size_renderer_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self) { 431 tracker_view_file_size_renderer_func (self, cell_layout, cell, tree_model, iter); 432 } 433 434 435 static gboolean _tracker_view_row_selection_func_gtk_tree_selection_func (GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, gpointer self) { 436 gboolean result; 437 result = tracker_view_row_selection_func (self, selection, model, path, path_currently_selected); 438 return result; 439 } 440 441 442 static void _tracker_view_category_detail_renderer_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self) { 443 tracker_view_category_detail_renderer_func (self, cell_layout, cell, tree_model, iter); 444 } 445 446 447 static void tracker_view_setup_model (TrackerView* self) { 448 TrackerViewDisplay _tmp0_; 449 g_return_if_fail (self != NULL); 450 _tmp0_ = self->priv->_display; 451 switch (_tmp0_) { 452 case TRACKER_VIEW_DISPLAY_FILE_ICONS: 453 { 454 { 455 GtkWidget* _tmp1_; 456 GtkIconView* _tmp2_; 457 GtkIconView* iv; 458 GtkIconView* _tmp3_; 459 TrackerResultStore* _tmp4_; 460 TrackerResultStore* _tmp5_; 461 GtkIconView* _tmp6_; 462 GtkIconView* _tmp7_; 463 GtkIconView* _tmp8_; 464 GtkIconView* _tmp9_; 465 GtkIconView* _tmp10_; 466 GtkIconView* _tmp11_; 467 GtkIconView* _tmp12_; 468 GtkIconView* _tmp13_; 469 _tmp1_ = self->priv->view; 470 _tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GTK_TYPE_ICON_VIEW, GtkIconView)); 471 iv = _tmp2_; 472 _tmp3_ = iv; 473 _tmp4_ = tracker_view_get_store (self); 474 _tmp5_ = _tmp4_; 475 gtk_icon_view_set_model (_tmp3_, (GtkTreeModel*) _tmp5_); 476 _tmp6_ = iv; 477 gtk_icon_view_set_item_width (_tmp6_, 128); 478 _tmp7_ = iv; 479 gtk_icon_view_set_item_padding (_tmp7_, 1); 480 _tmp8_ = iv; 481 gtk_icon_view_set_row_spacing (_tmp8_, 2); 482 _tmp9_ = iv; 483 gtk_icon_view_set_column_spacing (_tmp9_, 2); 484 _tmp10_ = iv; 485 gtk_icon_view_set_selection_mode (_tmp10_, GTK_SELECTION_SINGLE); 486 _tmp11_ = iv; 487 gtk_icon_view_set_pixbuf_column (_tmp11_, 6); 488 _tmp12_ = iv; 489 gtk_icon_view_set_text_column (_tmp12_, -1); 490 _tmp13_ = iv; 491 gtk_icon_view_set_tooltip_column (_tmp13_, 5); 492 _g_object_unref0 (iv); 493 break; 494 } 495 } 496 case TRACKER_VIEW_DISPLAY_FILE_LIST: 497 { 498 { 499 GtkTreeViewColumn* col = NULL; 500 GtkWidget* _tmp14_; 501 GtkTreeView* _tmp15_; 502 GtkTreeView* tv; 503 GtkTreeView* _tmp16_; 504 TrackerResultStore* _tmp17_; 505 TrackerResultStore* _tmp18_; 506 GtkTreeView* _tmp19_; 507 GtkTreeView* _tmp20_; 508 GtkTreeView* _tmp21_; 509 GtkTreeView* _tmp22_; 510 GtkCellRendererPixbuf* _tmp23_; 511 GtkCellRendererPixbuf* renderer1; 512 GtkCellRendererText* _tmp24_; 513 GtkCellRendererText* renderer2; 514 GtkTreeViewColumn* _tmp25_; 515 GtkTreeViewColumn* _tmp26_; 516 GtkTreeViewColumn* _tmp27_; 517 GtkCellRendererPixbuf* _tmp28_; 518 GtkTreeViewColumn* _tmp29_; 519 GtkCellRendererPixbuf* _tmp30_; 520 GtkCellRendererPixbuf* _tmp31_; 521 GtkCellRendererPixbuf* _tmp32_; 522 GtkTreeViewColumn* _tmp33_; 523 GtkCellRendererText* _tmp34_; 524 GtkCellRendererText* _tmp35_; 525 GtkCellRendererText* _tmp36_; 526 GtkTreeViewColumn* _tmp37_; 527 const gchar* _tmp38_ = NULL; 528 GtkTreeViewColumn* _tmp39_; 529 GtkTreeViewColumn* _tmp40_; 530 GtkTreeViewColumn* _tmp41_; 531 GtkCellRendererPixbuf* _tmp42_; 532 GtkTreeViewColumn* _tmp43_; 533 GtkCellRendererText* _tmp44_; 534 GtkTreeView* _tmp45_; 535 GtkTreeViewColumn* _tmp46_; 536 GtkCellRendererText* _tmp47_; 537 GtkCellRendererText* renderer3; 538 GtkCellRendererText* _tmp48_; 539 GtkTreeViewColumn* _tmp49_; 540 GtkTreeViewColumn* _tmp50_; 541 GtkTreeViewColumn* _tmp51_; 542 GtkCellRendererText* _tmp52_; 543 GtkTreeViewColumn* _tmp53_; 544 const gchar* _tmp54_ = NULL; 545 GtkTreeViewColumn* _tmp55_; 546 GtkCellRendererText* _tmp56_; 547 GtkTreeView* _tmp57_; 548 GtkTreeViewColumn* _tmp58_; 549 GtkCellRendererText* _tmp59_; 550 GtkCellRendererText* renderer4; 551 GtkCellRendererText* _tmp60_; 552 GtkTreeViewColumn* _tmp61_; 553 GtkTreeViewColumn* _tmp62_; 554 GtkTreeViewColumn* _tmp63_; 555 GtkCellRendererText* _tmp64_; 556 GtkTreeViewColumn* _tmp65_; 557 const gchar* _tmp66_ = NULL; 558 GtkTreeViewColumn* _tmp67_; 559 GtkCellRendererText* _tmp68_; 560 GtkTreeView* _tmp69_; 561 GtkTreeViewColumn* _tmp70_; 562 _tmp14_ = self->priv->view; 563 _tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, GTK_TYPE_TREE_VIEW, GtkTreeView)); 564 tv = _tmp15_; 565 _tmp16_ = tv; 566 _tmp17_ = tracker_view_get_store (self); 567 _tmp18_ = _tmp17_; 568 gtk_tree_view_set_model (_tmp16_, (GtkTreeModel*) _tmp18_); 569 _tmp19_ = tv; 570 gtk_tree_view_set_tooltip_column (_tmp19_, 6); 571 _tmp20_ = tv; 572 gtk_tree_view_set_rules_hint (_tmp20_, FALSE); 573 _tmp21_ = tv; 574 gtk_tree_view_set_grid_lines (_tmp21_, GTK_TREE_VIEW_GRID_LINES_VERTICAL); 575 _tmp22_ = tv; 576 gtk_tree_view_set_headers_visible (_tmp22_, TRUE); 577 _tmp23_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new (); 578 g_object_ref_sink (_tmp23_); 579 renderer1 = _tmp23_; 580 _tmp24_ = (GtkCellRendererText*) gtk_cell_renderer_text_new (); 581 g_object_ref_sink (_tmp24_); 582 renderer2 = _tmp24_; 583 _tmp25_ = gtk_tree_view_column_new (); 584 g_object_ref_sink (_tmp25_); 585 _g_object_unref0 (col); 586 col = _tmp25_; 587 _tmp26_ = col; 588 gtk_tree_view_column_set_sizing (_tmp26_, GTK_TREE_VIEW_COLUMN_AUTOSIZE); 589 _tmp27_ = col; 590 _tmp28_ = renderer1; 591 gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp27_, (GtkCellRenderer*) _tmp28_, FALSE); 592 _tmp29_ = col; 593 _tmp30_ = renderer1; 594 gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp29_, (GtkCellRenderer*) _tmp30_, "pixbuf", 7); 595 _tmp31_ = renderer1; 596 g_object_set ((GtkCellRenderer*) _tmp31_, "xpad", (guint) 5, NULL); 597 _tmp32_ = renderer1; 598 g_object_set ((GtkCellRenderer*) _tmp32_, "ypad", (guint) 5, NULL); 599 _tmp33_ = col; 600 _tmp34_ = renderer2; 601 gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp33_, (GtkCellRenderer*) _tmp34_, TRUE); 602 _tmp35_ = renderer2; 603 gtk_cell_renderer_text_set_fixed_height_from_font (_tmp35_, 2); 604 _tmp36_ = renderer2; 605 g_object_set (_tmp36_, "ellipsize", PANGO_ELLIPSIZE_MIDDLE, NULL); 606 _tmp37_ = col; 607 _tmp38_ = _ ("File"); 608 gtk_tree_view_column_set_title (_tmp37_, _tmp38_); 609 _tmp39_ = col; 610 gtk_tree_view_column_set_resizable (_tmp39_, TRUE); 611 _tmp40_ = col; 612 gtk_tree_view_column_set_expand (_tmp40_, TRUE); 613 _tmp41_ = col; 614 _tmp42_ = renderer1; 615 gtk_cell_layout_set_cell_data_func ((GtkCellLayout*) _tmp41_, (GtkCellRenderer*) _tmp42_, _tracker_view_background_renderer_func_gtk_cell_layout_data_func, g_object_ref (self), g_object_unref); 616 _tmp43_ = col; 617 _tmp44_ = renderer2; 618 gtk_cell_layout_set_cell_data_func ((GtkCellLayout*) _tmp43_, (GtkCellRenderer*) _tmp44_, _tracker_view_text_renderer_func_gtk_cell_layout_data_func, g_object_ref (self), g_object_unref); 619 _tmp45_ = tv; 620 _tmp46_ = col; 621 gtk_tree_view_append_column (_tmp45_, _tmp46_); 622 _tmp47_ = (GtkCellRendererText*) gtk_cell_renderer_text_new (); 623 g_object_ref_sink (_tmp47_); 624 renderer3 = _tmp47_; 625 _tmp48_ = renderer3; 626 gtk_cell_renderer_text_set_fixed_height_from_font (_tmp48_, 2); 627 _tmp49_ = gtk_tree_view_column_new (); 628 g_object_ref_sink (_tmp49_); 629 _g_object_unref0 (col); 630 col = _tmp49_; 631 _tmp50_ = col; 632 gtk_tree_view_column_set_sizing (_tmp50_, GTK_TREE_VIEW_COLUMN_AUTOSIZE); 633 _tmp51_ = col; 634 _tmp52_ = renderer3; 635 gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp51_, (GtkCellRenderer*) _tmp52_, TRUE); 636 _tmp53_ = col; 637 _tmp54_ = _ ("Last Changed"); 638 gtk_tree_view_column_set_title (_tmp53_, _tmp54_); 639 _tmp55_ = col; 640 _tmp56_ = renderer3; 641 gtk_cell_layout_set_cell_data_func ((GtkCellLayout*) _tmp55_, (GtkCellRenderer*) _tmp56_, _tracker_view_file_date_renderer_func_gtk_cell_layout_data_func, g_object_ref (self), g_object_unref); 642 _tmp57_ = tv; 643 _tmp58_ = col; 644 gtk_tree_view_append_column (_tmp57_, _tmp58_); 645 _tmp59_ = (GtkCellRendererText*) gtk_cell_renderer_text_new (); 646 g_object_ref_sink (_tmp59_); 647 renderer4 = _tmp59_; 648 _tmp60_ = renderer4; 649 gtk_cell_renderer_text_set_fixed_height_from_font (_tmp60_, 2); 650 _tmp61_ = gtk_tree_view_column_new (); 651 g_object_ref_sink (_tmp61_); 652 _g_object_unref0 (col); 653 col = _tmp61_; 654 _tmp62_ = col; 655 gtk_tree_view_column_set_sizing (_tmp62_, GTK_TREE_VIEW_COLUMN_AUTOSIZE); 656 _tmp63_ = col; 657 _tmp64_ = renderer4; 658 gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp63_, (GtkCellRenderer*) _tmp64_, TRUE); 659 _tmp65_ = col; 660 _tmp66_ = _ ("Size"); 661 gtk_tree_view_column_set_title (_tmp65_, _tmp66_); 662 _tmp67_ = col; 663 _tmp68_ = renderer4; 664 gtk_cell_layout_set_cell_data_func ((GtkCellLayout*) _tmp67_, (GtkCellRenderer*) _tmp68_, _tracker_view_file_size_renderer_func_gtk_cell_layout_data_func, g_object_ref (self), g_object_unref); 665 _tmp69_ = tv; 666 _tmp70_ = col; 667 gtk_tree_view_append_column (_tmp69_, _tmp70_); 668 _g_object_unref0 (renderer4); 669 _g_object_unref0 (renderer3); 670 _g_object_unref0 (renderer2); 671 _g_object_unref0 (renderer1); 672 _g_object_unref0 (tv); 673 _g_object_unref0 (col); 674 break; 675 } 676 } 677 case TRACKER_VIEW_DISPLAY_CATEGORIES: 678 { 679 { 680 GtkTreeViewColumn* col = NULL; 681 GtkWidget* _tmp71_; 682 GtkTreeView* _tmp72_; 683 GtkTreeView* tv; 684 GtkTreeSelection* selection = NULL; 685 GtkTreeView* _tmp73_; 686 TrackerResultStore* _tmp74_; 687 TrackerResultStore* _tmp75_; 688 GtkTreeView* _tmp76_; 689 GtkTreeView* _tmp77_; 690 GtkTreeView* _tmp78_; 691 GtkTreeView* _tmp79_; 692 GtkTreeView* _tmp80_; 693 GtkTreeView* _tmp81_; 694 GtkTreeSelection* _tmp82_ = NULL; 695 GtkTreeSelection* _tmp83_; 696 GtkTreeSelection* _tmp84_; 697 GtkTreeViewColumn* _tmp85_; 698 GtkTreeViewColumn* _tmp86_; 699 GtkTreeViewColumn* _tmp87_; 700 GtkCellRendererPixbuf* _tmp88_; 701 GtkCellRendererPixbuf* renderer1; 702 GtkTreeViewColumn* _tmp89_; 703 GtkCellRendererPixbuf* _tmp90_; 704 GtkTreeViewColumn* _tmp91_; 705 GtkCellRendererPixbuf* _tmp92_; 706 GtkTreeViewColumn* _tmp93_; 707 GtkCellRendererPixbuf* _tmp94_; 708 GtkCellRendererPixbuf* _tmp95_; 709 GtkCellRendererPixbuf* _tmp96_; 710 GtkCellRendererText* _tmp97_; 711 GtkCellRendererText* renderer2; 712 GtkTreeViewColumn* _tmp98_; 713 GtkCellRendererText* _tmp99_; 714 GtkTreeViewColumn* _tmp100_; 715 GtkCellRendererText* _tmp101_; 716 GtkCellRendererText* _tmp102_; 717 GtkCellRendererText* _tmp103_; 718 GtkTreeView* _tmp104_; 719 GtkTreeViewColumn* _tmp105_; 720 GtkCellRendererText* _tmp106_; 721 GtkCellRendererText* renderer4; 722 GtkCellRendererText* _tmp107_; 723 GtkCellRendererText* _tmp108_; 724 GtkCellRendererText* _tmp109_; 725 GtkTreeViewColumn* _tmp110_; 726 GtkTreeViewColumn* _tmp111_; 727 GtkTreeViewColumn* _tmp112_; 728 GtkTreeViewColumn* _tmp113_; 729 GtkCellRendererText* _tmp114_; 730 GtkTreeViewColumn* _tmp115_; 731 GtkCellRendererText* _tmp116_; 732 GtkTreeView* _tmp117_; 733 GtkTreeViewColumn* _tmp118_; 734 _tmp71_ = self->priv->view; 735 _tmp72_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp71_, GTK_TYPE_TREE_VIEW, GtkTreeView)); 736 tv = _tmp72_; 737 _tmp73_ = tv; 738 _tmp74_ = tracker_view_get_store (self); 739 _tmp75_ = _tmp74_; 740 gtk_tree_view_set_model (_tmp73_, (GtkTreeModel*) _tmp75_); 741 _tmp76_ = tv; 742 gtk_tree_view_set_tooltip_column (_tmp76_, 5); 743 _tmp77_ = tv; 744 gtk_tree_view_set_rules_hint (_tmp77_, FALSE); 745 _tmp78_ = tv; 746 gtk_tree_view_set_grid_lines (_tmp78_, GTK_TREE_VIEW_GRID_LINES_NONE); 747 _tmp79_ = tv; 748 gtk_tree_view_set_headers_visible (_tmp79_, FALSE); 749 _tmp80_ = tv; 750 gtk_tree_view_set_show_expanders (_tmp80_, FALSE); 751 _tmp81_ = tv; 752 _tmp82_ = gtk_tree_view_get_selection (_tmp81_); 753 _tmp83_ = _g_object_ref0 (_tmp82_); 754 _g_object_unref0 (selection); 755 selection = _tmp83_; 756 _tmp84_ = selection; 757 gtk_tree_selection_set_select_function (_tmp84_, _tracker_view_row_selection_func_gtk_tree_selection_func, g_object_ref (self), g_object_unref); 758 _tmp85_ = gtk_tree_view_column_new (); 759 g_object_ref_sink (_tmp85_); 760 _g_object_unref0 (col); 761 col = _tmp85_; 762 _tmp86_ = col; 763 gtk_tree_view_column_set_sizing (_tmp86_, GTK_TREE_VIEW_COLUMN_FIXED); 764 _tmp87_ = col; 765 gtk_tree_view_column_set_expand (_tmp87_, TRUE); 766 _tmp88_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new (); 767 g_object_ref_sink (_tmp88_); 768 renderer1 = _tmp88_; 769 _tmp89_ = col; 770 _tmp90_ = renderer1; 771 gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp89_, (GtkCellRenderer*) _tmp90_, FALSE); 772 _tmp91_ = col; 773 _tmp92_ = renderer1; 774 gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp91_, (GtkCellRenderer*) _tmp92_, "pixbuf", 6); 775 _tmp93_ = col; 776 _tmp94_ = renderer1; 777 gtk_cell_layout_set_cell_data_func ((GtkCellLayout*) _tmp93_, (GtkCellRenderer*) _tmp94_, _tracker_view_background_renderer_func_gtk_cell_layout_data_func, g_object_ref (self), g_object_unref); 778 _tmp95_ = renderer1; 779 g_object_set ((GtkCellRenderer*) _tmp95_, "xpad", (guint) 5, NULL); 780 _tmp96_ = renderer1; 781 g_object_set ((GtkCellRenderer*) _tmp96_, "ypad", (guint) 5, NULL); 782 _tmp97_ = (GtkCellRendererText*) gtk_cell_renderer_text_new (); 783 g_object_ref_sink (_tmp97_); 784 renderer2 = _tmp97_; 785 _tmp98_ = col; 786 _tmp99_ = renderer2; 787 gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp98_, (GtkCellRenderer*) _tmp99_, TRUE); 788 _tmp100_ = col; 789 _tmp101_ = renderer2; 790 gtk_cell_layout_set_cell_data_func ((GtkCellLayout*) _tmp100_, (GtkCellRenderer*) _tmp101_, _tracker_view_text_renderer_func_gtk_cell_layout_data_func, g_object_ref (self), g_object_unref); 791 _tmp102_ = renderer2; 792 gtk_cell_renderer_text_set_fixed_height_from_font (_tmp102_, 2); 793 _tmp103_ = renderer2; 794 g_object_set (_tmp103_, "ellipsize", PANGO_ELLIPSIZE_MIDDLE, NULL); 795 _tmp104_ = tv; 796 _tmp105_ = col; 797 gtk_tree_view_append_column (_tmp104_, _tmp105_); 798 _tmp106_ = (GtkCellRendererText*) gtk_cell_renderer_text_new (); 799 g_object_ref_sink (_tmp106_); 800 renderer4 = _tmp106_; 801 _tmp107_ = renderer4; 802 gtk_cell_renderer_text_set_fixed_height_from_font (_tmp107_, 2); 803 _tmp108_ = renderer4; 804 g_object_set (_tmp108_, "alignment", PANGO_ALIGN_RIGHT, NULL); 805 _tmp109_ = renderer4; 806 g_object_set ((GtkCellRenderer*) _tmp109_, "xalign", (gfloat) 1, NULL); 807 _tmp110_ = gtk_tree_view_column_new (); 808 g_object_ref_sink (_tmp110_); 809 _g_object_unref0 (col); 810 col = _tmp110_; 811 _tmp111_ = col; 812 gtk_tree_view_column_set_min_width (_tmp111_, 80); 813 _tmp112_ = col; 814 gtk_tree_view_column_set_sizing (_tmp112_, GTK_TREE_VIEW_COLUMN_FIXED); 815 _tmp113_ = col; 816 _tmp114_ = renderer4; 817 gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp113_, (GtkCellRenderer*) _tmp114_, TRUE); 818 _tmp115_ = col; 819 _tmp116_ = renderer4; 820 gtk_cell_layout_set_cell_data_func ((GtkCellLayout*) _tmp115_, (GtkCellRenderer*) _tmp116_, _tracker_view_category_detail_renderer_func_gtk_cell_layout_data_func, g_object_ref (self), g_object_unref); 821 _tmp117_ = tv; 822 _tmp118_ = col; 823 gtk_tree_view_append_column (_tmp117_, _tmp118_); 824 _g_object_unref0 (renderer4); 825 _g_object_unref0 (renderer2); 826 _g_object_unref0 (renderer1); 827 _g_object_unref0 (selection); 828 _g_object_unref0 (tv); 829 _g_object_unref0 (col); 830 break; 831 } 832 } 833 default: 834 break; 835 } 836 } 837 838 839 static void tracker_view_background_renderer_func (TrackerView* self, GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter) { 840 GdkColor color = {0}; 841 GtkStyle* style = NULL; 842 GtkTreePath* path = NULL; 843 GtkWidget* _tmp0_; 844 GtkStyle* _tmp1_ = NULL; 845 GtkStyle* _tmp2_; 846 GtkStyle* _tmp3_; 847 GdkColor* _tmp4_; 848 gint _tmp4__length1; 849 GdkColor _tmp5_; 850 GdkColor _tmp6_; 851 guint16 _tmp7_; 852 GdkColor _tmp8_; 853 guint16 _tmp9_; 854 GdkColor _tmp10_; 855 guint16 _tmp11_; 856 gint sum_normal; 857 GtkStyle* _tmp12_; 858 GdkColor* _tmp13_; 859 gint _tmp13__length1; 860 GdkColor _tmp14_; 861 GdkColor _tmp15_; 862 guint16 _tmp16_; 863 GdkColor _tmp17_; 864 guint16 _tmp18_; 865 GdkColor _tmp19_; 866 guint16 _tmp20_; 867 gint sum_selected; 868 GtkStyle* _tmp21_; 869 GdkColor* _tmp22_; 870 gint _tmp22__length1;
variable '_tmp22__length1' set but not used
(emitted by gcc)
871 GdkColor _tmp23_; 872 gint _tmp24_; 873 gint _tmp25_; 874 GtkTreeModel* _tmp56_; 875 GtkTreeIter _tmp57_; 876 GtkTreePath* _tmp58_ = NULL; 877 GtkTreePath* _tmp59_; 878 gint _tmp60_ = 0; 879 gint* _tmp61_ = NULL; 880 gint _tmp62_; 881 g_return_if_fail (self != NULL); 882 g_return_if_fail (cell_layout != NULL); 883 g_return_if_fail (cell != NULL); 884 g_return_if_fail (tree_model != NULL); 885 g_return_if_fail (iter != NULL); 886 _tmp0_ = self->priv->view; 887 _tmp1_ = gtk_widget_get_style (_tmp0_); 888 _tmp2_ = _g_object_ref0 (_tmp1_); 889 _g_object_unref0 (style); 890 style = _tmp2_; 891 _tmp3_ = style; 892 _tmp4_ = _tmp3_->base; 893 _tmp4__length1 = -1; 894 _tmp5_ = _tmp4_[GTK_STATE_SELECTED]; 895 color = _tmp5_; 896 _tmp6_ = color; 897 _tmp7_ = _tmp6_.red; 898 _tmp8_ = color; 899 _tmp9_ = _tmp8_.green; 900 _tmp10_ = color; 901 _tmp11_ = _tmp10_.blue; 902 sum_normal = (gint) ((_tmp7_ + _tmp9_) + _tmp11_); 903 _tmp12_ = style; 904 _tmp13_ = _tmp12_->base; 905 _tmp13__length1 = -1; 906 _tmp14_ = _tmp13_[GTK_STATE_NORMAL]; 907 color = _tmp14_; 908 _tmp15_ = color; 909 _tmp16_ = _tmp15_.red; 910 _tmp17_ = color; 911 _tmp18_ = _tmp17_.green; 912 _tmp19_ = color; 913 _tmp20_ = _tmp19_.blue; 914 sum_selected = (gint) ((_tmp16_ + _tmp18_) + _tmp20_); 915 _tmp21_ = style; 916 _tmp22_ = _tmp21_->text_aa; 917 _tmp22__length1 = -1; 918 _tmp23_ = _tmp22_[GTK_STATE_INSENSITIVE]; 919 color = _tmp23_; 920 _tmp24_ = sum_normal; 921 _tmp25_ = sum_selected; 922 if (_tmp24_ < _tmp25_) { 923 GdkColor _tmp26_; 924 guint16 _tmp27_; 925 GtkStyle* _tmp28_; 926 GdkColor _tmp29_; 927 guint16 _tmp30_; 928 GdkColor _tmp31_; 929 guint16 _tmp32_; 930 GtkStyle* _tmp33_; 931 GdkColor _tmp34_; 932 guint16 _tmp35_; 933 GdkColor _tmp36_; 934 guint16 _tmp37_; 935 GtkStyle* _tmp38_; 936 GdkColor _tmp39_; 937 guint16 _tmp40_; 938 _tmp26_ = color; 939 _tmp27_ = _tmp26_.red; 940 _tmp28_ = style; 941 _tmp29_ = _tmp28_->white; 942 _tmp30_ = _tmp29_.red; 943 color.red = (guint16) ((_tmp27_ + _tmp30_) / 2); 944 _tmp31_ = color; 945 _tmp32_ = _tmp31_.green; 946 _tmp33_ = style; 947 _tmp34_ = _tmp33_->white; 948 _tmp35_ = _tmp34_.green; 949 color.green = (guint16) ((_tmp32_ + _tmp35_) / 2); 950 _tmp36_ = color; 951 _tmp37_ = _tmp36_.blue; 952 _tmp38_ = style; 953 _tmp39_ = _tmp38_->white; 954 _tmp40_ = _tmp39_.blue; 955 color.blue = (guint16) ((_tmp37_ + _tmp40_) / 2); 956 } else { 957 GdkColor _tmp41_; 958 guint16 _tmp42_; 959 GtkStyle* _tmp43_; 960 GdkColor _tmp44_; 961 guint16 _tmp45_; 962 GdkColor _tmp46_; 963 guint16 _tmp47_; 964 GtkStyle* _tmp48_; 965 GdkColor _tmp49_; 966 guint16 _tmp50_; 967 GdkColor _tmp51_; 968 guint16 _tmp52_; 969 GtkStyle* _tmp53_; 970 GdkColor _tmp54_; 971 guint16 _tmp55_; 972 _tmp41_ = color; 973 _tmp42_ = _tmp41_.red; 974 _tmp43_ = style; 975 _tmp44_ = _tmp43_->black; 976 _tmp45_ = _tmp44_.red; 977 color.red = (guint16) ((_tmp42_ + _tmp45_) / 2); 978 _tmp46_ = color; 979 _tmp47_ = _tmp46_.green; 980 _tmp48_ = style; 981 _tmp49_ = _tmp48_->black; 982 _tmp50_ = _tmp49_.green; 983 color.green = (guint16) ((_tmp47_ + _tmp50_) / 2); 984 _tmp51_ = color; 985 _tmp52_ = _tmp51_.blue; 986 _tmp53_ = style; 987 _tmp54_ = _tmp53_->black; 988 _tmp55_ = _tmp54_.blue; 989 color.blue = (guint16) ((_tmp52_ + _tmp55_) / 2); 990 } 991 _tmp56_ = tree_model; 992 _tmp57_ = *iter; 993 _tmp58_ = gtk_tree_model_get_path (_tmp56_, &_tmp57_); 994 _gtk_tree_path_free0 (path); 995 path = _tmp58_; 996 _tmp59_ = path; 997 _tmp61_ = gtk_tree_path_get_indices_with_depth (_tmp59_, &_tmp60_); 998 _tmp62_ = _tmp61_[0]; 999 if ((_tmp62_ % 2) != 0) { 1000 GtkCellRenderer* _tmp63_; 1001 GdkColor _tmp64_; 1002 _tmp63_ = cell; 1003 _tmp64_ = color; 1004 g_object_set ((GObject*) _tmp63_, "cell-background-gdk", &_tmp64_, NULL); 1005 } else { 1006 GtkCellRenderer* _tmp65_; 1007 _tmp65_ = cell; 1008 g_object_set ((GObject*) _tmp65_, "cell-background-gdk", NULL, NULL); 1009 } 1010 _gtk_tree_path_free0 (path); 1011 _g_object_unref0 (style); 1012 } 1013 1014 1015 static gchar* string_replace (const gchar* self, const gchar* old, const gchar* replacement) { 1016 gchar* result = NULL; 1017 GError * _inner_error_ = NULL; 1018 g_return_val_if_fail (self != NULL, NULL); 1019 g_return_val_if_fail (old != NULL, NULL); 1020 g_return_val_if_fail (replacement != NULL, NULL); 1021 { 1022 const gchar* _tmp0_; 1023 gchar* _tmp1_ = NULL; 1024 gchar* _tmp2_; 1025 GRegex* _tmp3_; 1026 GRegex* _tmp4_; 1027 GRegex* regex; 1028 GRegex* _tmp5_; 1029 const gchar* _tmp6_; 1030 gchar* _tmp7_ = NULL; 1031 gchar* _tmp8_; 1032 _tmp0_ = old; 1033 _tmp1_ = g_regex_escape_string (_tmp0_, -1); 1034 _tmp2_ = _tmp1_; 1035 _tmp3_ = g_regex_new (_tmp2_, 0, 0, &_inner_error_); 1036 _tmp4_ = _tmp3_; 1037 _g_free0 (_tmp2_); 1038 regex = _tmp4_; 1039 if (_inner_error_ != NULL) { 1040 if (_inner_error_->domain == G_REGEX_ERROR) { 1041 goto __catch31_g_regex_error; 1042 } 1043 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); 1044 g_clear_error (&_inner_error_); 1045 return NULL; 1046 } 1047 _tmp5_ = regex; 1048 _tmp6_ = replacement; 1049 _tmp7_ = g_regex_replace_literal (_tmp5_, self, (gssize) (-1), 0, _tmp6_, 0, &_inner_error_); 1050 _tmp8_ = _tmp7_; 1051 if (_inner_error_ != NULL) { 1052 _g_regex_unref0 (regex); 1053 if (_inner_error_->domain == G_REGEX_ERROR) { 1054 goto __catch31_g_regex_error; 1055 } 1056 _g_regex_unref0 (regex); 1057 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); 1058 g_clear_error (&_inner_error_); 1059 return NULL; 1060 } 1061 result = _tmp8_; 1062 _g_regex_unref0 (regex); 1063 return result; 1064 } 1065 goto __finally31; 1066 __catch31_g_regex_error: 1067 { 1068 GError* e = NULL; 1069 e = _inner_error_; 1070 _inner_error_ = NULL; 1071 g_assert_not_reached (); 1072 _g_error_free0 (e); 1073 } 1074 __finally31: 1075 if (_inner_error_ != NULL) { 1076 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); 1077 g_clear_error (&_inner_error_); 1078 return NULL; 1079 } 1080 } 1081 1082 1083 static void tracker_view_text_renderer_func (TrackerView* self, GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter) { 1084 gchar* text = NULL; 1085 gchar* subtext = NULL; 1086 gchar* markup; 1087 gint n_children = 0; 1088 GtkCellLayout* _tmp0_; 1089 GtkCellRenderer* _tmp1_; 1090 GtkTreeModel* _tmp2_; 1091 GtkTreeIter _tmp3_; 1092 GtkTreeModel* _tmp4_; 1093 GtkTreeIter _tmp5_; 1094 gint _tmp6_ = 0; 1095 gint _tmp7_; 1096 GtkCellRenderer* _tmp48_; 1097 const gchar* _tmp49_; 1098 g_return_if_fail (self != NULL); 1099 g_return_if_fail (cell_layout != NULL); 1100 g_return_if_fail (cell != NULL); 1101 g_return_if_fail (tree_model != NULL); 1102 g_return_if_fail (iter != NULL); 1103 markup = NULL; 1104 _tmp0_ = cell_layout; 1105 _tmp1_ = cell; 1106 _tmp2_ = tree_model; 1107 _tmp3_ = *iter; 1108 tracker_view_background_renderer_func (self, _tmp0_, _tmp1_, _tmp2_, &_tmp3_); 1109 _tmp4_ = tree_model; 1110 _tmp5_ = *iter; 1111 _tmp6_ = gtk_tree_model_iter_n_children (_tmp4_, &_tmp5_); 1112 n_children = _tmp6_; 1113 _tmp7_ = n_children; 1114 if (_tmp7_ > 0) { 1115 TrackerQueryType type = 0; 1116 gchar* cat; 1117 GtkTreeModel* _tmp8_; 1118 GtkTreeIter _tmp9_; 1119 TrackerQueryType _tmp10_; 1120 const gchar* _tmp27_; 1121 gint _tmp28_; 1122 const gchar* _tmp29_ = NULL; 1123 gchar* _tmp30_ = NULL; 1124 cat = NULL; 1125 _tmp8_ = tree_model; 1126 _tmp9_ = *iter; 1127 gtk_tree_model_get (_tmp8_, &_tmp9_, 7, &type, -1, -1); 1128 _tmp10_ = type; 1129 switch (_tmp10_) { 1130 case TRACKER_QUERY_TYPE_APPLICATIONS: 1131 { 1132 const gchar* _tmp11_ = NULL; 1133 gchar* _tmp12_; 1134 _tmp11_ = _ ("Applications"); 1135 _tmp12_ = g_strdup (_tmp11_); 1136 _g_free0 (cat); 1137 cat = _tmp12_; 1138 break; 1139 } 1140 case TRACKER_QUERY_TYPE_MUSIC: 1141 { 1142 const gchar* _tmp13_ = NULL; 1143 gchar* _tmp14_; 1144 _tmp13_ = _ ("Music"); 1145 _tmp14_ = g_strdup (_tmp13_); 1146 _g_free0 (cat); 1147 cat = _tmp14_; 1148 break; 1149 } 1150 case TRACKER_QUERY_TYPE_IMAGES: 1151 { 1152 const gchar* _tmp15_ = NULL; 1153 gchar* _tmp16_; 1154 _tmp15_ = _ ("Images"); 1155 _tmp16_ = g_strdup (_tmp15_); 1156 _g_free0 (cat); 1157 cat = _tmp16_; 1158 break; 1159 } 1160 case TRACKER_QUERY_TYPE_VIDEOS: 1161 { 1162 const gchar* _tmp17_ = NULL; 1163 gchar* _tmp18_; 1164 _tmp17_ = _ ("Videos"); 1165 _tmp18_ = g_strdup (_tmp17_); 1166 _g_free0 (cat); 1167 cat = _tmp18_; 1168 break; 1169 } 1170 case TRACKER_QUERY_TYPE_DOCUMENTS: 1171 { 1172 const gchar* _tmp19_ = NULL; 1173 gchar* _tmp20_; 1174 _tmp19_ = _ ("Documents"); 1175 _tmp20_ = g_strdup (_tmp19_); 1176 _g_free0 (cat); 1177 cat = _tmp20_; 1178 break; 1179 } 1180 case TRACKER_QUERY_TYPE_MAIL: 1181 { 1182 const gchar* _tmp21_ = NULL; 1183 gchar* _tmp22_; 1184 _tmp21_ = _ ("Mail"); 1185 _tmp22_ = g_strdup (_tmp21_); 1186 _g_free0 (cat); 1187 cat = _tmp22_; 1188 break; 1189 } 1190 case TRACKER_QUERY_TYPE_FOLDERS: 1191 { 1192 const gchar* _tmp23_ = NULL; 1193 gchar* _tmp24_; 1194 _tmp23_ = _ ("Folders"); 1195 _tmp24_ = g_strdup (_tmp23_); 1196 _g_free0 (cat); 1197 cat = _tmp24_; 1198 break; 1199 } 1200 case TRACKER_QUERY_TYPE_BOOKMARKS: 1201 { 1202 const gchar* _tmp25_ = NULL; 1203 gchar* _tmp26_; 1204 _tmp25_ = _ ("Bookmarks"); 1205 _tmp26_ = g_strdup (_tmp25_); 1206 _g_free0 (cat); 1207 cat = _tmp26_; 1208 break; 1209 } 1210 default: 1211 break; 1212 } 1213 _tmp27_ = cat; 1214 _tmp28_ = n_children; 1215 _tmp29_ = _ ("Items"); 1216 _tmp30_ = g_strdup_printf ("<b><big>%s</big></b> <small>(%d %s)</small>", _tmp27_, _tmp28_, _tmp29_); 1217 _g_free0 (markup); 1218 markup = _tmp30_; 1219 _g_free0 (cat); 1220 } else { 1221 GtkTreeModel* _tmp31_; 1222 GtkTreeIter _tmp32_; 1223 const gchar* _tmp33_; 1224 _tmp31_ = tree_model; 1225 _tmp32_ = *iter; 1226 gtk_tree_model_get (_tmp31_, &_tmp32_, 2, &text, 3, &subtext, -1, -1); 1227 _tmp33_ = text; 1228 if (_tmp33_ != NULL) { 1229 const gchar* _tmp34_; 1230 gchar* _tmp35_ = NULL; 1231 const gchar* _tmp36_; 1232 _tmp34_ = text; 1233 _tmp35_ = g_markup_escape_text (_tmp34_, (gssize) (-1)); 1234 _g_free0 (markup); 1235 markup = _tmp35_; 1236 _tmp36_ = subtext; 1237 if (_tmp36_ != NULL) { 1238 const gchar* _tmp37_; 1239 gchar* _tmp38_ = NULL; 1240 const gchar* _tmp39_; 1241 const gchar* _tmp40_; 1242 gchar* _tmp41_ = NULL; 1243 gchar* _tmp42_; 1244 gchar* _tmp43_ = NULL; 1245 gchar* _tmp44_; 1246 gchar* _tmp45_; 1247 _tmp37_ = subtext; 1248 _tmp38_ = string_replace (_tmp37_, "\n", " "); 1249 _g_free0 (subtext); 1250 subtext = _tmp38_; 1251 _tmp39_ = markup; 1252 _tmp40_ = subtext; 1253 _tmp41_ = g_markup_escape_text (_tmp40_, (gssize) (-1)); 1254 _tmp42_ = _tmp41_; 1255 _tmp43_ = g_strdup_printf ("\n<small><span color='grey'>%s</span></small>", _tmp42_); 1256 _tmp44_ = _tmp43_; 1257 _tmp45_ = g_strconcat (_tmp39_, _tmp44_, NULL); 1258 _g_free0 (markup); 1259 markup = _tmp45_; 1260 _g_free0 (_tmp44_); 1261 _g_free0 (_tmp42_); 1262 } 1263 } else { 1264 const gchar* _tmp46_ = NULL; 1265 gchar* _tmp47_ = NULL; 1266 _tmp46_ = _ ("Loading..."); 1267 _tmp47_ = g_strdup_printf ("<span color='grey'>%s</span>\n", _tmp46_); 1268 _g_free0 (markup); 1269 markup = _tmp47_; 1270 } 1271 } 1272 _tmp48_ = cell; 1273 _tmp49_ = markup; 1274 g_object_set ((GObject*) _tmp48_, "markup", _tmp49_, NULL); 1275 _g_free0 (markup); 1276 _g_free0 (subtext); 1277 _g_free0 (text); 1278 } 1279 1280 1281 static void tracker_view_file_size_renderer_func (TrackerView* self, GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter) { 1282 gchar* size = NULL; 1283 GtkCellLayout* _tmp0_; 1284 GtkCellRenderer* _tmp1_; 1285 GtkTreeModel* _tmp2_; 1286 GtkTreeIter _tmp3_; 1287 GtkTreeModel* _tmp4_; 1288 GtkTreeIter _tmp5_; 1289 const gchar* _tmp6_; 1290 GtkCellRenderer* _tmp10_; 1291 const gchar* _tmp11_; 1292 g_return_if_fail (self != NULL); 1293 g_return_if_fail (cell_layout != NULL); 1294 g_return_if_fail (cell != NULL); 1295 g_return_if_fail (tree_model != NULL); 1296 g_return_if_fail (iter != NULL); 1297 _tmp0_ = cell_layout; 1298 _tmp1_ = cell; 1299 _tmp2_ = tree_model; 1300 _tmp3_ = *iter; 1301 tracker_view_background_renderer_func (self, _tmp0_, _tmp1_, _tmp2_, &_tmp3_); 1302 _tmp4_ = tree_model; 1303 _tmp5_ = *iter; 1304 gtk_tree_model_get (_tmp4_, &_tmp5_, 4, &size, -1, -1); 1305 _tmp6_ = size; 1306 if (_tmp6_ != NULL) { 1307 const gchar* _tmp7_; 1308 gint _tmp8_ = 0; 1309 gchar* _tmp9_ = NULL; 1310 _tmp7_ = size; 1311 _tmp8_ = atoi (_tmp7_); 1312 _tmp9_ = g_format_size_for_display ((gint64) _tmp8_);
'g_format_size_for_display' is deprecated (declared at /usr/include/glib-2.0/glib/gutils.h:231): Use 'g_format_size' instead
(emitted by gcc)
1313 _g_free0 (size); 1314 size = _tmp9_; 1315 } 1316 _tmp10_ = cell; 1317 _tmp11_ = size; 1318 g_object_set ((GObject*) _tmp10_, "text", _tmp11_, NULL); 1319 _g_free0 (size); 1320 } 1321 1322 1323 static void tracker_view_file_date_renderer_func (TrackerView* self, GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter) { 1324 gchar* date = NULL; 1325 GtkCellLayout* _tmp0_; 1326 GtkCellRenderer* _tmp1_; 1327 GtkTreeModel* _tmp2_; 1328 GtkTreeIter _tmp3_; 1329 GtkTreeModel* _tmp4_; 1330 GtkTreeIter _tmp5_; 1331 const gchar* _tmp6_; 1332 GtkCellRenderer* _tmp9_; 1333 const gchar* _tmp10_; 1334 g_return_if_fail (self != NULL); 1335 g_return_if_fail (cell_layout != NULL); 1336 g_return_if_fail (cell != NULL); 1337 g_return_if_fail (tree_model != NULL); 1338 g_return_if_fail (iter != NULL); 1339 _tmp0_ = cell_layout; 1340 _tmp1_ = cell; 1341 _tmp2_ = tree_model; 1342 _tmp3_ = *iter; 1343 tracker_view_background_renderer_func (self, _tmp0_, _tmp1_, _tmp2_, &_tmp3_); 1344 _tmp4_ = tree_model; 1345 _tmp5_ = *iter; 1346 gtk_tree_model_get (_tmp4_, &_tmp5_, 5, &date, -1, -1); 1347 _tmp6_ = date; 1348 if (_tmp6_ != NULL) { 1349 const gchar* _tmp7_; 1350 gchar* _tmp8_ = NULL; 1351 _tmp7_ = date; 1352 _tmp8_ = tracker_time_format_from_iso8601 (_tmp7_); 1353 _g_free0 (date); 1354 date = _tmp8_; 1355 } 1356 _tmp9_ = cell; 1357 _tmp10_ = date; 1358 g_object_set ((GObject*) _tmp9_, "text", _tmp10_, NULL); 1359 _g_free0 (date); 1360 } 1361 1362 1363 static void tracker_view_category_detail_renderer_func (TrackerView* self, GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter) { 1364 TrackerQueryType category = 0; 1365 gchar* markup; 1366 gchar* detail = NULL; 1367 GtkCellLayout* _tmp0_; 1368 GtkCellRenderer* _tmp1_; 1369 GtkTreeModel* _tmp2_; 1370 GtkTreeIter _tmp3_; 1371 GtkTreeModel* _tmp4_; 1372 GtkTreeIter _tmp5_; 1373 const gchar* _tmp6_; 1374 TrackerQueryType _tmp8_; 1375 const gchar* _tmp21_; 1376 gchar* _tmp22_ = NULL; 1377 gchar* _tmp23_; 1378 gchar* _tmp24_ = NULL; 1379 GtkCellRenderer* _tmp25_; 1380 const gchar* _tmp26_; 1381 g_return_if_fail (self != NULL); 1382 g_return_if_fail (cell_layout != NULL); 1383 g_return_if_fail (cell != NULL); 1384 g_return_if_fail (tree_model != NULL); 1385 g_return_if_fail (iter != NULL); 1386 markup = NULL; 1387 _tmp0_ = cell_layout; 1388 _tmp1_ = cell; 1389 _tmp2_ = tree_model; 1390 _tmp3_ = *iter; 1391 tracker_view_background_renderer_func (self, _tmp0_, _tmp1_, _tmp2_, &_tmp3_); 1392 _tmp4_ = tree_model; 1393 _tmp5_ = *iter; 1394 gtk_tree_model_get (_tmp4_, &_tmp5_, 4, &detail, 7, &category, -1, -1); 1395 _tmp6_ = detail; 1396 if (_tmp6_ == NULL) { 1397 GtkCellRenderer* _tmp7_; 1398 _tmp7_ = cell; 1399 g_object_set ((GObject*) _tmp7_, "markup", NULL, NULL); 1400 _g_free0 (detail); 1401 _g_free0 (markup); 1402 return; 1403 } 1404 _tmp8_ = category; 1405 switch (_tmp8_) { 1406 case TRACKER_QUERY_TYPE_FOLDERS: 1407 case TRACKER_QUERY_TYPE_MAIL: 1408 case TRACKER_QUERY_TYPE_BOOKMARKS: 1409 { 1410 const gchar* _tmp9_; 1411 gchar* _tmp10_ = NULL; 1412 _tmp9_ = detail; 1413 _tmp10_ = tracker_time_format_from_iso8601 (_tmp9_); 1414 _g_free0 (detail); 1415 detail = _tmp10_; 1416 break; 1417 } 1418 case TRACKER_QUERY_TYPE_MUSIC: 1419 case TRACKER_QUERY_TYPE_VIDEOS: 1420 { 1421 const gchar* _tmp11_; 1422 gchar* _tmp12_ = NULL; 1423 _tmp11_ = detail; 1424 _tmp12_ = tracker_time_format_from_seconds (_tmp11_); 1425 _g_free0 (detail); 1426 detail = _tmp12_; 1427 break; 1428 } 1429 case TRACKER_QUERY_TYPE_DOCUMENTS: 1430 { 1431 const gchar* _tmp13_; 1432 gchar* _tmp14_; 1433 gchar* _tmp15_; 1434 const gchar* _tmp16_ = NULL; 1435 gchar* _tmp17_; 1436 _tmp13_ = detail; 1437 _tmp14_ = g_strconcat (_tmp13_, " ", NULL); 1438 _tmp15_ = _tmp14_; 1439 _tmp16_ = _ ("Pages"); 1440 _tmp17_ = g_strconcat (_tmp15_, _tmp16_, NULL); 1441 _g_free0 (detail); 1442 detail = _tmp17_; 1443 _g_free0 (_tmp15_); 1444 break; 1445 } 1446 case TRACKER_QUERY_TYPE_IMAGES: 1447 { 1448 const gchar* _tmp18_; 1449 gint _tmp19_ = 0; 1450 gchar* _tmp20_ = NULL; 1451 _tmp18_ = detail; 1452 _tmp19_ = atoi (_tmp18_); 1453 _tmp20_ = g_format_size_for_display ((gint64) _tmp19_);
'g_format_size_for_display' is deprecated (declared at /usr/include/glib-2.0/glib/gutils.h:231): Use 'g_format_size' instead
(emitted by gcc)
1454 _g_free0 (detail); 1455 detail = _tmp20_; 1456 break; 1457 } 1458 default: 1459 break; 1460 } 1461 _tmp21_ = detail; 1462 _tmp22_ = g_markup_escape_text (_tmp21_, (gssize) (-1)); 1463 _tmp23_ = _tmp22_; 1464 _tmp24_ = g_strdup_printf ("<span color='grey'><small>%s</small></span>", _tmp23_); 1465 _g_free0 (markup); 1466 markup = _tmp24_; 1467 _g_free0 (_tmp23_); 1468 _tmp25_ = cell; 1469 _tmp26_ = markup; 1470 g_object_set ((GObject*) _tmp25_, "markup", _tmp26_, NULL); 1471 _g_free0 (detail); 1472 _g_free0 (markup); 1473 } 1474 1475 1476 static gboolean _tracker_view_view_button_press_event_gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) { 1477 gboolean result; 1478 result = tracker_view_view_button_press_event (self, _sender, event); 1479 return result; 1480 } 1481 1482 1483 static void _tracker_view_context_menu_directory_clicked_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) { 1484 tracker_view_context_menu_directory_clicked (self); 1485 } 1486 1487 1488 static void _tracker_view_context_menu_tags_clicked_gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) { 1489 tracker_view_context_menu_tags_clicked (self); 1490 } 1491 1492 1493 static void tracker_view_setup_menus (TrackerView* self) { 1494 GtkWidget* _tmp0_; 1495 GtkMenu* _tmp1_; 1496 const gchar* _tmp2_ = NULL; 1497 GtkMenuItem* _tmp3_; 1498 GtkMenuItem* item; 1499 GtkMenuItem* _tmp4_; 1500 GtkMenu* _tmp5_; 1501 GtkMenuItem* _tmp6_; 1502 GtkSeparatorMenuItem* _tmp7_; 1503 GtkSeparatorMenuItem* separator; 1504 GtkMenu* _tmp8_; 1505 const gchar* _tmp9_ = NULL; 1506 GtkMenuItem* _tmp10_; 1507 GtkMenuItem* _tmp11_; 1508 GtkMenu* _tmp12_; 1509 GtkMenuItem* _tmp13_; 1510 GtkMenu* _tmp14_; 1511 g_return_if_fail (self != NULL); 1512 _tmp0_ = self->priv->view; 1513 g_signal_connect_object (_tmp0_, "button-press-event", (GCallback) _tracker_view_view_button_press_event_gtk_widget_button_press_event, self, 0); 1514 _tmp1_ = (GtkMenu*) gtk_menu_new (); 1515 g_object_ref_sink (_tmp1_); 1516 _g_object_unref0 (self->priv->context_menu); 1517 self->priv->context_menu = _tmp1_; 1518 _tmp2_ = _ ("_Show Parent Directory"); 1519 _tmp3_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (_tmp2_); 1520 g_object_ref_sink (_tmp3_); 1521 item = _tmp3_; 1522 _tmp4_ = item; 1523 g_signal_connect_object (_tmp4_, "activate", (GCallback) _tracker_view_context_menu_directory_clicked_gtk_menu_item_activate, self, 0); 1524 _tmp5_ = self->priv->context_menu; 1525 _tmp6_ = item; 1526 gtk_menu_shell_append ((GtkMenuShell*) _tmp5_, (GtkWidget*) _tmp6_); 1527 _tmp7_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new (); 1528 g_object_ref_sink (_tmp7_); 1529 separator = _tmp7_; 1530 _tmp8_ = self->priv->context_menu; 1531 gtk_menu_shell_append ((GtkMenuShell*) _tmp8_, (GtkWidget*) ((GtkMenuItem*) separator)); 1532 _tmp9_ = _ ("_Tags..."); 1533 _tmp10_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (_tmp9_); 1534 g_object_ref_sink (_tmp10_); 1535 _g_object_unref0 (item); 1536 item = _tmp10_; 1537 _tmp11_ = item; 1538 g_signal_connect_object (_tmp11_, "activate", (GCallback) _tracker_view_context_menu_tags_clicked_gtk_menu_item_activate, self, 0); 1539 _tmp12_ = self->priv->context_menu; 1540 _tmp13_ = item; 1541 gtk_menu_shell_append ((GtkMenuShell*) _tmp12_, (GtkWidget*) _tmp13_); 1542 _tmp14_ = self->priv->context_menu; 1543 gtk_widget_show_all ((GtkWidget*) _tmp14_); 1544 _g_object_unref0 (separator); 1545 _g_object_unref0 (item); 1546 } 1547 1548 1549 static gboolean tracker_view_view_button_press_event (TrackerView* self, GtkWidget* widget, GdkEventButton* event) { 1550 gboolean result = FALSE; 1551 GdkEventButton _tmp0_; 1552 guint _tmp1_; 1553 g_return_val_if_fail (self != NULL, FALSE); 1554 g_return_val_if_fail (widget != NULL, FALSE); 1555 g_return_val_if_fail (event != NULL, FALSE); 1556 _tmp0_ = *event; 1557 _tmp1_ = _tmp0_.button; 1558 if (_tmp1_ == ((guint) 3)) { 1559 GtkTreePath* _tmp2_ = NULL; 1560 GtkTreePath* _tmp3_; 1561 gboolean _tmp4_; 1562 _tmp2_ = tracker_view_get_selected_path (self); 1563 _tmp3_ = _tmp2_; 1564 _tmp4_ = _tmp3_ != NULL; 1565 _gtk_tree_path_free0 (_tmp3_); 1566 if (_tmp4_) { 1567 GtkMenu* _tmp5_; 1568 GdkEventButton _tmp6_; 1569 guint _tmp7_; 1570 GdkEventButton _tmp8_; 1571 guint32 _tmp9_; 1572 _tmp5_ = self->priv->context_menu; 1573 _tmp6_ = *event; 1574 _tmp7_ = _tmp6_.button; 1575 _tmp8_ = *event; 1576 _tmp9_ = _tmp8_.time; 1577 gtk_menu_popup (_tmp5_, NULL, NULL, NULL, NULL, _tmp7_, _tmp9_); 1578 } 1579 } 1580 result = FALSE; 1581 return result; 1582 } 1583 1584 1585 static GtkTreeModel* tracker_view_get_model (TrackerView* self) { 1586 GtkTreeModel* result = NULL; 1587 TrackerViewDisplay _tmp0_; 1588 g_return_val_if_fail (self != NULL, NULL); 1589 _tmp0_ = self->priv->_display; 1590 switch (_tmp0_) { 1591 case TRACKER_VIEW_DISPLAY_CATEGORIES: 1592 case TRACKER_VIEW_DISPLAY_FILE_LIST: 1593 { 1594 GtkWidget* _tmp1_; 1595 GtkTreeView* _tmp2_; 1596 GtkTreeView* v; 1597 GtkTreeView* _tmp3_; 1598 GtkTreeModel* _tmp4_ = NULL; 1599 GtkTreeModel* _tmp5_; 1600 _tmp1_ = self->priv->view; 1601 _tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GTK_TYPE_TREE_VIEW, GtkTreeView)); 1602 v = _tmp2_; 1603 _tmp3_ = v; 1604 _tmp4_ = gtk_tree_view_get_model (_tmp3_); 1605 _tmp5_ = _g_object_ref0 (_tmp4_); 1606 result = _tmp5_; 1607 _g_object_unref0 (v); 1608 return result; 1609 } 1610 case TRACKER_VIEW_DISPLAY_FILE_ICONS: 1611 { 1612 GtkWidget* _tmp6_; 1613 GtkIconView* _tmp7_; 1614 GtkIconView* v; 1615 GtkIconView* _tmp8_; 1616 GtkTreeModel* _tmp9_ = NULL; 1617 GtkTreeModel* _tmp10_; 1618 _tmp6_ = self->priv->view; 1619 _tmp7_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GTK_TYPE_ICON_VIEW, GtkIconView)); 1620 v = _tmp7_; 1621 _tmp8_ = v; 1622 _tmp9_ = gtk_icon_view_get_model (_tmp8_); 1623 _tmp10_ = _g_object_ref0 (_tmp9_); 1624 result = _tmp10_; 1625 _g_object_unref0 (v); 1626 return result; 1627 } 1628 default: 1629 { 1630 break; 1631 } 1632 } 1633 result = NULL; 1634 return result; 1635 } 1636 1637 1638 static gpointer _gtk_tree_path_copy0 (gpointer self) { 1639 return self ? gtk_tree_path_copy (self) : NULL; 1640 } 1641 1642 1643 static void _gtk_tree_path_free0_ (gpointer var) { 1644 (var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)); 1645 } 1646 1647 1648 static void _g_list_free__gtk_tree_path_free0_ (GList* self) { 1649 g_list_foreach (self, (GFunc) _gtk_tree_path_free0_, NULL); 1650 g_list_free (self); 1651 } 1652 1653 1654 static GtkTreePath* tracker_view_get_selected_path (TrackerView* self) { 1655 GtkTreePath* result = NULL; 1656 TrackerViewDisplay _tmp0_; 1657 g_return_val_if_fail (self != NULL, NULL); 1658 _tmp0_ = self->priv->_display; 1659 switch (_tmp0_) { 1660 case TRACKER_VIEW_DISPLAY_CATEGORIES: 1661 case TRACKER_VIEW_DISPLAY_FILE_LIST: 1662 { 1663 GtkWidget* _tmp1_; 1664 GtkTreeView* _tmp2_; 1665 GtkTreeView* v; 1666 GtkTreeView* _tmp3_; 1667 GtkTreeSelection* _tmp4_ = NULL; 1668 GtkTreeSelection* _tmp5_; 1669 GtkTreeSelection* s; 1670 GtkTreeSelection* _tmp6_; 1671 GList* _tmp7_ = NULL; 1672 GList* selected; 1673 GList* _tmp8_; 1674 gconstpointer _tmp9_ = NULL; 1675 GtkTreePath* _tmp10_; 1676 _tmp1_ = self->priv->view; 1677 _tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GTK_TYPE_TREE_VIEW, GtkTreeView)); 1678 v = _tmp2_; 1679 _tmp3_ = v; 1680 _tmp4_ = gtk_tree_view_get_selection (_tmp3_); 1681 _tmp5_ = _g_object_ref0 (_tmp4_); 1682 s = _tmp5_; 1683 _tmp6_ = s; 1684 _tmp7_ = gtk_tree_selection_get_selected_rows (_tmp6_, NULL); 1685 selected = _tmp7_; 1686 _tmp8_ = selected; 1687 _tmp9_ = g_list_nth_data (_tmp8_, (guint) 0); 1688 _tmp10_ = _gtk_tree_path_copy0 ((GtkTreePath*) _tmp9_); 1689 result = _tmp10_; 1690 __g_list_free__gtk_tree_path_free0_0 (selected); 1691 _g_object_unref0 (s); 1692 _g_object_unref0 (v); 1693 return result; 1694 } 1695 case TRACKER_VIEW_DISPLAY_FILE_ICONS: 1696 { 1697 GtkWidget* _tmp11_; 1698 GtkIconView* _tmp12_; 1699 GtkIconView* v; 1700 GtkIconView* _tmp13_; 1701 GList* _tmp14_ = NULL; 1702 GList* selected; 1703 GList* _tmp15_; 1704 gconstpointer _tmp16_ = NULL; 1705 GtkTreePath* _tmp17_; 1706 _tmp11_ = self->priv->view; 1707 _tmp12_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GTK_TYPE_ICON_VIEW, GtkIconView)); 1708 v = _tmp12_; 1709 _tmp13_ = v; 1710 _tmp14_ = gtk_icon_view_get_selected_items (_tmp13_); 1711 selected = _tmp14_; 1712 _tmp15_ = selected; 1713 _tmp16_ = g_list_nth_data (_tmp15_, (guint) 0); 1714 _tmp17_ = _gtk_tree_path_copy0 ((GtkTreePath*) _tmp16_); 1715 result = _tmp17_; 1716 __g_list_free__gtk_tree_path_free0_0 (selected); 1717 _g_object_unref0 (v); 1718 return result; 1719 } 1720 default: 1721 { 1722 break; 1723 } 1724 } 1725 result = NULL; 1726 return result; 1727 } 1728 1729 1730 static void tracker_view_context_menu_directory_clicked (TrackerView* self) { 1731 GtkTreeModel* _tmp0_ = NULL; 1732 GtkTreeModel* model; 1733 GtkTreePath* _tmp1_ = NULL; 1734 GtkTreePath* path; 1735 g_return_if_fail (self != NULL); 1736 _tmp0_ = tracker_view_get_model (self); 1737 model = _tmp0_; 1738 _tmp1_ = tracker_view_get_selected_path (self); 1739 path = _tmp1_; 1740 tracker_model_launch_selected_parent_dir (model, path, 1); 1741 _gtk_tree_path_free0 (path); 1742 _g_object_unref0 (model); 1743 } 1744 1745 1746 static Block5Data* block5_data_ref (Block5Data* _data5_) { 1747 g_atomic_int_inc (&_data5_->_ref_count_); 1748 return _data5_; 1749 } 1750 1751 1752 static void block5_data_unref (void * _userdata_) { 1753 Block5Data* _data5_; 1754 _data5_ = (Block5Data*) _userdata_; 1755 if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) { 1756 TrackerView * self; 1757 self = _data5_->self; 1758 _g_object_unref0 (_data5_->dialog); 1759 _g_object_unref0 (self); 1760 g_slice_free (Block5Data, _data5_); 1761 } 1762 } 1763 1764 1765 static void __lambda5_ (Block5Data* _data5_) { 1766 TrackerView * self;
variable 'self' set but not used
(emitted by gcc)
1767 GtkDialog* _tmp0_; 1768 self = _data5_->self; 1769 _tmp0_ = _data5_->dialog; 1770 gtk_widget_destroy ((GtkWidget*) _tmp0_); 1771 } 1772 1773 1774 static void ___lambda5__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) { 1775 __lambda5_ (self); 1776 } 1777 1778 1779 static void _g_free0_ (gpointer var) { 1780 var = (g_free (var), NULL); 1781 } 1782 1783 1784 static void _g_list_free__g_free0_ (GList* self) { 1785 g_list_foreach (self, (GFunc) _g_free0_, NULL); 1786 g_list_free (self); 1787 } 1788 1789 1790 static void tracker_view_context_menu_tags_clicked (TrackerView* self) { 1791 Block5Data* _data5_; 1792 GtkTreeModel* _tmp0_ = NULL; 1793 GtkTreeModel* model; 1794 GtkTreePath* _tmp1_ = NULL; 1795 GtkTreePath* path; 1796 GtkTreeIter iter = {0}; 1797 GtkTreeModel* _tmp2_; 1798 GtkTreePath* _tmp3_; 1799 GtkTreeIter _tmp4_ = {0}; 1800 const gchar* uri = NULL; 1801 GtkTreeModel* _tmp5_; 1802 GtkTreeIter _tmp6_; 1803 const gchar* _tmp7_; 1804 const gchar* _tmp8_; 1805 const gchar* _tmp9_ = NULL; 1806 GtkWidget* _tmp10_ = NULL; 1807 GtkDialog* _tmp11_; 1808 GtkDialog* _tmp12_; 1809 GtkDialog* _tmp13_; 1810 GtkDialog* _tmp14_; 1811 GList* files; 1812 const gchar* _tmp15_; 1813 gchar* _tmp16_; 1814 GList* _tmp17_; 1815 TrackerTagsView* _tmp18_; 1816 GtkVBox* vbox; 1817 GtkDialog* _tmp19_; 1818 GtkBox* _tmp20_ = NULL; 1819 GtkBox* _tmp21_; 1820 GtkBox* content; 1821 GtkBox* _tmp22_; 1822 GtkVBox* _tmp23_; 1823 GtkBox* _tmp24_; 1824 GtkDialog* _tmp25_; 1825 GtkDialog* _tmp26_; 1826 g_return_if_fail (self != NULL); 1827 _data5_ = g_slice_new0 (Block5Data); 1828 _data5_->_ref_count_ = 1; 1829 _data5_->self = g_object_ref (self); 1830 _tmp0_ = tracker_view_get_model (self); 1831 model = _tmp0_; 1832 _tmp1_ = tracker_view_get_selected_path (self); 1833 path = _tmp1_; 1834 _tmp2_ = model; 1835 _tmp3_ = path; 1836 gtk_tree_model_get_iter (_tmp2_, &_tmp4_, _tmp3_); 1837 iter = _tmp4_; 1838 _tmp5_ = model; 1839 _tmp6_ = iter; 1840 gtk_tree_model_get (_tmp5_, &_tmp6_, 1, &uri, -1); 1841 _tmp7_ = uri; 1842 if (_tmp7_ == NULL) { 1843 _gtk_tree_path_free0 (path); 1844 _g_object_unref0 (model); 1845 block5_data_unref (_data5_); 1846 _data5_ = NULL; 1847 return; 1848 } 1849 _tmp8_ = uri; 1850 g_debug ("tracker-view.vala:536: Showing tags dialog for uri:'%s'", _tmp8_); 1851 _tmp9_ = _ ("Tags"); 1852 _tmp10_ = gtk_widget_get_toplevel ((GtkWidget*) self); 1853 _tmp11_ = (GtkDialog*) gtk_dialog_new_with_buttons (_tmp9_, G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, GTK_TYPE_WINDOW, GtkWindow), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL, NULL); 1854 g_object_ref_sink (_tmp11_); 1855 _data5_->dialog = _tmp11_; 1856 _tmp12_ = _data5_->dialog; 1857 gtk_window_set_default_size ((GtkWindow*) _tmp12_, 400, 300); 1858 _tmp13_ = _data5_->dialog; 1859 gtk_container_set_border_width ((GtkContainer*) _tmp13_, (guint) 12); 1860 _tmp14_ = _data5_->dialog; 1861 g_signal_connect_data (_tmp14_, "response", (GCallback) ___lambda5__gtk_dialog_response, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0); 1862 files = NULL; 1863 _tmp15_ = uri; 1864 _tmp16_ = g_strdup (_tmp15_); 1865 files = g_list_prepend (files, _tmp16_); 1866 _tmp17_ = files; 1867 files = NULL; 1868 _tmp18_ = tracker_tags_view_new (_tmp17_); 1869 g_object_ref_sink (_tmp18_); 1870 vbox = (GtkVBox*) _tmp18_; 1871 _tmp19_ = _data5_->dialog; 1872 _tmp20_ = gtk_dialog_get_content_area (_tmp19_);
assignment from incompatible pointer type [enabled by default]
(emitted by gcc)
1873 _tmp21_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp20_, GTK_TYPE_BOX) ? ((GtkBox*) _tmp20_) : NULL); 1874 content = _tmp21_; 1875 _tmp22_ = content; 1876 _tmp23_ = vbox; 1877 gtk_box_pack_start (_tmp22_, (GtkWidget*) _tmp23_, TRUE, TRUE, (guint) 6); 1878 _tmp24_ = content; 1879 gtk_box_set_spacing (_tmp24_, 10); 1880 _tmp25_ = _data5_->dialog; 1881 gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, GTK_TYPE_WIDGET, GtkWidget)); 1882 _tmp26_ = _data5_->dialog; 1883 gtk_dialog_run (_tmp26_); 1884 _g_object_unref0 (content); 1885 _g_object_unref0 (vbox); 1886 __g_list_free__g_free0_0 (files); 1887 _gtk_tree_path_free0 (path); 1888 _g_object_unref0 (model); 1889 block5_data_unref (_data5_); 1890 _data5_ = NULL; 1891 } 1892 1893 1894 TrackerViewDisplay tracker_view_get_display (TrackerView* self) { 1895 TrackerViewDisplay result; 1896 TrackerViewDisplay _tmp0_; 1897 g_return_val_if_fail (self != NULL, 0); 1898 _tmp0_ = self->priv->_display; 1899 result = _tmp0_; 1900 return result; 1901 } 1902 1903 1904 static void tracker_view_set_display (TrackerView* self, TrackerViewDisplay value) { 1905 TrackerViewDisplay _tmp0_; 1906 g_return_if_fail (self != NULL); 1907 _tmp0_ = value; 1908 self->priv->_display = _tmp0_; 1909 g_object_notify ((GObject *) self, "display"); 1910 } 1911 1912 1913 TrackerResultStore* tracker_view_get_store (TrackerView* self) { 1914 TrackerResultStore* result; 1915 TrackerResultStore* _tmp0_; 1916 g_return_val_if_fail (self != NULL, NULL); 1917 _tmp0_ = self->priv->_store; 1918 result = _tmp0_; 1919 return result; 1920 } 1921 1922 1923 void tracker_view_set_store (TrackerView* self, TrackerResultStore* value) { 1924 TrackerResultStore* _tmp0_; 1925 TrackerResultStore* _tmp3_; 1926 TrackerResultStore* _tmp4_; 1927 TrackerResultStore* _tmp5_; 1928 TrackerViewDisplay _tmp8_; 1929 g_return_if_fail (self != NULL); 1930 _tmp0_ = self->priv->_store; 1931 if (_tmp0_ != NULL) { 1932 TrackerResultStore* _tmp1_; 1933 guint _tmp2_ = 0U; 1934 _tmp1_ = self->priv->_store; 1935 g_signal_parse_name ("row-changed", GTK_TYPE_TREE_MODEL, &_tmp2_, NULL, FALSE); 1936 g_signal_handlers_disconnect_matched ((GtkTreeModel*) _tmp1_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, 0, NULL, (GCallback) _tracker_view_store_row_changed_gtk_tree_model_row_changed, self); 1937 } 1938 _tmp3_ = value; 1939 _tmp4_ = _g_object_ref0 (_tmp3_); 1940 _g_object_unref0 (self->priv->_store); 1941 self->priv->_store = _tmp4_; 1942 _tmp5_ = self->priv->_store; 1943 if (_tmp5_ != NULL) { 1944 TrackerResultStore* _tmp6_; 1945 TrackerResultStore* _tmp7_; 1946 _tmp6_ = self->priv->_store; 1947 g_debug ("tracker-view.vala:48: using store:%p", _tmp6_); 1948 _tmp7_ = self->priv->_store; 1949 g_signal_connect_object ((GtkTreeModel*) _tmp7_, "row-changed", (GCallback) _tracker_view_store_row_changed_gtk_tree_model_row_changed, self, 0); 1950 } 1951 _tmp8_ = self->priv->_display; 1952 if (_tmp8_ != TRACKER_VIEW_DISPLAY_FILE_ICONS) { 1953 GtkWidget* _tmp9_; 1954 TrackerResultStore* _tmp10_; 1955 _tmp9_ = self->priv->view; 1956 _tmp10_ = self->priv->_store; 1957 gtk_tree_view_set_model (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GTK_TYPE_TREE_VIEW, GtkTreeView), (GtkTreeModel*) _tmp10_); 1958 } else { 1959 GtkWidget* _tmp11_; 1960 TrackerResultStore* _tmp12_; 1961 _tmp11_ = self->priv->view; 1962 _tmp12_ = self->priv->_store; 1963 gtk_icon_view_set_model (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GTK_TYPE_ICON_VIEW, GtkIconView), (GtkTreeModel*) _tmp12_); 1964 } 1965 g_object_notify ((GObject *) self, "store"); 1966 } 1967 1968 1969 static void tracker_view_class_init (TrackerViewClass * klass) { 1970 tracker_view_parent_class = g_type_class_peek_parent (klass); 1971 g_type_class_add_private (klass, sizeof (TrackerViewPrivate)); 1972 GTK_WIDGET_CLASS (klass)->unmap = tracker_view_real_unmap; 1973 G_OBJECT_CLASS (klass)->get_property = _vala_tracker_view_get_property; 1974 G_OBJECT_CLASS (klass)->set_property = _vala_tracker_view_set_property; 1975 G_OBJECT_CLASS (klass)->finalize = tracker_view_finalize; 1976 g_object_class_install_property (G_OBJECT_CLASS (klass), TRACKER_VIEW_DISPLAY, g_param_spec_enum ("display", "display", "display", TRACKER_VIEW_TYPE_DISPLAY, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); 1977 g_object_class_install_property (G_OBJECT_CLASS (klass), TRACKER_VIEW_STORE, g_param_spec_object ("store", "store", "store", TRACKER_TYPE_RESULT_STORE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); 1978 } 1979 1980 1981 static void tracker_view_instance_init (TrackerView * self) { 1982 self->priv = TRACKER_VIEW_GET_PRIVATE (self); 1983 self->priv->view = NULL; 1984 } 1985 1986 1987 static void tracker_view_finalize (GObject* obj) { 1988 TrackerView * self; 1989 self = G_TYPE_CHECK_INSTANCE_CAST (obj, TRACKER_TYPE_VIEW, TrackerView); 1990 _g_object_unref0 (self->priv->_store); 1991 _g_object_unref0 (self->priv->view); 1992 _g_object_unref0 (self->priv->context_menu); 1993 G_OBJECT_CLASS (tracker_view_parent_class)->finalize (obj); 1994 } 1995 1996 1997 GType tracker_view_get_type (void) { 1998 static volatile gsize tracker_view_type_id__volatile = 0; 1999 if (g_once_init_enter (&tracker_view_type_id__volatile)) { 2000 static const GTypeInfo g_define_type_info = { sizeof (TrackerViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tracker_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TrackerView), 0, (GInstanceInitFunc) tracker_view_instance_init, NULL }; 2001 GType tracker_view_type_id; 2002 tracker_view_type_id = g_type_register_static (GTK_TYPE_SCROLLED_WINDOW, "TrackerView", &g_define_type_info, 0); 2003 g_once_init_leave (&tracker_view_type_id__volatile, tracker_view_type_id); 2004 } 2005 return tracker_view_type_id__volatile; 2006 } 2007 2008 2009 static void _vala_tracker_view_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { 2010 TrackerView * self; 2011 self = G_TYPE_CHECK_INSTANCE_CAST (object, TRACKER_TYPE_VIEW, TrackerView); 2012 switch (property_id) { 2013 case TRACKER_VIEW_DISPLAY: 2014 g_value_set_enum (value, tracker_view_get_display (self)); 2015 break; 2016 case TRACKER_VIEW_STORE: 2017 g_value_set_object (value, tracker_view_get_store (self)); 2018 break; 2019 default: 2020 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); 2021 break; 2022 } 2023 } 2024 2025 2026 static void _vala_tracker_view_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { 2027 TrackerView * self; 2028 self = G_TYPE_CHECK_INSTANCE_CAST (object, TRACKER_TYPE_VIEW, TrackerView); 2029 switch (property_id) { 2030 case TRACKER_VIEW_DISPLAY: 2031 tracker_view_set_display (self, g_value_get_enum (value)); 2032 break; 2033 case TRACKER_VIEW_STORE: 2034 tracker_view_set_store (self, g_value_get_object (value)); 2035 break; 2036 default: 2037 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); 2038 break; 2039 } 2040 }