~ubuntu-branches/ubuntu/trusty/indicator-sound-gtk2/trusty-proposed

« back to all changes in this revision

Viewing changes to src/metadata-menu-item.c

  • Committer: Package Import Robot
  • Author(s): Lionel Le Folgoc
  • Date: 2012-09-10 00:09:01 UTC
  • Revision ID: package-import@ubuntu.com-20120910000901-q6469svv5d3pmn0y
Tags: upstream-12.10.0.1
ImportĀ upstreamĀ versionĀ 12.10.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* metadata-menu-item.c generated by valac 0.17.6, the Vala compiler
 
2
 * generated from metadata-menu-item.vala, do not modify */
 
3
 
 
4
/*
 
5
Copyright 2010 Canonical Ltd.
 
6
 
 
7
Authors:
 
8
    Conor Curran <conor.curran@canonical.com>
 
9
 
 
10
This program is free software: you can redistribute it and/or modify it 
 
11
under the terms of the GNU General Public License version 3, as published 
 
12
by the Free Software Foundation.
 
13
 
 
14
This program is distributed in the hope that it will be useful, but 
 
15
WITHOUT ANY WARRANTY; without even the implied warranties of 
 
16
MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 
 
17
PURPOSE.  See the GNU General Public License for more details.
 
18
 
 
19
You should have received a copy of the GNU General Public License along 
 
20
with this program.  If not, see <http://www.gnu.org/licenses/>.
 
21
*/
 
22
 
 
23
#include <glib.h>
 
24
#include <glib-object.h>
 
25
#include <libdbusmenu-glib/client.h>
 
26
#include <libdbusmenu-glib/dbusmenu-glib.h>
 
27
#include <libdbusmenu-glib/enum-types.h>
 
28
#include <libdbusmenu-glib/menuitem-proxy.h>
 
29
#include <libdbusmenu-glib/menuitem.h>
 
30
#include <libdbusmenu-glib/server.h>
 
31
#include <libdbusmenu-glib/types.h>
 
32
#include <stdlib.h>
 
33
#include <string.h>
 
34
#include <common-defs.h>
 
35
#include <gio/gio.h>
 
36
#include <glib/gstdio.h>
 
37
#include <gdk-pixbuf/gdk-pixbuf.h>
 
38
#include <gee.h>
 
39
 
 
40
 
 
41
#define TYPE_PLAYER_ITEM (player_item_get_type ())
 
42
#define PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_ITEM, PlayerItem))
 
43
#define PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_ITEM, PlayerItemClass))
 
44
#define IS_PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_ITEM))
 
45
#define IS_PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_ITEM))
 
46
#define PLAYER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_ITEM, PlayerItemClass))
 
47
 
 
48
typedef struct _PlayerItem PlayerItem;
 
49
typedef struct _PlayerItemClass PlayerItemClass;
 
50
typedef struct _PlayerItemPrivate PlayerItemPrivate;
 
51
 
 
52
#define TYPE_METADATA_MENUITEM (metadata_menuitem_get_type ())
 
53
#define METADATA_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_METADATA_MENUITEM, MetadataMenuitem))
 
54
#define METADATA_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_METADATA_MENUITEM, MetadataMenuitemClass))
 
55
#define IS_METADATA_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_METADATA_MENUITEM))
 
56
#define IS_METADATA_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_METADATA_MENUITEM))
 
57
#define METADATA_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_METADATA_MENUITEM, MetadataMenuitemClass))
 
58
 
 
59
typedef struct _MetadataMenuitem MetadataMenuitem;
 
60
typedef struct _MetadataMenuitemClass MetadataMenuitemClass;
 
61
typedef struct _MetadataMenuitemPrivate MetadataMenuitemPrivate;
 
62
 
 
63
#define TYPE_FETCH_FILE (fetch_file_get_type ())
 
64
#define FETCH_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FETCH_FILE, FetchFile))
 
65
#define FETCH_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FETCH_FILE, FetchFileClass))
 
66
#define IS_FETCH_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FETCH_FILE))
 
67
#define IS_FETCH_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FETCH_FILE))
 
68
#define FETCH_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FETCH_FILE, FetchFileClass))
 
69
 
 
70
typedef struct _FetchFile FetchFile;
 
71
typedef struct _FetchFileClass FetchFileClass;
 
72
#define _g_free0(var) (var = (g_free (var), NULL))
 
73
 
 
74
#define TYPE_PLAYER_CONTROLLER (player_controller_get_type ())
 
75
#define PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_CONTROLLER, PlayerController))
 
76
#define PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_CONTROLLER, PlayerControllerClass))
 
77
#define IS_PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_CONTROLLER))
 
78
#define IS_PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_CONTROLLER))
 
79
#define PLAYER_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_CONTROLLER, PlayerControllerClass))
 
80
 
 
81
typedef struct _PlayerController PlayerController;
 
82
typedef struct _PlayerControllerClass PlayerControllerClass;
 
83
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
 
84
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
 
85
typedef struct _PlayerControllerPrivate PlayerControllerPrivate;
 
86
 
 
87
#define TYPE_MPRIS2_CONTROLLER (mpris2_controller_get_type ())
 
88
#define MPRIS2_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS2_CONTROLLER, Mpris2Controller))
 
89
#define MPRIS2_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS2_CONTROLLER, Mpris2ControllerClass))
 
90
#define IS_MPRIS2_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS2_CONTROLLER))
 
91
#define IS_MPRIS2_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS2_CONTROLLER))
 
92
#define MPRIS2_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS2_CONTROLLER, Mpris2ControllerClass))
 
93
 
 
94
typedef struct _Mpris2Controller Mpris2Controller;
 
