~leprechaun-team/+junk/unity-use-patches

« back to all changes in this revision

Viewing changes to unity/webapp-fetcher.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-09-09 19:13:29 UTC
  • mfrom: (1.1.15 upstream)
  • Revision ID: james.westby@ubuntu.com-20100909191329-j3odkmn02roj91b1
Tags: 0.2.36-0ubuntu1
* New upstream release:
  - Fix width of home-button on panel, so groove aligns with right edge of
    launcher, fixes (LP: #630031)
  - migration script to transition first time new people to unity
    (LP: #622146)
  - Quicklist name disappearing (LP: #627666)
* debian/unity.install:
  - install libexec in unity package (for migration tool)
* debian/libunity0.symbols:
  - update symbol

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* webapp-fetcher.c generated by valac 0.9.7, the Vala compiler
 
1
/* webapp-fetcher.c generated by valac, the Vala compiler
2
2
 * generated from webapp-fetcher.vala, do not modify */
3
3
 
4
4
/*
95
95
        GSimpleAsyncResult* _async_result;
96
96
        UnityWebappFetchFile* self;
97
97
        GFileInputStream* _tmp0_;
 
98
        GDataInputStream* _tmp2_;
98
99
        GFileInputStream* _tmp1_;
99
 
        GDataInputStream* _tmp2_;
100
100
        GError * e;
101
101
        GError * _inner_error_;
102
102
};
108
108
        UnityWebappFetchFile* self;
109
109
        gssize size;
110
110
        guint8* buffer;
 
111
        guint8* _tmp0_;
 
112
        gint _buffer_size_;
111
113
        gint buffer_length1;
112
 
        gint _buffer_size_;
113
 
        guint8* _tmp0_;
114
114
        gssize bufsize;
115
115
        gboolean _tmp1_;
116
116
        gssize _tmp2_;
117
117
        guint8* cpybuf;
 
118
        guint8* _tmp3_;
 
119
        gint _cpybuf_size_;
118
120
        gint cpybuf_length1;
119
 
        gint _cpybuf_size_;
120
 
        guint8* _tmp3_;
121
121
        GError * e;
122
122
        GError * _inner_error_;
123
123
};
214
214
UnityWebappFetchFile* unity_webapp_fetch_file_construct (GType object_type, const char* uri);
215
215
static void unity_webapp_fetch_file_fetch_data_data_free (gpointer _data);
216
216
static void unity_webapp_fetch_file_fetch_data_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
217
static void unity_webapp_fetch_file_read_something_async (UnityWebappFetchFile* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
218
static void unity_webapp_fetch_file_read_something_finish (UnityWebappFetchFile* self, GAsyncResult* _res_);
217
219
void unity_webapp_fetch_file_fetch_data (UnityWebappFetchFile* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
218
220
void unity_webapp_fetch_file_fetch_data_finish (UnityWebappFetchFile* self, GAsyncResult* _res_);
219
221
static gboolean unity_webapp_fetch_file_fetch_data_co (UnityWebappFetchFileFetchDataData* data);
220
 
static void unity_webapp_fetch_file_read_something_async (UnityWebappFetchFile* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
221
 
static void unity_webapp_fetch_file_read_something_finish (UnityWebappFetchFile* self, GAsyncResult* _res_);
222
222
static void unity_webapp_fetch_file_read_something_async_data_free (gpointer _data);
223
223
static void unity_webapp_fetch_file_read_something_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
224
224
static gboolean unity_webapp_fetch_file_read_something_async_co (UnityWebappFetchFileReadSomethingAsyncData* data);
239
239
};
240
240
UnityWebappWebiconFetcher* unity_webapp_webicon_fetcher_new (const char* uri, const char* destination, const char* desktop_file);
241
241
UnityWebappWebiconFetcher* unity_webapp_webicon_fetcher_construct (GType object_type, const char* uri, const char* destination, const char* desktop_file);
 
242
const char* unity_webapp_webicon_fetcher_get_desktop_location (UnityWebappWebiconFetcher* self);
242
243
static void unity_webapp_webicon_fetcher_set_desktop_file_icon (UnityWebappWebiconFetcher* self, const char* iconname);
243
 
const char* unity_webapp_webicon_fetcher_get_desktop_location (UnityWebappWebiconFetcher* self);
244
 
void unity_webapp_webicon_fetcher_fetch_webapp_data (UnityWebappWebiconFetcher* self);
245
244
const char* unity_webapp_webicon_fetcher_get_uri (UnityWebappWebiconFetcher* self);
246
245
static void _lambda5_ (UnityWebappWebiconFetcher* self);
247
246
static void __lambda5__unity_webapp_fetch_file_failed (UnityWebappFetchFile* _sender, gpointer self);
248
247
static void unity_webapp_webicon_fetcher_on_fetcher_completed (UnityWebappWebiconFetcher* self, GByteArray* data);
249
248
static void _unity_webapp_webicon_fetcher_on_fetcher_completed_unity_webapp_fetch_file_completed (UnityWebappFetchFile* _sender, GByteArray* data, gpointer self);
 
249
void unity_webapp_webicon_fetcher_fetch_webapp_data (UnityWebappWebiconFetcher* self);
250
250
static GeePriorityQueue* unity_webapp_webicon_fetcher_extract_icon_from_html (UnityWebappWebiconFetcher* self, const char* html, gboolean preferred);
251
251
static void unity_webapp_webicon_fetcher_attempt_fetch_icon (UnityWebappWebiconFetcher* self);
252
252
const char* unity_webapp_webicon_fetcher_get_destination (UnityWebappWebiconFetcher* self);
253
 
static gboolean _lambda7_ (UnityWebappWebiconFetcher* self);
254
253
GType unity_shell_mode_get_type (void) G_GNUC_CONST;
255
254
GType unity_window_action_get_type (void) G_GNUC_CONST;
256
255
GType unity_shell_get_type (void) G_GNUC_CONST;
 
256
static gboolean _lambda7_ (UnityWebappWebiconFetcher* self);
257
257
static gboolean __lambda7__gsource_func (gpointer self);
258
258
static void unity_webapp_webicon_fetcher_on_fetcher_failed (UnityWebappWebiconFetcher* self);
259
259
static void _lambda6_ (UnityWebappWebiconFetcher* self);
273
273
 
274
274
char* unity_webapp_urlify (const char* uri) {
275
275
        char* result = NULL;
 
276
        GError * _inner_error_;
276
277
        char* return_string;
277
 
        GError * _inner_error_ = NULL;
278
278
        g_return_val_if_fail (uri != NULL, NULL);
 
279
        _inner_error_ = NULL;
279
280
        return_string = g_uri_unescape_string (uri, NULL);
280
281
        {
281
282
                GRegex* regex;
284
285
                regex = g_regex_new ("^[ \\\\]+|[ \\\\]+$", 0, 0, &_inner_error_);
285
286
                if (_inner_error_ != NULL) {
286
287
                        if (_inner_error_->domain == G_REGEX_ERROR) {
287
 
                                goto __catch41_g_regex_error;
 
288
                                goto __catch42_g_regex_error;
288
289
                        }
289
290
                        _g_free0 (return_string);
290
291
                        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);
295
296
                if (_inner_error_ != NULL) {
296
297
                        _g_regex_unref0 (regex);
297
298
                        if (_inner_error_->domain == G_REGEX_ERROR) {
298
 
                                goto __catch41_g_regex_error;
 
299
                                goto __catch42_g_regex_error;
299
300
                        }
300
301
                        _g_regex_unref0 (regex);
301
302
                        _g_free0 (return_string);
306
307
                return_string = (_tmp1_ = _tmp0_, _g_free0 (return_string), _tmp1_);
307
308
                _g_regex_unref0 (regex);
308
309
        }
309
 
        goto __finally41;
310
 
        __catch41_g_regex_error:
 
310
        goto __finally42;
 
311
        __catch42_g_regex_error:
311
312
        {
312
313
                GError * e;
313
314
                e = _inner_error_;
317
318
                        _g_error_free0 (e);
318
319
                }
319
320
        }
320
 
        __finally41:
 
321
        __finally42:
321
322
        if (_inner_error_ != NULL) {
322
323
                _g_free0 (return_string);
323
324
                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);
331
332
                regex = g_regex_new ("^.*?://", 0, 0, &_inner_error_);
332
333
                if (_inner_error_ != NULL) {
333
334
                        if (_inner_error_->domain == G_REGEX_ERROR) {
334
 
                                goto __catch42_g_regex_error;
 
335
                                goto __catch43_g_regex_error;
335
336
                        }
336
337
                        _g_free0 (return_string);
337
338
                        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);
342
343
                if (_inner_error_ != NULL) {
343
344
                        _g_regex_unref0 (regex);
344
345
                        if (_inner_error_->domain == G_REGEX_ERROR) {
345
 
                                goto __catch42_g_regex_error;
 
346
                                goto __catch43_g_regex_error;
346
347
                        }
347
348
                        _g_regex_unref0 (regex);
348
349
                        _g_free0 (return_string);
353
354
                return_string = (_tmp3_ = _tmp2_, _g_free0 (return_string), _tmp3_);
354
355
                _g_regex_unref0 (regex);
355
356
        }
356
 
        goto __finally42;
357
 
        __catch42_g_regex_error:
 
357
        goto __finally43;
 
358
        __catch43_g_regex_error:
358
359
        {
359
360
                GError * e;
360
361
                e = _inner_error_;
364
365
                        _g_error_free0 (e);
365
366
                }
366
367
        }
367
 
        __finally42:
 
368
        __finally43:
368
369
        if (_inner_error_ != NULL) {
369
370
                _g_free0 (return_string);
370
371
                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);
378
379
                regex = g_regex_new ("(\\s|/)", 0, 0, &_inner_error_);
379
380
                if (_inner_error_ != NULL) {
380
381
                        if (_inner_error_->domain == G_REGEX_ERROR) {
381
 
                                goto __catch43_g_regex_error;
 
382
                                goto __catch44_g_regex_error;
382
383
                        }
383
384
                        _g_free0 (return_string);
384
385
                        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);
389
390
                if (_inner_error_ != NULL) {
390
391
                        _g_regex_unref0 (regex);
391
392
                        if (_inner_error_->domain == G_REGEX_ERROR) {
392
 
                                goto __catch43_g_regex_error;
 
393
                                goto __catch44_g_regex_error;
393
394
                        }
394
395
                        _g_regex_unref0 (regex);
395
396
                        _g_free0 (return_string);
400
401
                return_string = (_tmp5_ = _tmp4_, _g_free0 (return_string), _tmp5_);
401
402
                _g_regex_unref0 (regex);
402
403
        }
403
 
        goto __finally43;
404
 
        __catch43_g_regex_error:
 
404
        goto __finally44;
 
405
        __catch44_g_regex_error:
405
406
        {
406
407
                GError * e;
407
408
                e = _inner_error_;
411
412
                        _g_error_free0 (e);
412
413
                }
413
414
        }
414
 
        __finally43:
 
415
        __finally44:
415
416
        if (_inner_error_ != NULL) {
416
417
                _g_free0 (return_string);
417
418
                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);
425
426
                regex = g_regex_new ("[^([:alnum:]|\\.|_)]+", 0, 0, &_inner_error_);
426
427
                if (_inner_error_ != NULL) {
427
428
                        if (_inner_error_->domain == G_REGEX_ERROR) {
428
 
                                goto __catch44_g_regex_error;
 
429
                                goto __catch45_g_regex_error;
429
430
                        }
430
431
                        _g_free0 (return_string);
431
432
                        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);
436
437
                if (_inner_error_ != NULL) {
437
438
                        _g_regex_unref0 (regex);
438
439
                        if (_inner_error_->domain == G_REGEX_ERROR) {
439
 
                                goto __catch44_g_regex_error;
 
440
                                goto __catch45_g_regex_error;
440
441
                        }
441
442
                        _g_regex_unref0 (regex);
442
443
                        _g_free0 (return_string);
447
448
                return_string = (_tmp7_ = _tmp6_, _g_free0 (return_string), _tmp7_);
448
449
                _g_regex_unref0 (regex);
449
450
        }
450
 
        goto __finally44;
451
 
        __catch44_g_regex_error:
 
451
        goto __finally45;
 
452
        __catch45_g_regex_error:
452
453
        {
453
454
                GError * e;
454
455
                e = _inner_error_;
458
459
                        _g_error_free0 (e);
459
460
                }
460
461
        }
461
 
        __finally44:
 
462
        __finally45:
462
463
        if (_inner_error_ != NULL) {
463
464
                _g_free0 (return_string);
464
465
                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);
524
525
        }
525
526
        _state_0:
526
527
        {
527
 
                data->_tmp0_ = g_file_read (data->self->priv->file, NULL, &data->_inner_error_);
 
528
                {
 
529
                        data->_tmp0_ = g_file_read (data->self->priv->file, NULL, &data->_inner_error_);
 
530
                        if (data->_inner_error_ != NULL) {
 
531
                                goto __catch46_g_error;
 
532
                        }
 
533
                        data->self->priv->stream = (data->_tmp2_ = g_data_input_stream_new ((GInputStream*) (data->_tmp1_ = data->_tmp0_)), _g_object_unref0 (data->self->priv->stream), data->_tmp2_);
 
534
                        _g_object_unref0 (data->_tmp1_);
 
535
                        g_data_input_stream_set_byte_order (data->self->priv->stream, G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN);
 
536
                }
 
537
                goto __finally46;
 
538
                __catch46_g_error:
 
539
                {
 
540
                        data->e = data->_inner_error_;
 
541
                        data->_inner_error_ = NULL;
 
542
                        {
 
543
                                g_signal_emit_by_name (data->self, "failed");
 
544
                                _g_error_free0 (data->e);
 
545
                        }
 
546
                }
 
547
                __finally46:
528
548
                if (data->_inner_error_ != NULL) {
529
 
                        goto __catch45_g_error;
530
 
                }
531
 
                data->self->priv->stream = (data->_tmp2_ = g_data_input_stream_new ((GInputStream*) (data->_tmp1_ = data->_tmp0_)), _g_object_unref0 (data->self->priv->stream), data->_tmp2_);
532
 
                _g_object_unref0 (data->_tmp1_);
533
 
                g_data_input_stream_set_byte_order (data->self->priv->stream, G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN);
534
 
        }
535
 
        goto __finally45;
536
 
        __catch45_g_error:
537
 
        {
538
 
                data->e = data->_inner_error_;
539
 
                data->_inner_error_ = NULL;
540
 
                {
541
 
                        g_signal_emit_by_name (data->self, "failed");
542
 
                        _g_error_free0 (data->e);
543
 
                }
544
 
        }
545
 
        __finally45:
546
 
        if (data->_inner_error_ != NULL) {
547
 
                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);
548
 
                g_clear_error (&data->_inner_error_);
549
 
                return FALSE;
550
 
        }
551
 
        unity_webapp_fetch_file_read_something_async (data->self, NULL, NULL);
 
549
                        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);
 
550
                        g_clear_error (&data->_inner_error_);
 
551
                        return FALSE;
 
552
                }
 
553
                unity_webapp_fetch_file_read_something_async (data->self, NULL, NULL);
 
554
        }
552
555
        {
553
556
                if (data->_state_ == 0) {
554
557
                        g_simple_async_result_complete_in_idle (data->_async_result);
597
600
        switch (data->_state_) {
598
601
                case 0:
599
602
                goto _state_0;
 
603
                case 18:
 
604
                goto _state_18;
600
605
                default:
601
606
                g_assert_not_reached ();
602
 
                case 19:
603
 
                goto _state_19;
604
607
        }
605
608
        _state_0:
606
 
        data->size = (gssize) 1024;
607
 
        data->buffer = (data->_tmp0_ = g_new0 (guint8, data->size), data->buffer_length1 = data->size, data->_buffer_size_ = data->buffer_length1, data->_tmp0_);
608
 
        data->bufsize = (gssize) 1;
609
609
        {
610
 
                data->_tmp1_ = TRUE;
611
 
                while (TRUE) {
612
 
                        if (!data->_tmp1_) {
613
 
                                if (!(data->bufsize > 0)) {
614
 
                                        break;
615
 
                                }
616
 
                        }
617
 
                        data->_tmp1_ = FALSE;
618
 
                        {
619
 
                                data->_state_ = 19;
620
 
                                g_input_stream_read_async ((GInputStream*) data->self->priv->stream, data->buffer, (gsize) data->size, G_PRIORITY_DEFAULT, NULL, unity_webapp_fetch_file_read_something_async_ready, data);
621
 
                                return FALSE;
622
 
                                _state_19:
623
 
                                data->_tmp2_ = g_input_stream_read_finish ((GInputStream*) data->self->priv->stream, data->_res_, &data->_inner_error_);
 
610
                data->size = (gssize) 1024;
 
611
                data->buffer = (data->_tmp0_ = g_new0 (guint8, data->size), data->buffer_length1 = data->size, data->_buffer_size_ = data->buffer_length1, data->_tmp0_);
 
612
                data->bufsize = (gssize) 1;
 
613
                {
 
614
                        data->_tmp1_ = TRUE;
 
615
                        while (TRUE) {
 
616
                                if (!data->_tmp1_) {
 
617
                                        if (!(data->bufsize > 0)) {
 
618
                                                break;
 
619
                                        }
 
620
                                }
 
621
                                data->_tmp1_ = FALSE;
 
622
                                {
 
623
                                        data->_state_ = 18;
 
624
                                        g_input_stream_read_async ((GInputStream*) data->self->priv->stream, data->buffer, (gsize) data->size, G_PRIORITY_DEFAULT, NULL, unity_webapp_fetch_file_read_something_async_ready, data);
 
625
                                        return FALSE;
 
626
                                        _state_18:
 
627
                                        data->_tmp2_ = g_input_stream_read_finish ((GInputStream*) data->self->priv->stream, data->_res_, &data->_inner_error_);
 
628
                                        if (data->_inner_error_ != NULL) {
 
629
                                                goto __catch47_g_error;
 
630
                                        }
 
631
                                        data->bufsize = data->_tmp2_;
 
632
                                        if (data->bufsize < 1) {
 
633
                                                break;
 
634
                                        }
 
635
                                        if (data->bufsize != data->size) {
 
636
                                                data->cpybuf = (data->_tmp3_ = g_new0 (guint8, data->bufsize), data->cpybuf_length1 = data->bufsize, data->_cpybuf_size_ = data->cpybuf_length1, data->_tmp3_);
 
637
                                                memcpy (data->cpybuf, data->buffer, (gsize) data->bufsize);
 
638
                                                g_byte_array_append (data->self->priv->data, data->cpybuf, data->cpybuf_length1);
 
639
                                                data->cpybuf = (g_free (data->cpybuf), NULL);
 
640
                                        } else {
 
641
                                                g_byte_array_append (data->self->priv->data, data->buffer, data->buffer_length1);
 
642
                                        }
 
643
                                }
 
644
                                goto __finally47;
 
645
                                __catch47_g_error:
 
646
                                {
 
647
                                        data->e = data->_inner_error_;
 
648
                                        data->_inner_error_ = NULL;
 
649
                                        {
 
650
                                                g_signal_emit_by_name (data->self, "failed");
 
651
                                                _g_error_free0 (data->e);
 
652
                                        }
 
653
                                }
 
654
                                __finally47:
624
655
                                if (data->_inner_error_ != NULL) {
625
 
                                        goto __catch46_g_error;
626
 
                                }
627
 
                                data->bufsize = data->_tmp2_;
628
 
                                if (data->bufsize < 1) {
629
 
                                        break;
630
 
                                }
631
 
                                if (data->bufsize != data->size) {
632
 
                                        data->cpybuf = (data->_tmp3_ = g_new0 (guint8, data->bufsize), data->cpybuf_length1 = data->bufsize, data->_cpybuf_size_ = data->cpybuf_length1, data->_tmp3_);
633
 
                                        memcpy (data->cpybuf, data->buffer, (gsize) data->bufsize);
634
 
                                        g_byte_array_append (data->self->priv->data, data->cpybuf, data->cpybuf_length1);
635
 
                                        data->cpybuf = (g_free (data->cpybuf), NULL);
636
 
                                } else {
637
 
                                        g_byte_array_append (data->self->priv->data, data->buffer, data->buffer_length1);
638
 
                                }
639
 
                        }
640
 
                        goto __finally46;
641
 
                        __catch46_g_error:
642
 
                        {
643
 
                                data->e = data->_inner_error_;
644
 
                                data->_inner_error_ = NULL;
645
 
                                {
646
 
                                        g_signal_emit_by_name (data->self, "failed");
647
 
                                        _g_error_free0 (data->e);
648
 
                                }
649
 
                        }
650
 
                        __finally46:
651
 
                        if (data->_inner_error_ != NULL) {
652
 
                                data->buffer = (g_free (data->buffer), NULL);
653
 
                                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);
654
 
                                g_clear_error (&data->_inner_error_);
655
 
                                return FALSE;
 
656
                                        data->buffer = (g_free (data->buffer), NULL);
 
657
                                        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);
 
658
                                        g_clear_error (&data->_inner_error_);
 
659
                                        return FALSE;
 
660
                                }
656
661
                        }
657
662
                }
 
663
                g_signal_emit_by_name (data->self, "completed", data->self->priv->data);
 
664
                data->buffer = (g_free (data->buffer), NULL);
658
665
        }
659
 
        g_signal_emit_by_name (data->self, "completed", data->self->priv->data);
660
 
        data->buffer = (g_free (data->buffer), NULL);
661
666
        {
662
667
                if (data->_state_ == 0) {
663
668
                        g_simple_async_result_complete_in_idle (data->_async_result);
774
779
 
775
780
char* unity_webapp_get_hostname (const char* uri) {
776
781
        char* result = NULL;
 
782
        GError * _inner_error_;
777
783
        GMatchInfo* matchinfo;
 
784
        GMatchInfo* _tmp4_;
 
785
        gboolean _tmp3_;
778
786
        GMatchInfo* _tmp2_ = NULL;
779
 
        gboolean _tmp3_;
780
 
        GMatchInfo* _tmp4_;
781
787
        gboolean ismatch;
782
788
        char* hostname;
783
 
        GError * _inner_error_ = NULL;
784
789
        g_return_val_if_fail (uri != NULL, NULL);
 
790
        _inner_error_ = NULL;
785
791
        if (unity_webapp_hostname_match == NULL) {
786
792
                {
787
793
                        GRegex* _tmp0_;
788
794
                        GRegex* _tmp1_;
789
795
                        _tmp0_ = g_regex_new (hostname_string, G_REGEX_UNGREEDY, 0, &_inner_error_);
790
796
                        if (_inner_error_ != NULL) {
791
 
                                goto __catch47_g_error;
 
797
                                goto __catch48_g_error;
792
798
                        }
793
799
                        unity_webapp_hostname_match = (_tmp1_ = _tmp0_, _g_regex_unref0 (unity_webapp_hostname_match), _tmp1_);
794
800
                }
795
 
                goto __finally47;
796
 
                __catch47_g_error:
 
801
                goto __finally48;
 
802
                __catch48_g_error:
797
803
                {
798
804
                        GError * e;
799
805
                        e = _inner_error_;
803
809
                                _g_error_free0 (e);
804
810
                        }
805
811
                }
806
 
                __finally47:
 
812
                __finally48:
807
813
                if (_inner_error_ != NULL) {
808
814
                        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);
809
815
                        g_clear_error (&_inner_error_);
839
845
 
840
846
 
841
847
static void unity_webapp_webicon_fetcher_set_desktop_file_icon (UnityWebappWebiconFetcher* self, const char* iconname) {
842
 
        GError * _inner_error_ = NULL;
 
848
        GError * _inner_error_;
843
849
        g_return_if_fail (self != NULL);
844
850
        g_return_if_fail (iconname != NULL);
 
851
        _inner_error_ = NULL;
845
852
        {
846
853
                GFile* file;
847
854
                GFileOutputStream* file_stream;
852
859
                file_stream = g_file_replace (file, NULL, FALSE, G_FILE_CREATE_NONE, NULL, &_inner_error_);
853
860
                if (_inner_error_ != NULL) {
854
861
                        _g_object_unref0 (file);
855
 
                        goto __catch48_g_error;
 
862
                        goto __catch49_g_error;
856
863
                }
857
864
                desktop_file = g_key_file_new ();
858
865
                g_key_file_load_from_file (desktop_file, self->priv->_desktop_location, 0, &_inner_error_);
860
867
                        _g_key_file_free0 (desktop_file);
861
868
                        _g_object_unref0 (file_stream);
862
869
                        _g_object_unref0 (file);
863
 
                        goto __catch48_g_error;
 
870
                        goto __catch49_g_error;
864
871
                }
865
872
                g_key_file_set_string (desktop_file, "Desktop Entry", "Icon", iconname);
866
873
                desktop_data = g_key_file_to_data (desktop_file, NULL, NULL);
872
879
                        _g_key_file_free0 (desktop_file);
873
880
                        _g_object_unref0 (file_stream);
874
881
                        _g_object_unref0 (file);
875
 
                        goto __catch48_g_error;
 
882
                        goto __catch49_g_error;
876
883
                }
877
884
                g_output_stream_close ((GOutputStream*) data_stream, NULL, &_inner_error_);
878
885
                if (_inner_error_ != NULL) {
881
888
                        _g_key_file_free0 (desktop_file);
882
889
                        _g_object_unref0 (file_stream);
883
890
                        _g_object_unref0 (file);
884
 
                        goto __catch48_g_error;
 
891
                        goto __catch49_g_error;
885
892
                }
886
893
                _g_object_unref0 (data_stream);
887
894
                _g_free0 (desktop_data);
889
896
                _g_object_unref0 (file_stream);
890
897
                _g_object_unref0 (file);
891
898
        }
892
 
        goto __finally48;
893
 
        __catch48_g_error:
 
899
        goto __finally49;
 
900
        __catch49_g_error:
894
901
        {
895
902
                GError * e;
896
903
                e = _inner_error_;
900
907
                        _g_error_free0 (e);
901
908
                }
902
909
        }
903
 
        __finally48:
 
910
        __finally49:
904
911
        if (_inner_error_ != NULL) {
905
912
                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);
906
913
                g_clear_error (&_inner_error_);
956
963
 
957
964
 
958
965
static void unity_webapp_webicon_fetcher_on_fetcher_completed (UnityWebappWebiconFetcher* self, GByteArray* data) {
959
 
        GError * _inner_error_ = NULL;
 
966
        GError * _inner_error_;
960
967
        g_return_if_fail (self != NULL);
961
968
        g_return_if_fail (data != NULL);
 
969
        _inner_error_ = NULL;
962
970
        if (self->priv->html_phase) {
963
971
                char* html;
964
972
                char* hostname;
 
973
                char* _tmp1_;
965
974
                char* _tmp0_;
966
 
                char* _tmp1_;
967
975
                GeePriorityQueue* primary_icons;
 
976
                char* _tmp3_;
968
977
                char* _tmp2_;
969
 
                char* _tmp3_;
970
978
                GeePriorityQueue* secondary_icons;
 
979
                char* _tmp5_;
971
980
                char* _tmp4_;
972
 
                char* _tmp5_;
 
981
                char* _tmp7_;
973
982
                char* _tmp6_;
974
 
                char* _tmp7_;
975
983
                g_debug ("webapp-fetcher.vala:248: we got the html");
976
984
                self->priv->html_phase = FALSE;
977
985
                html = g_strdup ((const char*) data->data);
1034
1042
                                gdk_pixbuf_loader_write (loader, data->data, (gsize) data->len, &_inner_error_);
1035
1043
                                if (_inner_error_ != NULL) {
1036
1044
                                        _g_object_unref0 (loader);
1037
 
                                        goto __catch49_g_error;
 
1045
                                        goto __catch50_g_error;
1038
1046
                                }
1039
1047
                                gdk_pixbuf_loader_close (loader, &_inner_error_);
1040
1048
                                if (_inner_error_ != NULL) {
1041
1049
                                        _g_object_unref0 (loader);
1042
 
                                        goto __catch49_g_error;
 
1050
                                        goto __catch50_g_error;
1043
1051
                                }
1044
1052
                                icon = _g_object_ref0 (gdk_pixbuf_loader_get_pixbuf (loader));
1045
1053
                                gdk_pixbuf_save (icon, self->priv->_destination, "png", &_inner_error_, NULL);
1046
1054
                                if (_inner_error_ != NULL) {
1047
1055
                                        _g_object_unref0 (icon);
1048
1056
                                        _g_object_unref0 (loader);
1049
 
                                        goto __catch49_g_error;
 
1057
                                        goto __catch50_g_error;
1050
1058
                                }
1051
1059
                                _g_object_unref0 (icon);
1052
1060
                                _g_object_unref0 (loader);
1053
1061
                        }
1054
 
                        goto __finally49;
1055
 
                        __catch49_g_error:
 
1062
                        goto __finally50;
 
1063
                        __catch50_g_error:
1056
1064
                        {
1057
1065
                                GError * e;
1058
1066
                                e = _inner_error_;
1063
1071
                                        return;
1064
1072
                                }
1065
1073
                        }
1066
 
                        __finally49:
 
1074
                        __finally50:
1067
1075
                        if (_inner_error_ != NULL) {
1068
1076
                                g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
1069
1077
                                g_clear_error (&_inner_error_);
1142
1150
        GeePriorityQueue* result = NULL;
1143
1151
        GeePriorityQueue* return_uris;
1144
1152
        GMatchInfo* matchinfo;
 
1153
        gint _regex_array_size_;
1145
1154
        gint regex_array_length1;
1146
 
        gint _regex_array_size_;
1147
1155
        GRegex** regex_array;
1148
1156
        g_return_val_if_fail (self != NULL, NULL);
1149
1157
        g_return_val_if_fail (html != NULL, NULL);
1151
1159
        matchinfo = NULL;
1152
1160
        regex_array = (regex_array_length1 = 0, NULL);
1153
1161
        if (preferred) {
 
1162
                GRegex** _tmp1_;
1154
1163
                GRegex** _tmp0_ = NULL;
1155
 
                GRegex** _tmp1_;
1156
1164
                regex_array = (_tmp1_ = (_tmp0_ = g_new0 (GRegex*, 2 + 1), _tmp0_[0] = _g_regex_ref0 (unity_webapp_primary_match_prefix), _tmp0_[1] = _g_regex_ref0 (unity_webapp_primary_match_suffix), _tmp0_), regex_array = (_vala_array_free (regex_array, regex_array_length1, (GDestroyNotify) g_regex_unref), NULL), regex_array_length1 = 2, _regex_array_size_ = regex_array_length1, _tmp1_);
1157
1165
        } else {
 
1166
                GRegex** _tmp3_;
1158
1167
                GRegex** _tmp2_ = NULL;
1159
 
                GRegex** _tmp3_;
1160
1168
                regex_array = (_tmp3_ = (_tmp2_ = g_new0 (GRegex*, 2 + 1), _tmp2_[0] = _g_regex_ref0 (unity_webapp_secondary_match_prefix), _tmp2_[1] = _g_regex_ref0 (unity_webapp_secondary_match_suffix), _tmp2_), regex_array = (_vala_array_free (regex_array, regex_array_length1, (GDestroyNotify) g_regex_unref), NULL), regex_array_length1 = 2, _regex_array_size_ = regex_array_length1, _tmp3_);
1161
1169
        }
1162
1170
        {
1169
1177
                        GRegex* regex;
1170
1178
                        regex = _g_regex_ref0 (regex_collection[regex_it]);
1171
1179
                        {
 
1180
                                GMatchInfo* _tmp6_;
 
1181
                                gboolean _tmp5_;
1172
1182
                                GMatchInfo* _tmp4_ = NULL;
1173
 
                                gboolean _tmp5_;
1174
 
                                GMatchInfo* _tmp6_;
1175
1183
                                if ((_tmp5_ = g_regex_match (regex, html, 0, &_tmp4_), matchinfo = (_tmp6_ = _tmp4_, _g_match_info_free0 (matchinfo), _tmp6_), _tmp5_)) {
1176
1184
                                        char* match;
1177
1185
                                        gboolean _tmp7_ = FALSE;
1256
1264
        self = UNITY_WEBAPP_WEBICON_FETCHER (obj);
1257
1265
        _inner_error_ = NULL;
1258
1266
        {
1259
 
                GeeList* _tmp10_;
 
1267
                GeeList* _tmp12_;
1260
1268
                if (unity_webapp_primary_match_prefix == NULL) {
1261
1269
                        char* primary_match_prefix;
1262
1270
                        char* primary_match_suffix;
1267
1275
                        secondary_match_prefix = g_strdup (tag_start_string fav_string "[^>]*" uri_match_string tag_end_string);
1268
1276
                        secondary_match_suffix = g_strdup (tag_start_string uri_match_string "[^>]*" fav_string tag_end_string);
1269
1277
                        {
1270
 
                                GRegex* _tmp0_;
1271
 
                                GRegex* _tmp1_;
1272
1278
                                GRegex* _tmp2_;
1273
1279
                                GRegex* _tmp3_;
1274
1280
                                GRegex* _tmp4_;
1277
1283
                                GRegex* _tmp7_;
1278
1284
                                GRegex* _tmp8_;
1279
1285
                                GRegex* _tmp9_;
1280
 
                                _tmp0_ = g_regex_new (primary_match_prefix, G_REGEX_UNGREEDY, 0, &_inner_error_);
1281
 
                                if (_inner_error_ != NULL) {
1282
 
                                        goto __catch50_g_error;
1283
 
                                }
1284
 
                                unity_webapp_primary_match_prefix = (_tmp1_ = _tmp0_, _g_regex_unref0 (unity_webapp_primary_match_prefix), _tmp1_);
1285
 
                                _tmp2_ = g_regex_new (primary_match_suffix, G_REGEX_UNGREEDY, 0, &_inner_error_);
1286
 
                                if (_inner_error_ != NULL) {
1287
 
                                        goto __catch50_g_error;
1288
 
                                }
1289
 
                                unity_webapp_primary_match_suffix = (_tmp3_ = _tmp2_, _g_regex_unref0 (unity_webapp_primary_match_suffix), _tmp3_);
1290
 
                                _tmp4_ = g_regex_new (secondary_match_prefix, G_REGEX_UNGREEDY, 0, &_inner_error_);
1291
 
                                if (_inner_error_ != NULL) {
1292
 
                                        goto __catch50_g_error;
1293
 
                                }
1294
 
                                unity_webapp_secondary_match_prefix = (_tmp5_ = _tmp4_, _g_regex_unref0 (unity_webapp_secondary_match_prefix), _tmp5_);
1295
 
                                _tmp6_ = g_regex_new (secondary_match_suffix, G_REGEX_UNGREEDY, 0, &_inner_error_);
1296
 
                                if (_inner_error_ != NULL) {
1297
 
                                        goto __catch50_g_error;
1298
 
                                }
1299
 
                                unity_webapp_secondary_match_suffix = (_tmp7_ = _tmp6_, _g_regex_unref0 (unity_webapp_secondary_match_suffix), _tmp7_);
1300
 
                                _tmp8_ = g_regex_new (hostname_string, G_REGEX_UNGREEDY, 0, &_inner_error_);
1301
 
                                if (_inner_error_ != NULL) {
1302
 
                                        goto __catch50_g_error;
1303
 
                                }
1304
 
                                unity_webapp_hostname_match = (_tmp9_ = _tmp8_, _g_regex_unref0 (unity_webapp_hostname_match), _tmp9_);
 
1286
                                GRegex* _tmp10_;
 
1287
                                GRegex* _tmp11_;
 
1288
                                _tmp2_ = g_regex_new (primary_match_prefix, G_REGEX_UNGREEDY, 0, &_inner_error_);
 
1289
                                if (_inner_error_ != NULL) {
 
1290
                                        goto __catch51_g_error;
 
1291
                                }
 
1292
                                unity_webapp_primary_match_prefix = (_tmp3_ = _tmp2_, _g_regex_unref0 (unity_webapp_primary_match_prefix), _tmp3_);
 
1293
                                _tmp4_ = g_regex_new (primary_match_suffix, G_REGEX_UNGREEDY, 0, &_inner_error_);
 
1294
                                if (_inner_error_ != NULL) {
 
1295
                                        goto __catch51_g_error;
 
1296
                                }
 
1297
                                unity_webapp_primary_match_suffix = (_tmp5_ = _tmp4_, _g_regex_unref0 (unity_webapp_primary_match_suffix), _tmp5_);
 
1298
                                _tmp6_ = g_regex_new (secondary_match_prefix, G_REGEX_UNGREEDY, 0, &_inner_error_);
 
1299
                                if (_inner_error_ != NULL) {
 
1300
                                        goto __catch51_g_error;
 
1301
                                }
 
1302
                                unity_webapp_secondary_match_prefix = (_tmp7_ = _tmp6_, _g_regex_unref0 (unity_webapp_secondary_match_prefix), _tmp7_);
 
1303
                                _tmp8_ = g_regex_new (secondary_match_suffix, G_REGEX_UNGREEDY, 0, &_inner_error_);
 
1304
                                if (_inner_error_ != NULL) {
 
1305
                                        goto __catch51_g_error;
 
1306
                                }
 
1307
                                unity_webapp_secondary_match_suffix = (_tmp9_ = _tmp8_, _g_regex_unref0 (unity_webapp_secondary_match_suffix), _tmp9_);
 
1308
                                _tmp10_ = g_regex_new (hostname_string, G_REGEX_UNGREEDY, 0, &_inner_error_);
 
1309
                                if (_inner_error_ != NULL) {
 
1310
                                        goto __catch51_g_error;
 
1311
                                }
 
1312
                                unity_webapp_hostname_match = (_tmp11_ = _tmp10_, _g_regex_unref0 (unity_webapp_hostname_match), _tmp11_);
1305
1313
                        }
1306
 
                        goto __finally50;
1307
 
                        __catch50_g_error:
 
1314
                        goto __finally51;
 
1315
                        __catch51_g_error:
1308
1316
                        {
1309
1317
                                GError * e;
1310
1318
                                e = _inner_error_;
1314
1322
                                        _g_error_free0 (e);
1315
1323
                                }
1316
1324
                        }
1317
 
                        __finally50:
 
1325
                        __finally51:
1318
1326
                        if (_inner_error_ != NULL) {
1319
1327
                                _g_free0 (secondary_match_suffix);
1320
1328
                                _g_free0 (secondary_match_prefix);
1328
1336
                        _g_free0 (primary_match_suffix);
1329
1337
                        _g_free0 (primary_match_prefix);
1330
1338
                }
1331
 
                self->priv->icon_uris = (_tmp10_ = (GeeList*) gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL), _g_object_unref0 (self->priv->icon_uris), _tmp10_);
 
1339
                self->priv->icon_uris = (_tmp12_ = (GeeList*) gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL), _g_object_unref0 (self->priv->icon_uris), _tmp12_);
1332
1340
                {
1333
1341
                        GFile* make_file;
1334
 
                        GFileOutputStream* _tmp11_;
 
1342
                        GFileOutputStream* _tmp13_;
1335
1343
                        make_file = g_file_new_for_path (self->priv->_destination);
1336
 
                        _tmp11_ = g_file_create (make_file, G_FILE_CREATE_NONE, NULL, &_inner_error_);
1337
 
                        _g_object_unref0 (_tmp11_);
 
1344
                        _tmp13_ = g_file_create (make_file, G_FILE_CREATE_NONE, NULL, &_inner_error_);
 
1345
                        _g_object_unref0 (_tmp13_);
1338
1346
                        if (_inner_error_ != NULL) {
1339
1347
                                _g_object_unref0 (make_file);
1340
 
                                goto __catch51_g_error;
 
1348
                                goto __catch52_g_error;
1341
1349
                        }
1342
1350
                        _g_object_unref0 (make_file);
1343
1351
                }
1344
 
                goto __finally51;
1345
 
                __catch51_g_error:
 
1352
                goto __finally52;
 
1353
                __catch52_g_error:
1346
1354
                {
1347
1355
                        GError * e;
1348
1356
                        e = _inner_error_;
1351
1359
                                _g_error_free0 (e);
1352
1360
                        }
1353
1361
                }
1354
 
                __finally51:
 
1362
                __finally52:
1355
1363
                if (_inner_error_ != NULL) {
1356
1364
                        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);
1357
1365
                        g_clear_error (&_inner_error_);