Back to index

libunity  5.92.0
test-remote-scope.c
Go to the documentation of this file.
00001 /* test-remote-scope.c generated by valac 0.17.2, the Vala compiler
00002  * generated from test-remote-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 Michal Hruby <michal.hruby@canonical.com>
00020  *
00021  */
00022 
00023 #include <glib.h>
00024 #include <glib-object.h>
00025 #include <unity-internal.h>
00026 #include <stdlib.h>
00027 #include <string.h>
00028 #include <config.h>
00029 #include <gio/gio.h>
00030 #include <dee.h>
00031 #include <gobject/gvaluecollector.h>
00032 
00033 
00034 #define TYPE_MAIN (main_get_type ())
00035 #define MAIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN, Main))
00036 #define MAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN, MainClass))
00037 #define IS_MAIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN))
00038 #define IS_MAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN))
00039 #define MAIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN, MainClass))
00040 
00041 typedef struct _Main Main;
00042 typedef struct _MainClass MainClass;
00043 typedef struct _MainPrivate MainPrivate;
00044 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
00045 typedef struct _Block1Data Block1Data;
00046 #define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_unref (var), NULL)))
00047 typedef struct _Block2Data Block2Data;
00048 typedef struct _Block3Data Block3Data;
00049 typedef struct _Block4Data Block4Data;
00050 typedef struct _Block5Data Block5Data;
00051 typedef struct _Block6Data Block6Data;
00052 typedef struct _Block7Data Block7Data;
00053 typedef struct _Block8Data Block8Data;
00054 typedef struct _Block9Data Block9Data;
00055 typedef struct _Block10Data Block10Data;
00056 typedef struct _Block11Data Block11Data;
00057 #define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
00058 typedef struct _Block12Data Block12Data;
00059 typedef struct _Block13Data Block13Data;
00060 typedef struct _Block14Data Block14Data;
00061 typedef struct _ParamSpecMain ParamSpecMain;
00062 #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
00063 
00064 struct _Main {
00065        GTypeInstance parent_instance;
00066        volatile int ref_count;
00067        MainPrivate * priv;
00068 };
00069 
00070 struct _MainClass {
00071        GTypeClass parent_class;
00072        void (*finalize) (Main *self);
00073 };
00074 
00075 struct _Block1Data {
00076        int _ref_count_;
00077        GMainLoop* ml;
00078        gboolean got_search_changed;
00079 };
00080 
00081 struct _Block2Data {
00082        int _ref_count_;
00083        GMainLoop* ml;
00084        gboolean got_search_changed;
00085 };
00086 
00087 struct _Block3Data {
00088        int _ref_count_;
00089        Block2Data * _data2_;
00090        UnityLensSearch* lens_search;
00091 };
00092 
00093 struct _Block4Data {
00094        int _ref_count_;
00095        GMainLoop* ml;
00096        gboolean got_search_changed;
00097 };
00098 
00099 struct _Block5Data {
00100        int _ref_count_;
00101        Block4Data * _data4_;
00102        UnityLensSearch* lens_search;
00103 };
00104 
00105 struct _Block6Data {
00106        int _ref_count_;
00107        GMainLoop* ml;
00108        gboolean got_search_changed;
00109        GCancellable* canc1;
00110        GCancellable* canc2;
00111        guint num_searches;
00112 };
00113 
00114 struct _Block7Data {
00115        int _ref_count_;
00116        Block6Data * _data6_;
00117        UnityLensSearch* lens_search;
00118 };
00119 
00120 struct _Block8Data {
00121        int _ref_count_;
00122        GMainLoop* ml;
00123        gboolean got_search_changed;
00124 };
00125 
00126 struct _Block9Data {
00127        int _ref_count_;
00128        Block8Data * _data8_;
00129        UnityLensSearch* lens_search;
00130 };
00131 
00132 struct _Block10Data {
00133        int _ref_count_;
00134        GMainLoop* ml;
00135        gboolean got_search_changed;
00136 };
00137 
00138 struct _Block11Data {
00139        int _ref_count_;
00140        Block10Data * _data10_;
00141        UnityLensSearch* lens_search;
00142 };
00143 
00144 struct _Block12Data {
00145        int _ref_count_;
00146        GMainLoop* ml;
00147        gboolean remove_option;
00148 };
00149 
00150 struct _Block13Data {
00151        int _ref_count_;
00152        Block12Data * _data12_;
00153        UnityLensSearch* lens_search;
00154 };
00155 
00156 struct _Block14Data {
00157        int _ref_count_;
00158        GMainLoop* ml;
00159 };
00160 
00161 struct _ParamSpecMain {
00162        GParamSpec parent_instance;
00163 };
00164 
00165 
00166 static gpointer main_parent_class = NULL;
00167 static UnityScope* main_exported_scope;
00168 static UnityScope* main_exported_scope = NULL;
00169 
00170 gpointer main_ref (gpointer instance);
00171 void main_unref (gpointer instance);
00172 GParamSpec* param_spec_main (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
00173 void value_set_main (GValue* value, gpointer v_object);
00174 void value_take_main (GValue* value, gpointer v_object);
00175 gpointer value_get_main (const GValue* value);
00176 GType main_get_type (void) G_GNUC_CONST;
00177 enum  {
00178        MAIN_DUMMY_PROPERTY
00179 };
00180 gint main_main (gchar** args, int args_length1);
00181 void main_test_scope_export (void);
00182 static void _main_test_scope_export_gtest_data_func (gpointer self);
00183 void main_test_scope_search (void);
00184 static void _main_test_scope_search_gtest_data_func (gpointer self);
00185 void main_test_scope_search2 (void);
00186 static void _main_test_scope_search2_gtest_data_func (gpointer self);
00187 void main_test_scope_successive_searches (void);
00188 static void _main_test_scope_successive_searches_gtest_data_func (gpointer self);
00189 void main_test_scope_two_searches (void);
00190 static void _main_test_scope_two_searches_gtest_data_func (gpointer self);
00191 void main_test_scope_model_sync (void);
00192 static void _main_test_scope_model_sync_gtest_data_func (gpointer self);
00193 void main_test_scope_reply_hint (void);
00194 static void _main_test_scope_reply_hint_gtest_data_func (gpointer self);
00195 void main_test_scope_sources (void);
00196 static void _main_test_scope_sources_gtest_data_func (gpointer self);
00197 void main_test_scope_finalize (void);
00198 static void _main_test_scope_finalize_gtest_data_func (gpointer self);
00199 static void __lambda2_ (void);
00200 static void ___lambda2__gbus_acquired_callback (GDBusConnection* connection, const gchar* name, gpointer self);
00201 static void __lambda3_ (void);
00202 static void ___lambda3__gbus_name_acquired_callback (GDBusConnection* connection, const gchar* name, gpointer self);
00203 static void __lambda4_ (void);
00204 static void ___lambda4__gbus_name_lost_callback (GDBusConnection* connection, const gchar* name, gpointer self);
00205 static Block1Data* block1_data_ref (Block1Data* _data1_);
00206 static void block1_data_unref (void * _userdata_);
00207 static void __lambda5_ (Block1Data* _data1_, UnityLensSearch* lens_search);
00208 static void ___lambda5__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00209 static gboolean __lambda6_ (Block1Data* _data1_);
00210 static gboolean ___lambda6__gsource_func (gpointer self);
00211 static Block2Data* block2_data_ref (Block2Data* _data2_);
00212 static void block2_data_unref (void * _userdata_);
00213 static void __lambda7_ (Block2Data* _data2_, UnityLensSearch* lens_search);
00214 static Block3Data* block3_data_ref (Block3Data* _data3_);
00215 static void block3_data_unref (void * _userdata_);
00216 static gboolean __lambda8_ (Block3Data* _data3_);
00217 static gboolean ___lambda8__gsource_func (gpointer self);
00218 static void ___lambda7__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00219 static gboolean __lambda9_ (Block2Data* _data2_);
00220 static gboolean ___lambda9__gsource_func (gpointer self);
00221 static Block4Data* block4_data_ref (Block4Data* _data4_);
00222 static void block4_data_unref (void * _userdata_);
00223 static void __lambda10_ (Block4Data* _data4_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable);
00224 static Block5Data* block5_data_ref (Block5Data* _data5_);
00225 static void block5_data_unref (void * _userdata_);
00226 static gboolean __lambda11_ (Block5Data* _data5_);
00227 static gboolean ___lambda11__gsource_func (gpointer self);
00228 static void ___lambda10__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00229 static gboolean __lambda12_ (Block4Data* _data4_);
00230 static gboolean ___lambda12__gsource_func (gpointer self);
00231 static Block6Data* block6_data_ref (Block6Data* _data6_);
00232 static void block6_data_unref (void * _userdata_);
00233 static void __lambda13_ (Block6Data* _data6_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable);
00234 static Block7Data* block7_data_ref (Block7Data* _data7_);
00235 static void block7_data_unref (void * _userdata_);
00236 static gboolean __lambda14_ (Block7Data* _data7_);
00237 static gboolean ___lambda14__gsource_func (gpointer self);
00238 static void ___lambda13__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00239 static gboolean __lambda15_ (Block6Data* _data6_);
00240 static gboolean ___lambda15__gsource_func (gpointer self);
00241 static Block8Data* block8_data_ref (Block8Data* _data8_);
00242 static void block8_data_unref (void * _userdata_);
00243 static void __lambda16_ (Block8Data* _data8_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable);
00244 static Block9Data* block9_data_ref (Block9Data* _data9_);
00245 static void block9_data_unref (void * _userdata_);
00246 static gboolean __lambda17_ (Block9Data* _data9_);
00247 static gboolean ___lambda17__gsource_func (gpointer self);
00248 static void ___lambda16__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00249 static gboolean __lambda18_ (void);
00250 static gboolean ___lambda18__gsource_func (gpointer self);
00251 static Block10Data* block10_data_ref (Block10Data* _data10_);
00252 static void block10_data_unref (void * _userdata_);
00253 static void __lambda19_ (Block10Data* _data10_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable);
00254 static Block11Data* block11_data_ref (Block11Data* _data11_);
00255 static void block11_data_unref (void * _userdata_);
00256 static gboolean __lambda20_ (Block11Data* _data11_);
00257 static gboolean ___lambda20__gsource_func (gpointer self);
00258 static void ___lambda19__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00259 static gboolean __lambda21_ (void);
00260 static gboolean ___lambda21__gsource_func (gpointer self);
00261 static Block12Data* block12_data_ref (Block12Data* _data12_);
00262 static void block12_data_unref (void * _userdata_);
00263 static void __lambda22_ (Block12Data* _data12_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable);
00264 static Block13Data* block13_data_ref (Block13Data* _data13_);
00265 static void block13_data_unref (void * _userdata_);
00266 static gboolean __lambda23_ (Block13Data* _data13_);
00267 static gboolean ___lambda23__gsource_func (gpointer self);
00268 static void ___lambda22__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
00269 static gboolean __lambda24_ (void);
00270 static gboolean ___lambda24__gsource_func (gpointer self);
00271 static gboolean __lambda25_ (void);
00272 static gboolean ___lambda25__gsource_func (gpointer self);
00273 static Block14Data* block14_data_ref (Block14Data* _data14_);
00274 static void block14_data_unref (void * _userdata_);
00275 static void __lambda26_ (void);
00276 static void ___lambda26__gbus_name_appeared_callback (GDBusConnection* connection, const gchar* name, const gchar* name_owner, gpointer self);
00277 static void __lambda27_ (Block14Data* _data14_);
00278 static void ___lambda27__gbus_name_vanished_callback (GDBusConnection* connection, const gchar* name, gpointer self);
00279 Main* main_new (void);
00280 Main* main_construct (GType object_type);
00281 static void main_finalize (Main* obj);
00282 
00283 
00284 static void _main_test_scope_export_gtest_data_func (gpointer self) {
00285        main_test_scope_export ();
00286 }
00287 
00288 
00289 static void _main_test_scope_search_gtest_data_func (gpointer self) {
00290        main_test_scope_search ();
00291 }
00292 
00293 
00294 static void _main_test_scope_search2_gtest_data_func (gpointer self) {
00295        main_test_scope_search2 ();
00296 }
00297 
00298 
00299 static void _main_test_scope_successive_searches_gtest_data_func (gpointer self) {
00300        main_test_scope_successive_searches ();
00301 }
00302 
00303 
00304 static void _main_test_scope_two_searches_gtest_data_func (gpointer self) {
00305        main_test_scope_two_searches ();
00306 }
00307 
00308 
00309 static void _main_test_scope_model_sync_gtest_data_func (gpointer self) {
00310        main_test_scope_model_sync ();
00311 }
00312 
00313 
00314 static void _main_test_scope_reply_hint_gtest_data_func (gpointer self) {
00315        main_test_scope_reply_hint ();
00316 }
00317 
00318 
00319 static void _main_test_scope_sources_gtest_data_func (gpointer self) {
00320        main_test_scope_sources ();
00321 }
00322 
00323 
00324 static void _main_test_scope_finalize_gtest_data_func (gpointer self) {
00325        main_test_scope_finalize ();
00326 }
00327 
00328 
00329 gint main_main (gchar** args, int args_length1) {
00330        gint result = 0;
00331        g_setenv ("LIBUNITY_LENS_DIRECTORY", TESTDIR "/data", TRUE);
00332        g_test_init (&args_length1, &args, NULL);
00333        g_test_add_data_func ("/Integration/Scope/Export", NULL, _main_test_scope_export_gtest_data_func);
00334        g_test_add_data_func ("/Integration/Scope/Search", NULL, _main_test_scope_search_gtest_data_func);
00335        g_test_add_data_func ("/Integration/Scope/Search2", NULL, _main_test_scope_search2_gtest_data_func);
00336        g_test_add_data_func ("/Integration/Scope/SuccessiveSearches", NULL, _main_test_scope_successive_searches_gtest_data_func);
00337        g_test_add_data_func ("/Integration/Scope/TwoSearches", NULL, _main_test_scope_two_searches_gtest_data_func);
00338        g_test_add_data_func ("/Integration/Scope/ModelSync", NULL, _main_test_scope_model_sync_gtest_data_func);
00339        g_test_add_data_func ("/Integration/Scope/ReplyHint", NULL, _main_test_scope_reply_hint_gtest_data_func);
00340        g_test_add_data_func ("/Integration/Scope/Sources", NULL, _main_test_scope_sources_gtest_data_func);
00341        g_test_add_data_func ("/Integration/Scope/Finalize", NULL, _main_test_scope_finalize_gtest_data_func);
00342        g_test_run ();
00343        result = 0;
00344        return result;
00345 }
00346 
00347 
00348 int main (int argc, char ** argv) {
00349        g_type_init ();
00350        return main_main (argv, argc);
00351 }
00352 
00353 
00354 static void __lambda2_ (void) {
00355 }
00356 
00357 
00358 static void ___lambda2__gbus_acquired_callback (GDBusConnection* connection, const gchar* name, gpointer self) {
00359        __lambda2_ ();
00360 }
00361 
00362 
00363 static void __lambda3_ (void) {
00364 }
00365 
00366 
00367 static void ___lambda3__gbus_name_acquired_callback (GDBusConnection* connection, const gchar* name, gpointer self) {
00368        __lambda3_ ();
00369 }
00370 
00371 
00372 static void __lambda4_ (void) {
00373        g_debug ("test-remote-scope.vala:49: Name lost");
00374        g_assert_not_reached ();
00375 }
00376 
00377 
00378 static void ___lambda4__gbus_name_lost_callback (GDBusConnection* connection, const gchar* name, gpointer self) {
00379        __lambda4_ ();
00380 }
00381 
00382 
00383 static gpointer _g_object_ref0 (gpointer self) {
00384        return self ? g_object_ref (self) : NULL;
00385 }
00386 
00387 
00388 void main_test_scope_export (void) {
00389        UnityScope* _tmp0_;
00390        UnityScope* scope;
00391        UnityScope* _tmp1_;
00392        GError * _inner_error_ = NULL;
00393        g_bus_own_name_with_closures (G_BUS_TYPE_SESSION, "com.canonical.Unity.Scope0.Test", 0, (GClosure*) ((___lambda2__gbus_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda2__gbus_acquired_callback, NULL, NULL)), (GClosure*) ((___lambda3__gbus_name_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda3__gbus_name_acquired_callback, NULL, NULL)), (GClosure*) ((___lambda4__gbus_name_lost_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda4__gbus_name_lost_callback, NULL, NULL)));
00394        _tmp0_ = unity_scope_new ("/com/canonical/Unity/Scope0/Test");
00395        scope = _tmp0_;
00396        unity_scope_export (scope, &_inner_error_);
00397        if (_inner_error_ != NULL) {
00398               _g_object_unref0 (scope);
00399               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);
00400               g_clear_error (&_inner_error_);
00401               return;
00402        }
00403        _tmp1_ = _g_object_ref0 (scope);
00404        _g_object_unref0 (main_exported_scope);
00405        main_exported_scope = _tmp1_;
00406        _g_object_unref0 (scope);
00407 }
00408 
00409 
00410 static Block1Data* block1_data_ref (Block1Data* _data1_) {
00411        g_atomic_int_inc (&_data1_->_ref_count_);
00412        return _data1_;
00413 }
00414 
00415 
00416 static void block1_data_unref (void * _userdata_) {
00417        Block1Data* _data1_;
00418        _data1_ = (Block1Data*) _userdata_;
00419        if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
00420               _g_main_loop_unref0 (_data1_->ml);
00421               g_slice_free (Block1Data, _data1_);
00422        }
00423 }
00424 
00425 
00426 static void __lambda5_ (Block1Data* _data1_, UnityLensSearch* lens_search) {
00427        UnityLensSearch* _tmp0_;
00428        const gchar* _tmp1_;
00429        const gchar* _tmp2_;
00430        UnityLensSearch* _tmp3_;
00431        GMainLoop* _tmp4_;
00432        g_return_if_fail (lens_search != NULL);
00433        _tmp0_ = lens_search;
00434        _tmp1_ = unity_lens_search_get_search_string (_tmp0_);
00435        _tmp2_ = _tmp1_;
00436        _vala_assert (g_strcmp0 (_tmp2_, "foo") == 0, "lens_search.search_string == \"foo\"");
00437        _data1_->got_search_changed = TRUE;
00438        _tmp3_ = lens_search;
00439        g_signal_emit_by_name (_tmp3_, "finished");
00440        _tmp4_ = _data1_->ml;
00441        g_main_loop_quit (_tmp4_);
00442 }
00443 
00444 
00445 static void ___lambda5__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
00446        __lambda5_ (self, search);
00447 }
00448 
00449 
00450 static gboolean __lambda6_ (Block1Data* _data1_) {
00451        gboolean result = FALSE;
00452        GMainLoop* _tmp0_;
00453        _tmp0_ = _data1_->ml;
00454        g_main_loop_quit (_tmp0_);
00455        result = FALSE;
00456        return result;
00457 }
00458 
00459 
00460 static gboolean ___lambda6__gsource_func (gpointer self) {
00461        gboolean result;
00462        result = __lambda6_ (self);
00463        return result;
00464 }
00465 
00466 
00467 void main_test_scope_search (void) {
00468        Block1Data* _data1_;
00469        UnityScope* _tmp0_;
00470        GMainLoop* _tmp1_;
00471        UnityScope* _tmp2_;
00472        gulong _tmp3_ = 0UL;
00473        gulong sig_id;
00474        GMainLoop* _tmp4_;
00475        gboolean _tmp5_;
00476        UnityScope* _tmp6_;
00477        gulong _tmp7_;
00478        GDBusConnection* _tmp8_ = NULL;
00479        GDBusConnection* bus;
00480        GDBusConnection* _tmp9_;
00481        GError * _inner_error_ = NULL;
00482        _data1_ = g_slice_new0 (Block1Data);
00483        _data1_->_ref_count_ = 1;
00484        _tmp0_ = main_exported_scope;
00485        _vala_assert (_tmp0_ != NULL, "exported_scope != null");
00486        _tmp1_ = g_main_loop_new (NULL, FALSE);
00487        _data1_->ml = _tmp1_;
00488        _data1_->got_search_changed = FALSE;
00489        _tmp2_ = main_exported_scope;
00490        _tmp3_ = g_signal_connect_data (_tmp2_, "search-changed", (GCallback) ___lambda5__unity_scope_search_changed, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
00491        sig_id = _tmp3_;
00492        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 2000, ___lambda6__gsource_func, block1_data_ref (_data1_), block1_data_unref);
00493        _tmp4_ = _data1_->ml;
00494        g_main_loop_run (_tmp4_);
00495        _tmp5_ = _data1_->got_search_changed;
00496        _vala_assert (_tmp5_ == TRUE, "got_search_changed == true");
00497        _tmp6_ = main_exported_scope;
00498        _tmp7_ = sig_id;
00499        g_signal_handler_disconnect (_tmp6_, _tmp7_);
00500        _tmp8_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
00501        bus = _tmp8_;
00502        if (_inner_error_ != NULL) {
00503               block1_data_unref (_data1_);
00504               _data1_ = NULL;
00505               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);
00506               g_clear_error (&_inner_error_);
00507               return;
00508        }
00509        _tmp9_ = bus;
00510        g_dbus_connection_flush_sync (_tmp9_, NULL, &_inner_error_);
00511        if (_inner_error_ != NULL) {
00512               _g_object_unref0 (bus);
00513               block1_data_unref (_data1_);
00514               _data1_ = NULL;
00515               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);
00516               g_clear_error (&_inner_error_);
00517               return;
00518        }
00519        _g_object_unref0 (bus);
00520        block1_data_unref (_data1_);
00521        _data1_ = NULL;
00522 }
00523 
00524 
00525 static Block2Data* block2_data_ref (Block2Data* _data2_) {
00526        g_atomic_int_inc (&_data2_->_ref_count_);
00527        return _data2_;
00528 }
00529 
00530 
00531 static void block2_data_unref (void * _userdata_) {
00532        Block2Data* _data2_;
00533        _data2_ = (Block2Data*) _userdata_;
00534        if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
00535               _g_main_loop_unref0 (_data2_->ml);
00536               g_slice_free (Block2Data, _data2_);
00537        }
00538 }
00539 
00540 
00541 static Block3Data* block3_data_ref (Block3Data* _data3_) {
00542        g_atomic_int_inc (&_data3_->_ref_count_);
00543        return _data3_;
00544 }
00545 
00546 
00547 static void block3_data_unref (void * _userdata_) {
00548        Block3Data* _data3_;
00549        _data3_ = (Block3Data*) _userdata_;
00550        if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
00551               _g_object_unref0 (_data3_->lens_search);
00552               block2_data_unref (_data3_->_data2_);
00553               _data3_->_data2_ = NULL;
00554               g_slice_free (Block3Data, _data3_);
00555        }
00556 }
00557 
00558 
00559 static gboolean __lambda8_ (Block3Data* _data3_) {
00560        Block2Data* _data2_;
00561        gboolean result = FALSE;
00562        UnityLensSearch* _tmp0_;
00563        GMainLoop* _tmp1_;
00564        _data2_ = _data3_->_data2_;
00565        _tmp0_ = _data3_->lens_search;
00566        g_signal_emit_by_name (_tmp0_, "finished");
00567        _tmp1_ = _data2_->ml;
00568        g_main_loop_quit (_tmp1_);
00569        result = FALSE;
00570        return result;
00571 }
00572 
00573 
00574 static gboolean ___lambda8__gsource_func (gpointer self) {
00575        gboolean result;
00576        result = __lambda8_ (self);
00577        return result;
00578 }
00579 
00580 
00581 static void __lambda7_ (Block2Data* _data2_, UnityLensSearch* lens_search) {
00582        Block3Data* _data3_;
00583        UnityLensSearch* _tmp0_;
00584        UnityLensSearch* _tmp1_;
00585        UnityLensSearch* _tmp2_;
00586        const gchar* _tmp3_;
00587        const gchar* _tmp4_;
00588        g_return_if_fail (lens_search != NULL);
00589        _data3_ = g_slice_new0 (Block3Data);
00590        _data3_->_ref_count_ = 1;
00591        _data3_->_data2_ = block2_data_ref (_data2_);
00592        _tmp0_ = lens_search;
00593        _tmp1_ = _g_object_ref0 (_tmp0_);
00594        _data3_->lens_search = _tmp1_;
00595        _tmp2_ = _data3_->lens_search;
00596        _tmp3_ = unity_lens_search_get_search_string (_tmp2_);
00597        _tmp4_ = _tmp3_;
00598        _vala_assert (g_strcmp0 (_tmp4_, "qoo") == 0, "lens_search.search_string == \"qoo\"");
00599        _data2_->got_search_changed = TRUE;
00600        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 400, ___lambda8__gsource_func, block3_data_ref (_data3_), block3_data_unref);
00601        block3_data_unref (_data3_);
00602        _data3_ = NULL;
00603 }
00604 
00605 
00606 static void ___lambda7__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
00607        __lambda7_ (self, search);
00608 }
00609 
00610 
00611 static gboolean __lambda9_ (Block2Data* _data2_) {
00612        gboolean result = FALSE;
00613        GMainLoop* _tmp0_;
00614        _tmp0_ = _data2_->ml;
00615        g_main_loop_quit (_tmp0_);
00616        result = FALSE;
00617        return result;
00618 }
00619 
00620 
00621 static gboolean ___lambda9__gsource_func (gpointer self) {
00622        gboolean result;
00623        result = __lambda9_ (self);
00624        return result;
00625 }
00626 
00627 
00628 void main_test_scope_search2 (void) {
00629        Block2Data* _data2_;
00630        UnityScope* _tmp0_;
00631        GMainLoop* _tmp1_;
00632        UnityScope* _tmp2_;
00633        gulong _tmp3_ = 0UL;
00634        gulong sig_id;
00635        GMainLoop* _tmp4_;
00636        gboolean _tmp5_;
00637        UnityScope* _tmp6_;
00638        gulong _tmp7_;
00639        GDBusConnection* _tmp8_ = NULL;
00640        GDBusConnection* bus;
00641        GDBusConnection* _tmp9_;
00642        GError * _inner_error_ = NULL;
00643        _data2_ = g_slice_new0 (Block2Data);
00644        _data2_->_ref_count_ = 1;
00645        _tmp0_ = main_exported_scope;
00646        _vala_assert (_tmp0_ != NULL, "exported_scope != null");
00647        _tmp1_ = g_main_loop_new (NULL, FALSE);
00648        _data2_->ml = _tmp1_;
00649        _data2_->got_search_changed = FALSE;
00650        _tmp2_ = main_exported_scope;
00651        _tmp3_ = g_signal_connect_data (_tmp2_, "search-changed", (GCallback) ___lambda7__unity_scope_search_changed, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
00652        sig_id = _tmp3_;
00653        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 2000, ___lambda9__gsource_func, block2_data_ref (_data2_), block2_data_unref);
00654        _tmp4_ = _data2_->ml;
00655        g_main_loop_run (_tmp4_);
00656        _tmp5_ = _data2_->got_search_changed;
00657        _vala_assert (_tmp5_ == TRUE, "got_search_changed == true");
00658        _tmp6_ = main_exported_scope;
00659        _tmp7_ = sig_id;
00660        g_signal_handler_disconnect (_tmp6_, _tmp7_);
00661        _tmp8_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
00662        bus = _tmp8_;
00663        if (_inner_error_ != NULL) {
00664               block2_data_unref (_data2_);
00665               _data2_ = NULL;
00666               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);
00667               g_clear_error (&_inner_error_);
00668               return;
00669        }
00670        _tmp9_ = bus;
00671        g_dbus_connection_flush_sync (_tmp9_, NULL, &_inner_error_);
00672        if (_inner_error_ != NULL) {
00673               _g_object_unref0 (bus);
00674               block2_data_unref (_data2_);
00675               _data2_ = NULL;
00676               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);
00677               g_clear_error (&_inner_error_);
00678               return;
00679        }
00680        _g_object_unref0 (bus);
00681        block2_data_unref (_data2_);
00682        _data2_ = NULL;
00683 }
00684 
00685 
00686 static Block4Data* block4_data_ref (Block4Data* _data4_) {
00687        g_atomic_int_inc (&_data4_->_ref_count_);
00688        return _data4_;
00689 }
00690 
00691 
00692 static void block4_data_unref (void * _userdata_) {
00693        Block4Data* _data4_;
00694        _data4_ = (Block4Data*) _userdata_;
00695        if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
00696               _g_main_loop_unref0 (_data4_->ml);
00697               g_slice_free (Block4Data, _data4_);
00698        }
00699 }
00700 
00701 
00702 static Block5Data* block5_data_ref (Block5Data* _data5_) {
00703        g_atomic_int_inc (&_data5_->_ref_count_);
00704        return _data5_;
00705 }
00706 
00707 
00708 static void block5_data_unref (void * _userdata_) {
00709        Block5Data* _data5_;
00710        _data5_ = (Block5Data*) _userdata_;
00711        if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
00712               _g_object_unref0 (_data5_->lens_search);
00713               block4_data_unref (_data5_->_data4_);
00714               _data5_->_data4_ = NULL;
00715               g_slice_free (Block5Data, _data5_);
00716        }
00717 }
00718 
00719 
00720 static gboolean __lambda11_ (Block5Data* _data5_) {
00721        Block4Data* _data4_;
00722        gboolean result = FALSE;
00723        UnityLensSearch* _tmp0_;
00724        GMainLoop* _tmp1_;
00725        _data4_ = _data5_->_data4_;
00726        _tmp0_ = _data5_->lens_search;
00727        g_signal_emit_by_name (_tmp0_, "finished");
00728        _tmp1_ = _data4_->ml;
00729        g_main_loop_quit (_tmp1_);
00730        result = FALSE;
00731        return result;
00732 }
00733 
00734 
00735 static gboolean ___lambda11__gsource_func (gpointer self) {
00736        gboolean result;
00737        result = __lambda11_ (self);
00738        return result;
00739 }
00740 
00741 
00742 static void __lambda10_ (Block4Data* _data4_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable) {
00743        Block5Data* _data5_;
00744        UnityLensSearch* _tmp0_;
00745        UnityLensSearch* _tmp1_;
00746        UnityLensSearch* _tmp2_;
00747        const gchar* _tmp3_;
00748        const gchar* _tmp4_;
00749        g_return_if_fail (lens_search != NULL);
00750        g_return_if_fail (cancellable != NULL);
00751        _data5_ = g_slice_new0 (Block5Data);
00752        _data5_->_ref_count_ = 1;
00753        _data5_->_data4_ = block4_data_ref (_data4_);
00754        _tmp0_ = lens_search;
00755        _tmp1_ = _g_object_ref0 (_tmp0_);
00756        _data5_->lens_search = _tmp1_;
00757        _tmp2_ = _data5_->lens_search;
00758        _tmp3_ = unity_lens_search_get_search_string (_tmp2_);
00759        _tmp4_ = _tmp3_;
00760        _vala_assert (g_strcmp0 (_tmp4_, "successive-searches") == 0, "lens_search.search_string == \"successive-searches\"");
00761        _data4_->got_search_changed = TRUE;
00762        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 500, ___lambda11__gsource_func, block5_data_ref (_data5_), block5_data_unref);
00763        block5_data_unref (_data5_);
00764        _data5_ = NULL;
00765 }
00766 
00767 
00768 static void ___lambda10__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
00769        __lambda10_ (self, search, search_type, cancellable);
00770 }
00771 
00772 
00773 static gboolean __lambda12_ (Block4Data* _data4_) {
00774        gboolean result = FALSE;
00775        GMainLoop* _tmp0_;
00776        _tmp0_ = _data4_->ml;
00777        g_main_loop_quit (_tmp0_);
00778        result = FALSE;
00779        return result;
00780 }
00781 
00782 
00783 static gboolean ___lambda12__gsource_func (gpointer self) {
00784        gboolean result;
00785        result = __lambda12_ (self);
00786        return result;
00787 }
00788 
00789 
00790 void main_test_scope_successive_searches (void) {
00791        Block4Data* _data4_;
00792        UnityScope* _tmp0_;
00793        GMainLoop* _tmp1_;
00794        UnityScope* _tmp2_;
00795        gulong _tmp3_ = 0UL;
00796        gulong sig_id;
00797        GMainLoop* _tmp4_;
00798        gboolean _tmp5_;
00799        UnityScope* _tmp6_;
00800        gulong _tmp7_;
00801        GDBusConnection* _tmp8_ = NULL;
00802        GDBusConnection* bus;
00803        GDBusConnection* _tmp9_;
00804        GError * _inner_error_ = NULL;
00805        _data4_ = g_slice_new0 (Block4Data);
00806        _data4_->_ref_count_ = 1;
00807        _tmp0_ = main_exported_scope;
00808        _vala_assert (_tmp0_ != NULL, "exported_scope != null");
00809        _tmp1_ = g_main_loop_new (NULL, FALSE);
00810        _data4_->ml = _tmp1_;
00811        _data4_->got_search_changed = FALSE;
00812        _tmp2_ = main_exported_scope;
00813        _tmp3_ = g_signal_connect_data (_tmp2_, "search-changed", (GCallback) ___lambda10__unity_scope_search_changed, block4_data_ref (_data4_), (GClosureNotify) block4_data_unref, 0);
00814        sig_id = _tmp3_;
00815        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 2000, ___lambda12__gsource_func, block4_data_ref (_data4_), block4_data_unref);
00816        _tmp4_ = _data4_->ml;
00817        g_main_loop_run (_tmp4_);
00818        _tmp5_ = _data4_->got_search_changed;
00819        _vala_assert (_tmp5_ == TRUE, "got_search_changed == true");
00820        _tmp6_ = main_exported_scope;
00821        _tmp7_ = sig_id;
00822        g_signal_handler_disconnect (_tmp6_, _tmp7_);
00823        _tmp8_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
00824        bus = _tmp8_;
00825        if (_inner_error_ != NULL) {
00826               block4_data_unref (_data4_);
00827               _data4_ = NULL;
00828               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);
00829               g_clear_error (&_inner_error_);
00830               return;
00831        }
00832        _tmp9_ = bus;
00833        g_dbus_connection_flush_sync (_tmp9_, NULL, &_inner_error_);
00834        if (_inner_error_ != NULL) {
00835               _g_object_unref0 (bus);
00836               block4_data_unref (_data4_);
00837               _data4_ = NULL;
00838               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);
00839               g_clear_error (&_inner_error_);
00840               return;
00841        }
00842        _g_object_unref0 (bus);
00843        block4_data_unref (_data4_);
00844        _data4_ = NULL;
00845 }
00846 
00847 
00848 static Block6Data* block6_data_ref (Block6Data* _data6_) {
00849        g_atomic_int_inc (&_data6_->_ref_count_);
00850        return _data6_;
00851 }
00852 
00853 
00854 static void block6_data_unref (void * _userdata_) {
00855        Block6Data* _data6_;
00856        _data6_ = (Block6Data*) _userdata_;
00857        if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
00858               _g_object_unref0 (_data6_->canc2);
00859               _g_object_unref0 (_data6_->canc1);
00860               _g_main_loop_unref0 (_data6_->ml);
00861               g_slice_free (Block6Data, _data6_);
00862        }
00863 }
00864 
00865 
00866 static Block7Data* block7_data_ref (Block7Data* _data7_) {
00867        g_atomic_int_inc (&_data7_->_ref_count_);
00868        return _data7_;
00869 }
00870 
00871 
00872 static void block7_data_unref (void * _userdata_) {
00873        Block7Data* _data7_;
00874        _data7_ = (Block7Data*) _userdata_;
00875        if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
00876               _g_object_unref0 (_data7_->lens_search);
00877               block6_data_unref (_data7_->_data6_);
00878               _data7_->_data6_ = NULL;
00879               g_slice_free (Block7Data, _data7_);
00880        }
00881 }
00882 
00883 
00884 static gboolean __lambda14_ (Block7Data* _data7_) {
00885        Block6Data* _data6_;
00886        gboolean result = FALSE;
00887        UnityLensSearch* _tmp0_;
00888        guint _tmp1_;
00889        guint _tmp2_;
00890        _data6_ = _data7_->_data6_;
00891        _tmp0_ = _data7_->lens_search;
00892        g_signal_emit_by_name (_tmp0_, "finished");
00893        _tmp1_ = _data6_->num_searches;
00894        _data6_->num_searches = _tmp1_ + 1;
00895        _tmp2_ = _data6_->num_searches;
00896        if (_tmp2_ == ((guint) 2)) {
00897               GMainLoop* _tmp3_;
00898               _tmp3_ = _data6_->ml;
00899               g_main_loop_quit (_tmp3_);
00900        }
00901        result = FALSE;
00902        return result;
00903 }
00904 
00905 
00906 static gboolean ___lambda14__gsource_func (gpointer self) {
00907        gboolean result;
00908        result = __lambda14_ (self);
00909        return result;
00910 }
00911 
00912 
00913 static void __lambda13_ (Block6Data* _data6_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable) {
00914        Block7Data* _data7_;
00915        UnityLensSearch* _tmp0_;
00916        UnityLensSearch* _tmp1_;
00917        UnityLensSearch* _tmp2_;
00918        const gchar* _tmp3_;
00919        const gchar* _tmp4_;
00920        const gchar* _tmp5_;
00921        GQuark _tmp7_ = 0U;
00922        static GQuark _tmp6_label0 = 0;
00923        static GQuark _tmp6_label1 = 0;
00924        g_return_if_fail (lens_search != NULL);
00925        g_return_if_fail (cancellable != NULL);
00926        _data7_ = g_slice_new0 (Block7Data);
00927        _data7_->_ref_count_ = 1;
00928        _data7_->_data6_ = block6_data_ref (_data6_);
00929        _tmp0_ = lens_search;
00930        _tmp1_ = _g_object_ref0 (_tmp0_);
00931        _data7_->lens_search = _tmp1_;
00932        _tmp2_ = _data7_->lens_search;
00933        _tmp3_ = unity_lens_search_get_search_string (_tmp2_);
00934        _tmp4_ = _tmp3_;
00935        _tmp5_ = _tmp4_;
00936        _tmp7_ = (NULL == _tmp5_) ? 0 : g_quark_from_string (_tmp5_);
00937        if (_tmp7_ == ((0 != _tmp6_label0) ? _tmp6_label0 : (_tmp6_label0 = g_quark_from_static_string ("foo1")))) {
00938               switch (0) {
00939                      default:
00940                      {
00941                             GCancellable* _tmp8_;
00942                             GCancellable* _tmp9_;
00943                             _tmp8_ = cancellable;
00944                             _tmp9_ = _g_object_ref0 (_tmp8_);
00945                             _g_object_unref0 (_data6_->canc1);
00946                             _data6_->canc1 = _tmp9_;
00947                             break;
00948                      }
00949               }
00950        } else if (_tmp7_ == ((0 != _tmp6_label1) ? _tmp6_label1 : (_tmp6_label1 = g_quark_from_static_string ("foo2")))) {
00951               switch (0) {
00952                      default:
00953                      {
00954                             GCancellable* _tmp10_;
00955                             GCancellable* _tmp11_;
00956                             _tmp10_ = cancellable;
00957                             _tmp11_ = _g_object_ref0 (_tmp10_);
00958                             _g_object_unref0 (_data6_->canc2);
00959                             _data6_->canc2 = _tmp11_;
00960                             break;
00961                      }
00962               }
00963        } else {
00964               switch (0) {
00965                      default:
00966                      {
00967                             g_assert_not_reached ();
00968                             break;
00969                      }
00970               }
00971        }
00972        _data6_->got_search_changed = TRUE;
00973        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 500, ___lambda14__gsource_func, block7_data_ref (_data7_), block7_data_unref);
00974        block7_data_unref (_data7_);
00975        _data7_ = NULL;
00976 }
00977 
00978 
00979 static void ___lambda13__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
00980        __lambda13_ (self, search, search_type, cancellable);
00981 }
00982 
00983 
00984 static gboolean __lambda15_ (Block6Data* _data6_) {
00985        gboolean result = FALSE;
00986        GMainLoop* _tmp0_;
00987        _tmp0_ = _data6_->ml;
00988        g_main_loop_quit (_tmp0_);
00989        result = FALSE;
00990        return result;
00991 }
00992 
00993 
00994 static gboolean ___lambda15__gsource_func (gpointer self) {
00995        gboolean result;
00996        result = __lambda15_ (self);
00997        return result;
00998 }
00999 
01000 
01001 void main_test_scope_two_searches (void) {
01002        Block6Data* _data6_;
01003        UnityScope* _tmp0_;
01004        GMainLoop* _tmp1_;
01005        UnityScope* _tmp2_;
01006        gulong _tmp3_ = 0UL;
01007        gulong sig_id;
01008        GMainLoop* _tmp4_;
01009        gboolean _tmp5_;
01010        GCancellable* _tmp6_;
01011        GCancellable* _tmp7_;
01012        GCancellable* _tmp8_;
01013        gboolean _tmp9_ = FALSE;
01014        GCancellable* _tmp10_;
01015        gboolean _tmp11_ = FALSE;
01016        UnityScope* _tmp12_;
01017        gulong _tmp13_;
01018        GDBusConnection* _tmp14_ = NULL;
01019        GDBusConnection* bus;
01020        GDBusConnection* _tmp15_;
01021        GError * _inner_error_ = NULL;
01022        _data6_ = g_slice_new0 (Block6Data);
01023        _data6_->_ref_count_ = 1;
01024        _tmp0_ = main_exported_scope;
01025        _vala_assert (_tmp0_ != NULL, "exported_scope != null");
01026        _tmp1_ = g_main_loop_new (NULL, FALSE);
01027        _data6_->ml = _tmp1_;
01028        _data6_->got_search_changed = FALSE;
01029        _data6_->canc1 = NULL;
01030        _data6_->canc2 = NULL;
01031        _data6_->num_searches = (guint) 0;
01032        _tmp2_ = main_exported_scope;
01033        _tmp3_ = g_signal_connect_data (_tmp2_, "search-changed", (GCallback) ___lambda13__unity_scope_search_changed, block6_data_ref (_data6_), (GClosureNotify) block6_data_unref, 0);
01034        sig_id = _tmp3_;
01035        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 2000, ___lambda15__gsource_func, block6_data_ref (_data6_), block6_data_unref);
01036        _tmp4_ = _data6_->ml;
01037        g_main_loop_run (_tmp4_);
01038        _tmp5_ = _data6_->got_search_changed;
01039        _vala_assert (_tmp5_ == TRUE, "got_search_changed == true");
01040        _tmp6_ = _data6_->canc1;
01041        _vala_assert (_tmp6_ != NULL, "canc1 != null");
01042        _tmp7_ = _data6_->canc2;
01043        _vala_assert (_tmp7_ != NULL, "canc2 != null");
01044        _tmp8_ = _data6_->canc1;
01045        _tmp9_ = g_cancellable_is_cancelled (_tmp8_);
01046        _vala_assert (_tmp9_ == TRUE, "canc1.is_cancelled () == true");
01047        _tmp10_ = _data6_->canc2;
01048        _tmp11_ = g_cancellable_is_cancelled (_tmp10_);
01049        _vala_assert (_tmp11_ == FALSE, "canc2.is_cancelled () == false");
01050        _tmp12_ = main_exported_scope;
01051        _tmp13_ = sig_id;
01052        g_signal_handler_disconnect (_tmp12_, _tmp13_);
01053        _tmp14_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
01054        bus = _tmp14_;
01055        if (_inner_error_ != NULL) {
01056               block6_data_unref (_data6_);
01057               _data6_ = NULL;
01058               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);
01059               g_clear_error (&_inner_error_);
01060               return;
01061        }
01062        _tmp15_ = bus;
01063        g_dbus_connection_flush_sync (_tmp15_, NULL, &_inner_error_);
01064        if (_inner_error_ != NULL) {
01065               _g_object_unref0 (bus);
01066               block6_data_unref (_data6_);
01067               _data6_ = NULL;
01068               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);
01069               g_clear_error (&_inner_error_);
01070               return;
01071        }
01072        _g_object_unref0 (bus);
01073        block6_data_unref (_data6_);
01074        _data6_ = NULL;
01075 }
01076 
01077 
01078 static Block8Data* block8_data_ref (Block8Data* _data8_) {
01079        g_atomic_int_inc (&_data8_->_ref_count_);
01080        return _data8_;
01081 }
01082 
01083 
01084 static void block8_data_unref (void * _userdata_) {
01085        Block8Data* _data8_;
01086        _data8_ = (Block8Data*) _userdata_;
01087        if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) {
01088               _g_main_loop_unref0 (_data8_->ml);
01089               g_slice_free (Block8Data, _data8_);
01090        }
01091 }
01092 
01093 
01094 static Block9Data* block9_data_ref (Block9Data* _data9_) {
01095        g_atomic_int_inc (&_data9_->_ref_count_);
01096        return _data9_;
01097 }
01098 
01099 
01100 static void block9_data_unref (void * _userdata_) {
01101        Block9Data* _data9_;
01102        _data9_ = (Block9Data*) _userdata_;
01103        if (g_atomic_int_dec_and_test (&_data9_->_ref_count_)) {
01104               _g_object_unref0 (_data9_->lens_search);
01105               block8_data_unref (_data9_->_data8_);
01106               _data9_->_data8_ = NULL;
01107               g_slice_free (Block9Data, _data9_);
01108        }
01109 }
01110 
01111 
01112 static gboolean __lambda17_ (Block9Data* _data9_) {
01113        Block8Data* _data8_;
01114        gboolean result = FALSE;
01115        UnityLensSearch* _tmp0_;
01116        DeeSerializableModel* _tmp1_;
01117        DeeSerializableModel* _tmp2_;
01118        DeeSerializableModel* _tmp3_;
01119        DeeSerializableModel* model;
01120        UnityLensSearch* _tmp4_;
01121        GMainLoop* _tmp5_;
01122        _data8_ = _data9_->_data8_;
01123        _tmp0_ = _data9_->lens_search;
01124        _tmp1_ = unity_lens_search_get_results_model (_tmp0_);
01125        _tmp2_ = _tmp1_;
01126        _tmp3_ = _g_object_ref0 (_tmp2_);
01127        model = _tmp3_;
01128        dee_model_append ((DeeModel*) model, "uri", "icon", 0, "mimetype", "display-name", "comment", "dnd-uri", NULL);
01129        _tmp4_ = _data9_->lens_search;
01130        g_signal_emit_by_name (_tmp4_, "finished");
01131        _tmp5_ = _data8_->ml;
01132        g_main_loop_quit (_tmp5_);
01133        result = FALSE;
01134        _g_object_unref0 (model);
01135        return result;
01136 }
01137 
01138 
01139 static gboolean ___lambda17__gsource_func (gpointer self) {
01140        gboolean result;
01141        result = __lambda17_ (self);
01142        return result;
01143 }
01144 
01145 
01146 static void __lambda16_ (Block8Data* _data8_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable) {
01147        Block9Data* _data9_;
01148        UnityLensSearch* _tmp0_;
01149        UnityLensSearch* _tmp1_;
01150        UnityLensSearch* _tmp2_;
01151        const gchar* _tmp3_;
01152        const gchar* _tmp4_;
01153        g_return_if_fail (lens_search != NULL);
01154        g_return_if_fail (cancellable != NULL);
01155        _data9_ = g_slice_new0 (Block9Data);
01156        _data9_->_ref_count_ = 1;
01157        _data9_->_data8_ = block8_data_ref (_data8_);
01158        _tmp0_ = lens_search;
01159        _tmp1_ = _g_object_ref0 (_tmp0_);
01160        _data9_->lens_search = _tmp1_;
01161        _tmp2_ = _data9_->lens_search;
01162        _tmp3_ = unity_lens_search_get_search_string (_tmp2_);
01163        _tmp4_ = _tmp3_;
01164        _vala_assert (g_strcmp0 (_tmp4_, "model-sync") == 0, "lens_search.search_string == \"model-sync\"");
01165        _data8_->got_search_changed = TRUE;
01166        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 500, ___lambda17__gsource_func, block9_data_ref (_data9_), block9_data_unref);
01167        block9_data_unref (_data9_);
01168        _data9_ = NULL;
01169 }
01170 
01171 
01172 static void ___lambda16__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
01173        __lambda16_ (self, search, search_type, cancellable);
01174 }
01175 
01176 
01177 static gboolean __lambda18_ (void) {
01178        gboolean result = FALSE;
01179        g_assert_not_reached ();
01180        return result;
01181 }
01182 
01183 
01184 static gboolean ___lambda18__gsource_func (gpointer self) {
01185        gboolean result;
01186        result = __lambda18_ ();
01187        return result;
01188 }
01189 
01190 
01191 void main_test_scope_model_sync (void) {
01192        Block8Data* _data8_;
01193        UnityScope* _tmp0_;
01194        GMainLoop* _tmp1_;
01195        UnityScope* _tmp2_;
01196        gulong _tmp3_ = 0UL;
01197        gulong sig_id;
01198        GMainLoop* _tmp4_;
01199        gboolean _tmp5_;
01200        UnityScope* _tmp6_;
01201        gulong _tmp7_;
01202        GDBusConnection* _tmp8_ = NULL;
01203        GDBusConnection* bus;
01204        GDBusConnection* _tmp9_;
01205        GError * _inner_error_ = NULL;
01206        _data8_ = g_slice_new0 (Block8Data);
01207        _data8_->_ref_count_ = 1;
01208        _tmp0_ = main_exported_scope;
01209        _vala_assert (_tmp0_ != NULL, "exported_scope != null");
01210        _tmp1_ = g_main_loop_new (NULL, FALSE);
01211        _data8_->ml = _tmp1_;
01212        _data8_->got_search_changed = FALSE;
01213        _tmp2_ = main_exported_scope;
01214        _tmp3_ = g_signal_connect_data (_tmp2_, "search-changed", (GCallback) ___lambda16__unity_scope_search_changed, block8_data_ref (_data8_), (GClosureNotify) block8_data_unref, 0);
01215        sig_id = _tmp3_;
01216        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 2000, ___lambda18__gsource_func, NULL, NULL);
01217        _tmp4_ = _data8_->ml;
01218        g_main_loop_run (_tmp4_);
01219        _tmp5_ = _data8_->got_search_changed;
01220        _vala_assert (_tmp5_ == TRUE, "got_search_changed == true");
01221        _tmp6_ = main_exported_scope;
01222        _tmp7_ = sig_id;
01223        g_signal_handler_disconnect (_tmp6_, _tmp7_);
01224        _tmp8_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
01225        bus = _tmp8_;
01226        if (_inner_error_ != NULL) {
01227               block8_data_unref (_data8_);
01228               _data8_ = NULL;
01229               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);
01230               g_clear_error (&_inner_error_);
01231               return;
01232        }
01233        _tmp9_ = bus;
01234        g_dbus_connection_flush_sync (_tmp9_, NULL, &_inner_error_);
01235        if (_inner_error_ != NULL) {
01236               _g_object_unref0 (bus);
01237               block8_data_unref (_data8_);
01238               _data8_ = NULL;
01239               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);
01240               g_clear_error (&_inner_error_);
01241               return;
01242        }
01243        _g_object_unref0 (bus);
01244        block8_data_unref (_data8_);
01245        _data8_ = NULL;
01246 }
01247 
01248 
01249 static Block10Data* block10_data_ref (Block10Data* _data10_) {
01250        g_atomic_int_inc (&_data10_->_ref_count_);
01251        return _data10_;
01252 }
01253 
01254 
01255 static void block10_data_unref (void * _userdata_) {
01256        Block10Data* _data10_;
01257        _data10_ = (Block10Data*) _userdata_;
01258        if (g_atomic_int_dec_and_test (&_data10_->_ref_count_)) {
01259               _g_main_loop_unref0 (_data10_->ml);
01260               g_slice_free (Block10Data, _data10_);
01261        }
01262 }
01263 
01264 
01265 static Block11Data* block11_data_ref (Block11Data* _data11_) {
01266        g_atomic_int_inc (&_data11_->_ref_count_);
01267        return _data11_;
01268 }
01269 
01270 
01271 static void block11_data_unref (void * _userdata_) {
01272        Block11Data* _data11_;
01273        _data11_ = (Block11Data*) _userdata_;
01274        if (g_atomic_int_dec_and_test (&_data11_->_ref_count_)) {
01275               _g_object_unref0 (_data11_->lens_search);
01276               block10_data_unref (_data11_->_data10_);
01277               _data11_->_data10_ = NULL;
01278               g_slice_free (Block11Data, _data11_);
01279        }
01280 }
01281 
01282 
01283 static gboolean __lambda20_ (Block11Data* _data11_) {
01284        Block10Data* _data10_;
01285        gboolean result = FALSE;
01286        UnityLensSearch* _tmp0_;
01287        DeeSerializableModel* _tmp1_;
01288        DeeSerializableModel* _tmp2_;
01289        DeeSerializableModel* _tmp3_;
01290        DeeSerializableModel* model;
01291        UnityLensSearch* _tmp4_;
01292        GVariant* _tmp5_;
01293        GVariant* _tmp6_;
01294        UnityLensSearch* _tmp7_;
01295        GMainLoop* _tmp8_;
01296        _data10_ = _data11_->_data10_;
01297        _tmp0_ = _data11_->lens_search;
01298        _tmp1_ = unity_lens_search_get_results_model (_tmp0_);
01299        _tmp2_ = _tmp1_;
01300        _tmp3_ = _g_object_ref0 (_tmp2_);
01301        model = _tmp3_;
01302        dee_model_append ((DeeModel*) model, "uri", "icon", 0, "mimetype", "display-name", "comment", "dnd-uri", NULL);
01303        _tmp4_ = _data11_->lens_search;
01304        _tmp5_ = g_variant_new_string ("value");
01305        g_variant_ref_sink (_tmp5_);
01306        _tmp6_ = _tmp5_;
01307        unity_lens_search_set_reply_hint (_tmp4_, "test-reply-hint", _tmp6_);
01308        _g_variant_unref0 (_tmp6_);
01309        _tmp7_ = _data11_->lens_search;
01310        g_signal_emit_by_name (_tmp7_, "finished");
01311        _tmp8_ = _data10_->ml;
01312        g_main_loop_quit (_tmp8_);
01313        result = FALSE;
01314        _g_object_unref0 (model);
01315        return result;
01316 }
01317 
01318 
01319 static gboolean ___lambda20__gsource_func (gpointer self) {
01320        gboolean result;
01321        result = __lambda20_ (self);
01322        return result;
01323 }
01324 
01325 
01326 static void __lambda19_ (Block10Data* _data10_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable) {
01327        Block11Data* _data11_;
01328        UnityLensSearch* _tmp0_;
01329        UnityLensSearch* _tmp1_;
01330        UnityLensSearch* _tmp2_;
01331        const gchar* _tmp3_;
01332        const gchar* _tmp4_;
01333        g_return_if_fail (lens_search != NULL);
01334        g_return_if_fail (cancellable != NULL);
01335        _data11_ = g_slice_new0 (Block11Data);
01336        _data11_->_ref_count_ = 1;
01337        _data11_->_data10_ = block10_data_ref (_data10_);
01338        _tmp0_ = lens_search;
01339        _tmp1_ = _g_object_ref0 (_tmp0_);
01340        _data11_->lens_search = _tmp1_;
01341        _tmp2_ = _data11_->lens_search;
01342        _tmp3_ = unity_lens_search_get_search_string (_tmp2_);
01343        _tmp4_ = _tmp3_;
01344        _vala_assert (g_strcmp0 (_tmp4_, "reply-hint") == 0, "lens_search.search_string == \"reply-hint\"");
01345        _data10_->got_search_changed = TRUE;
01346        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 100, ___lambda20__gsource_func, block11_data_ref (_data11_), block11_data_unref);
01347        block11_data_unref (_data11_);
01348        _data11_ = NULL;
01349 }
01350 
01351 
01352 static void ___lambda19__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
01353        __lambda19_ (self, search, search_type, cancellable);
01354 }
01355 
01356 
01357 static gboolean __lambda21_ (void) {
01358        gboolean result = FALSE;
01359        g_assert_not_reached ();
01360        return result;
01361 }
01362 
01363 
01364 static gboolean ___lambda21__gsource_func (gpointer self) {
01365        gboolean result;
01366        result = __lambda21_ ();
01367        return result;
01368 }
01369 
01370 
01371 void main_test_scope_reply_hint (void) {
01372        Block10Data* _data10_;
01373        UnityScope* _tmp0_;
01374        GMainLoop* _tmp1_;
01375        UnityScope* _tmp2_;
01376        gulong _tmp3_ = 0UL;
01377        gulong sig_id;
01378        GMainLoop* _tmp4_;
01379        gboolean _tmp5_;
01380        UnityScope* _tmp6_;
01381        gulong _tmp7_;
01382        GDBusConnection* _tmp8_ = NULL;
01383        GDBusConnection* bus;
01384        GDBusConnection* _tmp9_;
01385        GError * _inner_error_ = NULL;
01386        _data10_ = g_slice_new0 (Block10Data);
01387        _data10_->_ref_count_ = 1;
01388        _tmp0_ = main_exported_scope;
01389        _vala_assert (_tmp0_ != NULL, "exported_scope != null");
01390        _tmp1_ = g_main_loop_new (NULL, FALSE);
01391        _data10_->ml = _tmp1_;
01392        _data10_->got_search_changed = FALSE;
01393        _tmp2_ = main_exported_scope;
01394        _tmp3_ = g_signal_connect_data (_tmp2_, "search-changed", (GCallback) ___lambda19__unity_scope_search_changed, block10_data_ref (_data10_), (GClosureNotify) block10_data_unref, 0);
01395        sig_id = _tmp3_;
01396        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 2000, ___lambda21__gsource_func, NULL, NULL);
01397        _tmp4_ = _data10_->ml;
01398        g_main_loop_run (_tmp4_);
01399        _tmp5_ = _data10_->got_search_changed;
01400        _vala_assert (_tmp5_ == TRUE, "got_search_changed == true");
01401        _tmp6_ = main_exported_scope;
01402        _tmp7_ = sig_id;
01403        g_signal_handler_disconnect (_tmp6_, _tmp7_);
01404        _tmp8_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
01405        bus = _tmp8_;
01406        if (_inner_error_ != NULL) {
01407               block10_data_unref (_data10_);
01408               _data10_ = NULL;
01409               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);
01410               g_clear_error (&_inner_error_);
01411               return;
01412        }
01413        _tmp9_ = bus;
01414        g_dbus_connection_flush_sync (_tmp9_, NULL, &_inner_error_);
01415        if (_inner_error_ != NULL) {
01416               _g_object_unref0 (bus);
01417               block10_data_unref (_data10_);
01418               _data10_ = NULL;
01419               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);
01420               g_clear_error (&_inner_error_);
01421               return;
01422        }
01423        _g_object_unref0 (bus);
01424        block10_data_unref (_data10_);
01425        _data10_ = NULL;
01426 }
01427 
01428 
01429 static Block12Data* block12_data_ref (Block12Data* _data12_) {
01430        g_atomic_int_inc (&_data12_->_ref_count_);
01431        return _data12_;
01432 }
01433 
01434 
01435 static void block12_data_unref (void * _userdata_) {
01436        Block12Data* _data12_;
01437        _data12_ = (Block12Data*) _userdata_;
01438        if (g_atomic_int_dec_and_test (&_data12_->_ref_count_)) {
01439               _g_main_loop_unref0 (_data12_->ml);
01440               g_slice_free (Block12Data, _data12_);
01441        }
01442 }
01443 
01444 
01445 static Block13Data* block13_data_ref (Block13Data* _data13_) {
01446        g_atomic_int_inc (&_data13_->_ref_count_);
01447        return _data13_;
01448 }
01449 
01450 
01451 static void block13_data_unref (void * _userdata_) {
01452        Block13Data* _data13_;
01453        _data13_ = (Block13Data*) _userdata_;
01454        if (g_atomic_int_dec_and_test (&_data13_->_ref_count_)) {
01455               _g_object_unref0 (_data13_->lens_search);
01456               block12_data_unref (_data13_->_data12_);
01457               _data13_->_data12_ = NULL;
01458               g_slice_free (Block13Data, _data13_);
01459        }
01460 }
01461 
01462 
01463 static gboolean __lambda23_ (Block13Data* _data13_) {
01464        Block12Data* _data12_;
01465        gboolean result = FALSE;
01466        UnityLensSearch* _tmp0_;
01467        GMainLoop* _tmp1_;
01468        _data12_ = _data13_->_data12_;
01469        _tmp0_ = _data13_->lens_search;
01470        g_signal_emit_by_name (_tmp0_, "finished");
01471        _tmp1_ = _data12_->ml;
01472        g_main_loop_quit (_tmp1_);
01473        result = FALSE;
01474        return result;
01475 }
01476 
01477 
01478 static gboolean ___lambda23__gsource_func (gpointer self) {
01479        gboolean result;
01480        result = __lambda23_ (self);
01481        return result;
01482 }
01483 
01484 
01485 static void __lambda22_ (Block12Data* _data12_, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable) {
01486        Block13Data* _data13_;
01487        UnityLensSearch* _tmp0_;
01488        UnityLensSearch* _tmp1_;
01489        UnityLensSearch* _tmp2_;
01490        const gchar* _tmp3_;
01491        const gchar* _tmp4_;
01492        gboolean _tmp5_ = FALSE;
01493        gboolean _tmp6_;
01494        g_return_if_fail (lens_search != NULL);
01495        g_return_if_fail (cancellable != NULL);
01496        _data13_ = g_slice_new0 (Block13Data);
01497        _data13_->_ref_count_ = 1;
01498        _data13_->_data12_ = block12_data_ref (_data12_);
01499        _tmp0_ = lens_search;
01500        _tmp1_ = _g_object_ref0 (_tmp0_);
01501        _data13_->lens_search = _tmp1_;
01502        _tmp2_ = _data13_->lens_search;
01503        _tmp3_ = unity_lens_search_get_search_string (_tmp2_);
01504        _tmp4_ = _tmp3_;
01505        _tmp5_ = g_str_has_prefix (_tmp4_, "sources-test");
01506        _vala_assert (_tmp5_, "lens_search.search_string.has_prefix (\"sources-test\")");
01507        _tmp6_ = _data12_->remove_option;
01508        if (_tmp6_) {
01509               UnityScope* _tmp7_;
01510               UnityOptionsFilter* _tmp8_;
01511               UnityOptionsFilter* _tmp9_;
01512               _tmp7_ = main_exported_scope;
01513               _tmp8_ = unity_scope_get_sources (_tmp7_);
01514               _tmp9_ = _tmp8_;
01515               unity_options_filter_remove_option (_tmp9_, "id1-remote");
01516        }
01517        g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda23__gsource_func, block13_data_ref (_data13_), block13_data_unref);
01518        block13_data_unref (_data13_);
01519        _data13_ = NULL;
01520 }
01521 
01522 
01523 static void ___lambda22__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
01524        __lambda22_ (self, search, search_type, cancellable);
01525 }
01526 
01527 
01528 static gboolean __lambda24_ (void) {
01529        gboolean result = FALSE;
01530        g_assert_not_reached ();
01531        return result;
01532 }
01533 
01534 
01535 static gboolean ___lambda24__gsource_func (gpointer self) {
01536        gboolean result;
01537        result = __lambda24_ ();
01538        return result;
01539 }
01540 
01541 
01542 static gboolean __lambda25_ (void) {
01543        gboolean result = FALSE;
01544        g_assert_not_reached ();
01545        return result;
01546 }
01547 
01548 
01549 static gboolean ___lambda25__gsource_func (gpointer self) {
01550        gboolean result;
01551        result = __lambda25_ ();
01552        return result;
01553 }
01554 
01555 
01556 void main_test_scope_sources (void) {
01557        Block12Data* _data12_;
01558        UnityScope* _tmp0_;
01559        GMainLoop* _tmp1_;
01560        UnityScope* _tmp2_;
01561        UnityOptionsFilter* _tmp3_;
01562        UnityOptionsFilter* _tmp4_;
01563        UnityFilterOption* _tmp5_ = NULL;
01564        UnityFilterOption* _tmp6_;
01565        UnityScope* _tmp7_;
01566        UnityOptionsFilter* _tmp8_;
01567        UnityOptionsFilter* _tmp9_;
01568        UnityFilterOption* _tmp10_ = NULL;
01569        UnityFilterOption* _tmp11_;
01570        UnityScope* _tmp12_;
01571        gulong _tmp13_ = 0UL;
01572        gulong sig_id;
01573        GMainLoop* _tmp14_;
01574        GMainLoop* _tmp15_;
01575        GMainLoop* _tmp16_;
01576        UnityScope* _tmp17_;
01577        gulong _tmp18_;
01578        GDBusConnection* _tmp19_ = NULL;
01579        GDBusConnection* bus;
01580        GDBusConnection* _tmp20_;
01581        GError * _inner_error_ = NULL;
01582        _data12_ = g_slice_new0 (Block12Data);
01583        _data12_->_ref_count_ = 1;
01584        _tmp0_ = main_exported_scope;
01585        _vala_assert (_tmp0_ != NULL, "exported_scope != null");
01586        _tmp1_ = g_main_loop_new (NULL, FALSE);
01587        _data12_->ml = _tmp1_;
01588        _tmp2_ = main_exported_scope;
01589        _tmp3_ = unity_scope_get_sources (_tmp2_);
01590        _tmp4_ = _tmp3_;
01591        _tmp5_ = unity_options_filter_add_option (_tmp4_, "id1-remote", "Remote 1", NULL);
01592        _tmp6_ = _tmp5_;
01593        _g_object_unref0 (_tmp6_);
01594        _tmp7_ = main_exported_scope;
01595        _tmp8_ = unity_scope_get_sources (_tmp7_);
01596        _tmp9_ = _tmp8_;
01597        _tmp10_ = unity_options_filter_add_option (_tmp9_, "id2-remote", "Remote 2", NULL);
01598        _tmp11_ = _tmp10_;
01599        _g_object_unref0 (_tmp11_);
01600        _data12_->remove_option = FALSE;
01601        _tmp12_ = main_exported_scope;
01602        _tmp13_ = g_signal_connect_data (_tmp12_, "search-changed", (GCallback) ___lambda22__unity_scope_search_changed, block12_data_ref (_data12_), (GClosureNotify) block12_data_unref, 0);
01603        sig_id = _tmp13_;
01604        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 2000, ___lambda24__gsource_func, NULL, NULL);
01605        _tmp14_ = _data12_->ml;
01606        g_main_loop_run (_tmp14_);
01607        _data12_->remove_option = TRUE;
01608        _tmp15_ = g_main_loop_new (NULL, FALSE);
01609        _g_main_loop_unref0 (_data12_->ml);
01610        _data12_->ml = _tmp15_;
01611        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 2000, ___lambda25__gsource_func, NULL, NULL);
01612        _tmp16_ = _data12_->ml;
01613        g_main_loop_run (_tmp16_);
01614        _tmp17_ = main_exported_scope;
01615        _tmp18_ = sig_id;
01616        g_signal_handler_disconnect (_tmp17_, _tmp18_);
01617        _tmp19_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
01618        bus = _tmp19_;
01619        if (_inner_error_ != NULL) {
01620               block12_data_unref (_data12_);
01621               _data12_ = NULL;
01622               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);
01623               g_clear_error (&_inner_error_);
01624               return;
01625        }
01626        _tmp20_ = bus;
01627        g_dbus_connection_flush_sync (_tmp20_, NULL, &_inner_error_);
01628        if (_inner_error_ != NULL) {
01629               _g_object_unref0 (bus);
01630               block12_data_unref (_data12_);
01631               _data12_ = NULL;
01632               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);
01633               g_clear_error (&_inner_error_);
01634               return;
01635        }
01636        _g_object_unref0 (bus);
01637        block12_data_unref (_data12_);
01638        _data12_ = NULL;
01639 }
01640 
01641 
01642 static Block14Data* block14_data_ref (Block14Data* _data14_) {
01643        g_atomic_int_inc (&_data14_->_ref_count_);
01644        return _data14_;
01645 }
01646 
01647 
01648 static void block14_data_unref (void * _userdata_) {
01649        Block14Data* _data14_;
01650        _data14_ = (Block14Data*) _userdata_;
01651        if (g_atomic_int_dec_and_test (&_data14_->_ref_count_)) {
01652               _g_main_loop_unref0 (_data14_->ml);
01653               g_slice_free (Block14Data, _data14_);
01654        }
01655 }
01656 
01657 
01658 static void __lambda26_ (void) {
01659 }
01660 
01661 
01662 static void ___lambda26__gbus_name_appeared_callback (GDBusConnection* connection, const gchar* name, const gchar* name_owner, gpointer self) {
01663        __lambda26_ ();
01664 }
01665 
01666 
01667 static void __lambda27_ (Block14Data* _data14_) {
01668        g_main_loop_quit (_data14_->ml);
01669 }
01670 
01671 
01672 static void ___lambda27__gbus_name_vanished_callback (GDBusConnection* connection, const gchar* name, gpointer self) {
01673        __lambda27_ (self);
01674 }
01675 
01676 
01677 void main_test_scope_finalize (void) {
01678        Block14Data* _data14_;
01679        GMainLoop* _tmp0_;
01680        guint _tmp1_ = 0U;
01681        guint watch_id;
01682        _data14_ = g_slice_new0 (Block14Data);
01683        _data14_->_ref_count_ = 1;
01684        _tmp0_ = g_main_loop_new (NULL, FALSE);
01685        _data14_->ml = _tmp0_;
01686        _tmp1_ = g_bus_watch_name_with_closures (G_BUS_TYPE_SESSION, "com.canonical.Unity.Lens.Test", 0, (GClosure*) ((___lambda26__gbus_name_appeared_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda26__gbus_name_appeared_callback, NULL, NULL)), (GClosure*) ((___lambda27__gbus_name_vanished_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda27__gbus_name_vanished_callback, block14_data_ref (_data14_), block14_data_unref)));
01687        watch_id = _tmp1_;
01688        g_main_loop_run (_data14_->ml);
01689        g_bus_unwatch_name (watch_id);
01690        block14_data_unref (_data14_);
01691        _data14_ = NULL;
01692 }
01693 
01694 
01695 Main* main_construct (GType object_type) {
01696        Main* self = NULL;
01697        self = (Main*) g_type_create_instance (object_type);
01698        return self;
01699 }
01700 
01701 
01702 Main* main_new (void) {
01703        return main_construct (TYPE_MAIN);
01704 }
01705 
01706 
01707 static void value_main_init (GValue* value) {
01708        value->data[0].v_pointer = NULL;
01709 }
01710 
01711 
01712 static void value_main_free_value (GValue* value) {
01713        if (value->data[0].v_pointer) {
01714               main_unref (value->data[0].v_pointer);
01715        }
01716 }
01717 
01718 
01719 static void value_main_copy_value (const GValue* src_value, GValue* dest_value) {
01720        if (src_value->data[0].v_pointer) {
01721               dest_value->data[0].v_pointer = main_ref (src_value->data[0].v_pointer);
01722        } else {
01723               dest_value->data[0].v_pointer = NULL;
01724        }
01725 }
01726 
01727 
01728 static gpointer value_main_peek_pointer (const GValue* value) {
01729        return value->data[0].v_pointer;
01730 }
01731 
01732 
01733 static gchar* value_main_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
01734        if (collect_values[0].v_pointer) {
01735               Main* object;
01736               object = collect_values[0].v_pointer;
01737               if (object->parent_instance.g_class == NULL) {
01738                      return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
01739               } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
01740                      return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
01741               }
01742               value->data[0].v_pointer = main_ref (object);
01743        } else {
01744               value->data[0].v_pointer = NULL;
01745        }
01746        return NULL;
01747 }
01748 
01749 
01750 static gchar* value_main_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
01751        Main** object_p;
01752        object_p = collect_values[0].v_pointer;
01753        if (!object_p) {
01754               return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
01755        }
01756        if (!value->data[0].v_pointer) {
01757               *object_p = NULL;
01758        } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
01759               *object_p = value->data[0].v_pointer;
01760        } else {
01761               *object_p = main_ref (value->data[0].v_pointer);
01762        }
01763        return NULL;
01764 }
01765 
01766 
01767 GParamSpec* param_spec_main (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
01768        ParamSpecMain* spec;
01769        g_return_val_if_fail (g_type_is_a (object_type, TYPE_MAIN), NULL);
01770        spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
01771        G_PARAM_SPEC (spec)->value_type = object_type;
01772        return G_PARAM_SPEC (spec);
01773 }
01774 
01775 
01776 gpointer value_get_main (const GValue* value) {
01777        g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MAIN), NULL);
01778        return value->data[0].v_pointer;
01779 }
01780 
01781 
01782 void value_set_main (GValue* value, gpointer v_object) {
01783        Main* old;
01784        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MAIN));
01785        old = value->data[0].v_pointer;
01786        if (v_object) {
01787               g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_MAIN));
01788               g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
01789               value->data[0].v_pointer = v_object;
01790               main_ref (value->data[0].v_pointer);
01791        } else {
01792               value->data[0].v_pointer = NULL;
01793        }
01794        if (old) {
01795               main_unref (old);
01796        }
01797 }
01798 
01799 
01800 void value_take_main (GValue* value, gpointer v_object) {
01801        Main* old;
01802        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MAIN));
01803        old = value->data[0].v_pointer;
01804        if (v_object) {
01805               g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_MAIN));
01806               g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
01807               value->data[0].v_pointer = v_object;
01808        } else {
01809               value->data[0].v_pointer = NULL;
01810        }
01811        if (old) {
01812               main_unref (old);
01813        }
01814 }
01815 
01816 
01817 static void main_class_init (MainClass * klass) {
01818        main_parent_class = g_type_class_peek_parent (klass);
01819        MAIN_CLASS (klass)->finalize = main_finalize;
01820 }
01821 
01822 
01823 static void main_instance_init (Main * self) {
01824        self->ref_count = 1;
01825 }
01826 
01827 
01828 static void main_finalize (Main* obj) {
01829        Main * self;
01830        self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MAIN, Main);
01831 }
01832 
01833 
01834 GType main_get_type (void) {
01835        static volatile gsize main_type_id__volatile = 0;
01836        if (g_once_init_enter (&main_type_id__volatile)) {
01837               static const GTypeValueTable g_define_type_value_table = { value_main_init, value_main_free_value, value_main_copy_value, value_main_peek_pointer, "p", value_main_collect_value, "p", value_main_lcopy_value };
01838               static const GTypeInfo g_define_type_info = { sizeof (MainClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) main_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Main), 0, (GInstanceInitFunc) main_instance_init, &g_define_type_value_table };
01839               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) };
01840               GType main_type_id;
01841               main_type_id = g_type_register_fundamental (g_type_fundamental_next (), "Main", &g_define_type_info, &g_define_type_fundamental_info, 0);
01842               g_once_init_leave (&main_type_id__volatile, main_type_id);
01843        }
01844        return main_type_id__volatile;
01845 }
01846 
01847 
01848 gpointer main_ref (gpointer instance) {
01849        Main* self;
01850        self = instance;
01851        g_atomic_int_inc (&self->ref_count);
01852        return instance;
01853 }
01854 
01855 
01856 void main_unref (gpointer instance) {
01857        Main* self;
01858        self = instance;
01859        if (g_atomic_int_dec_and_test (&self->ref_count)) {
01860               MAIN_GET_CLASS (self)->finalize (self);
01861               g_type_free_instance ((GTypeInstance *) self);
01862        }
01863 }
01864 
01865 
01866