95
typedef struct _Mpris2ControllerClass Mpris2ControllerClass;
 
96
 
 
97
#define PLAYER_CONTROLLER_TYPE_STATE (player_controller_state_get_type ())
 
98
 
 
99
struct _PlayerItem {
 
100
        DbusmenuMenuitem parent_instance;
 
101
        PlayerItemPrivate * priv;
 
102
};
 
103
 
 
104
struct _PlayerItemClass {
 
105
        DbusmenuMenuitemClass parent_class;
 
106
};
 
107
 
 
108
struct _MetadataMenuitem {
 
109
        PlayerItem parent_instance;
 
110
        MetadataMenuitemPrivate * priv;
 
111
};
 
112
 
 
113
struct _MetadataMenuitemClass {
 
114
        PlayerItemClass parent_class;
 
115
};
 
116
 
 
117
struct _MetadataMenuitemPrivate {
 
118
        gchar* previous_temp_album_art_path;
 
119
};
 
120
 
 
121
struct _PlayerController {
 
122
        GObject parent_instance;
 
123
        PlayerControllerPrivate * priv;
 
124
        gint current_state;
 
125
        DbusmenuMenuitem* root_menu;
 
126
        GeeArrayList* custom_items;
 
127
        Mpris2Controller* mpris_bridge;
 
128
        gboolean* use_playlists;
 
129
};
 
130
 
 
131
struct _PlayerControllerClass {
 
132
        GObjectClass parent_class;
 
133
};
 
134
 
 
135
typedef enum  {
 
136
        PLAYER_CONTROLLER_STATE_OFFLINE,
 
137
        PLAYER_CONTROLLER_STATE_INSTANTIATING,
 
138
        PLAYER_CONTROLLER_STATE_READY,
 
139
        PLAYER_CONTROLLER_STATE_CONNECTED,
 
140
        PLAYER_CONTROLLER_STATE_DISCONNECTED
 
141
} PlayerControllerstate;
 
142
 
 
143
 
 
144
static gpointer metadata_menuitem_parent_class = NULL;
 
145
extern gchar* metadata_menuitem_album_art_cache_dir;
 
146
gchar* metadata_menuitem_album_art_cache_dir = NULL;
 
147
static FetchFile* metadata_menuitem_fetcher;
 
148
static FetchFile* metadata_menuitem_fetcher = NULL;
 
149
 
 
150
GType player_item_get_type (void) G_GNUC_CONST;
 
151
GType metadata_menuitem_get_type (void) G_GNUC_CONST;
 
152
#define METADATA_MENUITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_METADATA_MENUITEM, MetadataMenuitemPrivate))
 
153
enum  {
 
154
        METADATA_MENUITEM_DUMMY_PROPERTY
 
155
};
 
156
GType fetch_file_get_type (void) G_GNUC_CONST;
 
157
#define METADATA_MENUITEM_ALBUM_ART_DIR_SUFFIX "indicator/sound/album-art-cache"
 
158
GType player_controller_get_type (void) G_GNUC_CONST;
 
159
MetadataMenuitem* metadata_menuitem_new (PlayerController* parent);
 
160
MetadataMenuitem* metadata_menuitem_construct (GType object_type, PlayerController* parent);
 
161
static void metadata_menuitem_clean_album_art_temp_dir (void);
 
162
static gboolean metadata_menuitem_delete_album_art_contents (GFile* dir);
 
163
static gchar* metadata_menuitem_create_album_art_temp_dir (void);
 
164
void metadata_menuitem_fetch_art (MetadataMenuitem* self, const gchar* uri, const gchar* prop);
 
165
#define PLAYER_ITEM_EMPTY (-1)
 
166
FetchFile* fetch_file_new (const gchar* uri, const gchar* prop);
 
167
FetchFile* fetch_file_construct (GType object_type, const gchar* uri, const gchar* prop);
 
168
static void __lambda2_ (MetadataMenuitem* self);
 
169
static void metadata_menuitem_on_fetcher_failed (MetadataMenuitem* self);
 
170
static void ___lambda2__fetch_file_failed (FetchFile* _sender, gpointer self);
 
171
static void metadata_menuitem_on_fetcher_completed (MetadataMenuitem* self, GByteArray* update, const gchar* property);
 
172
static void _metadata_menuitem_on_fetcher_completed_fetch_file_completed (FetchFile* _sender, GByteArray* data, const gchar* property, gpointer self);
 
