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

« back to all changes in this revision

Viewing changes to unity-private/places/places-trash-controller.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
 
/* places-trash-controller.c generated by valac 0.9.7, the Vala compiler
 
1
/* places-trash-controller.c generated by valac, the Vala compiler
2
2
 * generated from places-trash-controller.vala, do not modify */
3
3
 
4
4
/*
150
150
        GFileEnumerator* e;
151
151
        GList* files;
152
152
        GFile* child;
 
153
        char* _tmp1_;
153
154
        char* _tmp0_;
154
 
        char* _tmp1_;
155
155
        GError * error_;
156
156
        GList* info_collection;
157
157
        GList* info_it;
158
158
        GFileInfo* info;
 
159
        char* _tmp3_;
159
160
        char* _tmp2_;
160
 
        char* _tmp3_;
161
161
        GError * _error_;
162
162
        GError * _inner_error_;
163
163
};
181
181
        UNITY_PLACES_TRASH_CONTROLLER_DUMMY_PROPERTY
182
182
};
183
183
#define UNITY_PLACES_TRASH_CONTROLLER_ICON "/usr/share/unity/trash.png"
184
 
UnityPlacesTrashController* unity_places_trash_controller_new (void);
185
 
UnityPlacesTrashController* unity_places_trash_controller_construct (GType object_type);
186
184
UnityLauncherScrollerChild* unity_launcher_scroller_child_new (void);
187
185
UnityLauncherScrollerChild* unity_launcher_scroller_child_construct (GType object_type);
188
186
GType unity_launcher_scroller_child_get_type (void) G_GNUC_CONST;
 
187
UnityPlacesTrashController* unity_places_trash_controller_new (void);
 
188
UnityPlacesTrashController* unity_places_trash_controller_construct (GType object_type);
189
189
static void unity_places_trash_controller_real_activate (UnityLauncherScrollerChildController* base);
190
 
static UnityLauncherQuicklistController* unity_places_trash_controller_real_get_menu_controller (UnityLauncherScrollerChildController* base);
191
190
UnityLauncherApplicationQuicklistController* unity_launcher_application_quicklist_controller_new (UnityLauncherScrollerChildController* scroller_child);
192
191
UnityLauncherApplicationQuicklistController* unity_launcher_application_quicklist_controller_construct (GType object_type, UnityLauncherScrollerChildController* scroller_child);
193
192
GType unity_launcher_application_quicklist_controller_get_type (void) G_GNUC_CONST;
 
193
static UnityLauncherQuicklistController* unity_places_trash_controller_real_get_menu_controller (UnityLauncherScrollerChildController* base);
194
194
static void unity_places_trash_controller_real_get_menu_actions (UnityLauncherScrollerChildController* base, UnityLauncherScrollerChildControllermenu_cb callback, void* callback_target);
195
 
static void unity_places_trash_controller_real_get_menu_navigation (UnityLauncherScrollerChildController* base, UnityLauncherScrollerChildControllermenu_cb callback, void* callback_target);
196
195
static void _lambda70_ (UnityPlacesTrashController* self);
197
196
static void __lambda70__dbusmenu_menuitem_item_activated (DbusmenuMenuitem* _sender, guint object, gpointer self);
198
 
static void _lambda71_ (UnityPlacesTrashController* self);
199
197
static void unity_places_trash_controller_recursively_delete_contents (UnityPlacesTrashController* self, GFile* dir, GAsyncReadyCallback _callback_, gpointer _user_data_);
200
198
static void unity_places_trash_controller_recursively_delete_contents_finish (UnityPlacesTrashController* self, GAsyncResult* _res_);
 
199
static void _lambda71_ (UnityPlacesTrashController* self);
201
200
static void __lambda71__dbusmenu_menuitem_item_activated (DbusmenuMenuitem* _sender, guint object, gpointer self);
 
201
static void unity_places_trash_controller_real_get_menu_navigation (UnityLauncherScrollerChildController* base, UnityLauncherScrollerChildControllermenu_cb callback, void* callback_target);
202
202
static void unity_places_trash_controller_recursively_delete_contents_data_free (gpointer _data);
203
203
static void unity_places_trash_controller_recursively_delete_contents_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
204
static void _g_list_free_g_object_unref (GList* self);
204
205
static gboolean unity_places_trash_controller_recursively_delete_contents_co (UnityPlacesTrashControllerRecursivelyDeleteContentsData* data);
205
 
static void _g_list_free_g_object_unref (GList* self);
206
206
static gboolean unity_places_trash_controller_real_can_drag (UnityLauncherScrollerChildController* base);
207
207
void unity_launcher_scroller_child_controller_set_name (UnityLauncherScrollerChildController* self, const char* value);
208
208
void unity_launcher_scroller_child_controller_load_icon_from_icon_name (UnityLauncherScrollerChildController* self, const char* icon_name);
209
 
UnityLauncherScrollerChild* unity_launcher_scroller_child_controller_get_child (UnityLauncherScrollerChildController* self);
210
209
GType unity_launcher_scroller_child_group_type_get_type (void) G_GNUC_CONST;
211
210
void unity_launcher_scroller_child_set_group_type (UnityLauncherScrollerChild* self, UnityLauncherScrollerChildGroupType value);
 
211
UnityLauncherScrollerChild* unity_launcher_scroller_child_controller_get_child (UnityLauncherScrollerChildController* self);
212
212
static GObject * unity_places_trash_controller_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
213
213
static void unity_places_trash_controller_finalize (GObject* obj);
214
214
 
238
238
 
239
239
static void unity_places_trash_controller_real_activate (UnityLauncherScrollerChildController* base) {
240
240
        UnityPlacesTrashController * self;
241
 
        GError * _inner_error_ = NULL;
 
241
        GError * _inner_error_;
242
242
        self = (UnityPlacesTrashController*) base;
 
243
        _inner_error_ = NULL;
243
244
        {
244
245
                gtk_show_uri (NULL, "trash://", clutter_get_current_event_time (), &_inner_error_);
245
246
                if (_inner_error_ != NULL) {
279
280
 
280
281
static void unity_places_trash_controller_real_get_menu_actions (UnityLauncherScrollerChildController* base, UnityLauncherScrollerChildControllermenu_cb callback, void* callback_target) {
281
282
        UnityPlacesTrashController * self;
 
283
        GError * _inner_error_;
282
284
        DbusmenuMenuitem* root;
283
 
        GError * _inner_error_ = NULL;
284
285
        self = (UnityPlacesTrashController*) base;
 
286
        _inner_error_ = NULL;
285
287
        self->priv->n_items = (guint) 0;
286
288
        root = dbusmenu_menuitem_new ();
287
289
        dbusmenu_menuitem_set_root (root, TRUE);
350
352
 
351
353
 
352
354
static void _lambda70_ (UnityPlacesTrashController* self) {
353
 
        GError * _inner_error_ = NULL;
 
355
        GError * _inner_error_;
 
356
        _inner_error_ = NULL;
354
357
        {
355
358
                gtk_show_uri (NULL, "trash://", clutter_get_current_event_time (), &_inner_error_);
356
359
                if (_inner_error_ != NULL) {
473
476
        switch (data->_state_) {
474
477
                case 0:
475
478
                goto _state_0;
476
 
                default:
477
 
                g_assert_not_reached ();
478
479
                case 7:
479
480
                goto _state_7;
480
481
                case 8:
481
482
                goto _state_8;
482
483
                case 9:
483
484
                goto _state_9;
 
485
                default:
 
486
                g_assert_not_reached ();
484
487
        }
485
488
        _state_0:
486
489
        {
487
 
                data->_state_ = 7;
488
 
                g_file_enumerate_children_async (data->dir, G_FILE_ATTRIBUTE_STANDARD_NAME "," G_FILE_ATTRIBUTE_STANDARD_TYPE, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, G_PRIORITY_DEFAULT, NULL, unity_places_trash_controller_recursively_delete_contents_ready, data);
489
 
                return FALSE;
490
 
                _state_7:
491
 
                data->e = g_file_enumerate_children_finish (data->dir, data->_res_, &data->_inner_error_);
492
 
                if (data->_inner_error_ != NULL) {
493
 
                        goto __catch39_g_error;
494
 
                }
495
 
                while (TRUE) {
496
 
                        data->_state_ = 8;
497
 
                        g_file_enumerator_next_files_async (data->e, 10, G_PRIORITY_DEFAULT, NULL, unity_places_trash_controller_recursively_delete_contents_ready, data);
 
490
                {
 
491
                        data->_state_ = 7;
 
492
                        g_file_enumerate_children_async (data->dir, G_FILE_ATTRIBUTE_STANDARD_NAME "," G_FILE_ATTRIBUTE_STANDARD_TYPE, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, G_PRIORITY_DEFAULT, NULL, unity_places_trash_controller_recursively_delete_contents_ready, data);
498
493
                        return FALSE;
499
 
                        _state_8:
500
 
                        data->files = g_file_enumerator_next_files_finish (data->e, data->_res_, &data->_inner_error_);
 
494
                        _state_7:
 
495
                        data->e = g_file_enumerate_children_finish (data->dir, data->_res_, &data->_inner_error_);
501
496
                        if (data->_inner_error_ != NULL) {
502
 
                                _g_object_unref0 (data->e);
503
497
                                goto __catch39_g_error;
504
498
                        }
505
 
                        if (data->files == NULL) {
506
 
                                __g_list_free_g_object_unref0 (data->files);
507
 
                                break;
508
 
                        }
509
 
                        {
510
 
                                data->info_collection = data->files;
511
 
                                for (data->info_it = data->info_collection; data->info_it != NULL; data->info_it = data->info_it->next) {
512
 
                                        data->info = _g_object_ref0 ((GFileInfo*) data->info_it->data);
513
 
                                        {
514
 
                                                data->child = g_file_get_child (data->dir, g_file_info_get_name (data->info));
515
 
                                                if (g_file_info_get_file_type (data->info) == G_FILE_TYPE_DIRECTORY) {
516
 
                                                        data->_state_ = 9;
517
 
                                                        unity_places_trash_controller_recursively_delete_contents (data->self, data->child, unity_places_trash_controller_recursively_delete_contents_ready, data);
518
 
                                                        return FALSE;
519
 
                                                        _state_9:
520
 
                                                        unity_places_trash_controller_recursively_delete_contents_finish (data->self, data->_res_);
521
 
                                                }
 
499
                        while (TRUE) {
 
500
                                data->_state_ = 8;
 
501
                                g_file_enumerator_next_files_async (data->e, 10, G_PRIORITY_DEFAULT, NULL, unity_places_trash_controller_recursively_delete_contents_ready, data);
 
502
                                return FALSE;
 
503
                                _state_8:
 
504
                                data->files = g_file_enumerator_next_files_finish (data->e, data->_res_, &data->_inner_error_);
 
505
                                if (data->_inner_error_ != NULL) {
 
506
                                        _g_object_unref0 (data->e);
 
507
                                        goto __catch39_g_error;
 
508
                                }
 
509
                                if (data->files == NULL) {
 
510
                                        __g_list_free_g_object_unref0 (data->files);
 
511
                                        break;
 
512
                                }
 
513
                                {
 
514
                                        data->info_collection = data->files;
 
515
                                        for (data->info_it = data->info_collection; data->info_it != NULL; data->info_it = data->info_it->next) {
 
516
                                                data->info = _g_object_ref0 ((GFileInfo*) data->info_it->data);
522
517
                                                {
523
 
                                                        g_file_delete (data->child, NULL, &data->_inner_error_);
 
518
                                                        data->child = g_file_get_child (data->dir, g_file_info_get_name (data->info));
 
519
                                                        if (g_file_info_get_file_type (data->info) == G_FILE_TYPE_DIRECTORY) {
 
520
                                                                data->_state_ = 9;
 
521
                                                                unity_places_trash_controller_recursively_delete_contents (data->self, data->child, unity_places_trash_controller_recursively_delete_contents_ready, data);
 
522
                                                                return FALSE;
 
523
                                                                _state_9:
 
524
                                                                unity_places_trash_controller_recursively_delete_contents_finish (data->self, data->_res_);
 
525
                                                        }
 
526
                                                        {
 
527
                                                                g_file_delete (data->child, NULL, &data->_inner_error_);
 
528
                                                                if (data->_inner_error_ != NULL) {
 
529
                                                                        goto __catch40_g_error;
 
530
                                                                }
 
531
                                                        }
 
532
                                                        goto __finally40;
 
533
                                                        __catch40_g_error:
 
534
                                                        {
 
535
                                                                data->error_ = data->_inner_error_;
 
536
                                                                data->_inner_error_ = NULL;
 
537
                                                                {
 
538
                                                                        g_warning ("places-trash-controller.vala:181: %s", data->_tmp1_ = g_strconcat ("Unable to delete file '", string_to_string (data->_tmp0_ = g_file_get_basename (data->child)), ": ", string_to_string (data->error_->message), NULL));
 
539
                                                                        _g_free0 (data->_tmp1_);
 
540
                                                                        _g_free0 (data->_tmp0_);
 
541
                                                                        _g_error_free0 (data->error_);
 
542
                                                                }
 
543
                                                        }
 
544
                                                        __finally40:
524
545
                                                        if (data->_inner_error_ != NULL) {
525
 
                                                                goto __catch40_g_error;
526
 
                                                        }
527
 
                                                }
528
 
                                                goto __finally40;
529
 
                                                __catch40_g_error:
530
 
                                                {
531
 
                                                        data->error_ = data->_inner_error_;
532
 
                                                        data->_inner_error_ = NULL;
533
 
                                                        {
534
 
                                                                g_warning ("places-trash-controller.vala:181: %s", data->_tmp1_ = g_strconcat ("Unable to delete file '", string_to_string (data->_tmp0_ = g_file_get_basename (data->child)), ": ", string_to_string (data->error_->message), NULL));
535
 
                                                                _g_free0 (data->_tmp1_);
536
 
                                                                _g_free0 (data->_tmp0_);
537
 
                                                                _g_error_free0 (data->error_);
538
 
                                                        }
539
 
                                                }
540
 
                                                __finally40:
541
 
                                                if (data->_inner_error_ != NULL) {
 
546
                                                                _g_object_unref0 (data->child);
 
547
                                                                _g_object_unref0 (data->info);
 
548
                                                                __g_list_free_g_object_unref0 (data->files);
 
549
                                                                _g_object_unref0 (data->e);
 
550
                                                                goto __catch39_g_error;
 
551
                                                        }
542
552
                                                        _g_object_unref0 (data->child);
543
553
                                                        _g_object_unref0 (data->info);
544
 
                                                        __g_list_free_g_object_unref0 (data->files);
545
 
                                                        _g_object_unref0 (data->e);
546
 
                                                        goto __catch39_g_error;
547
554
                                                }
548
 
                                                _g_object_unref0 (data->child);
549
 
                                                _g_object_unref0 (data->info);
550
555
                                        }
551
556
                                }
 
557
                                __g_list_free_g_object_unref0 (data->files);
552
558
                        }
553
 
                        __g_list_free_g_object_unref0 (data->files);
 
559
                        _g_object_unref0 (data->e);
554
560
                }
555
 
                _g_object_unref0 (data->e);
556
 
        }
557
 
        goto __finally39;
558
 
        __catch39_g_error:
559
 
        {
560
 
                data->_error_ = data->_inner_error_;
561
 
                data->_inner_error_ = NULL;
 
561
                goto __finally39;
 
562
                __catch39_g_error:
562
563
                {
563
 
                        g_warning (data->_tmp3_ = g_strconcat ("Unable to read place files from directory '", string_to_string (data->_tmp2_ = g_file_get_basename (data->dir)), "': %s", NULL), data->_error_->message);
564
 
                        _g_free0 (data->_tmp3_);
565
 
                        _g_free0 (data->_tmp2_);
566
 
                        _g_error_free0 (data->_error_);
567
 
                }
568
 
        }
569
 
        __finally39:
570
 
        if (data->_inner_error_ != NULL) {
571
 
                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);
572
 
                g_clear_error (&data->_inner_error_);
573
 
                return FALSE;
 
564
                        data->_error_ = data->_inner_error_;
 
565
                        data->_inner_error_ = NULL;
 
566
                        {
 
567
                                g_warning (data->_tmp3_ = g_strconcat ("Unable to read place files from directory '", string_to_string (data->_tmp2_ = g_file_get_basename (data->dir)), "': %s", NULL), data->_error_->message);
 
568
                                _g_free0 (data->_tmp3_);
 
569
                                _g_free0 (data->_tmp2_);
 
570
                                _g_error_free0 (data->_error_);
 
571
                        }
 
572
                }
 
573
                __finally39:
 
574
                if (data->_inner_error_ != NULL) {
 
575
                        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);
 
576
                        g_clear_error (&data->_inner_error_);
 
577
                        return FALSE;
 
578
                }
574
579
        }
575
580
        {
576
581
                if (data->_state_ == 0) {