aboutsummaryrefslogtreecommitdiff
path: root/src/player-item.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/player-item.c')
-rw-r--r--src/player-item.c296
1 files changed, 97 insertions, 199 deletions
diff --git a/src/player-item.c b/src/player-item.c
index e9b7759..92f4e10 100644
--- a/src/player-item.c
+++ b/src/player-item.c
@@ -1,4 +1,4 @@
-/* player-item.c generated by valac 0.14.0, the Vala compiler
+/* player-item.c generated by valac 0.12.1, the Vala compiler
* generated from player-item.vala, do not modify */
/*
@@ -116,10 +116,8 @@ static gint _vala_array_length (gpointer array);
PlayerItem* player_item_construct (GType object_type, const gchar* type) {
PlayerItem * self = NULL;
- const gchar* _tmp0_;
g_return_val_if_fail (type != NULL, NULL);
- _tmp0_ = type;
- self = (PlayerItem*) g_object_new (object_type, "item-type", _tmp0_, NULL);
+ self = (PlayerItem*) g_object_new (object_type, "item-type", type, NULL);
return self;
}
@@ -133,29 +131,21 @@ void player_item_reset (PlayerItem* self, GeeHashSet* attrs) {
g_return_if_fail (self != NULL);
g_return_if_fail (attrs != NULL);
{
- GeeHashSet* _tmp0_;
- GeeIterator* _tmp1_ = NULL;
+ GeeIterator* _tmp0_ = NULL;
GeeIterator* _s_it;
- _tmp0_ = attrs;
- _tmp1_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _tmp0_);
- _s_it = _tmp1_;
+ _tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) attrs);
+ _s_it = _tmp0_;
while (TRUE) {
- GeeIterator* _tmp2_;
- gboolean _tmp3_ = FALSE;
- GeeIterator* _tmp4_;
- gpointer _tmp5_ = NULL;
+ gboolean _tmp1_;
+ gpointer _tmp2_ = NULL;
gchar* s;
- const gchar* _tmp6_;
- _tmp2_ = _s_it;
- _tmp3_ = gee_iterator_next (_tmp2_);
- if (!_tmp3_) {
+ _tmp1_ = gee_iterator_next (_s_it);
+ if (!_tmp1_) {
break;
}
- _tmp4_ = _s_it;
- _tmp5_ = gee_iterator_get (_tmp4_);
- s = (gchar*) _tmp5_;
- _tmp6_ = s;
- dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, _tmp6_, PLAYER_ITEM_EMPTY);
+ _tmp2_ = gee_iterator_get (_s_it);
+ s = (gchar*) _tmp2_;
+ dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, s, PLAYER_ITEM_EMPTY);
_g_free0 (s);
}
_g_object_unref0 (_s_it);
@@ -178,12 +168,10 @@ static gchar* string_strip (const gchar* self) {
gchar* result = NULL;
gchar* _tmp0_ = NULL;
gchar* _result_;
- const gchar* _tmp1_;
g_return_val_if_fail (self != NULL, NULL);
_tmp0_ = g_strdup (self);
_result_ = _tmp0_;
- _tmp1_ = _result_;
- g_strstrip (_tmp1_);
+ g_strstrip (_result_);
result = _result_;
return result;
}
@@ -191,13 +179,11 @@ static gchar* string_strip (const gchar* self) {
static gboolean string_contains (const gchar* self, const gchar* needle) {
gboolean result = FALSE;
- const gchar* _tmp0_;
- gchar* _tmp1_ = NULL;
+ gchar* _tmp0_ = NULL;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (needle != NULL, FALSE);
- _tmp0_ = needle;
- _tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_);
- result = _tmp1_ != NULL;
+ _tmp0_ = strstr ((gchar*) self, (gchar*) needle);
+ result = _tmp0_ != NULL;
return result;
}
@@ -208,118 +194,74 @@ static gpointer _g_object_ref0 (gpointer self) {
void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attributes) {
- GHashTable* _tmp0_;
g_return_if_fail (self != NULL);
g_return_if_fail (data != NULL);
g_return_if_fail (attributes != NULL);
- _tmp0_ = data;
- if (_tmp0_ == NULL) {
+ if (data == NULL) {
g_warning ("player-item.vala:54: PlayerItem::Update -> The hashtable was null - ju" \
"st leave it!");
return;
}
{
- GeeHashSet* _tmp1_;
- GeeIterator* _tmp2_ = NULL;
+ GeeIterator* _tmp0_ = NULL;
GeeIterator* _property_it;
- _tmp1_ = attributes;
- _tmp2_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _tmp1_);
- _property_it = _tmp2_;
+ _tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) attributes);
+ _property_it = _tmp0_;
while (TRUE) {
- GeeIterator* _tmp3_;
- gboolean _tmp4_ = FALSE;
- GeeIterator* _tmp5_;
- gpointer _tmp6_ = NULL;
+ gboolean _tmp1_;
+ gpointer _tmp2_ = NULL;
gchar* property;
- const gchar* _tmp7_;
- gchar** _tmp8_;
- gchar** _tmp9_ = NULL;
+ gchar** _tmp3_;
+ gchar** _tmp4_ = NULL;
gchar** input_keys;
gint input_keys_length1;
gint _input_keys_size_;
- gchar** _tmp10_;
- gint _tmp10__length1;
- gchar** _tmp11_;
- gint _tmp11__length1;
- gchar** _tmp12_;
- gint _tmp12__length1;
- const gchar* _tmp13_;
- gchar* _tmp14_;
+ gchar* _tmp5_;
gchar* search_key;
- GHashTable* _tmp15_;
- const gchar* _tmp16_;
- gconstpointer _tmp17_ = NULL;
- GVariant* _tmp18_;
+ gconstpointer _tmp6_ = NULL;
+ GVariant* _tmp7_;
GVariant* v;
- GVariant* _tmp19_;
- GVariant* _tmp20_;
- const GVariantType* _tmp21_;
- gboolean _tmp22_ = FALSE;
- _tmp3_ = _property_it;
- _tmp4_ = gee_iterator_next (_tmp3_);
- if (!_tmp4_) {
+ gboolean _tmp8_;
+ _tmp1_ = gee_iterator_next (_property_it);
+ if (!_tmp1_) {
break;
}
- _tmp5_ = _property_it;
- _tmp6_ = gee_iterator_get (_tmp5_);
- property = (gchar*) _tmp6_;
- _tmp7_ = property;
- _tmp9_ = _tmp8_ = g_strsplit (_tmp7_, "-", 0);
- input_keys = _tmp9_;
- input_keys_length1 = _vala_array_length (_tmp8_);
- _input_keys_size_ = input_keys_length1;
- _tmp10_ = input_keys;
- _tmp10__length1 = input_keys_length1;
- _tmp11_ = input_keys;
- _tmp11__length1 = input_keys_length1;
- _tmp12_ = input_keys;
- _tmp12__length1 = input_keys_length1;
- _tmp13_ = (_tmp10_ + (_tmp11__length1 - 1))[0];
- _tmp14_ = g_strdup (_tmp13_);
- search_key = _tmp14_;
- _tmp15_ = data;
- _tmp16_ = search_key;
- _tmp17_ = g_hash_table_lookup (_tmp15_, _tmp16_);
- _tmp18_ = _g_variant_ref0 ((GVariant*) _tmp17_);
- v = _tmp18_;
- _tmp19_ = v;
- if (_tmp19_ == NULL) {
+ _tmp2_ = gee_iterator_get (_property_it);
+ property = (gchar*) _tmp2_;
+ _tmp4_ = _tmp3_ = g_strsplit (property, "-", 0);
+ input_keys = _tmp4_;
+ input_keys_length1 = _vala_array_length (_tmp3_);
+ _input_keys_size_ = _vala_array_length (_tmp3_);
+ _tmp5_ = g_strdup ((input_keys + (input_keys_length1 - 1))[0]);
+ search_key = _tmp5_;
+ _tmp6_ = g_hash_table_lookup (data, search_key);
+ _tmp7_ = _g_variant_ref0 ((GVariant*) _tmp6_);
+ v = _tmp7_;
+ if (v == NULL) {
_g_variant_unref0 (v);
_g_free0 (search_key);
input_keys = (_vala_array_free (input_keys, input_keys_length1, (GDestroyNotify) g_free), NULL);
_g_free0 (property);
continue;
}
- _tmp20_ = v;
- _tmp21_ = G_VARIANT_TYPE_STRING;
- _tmp22_ = g_variant_is_of_type (_tmp20_, _tmp21_);
- if (_tmp22_) {
- GVariant* _tmp23_;
- const gchar* _tmp24_ = NULL;
- gchar* _tmp25_ = NULL;
+ _tmp8_ = g_variant_is_of_type (v, G_VARIANT_TYPE_STRING);
+ if (_tmp8_) {
+ const gchar* _tmp9_ = NULL;
+ gchar* _tmp10_ = NULL;
gchar* update;
- const gchar* _tmp26_;
- gboolean _tmp27_ = FALSE;
- const gchar* _tmp32_;
- const gchar* _tmp33_;
- _tmp23_ = v;
- _tmp24_ = g_variant_get_string (_tmp23_, NULL);
- _tmp25_ = string_strip (_tmp24_);
- update = _tmp25_;
- _tmp26_ = property;
- _tmp27_ = string_contains (_tmp26_, "mpris:artUrl");
- if (_tmp27_) {
- MetadataMenuitem* _tmp28_;
+ gboolean _tmp11_;
+ _tmp9_ = g_variant_get_string (v, NULL);
+ _tmp10_ = string_strip (_tmp9_);
+ update = _tmp10_;
+ _tmp11_ = string_contains (property, "mpris:artUrl");
+ if (_tmp11_) {
+ PlayerItem* _tmp12_;
+ MetadataMenuitem* _tmp13_;
MetadataMenuitem* metadata;
- MetadataMenuitem* _tmp29_;
- const gchar* _tmp30_;
- const gchar* _tmp31_;
- _tmp28_ = _g_object_ref0 (IS_METADATA_MENUITEM (self) ? ((MetadataMenuitem*) self) : NULL);
- metadata = _tmp28_;
- _tmp29_ = metadata;
- _tmp30_ = update;
- _tmp31_ = property;
- metadata_menuitem_fetch_art (_tmp29_, _tmp30_, _tmp31_);
+ _tmp12_ = self;
+ _tmp13_ = _g_object_ref0 (IS_METADATA_MENUITEM (_tmp12_) ? ((MetadataMenuitem*) _tmp12_) : NULL);
+ metadata = _tmp13_;
+ metadata_menuitem_fetch_art (metadata, update, property);
_g_object_unref0 (metadata);
_g_free0 (update);
_g_variant_unref0 (v);
@@ -328,55 +270,29 @@ void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attribu
_g_free0 (property);
continue;
}
- _tmp32_ = property;
- _tmp33_ = update;
- dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, _tmp32_, _tmp33_);
+ dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, property, update);
_g_free0 (update);
} else {
- GVariant* _tmp34_;
- const GVariantType* _tmp35_;
- gboolean _tmp36_ = FALSE;
- _tmp34_ = v;
- _tmp35_ = G_VARIANT_TYPE_INT32;
- _tmp36_ = g_variant_is_of_type (_tmp34_, _tmp35_);
- if (_tmp36_) {
- const gchar* _tmp37_;
- GVariant* _tmp38_;
- gint32 _tmp39_ = 0;
- _tmp37_ = property;
- _tmp38_ = v;
- _tmp39_ = g_variant_get_int32 (_tmp38_);
- dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, _tmp37_, (gint) _tmp39_);
+ gboolean _tmp14_;
+ _tmp14_ = g_variant_is_of_type (v, G_VARIANT_TYPE_INT32);
+ if (_tmp14_) {
+ gint32 _tmp15_;
+ _tmp15_ = g_variant_get_int32 (v);
+ dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, property, (gint) _tmp15_);
} else {
- GVariant* _tmp40_;
- const GVariantType* _tmp41_;
- gboolean _tmp42_ = FALSE;
- _tmp40_ = v;
- _tmp41_ = G_VARIANT_TYPE_INT64;
- _tmp42_ = g_variant_is_of_type (_tmp40_, _tmp41_);
- if (_tmp42_) {
- const gchar* _tmp43_;
- GVariant* _tmp44_;
- gint64 _tmp45_ = 0LL;
- _tmp43_ = property;
- _tmp44_ = v;
- _tmp45_ = g_variant_get_int64 (_tmp44_);
- dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, _tmp43_, (gint) _tmp45_);
+ gboolean _tmp16_;
+ _tmp16_ = g_variant_is_of_type (v, G_VARIANT_TYPE_INT64);
+ if (_tmp16_) {
+ gint64 _tmp17_;
+ _tmp17_ = g_variant_get_int64 (v);
+ dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, property, (gint) _tmp17_);
} else {
- GVariant* _tmp46_;
- const GVariantType* _tmp47_;
- gboolean _tmp48_ = FALSE;
- _tmp46_ = v;
- _tmp47_ = G_VARIANT_TYPE_BOOLEAN;
- _tmp48_ = g_variant_is_of_type (_tmp46_, _tmp47_);
- if (_tmp48_) {
- const gchar* _tmp49_;
- GVariant* _tmp50_;
- gboolean _tmp51_ = FALSE;
- _tmp49_ = property;
- _tmp50_ = v;
- _tmp51_ = g_variant_get_boolean (_tmp50_);
- dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, _tmp49_, _tmp51_);
+ gboolean _tmp18_;
+ _tmp18_ = g_variant_is_of_type (v, G_VARIANT_TYPE_BOOLEAN);
+ if (_tmp18_) {
+ gboolean _tmp19_;
+ _tmp19_ = g_variant_get_boolean (v);
+ dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, property, _tmp19_);
}
}
}
@@ -396,31 +312,23 @@ gboolean player_item_populated (PlayerItem* self, GeeHashSet* attrs) {
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (attrs != NULL, FALSE);
{
- GeeHashSet* _tmp0_;
- GeeIterator* _tmp1_ = NULL;
+ GeeIterator* _tmp0_ = NULL;
GeeIterator* _prop_it;
- _tmp0_ = attrs;
- _tmp1_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _tmp0_);
- _prop_it = _tmp1_;
+ _tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) attrs);
+ _prop_it = _tmp0_;
while (TRUE) {
- GeeIterator* _tmp2_;
- gboolean _tmp3_ = FALSE;
- GeeIterator* _tmp4_;
- gpointer _tmp5_ = NULL;
+ gboolean _tmp1_;
+ gpointer _tmp2_ = NULL;
gchar* prop;
- const gchar* _tmp6_;
- gint _tmp7_ = 0;
- _tmp2_ = _prop_it;
- _tmp3_ = gee_iterator_next (_tmp2_);
- if (!_tmp3_) {
+ gint _tmp3_;
+ _tmp1_ = gee_iterator_next (_prop_it);
+ if (!_tmp1_) {
break;
}
- _tmp4_ = _prop_it;
- _tmp5_ = gee_iterator_get (_tmp4_);
- prop = (gchar*) _tmp5_;
- _tmp6_ = prop;
- _tmp7_ = dbusmenu_menuitem_property_get_int ((DbusmenuMenuitem*) self, _tmp6_);
- if (_tmp7_ != PLAYER_ITEM_EMPTY) {
+ _tmp2_ = gee_iterator_get (_prop_it);
+ prop = (gchar*) _tmp2_;
+ _tmp3_ = dbusmenu_menuitem_property_get_int ((DbusmenuMenuitem*) self, prop);
+ if (_tmp3_ != PLAYER_ITEM_EMPTY) {
result = TRUE;
_g_free0 (prop);
_g_object_unref0 (_prop_it);
@@ -437,44 +345,36 @@ gboolean player_item_populated (PlayerItem* self, GeeHashSet* attrs) {
PlayerController* player_item_get_owner (PlayerItem* self) {
PlayerController* result;
- PlayerController* _tmp0_;
g_return_val_if_fail (self != NULL, NULL);
- _tmp0_ = self->priv->_owner;
- result = _tmp0_;
+ result = self->priv->_owner;
return result;
}
static void player_item_set_owner (PlayerItem* self, PlayerController* value) {
PlayerController* _tmp0_;
- PlayerController* _tmp1_;
g_return_if_fail (self != NULL);
- _tmp0_ = value;
- _tmp1_ = _g_object_ref0 (_tmp0_);
+ _tmp0_ = _g_object_ref0 (value);
_g_object_unref0 (self->priv->_owner);
- self->priv->_owner = _tmp1_;
+ self->priv->_owner = _tmp0_;
g_object_notify ((GObject *) self, "owner");
}
const gchar* player_item_get_item_type (PlayerItem* self) {
const gchar* result;
- const gchar* _tmp0_;
g_return_val_if_fail (self != NULL, NULL);
- _tmp0_ = self->priv->_item_type;
- result = _tmp0_;
+ result = self->priv->_item_type;
return result;
}
static void player_item_set_item_type (PlayerItem* self, const gchar* value) {
- const gchar* _tmp0_;
- gchar* _tmp1_;
+ gchar* _tmp0_;
g_return_if_fail (self != NULL);
- _tmp0_ = value;
- _tmp1_ = g_strdup (_tmp0_);
+ _tmp0_ = g_strdup (value);
_g_free0 (self->priv->_item_type);
- self->priv->_item_type = _tmp1_;
+ self->priv->_item_type = _tmp0_;
g_object_notify ((GObject *) self, "item-type");
}
@@ -483,12 +383,10 @@ static GObject * player_item_constructor (GType type, guint n_construct_properti
GObject * obj;
GObjectClass * parent_class;
PlayerItem * self;
- const gchar* _tmp0_;
parent_class = G_OBJECT_CLASS (player_item_parent_class);
obj = parent_class->constructor (type, n_construct_properties, construct_properties);
self = PLAYER_ITEM (obj);
- _tmp0_ = self->priv->_item_type;
- dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_MENUITEM_PROP_TYPE, _tmp0_);
+ dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_MENUITEM_PROP_TYPE, self->priv->_item_type);
return obj;
}