173
void fetch_file_fetch_data (FetchFile* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
174
void fetch_file_fetch_data_finish (FetchFile* self, GAsyncResult* _res_);
 
175
static void metadata_menuitem_real_handle_event (DbusmenuMenuitem* base, const gchar* name, GVariant* input_value, guint timestamp);
 
176
PlayerController* player_item_get_owner (PlayerItem* self);
 
177
GType mpris2_controller_get_type (void) G_GNUC_CONST;
 
178
GType player_controller_state_get_type (void) G_GNUC_CONST;
 
179
void player_controller_instantiate (PlayerController* self);
 
180
void mpris2_controller_expose (Mpris2Controller* self);
 
181
void metadata_menuitem_alter_label (MetadataMenuitem* self, const gchar* new_title);
 
182
void metadata_menuitem_toggle_active_triangle (MetadataMenuitem* self, gboolean update);
 
183
void metadata_menuitem_should_collapse (MetadataMenuitem* self, gboolean collapse);
 
184
GeeHashSet* metadata_menuitem_attributes_format (void);
 
185
GeeHashSet* metadata_menuitem_relevant_attributes_for_ui (void);
 
186
static GObject * metadata_menuitem_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
 
187
GAppInfo* player_controller_get_app_info (PlayerController* self);
 
188
const gchar* player_controller_get_icon_name (PlayerController* self);
 
189
void player_item_reset (PlayerItem* self, GeeHashSet* attrs);
 
190
static void metadata_menuitem_finalize (GObject* obj);
 
191
 
 
192
 
 
193
MetadataMenuitem* metadata_menuitem_construct (GType object_type, PlayerController* parent) {
 
194
        MetadataMenuitem * self = NULL;
 
195
        PlayerController* _tmp0_;
 
196
        g_return_val_if_fail (parent != NULL, NULL);
 
197
        _tmp0_ = parent;
 
198
        self = (MetadataMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_METADATA_MENUITEM_TYPE, "owner", _tmp0_, NULL);
 
199
        return self;
 
200
}
 
201
 
 
202
 
 
203
MetadataMenuitem* metadata_menuitem_new (PlayerController* parent) {
 
204
        return metadata_menuitem_construct (TYPE_METADATA_MENUITEM, parent);
 
205
}
 
206
 
 
207
 
 
208
static void metadata_menuitem_clean_album_art_temp_dir (void) {
 
209
        const gchar* _tmp0_ = NULL;
 
210
        gchar* _tmp1_ = NULL;
 
211
        gchar* path;
 
212
        const gchar* _tmp2_;
 
213
        GFile* _tmp3_ = NULL;
 
214
        GFile* album_art_dir;
 
215
        GFile* _tmp4_;
 
216
        gboolean _tmp5_ = FALSE;
 
217
        _tmp0_ = g_get_user_cache_dir ();
 
218
        _tmp1_ = g_build_filename (_tmp0_, METADATA_MENUITEM_ALBUM_ART_DIR_SUFFIX, NULL);
 
219
        path = _tmp1_;
 
220
        _tmp2_ = path;
 
221
        _tmp3_ = g_file_new_for_path (_tmp2_);
 
222
        album_art_dir = _tmp3_;
 
223
        _tmp4_ = album_art_dir;
 
224
        _tmp5_ = metadata_menuitem_delete_album_art_contents (_tmp4_);
 
225
        if (_tmp5_ == FALSE) {
 
226
                const gchar* _tmp6_;
 
227
                _tmp6_ = path;
 
228
                g_warning ("metadata-menu-item.vala:58: could not remove the temp album art files " \
 
229
"%s", _tmp6_);
 
230
        }
 
231
        _g_object_unref0 (album_art_dir);
 
232
        _g_free0 (path);
 
233
}
 
234
 
 
235
 
 
236
static gchar* metadata_menuitem_create_album_art_temp_dir (void) {
 
237
        gchar* result = NULL;
 
238
        const gchar* _tmp0_ = NULL;
 
239
        gchar* _tmp1_ = NULL;
 
240
        gchar* path;
 
241
        const gchar* _tmp2_;
 
242
        gint _tmp3_ = 0;
 
243
        _tmp0_ = g_get_user_cache_dir ();
 
244
        _tmp1_ = g_build_filename (_tmp0_, METADATA_MENUITEM_ALBUM_ART_DIR_SUFFIX, NULL);
 
245
        path = _tmp1_;
 
246
        _tmp2_ = path;
 
247
        _tmp3_ = g_mkdir_with_parents (_tmp2_, 0700);
 
248
        if (_tmp3_ == (-1)) {
 
249
                const gchar* _tmp4_;
 
250
                _tmp4_ = path;
 
251
                g_warning ("metadata-menu-item.vala:66: could not create temp dir %s for remote al" \
 
252
"bum art, it must have been created already", _tmp4_);
 
253
        }
 
254
        result = path;
 
255
        return result;
 
256
}
 
257
 
 
258
 
 
259
static const gchar* string_to_string (const gchar* self) {
 
260
        const gchar* result = NULL;
 
261
        g_return_val_if_fail (self != NULL, NULL);
 
262
        result = self;
 
263
        return result;
 
264
}
 
265
 
 
266
 
 
267
static gboolean metadata_menuitem_delete_album_art_contents (GFile* dir) {
 
268
        gboolean result = FALSE;
 
269
        gboolean _result_;
 
270
        GError * _inner_error_ = NULL;
 
271
        g_return_val_if_fail (dir != NULL, FALSE);
 
272
        _result_ = TRUE;
 
273
        {
 
274
                GFile* _tmp0_;
 
275
                GFileEnumerator* _tmp1_ = NULL;
 
276
                GFileEnumerator* e;
 
277
                _tmp0_ = dir;
 
278
                _tmp1_ = g_file_enumerate_children (_tmp0_, G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &_inner_error_);
 
279
                e = _tmp1_;
 
280
                if (_inner_error_ != NULL) {
 
281
                        goto __catch3_g_error;
 
282
                }
 
283
                while (TRUE) {
 
284
                        GFileEnumerator* _tmp2_;
 
285
                        GFileInfo* _tmp3_ = NULL;
 
286
                        GFileInfo* file;
 
287
                        GFileInfo* _tmp4_;
 
288
                        GFileInfo* _tmp5_;
 
289
                        const gchar* _tmp6_ = NULL;
 
290
                        GFile* _tmp7_;
 
291
                        GFileInfo* _tmp8_;
 
292
                        const gchar* _tmp9_ = NULL;
 
293
                        GFile* _tmp10_ = NULL;
 
294
                        GFile* child;
 
295
                        _tmp2_ = e;
 
296
                        _tmp3_ = g_file_enumerator_next_file (_tmp2_, NULL, &_inner_error_);
 
297
                        file = _tmp3_;
 
298
                        if (_inner_error_ != NULL) {
 
299
                                _g_object_unref0 (e);
 
300
                                goto __catch3_g_error;
 
301
                        }
 
302
                        _tmp4_ = file;
 
303
                        if (_tmp4_ == NULL) {
 
304
                                _g_object_unref0 (file);
 
305
                                break;
 
306
                        }
 
307
                        _tmp5_ = file;
 
308
                        _tmp6_ = g_file_info_get_name (_tmp5_);
 
309
                        g_debug ("metadata-menu-item.vala:85: file name = %s", _tmp6_);
 
310
                        _tmp7_ = dir;
 
311
                        _tmp8_ = file;
 
312
                        _tmp9_ = g_file_info_get_name (_tmp8_);
 
313
                        _tmp10_ = g_file_get_child (_tmp7_, _tmp9_);
 
314
                        child = _tmp10_;
 
315
                        {
 
316
                                GFile* _tmp11_;
 
317
                                _tmp11_ = child;
 
318
                                g_file_delete (_tmp11_, NULL, &_inner_error_);
 
319
                                if (_inner_error_ != NULL) {
 
320
                                        goto __catch4_g_error;
 
321
                                }
 
322
                        }
 
323
                        goto __finally4;
 
324
                        __catch4_g_error:
 
325
                        {
 
326
                                GError* error_ = NULL;
 
327
                                GFile* _tmp12_;
 
328
                                gchar* _tmp13_ = NULL;
 
329
                                gchar* _tmp14_;
 
330
                                const gchar* _tmp15_ = NULL;
 
331
                                GError* _tmp16_;
 
332
                                const gchar* _tmp17_;
 
333
                                const gchar* _tmp18_ = NULL;
 
334
                                gchar* _tmp19_ = NULL;
 
335
                                gchar* _tmp20_;
 
336
                                error_ = _inner_error_;
 
337
                                _inner_error_ = NULL;
 
338
                                _tmp12_ = child;
 
339
                                _tmp13_ = g_file_get_basename (_tmp12_);
 
340
                                _tmp14_ = _tmp13_;
 
341
                                _tmp15_ = string_to_string (_tmp14_);
 
342
                                _tmp16_ = error_;
 
343
                                _tmp17_ = _tmp16_->message;
 
344
                                _tmp18_ = string_to_string (_tmp17_);
 
345
                                _tmp19_ = g_strconcat ("Unable to delete file '", _tmp15_, ": ", _tmp18_, NULL);
 
346
                                _tmp20_ = _tmp19_;
 
347
                                g_warning ("metadata-menu-item.vala:92: %s", _tmp20_);
 
348
                                _g_free0 (_tmp20_);
 
349
                                _g_free0 (_tmp14_);
 
350
                                _result_ = FALSE;
 
351
                                _g_error_free0 (error_);
 
352
                        }
 
353
                        __finally4:
 
354
                        if (_inner_error_ != NULL) {
 
355
                                _g_object_unref0 (child);
 
356
                                _g_object_unref0 (file);
 
357
                                _g_object_unref0 (e);
 
358
                                goto __catch3_g_error;
 
359
                        }
 
360
                        _g_object_unref0 (child);
 
361
                        _g_object_unref0 (file);
 
362
                }
 
363
                _g_object_unref0 (e);
 
364
        }
 
365
        goto __finally3;
 
366
        __catch3_g_error:
 
367
        {
 
368
                GError* _error_ = NULL;
 
369
                GFile* _tmp21_;
 
370
                gchar* _tmp22_ = NULL;
 
371
                gchar* _tmp23_;
 
372
                const gchar* _tmp24_ = NULL;
 
373
                gchar* _tmp25_ = NULL;
 
374
                gchar* _tmp26_;
 
375
                GError* _tmp27_;
 
376
                const gchar* _tmp28_;
 
377
                _error_ = _inner_error_;
 
378
                _inner_error_ = NULL;
 
379
                _tmp21_ = dir;
 
380
                _tmp22_ = g_file_get_basename (_tmp21_);
 
381
                _tmp23_ = _tmp22_;
 
382
                _tmp24_ = string_to_string (_tmp23_);
 
383
                _tmp25_ = g_strconcat ("Unable to read files from directory '", _tmp24_, "': %s", NULL);
 
384
                _tmp26_ = _tmp25_;
 
385
                _tmp27_ = _error_;
 
386
                _tmp28_ = _tmp27_->message;
 
387
                g_warning (_tmp26_, _tmp28_);
 
388
                _g_free0 (_tmp26_);
 
389
                _g_free0 (_tmp23_);
 
390
                _result_ = FALSE;
 
391
                _g_error_free0 (_error_);
 
392
        }
 
393
        __finally3:
 
394
        if (_inner_error_ != NULL) {
 
395
                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);
 
396
                g_clear_error (&_inner_error_);
 
397
                return FALSE;
 
398
        }
 
399
        result = _result_;
 
400
        return result;
 
401
}
 
