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

Location Tool Test ID Function Issue
tracker-history.c:191:8 gcc unused-but-set-variable tracker_history_construct variable '__tmp19__size_' set but not used
tracker-history.c:196:3 clang-analyzer Value stored to '__tmp19__size_' is never read
tracker-history.c:232:2 clang-analyzer Value stored to '_tmp23_' is never read
tracker-history.c:278:8 gcc unused-variable tracker_history_add unused variable '_check_collection_size_'
tracker-history.c:281:3 clang-analyzer Value stored to 'check_collection_length1' is never read
tracker-history.c:300:2 clang-analyzer Value stored to '_tmp8_' is never read
tracker-history.c:301:2 clang-analyzer Value stored to '_tmp8__length1' is never read
  1 /* tracker-history.c generated by valac 0.18.1, the Vala compiler
  2  * generated from tracker-history.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 <stdlib.h>
 26 #include <string.h>
 27 #include <glib/gstdio.h>
 28 #include <gobject/gvaluecollector.h>
 29 
 30 
 31 #define TRACKER_TYPE_HISTORY (tracker_history_get_type ())
 32 #define TRACKER_HISTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRACKER_TYPE_HISTORY, TrackerHistory))
 33 #define TRACKER_HISTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TRACKER_TYPE_HISTORY, TrackerHistoryClass))
 34 #define TRACKER_IS_HISTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRACKER_TYPE_HISTORY))
 35 #define TRACKER_IS_HISTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TRACKER_TYPE_HISTORY))
 36 #define TRACKER_HISTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TRACKER_TYPE_HISTORY, TrackerHistoryClass))
 37 
 38 typedef struct _TrackerHistory TrackerHistory;
 39 typedef struct _TrackerHistoryClass TrackerHistoryClass;
 40 typedef struct _TrackerHistoryPrivate TrackerHistoryPrivate;
 41 #define _g_free0(var) (var = (g_free (var), NULL))
 42 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
 43 #define _g_key_file_free0(var) ((var == NULL) ? NULL : (var = (g_key_file_free (var), NULL)))
 44 typedef struct _TrackerParamSpecHistory TrackerParamSpecHistory;
 45 
 46 struct _TrackerHistory {
 47 	GTypeInstance parent_instance;
 48 	volatile int ref_count;
 49 	TrackerHistoryPrivate * priv;
 50 };
 51 
 52 struct _TrackerHistoryClass {
 53 	GTypeClass parent_class;
 54 	void (*finalize) (TrackerHistory *self);
 55 };
 56 
 57 struct _TrackerHistoryPrivate {
 58 	GKeyFile* data;
 59 	gchar* filename;
 60 	gchar** history;
 61 	gint history_length1;
 62 	gint _history_size_;
 63 };
 64 
 65 struct _TrackerParamSpecHistory {
 66 	GParamSpec parent_instance;
 67 };
 68 
 69 
 70 static gpointer tracker_history_parent_class = NULL;
 71 
 72 gpointer tracker_history_ref (gpointer instance);
 73 void tracker_history_unref (gpointer instance);
 74 GParamSpec* tracker_param_spec_history (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
 75 void tracker_value_set_history (GValue* value, gpointer v_object);
 76 void tracker_value_take_history (GValue* value, gpointer v_object);
 77 gpointer tracker_value_get_history (const GValue* value);
 78 GType tracker_history_get_type (void) G_GNUC_CONST;
 79 #define TRACKER_HISTORY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRACKER_TYPE_HISTORY, TrackerHistoryPrivate))
 80 enum  {
 81 	TRACKER_HISTORY_DUMMY_PROPERTY
 82 };
 83 TrackerHistory* tracker_history_new (void);
 84 TrackerHistory* tracker_history_construct (GType object_type);
 85 void tracker_history_add (TrackerHistory* self, const gchar* criteria);
 86 static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value);
 87 gchar** tracker_history_get (TrackerHistory* self, int* result_length1);
 88 static gchar** _vala_array_dup1 (gchar** self, int length);
 89 static void tracker_history_finalize (TrackerHistory* obj);
 90 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
 91 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
 92 
 93 
 94 TrackerHistory* tracker_history_construct (GType object_type) {
 95 	TrackerHistory* self = NULL;
 96 	GKeyFile* _tmp0_;
 97 	const gchar* _tmp1_ = NULL;
 98 	gchar* _tmp2_ = NULL;
 99 	GKeyFile* _tmp14_;
100 	gboolean _tmp15_ = FALSE;
101 	gchar** _tmp23_;
102 	gint _tmp23__length1;
103 	GError * _inner_error_ = NULL;
104 	self = (TrackerHistory*) g_type_create_instance (object_type);
105 	g_debug ("tracker-history.vala:26: Loading history");
106 	_tmp0_ = g_key_file_new ();
107 	_g_key_file_free0 (self->priv->data);
108 	self->priv->data = _tmp0_;
109 	_tmp1_ = g_get_user_data_dir ();
110 	_tmp2_ = g_build_filename (_tmp1_, "tracker", "tracker-needle.txt", NULL, NULL);
111 	_g_free0 (self->priv->filename);
112 	self->priv->filename = _tmp2_;
113 	{
114 		GKeyFile* _tmp3_;
115 		const gchar* _tmp4_;
116 		_tmp3_ = self->priv->data;
117 		_tmp4_ = self->priv->filename;
118 		g_key_file_load_from_file (_tmp3_, _tmp4_, G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS, &_inner_error_);
119 		if (_inner_error_ != NULL) {
120 			if (_inner_error_->domain == G_KEY_FILE_ERROR) {
121 				goto __catch1_g_key_file_error;
122 			}
123 			if (_inner_error_->domain == G_FILE_ERROR) {
124 				goto __catch1_g_file_error;
125 			}
126 			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);
127 			g_clear_error (&_inner_error_);
128 			return NULL;
129 		}
130 	}
131 	goto __finally1;
132 	__catch1_g_key_file_error:
133 	{
134 		GError* e1 = NULL;
135 		const gchar* _tmp5_;
136 		GError* _tmp6_;
137 		const gchar* _tmp7_;
138 		e1 = _inner_error_;
139 		_inner_error_ = NULL;
140 		_tmp5_ = self->priv->filename;
141 		_tmp6_ = e1;
142 		_tmp7_ = _tmp6_->message;
143 		g_warning ("tracker-history.vala:34: Could not load history from file:'%s': %s", _tmp5_, _tmp7_);
144 		_g_error_free0 (e1);
145 		return self;
146 	}
147 	goto __finally1;
148 	__catch1_g_file_error:
149 	{
150 		GError* e2 = NULL;
151 		GError* _tmp8_;
152 		gint _tmp9_;
153 		e2 = _inner_error_;
154 		_inner_error_ = NULL;
155 		_tmp8_ = e2;
156 		_tmp9_ = _tmp8_->code;
157 		if (_tmp9_ == 4) {
158 			const gchar* _tmp10_;
159 			_tmp10_ = self->priv->filename;
160 			g_message ("tracker-history.vala:38: Creating new history file:'%s'", _tmp10_);
161 		} else {
162 			const gchar* _tmp11_;
163 			GError* _tmp12_;
164 			const gchar* _tmp13_;
165 			_tmp11_ = self->priv->filename;
166 			_tmp12_ = e2;
167 			_tmp13_ = _tmp12_->message;
168 			g_warning ("tracker-history.vala:40: Could not load history from file:'%s': %s", _tmp11_, _tmp13_);
169 		}
170 		_g_error_free0 (e2);
171 		return self;
172 	}
173 	__finally1:
174 	if (_inner_error_ != NULL) {
175 		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);
176 		g_clear_error (&_inner_error_);
177 		return NULL;
178 	}
179 	_tmp14_ = self->priv->data;
180 	_tmp15_ = g_key_file_has_group (_tmp14_, "History");
181 	if (_tmp15_ == FALSE) {
182 		g_debug ("tracker-history.vala:45:   No history found");
183 		return self;
184 	}
185 	{
186 		GKeyFile* _tmp16_;
187 		gsize _tmp17_;
188 		gchar** _tmp18_ = NULL;
189 		gchar** _tmp19_;
190 		gint _tmp19__length1;
191 		gint __tmp19__size_;
variable '__tmp19__size_' set but not used
(emitted by gcc)
192 _tmp16_ = self->priv->data; 193 _tmp18_ = g_key_file_get_string_list (_tmp16_, "History", "criteria", &_tmp17_, &_inner_error_); 194 _tmp19_ = _tmp18_; 195 _tmp19__length1 = _tmp17_; 196 __tmp19__size_ = _tmp19__length1;
Value stored to '__tmp19__size_' is never read
(emitted by clang-analyzer)

TODO: a detailed trace is available in the data model (not yet rendered in this report)

197 if (_inner_error_ != NULL) { 198 if (_inner_error_->domain == G_KEY_FILE_ERROR) { 199 goto __catch2_g_key_file_error; 200 } 201 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); 202 g_clear_error (&_inner_error_); 203 return NULL; 204 } 205 self->priv->history = (_vala_array_free (self->priv->history, self->priv->history_length1, (GDestroyNotify) g_free), NULL); 206 self->priv->history = _tmp19_; 207 self->priv->history_length1 = _tmp19__length1; 208 self->priv->_history_size_ = self->priv->history_length1; 209 } 210 goto __finally2; 211 __catch2_g_key_file_error: 212 { 213 GError* e1 = NULL; 214 const gchar* _tmp20_; 215 GError* _tmp21_; 216 const gchar* _tmp22_; 217 e1 = _inner_error_; 218 _inner_error_ = NULL; 219 _tmp20_ = self->priv->filename; 220 _tmp21_ = e1; 221 _tmp22_ = _tmp21_->message; 222 g_warning ("tracker-history.vala:52: Could not load history from file:'%s': %s", _tmp20_, _tmp22_); 223 _g_error_free0 (e1); 224 return self; 225 } 226 __finally2: 227 if (_inner_error_ != NULL) { 228 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); 229 g_clear_error (&_inner_error_); 230 return NULL; 231 } 232 _tmp23_ = self->priv->history;
Value stored to '_tmp23_' is never read
(emitted by clang-analyzer)

TODO: a detailed trace is available in the data model (not yet rendered in this report)

233 _tmp23__length1 = self->priv->history_length1; 234 g_debug ("tracker-history.vala:56: Found %d previous search histories", _tmp23__length1); 235 g_debug ("tracker-history.vala:58: Done"); 236 return self; 237 } 238 239 240 TrackerHistory* tracker_history_new (void) { 241 return tracker_history_construct (TRACKER_TYPE_HISTORY); 242 } 243 244 245 static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value) { 246 if ((*length) == (*size)) { 247 *size = (*size) ? (2 * (*size)) : 4; 248 *array = g_renew (gchar*, *array, (*size) + 1); 249 } 250 (*array)[(*length)++] = value; 251 (*array)[*length] = NULL; 252 } 253 254 255 void tracker_history_add (TrackerHistory* self, const gchar* criteria) { 256 const gchar* _tmp0_; 257 const gchar* _tmp1_; 258 gint _tmp2_; 259 gint _tmp3_; 260 gchar** _tmp4_; 261 gint _tmp4__length1; 262 gchar** _tmp8_; 263 gint _tmp8__length1; 264 const gchar* _tmp9_; 265 gchar* _tmp10_; 266 g_return_if_fail (self != NULL); 267 g_return_if_fail (criteria != NULL); 268 _tmp0_ = criteria; 269 _tmp1_ = criteria; 270 _tmp2_ = strlen (_tmp1_); 271 _tmp3_ = _tmp2_; 272 g_return_if_fail ((_tmp0_ != NULL) && (_tmp3_ > 0)); 273 _tmp4_ = self->priv->history; 274 _tmp4__length1 = self->priv->history_length1; 275 { 276 gchar** check_collection = NULL; 277 gint check_collection_length1 = 0; 278 gint _check_collection_size_ = 0;
unused variable '_check_collection_size_'
(emitted by gcc)
279 gint check_it = 0; 280 check_collection = _tmp4_; 281 check_collection_length1 = _tmp4__length1;
Value stored to 'check_collection_length1' is never read
(emitted by clang-analyzer)

TODO: a detailed trace is available in the data model (not yet rendered in this report)

282 for (check_it = 0; check_it < _tmp4__length1; check_it = check_it + 1) { 283 gchar* _tmp5_; 284 gchar* check = NULL; 285 _tmp5_ = g_strdup (check_collection[check_it]); 286 check = _tmp5_; 287 { 288 const gchar* _tmp6_; 289 const gchar* _tmp7_; 290 _tmp6_ = check; 291 _tmp7_ = criteria; 292 if (g_strcmp0 (_tmp6_, _tmp7_) == 0) { 293 _g_free0 (check); 294 return; 295 } 296 _g_free0 (check); 297 } 298 } 299 } 300 _tmp8_ = self->priv->history;
Value stored to '_tmp8_' is never read
(emitted by clang-analyzer)

TODO: a detailed trace is available in the data model (not yet rendered in this report)

301 _tmp8__length1 = self->priv->history_length1;
Value stored to '_tmp8__length1' is never read
(emitted by clang-analyzer)

TODO: a detailed trace is available in the data model (not yet rendered in this report)

302 _tmp9_ = criteria; 303 _tmp10_ = g_strdup (_tmp9_); 304 _vala_array_add1 (&self->priv->history, &self->priv->history_length1, &self->priv->_history_size_, _tmp10_); 305 } 306 307 308 static gchar** _vala_array_dup1 (gchar** self, int length) { 309 gchar** result; 310 int i; 311 result = g_new0 (gchar*, length + 1); 312 for (i = 0; i < length; i++) { 313 gchar* _tmp0_; 314 _tmp0_ = g_strdup (self[i]); 315 result[i] = _tmp0_; 316 } 317 return result; 318 } 319 320 321 gchar** tracker_history_get (TrackerHistory* self, int* result_length1) { 322 gchar** result = NULL; 323 gchar** _tmp0_; 324 gint _tmp0__length1; 325 gchar** _tmp1_; 326 gint _tmp1__length1; 327 gchar** _tmp2_; 328 gint _tmp2__length1; 329 g_return_val_if_fail (self != NULL, NULL); 330 _tmp0_ = self->priv->history; 331 _tmp0__length1 = self->priv->history_length1; 332 _tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup1 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_); 333 _tmp1__length1 = _tmp0__length1; 334 _tmp2_ = _tmp1_; 335 _tmp2__length1 = _tmp1__length1; 336 if (result_length1) { 337 *result_length1 = _tmp2__length1; 338 } 339 result = _tmp2_; 340 return result; 341 } 342 343 344 static void tracker_value_history_init (GValue* value) { 345 value->data[0].v_pointer = NULL; 346 } 347 348 349 static void tracker_value_history_free_value (GValue* value) { 350 if (value->data[0].v_pointer) { 351 tracker_history_unref (value->data[0].v_pointer); 352 } 353 } 354 355 356 static void tracker_value_history_copy_value (const GValue* src_value, GValue* dest_value) { 357 if (src_value->data[0].v_pointer) { 358 dest_value->data[0].v_pointer = tracker_history_ref (src_value->data[0].v_pointer); 359 } else { 360 dest_value->data[0].v_pointer = NULL; 361 } 362 } 363 364 365 static gpointer tracker_value_history_peek_pointer (const GValue* value) { 366 return value->data[0].v_pointer; 367 } 368 369 370 static gchar* tracker_value_history_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { 371 if (collect_values[0].v_pointer) { 372 TrackerHistory* object; 373 object = collect_values[0].v_pointer; 374 if (object->parent_instance.g_class == NULL) { 375 return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); 376 } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) { 377 return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); 378 } 379 value->data[0].v_pointer = tracker_history_ref (object); 380 } else { 381 value->data[0].v_pointer = NULL; 382 } 383 return NULL; 384 } 385 386 387 static gchar* tracker_value_history_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { 388 TrackerHistory** object_p; 389 object_p = collect_values[0].v_pointer; 390 if (!object_p) { 391 return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); 392 } 393 if (!value->data[0].v_pointer) { 394 *object_p = NULL; 395 } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { 396 *object_p = value->data[0].v_pointer; 397 } else { 398 *object_p = tracker_history_ref (value->data[0].v_pointer); 399 } 400 return NULL; 401 } 402 403 404 GParamSpec* tracker_param_spec_history (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { 405 TrackerParamSpecHistory* spec; 406 g_return_val_if_fail (g_type_is_a (object_type, TRACKER_TYPE_HISTORY), NULL); 407 spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags); 408 G_PARAM_SPEC (spec)->value_type = object_type; 409 return G_PARAM_SPEC (spec); 410 } 411 412 413 gpointer tracker_value_get_history (const GValue* value) { 414 g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TRACKER_TYPE_HISTORY), NULL); 415 return value->data[0].v_pointer; 416 } 417 418 419 void tracker_value_set_history (GValue* value, gpointer v_object) { 420 TrackerHistory* old; 421 g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TRACKER_TYPE_HISTORY)); 422 old = value->data[0].v_pointer; 423 if (v_object) { 424 g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TRACKER_TYPE_HISTORY)); 425 g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); 426 value->data[0].v_pointer = v_object; 427 tracker_history_ref (value->data[0].v_pointer); 428 } else { 429 value->data[0].v_pointer = NULL; 430 } 431 if (old) { 432 tracker_history_unref (old); 433 } 434 } 435 436 437 void tracker_value_take_history (GValue* value, gpointer v_object) { 438 TrackerHistory* old; 439 g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TRACKER_TYPE_HISTORY)); 440 old = value->data[0].v_pointer; 441 if (v_object) { 442 g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TRACKER_TYPE_HISTORY)); 443 g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); 444 value->data[0].v_pointer = v_object; 445 } else { 446 value->data[0].v_pointer = NULL; 447 } 448 if (old) { 449 tracker_history_unref (old); 450 } 451 } 452 453 454 static void tracker_history_class_init (TrackerHistoryClass * klass) { 455 tracker_history_parent_class = g_type_class_peek_parent (klass); 456 TRACKER_HISTORY_CLASS (klass)->finalize = tracker_history_finalize; 457 g_type_class_add_private (klass, sizeof (TrackerHistoryPrivate)); 458 } 459 460 461 static void tracker_history_instance_init (TrackerHistory * self) { 462 self->priv = TRACKER_HISTORY_GET_PRIVATE (self); 463 self->ref_count = 1; 464 } 465 466 467 static void tracker_history_finalize (TrackerHistory* obj) { 468 TrackerHistory * self; 469 GKeyFile* _tmp0_; 470 gchar** _tmp1_; 471 gint _tmp1__length1; 472 GError * _inner_error_ = NULL; 473 self = G_TYPE_CHECK_INSTANCE_CAST (obj, TRACKER_TYPE_HISTORY, TrackerHistory); 474 g_debug ("tracker-history.vala:62: Saving history"); 475 _tmp0_ = self->priv->data; 476 _tmp1_ = self->priv->history; 477 _tmp1__length1 = self->priv->history_length1; 478 g_key_file_set_string_list (_tmp0_, "History", "criteria", (const gchar* const*) _tmp1_, _tmp1__length1); 479 { 480 GKeyFile* _tmp2_; 481 gchar* _tmp3_ = NULL; 482 gchar* output; 483 const gchar* _tmp4_; 484 const gchar* _tmp5_; 485 _tmp2_ = self->priv->data; 486 _tmp3_ = g_key_file_to_data (_tmp2_, NULL, NULL); 487 output = _tmp3_; 488 _tmp4_ = self->priv->filename; 489 _tmp5_ = output; 490 g_file_set_contents (_tmp4_, _tmp5_, (gssize) (-1), &_inner_error_); 491 if (_inner_error_ != NULL) { 492 _g_free0 (output); 493 if (_inner_error_->domain == G_FILE_ERROR) { 494 goto __catch0_g_file_error; 495 } 496 _g_free0 (output); 497 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); 498 g_clear_error (&_inner_error_); 499 } 500 _g_free0 (output); 501 } 502 goto __finally0; 503 __catch0_g_file_error: 504 { 505 GError* e1 = NULL; 506 const gchar* _tmp6_; 507 GError* _tmp7_; 508 const gchar* _tmp8_; 509 e1 = _inner_error_; 510 _inner_error_ = NULL; 511 _tmp6_ = self->priv->filename; 512 _tmp7_ = e1; 513 _tmp8_ = _tmp7_->message; 514 g_warning ("tracker-history.vala:71: Could not save history to file:'%s': %s", _tmp6_, _tmp8_); 515 _g_error_free0 (e1); 516 } 517 __finally0: 518 if (_inner_error_ != NULL) { 519 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); 520 g_clear_error (&_inner_error_); 521 } 522 g_debug ("tracker-history.vala:74: Done"); 523 _g_key_file_free0 (self->priv->data); 524 _g_free0 (self->priv->filename); 525 self->priv->history = (_vala_array_free (self->priv->history, self->priv->history_length1, (GDestroyNotify) g_free), NULL); 526 } 527 528 529 GType tracker_history_get_type (void) { 530 static volatile gsize tracker_history_type_id__volatile = 0; 531 if (g_once_init_enter (&tracker_history_type_id__volatile)) { 532 static const GTypeValueTable g_define_type_value_table = { tracker_value_history_init, tracker_value_history_free_value, tracker_value_history_copy_value, tracker_value_history_peek_pointer, "p", tracker_value_history_collect_value, "p", tracker_value_history_lcopy_value }; 533 static const GTypeInfo g_define_type_info = { sizeof (TrackerHistoryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tracker_history_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TrackerHistory), 0, (GInstanceInitFunc) tracker_history_instance_init, &g_define_type_value_table }; 534 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) }; 535 GType tracker_history_type_id; 536 tracker_history_type_id = g_type_register_fundamental (g_type_fundamental_next (), "TrackerHistory", &g_define_type_info, &g_define_type_fundamental_info, 0); 537 g_once_init_leave (&tracker_history_type_id__volatile, tracker_history_type_id); 538 } 539 return tracker_history_type_id__volatile; 540 } 541 542 543 gpointer tracker_history_ref (gpointer instance) { 544 TrackerHistory* self; 545 self = instance; 546 g_atomic_int_inc (&self->ref_count); 547 return instance; 548 } 549 550 551 void tracker_history_unref (gpointer instance) { 552 TrackerHistory* self; 553 self = instance; 554 if (g_atomic_int_dec_and_test (&self->ref_count)) { 555 TRACKER_HISTORY_GET_CLASS (self)->finalize (self); 556 g_type_free_instance ((GTypeInstance *) self); 557 } 558 } 559 560 561 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { 562 if ((array != NULL) && (destroy_func != NULL)) { 563 int i; 564 for (i = 0; i < array_length; i = i + 1) { 565 if (((gpointer*) array)[i] != NULL) { 566 destroy_func (((gpointer*) array)[i]); 567 } 568 } 569 } 570 } 571 572 573 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { 574 _vala_array_destroy (array, array_length, destroy_func); 575 g_free (array); 576 }