Back to index

libunity  5.92.0
unity-appinfo-manager.c
Go to the documentation of this file.
00001 /* unity-appinfo-manager.c generated by valac 0.17.2, the Vala compiler
00002  * generated from unity-appinfo-manager.vala, do not modify */
00003 
00004 /*
00005  * Copyright (C) 2010 Canonical, Ltd.
00006  *
00007  * This library is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU Lesser General Public License
00009  * version 3.0 as published by the Free Software Foundation.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU Lesser General Public License version 3.0 for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library. If not, see
00018  * <http://www.gnu.org/licenses/>.
00019  *
00020  * Authored by Mikkel Kamstrup Erlandsen <mikkel.kamstrup@canonical.com>
00021  *
00022  */
00023 /*
00024  * IMPLEMENTATION NOTE:
00025  * We want the generatedd C API to be nice and not too Vala-ish. We must
00026  * anticipate that place daemons consuming libunity will be written in
00027  * both Vala and C.
00028  *
00029  */
00030 
00031 #include <glib.h>
00032 #include <glib-object.h>
00033 #include <stdlib.h>
00034 #include <string.h>
00035 #include "unity.h"
00036 #include <gio/gio.h>
00037 #include <unity-trace.h>
00038 #include <gio/gdesktopappinfo.h>
00039 #include <gobject/gvaluecollector.h>
00040 
00041 
00042 #define UNITY_TYPE_STRING_ARRAY_WRAPPER (unity_string_array_wrapper_get_type ())
00043 #define UNITY_STRING_ARRAY_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_STRING_ARRAY_WRAPPER, UnityStringArrayWrapper))
00044 #define UNITY_STRING_ARRAY_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_STRING_ARRAY_WRAPPER, UnityStringArrayWrapperClass))
00045 #define UNITY_IS_STRING_ARRAY_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_STRING_ARRAY_WRAPPER))
00046 #define UNITY_IS_STRING_ARRAY_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_STRING_ARRAY_WRAPPER))
00047 #define UNITY_STRING_ARRAY_WRAPPER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_STRING_ARRAY_WRAPPER, UnityStringArrayWrapperClass))
00048 
00049 typedef struct _UnityStringArrayWrapper UnityStringArrayWrapper;
00050 typedef struct _UnityStringArrayWrapperClass UnityStringArrayWrapperClass;
00051 typedef struct _UnityStringArrayWrapperPrivate UnityStringArrayWrapperPrivate;
00052 typedef struct _UnityParamSpecStringArrayWrapper UnityParamSpecStringArrayWrapper;
00053 #define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
00054 #define _g_free0(var) (var = (g_free (var), NULL))
00055 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
00056 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
00057 #define _g_key_file_free0(var) ((var == NULL) ? NULL : (var = (g_key_file_free (var), NULL)))
00058 #define _unity_string_array_wrapper_unref0(var) ((var == NULL) ? NULL : (var = (unity_string_array_wrapper_unref (var), NULL)))
00059 typedef struct _UnityAppInfoManagerLookupAsyncData UnityAppInfoManagerLookupAsyncData;
00060 
00061 struct _UnityStringArrayWrapper {
00062        GTypeInstance parent_instance;
00063        volatile int ref_count;
00064        UnityStringArrayWrapperPrivate * priv;
00065        gchar** strings;
00066        gint strings_length1;
00067        gint _strings_size_;
00068 };
00069 
00070 struct _UnityStringArrayWrapperClass {
00071        GTypeClass parent_class;
00072        void (*finalize) (UnityStringArrayWrapper *self);
00073 };
00074 
00075 struct _UnityParamSpecStringArrayWrapper {
00076        GParamSpec parent_instance;
00077 };
00078 
00079 struct _UnityAppInfoManagerPrivate {
00080        GHashTable* appinfo_by_id;
00081        GHashTable* monitors;
00082        GHashTable* categories_by_id;
00083        GHashTable* keywords_by_id;
00084        GHashTable* paths_by_id;
00085 };
00086 
00087 struct _UnityAppInfoManagerLookupAsyncData {
00088        int _state_;
00089        GObject* _source_object_;
00090        GAsyncResult* _res_;
00091        GSimpleAsyncResult* _async_result;
00092        UnityAppInfoManager* self;
00093        gchar* id;
00094        GAppInfo* result;
00095        GHashTable* _tmp0_;
00096        const gchar* _tmp1_;
00097        gboolean _tmp2_;
00098        GHashTable* _tmp3_;
00099        const gchar* _tmp4_;
00100        gconstpointer _tmp5_;
00101        GAppInfo* _tmp6_;
00102        gsize data_size;
00103        guint8* data;
00104        gint data_length1;
00105        gint _data_size_;
00106        GFileInputStream* input;
00107        const gchar* _tmp7_;
00108        gboolean _tmp8_;
00109        const gchar* _tmp9_;
00110        GFile* _tmp10_;
00111        GFile* f;
00112        GFile* _tmp11_;
00113        GFileInputStream* _tmp12_;
00114        GFileInputStream* _tmp13_;
00115        GFile* _tmp14_;
00116        GFile* _tmp15_;
00117        GFile* dir;
00118        GFile* _tmp16_;
00119        gchar* _tmp17_;
00120        gchar* dir_uri;
00121        GHashTable* _tmp18_;
00122        const gchar* _tmp19_;
00123        gconstpointer _tmp20_;
00124        GFile* _tmp21_;
00125        GFileMonitor* _tmp22_;
00126        GFileMonitor* monitor;
00127        GFileMonitor* _tmp23_;
00128        GHashTable* _tmp24_;
00129        const gchar* _tmp25_;
00130        gchar* _tmp26_;
00131        GFileMonitor* _tmp27_;
00132        GFileMonitor* _tmp28_;
00133        const gchar* _tmp29_;
00134        GError* ioe;
00135        const gchar* _tmp30_;
00136        GError* _tmp31_;
00137        const gchar* _tmp32_;
00138        const gchar* _tmp33_;
00139        gchar* _tmp34_;
00140        gchar* path;
00141        const gchar* _tmp35_;
00142        GFileInputStream* _tmp36_;
00143        GFileInputStream* _tmp37_;
00144        GFileInputStream* _tmp38_;
00145        GHashTable* _tmp39_;
00146        const gchar* _tmp40_;
00147        gchar* _tmp41_;
00148        GFileInputStream* _tmp42_;
00149        guint8* _tmp43_;
00150        gint _tmp44_;
00151        gsize _tmp45_;
00152        GError* e;
00153        const gchar* _tmp46_;
00154        GError* _tmp47_;
00155        const gchar* _tmp48_;
00156        GKeyFile* _tmp49_;
00157        GKeyFile* keyfile;
00158        GKeyFile* _tmp50_;
00159        guint8* _tmp51_;
00160        gint _tmp51__length1;
00161        gsize _tmp52_;
00162        GError* ee;
00163        const gchar* _tmp53_;
00164        GError* _tmp54_;
00165        const gchar* _tmp55_;
00166        GKeyFile* _tmp56_;
00167        GDesktopAppInfo* _tmp57_;
00168        GDesktopAppInfo* appinfo;
00169        GHashTable* _tmp58_;
00170        const gchar* _tmp59_;
00171        gchar* _tmp60_;
00172        GDesktopAppInfo* _tmp61_;
00173        GAppInfo* _tmp62_;
00174        const gchar* _tmp63_;
00175        GKeyFile* _tmp64_;
00176        const gchar* _tmp65_;
00177        GKeyFile* _tmp66_;
00178        GError * _inner_error_;
00179 };
00180 
00181 
00182 static gpointer unity_string_array_wrapper_parent_class = NULL;
00183 static gpointer unity_app_info_manager_parent_class = NULL;
00184 static UnityAppInfoManager* unity_app_info_manager_singleton;
00185 static UnityAppInfoManager* unity_app_info_manager_singleton = NULL;
00186 
00187 gpointer unity_string_array_wrapper_ref (gpointer instance);
00188 void unity_string_array_wrapper_unref (gpointer instance);
00189 GParamSpec* unity_param_spec_string_array_wrapper (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
00190 void unity_value_set_string_array_wrapper (GValue* value, gpointer v_object);
00191 void unity_value_take_string_array_wrapper (GValue* value, gpointer v_object);
00192 gpointer unity_value_get_string_array_wrapper (const GValue* value);
00193 GType unity_string_array_wrapper_get_type (void) G_GNUC_CONST;
00194 enum  {
00195        UNITY_STRING_ARRAY_WRAPPER_DUMMY_PROPERTY
00196 };
00197 void unity_string_array_wrapper_take_strings (UnityStringArrayWrapper* self, gchar** str_arr, int str_arr_length1);
00198 UnityStringArrayWrapper* unity_string_array_wrapper_new (void);
00199 UnityStringArrayWrapper* unity_string_array_wrapper_construct (GType object_type);
00200 static void unity_string_array_wrapper_finalize (UnityStringArrayWrapper* obj);
00201 #define UNITY_APP_INFO_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_APP_INFO_MANAGER, UnityAppInfoManagerPrivate))
00202 enum  {
00203        UNITY_APP_INFO_MANAGER_DUMMY_PROPERTY
00204 };
00205 static UnityAppInfoManager* unity_app_info_manager_new (void);
00206 static UnityAppInfoManager* unity_app_info_manager_construct (GType object_type);
00207 static void _g_free0_ (gpointer var);
00208 static void _g_object_unref0_ (gpointer var);
00209 static void _unity_string_array_wrapper_unref0_ (gpointer var);
00210 static void unity_app_info_manager_on_dir_changed (UnityAppInfoManager* self, GFileMonitor* mon, GFile* file, GFile* other_file, GFileMonitorEvent e);
00211 static void _unity_app_info_manager_on_dir_changed_g_file_monitor_changed (GFileMonitor* _sender, GFile* file, GFile* other_file, GFileMonitorEvent event_type, gpointer self);
00212 static void unity_app_info_manager_register_categories (UnityAppInfoManager* self, const gchar* id, GKeyFile* keyfile);
00213 static void unity_app_info_manager_register_keywords (UnityAppInfoManager* self, const gchar* id, GKeyFile* keyfile);
00214 static void unity_app_info_manager_lookup_async_data_free (gpointer _data);
00215 static gboolean unity_app_info_manager_lookup_async_co (UnityAppInfoManagerLookupAsyncData* _data_);
00216 static void unity_app_info_manager_lookup_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
00217 static void g_cclosure_user_marshal_VOID__STRING_OBJECT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
00218 static void unity_app_info_manager_finalize (GObject* obj);
00219 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
00220 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
00221 
00222 
00223 void unity_string_array_wrapper_take_strings (UnityStringArrayWrapper* self, gchar** str_arr, int str_arr_length1) {
00224        gchar** _tmp0_;
00225        gint _tmp0__length1;
00226        g_return_if_fail (self != NULL);
00227        _tmp0_ = str_arr;
00228        _tmp0__length1 = str_arr_length1;
00229        str_arr = NULL;
00230        self->strings = (_vala_array_free (self->strings, self->strings_length1, (GDestroyNotify) g_free), NULL);
00231        self->strings = _tmp0_;
00232        self->strings_length1 = _tmp0__length1;
00233        self->_strings_size_ = self->strings_length1;
00234        str_arr = (_vala_array_free (str_arr, str_arr_length1, (GDestroyNotify) g_free), NULL);
00235 }
00236 
00237 
00238 UnityStringArrayWrapper* unity_string_array_wrapper_construct (GType object_type) {
00239        UnityStringArrayWrapper* self = NULL;
00240        self = (UnityStringArrayWrapper*) g_type_create_instance (object_type);
00241        return self;
00242 }
00243 
00244 
00245 UnityStringArrayWrapper* unity_string_array_wrapper_new (void) {
00246        return unity_string_array_wrapper_construct (UNITY_TYPE_STRING_ARRAY_WRAPPER);
00247 }
00248 
00249 
00250 static void unity_value_string_array_wrapper_init (GValue* value) {
00251        value->data[0].v_pointer = NULL;
00252 }
00253 
00254 
00255 static void unity_value_string_array_wrapper_free_value (GValue* value) {
00256        if (value->data[0].v_pointer) {
00257               unity_string_array_wrapper_unref (value->data[0].v_pointer);
00258        }
00259 }
00260 
00261 
00262 static void unity_value_string_array_wrapper_copy_value (const GValue* src_value, GValue* dest_value) {
00263        if (src_value->data[0].v_pointer) {
00264               dest_value->data[0].v_pointer = unity_string_array_wrapper_ref (src_value->data[0].v_pointer);
00265        } else {
00266               dest_value->data[0].v_pointer = NULL;
00267        }
00268 }
00269 
00270 
00271 static gpointer unity_value_string_array_wrapper_peek_pointer (const GValue* value) {
00272        return value->data[0].v_pointer;
00273 }
00274 
00275 
00276 static gchar* unity_value_string_array_wrapper_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
00277        if (collect_values[0].v_pointer) {
00278               UnityStringArrayWrapper* object;
00279               object = collect_values[0].v_pointer;
00280               if (object->parent_instance.g_class == NULL) {
00281                      return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
00282               } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
00283                      return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
00284               }
00285               value->data[0].v_pointer = unity_string_array_wrapper_ref (object);
00286        } else {
00287               value->data[0].v_pointer = NULL;
00288        }
00289        return NULL;
00290 }
00291 
00292 
00293 static gchar* unity_value_string_array_wrapper_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
00294        UnityStringArrayWrapper** object_p;
00295        object_p = collect_values[0].v_pointer;
00296        if (!object_p) {
00297               return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
00298        }
00299        if (!value->data[0].v_pointer) {
00300               *object_p = NULL;
00301        } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
00302               *object_p = value->data[0].v_pointer;
00303        } else {
00304               *object_p = unity_string_array_wrapper_ref (value->data[0].v_pointer);
00305        }
00306        return NULL;
00307 }
00308 
00309 
00310 GParamSpec* unity_param_spec_string_array_wrapper (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
00311        UnityParamSpecStringArrayWrapper* spec;
00312        g_return_val_if_fail (g_type_is_a (object_type, UNITY_TYPE_STRING_ARRAY_WRAPPER), NULL);
00313        spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
00314        G_PARAM_SPEC (spec)->value_type = object_type;
00315        return G_PARAM_SPEC (spec);
00316 }
00317 
00318 
00319 gpointer unity_value_get_string_array_wrapper (const GValue* value) {
00320        g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_TYPE_STRING_ARRAY_WRAPPER), NULL);
00321        return value->data[0].v_pointer;
00322 }
00323 
00324 
00325 void unity_value_set_string_array_wrapper (GValue* value, gpointer v_object) {
00326        UnityStringArrayWrapper* old;
00327        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_TYPE_STRING_ARRAY_WRAPPER));
00328        old = value->data[0].v_pointer;
00329        if (v_object) {
00330               g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, UNITY_TYPE_STRING_ARRAY_WRAPPER));
00331               g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
00332               value->data[0].v_pointer = v_object;
00333               unity_string_array_wrapper_ref (value->data[0].v_pointer);
00334        } else {
00335               value->data[0].v_pointer = NULL;
00336        }
00337        if (old) {
00338               unity_string_array_wrapper_unref (old);
00339        }
00340 }
00341 
00342 
00343 void unity_value_take_string_array_wrapper (GValue* value, gpointer v_object) {
00344        UnityStringArrayWrapper* old;
00345        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_TYPE_STRING_ARRAY_WRAPPER));
00346        old = value->data[0].v_pointer;
00347        if (v_object) {
00348               g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, UNITY_TYPE_STRING_ARRAY_WRAPPER));
00349               g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
00350               value->data[0].v_pointer = v_object;
00351        } else {
00352               value->data[0].v_pointer = NULL;
00353        }
00354        if (old) {
00355               unity_string_array_wrapper_unref (old);
00356        }
00357 }
00358 
00359 
00360 static void unity_string_array_wrapper_class_init (UnityStringArrayWrapperClass * klass) {
00361        unity_string_array_wrapper_parent_class = g_type_class_peek_parent (klass);
00362        UNITY_STRING_ARRAY_WRAPPER_CLASS (klass)->finalize = unity_string_array_wrapper_finalize;
00363 }
00364 
00365 
00366 static void unity_string_array_wrapper_instance_init (UnityStringArrayWrapper * self) {
00367        self->ref_count = 1;
00368 }
00369 
00370 
00371 static void unity_string_array_wrapper_finalize (UnityStringArrayWrapper* obj) {
00372        UnityStringArrayWrapper * self;
00373        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_STRING_ARRAY_WRAPPER, UnityStringArrayWrapper);
00374        self->strings = (_vala_array_free (self->strings, self->strings_length1, (GDestroyNotify) g_free), NULL);
00375 }
00376 
00377 
00378 GType unity_string_array_wrapper_get_type (void) {
00379        static volatile gsize unity_string_array_wrapper_type_id__volatile = 0;
00380        if (g_once_init_enter (&unity_string_array_wrapper_type_id__volatile)) {
00381               static const GTypeValueTable g_define_type_value_table = { unity_value_string_array_wrapper_init, unity_value_string_array_wrapper_free_value, unity_value_string_array_wrapper_copy_value, unity_value_string_array_wrapper_peek_pointer, "p", unity_value_string_array_wrapper_collect_value, "p", unity_value_string_array_wrapper_lcopy_value };
00382               static const GTypeInfo g_define_type_info = { sizeof (UnityStringArrayWrapperClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_string_array_wrapper_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityStringArrayWrapper), 0, (GInstanceInitFunc) unity_string_array_wrapper_instance_init, &g_define_type_value_table };
00383               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) };
00384               GType unity_string_array_wrapper_type_id;
00385               unity_string_array_wrapper_type_id = g_type_register_fundamental (g_type_fundamental_next (), "UnityStringArrayWrapper", &g_define_type_info, &g_define_type_fundamental_info, 0);
00386               g_once_init_leave (&unity_string_array_wrapper_type_id__volatile, unity_string_array_wrapper_type_id);
00387        }
00388        return unity_string_array_wrapper_type_id__volatile;
00389 }
00390 
00391 
00392 gpointer unity_string_array_wrapper_ref (gpointer instance) {
00393        UnityStringArrayWrapper* self;
00394        self = instance;
00395        g_atomic_int_inc (&self->ref_count);
00396        return instance;
00397 }
00398 
00399 
00400 void unity_string_array_wrapper_unref (gpointer instance) {
00401        UnityStringArrayWrapper* self;
00402        self = instance;
00403        if (g_atomic_int_dec_and_test (&self->ref_count)) {
00404               UNITY_STRING_ARRAY_WRAPPER_GET_CLASS (self)->finalize (self);
00405               g_type_free_instance ((GTypeInstance *) self);
00406        }
00407 }
00408 
00409 
00410 static void _g_free0_ (gpointer var) {
00411        var = (g_free (var), NULL);
00412 }
00413 
00414 
00415 static void _g_object_unref0_ (gpointer var) {
00416        (var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
00417 }
00418 
00419 
00420 static void _unity_string_array_wrapper_unref0_ (gpointer var) {
00421        (var == NULL) ? NULL : (var = (unity_string_array_wrapper_unref (var), NULL));
00422 }
00423 
00424 
00425 static void _unity_app_info_manager_on_dir_changed_g_file_monitor_changed (GFileMonitor* _sender, GFile* file, GFile* other_file, GFileMonitorEvent event_type, gpointer self) {
00426        unity_app_info_manager_on_dir_changed (self, _sender, file, other_file, event_type);
00427 }
00428 
00429 
00430 static gpointer _g_object_ref0 (gpointer self) {
00431        return self ? g_object_ref (self) : NULL;
00432 }
00433 
00434 
00435 static UnityAppInfoManager* unity_app_info_manager_construct (GType object_type) {
00436        UnityAppInfoManager * self = NULL;
00437        GHashFunc _tmp0_;
00438        GEqualFunc _tmp1_;
00439        GHashTable* _tmp2_;
00440        GHashFunc _tmp3_;
00441        GEqualFunc _tmp4_;
00442        GHashTable* _tmp5_;
00443        GHashFunc _tmp6_;
00444        GEqualFunc _tmp7_;
00445        GHashTable* _tmp8_;
00446        GHashFunc _tmp9_;
00447        GEqualFunc _tmp10_;
00448        GHashTable* _tmp11_;
00449        GHashFunc _tmp12_;
00450        GEqualFunc _tmp13_;
00451        GHashTable* _tmp14_;
00452        gint _tmp15_ = 0;
00453        gchar** _tmp16_ = NULL;
00454        GError * _inner_error_ = NULL;
00455        self = (UnityAppInfoManager*) g_object_new (object_type, NULL);
00456        _tmp0_ = g_str_hash;
00457        _tmp1_ = g_str_equal;
00458        _tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_object_unref0_);
00459        _g_hash_table_unref0 (self->priv->appinfo_by_id);
00460        self->priv->appinfo_by_id = _tmp2_;
00461        _tmp3_ = g_str_hash;
00462        _tmp4_ = g_str_equal;
00463        _tmp5_ = g_hash_table_new_full (_tmp3_, _tmp4_, _g_free0_, _unity_string_array_wrapper_unref0_);
00464        _g_hash_table_unref0 (self->priv->categories_by_id);
00465        self->priv->categories_by_id = _tmp5_;
00466        _tmp6_ = g_str_hash;
00467        _tmp7_ = g_str_equal;
00468        _tmp8_ = g_hash_table_new_full (_tmp6_, _tmp7_, _g_free0_, _unity_string_array_wrapper_unref0_);
00469        _g_hash_table_unref0 (self->priv->keywords_by_id);
00470        self->priv->keywords_by_id = _tmp8_;
00471        _tmp9_ = g_str_hash;
00472        _tmp10_ = g_str_equal;
00473        _tmp11_ = g_hash_table_new_full (_tmp9_, _tmp10_, _g_free0_, _g_free0_);
00474        _g_hash_table_unref0 (self->priv->paths_by_id);
00475        self->priv->paths_by_id = _tmp11_;
00476        _tmp12_ = g_str_hash;
00477        _tmp13_ = g_str_equal;
00478        _tmp14_ = g_hash_table_new_full (_tmp12_, _tmp13_, _g_free0_, _g_object_unref0_);
00479        _g_hash_table_unref0 (self->priv->monitors);
00480        self->priv->monitors = _tmp14_;
00481        _tmp16_ = unity_io_get_system_data_dirs (&_tmp15_);
00482        {
00483               gchar** path_collection = NULL;
00484               gint path_collection_length1 = 0;
00485               gint _path_collection_size_ = 0;
00486               gint path_it = 0;
00487               path_collection = _tmp16_;
00488               path_collection_length1 = _tmp15_;
00489               for (path_it = 0; path_it < _tmp15_; path_it = path_it + 1) {
00490                      gchar* _tmp17_;
00491                      gchar* path = NULL;
00492                      _tmp17_ = g_strdup (path_collection[path_it]);
00493                      path = _tmp17_;
00494                      {
00495                             const gchar* _tmp18_;
00496                             gchar* _tmp19_ = NULL;
00497                             gchar* _tmp20_;
00498                             GFile* _tmp21_ = NULL;
00499                             GFile* _tmp22_;
00500                             GFile* dir;
00501                             _tmp18_ = path;
00502                             _tmp19_ = g_build_filename (_tmp18_, "applications", NULL);
00503                             _tmp20_ = _tmp19_;
00504                             _tmp21_ = g_file_new_for_path (_tmp20_);
00505                             _tmp22_ = _tmp21_;
00506                             _g_free0 (_tmp20_);
00507                             dir = _tmp22_;
00508                             {
00509                                    GFile* _tmp23_;
00510                                    GFileMonitor* _tmp24_ = NULL;
00511                                    GFileMonitor* monitor;
00512                                    GFileMonitor* _tmp25_;
00513                                    GHashTable* _tmp26_;
00514                                    GFile* _tmp27_;
00515                                    gchar* _tmp28_ = NULL;
00516                                    GFileMonitor* _tmp29_;
00517                                    GFileMonitor* _tmp30_;
00518                                    _tmp23_ = dir;
00519                                    _tmp24_ = g_file_monitor_directory (_tmp23_, G_FILE_MONITOR_NONE, NULL, &_inner_error_);
00520                                    monitor = _tmp24_;
00521                                    if (_inner_error_ != NULL) {
00522                                           if (_inner_error_->domain == G_IO_ERROR) {
00523                                                  goto __catch0_g_io_error;
00524                                           }
00525                                           _g_object_unref0 (dir);
00526                                           _g_free0 (path);
00527                                           path_collection = (_vala_array_free (path_collection, path_collection_length1, (GDestroyNotify) g_free), NULL);
00528                                           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);
00529                                           g_clear_error (&_inner_error_);
00530                                           return NULL;
00531                                    }
00532                                    _tmp25_ = monitor;
00533                                    g_signal_connect_object (_tmp25_, "changed", (GCallback) _unity_app_info_manager_on_dir_changed_g_file_monitor_changed, self, 0);
00534                                    _tmp26_ = self->priv->monitors;
00535                                    _tmp27_ = dir;
00536                                    _tmp28_ = g_file_get_uri (_tmp27_);
00537                                    _tmp29_ = monitor;
00538                                    _tmp30_ = _g_object_ref0 (_tmp29_);
00539                                    g_hash_table_insert (_tmp26_, _tmp28_, _tmp30_);
00540                                    _g_object_unref0 (monitor);
00541                             }
00542                             goto __finally0;
00543                             __catch0_g_io_error:
00544                             {
00545                                    GError* e = NULL;
00546                                    GFile* _tmp31_;
00547                                    gchar* _tmp32_ = NULL;
00548                                    gchar* _tmp33_;
00549                                    GError* _tmp34_;
00550                                    const gchar* _tmp35_;
00551                                    e = _inner_error_;
00552                                    _inner_error_ = NULL;
00553                                    _tmp31_ = dir;
00554                                    _tmp32_ = g_file_get_uri (_tmp31_);
00555                                    _tmp33_ = _tmp32_;
00556                                    _tmp34_ = e;
00557                                    _tmp35_ = _tmp34_->message;
00558                                    g_warning ("unity-appinfo-manager.vala:83: Error setting up directory monitor on '" \
00559 "%s': %s", _tmp33_, _tmp35_);
00560                                    _g_free0 (_tmp33_);
00561                                    _g_error_free0 (e);
00562                             }
00563                             __finally0:
00564                             if (_inner_error_ != NULL) {
00565                                    _g_object_unref0 (dir);
00566                                    _g_free0 (path);
00567                                    path_collection = (_vala_array_free (path_collection, path_collection_length1, (GDestroyNotify) g_free), NULL);
00568                                    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);
00569                                    g_clear_error (&_inner_error_);
00570                                    return NULL;
00571                             }
00572                             _g_object_unref0 (dir);
00573                             _g_free0 (path);
00574                      }
00575               }
00576               path_collection = (_vala_array_free (path_collection, path_collection_length1, (GDestroyNotify) g_free), NULL);
00577        }
00578        return self;
00579 }
00580 
00581 
00582 static UnityAppInfoManager* unity_app_info_manager_new (void) {
00583        return unity_app_info_manager_construct (UNITY_TYPE_APP_INFO_MANAGER);
00584 }
00585 
00586 
00587 UnityAppInfoManager* unity_app_info_manager_get_instance (void) {
00588        UnityAppInfoManager* result = NULL;
00589        UnityAppInfoManager* _tmp0_ = NULL;
00590        _tmp0_ = unity_app_info_manager_get_default ();
00591        result = _tmp0_;
00592        return result;
00593 }
00594 
00595 
00599 UnityAppInfoManager* unity_app_info_manager_get_default (void) {
00600        UnityAppInfoManager* result = NULL;
00601        UnityAppInfoManager* _tmp0_;
00602        UnityAppInfoManager* _tmp2_;
00603        UnityAppInfoManager* _tmp3_;
00604        _tmp0_ = unity_app_info_manager_singleton;
00605        if (_tmp0_ == NULL) {
00606               UnityAppInfoManager* _tmp1_;
00607               _tmp1_ = unity_app_info_manager_new ();
00608               _g_object_unref0 (unity_app_info_manager_singleton);
00609               unity_app_info_manager_singleton = _tmp1_;
00610        }
00611        _tmp2_ = unity_app_info_manager_singleton;
00612        _tmp3_ = _g_object_ref0 (_tmp2_);
00613        result = _tmp3_;
00614        return result;
00615 }
00616 
00617 
00618 static void unity_app_info_manager_on_dir_changed (UnityAppInfoManager* self, GFileMonitor* mon, GFile* file, GFile* other_file, GFileMonitorEvent e) {
00619        GFile* _tmp0_;
00620        gchar* _tmp1_ = NULL;
00621        gchar* desktop_id;
00622        GFile* _tmp2_;
00623        gchar* _tmp3_ = NULL;
00624        gchar* path;
00625        GAppInfo* appinfo = NULL;
00626        GHashTable* _tmp4_;
00627        const gchar* _tmp5_;
00628        gboolean _tmp6_ = FALSE;
00629        GHashTable* _tmp11_;
00630        const gchar* _tmp12_;
00631        gboolean _tmp13_ = FALSE;
00632        g_return_if_fail (self != NULL);
00633        g_return_if_fail (mon != NULL);
00634        g_return_if_fail (file != NULL);
00635        _tmp0_ = file;
00636        _tmp1_ = g_file_get_basename (_tmp0_);
00637        desktop_id = _tmp1_;
00638        _tmp2_ = file;
00639        _tmp3_ = g_file_get_path (_tmp2_);
00640        path = _tmp3_;
00641        _tmp4_ = self->priv->appinfo_by_id;
00642        _tmp5_ = desktop_id;
00643        _tmp6_ = g_hash_table_remove (_tmp4_, _tmp5_);
00644        if (_tmp6_) {
00645               const gchar* _tmp7_;
00646               GAppInfo* _tmp8_ = NULL;
00647               const gchar* _tmp9_;
00648               GAppInfo* _tmp10_;
00649               _tmp7_ = desktop_id;
00650               _tmp8_ = unity_app_info_manager_lookup (self, _tmp7_);
00651               _g_object_unref0 (appinfo);
00652               appinfo = _tmp8_;
00653               _tmp9_ = desktop_id;
00654               _tmp10_ = appinfo;
00655               g_signal_emit_by_name (self, "changed", _tmp9_, _tmp10_);
00656        }
00657        _tmp11_ = self->priv->appinfo_by_id;
00658        _tmp12_ = path;
00659        _tmp13_ = g_hash_table_remove (_tmp11_, _tmp12_);
00660        if (_tmp13_) {
00661               const gchar* _tmp14_;
00662               GAppInfo* _tmp15_ = NULL;
00663               const gchar* _tmp16_;
00664               GAppInfo* _tmp17_;
00665               _tmp14_ = path;
00666               _tmp15_ = unity_app_info_manager_lookup (self, _tmp14_);
00667               _g_object_unref0 (appinfo);
00668               appinfo = _tmp15_;
00669               _tmp16_ = path;
00670               _tmp17_ = appinfo;
00671               g_signal_emit_by_name (self, "changed", _tmp16_, _tmp17_);
00672        }
00673        _g_object_unref0 (appinfo);
00674        _g_free0 (path);
00675        _g_free0 (desktop_id);
00676 }
00677 
00678 
00687 GAppInfo* unity_app_info_manager_lookup (UnityAppInfoManager* self, const gchar* id) {
00688        GAppInfo* result = NULL;
00689        GHashTable* _tmp0_;
00690        const gchar* _tmp1_;
00691        gboolean _tmp2_ = FALSE;
00692        GAppInfo* appinfo = NULL;
00693        GKeyFile* _tmp7_;
00694        GKeyFile* keyfile;
00695        const gchar* _tmp8_;
00696        gboolean _tmp9_ = FALSE;
00697        GKeyFile* _tmp74_;
00698        GHashTable* _tmp81_;
00699        const gchar* _tmp82_;
00700        gchar* _tmp83_;
00701        GAppInfo* _tmp84_;
00702        GAppInfo* _tmp85_;
00703        GError * _inner_error_ = NULL;
00704        g_return_val_if_fail (self != NULL, NULL);
00705        g_return_val_if_fail (id != NULL, NULL);
00706        _tmp0_ = self->priv->appinfo_by_id;
00707        _tmp1_ = id;
00708        _tmp2_ = g_hash_table_lookup_extended (_tmp0_, _tmp1_, NULL, NULL);
00709        if (_tmp2_) {
00710               GHashTable* _tmp3_;
00711               const gchar* _tmp4_;
00712               gconstpointer _tmp5_ = NULL;
00713               GAppInfo* _tmp6_;
00714               _tmp3_ = self->priv->appinfo_by_id;
00715               _tmp4_ = id;
00716               _tmp5_ = g_hash_table_lookup (_tmp3_, _tmp4_);
00717               _tmp6_ = _g_object_ref0 ((GAppInfo*) _tmp5_);
00718               result = _tmp6_;
00719               return result;
00720        }
00721        _tmp7_ = g_key_file_new ();
00722        keyfile = _tmp7_;
00723        _tmp8_ = id;
00724        _tmp9_ = g_str_has_prefix (_tmp8_, "/");
00725        if (_tmp9_) {
00726               GHashTable* _tmp10_;
00727               const gchar* _tmp11_;
00728               gchar* _tmp12_;
00729               const gchar* _tmp13_;
00730               gchar* _tmp14_;
00731               const gchar* _tmp24_;
00732               GFile* _tmp25_ = NULL;
00733               GFile* _tmp26_;
00734               GFile* _tmp27_ = NULL;
00735               GFile* _tmp28_;
00736               GFile* dir;
00737               GFile* _tmp29_;
00738               gchar* _tmp30_ = NULL;
00739               gchar* dir_uri;
00740               GHashTable* _tmp31_;
00741               const gchar* _tmp32_;
00742               gconstpointer _tmp33_ = NULL;
00743               _tmp10_ = self->priv->paths_by_id;
00744               _tmp11_ = id;
00745               _tmp12_ = g_strdup (_tmp11_);
00746               _tmp13_ = id;
00747               _tmp14_ = g_strdup (_tmp13_);
00748               g_hash_table_insert (_tmp10_, _tmp12_, _tmp14_);
00749               {
00750                      GKeyFile* _tmp15_;
00751                      const gchar* _tmp16_;
00752                      _tmp15_ = keyfile;
00753                      _tmp16_ = id;
00754                      g_key_file_load_from_file (_tmp15_, _tmp16_, G_KEY_FILE_NONE, &_inner_error_);
00755                      if (_inner_error_ != NULL) {
00756                             goto __catch1_g_error;
00757                      }
00758               }
00759               goto __finally1;
00760               __catch1_g_error:
00761               {
00762                      GError* e = NULL;
00763                      gboolean _tmp17_ = FALSE;
00764                      GError* _tmp18_;
00765                      gboolean _tmp20_;
00766                      e = _inner_error_;
00767                      _inner_error_ = NULL;
00768                      _g_key_file_free0 (keyfile);
00769                      keyfile = NULL;
00770                      _tmp18_ = e;
00771                      if (g_error_matches (_tmp18_, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) {
00772                             _tmp17_ = TRUE;
00773                      } else {
00774                             GError* _tmp19_;
00775                             _tmp19_ = e;
00776                             _tmp17_ = g_error_matches (_tmp19_, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_NOT_FOUND);
00777                      }
00778                      _tmp20_ = _tmp17_;
00779                      if (!_tmp20_) {
00780                             const gchar* _tmp21_;
00781                             GError* _tmp22_;
00782                             const gchar* _tmp23_;
00783                             _tmp21_ = id;
00784                             _tmp22_ = e;
00785                             _tmp23_ = _tmp22_->message;
00786                             g_warning ("unity-appinfo-manager.vala:159: Error loading '%s': %s", _tmp21_, _tmp23_);
00787                      }
00788                      _g_error_free0 (e);
00789               }
00790               __finally1:
00791               if (_inner_error_ != NULL) {
00792                      _g_key_file_free0 (keyfile);
00793                      _g_object_unref0 (appinfo);
00794                      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);
00795                      g_clear_error (&_inner_error_);
00796                      return NULL;
00797               }
00798               _tmp24_ = id;
00799               _tmp25_ = g_file_new_for_path (_tmp24_);
00800               _tmp26_ = _tmp25_;
00801               _tmp27_ = g_file_get_parent (_tmp26_);
00802               _tmp28_ = _tmp27_;
00803               _g_object_unref0 (_tmp26_);
00804               dir = _tmp28_;
00805               _tmp29_ = dir;
00806               _tmp30_ = g_file_get_uri (_tmp29_);
00807               dir_uri = _tmp30_;
00808               _tmp31_ = self->priv->monitors;
00809               _tmp32_ = dir_uri;
00810               _tmp33_ = g_hash_table_lookup (_tmp31_, _tmp32_);
00811               if (((GFileMonitor*) _tmp33_) == NULL) {
00812                      {
00813                             GFile* _tmp34_;
00814                             GFileMonitor* _tmp35_ = NULL;
00815                             GFileMonitor* monitor;
00816                             GFileMonitor* _tmp36_;
00817                             GHashTable* _tmp37_;
00818                             const gchar* _tmp38_;
00819                             gchar* _tmp39_;
00820                             GFileMonitor* _tmp40_;
00821                             GFileMonitor* _tmp41_;
00822                             const gchar* _tmp42_;
00823                             _tmp34_ = dir;
00824                             _tmp35_ = g_file_monitor_directory (_tmp34_, G_FILE_MONITOR_NONE, NULL, &_inner_error_);
00825                             monitor = _tmp35_;
00826                             if (_inner_error_ != NULL) {
00827                                    if (_inner_error_->domain == G_IO_ERROR) {
00828                                           goto __catch2_g_io_error;
00829                                    }
00830                                    _g_free0 (dir_uri);
00831                                    _g_object_unref0 (dir);
00832                                    _g_key_file_free0 (keyfile);
00833                                    _g_object_unref0 (appinfo);
00834                                    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);
00835                                    g_clear_error (&_inner_error_);
00836                                    return NULL;
00837                             }
00838                             _tmp36_ = monitor;
00839                             g_signal_connect_object (_tmp36_, "changed", (GCallback) _unity_app_info_manager_on_dir_changed_g_file_monitor_changed, self, 0);
00840                             _tmp37_ = self->priv->monitors;
00841                             _tmp38_ = dir_uri;
00842                             _tmp39_ = g_strdup (_tmp38_);
00843                             _tmp40_ = monitor;
00844                             _tmp41_ = _g_object_ref0 (_tmp40_);
00845                             g_hash_table_insert (_tmp37_, _tmp39_, _tmp41_);
00846                             _tmp42_ = dir_uri;
00847                             unity_trace_log_object ((GObject*) self, "Monitoring extra app directory: %s", _tmp42_);
00848                             _g_object_unref0 (monitor);
00849                      }
00850                      goto __finally2;
00851                      __catch2_g_io_error:
00852                      {
00853                             GError* ioe = NULL;
00854                             const gchar* _tmp43_;
00855                             GError* _tmp44_;
00856                             const gchar* _tmp45_;
00857                             ioe = _inner_error_;
00858                             _inner_error_ = NULL;
00859                             _tmp43_ = dir_uri;
00860                             _tmp44_ = ioe;
00861                             _tmp45_ = _tmp44_->message;
00862                             g_warning ("unity-appinfo-manager.vala:171: Error setting up extra app directory m" \
00863 "onitor on '%s': %s", _tmp43_, _tmp45_);
00864                             _g_error_free0 (ioe);
00865                      }
00866                      __finally2:
00867                      if (_inner_error_ != NULL) {
00868                             _g_free0 (dir_uri);
00869                             _g_object_unref0 (dir);
00870                             _g_key_file_free0 (keyfile);
00871                             _g_object_unref0 (appinfo);
00872                             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);
00873                             g_clear_error (&_inner_error_);
00874                             return NULL;
00875                      }
00876               }
00877               _g_free0 (dir_uri);
00878               _g_object_unref0 (dir);
00879        } else {
00880               const gchar* _tmp46_;
00881               gchar* _tmp47_ = NULL;
00882               gchar* path;
00883               gchar* full_path;
00884               const gchar* _tmp58_;
00885               _tmp46_ = id;
00886               _tmp47_ = g_build_filename ("applications", _tmp46_, NULL, NULL);
00887               path = _tmp47_;
00888               full_path = NULL;
00889               {
00890                      GKeyFile* _tmp48_;
00891                      const gchar* _tmp49_;
00892                      gchar* _tmp50_ = NULL;
00893                      _tmp48_ = keyfile;
00894                      _tmp49_ = path;
00895                      g_key_file_load_from_data_dirs (_tmp48_, _tmp49_, &_tmp50_, G_KEY_FILE_NONE, &_inner_error_);
00896                      _g_free0 (full_path);
00897                      full_path = _tmp50_;
00898                      if (_inner_error_ != NULL) {
00899                             goto __catch3_g_error;
00900                      }
00901               }
00902               goto __finally3;
00903               __catch3_g_error:
00904               {
00905                      GError* e = NULL;
00906                      gboolean _tmp51_ = FALSE;
00907                      GError* _tmp52_;
00908                      gboolean _tmp54_;
00909                      e = _inner_error_;
00910                      _inner_error_ = NULL;
00911                      _g_key_file_free0 (keyfile);
00912                      keyfile = NULL;
00913                      _tmp52_ = e;
00914                      if (g_error_matches (_tmp52_, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) {
00915                             _tmp51_ = TRUE;
00916                      } else {
00917                             GError* _tmp53_;
00918                             _tmp53_ = e;
00919                             _tmp51_ = g_error_matches (_tmp53_, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_NOT_FOUND);
00920                      }
00921                      _tmp54_ = _tmp51_;
00922                      if (!_tmp54_) {
00923                             const gchar* _tmp55_;
00924                             GError* _tmp56_;
00925                             const gchar* _tmp57_;
00926                             _tmp55_ = id;
00927                             _tmp56_ = e;
00928                             _tmp57_ = _tmp56_->message;
00929                             g_warning ("unity-appinfo-manager.vala:185: Error loading '%s': %s", _tmp55_, _tmp57_);
00930                      }
00931                      _g_error_free0 (e);
00932               }
00933               __finally3:
00934               if (_inner_error_ != NULL) {
00935                      _g_free0 (full_path);
00936                      _g_free0 (path);
00937                      _g_key_file_free0 (keyfile);
00938                      _g_object_unref0 (appinfo);
00939                      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);
00940                      g_clear_error (&_inner_error_);
00941                      return NULL;
00942               }
00943               _tmp58_ = full_path;
00944               if (_tmp58_ != NULL) {
00945                      const gchar* _tmp59_;
00946                      GFile* _tmp60_ = NULL;
00947                      GFile* file;
00948                      GFile* _tmp61_;
00949                      GFile* _tmp62_;
00950                      gchar* _tmp63_ = NULL;
00951                      gchar* _tmp64_;
00952                      GFile* _tmp65_ = NULL;
00953                      GHashTable* _tmp66_;
00954                      const gchar* _tmp67_;
00955                      gchar* _tmp68_;
00956                      GFile* _tmp69_;
00957                      gchar* _tmp70_ = NULL;
00958                      _tmp59_ = full_path;
00959                      _tmp60_ = g_file_new_for_path (_tmp59_);
00960                      file = _tmp60_;
00961                      _tmp61_ = file;
00962                      _tmp62_ = file;
00963                      _tmp63_ = g_file_get_path (_tmp62_);
00964                      _tmp64_ = _tmp63_;
00965                      _tmp65_ = g_file_resolve_relative_path (_tmp61_, _tmp64_);
00966                      _g_object_unref0 (file);
00967                      file = _tmp65_;
00968                      _g_free0 (_tmp64_);
00969                      _tmp66_ = self->priv->paths_by_id;
00970                      _tmp67_ = id;
00971                      _tmp68_ = g_strdup (_tmp67_);
00972                      _tmp69_ = file;
00973                      _tmp70_ = g_file_get_path (_tmp69_);
00974                      g_hash_table_insert (_tmp66_, _tmp68_, _tmp70_);
00975                      _g_object_unref0 (file);
00976               } else {
00977                      GHashTable* _tmp71_;
00978                      const gchar* _tmp72_;
00979                      gchar* _tmp73_;
00980                      _tmp71_ = self->priv->paths_by_id;
00981                      _tmp72_ = id;
00982                      _tmp73_ = g_strdup (_tmp72_);
00983                      g_hash_table_insert (_tmp71_, _tmp73_, NULL);
00984               }
00985               _g_free0 (full_path);
00986               _g_free0 (path);
00987        }
00988        _tmp74_ = keyfile;
00989        if (_tmp74_ != NULL) {
00990               GKeyFile* _tmp75_;
00991               GDesktopAppInfo* _tmp76_;
00992               const gchar* _tmp77_;
00993               GKeyFile* _tmp78_;
00994               const gchar* _tmp79_;
00995               GKeyFile* _tmp80_;
00996               _tmp75_ = keyfile;
00997               _tmp76_ = g_desktop_app_info_new_from_keyfile (_tmp75_);
00998               _g_object_unref0 (appinfo);
00999               appinfo = (GAppInfo*) _tmp76_;
01000               _tmp77_ = id;
01001               _tmp78_ = keyfile;
01002               unity_app_info_manager_register_categories (self, _tmp77_, _tmp78_);
01003               _tmp79_ = id;
01004               _tmp80_ = keyfile;
01005               unity_app_info_manager_register_keywords (self, _tmp79_, _tmp80_);
01006        } else {
01007               _g_object_unref0 (appinfo);
01008               appinfo = NULL;
01009        }
01010        _tmp81_ = self->priv->appinfo_by_id;
01011        _tmp82_ = id;
01012        _tmp83_ = g_strdup (_tmp82_);
01013        _tmp84_ = appinfo;
01014        _tmp85_ = _g_object_ref0 (_tmp84_);
01015        g_hash_table_insert (_tmp81_, _tmp83_, _tmp85_);
01016        result = appinfo;
01017        _g_key_file_free0 (keyfile);
01018        return result;
01019 }
01020 
01021 
01030 static gpointer _unity_string_array_wrapper_ref0 (gpointer self) {
01031        return self ? unity_string_array_wrapper_ref (self) : NULL;
01032 }
01033 
01034 
01035 gchar** unity_app_info_manager_get_categories (UnityAppInfoManager* self, const gchar* id, int* result_length1) {
01036        gchar** result = NULL;
01037        const gchar* _tmp0_;
01038        GAppInfo* _tmp1_ = NULL;
01039        GAppInfo* appinfo;
01040        GAppInfo* _tmp2_;
01041        GHashTable* _tmp4_;
01042        const gchar* _tmp5_;
01043        gconstpointer _tmp6_ = NULL;
01044        UnityStringArrayWrapper* _tmp7_;
01045        UnityStringArrayWrapper* _result_;
01046        gchar** _tmp8_ = NULL;
01047        gint _tmp8__length1 = 0;
01048        gint __tmp8__size_ = 0;
01049        UnityStringArrayWrapper* _tmp9_;
01050        gchar** _tmp12_;
01051        gint _tmp12__length1;
01052        gchar** _tmp13_;
01053        gint _tmp13__length1;
01054        g_return_val_if_fail (self != NULL, NULL);
01055        g_return_val_if_fail (id != NULL, NULL);
01056        _tmp0_ = id;
01057        _tmp1_ = unity_app_info_manager_lookup (self, _tmp0_);
01058        appinfo = _tmp1_;
01059        _tmp2_ = appinfo;
01060        if (_tmp2_ == NULL) {
01061               gchar** _tmp3_;
01062               gint _tmp3__length1;
01063               _tmp3_ = NULL;
01064               _tmp3__length1 = 0;
01065               if (result_length1) {
01066                      *result_length1 = _tmp3__length1;
01067               }
01068               result = _tmp3_;
01069               _g_object_unref0 (appinfo);
01070               return result;
01071        }
01072        _tmp4_ = self->priv->categories_by_id;
01073        _tmp5_ = id;
01074        _tmp6_ = g_hash_table_lookup (_tmp4_, _tmp5_);
01075        _tmp7_ = _unity_string_array_wrapper_ref0 ((UnityStringArrayWrapper*) _tmp6_);
01076        _result_ = _tmp7_;
01077        _tmp9_ = _result_;
01078        if (_tmp9_ != NULL) {
01079               UnityStringArrayWrapper* _tmp10_;
01080               gchar** _tmp11_;
01081               gint _tmp11__length1;
01082               _tmp10_ = _result_;
01083               _tmp11_ = _tmp10_->strings;
01084               _tmp11__length1 = _tmp10_->strings_length1;
01085               _tmp8_ = _tmp11_;
01086               _tmp8__length1 = _tmp11__length1;
01087               __tmp8__size_ = _tmp8__length1;
01088        } else {
01089               _tmp8_ = NULL;
01090               _tmp8__length1 = 0;
01091               __tmp8__size_ = _tmp8__length1;
01092        }
01093        _tmp12_ = _tmp8_;
01094        _tmp12__length1 = _tmp8__length1;
01095        _tmp13_ = _tmp12_;
01096        _tmp13__length1 = _tmp12__length1;
01097        if (result_length1) {
01098               *result_length1 = _tmp13__length1;
01099        }
01100        result = _tmp13_;
01101        _unity_string_array_wrapper_unref0 (_result_);
01102        _g_object_unref0 (appinfo);
01103        return result;
01104 }
01105 
01106 
01117 gchar** unity_app_info_manager_get_keywords (UnityAppInfoManager* self, const gchar* id, int* result_length1) {
01118        gchar** result = NULL;
01119        const gchar* _tmp0_;
01120        GAppInfo* _tmp1_ = NULL;
01121        GAppInfo* appinfo;
01122        GAppInfo* _tmp2_;
01123        GHashTable* _tmp4_;
01124        const gchar* _tmp5_;
01125        gconstpointer _tmp6_ = NULL;
01126        UnityStringArrayWrapper* _tmp7_;
01127        UnityStringArrayWrapper* _result_;
01128        gchar** _tmp8_ = NULL;
01129        gint _tmp8__length1 = 0;
01130        gint __tmp8__size_ = 0;
01131        UnityStringArrayWrapper* _tmp9_;
01132        gchar** _tmp12_;
01133        gint _tmp12__length1;
01134        gchar** _tmp13_;
01135        gint _tmp13__length1;
01136        g_return_val_if_fail (self != NULL, NULL);
01137        g_return_val_if_fail (id != NULL, NULL);
01138        _tmp0_ = id;
01139        _tmp1_ = unity_app_info_manager_lookup (self, _tmp0_);
01140        appinfo = _tmp1_;
01141        _tmp2_ = appinfo;
01142        if (_tmp2_ == NULL) {
01143               gchar** _tmp3_;
01144               gint _tmp3__length1;
01145               _tmp3_ = NULL;
01146               _tmp3__length1 = 0;
01147               if (result_length1) {
01148                      *result_length1 = _tmp3__length1;
01149               }
01150               result = _tmp3_;
01151               _g_object_unref0 (appinfo);
01152               return result;
01153        }
01154        _tmp4_ = self->priv->keywords_by_id;
01155        _tmp5_ = id;
01156        _tmp6_ = g_hash_table_lookup (_tmp4_, _tmp5_);
01157        _tmp7_ = _unity_string_array_wrapper_ref0 ((UnityStringArrayWrapper*) _tmp6_);
01158        _result_ = _tmp7_;
01159        _tmp9_ = _result_;
01160        if (_tmp9_ != NULL) {
01161               UnityStringArrayWrapper* _tmp10_;
01162               gchar** _tmp11_;
01163               gint _tmp11__length1;
01164               _tmp10_ = _result_;
01165               _tmp11_ = _tmp10_->strings;
01166               _tmp11__length1 = _tmp10_->strings_length1;
01167               _tmp8_ = _tmp11_;
01168               _tmp8__length1 = _tmp11__length1;
01169               __tmp8__size_ = _tmp8__length1;
01170        } else {
01171               _tmp8_ = NULL;
01172               _tmp8__length1 = 0;
01173               __tmp8__size_ = _tmp8__length1;
01174        }
01175        _tmp12_ = _tmp8_;
01176        _tmp12__length1 = _tmp8__length1;
01177        _tmp13_ = _tmp12_;
01178        _tmp13__length1 = _tmp12__length1;
01179        if (result_length1) {
01180               *result_length1 = _tmp13__length1;
01181        }
01182        result = _tmp13_;
01183        _unity_string_array_wrapper_unref0 (_result_);
01184        _g_object_unref0 (appinfo);
01185        return result;
01186 }
01187 
01188 
01197 gchar* unity_app_info_manager_get_path (UnityAppInfoManager* self, const gchar* id) {
01198        gchar* result = NULL;
01199        const gchar* _tmp0_;
01200        GAppInfo* _tmp1_ = NULL;
01201        GAppInfo* appinfo;
01202        GAppInfo* _tmp2_;
01203        GHashTable* _tmp3_;
01204        const gchar* _tmp4_;
01205        gconstpointer _tmp5_ = NULL;
01206        gchar* _tmp6_;
01207        g_return_val_if_fail (self != NULL, NULL);
01208        g_return_val_if_fail (id != NULL, NULL);
01209        _tmp0_ = id;
01210        _tmp1_ = unity_app_info_manager_lookup (self, _tmp0_);
01211        appinfo = _tmp1_;
01212        _tmp2_ = appinfo;
01213        if (_tmp2_ == NULL) {
01214               result = NULL;
01215               _g_object_unref0 (appinfo);
01216               return result;
01217        }
01218        _tmp3_ = self->priv->paths_by_id;
01219        _tmp4_ = id;
01220        _tmp5_ = g_hash_table_lookup (_tmp3_, _tmp4_);
01221        _tmp6_ = g_strdup ((const gchar*) _tmp5_);
01222        result = _tmp6_;
01223        _g_object_unref0 (appinfo);
01224        return result;
01225 }
01226 
01227 
01228 static void unity_app_info_manager_lookup_async_data_free (gpointer _data) {
01229        UnityAppInfoManagerLookupAsyncData* _data_;
01230        _data_ = _data;
01231        _g_free0 (_data_->id);
01232        _g_object_unref0 (_data_->result);
01233        _g_object_unref0 (_data_->self);
01234        g_slice_free (UnityAppInfoManagerLookupAsyncData, _data_);
01235 }
01236 
01237 
01238 void unity_app_info_manager_lookup_async (UnityAppInfoManager* self, const gchar* id, GAsyncReadyCallback _callback_, gpointer _user_data_) {
01239        UnityAppInfoManagerLookupAsyncData* _data_;
01240        UnityAppInfoManager* _tmp0_;
01241        const gchar* _tmp1_;
01242        gchar* _tmp2_;
01243        _data_ = g_slice_new0 (UnityAppInfoManagerLookupAsyncData);
01244        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_app_info_manager_lookup_async);
01245        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_app_info_manager_lookup_async_data_free);
01246        _tmp0_ = _g_object_ref0 (self);
01247        _data_->self = _tmp0_;
01248        _tmp1_ = id;
01249        _tmp2_ = g_strdup (_tmp1_);
01250        _data_->id = _tmp2_;
01251        unity_app_info_manager_lookup_async_co (_data_);
01252 }
01253 
01254 
01255 GAppInfo* unity_app_info_manager_lookup_finish (UnityAppInfoManager* self, GAsyncResult* _res_, GError** error) {
01256        GAppInfo* result;
01257        UnityAppInfoManagerLookupAsyncData* _data_;
01258        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
01259               return NULL;
01260        }
01261        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
01262        result = _data_->result;
01263        _data_->result = NULL;
01264        return result;
01265 }
01266 
01267 
01276 static void unity_app_info_manager_lookup_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
01277        UnityAppInfoManagerLookupAsyncData* _data_;
01278        _data_ = _user_data_;
01279        _data_->_source_object_ = source_object;
01280        _data_->_res_ = _res_;
01281        unity_app_info_manager_lookup_async_co (_data_);
01282 }
01283 
01284 
01285 static gboolean unity_app_info_manager_lookup_async_co (UnityAppInfoManagerLookupAsyncData* _data_) {
01286        switch (_data_->_state_) {
01287               case 0:
01288               goto _state_0;
01289               case 1:
01290               goto _state_1;
01291               case 2:
01292               goto _state_2;
01293               case 3:
01294               goto _state_3;
01295               default:
01296               g_assert_not_reached ();
01297        }
01298        _state_0:
01299        _data_->_tmp0_ = _data_->self->priv->appinfo_by_id;
01300        _data_->_tmp1_ = _data_->id;
01301        _data_->_tmp2_ = FALSE;
01302        _data_->_tmp2_ = g_hash_table_lookup_extended (_data_->_tmp0_, _data_->_tmp1_, NULL, NULL);
01303        if (_data_->_tmp2_) {
01304               _data_->_tmp3_ = _data_->self->priv->appinfo_by_id;
01305               _data_->_tmp4_ = _data_->id;
01306               _data_->_tmp5_ = NULL;
01307               _data_->_tmp5_ = g_hash_table_lookup (_data_->_tmp3_, _data_->_tmp4_);
01308               _data_->_tmp6_ = _g_object_ref0 ((GAppInfo*) _data_->_tmp5_);
01309               _data_->result = _data_->_tmp6_;
01310               if (_data_->_state_ == 0) {
01311                      g_simple_async_result_complete_in_idle (_data_->_async_result);
01312               } else {
01313                      g_simple_async_result_complete (_data_->_async_result);
01314               }
01315               g_object_unref (_data_->_async_result);
01316               return FALSE;
01317        }
01318        _data_->data_length1 = 0;
01319        _data_->_data_size_ = 0;
01320        _data_->_tmp7_ = _data_->id;
01321        _data_->_tmp8_ = FALSE;
01322        _data_->_tmp8_ = g_str_has_prefix (_data_->_tmp7_, "/");
01323        if (_data_->_tmp8_) {
01324               _data_->_tmp9_ = _data_->id;
01325               _data_->_tmp10_ = NULL;
01326               _data_->_tmp10_ = g_file_new_for_path (_data_->_tmp9_);
01327               _data_->f = _data_->_tmp10_;
01328               _data_->_tmp11_ = _data_->f;
01329               _data_->_state_ = 1;
01330               g_file_read_async (_data_->_tmp11_, G_PRIORITY_DEFAULT, NULL, unity_app_info_manager_lookup_async_ready, _data_);
01331               return FALSE;
01332               _state_1:
01333               _data_->_tmp12_ = NULL;
01334               _data_->_tmp12_ = g_file_read_finish (_data_->_tmp11_, _data_->_res_, &_data_->_inner_error_);
01335               _data_->_tmp13_ = _data_->_tmp12_;
01336               if (_data_->_inner_error_ != NULL) {
01337                      g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
01338                      g_error_free (_data_->_inner_error_);
01339                      _g_object_unref0 (_data_->f);
01340                      _g_object_unref0 (_data_->input);
01341                      _data_->data = (g_free (_data_->data), NULL);
01342                      if (_data_->_state_ == 0) {
01343                             g_simple_async_result_complete_in_idle (_data_->_async_result);
01344                      } else {
01345                             g_simple_async_result_complete (_data_->_async_result);
01346                      }
01347                      g_object_unref (_data_->_async_result);
01348                      return FALSE;
01349               }
01350               _g_object_unref0 (_data_->input);
01351               _data_->input = _data_->_tmp13_;
01352               _data_->_tmp14_ = _data_->f;
01353               _data_->_tmp15_ = NULL;
01354               _data_->_tmp15_ = g_file_get_parent (_data_->_tmp14_);
01355               _data_->dir = _data_->_tmp15_;
01356               _data_->_tmp16_ = _data_->dir;
01357               _data_->_tmp17_ = NULL;
01358               _data_->_tmp17_ = g_file_get_uri (_data_->_tmp16_);
01359               _data_->dir_uri = _data_->_tmp17_;
01360               _data_->_tmp18_ = _data_->self->priv->monitors;
01361               _data_->_tmp19_ = _data_->dir_uri;
01362               _data_->_tmp20_ = NULL;
01363               _data_->_tmp20_ = g_hash_table_lookup (_data_->_tmp18_, _data_->_tmp19_);
01364               if (((GFileMonitor*) _data_->_tmp20_) == NULL) {
01365                      {
01366                             _data_->_tmp21_ = _data_->dir;
01367                             _data_->_tmp22_ = NULL;
01368                             _data_->_tmp22_ = g_file_monitor_directory (_data_->_tmp21_, G_FILE_MONITOR_NONE, NULL, &_data_->_inner_error_);
01369                             _data_->monitor = _data_->_tmp22_;
01370                             if (_data_->_inner_error_ != NULL) {
01371                                    if (_data_->_inner_error_->domain == G_IO_ERROR) {
01372                                           goto __catch4_g_io_error;
01373                                    }
01374                                    _g_free0 (_data_->dir_uri);
01375                                    _g_object_unref0 (_data_->dir);
01376                                    _g_object_unref0 (_data_->f);
01377                                    _g_object_unref0 (_data_->input);
01378                                    _data_->data = (g_free (_data_->data), NULL);
01379                                    g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
01380                                    g_clear_error (&_data_->_inner_error_);
01381                                    return FALSE;
01382                             }
01383                             _data_->_tmp23_ = _data_->monitor;
01384                             g_signal_connect_object (_data_->_tmp23_, "changed", (GCallback) _unity_app_info_manager_on_dir_changed_g_file_monitor_changed, _data_->self, 0);
01385                             _data_->_tmp24_ = _data_->self->priv->monitors;
01386                             _data_->_tmp25_ = _data_->dir_uri;
01387                             _data_->_tmp26_ = g_strdup (_data_->_tmp25_);
01388                             _data_->_tmp27_ = _data_->monitor;
01389                             _data_->_tmp28_ = _g_object_ref0 (_data_->_tmp27_);
01390                             g_hash_table_insert (_data_->_tmp24_, _data_->_tmp26_, _data_->_tmp28_);
01391                             _data_->_tmp29_ = _data_->dir_uri;
01392                             unity_trace_log_object ((GObject*) _data_->self, "Monitoring extra app directory: %s", _data_->_tmp29_);
01393                             _g_object_unref0 (_data_->monitor);
01394                      }
01395                      goto __finally4;
01396                      __catch4_g_io_error:
01397                      {
01398                             _data_->ioe = _data_->_inner_error_;
01399                             _data_->_inner_error_ = NULL;
01400                             _data_->_tmp30_ = _data_->dir_uri;
01401                             _data_->_tmp31_ = _data_->ioe;
01402                             _data_->_tmp32_ = _data_->_tmp31_->message;
01403                             g_warning ("unity-appinfo-manager.vala:312: Error setting up extra app directory m" \
01404 "onitor on '%s': %s", _data_->_tmp30_, _data_->_tmp32_);
01405                             _g_error_free0 (_data_->ioe);
01406                      }
01407                      __finally4:
01408                      if (_data_->_inner_error_ != NULL) {
01409                             g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
01410                             g_error_free (_data_->_inner_error_);
01411                             _g_free0 (_data_->dir_uri);
01412                             _g_object_unref0 (_data_->dir);
01413                             _g_object_unref0 (_data_->f);
01414                             _g_object_unref0 (_data_->input);
01415                             _data_->data = (g_free (_data_->data), NULL);
01416                             if (_data_->_state_ == 0) {
01417                                    g_simple_async_result_complete_in_idle (_data_->_async_result);
01418                             } else {
01419                                    g_simple_async_result_complete (_data_->_async_result);
01420                             }
01421                             g_object_unref (_data_->_async_result);
01422                             return FALSE;
01423                      }
01424               }
01425               _g_free0 (_data_->dir_uri);
01426               _g_object_unref0 (_data_->dir);
01427               _g_object_unref0 (_data_->f);
01428        } else {
01429               _data_->_tmp33_ = _data_->id;
01430               _data_->_tmp34_ = NULL;
01431               _data_->_tmp34_ = g_build_filename ("applications", _data_->_tmp33_, NULL, NULL);
01432               _data_->path = _data_->_tmp34_;
01433               _data_->_tmp35_ = _data_->path;
01434               _data_->_state_ = 2;
01435               unity_io_open_from_data_dirs (_data_->_tmp35_, unity_app_info_manager_lookup_async_ready, _data_);
01436               return FALSE;
01437               _state_2:
01438               _data_->_tmp36_ = NULL;
01439               _data_->_tmp36_ = unity_io_open_from_data_dirs_finish (_data_->_res_, &_data_->_inner_error_);
01440               _data_->_tmp37_ = _data_->_tmp36_;
01441               if (_data_->_inner_error_ != NULL) {
01442                      g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
01443                      g_error_free (_data_->_inner_error_);
01444                      _g_free0 (_data_->path);
01445                      _g_object_unref0 (_data_->input);
01446                      _data_->data = (g_free (_data_->data), NULL);
01447                      if (_data_->_state_ == 0) {
01448                             g_simple_async_result_complete_in_idle (_data_->_async_result);
01449                      } else {
01450                             g_simple_async_result_complete (_data_->_async_result);
01451                      }
01452                      g_object_unref (_data_->_async_result);
01453                      return FALSE;
01454               }
01455               _g_object_unref0 (_data_->input);
01456               _data_->input = _data_->_tmp37_;
01457               _g_free0 (_data_->path);
01458        }
01459        _data_->_tmp38_ = _data_->input;
01460        if (_data_->_tmp38_ == NULL) {
01461               _data_->_tmp39_ = _data_->self->priv->appinfo_by_id;
01462               _data_->_tmp40_ = _data_->id;
01463               _data_->_tmp41_ = g_strdup (_data_->_tmp40_);
01464               g_hash_table_insert (_data_->_tmp39_, _data_->_tmp41_, NULL);
01465               _data_->result = NULL;
01466               _g_object_unref0 (_data_->input);
01467               _data_->data = (g_free (_data_->data), NULL);
01468               if (_data_->_state_ == 0) {
01469                      g_simple_async_result_complete_in_idle (_data_->_async_result);
01470               } else {
01471                      g_simple_async_result_complete (_data_->_async_result);
01472               }
01473               g_object_unref (_data_->_async_result);
01474               return FALSE;
01475        }
01476        {
01477               _data_->_tmp42_ = _data_->input;
01478               _data_->_tmp43_ = NULL;
01479               _data_->_tmp44_ = 0;
01480               _data_->_tmp45_ = 0UL;
01481               _data_->_state_ = 3;
01482               unity_io_read_stream_async ((GInputStream*) _data_->_tmp42_, G_PRIORITY_LOW, NULL, unity_app_info_manager_lookup_async_ready, _data_);
01483               return FALSE;
01484               _state_3:
01485               unity_io_read_stream_finish (_data_->_res_, &_data_->_tmp43_, &_data_->_tmp44_, &_data_->_tmp45_, &_data_->_inner_error_);
01486               _data_->data = (g_free (_data_->data), NULL);
01487               _data_->data = _data_->_tmp43_;
01488               _data_->data_length1 = _data_->_tmp44_;
01489               _data_->_data_size_ = _data_->data_length1;
01490               _data_->data_size = _data_->_tmp45_;
01491               if (_data_->_inner_error_ != NULL) {
01492                      goto __catch5_g_error;
01493               }
01494        }
01495        goto __finally5;
01496        __catch5_g_error:
01497        {
01498               _data_->e = _data_->_inner_error_;
01499               _data_->_inner_error_ = NULL;
01500               _data_->_tmp46_ = _data_->id;
01501               _data_->_tmp47_ = _data_->e;
01502               _data_->_tmp48_ = _data_->_tmp47_->message;
01503               g_warning ("unity-appinfo-manager.vala:340: Error reading '%s': %s", _data_->_tmp46_, _data_->_tmp48_);
01504               _data_->result = NULL;
01505               _g_error_free0 (_data_->e);
01506               _g_object_unref0 (_data_->input);
01507               _data_->data = (g_free (_data_->data), NULL);
01508               if (_data_->_state_ == 0) {
01509                      g_simple_async_result_complete_in_idle (_data_->_async_result);
01510               } else {
01511                      g_simple_async_result_complete (_data_->_async_result);
01512               }
01513               g_object_unref (_data_->_async_result);
01514               return FALSE;
01515        }
01516        __finally5:
01517        if (_data_->_inner_error_ != NULL) {
01518               g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
01519               g_error_free (_data_->_inner_error_);
01520               _g_object_unref0 (_data_->input);
01521               _data_->data = (g_free (_data_->data), NULL);
01522               if (_data_->_state_ == 0) {
01523                      g_simple_async_result_complete_in_idle (_data_->_async_result);
01524               } else {
01525                      g_simple_async_result_complete (_data_->_async_result);
01526               }
01527               g_object_unref (_data_->_async_result);
01528               return FALSE;
01529        }
01530        _data_->_tmp49_ = g_key_file_new ();
01531        _data_->keyfile = _data_->_tmp49_;
01532        {
01533               _data_->_tmp50_ = _data_->keyfile;
01534               _data_->_tmp51_ = _data_->data;
01535               _data_->_tmp51__length1 = _data_->data_length1;
01536               _data_->_tmp52_ = _data_->data_size;
01537               g_key_file_load_from_data (_data_->_tmp50_, (const gchar*) _data_->_tmp51_, _data_->_tmp52_, G_KEY_FILE_NONE, &_data_->_inner_error_);
01538               if (_data_->_inner_error_ != NULL) {
01539                      goto __catch6_g_error;
01540               }
01541        }
01542        goto __finally6;
01543        __catch6_g_error:
01544        {
01545               _data_->ee = _data_->_inner_error_;
01546               _data_->_inner_error_ = NULL;
01547               _data_->_tmp53_ = _data_->id;
01548               _data_->_tmp54_ = _data_->ee;
01549               _data_->_tmp55_ = _data_->_tmp54_->message;
01550               g_warning ("unity-appinfo-manager.vala:351: Error parsing '%s': %s", _data_->_tmp53_, _data_->_tmp55_);
01551               _data_->result = NULL;
01552               _g_error_free0 (_data_->ee);
01553               _g_key_file_free0 (_data_->keyfile);
01554               _g_object_unref0 (_data_->input);
01555               _data_->data = (g_free (_data_->data), NULL);
01556               if (_data_->_state_ == 0) {
01557                      g_simple_async_result_complete_in_idle (_data_->_async_result);
01558               } else {
01559                      g_simple_async_result_complete (_data_->_async_result);
01560               }
01561               g_object_unref (_data_->_async_result);
01562               return FALSE;
01563        }
01564        __finally6:
01565        if (_data_->_inner_error_ != NULL) {
01566               g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
01567               g_error_free (_data_->_inner_error_);
01568               _g_key_file_free0 (_data_->keyfile);
01569               _g_object_unref0 (_data_->input);
01570               _data_->data = (g_free (_data_->data), NULL);
01571               if (_data_->_state_ == 0) {
01572                      g_simple_async_result_complete_in_idle (_data_->_async_result);
01573               } else {
01574                      g_simple_async_result_complete (_data_->_async_result);
01575               }
01576               g_object_unref (_data_->_async_result);
01577               return FALSE;
01578        }
01579        _data_->_tmp56_ = _data_->keyfile;
01580        _data_->_tmp57_ = g_desktop_app_info_new_from_keyfile (_data_->_tmp56_);
01581        _data_->appinfo = _data_->_tmp57_;
01582        _data_->_tmp58_ = _data_->self->priv->appinfo_by_id;
01583        _data_->_tmp59_ = _data_->id;
01584        _data_->_tmp60_ = g_strdup (_data_->_tmp59_);
01585        _data_->_tmp61_ = _data_->appinfo;
01586        _data_->_tmp62_ = _g_object_ref0 ((GAppInfo*) _data_->_tmp61_);
01587        g_hash_table_insert (_data_->_tmp58_, _data_->_tmp60_, _data_->_tmp62_);
01588        _data_->_tmp63_ = _data_->id;
01589        _data_->_tmp64_ = _data_->keyfile;
01590        unity_app_info_manager_register_categories (_data_->self, _data_->_tmp63_, _data_->_tmp64_);
01591        _data_->_tmp65_ = _data_->id;
01592        _data_->_tmp66_ = _data_->keyfile;
01593        unity_app_info_manager_register_keywords (_data_->self, _data_->_tmp65_, _data_->_tmp66_);
01594        _data_->result = (GAppInfo*) _data_->appinfo;
01595        _g_key_file_free0 (_data_->keyfile);
01596        _g_object_unref0 (_data_->input);
01597        _data_->data = (g_free (_data_->data), NULL);
01598        if (_data_->_state_ == 0) {
01599               g_simple_async_result_complete_in_idle (_data_->_async_result);
01600        } else {
01601               g_simple_async_result_complete (_data_->_async_result);
01602        }
01603        g_object_unref (_data_->_async_result);
01604        return FALSE;
01605        _g_object_unref0 (_data_->appinfo);
01606        _g_key_file_free0 (_data_->keyfile);
01607        _g_object_unref0 (_data_->input);
01608        _data_->data = (g_free (_data_->data), NULL);
01609        if (_data_->_state_ == 0) {
01610               g_simple_async_result_complete_in_idle (_data_->_async_result);
01611        } else {
01612               g_simple_async_result_complete (_data_->_async_result);
01613        }
01614        g_object_unref (_data_->_async_result);
01615        return FALSE;
01616 }
01617 
01618 
01619 void unity_app_info_manager_clear (UnityAppInfoManager* self) {
01620        GHashTable* _tmp0_;
01621        GHashTable* _tmp1_;
01622        GHashTable* _tmp2_;
01623        GHashTable* _tmp3_;
01624        g_return_if_fail (self != NULL);
01625        _tmp0_ = self->priv->appinfo_by_id;
01626        g_hash_table_remove_all (_tmp0_);
01627        _tmp1_ = self->priv->categories_by_id;
01628        g_hash_table_remove_all (_tmp1_);
01629        _tmp2_ = self->priv->keywords_by_id;
01630        g_hash_table_remove_all (_tmp2_);
01631        _tmp3_ = self->priv->paths_by_id;
01632        g_hash_table_remove_all (_tmp3_);
01633 }
01634 
01635 
01636 static void unity_app_info_manager_register_categories (UnityAppInfoManager* self, const gchar* id, GKeyFile* keyfile) {
01637        GError * _inner_error_ = NULL;
01638        g_return_if_fail (self != NULL);
01639        g_return_if_fail (id != NULL);
01640        g_return_if_fail (keyfile != NULL);
01641        {
01642               GKeyFile* _tmp0_;
01643               gsize _tmp1_;
01644               gchar** _tmp2_ = NULL;
01645               gchar** categories;
01646               gint categories_length1;
01647               gint _categories_size_;
01648               UnityStringArrayWrapper* _tmp3_;
01649               UnityStringArrayWrapper* wrapper;
01650               UnityStringArrayWrapper* _tmp4_;
01651               gchar** _tmp5_;
01652               gint _tmp5__length1;
01653               GHashTable* _tmp6_;
01654               const gchar* _tmp7_;
01655               gchar* _tmp8_;
01656               UnityStringArrayWrapper* _tmp9_;
01657               UnityStringArrayWrapper* _tmp10_;
01658               _tmp0_ = keyfile;
01659               _tmp2_ = g_key_file_get_string_list (_tmp0_, "Desktop Entry", "Categories", &_tmp1_, &_inner_error_);
01660               categories = _tmp2_;
01661               categories_length1 = _tmp1_;
01662               _categories_size_ = categories_length1;
01663               if (_inner_error_ != NULL) {
01664                      if (_inner_error_->domain == G_KEY_FILE_ERROR) {
01665                             goto __catch7_g_key_file_error;
01666                      }
01667                      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);
01668                      g_clear_error (&_inner_error_);
01669                      return;
01670               }
01671               _tmp3_ = unity_string_array_wrapper_new ();
01672               wrapper = _tmp3_;
01673               _tmp4_ = wrapper;
01674               _tmp5_ = categories;
01675               _tmp5__length1 = categories_length1;
01676               categories = NULL;
01677               unity_string_array_wrapper_take_strings (_tmp4_, _tmp5_, _tmp5__length1);
01678               _tmp6_ = self->priv->categories_by_id;
01679               _tmp7_ = id;
01680               _tmp8_ = g_strdup (_tmp7_);
01681               _tmp9_ = wrapper;
01682               _tmp10_ = _unity_string_array_wrapper_ref0 (_tmp9_);
01683               g_hash_table_insert (_tmp6_, _tmp8_, _tmp10_);
01684               _unity_string_array_wrapper_unref0 (wrapper);
01685               categories = (_vala_array_free (categories, categories_length1, (GDestroyNotify) g_free), NULL);
01686        }
01687        goto __finally7;
01688        __catch7_g_key_file_error:
01689        {
01690               GError* eee = NULL;
01691               eee = _inner_error_;
01692               _inner_error_ = NULL;
01693               _g_error_free0 (eee);
01694        }
01695        __finally7:
01696        if (_inner_error_ != NULL) {
01697               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);
01698               g_clear_error (&_inner_error_);
01699               return;
01700        }
01701 }
01702 
01703 
01704 static void unity_app_info_manager_register_keywords (UnityAppInfoManager* self, const gchar* id, GKeyFile* keyfile) {
01705        gchar** gkeywords = NULL;
01706        gint gkeywords_length1 = 0;
01707        gint _gkeywords_size_ = 0;
01708        gchar** akeywords = NULL;
01709        gint akeywords_length1 = 0;
01710        gint _akeywords_size_ = 0;
01711        gchar** xdgkeywords = NULL;
01712        gint xdgkeywords_length1 = 0;
01713        gint _xdgkeywords_size_ = 0;
01714        gchar** _tmp15_;
01715        gint _tmp15__length1;
01716        gchar** _tmp16_;
01717        gint _tmp16__length1;
01718        gchar** _tmp17_;
01719        gint _tmp17__length1;
01720        gchar** _tmp18_ = NULL;
01721        gchar** keywords;
01722        gint keywords_length1;
01723        gint _keywords_size_;
01724        UnityStringArrayWrapper* _tmp58_;
01725        UnityStringArrayWrapper* wrapper;
01726        gchar** _tmp59_;
01727        gint _tmp59__length1;
01728        GHashTable* _tmp60_;
01729        const gchar* _tmp61_;
01730        gchar* _tmp62_;
01731        UnityStringArrayWrapper* _tmp63_;
01732        GError * _inner_error_ = NULL;
01733        g_return_if_fail (self != NULL);
01734        g_return_if_fail (id != NULL);
01735        g_return_if_fail (keyfile != NULL);
01736        {
01737               GKeyFile* _tmp0_;
01738               gsize _tmp1_;
01739               gchar** _tmp2_ = NULL;
01740               gchar** _tmp3_;
01741               gint _tmp3__length1;
01742               gint __tmp3__size_;
01743               _tmp0_ = keyfile;
01744               _tmp2_ = g_key_file_get_locale_string_list (_tmp0_, "Desktop Entry", "X-GNOME-Keywords", NULL, &_tmp1_, &_inner_error_);
01745               _tmp3_ = _tmp2_;
01746               _tmp3__length1 = _tmp1_;
01747               __tmp3__size_ = _tmp3__length1;
01748               if (_inner_error_ != NULL) {
01749                      if (_inner_error_->domain == G_KEY_FILE_ERROR) {
01750                             goto __catch8_g_key_file_error;
01751                      }
01752                      xdgkeywords = (_vala_array_free (xdgkeywords, xdgkeywords_length1, (GDestroyNotify) g_free), NULL);
01753                      akeywords = (_vala_array_free (akeywords, akeywords_length1, (GDestroyNotify) g_free), NULL);
01754                      gkeywords = (_vala_array_free (gkeywords, gkeywords_length1, (GDestroyNotify) g_free), NULL);
01755                      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);
01756                      g_clear_error (&_inner_error_);
01757                      return;
01758               }
01759               gkeywords = (_vala_array_free (gkeywords, gkeywords_length1, (GDestroyNotify) g_free), NULL);
01760               gkeywords = _tmp3_;
01761               gkeywords_length1 = _tmp3__length1;
01762               _gkeywords_size_ = gkeywords_length1;
01763        }
01764        goto __finally8;
01765        __catch8_g_key_file_error:
01766        {
01767               GError* e = NULL;
01768               gchar** _tmp4_ = NULL;
01769               e = _inner_error_;
01770               _inner_error_ = NULL;
01771               _tmp4_ = g_new0 (gchar*, 0 + 1);
01772               gkeywords = (_vala_array_free (gkeywords, gkeywords_length1, (GDestroyNotify) g_free), NULL);
01773               gkeywords = _tmp4_;
01774               gkeywords_length1 = 0;
01775               _gkeywords_size_ = gkeywords_length1;
01776               _g_error_free0 (e);
01777        }
01778        __finally8:
01779        if (_inner_error_ != NULL) {
01780               xdgkeywords = (_vala_array_free (xdgkeywords, xdgkeywords_length1, (GDestroyNotify) g_free), NULL);
01781               akeywords = (_vala_array_free (akeywords, akeywords_length1, (GDestroyNotify) g_free), NULL);
01782               gkeywords = (_vala_array_free (gkeywords, gkeywords_length1, (GDestroyNotify) g_free), NULL);
01783               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);
01784               g_clear_error (&_inner_error_);
01785               return;
01786        }
01787        {
01788               GKeyFile* _tmp5_;
01789               gsize _tmp6_;
01790               gchar** _tmp7_ = NULL;
01791               gchar** _tmp8_;
01792               gint _tmp8__length1;
01793               gint __tmp8__size_;
01794               _tmp5_ = keyfile;
01795               _tmp7_ = g_key_file_get_locale_string_list (_tmp5_, "Desktop Entry", "X-AppInstall-Keywords", NULL, &_tmp6_, &_inner_error_);
01796               _tmp8_ = _tmp7_;
01797               _tmp8__length1 = _tmp6_;
01798               __tmp8__size_ = _tmp8__length1;
01799               if (_inner_error_ != NULL) {
01800                      if (_inner_error_->domain == G_KEY_FILE_ERROR) {
01801                             goto __catch9_g_key_file_error;
01802                      }
01803                      xdgkeywords = (_vala_array_free (xdgkeywords, xdgkeywords_length1, (GDestroyNotify) g_free), NULL);
01804                      akeywords = (_vala_array_free (akeywords, akeywords_length1, (GDestroyNotify) g_free), NULL);
01805                      gkeywords = (_vala_array_free (gkeywords, gkeywords_length1, (GDestroyNotify) g_free), NULL);
01806                      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);
01807                      g_clear_error (&_inner_error_);
01808                      return;
01809               }
01810               akeywords = (_vala_array_free (akeywords, akeywords_length1, (GDestroyNotify) g_free), NULL);
01811               akeywords = _tmp8_;
01812               akeywords_length1 = _tmp8__length1;
01813               _akeywords_size_ = akeywords_length1;
01814        }
01815        goto __finally9;
01816        __catch9_g_key_file_error:
01817        {
01818               GError* e = NULL;
01819               gchar** _tmp9_ = NULL;
01820               e = _inner_error_;
01821               _inner_error_ = NULL;
01822               _tmp9_ = g_new0 (gchar*, 0 + 1);
01823               akeywords = (_vala_array_free (akeywords, akeywords_length1, (GDestroyNotify) g_free), NULL);
01824               akeywords = _tmp9_;
01825               akeywords_length1 = 0;
01826               _akeywords_size_ = akeywords_length1;
01827               _g_error_free0 (e);
01828        }
01829        __finally9:
01830        if (_inner_error_ != NULL) {
01831               xdgkeywords = (_vala_array_free (xdgkeywords, xdgkeywords_length1, (GDestroyNotify) g_free), NULL);
01832               akeywords = (_vala_array_free (akeywords, akeywords_length1, (GDestroyNotify) g_free), NULL);
01833               gkeywords = (_vala_array_free (gkeywords, gkeywords_length1, (GDestroyNotify) g_free), NULL);
01834               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);
01835               g_clear_error (&_inner_error_);
01836               return;
01837        }
01838        {
01839               GKeyFile* _tmp10_;
01840               gsize _tmp11_;
01841               gchar** _tmp12_ = NULL;
01842               gchar** _tmp13_;
01843               gint _tmp13__length1;
01844               gint __tmp13__size_;
01845               _tmp10_ = keyfile;
01846               _tmp12_ = g_key_file_get_locale_string_list (_tmp10_, "Desktop Entry", "Keywords", NULL, &_tmp11_, &_inner_error_);
01847               _tmp13_ = _tmp12_;
01848               _tmp13__length1 = _tmp11_;
01849               __tmp13__size_ = _tmp13__length1;
01850               if (_inner_error_ != NULL) {
01851                      if (_inner_error_->domain == G_KEY_FILE_ERROR) {
01852                             goto __catch10_g_key_file_error;
01853                      }
01854                      xdgkeywords = (_vala_array_free (xdgkeywords, xdgkeywords_length1, (GDestroyNotify) g_free), NULL);
01855                      akeywords = (_vala_array_free (akeywords, akeywords_length1, (GDestroyNotify) g_free), NULL);
01856                      gkeywords = (_vala_array_free (gkeywords, gkeywords_length1, (GDestroyNotify) g_free), NULL);
01857                      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);
01858                      g_clear_error (&_inner_error_);
01859                      return;
01860               }
01861               xdgkeywords = (_vala_array_free (xdgkeywords, xdgkeywords_length1, (GDestroyNotify) g_free), NULL);
01862               xdgkeywords = _tmp13_;
01863               xdgkeywords_length1 = _tmp13__length1;
01864               _xdgkeywords_size_ = xdgkeywords_length1;
01865        }
01866        goto __finally10;
01867        __catch10_g_key_file_error:
01868        {
01869               GError* e = NULL;
01870               gchar** _tmp14_ = NULL;
01871               e = _inner_error_;
01872               _inner_error_ = NULL;
01873               _tmp14_ = g_new0 (gchar*, 0 + 1);
01874               xdgkeywords = (_vala_array_free (xdgkeywords, xdgkeywords_length1, (GDestroyNotify) g_free), NULL);
01875               xdgkeywords = _tmp14_;
01876               xdgkeywords_length1 = 0;
01877               _xdgkeywords_size_ = xdgkeywords_length1;
01878               _g_error_free0 (e);
01879        }
01880        __finally10:
01881        if (_inner_error_ != NULL) {
01882               xdgkeywords = (_vala_array_free (xdgkeywords, xdgkeywords_length1, (GDestroyNotify) g_free), NULL);
01883               akeywords = (_vala_array_free (akeywords, akeywords_length1, (GDestroyNotify) g_free), NULL);
01884               gkeywords = (_vala_array_free (gkeywords, gkeywords_length1, (GDestroyNotify) g_free), NULL);
01885               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);
01886               g_clear_error (&_inner_error_);
01887               return;
01888        }
01889        _tmp15_ = gkeywords;
01890        _tmp15__length1 = gkeywords_length1;
01891        _tmp16_ = akeywords;
01892        _tmp16__length1 = akeywords_length1;
01893        _tmp17_ = xdgkeywords;
01894        _tmp17__length1 = xdgkeywords_length1;
01895        _tmp18_ = g_new0 (gchar*, ((_tmp15__length1 + _tmp16__length1) + _tmp17__length1) + 1);
01896        keywords = _tmp18_;
01897        keywords_length1 = (_tmp15__length1 + _tmp16__length1) + _tmp17__length1;
01898        _keywords_size_ = keywords_length1;
01899        {
01900               gint i;
01901               i = 0;
01902               {
01903                      gboolean _tmp19_;
01904                      _tmp19_ = TRUE;
01905                      while (TRUE) {
01906                             gboolean _tmp20_;
01907                             gint _tmp22_;
01908                             gchar** _tmp23_;
01909                             gint _tmp23__length1;
01910                             gchar** _tmp24_;
01911                             gint _tmp24__length1;
01912                             gint _tmp25_;
01913                             gchar** _tmp26_;
01914                             gint _tmp26__length1;
01915                             gint _tmp27_;
01916                             const gchar* _tmp28_;
01917                             gchar* _tmp29_;
01918                             gchar* _tmp30_;
01919                             _tmp20_ = _tmp19_;
01920                             if (!_tmp20_) {
01921                                    gint _tmp21_;
01922                                    _tmp21_ = i;
01923                                    i = _tmp21_ + 1;
01924                             }
01925                             _tmp19_ = FALSE;
01926                             _tmp22_ = i;
01927                             _tmp23_ = gkeywords;
01928                             _tmp23__length1 = gkeywords_length1;
01929                             if (!(_tmp22_ < _tmp23__length1)) {
01930                                    break;
01931                             }
01932                             _tmp24_ = keywords;
01933                             _tmp24__length1 = keywords_length1;
01934                             _tmp25_ = i;
01935                             _tmp26_ = gkeywords;
01936                             _tmp26__length1 = gkeywords_length1;
01937                             _tmp27_ = i;
01938                             _tmp28_ = _tmp26_[_tmp27_];
01939                             _tmp29_ = g_strdup (_tmp28_);
01940                             _g_free0 (_tmp24_[_tmp25_]);
01941                             _tmp24_[_tmp25_] = _tmp29_;
01942                             _tmp30_ = _tmp24_[_tmp25_];
01943                      }
01944               }
01945        }
01946        {
01947               gint i;
01948               i = 0;
01949               {
01950                      gboolean _tmp31_;
01951                      _tmp31_ = TRUE;
01952                      while (TRUE) {
01953                             gboolean _tmp32_;
01954                             gint _tmp34_;
01955                             gchar** _tmp35_;
01956                             gint _tmp35__length1;
01957                             gchar** _tmp36_;
01958                             gint _tmp36__length1;
01959                             gchar** _tmp37_;
01960                             gint _tmp37__length1;
01961                             gint _tmp38_;
01962                             gchar** _tmp39_;
01963                             gint _tmp39__length1;
01964                             gint _tmp40_;
01965                             const gchar* _tmp41_;
01966                             gchar* _tmp42_;
01967                             gchar* _tmp43_;
01968                             _tmp32_ = _tmp31_;
01969                             if (!_tmp32_) {
01970                                    gint _tmp33_;
01971                                    _tmp33_ = i;
01972                                    i = _tmp33_ + 1;
01973                             }
01974                             _tmp31_ = FALSE;
01975                             _tmp34_ = i;
01976                             _tmp35_ = akeywords;
01977                             _tmp35__length1 = akeywords_length1;
01978                             if (!(_tmp34_ < _tmp35__length1)) {
01979                                    break;
01980                             }
01981                             _tmp36_ = keywords;
01982                             _tmp36__length1 = keywords_length1;
01983                             _tmp37_ = gkeywords;
01984                             _tmp37__length1 = gkeywords_length1;
01985                             _tmp38_ = i;
01986                             _tmp39_ = akeywords;
01987                             _tmp39__length1 = akeywords_length1;
01988                             _tmp40_ = i;
01989                             _tmp41_ = _tmp39_[_tmp40_];
01990                             _tmp42_ = g_strdup (_tmp41_);
01991                             _g_free0 (_tmp36_[_tmp37__length1 + _tmp38_]);
01992                             _tmp36_[_tmp37__length1 + _tmp38_] = _tmp42_;
01993                             _tmp43_ = _tmp36_[_tmp37__length1 + _tmp38_];
01994                      }
01995               }
01996        }
01997        {
01998               gint i;
01999               i = 0;
02000               {
02001                      gboolean _tmp44_;
02002                      _tmp44_ = TRUE;
02003                      while (TRUE) {
02004                             gboolean _tmp45_;
02005                             gint _tmp47_;
02006                             gchar** _tmp48_;
02007                             gint _tmp48__length1;
02008                             gchar** _tmp49_;
02009                             gint _tmp49__length1;
02010                             gchar** _tmp50_;
02011                             gint _tmp50__length1;
02012                             gchar** _tmp51_;
02013                             gint _tmp51__length1;
02014                             gint _tmp52_;
02015                             gchar** _tmp53_;
02016                             gint _tmp53__length1;
02017                             gint _tmp54_;
02018                             const gchar* _tmp55_;
02019                             gchar* _tmp56_;
02020                             gchar* _tmp57_;
02021                             _tmp45_ = _tmp44_;
02022                             if (!_tmp45_) {
02023                                    gint _tmp46_;
02024                                    _tmp46_ = i;
02025                                    i = _tmp46_ + 1;
02026                             }
02027                             _tmp44_ = FALSE;
02028                             _tmp47_ = i;
02029                             _tmp48_ = xdgkeywords;
02030                             _tmp48__length1 = xdgkeywords_length1;
02031                             if (!(_tmp47_ < _tmp48__length1)) {
02032                                    break;
02033                             }
02034                             _tmp49_ = keywords;
02035                             _tmp49__length1 = keywords_length1;
02036                             _tmp50_ = gkeywords;
02037                             _tmp50__length1 = gkeywords_length1;
02038                             _tmp51_ = akeywords;
02039                             _tmp51__length1 = akeywords_length1;
02040                             _tmp52_ = i;
02041                             _tmp53_ = xdgkeywords;
02042                             _tmp53__length1 = xdgkeywords_length1;
02043                             _tmp54_ = i;
02044                             _tmp55_ = _tmp53_[_tmp54_];
02045                             _tmp56_ = g_strdup (_tmp55_);
02046                             _g_free0 (_tmp49_[(_tmp50__length1 + _tmp51__length1) + _tmp52_]);
02047                             _tmp49_[(_tmp50__length1 + _tmp51__length1) + _tmp52_] = _tmp56_;
02048                             _tmp57_ = _tmp49_[(_tmp50__length1 + _tmp51__length1) + _tmp52_];
02049                      }
02050               }
02051        }
02052        _tmp58_ = unity_string_array_wrapper_new ();
02053        wrapper = _tmp58_;
02054        _tmp59_ = keywords;
02055        _tmp59__length1 = keywords_length1;
02056        keywords = NULL;
02057        unity_string_array_wrapper_take_strings (wrapper, _tmp59_, _tmp59__length1);
02058        _tmp60_ = self->priv->keywords_by_id;
02059        _tmp61_ = id;
02060        _tmp62_ = g_strdup (_tmp61_);
02061        _tmp63_ = _unity_string_array_wrapper_ref0 (wrapper);
02062        g_hash_table_insert (_tmp60_, _tmp62_, _tmp63_);
02063        _unity_string_array_wrapper_unref0 (wrapper);
02064        keywords = (_vala_array_free (keywords, keywords_length1, (GDestroyNotify) g_free), NULL);
02065        xdgkeywords = (_vala_array_free (xdgkeywords, xdgkeywords_length1, (GDestroyNotify) g_free), NULL);
02066        akeywords = (_vala_array_free (akeywords, akeywords_length1, (GDestroyNotify) g_free), NULL);
02067        gkeywords = (_vala_array_free (gkeywords, gkeywords_length1, (GDestroyNotify) g_free), NULL);
02068 }
02069 
02070 
02071 static void g_cclosure_user_marshal_VOID__STRING_OBJECT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
02072        typedef void (*GMarshalFunc_VOID__STRING_OBJECT) (gpointer data1, const char* arg_1, gpointer arg_2, gpointer data2);
02073        register GMarshalFunc_VOID__STRING_OBJECT callback;
02074        register GCClosure * cc;
02075        register gpointer data1;
02076        register gpointer data2;
02077        cc = (GCClosure *) closure;
02078        g_return_if_fail (n_param_values == 3);
02079        if (G_CCLOSURE_SWAP_DATA (closure)) {
02080               data1 = closure->data;
02081               data2 = param_values->data[0].v_pointer;
02082        } else {
02083               data1 = param_values->data[0].v_pointer;
02084               data2 = closure->data;
02085        }
02086        callback = (GMarshalFunc_VOID__STRING_OBJECT) (marshal_data ? marshal_data : cc->callback);
02087        callback (data1, g_value_get_string (param_values + 1), g_value_get_object (param_values + 2), data2);
02088 }
02089 
02090 
02091 static void unity_app_info_manager_class_init (UnityAppInfoManagerClass * klass) {
02092        unity_app_info_manager_parent_class = g_type_class_peek_parent (klass);
02093        g_type_class_add_private (klass, sizeof (UnityAppInfoManagerPrivate));
02094        G_OBJECT_CLASS (klass)->finalize = unity_app_info_manager_finalize;
02099        g_signal_new ("changed", UNITY_TYPE_APP_INFO_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_OBJECT, G_TYPE_NONE, 2, G_TYPE_STRING, g_app_info_get_type ());
02100 }
02101 
02102 
02103 static void unity_app_info_manager_instance_init (UnityAppInfoManager * self) {
02104        self->priv = UNITY_APP_INFO_MANAGER_GET_PRIVATE (self);
02105 }
02106 
02107 
02108 static void unity_app_info_manager_finalize (GObject* obj) {
02109        UnityAppInfoManager * self;
02110        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_APP_INFO_MANAGER, UnityAppInfoManager);
02111        _g_hash_table_unref0 (self->priv->appinfo_by_id);
02112        _g_hash_table_unref0 (self->priv->monitors);
02113        _g_hash_table_unref0 (self->priv->categories_by_id);
02114        _g_hash_table_unref0 (self->priv->keywords_by_id);
02115        _g_hash_table_unref0 (self->priv->paths_by_id);
02116        G_OBJECT_CLASS (unity_app_info_manager_parent_class)->finalize (obj);
02117 }
02118 
02119 
02128 GType unity_app_info_manager_get_type (void) {
02129        static volatile gsize unity_app_info_manager_type_id__volatile = 0;
02130        if (g_once_init_enter (&unity_app_info_manager_type_id__volatile)) {
02131               static const GTypeInfo g_define_type_info = { sizeof (UnityAppInfoManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_app_info_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityAppInfoManager), 0, (GInstanceInitFunc) unity_app_info_manager_instance_init, NULL };
02132               GType unity_app_info_manager_type_id;
02133               unity_app_info_manager_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityAppInfoManager", &g_define_type_info, 0);
02134               g_once_init_leave (&unity_app_info_manager_type_id__volatile, unity_app_info_manager_type_id);
02135        }
02136        return unity_app_info_manager_type_id__volatile;
02137 }
02138 
02139 
02140 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
02141        if ((array != NULL) && (destroy_func != NULL)) {
02142               int i;
02143               for (i = 0; i < array_length; i = i + 1) {
02144                      if (((gpointer*) array)[i] != NULL) {
02145                             destroy_func (((gpointer*) array)[i]);
02146                      }
02147               }
02148        }
02149 }
02150 
02151 
02152 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
02153        _vala_array_destroy (array, array_length, destroy_func);
02154        g_free (array);
02155 }
02156 
02157 
02158