402
 
 
403
 
 
404
static gchar* string_strip (const gchar* self) {
 
405
        gchar* result = NULL;
 
406
        gchar* _tmp0_ = NULL;
 
407
        gchar* _result_;
 
408
        const gchar* _tmp1_;
 
409
        g_return_val_if_fail (self != NULL, NULL);
 
410
        _tmp0_ = g_strdup (self);
 
411
        _result_ = _tmp0_;
 
412
        _tmp1_ = _result_;
 
413
        g_strstrip (_tmp1_);
 
414
        result = _result_;
 
415
        return result;
 
416
}
 
417
 
 
418
 
 
419
static void __lambda2_ (MetadataMenuitem* self) {
 
420
        metadata_menuitem_on_fetcher_failed (self);
 
421
}
 
422
 
 
423
 
 
424
static void ___lambda2__fetch_file_failed (FetchFile* _sender, gpointer self) {
 
425
        __lambda2_ (self);
 
426
}
 
427
 
 
428
 
 
429
static void _metadata_menuitem_on_fetcher_completed_fetch_file_completed (FetchFile* _sender, GByteArray* data, const gchar* property, gpointer self) {
 
430
        metadata_menuitem_on_fetcher_completed (self, data, property);
 
431
}
 
432
 
 
433
 
 
434
void metadata_menuitem_fetch_art (MetadataMenuitem* self, const gchar* uri, const gchar* prop) {
 
435
        const gchar* _tmp0_;
 
436
        GFile* _tmp1_ = NULL;
 
437
        GFile* art_file;
 
438
        GFile* _tmp2_;
 
439
        gboolean _tmp3_ = FALSE;
 
440
        const gchar* _tmp19_;
 
441
        const gchar* _tmp20_;
 
442
        const gchar* _tmp21_;
 
443
        const gchar* _tmp22_;
 
444
        FetchFile* _tmp23_;
 
445
        FetchFile* _tmp24_;
 
446
        FetchFile* _tmp25_;
 
447
        FetchFile* _tmp26_;
 
448
        GError * _inner_error_ = NULL;
 
449
        g_return_if_fail (self != NULL);
 
450
        g_return_if_fail (uri != NULL);
 
451
        g_return_if_fail (prop != NULL);
 
452
        _tmp0_ = uri;
 
453
        _tmp1_ = g_file_new_for_uri (_tmp0_);
 
454
        art_file = _tmp1_;
 
455
        _tmp2_ = art_file;
 
456
        _tmp3_ = g_file_is_native (_tmp2_);
 
457
        if (_tmp3_ == TRUE) {
 
458
                GFile* _tmp4_;
 
459
                gboolean _tmp5_ = FALSE;
 
460
                gchar* path = NULL;
 
461
                _tmp4_ = art_file;
 
462
                _tmp5_ = g_file_query_exists (_tmp4_, NULL);
 
463
                if (_tmp5_ == FALSE) {
 
464
                        const gchar* _tmp6_;
 
465
                        _tmp6_ = prop;
 
466
                        dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, _tmp6_, PLAYER_ITEM_EMPTY);
 
467
                        _g_object_unref0 (art_file);
 
468
                        return;
 
469
                }
 
470
                {
 
471
                        const gchar* _tmp7_;
 
472
                        gchar* _tmp8_ = NULL;
 
473
                        gchar* _tmp9_;
 
474
                        gchar* _tmp10_ = NULL;
 
475
                        gchar* _tmp11_;
 
476
                        gchar* _tmp12_;
 
477
                        const gchar* _tmp13_;
 
478
                        gchar* _tmp14_ = NULL;
 
479
                        gchar* _tmp15_;
 
480
                        const gchar* _tmp16_;
 
481
                        const gchar* _tmp17_;
 
482
                        _tmp7_ = uri;
 
483
                        _tmp8_ = string_strip (_tmp7_);
 
484
                        _tmp9_ = _tmp8_;
 
485
                        _tmp10_ = g_filename_from_uri (_tmp9_, NULL, &_inner_error_);
 
486
                        _tmp11_ = _tmp10_;
 
487
                        _g_free0 (_tmp9_);
 
488
                        _tmp12_ = _tmp11_;
 
489
                        if (_inner_error_ != NULL) {
 
490
                                if (_inner_error_->domain == G_CONVERT_ERROR) {
 
491
                                        goto __catch5_g_convert_error;
 
492
                                }
 
493
                                _g_free0 (path);
 
494
                                _g_object_unref0 (art_file);
 
495
                                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);
 
496
                                g_clear_error (&_inner_error_);
 
497
                                return;
 
498
                        }
 
499
                        _g_free0 (path);
 
500
                        path = _tmp12_;
 
501
                        _tmp13_ = uri;
 
502
                        _tmp14_ = string_strip (_tmp13_);
 
503
                        _tmp15_ = _tmp14_;
 
504
                        g_debug ("metadata-menu-item.vala:116: Populating the artwork field with %s", _tmp15_);
 
505
                        _g_free0 (_tmp15_);
 
506
                        _tmp16_ = prop;
 
507
                        _tmp17_ = path;
 
508
                        dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, _tmp16_, _tmp17_);
 
