108
108
static void baobab_location_list_real_child_activated (EggListBox* base, GtkWidget* widget);
109
109
GType baobab_location_widget_get_type (void) G_GNUC_CONST;
110
110
BaobabLocation* baobab_location_widget_get_location (BaobabLocationWidget* self);
111
static gboolean baobab_location_list_already_present (BaobabLocationList* self, GFile* file);
112
GFile* baobab_location_get_file (BaobabLocation* self);
111
113
static void baobab_location_list_volume_changed (BaobabLocationList* self, GVolume* volume);
112
114
void baobab_location_list_update (BaobabLocationList* self);
113
115
static void baobab_location_list_volume_removed (BaobabLocationList* self, GVolume* volume);
122
124
BaobabLocation* baobab_location_new_from_mount (GMount* mount_);
123
125
BaobabLocation* baobab_location_construct_from_mount (GType object_type, GMount* mount_);
124
126
void baobab_location_update (BaobabLocation* self);
125
static gboolean baobab_location_list_already_present (BaobabLocationList* self, GFile* file);
126
GFile* baobab_location_get_file (BaobabLocation* self);
127
127
static void baobab_location_list_populate (BaobabLocationList* self);
128
128
BaobabLocation* baobab_location_new_for_main_volume (void);
129
129
BaobabLocation* baobab_location_construct_for_main_volume (GType object_type);
235
static void baobab_location_list_volume_changed (BaobabLocationList* self, GVolume* volume) {
236
g_return_if_fail (self != NULL);
237
g_return_if_fail (volume != NULL);
238
baobab_location_list_update (self);
242
235
static gpointer _baobab_location_ref0 (gpointer self) {
243
236
return self ? baobab_location_ref (self) : NULL;
240
static gboolean baobab_location_list_already_present (BaobabLocationList* self, GFile* file) {
241
gboolean result = FALSE;
243
g_return_val_if_fail (self != NULL, FALSE);
244
g_return_val_if_fail (file != NULL, FALSE);
245
_tmp0_ = self->priv->locations;
247
GList* l_collection = NULL;
249
l_collection = _tmp0_;
250
for (l_it = l_collection; l_it != NULL; l_it = l_it->next) {
251
BaobabLocation* _tmp1_;
252
BaobabLocation* l = NULL;
253
_tmp1_ = _baobab_location_ref0 ((BaobabLocation*) l_it->data);
256
gboolean _tmp2_ = FALSE;
257
BaobabLocation* _tmp3_;
262
_tmp4_ = baobab_location_get_file (_tmp3_);
264
if (_tmp5_ != NULL) {
265
BaobabLocation* _tmp6_;
269
gboolean _tmp10_ = FALSE;
271
_tmp7_ = baobab_location_get_file (_tmp6_);
274
_tmp10_ = g_file_equal (_tmp8_, _tmp9_);
282
_baobab_location_unref0 (l);
285
_baobab_location_unref0 (l);
294
static void baobab_location_list_volume_changed (BaobabLocationList* self, GVolume* volume) {
295
g_return_if_fail (self != NULL);
296
g_return_if_fail (volume != NULL);
297
baobab_location_list_update (self);
247
301
static void baobab_location_list_volume_removed (BaobabLocationList* self, GVolume* volume) {
249
303
g_return_if_fail (self != NULL);
352
406
if (_tmp2_ == NULL) {
354
BaobabLocation* _tmp4_;
408
GFile* _tmp4_ = NULL;
410
gboolean _tmp6_ = FALSE;
356
_tmp4_ = baobab_location_new_from_mount (_tmp3_);
357
self->priv->locations = g_list_append (self->priv->locations, _tmp4_);
413
_tmp4_ = g_mount_get_root (_tmp3_);
415
_tmp6_ = baobab_location_list_already_present (self, _tmp5_);
417
_g_object_unref0 (_tmp5_);
420
BaobabLocation* _tmp9_;
422
_tmp9_ = baobab_location_new_from_mount (_tmp8_);
423
self->priv->locations = g_list_append (self->priv->locations, _tmp9_);
360
_tmp5_ = self->priv->locations;
427
_tmp10_ = self->priv->locations;
362
429
GList* location_collection = NULL;
363
430
GList* location_it = NULL;
364
location_collection = _tmp5_;
431
location_collection = _tmp10_;
365
432
for (location_it = location_collection; location_it != NULL; location_it = location_it->next) {
366
BaobabLocation* _tmp6_;
433
BaobabLocation* _tmp11_;
367
434
BaobabLocation* location = NULL;
368
_tmp6_ = _baobab_location_ref0 ((BaobabLocation*) location_it->data);
435
_tmp11_ = _baobab_location_ref0 ((BaobabLocation*) location_it->data);
371
BaobabLocation* _tmp7_;
376
_tmp8_ = baobab_location_get_volume (_tmp7_);
379
if (_tmp9_ == _tmp10_) {
380
BaobabLocation* _tmp11_;
382
baobab_location_update (_tmp11_);
438
BaobabLocation* _tmp12_;
443
_tmp13_ = baobab_location_get_volume (_tmp12_);
446
if (_tmp14_ == _tmp15_) {
447
BaobabLocation* _tmp16_;
449
baobab_location_update (_tmp16_);
383
450
_baobab_location_unref0 (location);
396
static gboolean baobab_location_list_already_present (BaobabLocationList* self, GFile* file) {
397
gboolean result = FALSE;
399
g_return_val_if_fail (self != NULL, FALSE);
400
g_return_val_if_fail (file != NULL, FALSE);
401
_tmp0_ = self->priv->locations;
403
GList* l_collection = NULL;
405
l_collection = _tmp0_;
406
for (l_it = l_collection; l_it != NULL; l_it = l_it->next) {
407
BaobabLocation* _tmp1_;
408
BaobabLocation* l = NULL;
409
_tmp1_ = _baobab_location_ref0 ((BaobabLocation*) l_it->data);
412
gboolean _tmp2_ = FALSE;
413
BaobabLocation* _tmp3_;
418
_tmp4_ = baobab_location_get_file (_tmp3_);
420
if (_tmp5_ != NULL) {
421
BaobabLocation* _tmp6_;
425
gboolean _tmp10_ = FALSE;
427
_tmp7_ = baobab_location_get_file (_tmp6_);
430
_tmp10_ = g_file_equal (_tmp8_, _tmp9_);
438
_baobab_location_unref0 (l);
441
_baobab_location_unref0 (l);
450
463
static void _g_object_unref0_ (gpointer var) {
451
464
(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));