Back to index

unity-lens-music  6.0.0
musicstore-scope.c
Go to the documentation of this file.
00001 /* musicstore-scope.c generated by valac 0.14.2, the Vala compiler
00002  * generated from musicstore-scope.vala, do not modify */
00003 
00004 /*
00005  * Copyright (C) 2011 Canonical Ltd
00006  *
00007  * This program is free software: you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License version 3 as
00009  * published by the Free Software Foundation.
00010  *
00011  * This program 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 General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00018  *
00019  * Authored by Alex Launi <alex.launi@canonical.com>
00020  *
00021  */
00022 
00023 #include <glib.h>
00024 #include <glib-object.h>
00025 #include <gio/gio.h>
00026 #include <unity.h>
00027 #include <stdlib.h>
00028 #include <string.h>
00029 #include <stdio.h>
00030 #include <dee.h>
00031 
00032 
00033 #define UNITY_MUSIC_LENS_TYPE_SIMPLE_SCOPE (unity_music_lens_simple_scope_get_type ())
00034 #define UNITY_MUSIC_LENS_SIMPLE_SCOPE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_SIMPLE_SCOPE, UnityMusicLensSimpleScope))
00035 #define UNITY_MUSIC_LENS_SIMPLE_SCOPE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_SIMPLE_SCOPE, UnityMusicLensSimpleScopeClass))
00036 #define UNITY_MUSIC_LENS_IS_SIMPLE_SCOPE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_SIMPLE_SCOPE))
00037 #define UNITY_MUSIC_LENS_IS_SIMPLE_SCOPE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_SIMPLE_SCOPE))
00038 #define UNITY_MUSIC_LENS_SIMPLE_SCOPE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_SIMPLE_SCOPE, UnityMusicLensSimpleScopeClass))
00039 
00040 typedef struct _UnityMusicLensSimpleScope UnityMusicLensSimpleScope;
00041 typedef struct _UnityMusicLensSimpleScopeClass UnityMusicLensSimpleScopeClass;
00042 typedef struct _UnityMusicLensSimpleScopePrivate UnityMusicLensSimpleScopePrivate;
00043 
00044 #define UNITY_MUSIC_LENS_TYPE_FILTER_PARSER (unity_music_lens_filter_parser_get_type ())
00045 #define UNITY_MUSIC_LENS_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParser))
00046 #define UNITY_MUSIC_LENS_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParserClass))
00047 #define UNITY_MUSIC_LENS_IS_FILTER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER))
00048 #define UNITY_MUSIC_LENS_IS_FILTER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER))
00049 #define UNITY_MUSIC_LENS_FILTER_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_FILTER_PARSER, UnityMusicLensFilterParserClass))
00050 
00051 typedef struct _UnityMusicLensFilterParser UnityMusicLensFilterParser;
00052 typedef struct _UnityMusicLensFilterParserClass UnityMusicLensFilterParserClass;
00053 
00054 #define UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_SCOPE_PROXY (unity_music_lens_music_store_scope_proxy_get_type ())
00055 #define UNITY_MUSIC_LENS_MUSIC_STORE_SCOPE_PROXY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_SCOPE_PROXY, UnityMusicLensMusicStoreScopeProxy))
00056 #define UNITY_MUSIC_LENS_MUSIC_STORE_SCOPE_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_SCOPE_PROXY, UnityMusicLensMusicStoreScopeProxyClass))
00057 #define UNITY_MUSIC_LENS_IS_MUSIC_STORE_SCOPE_PROXY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_SCOPE_PROXY))
00058 #define UNITY_MUSIC_LENS_IS_MUSIC_STORE_SCOPE_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_SCOPE_PROXY))
00059 #define UNITY_MUSIC_LENS_MUSIC_STORE_SCOPE_PROXY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_SCOPE_PROXY, UnityMusicLensMusicStoreScopeProxyClass))
00060 
00061 typedef struct _UnityMusicLensMusicStoreScopeProxy UnityMusicLensMusicStoreScopeProxy;
00062 typedef struct _UnityMusicLensMusicStoreScopeProxyClass UnityMusicLensMusicStoreScopeProxyClass;
00063 typedef struct _UnityMusicLensMusicStoreScopeProxyPrivate UnityMusicLensMusicStoreScopeProxyPrivate;
00064 
00065 #define UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_COLLECTION (unity_music_lens_music_store_collection_get_type ())
00066 #define UNITY_MUSIC_LENS_MUSIC_STORE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_COLLECTION, UnityMusicLensMusicStoreCollection))
00067 #define UNITY_MUSIC_LENS_MUSIC_STORE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_COLLECTION, UnityMusicLensMusicStoreCollectionClass))
00068 #define UNITY_MUSIC_LENS_IS_MUSIC_STORE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_COLLECTION))
00069 #define UNITY_MUSIC_LENS_IS_MUSIC_STORE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_COLLECTION))
00070 #define UNITY_MUSIC_LENS_MUSIC_STORE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_COLLECTION, UnityMusicLensMusicStoreCollectionClass))
00071 
00072 typedef struct _UnityMusicLensMusicStoreCollection UnityMusicLensMusicStoreCollection;
00073 typedef struct _UnityMusicLensMusicStoreCollectionClass UnityMusicLensMusicStoreCollectionClass;
00074 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
00075 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
00076 #define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
00077 typedef struct _UnityMusicLensMusicStoreScopeProxyPerformSearchData UnityMusicLensMusicStoreScopeProxyPerformSearchData;
00078 
00079 struct _UnityMusicLensSimpleScope {
00080        GObject parent_instance;
00081        UnityMusicLensSimpleScopePrivate * priv;
00082 };
00083 
00084 struct _UnityMusicLensSimpleScopeClass {
00085        GObjectClass parent_class;
00086        void (*perform_search) (UnityMusicLensSimpleScope* self, UnityLensSearch* search, UnitySearchType search_type, GList* filters, gint max_results, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
00087        void (*perform_search_finish) (UnityMusicLensSimpleScope* self, GAsyncResult* _res_);
00088        gint (*get_num_results_without_search) (UnityMusicLensSimpleScope* self);
00089        gint (*get_num_results_global_search) (UnityMusicLensSimpleScope* self);
00090        gint (*get_num_results_lens_search) (UnityMusicLensSimpleScope* self);
00091 };
00092 
00093 struct _UnityMusicLensMusicStoreScopeProxy {
00094        UnityMusicLensSimpleScope parent_instance;
00095        UnityMusicLensMusicStoreScopeProxyPrivate * priv;
00096 };
00097 
00098 struct _UnityMusicLensMusicStoreScopeProxyClass {
00099        UnityMusicLensSimpleScopeClass parent_class;
00100 };
00101 
00102 struct _UnityMusicLensMusicStoreScopeProxyPrivate {
00103        UnityMusicLensMusicStoreCollection* collection;
00104 };
00105 
00106 struct _UnityMusicLensMusicStoreScopeProxyPerformSearchData {
00107        int _state_;
00108        GObject* _source_object_;
00109        GAsyncResult* _res_;
00110        GSimpleAsyncResult* _async_result;
00111        UnityMusicLensMusicStoreScopeProxy* self;
00112        UnityLensSearch* search;
00113        UnitySearchType search_type;
00114        GList* filters;
00115        gint max_results;
00116        GCancellable* cancellable;
00117        UnityLensSearch* _tmp0_;
00118        gboolean _tmp1_;
00119        UnityLensSearch* _tmp2_;
00120        DeeSerializableModel* _tmp3_;
00121        DeeSerializableModel* _tmp4_;
00122        guint _tmp5_;
00123        UnityMusicLensMusicStoreCollection* _tmp6_;
00124        UnityLensSearch* _tmp7_;
00125        UnitySearchType _tmp8_;
00126        GList* _tmp9_;
00127        gint _tmp10_;
00128        GCancellable* _tmp11_;
00129        UnityLensSearch* _tmp12_;
00130        DeeSerializableModel* _tmp13_;
00131        DeeSerializableModel* _tmp14_;
00132        guint _tmp15_;
00133        GError* e;
00134        UnityLensSearch* _tmp16_;
00135        const gchar* _tmp17_;
00136        const gchar* _tmp18_;
00137        GError* _tmp19_;
00138        const gchar* _tmp20_;
00139        GError * _inner_error_;
00140 };
00141 
00142 
00143 static gpointer unity_music_lens_music_store_scope_proxy_parent_class = NULL;
00144 
00145 GType unity_music_lens_simple_scope_get_type (void) G_GNUC_CONST;
00146 GType unity_music_lens_filter_parser_get_type (void) G_GNUC_CONST;
00147 GType unity_music_lens_music_store_scope_proxy_get_type (void) G_GNUC_CONST;
00148 GType unity_music_lens_music_store_collection_get_type (void) G_GNUC_CONST;
00149 #define UNITY_MUSIC_LENS_MUSIC_STORE_SCOPE_PROXY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_SCOPE_PROXY, UnityMusicLensMusicStoreScopeProxyPrivate))
00150 enum  {
00151        UNITY_MUSIC_LENS_MUSIC_STORE_SCOPE_PROXY_DUMMY_PROPERTY,
00152        UNITY_MUSIC_LENS_MUSIC_STORE_SCOPE_PROXY_NUM_RESULTS_WITHOUT_SEARCH,
00153        UNITY_MUSIC_LENS_MUSIC_STORE_SCOPE_PROXY_NUM_RESULTS_GLOBAL_SEARCH,
00154        UNITY_MUSIC_LENS_MUSIC_STORE_SCOPE_PROXY_NUM_RESULTS_LENS_SEARCH
00155 };
00156 UnityMusicLensMusicStoreScopeProxy* unity_music_lens_music_store_scope_proxy_new (void);
00157 UnityMusicLensMusicStoreScopeProxy* unity_music_lens_music_store_scope_proxy_construct (GType object_type);
00158 UnityMusicLensSimpleScope* unity_music_lens_simple_scope_construct (GType object_type);
00159 void unity_music_lens_simple_scope_set_scope (UnityMusicLensSimpleScope* self, UnityScope* value);
00160 UnityScope* unity_music_lens_simple_scope_get_scope (UnityMusicLensSimpleScope* self);
00161 UnityActivationResponse* unity_music_lens_music_store_scope_proxy_activate (UnityMusicLensMusicStoreScopeProxy* self, const gchar* uri);
00162 static UnityActivationResponse* _unity_music_lens_music_store_scope_proxy_activate_unity_scope_activate_uri (UnityScope* _sender, const gchar* uri, gpointer self);
00163 void unity_music_lens_simple_scope_initialize (UnityMusicLensSimpleScope* self);
00164 UnityMusicLensMusicStoreCollection* unity_music_lens_music_store_collection_new (void);
00165 UnityMusicLensMusicStoreCollection* unity_music_lens_music_store_collection_construct (GType object_type);
00166 static void _g_object_unref0_ (gpointer var);
00167 static void _g_list_free__g_object_unref0_ (GList* self);
00168 static void unity_music_lens_music_store_scope_proxy_real_perform_search_data_free (gpointer _data);
00169 static void unity_music_lens_music_store_scope_proxy_real_perform_search (UnityMusicLensSimpleScope* base, UnityLensSearch* search, UnitySearchType search_type, GList* filters, gint max_results, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
00170 static gboolean unity_music_lens_music_store_scope_proxy_real_perform_search_co (UnityMusicLensMusicStoreScopeProxyPerformSearchData* _data_);
00171 gboolean unity_music_lens_simple_scope_is_search_empty (UnityMusicLensSimpleScope* self, UnityLensSearch* search);
00172 void unity_music_lens_music_store_collection_search (UnityMusicLensMusicStoreCollection* self, UnityLensSearch* search, UnitySearchType search_type, GList* filters, gint max_results, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
00173 void unity_music_lens_music_store_collection_search_finish (UnityMusicLensMusicStoreCollection* self, GAsyncResult* _res_, GError** error);
00174 static void unity_music_lens_music_store_scope_proxy_perform_search_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
00175 static void unity_music_lens_music_store_scope_proxy_finalize (GObject* obj);
00176 gint unity_music_lens_simple_scope_get_num_results_without_search (UnityMusicLensSimpleScope* self);
00177 gint unity_music_lens_simple_scope_get_num_results_global_search (UnityMusicLensSimpleScope* self);
00178 gint unity_music_lens_simple_scope_get_num_results_lens_search (UnityMusicLensSimpleScope* self);
00179 static void _vala_unity_music_lens_music_store_scope_proxy_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
00180 
00181 
00182 static UnityActivationResponse* _unity_music_lens_music_store_scope_proxy_activate_unity_scope_activate_uri (UnityScope* _sender, const gchar* uri, gpointer self) {
00183        UnityActivationResponse* result;
00184        result = unity_music_lens_music_store_scope_proxy_activate (self, uri);
00185        return result;
00186 }
00187 
00188 
00189 UnityMusicLensMusicStoreScopeProxy* unity_music_lens_music_store_scope_proxy_construct (GType object_type) {
00190        UnityMusicLensMusicStoreScopeProxy * self = NULL;
00191        UnityScope* _tmp0_;
00192        UnityScope* _tmp1_;
00193        UnityScope* _tmp2_;
00194        UnityScope* _tmp3_;
00195        UnityScope* _tmp4_;
00196        UnityScope* _tmp5_;
00197        UnityMusicLensMusicStoreCollection* _tmp6_;
00198        GError * _inner_error_ = NULL;
00199        self = (UnityMusicLensMusicStoreScopeProxy*) unity_music_lens_simple_scope_construct (object_type);
00200        _tmp0_ = unity_scope_new ("/com/canonical/unity/scope/musicstore");
00201        _tmp1_ = _tmp0_;
00202        unity_music_lens_simple_scope_set_scope ((UnityMusicLensSimpleScope*) self, _tmp1_);
00203        _g_object_unref0 (_tmp1_);
00204        _tmp2_ = unity_music_lens_simple_scope_get_scope ((UnityMusicLensSimpleScope*) self);
00205        _tmp3_ = _tmp2_;
00206        unity_scope_set_search_in_global (_tmp3_, FALSE);
00207        _tmp4_ = unity_music_lens_simple_scope_get_scope ((UnityMusicLensSimpleScope*) self);
00208        _tmp5_ = _tmp4_;
00209        g_signal_connect_object (_tmp5_, "activate-uri", (GCallback) _unity_music_lens_music_store_scope_proxy_activate_unity_scope_activate_uri, self, 0);
00210        unity_music_lens_simple_scope_initialize (UNITY_MUSIC_LENS_SIMPLE_SCOPE (self));
00211        _tmp6_ = unity_music_lens_music_store_collection_new ();
00212        _g_object_unref0 (self->priv->collection);
00213        self->priv->collection = _tmp6_;
00214        {
00215               UnityScope* _tmp7_;
00216               UnityScope* _tmp8_;
00217               _tmp7_ = unity_music_lens_simple_scope_get_scope ((UnityMusicLensSimpleScope*) self);
00218               _tmp8_ = _tmp7_;
00219               unity_scope_export (_tmp8_, &_inner_error_);
00220               if (_inner_error_ != NULL) {
00221                      if (_inner_error_->domain == G_IO_ERROR) {
00222                             goto __catch3_g_io_error;
00223                      }
00224                      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);
00225                      g_clear_error (&_inner_error_);
00226                      return NULL;
00227               }
00228        }
00229        goto __finally3;
00230        __catch3_g_io_error:
00231        {
00232               GError* e = NULL;
00233               FILE* _tmp9_;
00234               GError* _tmp10_;
00235               const gchar* _tmp11_;
00236               e = _inner_error_;
00237               _inner_error_ = NULL;
00238               _tmp9_ = stdout;
00239               _tmp10_ = e;
00240               _tmp11_ = _tmp10_->message;
00241               fprintf (_tmp9_, "%s", _tmp11_);
00242               _g_error_free0 (e);
00243        }
00244        __finally3:
00245        if (_inner_error_ != NULL) {
00246               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);
00247               g_clear_error (&_inner_error_);
00248               return NULL;
00249        }
00250        return self;
00251 }
00252 
00253 
00254 UnityMusicLensMusicStoreScopeProxy* unity_music_lens_music_store_scope_proxy_new (void) {
00255        return unity_music_lens_music_store_scope_proxy_construct (UNITY_MUSIC_LENS_TYPE_MUSIC_STORE_SCOPE_PROXY);
00256 }
00257 
00258 
00259 UnityActivationResponse* unity_music_lens_music_store_scope_proxy_activate (UnityMusicLensMusicStoreScopeProxy* self, const gchar* uri) {
00260        UnityActivationResponse* result = NULL;
00261        UnityActivationResponse* _tmp4_;
00262        UnityActivationResponse* _tmp5_;
00263        GError * _inner_error_ = NULL;
00264        g_return_val_if_fail (self != NULL, NULL);
00265        g_return_val_if_fail (uri != NULL, NULL);
00266        {
00267               const gchar* _tmp0_;
00268               _tmp0_ = uri;
00269               g_app_info_launch_default_for_uri (_tmp0_, NULL, &_inner_error_);
00270               if (_inner_error_ != NULL) {
00271                      goto __catch4_g_error;
00272               }
00273        }
00274        goto __finally4;
00275        __catch4_g_error:
00276        {
00277               GError* e = NULL;
00278               const gchar* _tmp1_;
00279               GError* _tmp2_;
00280               const gchar* _tmp3_;
00281               e = _inner_error_;
00282               _inner_error_ = NULL;
00283               _tmp1_ = uri;
00284               _tmp2_ = e;
00285               _tmp3_ = _tmp2_->message;
00286               g_warning ("musicstore-scope.vala:57: Failed to open uri %s. %s", _tmp1_, _tmp3_);
00287               _g_error_free0 (e);
00288        }
00289        __finally4:
00290        if (_inner_error_ != NULL) {
00291               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);
00292               g_clear_error (&_inner_error_);
00293               return NULL;
00294        }
00295        _tmp4_ = unity_activation_response_new (UNITY_HANDLED_TYPE_HIDE_DASH, "");
00296        _tmp5_ = g_object_ref_sink (_tmp4_);
00297        result = _tmp5_;
00298        return result;
00299 }
00300 
00301 
00302 static void _g_object_unref0_ (gpointer var) {
00303        (var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
00304 }
00305 
00306 
00307 static void _g_list_free__g_object_unref0_ (GList* self) {
00308        g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
00309        g_list_free (self);
00310 }
00311 
00312 
00313 static void unity_music_lens_music_store_scope_proxy_real_perform_search_data_free (gpointer _data) {
00314        UnityMusicLensMusicStoreScopeProxyPerformSearchData* _data_;
00315        _data_ = _data;
00316        _g_object_unref0 (_data_->search);
00317        __g_list_free__g_object_unref0_0 (_data_->filters);
00318        _g_object_unref0 (_data_->cancellable);
00319        _g_object_unref0 (_data_->self);
00320        g_slice_free (UnityMusicLensMusicStoreScopeProxyPerformSearchData, _data_);
00321 }
00322 
00323 
00324 static gpointer _g_object_ref0 (gpointer self) {
00325        return self ? g_object_ref (self) : NULL;
00326 }
00327 
00328 
00329 static void unity_music_lens_music_store_scope_proxy_real_perform_search (UnityMusicLensSimpleScope* base, UnityLensSearch* search, UnitySearchType search_type, GList* filters, gint max_results, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
00330        UnityMusicLensMusicStoreScopeProxy * self;
00331        UnityMusicLensMusicStoreScopeProxyPerformSearchData* _data_;
00332        UnityMusicLensMusicStoreScopeProxy* _tmp0_;
00333        UnityLensSearch* _tmp1_;
00334        UnityLensSearch* _tmp2_;
00335        UnitySearchType _tmp3_;
00336        GList* _tmp4_;
00337        gint _tmp5_;
00338        GCancellable* _tmp6_;
00339        GCancellable* _tmp7_;
00340        self = (UnityMusicLensMusicStoreScopeProxy*) base;
00341        _data_ = g_slice_new0 (UnityMusicLensMusicStoreScopeProxyPerformSearchData);
00342        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_music_lens_music_store_scope_proxy_real_perform_search);
00343        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_music_lens_music_store_scope_proxy_real_perform_search_data_free);
00344        _tmp0_ = _g_object_ref0 (self);
00345        _data_->self = _tmp0_;
00346        _tmp1_ = search;
00347        _tmp2_ = _g_object_ref0 (_tmp1_);
00348        _data_->search = _tmp2_;
00349        _tmp3_ = search_type;
00350        _data_->search_type = _tmp3_;
00351        _tmp4_ = filters;
00352        __g_list_free__g_object_unref0_0 (_data_->filters);
00353        _data_->filters = _tmp4_;
00354        _tmp5_ = max_results;
00355        _data_->max_results = _tmp5_;
00356        _tmp6_ = cancellable;
00357        _tmp7_ = _g_object_ref0 (_tmp6_);
00358        _data_->cancellable = _tmp7_;
00359        unity_music_lens_music_store_scope_proxy_real_perform_search_co (_data_);
00360 }
00361 
00362 
00363 static void unity_music_lens_music_store_scope_proxy_real_perform_search_finish (UnityMusicLensSimpleScope* base, GAsyncResult* _res_) {
00364        UnityMusicLensMusicStoreScopeProxyPerformSearchData* _data_;
00365        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
00366 }
00367 
00368 
00369 static void unity_music_lens_music_store_scope_proxy_perform_search_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
00370        UnityMusicLensMusicStoreScopeProxyPerformSearchData* _data_;
00371        _data_ = _user_data_;
00372        _data_->_source_object_ = source_object;
00373        _data_->_res_ = _res_;
00374        unity_music_lens_music_store_scope_proxy_real_perform_search_co (_data_);
00375 }
00376 
00377 
00378 static gboolean unity_music_lens_music_store_scope_proxy_real_perform_search_co (UnityMusicLensMusicStoreScopeProxyPerformSearchData* _data_) {
00379        switch (_data_->_state_) {
00380               case 0:
00381               goto _state_0;
00382               case 1:
00383               goto _state_1;
00384               default:
00385               g_assert_not_reached ();
00386        }
00387        _state_0:
00388        _data_->_tmp0_ = _data_->search;
00389        _data_->_tmp1_ = FALSE;
00390        _data_->_tmp1_ = unity_music_lens_simple_scope_is_search_empty ((UnityMusicLensSimpleScope*) _data_->self, _data_->_tmp0_);
00391        if (_data_->_tmp1_) {
00392               __g_list_free__g_object_unref0_0 (_data_->filters);
00393               if (_data_->_state_ == 0) {
00394                      g_simple_async_result_complete_in_idle (_data_->_async_result);
00395               } else {
00396                      g_simple_async_result_complete (_data_->_async_result);
00397               }
00398               g_object_unref (_data_->_async_result);
00399               return FALSE;
00400        }
00401        {
00402               _data_->_tmp2_ = _data_->search;
00403               _data_->_tmp3_ = unity_lens_search_get_results_model (_data_->_tmp2_);
00404               _data_->_tmp4_ = _data_->_tmp3_;
00405               _data_->_tmp5_ = 0U;
00406               _data_->_tmp5_ = dee_model_get_n_rows ((DeeModel*) _data_->_tmp4_);
00407               g_debug ("musicstore-scope.vala:72: model has %u rows before search", _data_->_tmp5_);
00408               _data_->_tmp6_ = _data_->self->priv->collection;
00409               _data_->_tmp7_ = _data_->search;
00410               _data_->_tmp8_ = _data_->search_type;
00411               _data_->_tmp9_ = _data_->filters;
00412               _data_->filters = NULL;
00413               _data_->_tmp10_ = _data_->max_results;
00414               _data_->_tmp11_ = _data_->cancellable;
00415               _data_->_state_ = 1;
00416               unity_music_lens_music_store_collection_search (_data_->_tmp6_, _data_->_tmp7_, _data_->_tmp8_, _data_->_tmp9_, _data_->_tmp10_, _data_->_tmp11_, unity_music_lens_music_store_scope_proxy_perform_search_ready, _data_);
00417               return FALSE;
00418               _state_1:
00419               unity_music_lens_music_store_collection_search_finish (_data_->_tmp6_, _data_->_res_, &_data_->_inner_error_);
00420               if (_data_->_inner_error_ != NULL) {
00421                      if (_data_->_inner_error_->domain == G_IO_ERROR) {
00422                             goto __catch5_g_io_error;
00423                      }
00424                      __g_list_free__g_object_unref0_0 (_data_->filters);
00425                      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);
00426                      g_clear_error (&_data_->_inner_error_);
00427                      return FALSE;
00428               }
00429               _data_->_tmp12_ = _data_->search;
00430               _data_->_tmp13_ = unity_lens_search_get_results_model (_data_->_tmp12_);
00431               _data_->_tmp14_ = _data_->_tmp13_;
00432               _data_->_tmp15_ = 0U;
00433               _data_->_tmp15_ = dee_model_get_n_rows ((DeeModel*) _data_->_tmp14_);
00434               g_debug ("musicstore-scope.vala:74: model has %u rows after search", _data_->_tmp15_);
00435        }
00436        goto __finally5;
00437        __catch5_g_io_error:
00438        {
00439               _data_->e = _data_->_inner_error_;
00440               _data_->_inner_error_ = NULL;
00441               _data_->_tmp16_ = _data_->search;
00442               _data_->_tmp17_ = unity_lens_search_get_search_string (_data_->_tmp16_);
00443               _data_->_tmp18_ = _data_->_tmp17_;
00444               _data_->_tmp19_ = _data_->e;
00445               _data_->_tmp20_ = _data_->_tmp19_->message;
00446               g_warning ("musicstore-scope.vala:76: Failed to search for '%s': %s", _data_->_tmp18_, _data_->_tmp20_);
00447               _g_error_free0 (_data_->e);
00448        }
00449        __finally5:
00450        if (_data_->_inner_error_ != NULL) {
00451               __g_list_free__g_object_unref0_0 (_data_->filters);
00452               g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
00453               g_clear_error (&_data_->_inner_error_);
00454               return FALSE;
00455        }
00456        __g_list_free__g_object_unref0_0 (_data_->filters);
00457        if (_data_->_state_ == 0) {
00458               g_simple_async_result_complete_in_idle (_data_->_async_result);
00459        } else {
00460               g_simple_async_result_complete (_data_->_async_result);
00461        }
00462        g_object_unref (_data_->_async_result);
00463        return FALSE;
00464 }
00465 
00466 
00467 static gint unity_music_lens_music_store_scope_proxy_real_get_num_results_without_search (UnityMusicLensSimpleScope* base) {
00468        gint result;
00469        UnityMusicLensMusicStoreScopeProxy* self;
00470        self = (UnityMusicLensMusicStoreScopeProxy*) base;
00471        result = 100;
00472        return result;
00473 }
00474 
00475 
00476 static gint unity_music_lens_music_store_scope_proxy_real_get_num_results_global_search (UnityMusicLensSimpleScope* base) {
00477        gint result;
00478        UnityMusicLensMusicStoreScopeProxy* self;
00479        self = (UnityMusicLensMusicStoreScopeProxy*) base;
00480        result = 20;
00481        return result;
00482 }
00483 
00484 
00485 static gint unity_music_lens_music_store_scope_proxy_real_get_num_results_lens_search (UnityMusicLensSimpleScope* base) {
00486        gint result;
00487        UnityMusicLensMusicStoreScopeProxy* self;
00488        self = (UnityMusicLensMusicStoreScopeProxy*) base;
00489        result = 50;
00490        return result;
00491 }
00492 
00493 
00494 static void unity_music_lens_music_store_scope_proxy_class_init (UnityMusicLensMusicStoreScopeProxyClass * klass) {
00495        unity_music_lens_music_store_scope_proxy_parent_class = g_type_class_peek_parent (klass);
00496        g_type_class_add_private (klass, sizeof (UnityMusicLensMusicStoreScopeProxyPrivate));
00497        UNITY_MUSIC_LENS_SIMPLE_SCOPE_CLASS (klass)->perform_search = unity_music_lens_music_store_scope_proxy_real_perform_search;
00498        UNITY_MUSIC_LENS_SIMPLE_SCOPE_CLASS (klass)->perform_search_finish = unity_music_lens_music_store_scope_proxy_real_perform_search_finish;
00499        UNITY_MUSIC_LENS_SIMPLE_SCOPE_CLASS (klass)->get_num_results_without_search = unity_music_lens_music_store_scope_proxy_real_get_num_results_without_search;
00500        UNITY_MUSIC_LENS_SIMPLE_SCOPE_CLASS (klass)->get_num_results_global_search = unity_music_lens_music_store_scope_proxy_real_get_num_results_global_search;
00501        UNITY_MUSIC_LENS_SIMPLE_SCOPE_CLASS (klass)->get_num_results_lens_search = unity_music_lens_music_store_scope_proxy_real_get_num_results_lens_search;
00502        G_OBJECT_CLASS (klass)->get_property = _vala_unity_music_lens_music_store_scope_proxy_get_property;
00503        G_OBJECT_CLASS (klass)->finalize = unity_music_lens_music_store_scope_proxy_finalize;
00504        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_LENS_MUSIC_STORE_SCOPE_PROXY_NUM_RESULTS_WITHOUT_SEARCH, g_param_spec_int ("num-results-without-search", "num-results-without-search", "num-results-without-search", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
00505        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_LENS_MUSIC_STORE_SCOPE_PROXY_NUM_RESULTS_GLOBAL_SEARCH, g_param_spec_int ("num-results-global-search", "num-results-global-search", "num-results-global-search", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
00506        g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_MUSIC_LENS_MUSIC_STORE_SCOPE_PROXY_NUM_RESULTS_LENS_SEARCH, g_param_spec_int ("num-results-lens-search", "num-results-lens-search", "num-results-lens-search", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
00507 }
00508 
00509 
00510 static void unity_music_lens_music_store_scope_proxy_instance_init (UnityMusicLensMusicStoreScopeProxy * self) {
00511        self->priv = UNITY_MUSIC_LENS_MUSIC_STORE_SCOPE_PROXY_GET_PRIVATE (self);
00512 }
00513 
00514 
00515 static void unity_music_lens_music_store_scope_proxy_finalize (GObject* obj) {
00516        UnityMusicLensMusicStoreScopeProxy * self;
00517        self = UNITY_MUSIC_LENS_MUSIC_STORE_SCOPE_PROXY (obj);
00518        _g_object_unref0 (self->priv->collection);
00519        G_OBJECT_CLASS (unity_music_lens_music_store_scope_proxy_parent_class)->finalize (obj);
00520 }
00521 
00522 
00523 GType unity_music_lens_music_store_scope_proxy_get_type (void) {
00524        static volatile gsize unity_music_lens_music_store_scope_proxy_type_id__volatile = 0;
00525        if (g_once_init_enter (&unity_music_lens_music_store_scope_proxy_type_id__volatile)) {
00526               static const GTypeInfo g_define_type_info = { sizeof (UnityMusicLensMusicStoreScopeProxyClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_music_lens_music_store_scope_proxy_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityMusicLensMusicStoreScopeProxy), 0, (GInstanceInitFunc) unity_music_lens_music_store_scope_proxy_instance_init, NULL };
00527               GType unity_music_lens_music_store_scope_proxy_type_id;
00528               unity_music_lens_music_store_scope_proxy_type_id = g_type_register_static (UNITY_MUSIC_LENS_TYPE_SIMPLE_SCOPE, "UnityMusicLensMusicStoreScopeProxy", &g_define_type_info, 0);
00529               g_once_init_leave (&unity_music_lens_music_store_scope_proxy_type_id__volatile, unity_music_lens_music_store_scope_proxy_type_id);
00530        }
00531        return unity_music_lens_music_store_scope_proxy_type_id__volatile;
00532 }
00533 
00534 
00535 static void _vala_unity_music_lens_music_store_scope_proxy_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
00536        UnityMusicLensMusicStoreScopeProxy * self;
00537        self = UNITY_MUSIC_LENS_MUSIC_STORE_SCOPE_PROXY (object);
00538        switch (property_id) {
00539               case UNITY_MUSIC_LENS_MUSIC_STORE_SCOPE_PROXY_NUM_RESULTS_WITHOUT_SEARCH:
00540               g_value_set_int (value, unity_music_lens_simple_scope_get_num_results_without_search ((UnityMusicLensSimpleScope*) self));
00541               break;
00542               case UNITY_MUSIC_LENS_MUSIC_STORE_SCOPE_PROXY_NUM_RESULTS_GLOBAL_SEARCH:
00543               g_value_set_int (value, unity_music_lens_simple_scope_get_num_results_global_search ((UnityMusicLensSimpleScope*) self));
00544               break;
00545               case UNITY_MUSIC_LENS_MUSIC_STORE_SCOPE_PROXY_NUM_RESULTS_LENS_SEARCH:
00546               g_value_set_int (value, unity_music_lens_simple_scope_get_num_results_lens_search ((UnityMusicLensSimpleScope*) self));
00547               break;
00548               default:
00549               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
00550               break;
00551        }
00552 }
00553 
00554 
00555