509
                }
 
510
                goto __finally5;
 
511
                __catch5_g_convert_error:
 
512
                {
 
513
                        GError* e = NULL;
 
514
                        const gchar* _tmp18_;
 
515
                        e = _inner_error_;
 
516
                        _inner_error_ = NULL;
 
517
                        _tmp18_ = uri;
 
518
                        g_warning ("metadata-menu-item.vala:120: Problem converting URI %s to file path", _tmp18_);
 
519
                        _g_error_free0 (e);
 
520
                }
 
521
                __finally5:
 
522
                if (_inner_error_ != NULL) {
 
523
                        _g_free0 (path);
 
524
                        _g_object_unref0 (art_file);
 
525
                        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);
 
526
                        g_clear_error (&_inner_error_);
 
527
                        return;
 
528
                }
 
529
                _g_free0 (path);
 
530
                _g_object_unref0 (art_file);
 
531
                return;
 
532
        }
 
533
        _tmp19_ = metadata_menuitem_album_art_cache_dir;
 
534
        g_debug ("metadata-menu-item.vala:126: fetch_art -remotely %s", _tmp19_);
 
535
        _tmp20_ = metadata_menuitem_album_art_cache_dir;
 
536
        if (_tmp20_ == NULL) {
 
537
                _g_object_unref0 (art_file);
 
538
                return;
 
539
        }
 
540
        _tmp21_ = uri;
 
541
        _tmp22_ = prop;
 
542
        _tmp23_ = fetch_file_new (_tmp21_, _tmp22_);
 
543
        _g_object_unref0 (metadata_menuitem_fetcher);
 
544
        metadata_menuitem_fetcher = _tmp23_;
 
545
        _tmp24_ = metadata_menuitem_fetcher;
 
546
        g_signal_connect_object (_tmp24_, "failed", (GCallback) ___lambda2__fetch_file_failed, self, 0);
 
547
        _tmp25_ = metadata_menuitem_fetcher;
 
548
        g_signal_connect_object (_tmp25_, "completed", (GCallback) _metadata_menuitem_on_fetcher_completed_fetch_file_completed, self, 0);
 
549
        _tmp26_ = metadata_menuitem_fetcher;
 
550
        fetch_file_fetch_data (_tmp26_, NULL, NULL);
 
551
        _g_object_unref0 (art_file);
 
552
}
 
553
 
 
554
 
 
555
static void metadata_menuitem_on_fetcher_failed (MetadataMenuitem* self) {
 
556
        g_return_if_fail (self != NULL);
 
557
        g_warning ("metadata-menu-item.vala:141: on_fetcher_failed -> could not fetch artw" \
 
558
"ork");
 
559
}
 
560
 
 
561
 
 
562
static gpointer _g_object_ref0 (gpointer self) {
 
563
        return self ? g_object_ref (self) : NULL;
 
564
}
 
565
 
 
566
 
 
567
static void metadata_menuitem_on_fetcher_completed (MetadataMenuitem* self, GByteArray* update, const gchar* property) {
 
568
        GError * _inner_error_ = NULL;
 
569
        g_return_if_fail (self != NULL);
 
570
        g_return_if_fail (update != NULL);
 
571
        g_return_if_fail (property != NULL);
 
572
        {
 
573
                GdkPixbufLoader* _tmp0_;
 
574
                GdkPixbufLoader* loader;
 
575
                GdkPixbufLoader* _tmp1_;
 
576
                GByteArray* _tmp2_;
 
577
                guint8* _tmp3_;
 
578
                gint _tmp3__length1;
 
579
                GdkPixbufLoader* _tmp4_;
 
580
                GdkPixbufLoader* _tmp5_;
 
581
                GdkPixbuf* _tmp6_ = NULL;
 
582
                GdkPixbuf* _tmp7_;
 
583
                GdkPixbuf* icon;
 
584
                const gchar* _tmp8_;
 
585
                gchar* _tmp9_ = NULL;
 
586
                gchar* path;
 
587
                const gchar* _tmp10_;
 
588
                gint _tmp11_ = 0;
 
589
                gint r;
 
590
                gint _tmp12_;
 
591
                _tmp0_ = gdk_pixbuf_loader_new ();
 
592
                loader = _tmp0_;
 
593
                _tmp1_ = loader;
 
594
                _tmp2_ = update;
 
595
                _tmp3_ = _tmp2_->data;
 
596
                _tmp3__length1 = (gint) _tmp2_->len;
 
597
                gdk_pixbuf_loader_write (_tmp1_, _tmp3_, (gsize) _tmp3__length1, &_inner_error_);
 
598
                if (_inner_error_ != NULL) {
 
599
                        _g_object_unref0 (loader);
 
600
                        goto __catch6_g_error;
 
601
                }
 
602
                _tmp4_ = loader;
 
603
                gdk_pixbuf_loader_close (_tmp4_, &_inner_error_);
 
604
                if (_inner_error_ != NULL) {
 
605
                        _g_object_unref0 (loader);
 
606
                        goto __catch6_g_error;
 
607
                }
 
608
                _tmp5_ = loader;
 
609
                _tmp6_ = gdk_pixbuf_loader_get_pixbuf (_tmp5_);
 
610
                _tmp7_ = _g_object_ref0 (_tmp6_);
 
611
                icon = _tmp7_;
 
612
                _tmp8_ = metadata_menuitem_album_art_cache_dir;
 
613
                _tmp9_ = g_strconcat (_tmp8_, "/downloaded-coverart-XXXXXX", NULL);
 
614
                path = _tmp9_;
 
615
                _tmp10_ = path;
 
616
                _tmp11_ = g_mkstemp (_tmp10_);
 
617
                r = _tmp11_;
 
618
                _tmp12_ = r;
 
619
                if (_tmp12_ != (-1)) {
 
620
                        GdkPixbuf* _tmp13_;
 
621
                        const gchar* _tmp14_;
 
622
                        GdkPixbufLoader* _tmp15_;
 
623
                        GdkPixbufFormat* _tmp16_ = NULL;
 
624
                        gchar* _tmp17_ = NULL;
 
625
                        gchar* _tmp18_;
 
626
                        const gchar* _tmp19_;
 
627
                        const gchar* _tmp20_;
 
628
                        const gchar* _tmp21_;
 
629
                        const gchar* _tmp23_;
 
630
                        gchar* _tmp24_;
 
631
                        _tmp13_ = icon;
 
632
                        _tmp14_ = path;
 
633
                        _tmp15_ = loader;
 
634
                        _tmp16_ = gdk_pixbuf_loader_get_format (_tmp15_);
 
635
                        _tmp17_ = gdk_pixbuf_format_get_name (_tmp16_);
 
636
                        _tmp18_ = _tmp17_;
 
637
                        gdk_pixbuf_save (_tmp13_, _tmp14_, _tmp18_, &_inner_error_, NULL);
 
638
                        _g_free0 (_tmp18_);
 
639
                        if (_inner_error_ != NULL) {
 
640
                                _g_free0 (path);
 
641
                                _g_object_unref0 (icon);
 
642
                                _g_object_unref0 (loader);
 
643
                                goto __catch6_g_error;
 
644
                        }
 
645
                        _tmp19_ = property;
 
646
                        _tmp20_ = path;
 
647
                        dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, _tmp19_, _tmp20_);
 
648
                        _tmp21_ = self->priv->previous_temp_album_art_path;
 
649
                        if (_tmp21_ != NULL) {
 
650
                                const gchar* _tmp22_;
 
651
                                _tmp22_ = self->priv->previous_temp_album_art_path;
 
652
                                g_remove (_tmp22_);
 
653
                        }
 
654
                        _tmp23_ = path;
 
655
                        _tmp24_ = g_strdup (_tmp23_);
 
656
                        _g_free0 (self->priv->previous_temp_album_art_path);
 
657
                        self->priv->previous_temp_album_art_path = _tmp24_;
 
658
                }
 
659
                _g_free0 (path);
 
660
                _g_object_unref0 (icon);
 
661
                _g_object_unref0 (loader);
 
662
        }
 
663
        goto __finally6;
 
664
        __catch6_g_error:
 
665
        {
 
666
                GError* e = NULL;
 
667
                GError* _tmp25_;
 
668
                const gchar* _tmp26_;
 
669
                e = _inner_error_;
 
670
                _inner_error_ = NULL;
 
671
                _tmp25_ = e;
 
672
                _tmp26_ = _tmp25_->message;
 
673
                g_warning ("metadata-menu-item.vala:163: Problem creating file from bytearray fetc" \
 
674
"hed from the interweb - error: %s", _tmp26_);
 
675
                _g_error_free0 (e);
 
676
        }
 
677
        __finally6:
 
678
        if (_inner_error_ != NULL) {
 
679
                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);
 
680
                g_clear_error (&_inner_error_);
 
681
                return;
 
682
        }
 
683
}
 
684
 
 
685
 
 
686
static void metadata_menuitem_real_handle_event (DbusmenuMenuitem* base, const gchar* name, GVariant* input_value, guint timestamp) {
 
687
        MetadataMenuitem * self;
 
688
        PlayerController* _tmp0_;
 
689
        PlayerController* _tmp1_;
 
690
        gint _tmp2_;
 
691
        self = (MetadataMenuitem*) base;
 
692
        g_return_if_fail (name != NULL);
 
693
        g_return_if_fail (input_value != NULL);
 
694
        _tmp0_ = player_item_get_owner ((PlayerItem*) self);
 
695
        _tmp1_ = _tmp0_;
 
696
        _tmp2_ = _tmp1_->current_state;
 
697
        if (_tmp2_ == ((gint) PLAYER_CONTROLLER_STATE_OFFLINE)) {
 
698
                PlayerController* _tmp3_;
 
699
                PlayerController* _tmp4_;
 
700
                _tmp3_ = player_item_get_owner ((PlayerItem*) self);
 
701
                _tmp4_ = _tmp3_;
 
702
                player_controller_instantiate (_tmp4_);
 
703
        } else {
 
704
                PlayerController* _tmp5_;
 
705
                PlayerController* _tmp6_;
 
706
                gint _tmp7_;
 
707
                _tmp5_ = player_item_get_owner ((PlayerItem*) self);
 
708
                _tmp6_ = _tmp5_;
 
709
                _tmp7_ = _tmp6_->current_state;
 
710
                if (_tmp7_ == ((gint) PLAYER_CONTROLLER_STATE_CONNECTED)) {
 
711
                        PlayerController* _tmp8_;
 
712
                        PlayerController* _tmp9_;
 
713
                        Mpris2Controller* _tmp10_;
 
714
                        _tmp8_ = player_item_get_owner ((PlayerItem*) self);
 
715
                        _tmp9_ = _tmp8_;
 
716
                        _tmp10_ = _tmp9_->mpris_bridge;
 
717
                        mpris2_controller_expose (_tmp10_);
 
718
                }
 
719
        }
 
720
}
 
721
 
 
722
 
 
723
void metadata_menuitem_alter_label (MetadataMenuitem* self, const gchar* new_title) {
 
724
        const gchar* _tmp0_;
 
725
        const gchar* _tmp1_;
 
726
        g_return_if_fail (self != NULL);
 
727
        _tmp0_ = new_title;
 
728
        if (_tmp0_ == NULL) {
 
729
                return;
 
730
        }
 
731
        _tmp1_ = new_title;
 
732
        dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_PLAYER_NAME, _tmp1_);
 
733
}
 
734
 
 
735
 
 
736
void metadata_menuitem_toggle_active_triangle (MetadataMenuitem* self, gboolean update) {
 
737
        gboolean _tmp0_;
 
738
        g_return_if_fail (self != NULL);
 
739
        g_debug ("metadata-menu-item.vala:189: toggle active triangle");
 
740
        _tmp0_ = update;
 
741
        dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_PLAYER_RUNNING, _tmp0_);
 
742
}
 
743
 
 
744
 
 
745
void metadata_menuitem_should_collapse (MetadataMenuitem* self, gboolean collapse) {
 
746
        gboolean _tmp0_;
 
747
        g_return_if_fail (self != NULL);
 
748
        _tmp0_ = collapse;
 
749
        dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_HIDE_TRACK_DETAILS, _tmp0_);
 
750
}
 
751
 
 
752
 
 
753
GeeHashSet* metadata_menuitem_attributes_format (void) {
 
754
        GeeHashSet* result = NULL;
 
755
        GeeHashSet* _tmp0_;
 
756
        GeeHashSet* attrs;
 
757
        _tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
 
758
        attrs = _tmp0_;
 
759
        gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_TITLE);
 
760
        gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_ARTIST);
 
761
        gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_ALBUM);
 
762
        gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_ARTURL);
 
763
        gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_PLAYER_NAME);
 
764
        gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_PLAYER_ICON);
 
765
        gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_PLAYER_RUNNING);
 
766
        result = attrs;
 
767
        return result;
 
768
}
 
769
 
 
770
 
 
771
GeeHashSet* metadata_menuitem_relevant_attributes_for_ui (void) {
 
772
        GeeHashSet* result = NULL;
 
773
        GeeHashSet* _tmp0_;
 
774
        GeeHashSet* attrs;
 
775
        _tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
 
776
        attrs = _tmp0_;
 
777
        gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_TITLE);
 
778
        gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_ARTIST);
 
779
        gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_ALBUM);
 
780
        gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_ARTURL);
 
781
        result = attrs;
 
782
        return result;
 
783
}
 
784
 
 
785
 
 
786
static GObject * metadata_menuitem_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
 
787
        GObject * obj;
 
788
        GObjectClass * parent_class;
 
789
        MetadataMenuitem * self;
 
790
        gchar* _tmp0_ = NULL;
 
791
        PlayerController* _tmp1_;
 
792
        PlayerController* _tmp2_;
 
793
        GAppInfo* _tmp3_;
 
794
        GAppInfo* _tmp4_;
 
795
        const gchar* _tmp5_ = NULL;
 
796
        PlayerController* _tmp6_;
 
797
        PlayerController* _tmp7_;
 
798
        const gchar* _tmp8_;
 
799
        const gchar* _tmp9_;
 
800
        GeeHashSet* _tmp10_ = NULL;
 
801
        GeeHashSet* _tmp11_;
 
802
        parent_class = G_OBJECT_CLASS (metadata_menuitem_parent_class);
 
803
        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
 
804
        self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_METADATA_MENUITEM, MetadataMenuitem);
 
805
        metadata_menuitem_clean_album_art_temp_dir ();
 
806
        _g_free0 (self->priv->previous_temp_album_art_path);
 
807
        self->priv->previous_temp_album_art_path = NULL;
 
808
        _tmp0_ = metadata_menuitem_create_album_art_temp_dir ();
 
809
        _g_free0 (metadata_menuitem_album_art_cache_dir);
 
810
        metadata_menuitem_album_art_cache_dir = _tmp0_;
 
811
        _tmp1_ = player_item_get_owner ((PlayerItem*) self);
 
812
        _tmp2_ = _tmp1_;
 
813
        _tmp3_ = player_controller_get_app_info (_tmp2_);
 
814
        _tmp4_ = _tmp3_;
 
815
        _tmp5_ = g_app_info_get_name (_tmp4_);
 
816
        dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_PLAYER_NAME, _tmp5_);
 
817
        _tmp6_ = player_item_get_owner ((PlayerItem*) self);
 
818
        _tmp7_ = _tmp6_;
 
819
        _tmp8_ = player_controller_get_icon_name (_tmp7_);
 
820
        _tmp9_ = _tmp8_;
 
821
        dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_PLAYER_ICON, _tmp9_);
 
822
        dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_PLAYER_RUNNING, FALSE);
 
823
        dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_HIDE_TRACK_DETAILS, TRUE);
 
824
        _tmp10_ = metadata_menuitem_relevant_attributes_for_ui ();
 
825
        _tmp11_ = _tmp10_;
 
826
        player_item_reset ((PlayerItem*) self, _tmp11_);
 
827
        _g_object_unref0 (_tmp11_);
 
828
        return obj;
 
829
}
 
830
 
 
831
 
 
832
static void metadata_menuitem_class_init (MetadataMenuitemClass * klass) {
 
833
        metadata_menuitem_parent_class = g_type_class_peek_parent (klass);
 
834
        g_type_class_add_private (klass, sizeof (MetadataMenuitemPrivate));
 
835
        DBUSMENU_MENUITEM_CLASS (klass)->handle_event = metadata_menuitem_real_handle_event;
 
836
        G_OBJECT_CLASS (klass)->constructor = metadata_menuitem_constructor;
 
837
        G_OBJECT_CLASS (klass)->finalize = metadata_menuitem_finalize;
 
838
}
 
839
 
 
840
 
 
841
static void metadata_menuitem_instance_init (MetadataMenuitem * self) {
 
842
        self->priv = METADATA_MENUITEM_GET_PRIVATE (self);
 
843
}
 
844
 
 
845
 
 
846
static void metadata_menuitem_finalize (GObject* obj) {
 
847
        MetadataMenuitem * self;
 
848
        self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_METADATA_MENUITEM, MetadataMenuitem);
 
849
        _g_free0 (self->priv->previous_temp_album_art_path);
 
850
        G_OBJECT_CLASS (metadata_menuitem_parent_class)->finalize (obj);
 
851
}
 
852
 
 
853
 
 
854
GType metadata_menuitem_get_type (void) {
 
855
        static volatile gsize metadata_menuitem_type_id__volatile = 0;
 
856
        if (g_once_init_enter (&metadata_menuitem_type_id__volatile)) {
 
857
                static const GTypeInfo g_define_type_info = { sizeof (MetadataMenuitemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) metadata_menuitem_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MetadataMenuitem), 0, (GInstanceInitFunc) metadata_menuitem_instance_init, NULL };
 
858
                GType metadata_menuitem_type_id;
 
859
                metadata_menuitem_type_id = g_type_register_static (TYPE_PLAYER_ITEM, "MetadataMenuitem", &g_define_type_info, 0);
 
860
                g_once_init_leave (&metadata_menuitem_type_id__volatile, metadata_menuitem_type_id);
 
861
        }
 
862
        return metadata_menuitem_type_id__volatile;
 
863
}
 
864
 
 
865
 
 
866