aboutsummaryrefslogtreecommitdiff
path: root/src/settings-manager.c
diff options
context:
space:
mode:
authorKen VanDine <ken.vandine@canonical.com>2011-10-28 09:45:22 -0400
committerKen VanDine <ken.vandine@canonical.com>2011-10-28 09:45:22 -0400
commit6c40e13a44770e9bda393e5b0b1ebefa6b8077d5 (patch)
tree8d5e2ee74ab2a728a2af4e514740266424b5b955 /src/settings-manager.c
parent3b17bc829e96005f2cd6897be7cf77fec37ef012 (diff)
parentef3495e8ca6aa257c2d3123a7b0a25067570b0de (diff)
downloadayatana-indicator-sound-6c40e13a44770e9bda393e5b0b1ebefa6b8077d5.tar.gz
ayatana-indicator-sound-6c40e13a44770e9bda393e5b0b1ebefa6b8077d5.tar.bz2
ayatana-indicator-sound-6c40e13a44770e9bda393e5b0b1ebefa6b8077d5.zip
Import upstream version 0.7.9.1
Diffstat (limited to 'src/settings-manager.c')
-rw-r--r--src/settings-manager.c215
1 files changed, 77 insertions, 138 deletions
diff --git a/src/settings-manager.c b/src/settings-manager.c
index 898e983..748cffe 100644
--- a/src/settings-manager.c
+++ b/src/settings-manager.c
@@ -1,4 +1,4 @@
-/* settings-manager.c generated by valac 0.14.0, the Vala compiler
+/* settings-manager.c generated by valac 0.12.1, the Vala compiler
* generated from settings-manager.vala, do not modify */
/*
@@ -94,20 +94,16 @@ SettingsManager* settings_manager_new (void) {
gchar** settings_manager_fetch_blacklist (SettingsManager* self, int* result_length1) {
gchar** result = NULL;
- GSettings* _tmp0_;
- gchar** _tmp1_;
- gchar** _tmp2_ = NULL;
- gchar** _tmp3_;
- gint _tmp3__length1;
+ gchar** _tmp0_;
+ gchar** _tmp1_ = NULL;
+ gchar** _tmp2_;
g_return_val_if_fail (self != NULL, NULL);
- _tmp0_ = self->priv->settings;
- _tmp2_ = _tmp1_ = g_settings_get_strv (_tmp0_, "blacklisted-media-players");
- _tmp3_ = _tmp2_;
- _tmp3__length1 = _vala_array_length (_tmp1_);
+ _tmp1_ = _tmp0_ = g_settings_get_strv (self->priv->settings, "blacklisted-media-players");
+ _tmp2_ = _tmp1_;
if (result_length1) {
- *result_length1 = _tmp3__length1;
+ *result_length1 = _vala_array_length (_tmp0_);
}
- result = _tmp3_;
+ result = _tmp2_;
return result;
}
@@ -125,83 +121,58 @@ static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gc
GeeArrayList* settings_manager_fetch_interested (SettingsManager* self) {
GeeArrayList* result = NULL;
- GSettings* _tmp0_;
- gchar** _tmp1_;
- gchar** _tmp2_ = NULL;
+ gchar** _tmp0_;
+ gchar** _tmp1_ = NULL;
gchar** blacklisted;
gint blacklisted_length1;
gint _blacklisted_size_;
- GSettings* _tmp3_;
- gchar** _tmp4_;
- gchar** _tmp5_ = NULL;
+ gchar** _tmp2_;
+ gchar** _tmp3_ = NULL;
gchar** interested;
gint interested_length1;
gint _interested_size_;
- GeeArrayList* _tmp6_;
+ GeeArrayList* _tmp4_ = NULL;
GeeArrayList* list;
- gchar** _tmp7_;
- gint _tmp7__length1;
g_return_val_if_fail (self != NULL, NULL);
- _tmp0_ = self->priv->settings;
- _tmp2_ = _tmp1_ = g_settings_get_strv (_tmp0_, "blacklisted-media-players");
- blacklisted = _tmp2_;
- blacklisted_length1 = _vala_array_length (_tmp1_);
- _blacklisted_size_ = blacklisted_length1;
- _tmp3_ = self->priv->settings;
- _tmp5_ = _tmp4_ = g_settings_get_strv (_tmp3_, "interested-media-players");
- interested = _tmp5_;
- interested_length1 = _vala_array_length (_tmp4_);
- _interested_size_ = interested_length1;
- _tmp6_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL);
- list = _tmp6_;
- _tmp7_ = interested;
- _tmp7__length1 = interested_length1;
+ _tmp1_ = _tmp0_ = g_settings_get_strv (self->priv->settings, "blacklisted-media-players");
+ blacklisted = _tmp1_;
+ blacklisted_length1 = _vala_array_length (_tmp0_);
+ _blacklisted_size_ = _vala_array_length (_tmp0_);
+ _tmp3_ = _tmp2_ = g_settings_get_strv (self->priv->settings, "interested-media-players");
+ interested = _tmp3_;
+ interested_length1 = _vala_array_length (_tmp2_);
+ _interested_size_ = _vala_array_length (_tmp2_);
+ _tmp4_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL);
+ list = _tmp4_;
{
- gchar** s_collection = NULL;
- gint s_collection_length1 = 0;
- gint _s_collection_size_ = 0;
- gint s_it = 0;
- s_collection = _tmp7_;
- s_collection_length1 = _tmp7__length1;
- for (s_it = 0; s_it < _tmp7__length1; s_it = s_it + 1) {
- gchar* _tmp8_;
- gchar* s = NULL;
- _tmp8_ = g_strdup (s_collection[s_it]);
- s = _tmp8_;
+ gchar** s_collection;
+ int s_collection_length1;
+ int s_it;
+ s_collection = interested;
+ s_collection_length1 = interested_length1;
+ for (s_it = 0; s_it < interested_length1; s_it = s_it + 1) {
+ gchar* _tmp5_;
+ gchar* s;
+ _tmp5_ = g_strdup (s_collection[s_it]);
+ s = _tmp5_;
{
- const gchar* _tmp9_;
- GeeArrayList* _tmp11_;
- const gchar* _tmp12_;
- gboolean _tmp13_ = FALSE;
- const gchar* _tmp14_;
- gchar** _tmp15_;
- gint _tmp15__length1;
- GeeArrayList* _tmp16_;
- const gchar* _tmp17_;
- _tmp9_ = s;
- if (g_strcmp0 (_tmp9_, "banshee-1") == 0) {
- gchar* _tmp10_;
- _tmp10_ = g_strdup ("banshee");
+ gboolean _tmp7_;
+ if (g_strcmp0 (s, "banshee-1") == 0) {
+ gchar* _tmp6_;
+ _tmp6_ = g_strdup ("banshee");
_g_free0 (s);
- s = _tmp10_;
+ s = _tmp6_;
}
- _tmp11_ = list;
- _tmp12_ = s;
- _tmp13_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp11_, _tmp12_);
- if (_tmp13_) {
+ _tmp7_ = gee_abstract_collection_contains ((GeeAbstractCollection*) list, s);
+ if (_tmp7_) {
_g_free0 (s);
continue;
}
- _tmp14_ = s;
- _tmp15_ = blacklisted;
- _tmp15__length1 = blacklisted_length1;
- if (_vala_string_array_contains (_tmp15_, _tmp15__length1, _tmp14_)) {
+ if (_vala_string_array_contains (blacklisted, blacklisted_length1, s)) {
_g_free0 (s);
continue;
}
- _tmp16_ = list;
- _tmp17_ = s;
- gee_abstract_collection_add ((GeeAbstractCollection*) _tmp16_, _tmp17_);
+ gee_abstract_collection_add ((GeeAbstractCollection*) list, s);
_g_free0 (s);
}
}
@@ -214,10 +185,8 @@ GeeArrayList* settings_manager_fetch_interested (SettingsManager* self) {
void settings_manager_clear_list (SettingsManager* self) {
- GSettings* _tmp0_;
g_return_if_fail (self != NULL);
- _tmp0_ = self->priv->settings;
- g_settings_reset (_tmp0_, "interested-media-players");
+ g_settings_reset (self->priv->settings, "interested-media-players");
}
@@ -232,49 +201,31 @@ static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* val
void settings_manager_add_interested (SettingsManager* self, const gchar* app_desktop_name) {
- GSettings* _tmp0_;
- gchar** _tmp1_;
- gchar** _tmp2_ = NULL;
+ gchar** _tmp0_;
+ gchar** _tmp1_ = NULL;
gchar** already_interested;
gint already_interested_length1;
gint _already_interested_size_;
- gchar** _tmp3_;
- gint _tmp3__length1;
- gchar** _tmp7_;
- gint _tmp7__length1;
- const gchar* _tmp8_;
- gchar* _tmp9_;
- GSettings* _tmp10_;
- gchar** _tmp11_;
- gint _tmp11__length1;
- GSettings* _tmp12_;
+ gchar* _tmp3_;
g_return_if_fail (self != NULL);
g_return_if_fail (app_desktop_name != NULL);
- _tmp0_ = self->priv->settings;
- _tmp2_ = _tmp1_ = g_settings_get_strv (_tmp0_, "interested-media-players");
- already_interested = _tmp2_;
- already_interested_length1 = _vala_array_length (_tmp1_);
- _already_interested_size_ = already_interested_length1;
- _tmp3_ = already_interested;
- _tmp3__length1 = already_interested_length1;
+ _tmp1_ = _tmp0_ = g_settings_get_strv (self->priv->settings, "interested-media-players");
+ already_interested = _tmp1_;
+ already_interested_length1 = _vala_array_length (_tmp0_);
+ _already_interested_size_ = _vala_array_length (_tmp0_);
{
- gchar** s_collection = NULL;
- gint s_collection_length1 = 0;
- gint _s_collection_size_ = 0;
- gint s_it = 0;
- s_collection = _tmp3_;
- s_collection_length1 = _tmp3__length1;
- for (s_it = 0; s_it < _tmp3__length1; s_it = s_it + 1) {
- gchar* _tmp4_;
- gchar* s = NULL;
- _tmp4_ = g_strdup (s_collection[s_it]);
- s = _tmp4_;
+ gchar** s_collection;
+ int s_collection_length1;
+ int s_it;
+ s_collection = already_interested;
+ s_collection_length1 = already_interested_length1;
+ for (s_it = 0; s_it < already_interested_length1; s_it = s_it + 1) {
+ gchar* _tmp2_;
+ gchar* s;
+ _tmp2_ = g_strdup (s_collection[s_it]);
+ s = _tmp2_;
{
- const gchar* _tmp5_;
- const gchar* _tmp6_;
- _tmp5_ = s;
- _tmp6_ = app_desktop_name;
- if (g_strcmp0 (_tmp5_, _tmp6_) == 0) {
+ if (g_strcmp0 (s, app_desktop_name) == 0) {
_g_free0 (s);
already_interested = (_vala_array_free (already_interested, already_interested_length1, (GDestroyNotify) g_free), NULL);
return;
@@ -283,34 +234,25 @@ void settings_manager_add_interested (SettingsManager* self, const gchar* app_de
}
}
}
- _tmp7_ = already_interested;
- _tmp7__length1 = already_interested_length1;
- _tmp8_ = app_desktop_name;
- _tmp9_ = g_strdup (_tmp8_);
- _vala_array_add1 (&already_interested, &already_interested_length1, &_already_interested_size_, _tmp9_);
- _tmp10_ = self->priv->settings;
- _tmp11_ = already_interested;
- _tmp11__length1 = already_interested_length1;
- g_settings_set_strv (_tmp10_, "interested-media-players", _tmp11_);
- _tmp12_ = self->priv->settings;
- g_settings_apply (_tmp12_);
+ _tmp3_ = g_strdup (app_desktop_name);
+ _vala_array_add1 (&already_interested, &already_interested_length1, &_already_interested_size_, _tmp3_);
+ g_settings_set_strv (self->priv->settings, "interested-media-players", already_interested);
+ g_settings_apply (self->priv->settings);
already_interested = (_vala_array_free (already_interested, already_interested_length1, (GDestroyNotify) g_free), NULL);
}
static void settings_manager_on_blacklist_event (SettingsManager* self) {
- GSettings* _tmp0_;
- gchar** _tmp1_;
- gchar** _tmp2_ = NULL;
- gchar** _tmp3_;
- gint _tmp3__length1;
+ gchar** _tmp0_;
+ gchar** _tmp1_ = NULL;
+ gchar** _tmp2_;
+ gint _tmp2__length1;
g_return_if_fail (self != NULL);
- _tmp0_ = self->priv->settings;
- _tmp2_ = _tmp1_ = g_settings_get_strv (_tmp0_, "blacklisted-media-players");
- _tmp3_ = _tmp2_;
- _tmp3__length1 = _vala_array_length (_tmp1_);
- g_signal_emit_by_name (self, "blacklist-updates", _tmp3_, _vala_array_length (_tmp1_));
- _tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_free), NULL);
+ _tmp1_ = _tmp0_ = g_settings_get_strv (self->priv->settings, "blacklisted-media-players");
+ _tmp2_ = _tmp1_;
+ _tmp2__length1 = _vala_array_length (_tmp0_);
+ g_signal_emit_by_name (self, "blacklist-updates", _tmp2_, _vala_array_length (_tmp0_));
+ _tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_free), NULL);
}
@@ -318,8 +260,7 @@ static void g_cclosure_user_marshal_VOID__BOXED_INT (GClosure * closure, GValue
typedef void (*GMarshalFunc_VOID__BOXED_INT) (gpointer data1, gpointer arg_1, gint arg_2, gpointer data2);
register GMarshalFunc_VOID__BOXED_INT callback;
register GCClosure * cc;
- register gpointer data1;
- register gpointer data2;
+ register gpointer data1, data2;
cc = (GCClosure *) closure;
g_return_if_fail (n_param_values == 3);
if (G_CCLOSURE_SWAP_DATA (closure)) {
@@ -343,16 +284,14 @@ static GObject * settings_manager_constructor (GType type, guint n_construct_pro
GObject * obj;
GObjectClass * parent_class;
SettingsManager * self;
- GSettings* _tmp0_;
- GSettings* _tmp1_;
+ GSettings* _tmp0_ = NULL;
parent_class = G_OBJECT_CLASS (settings_manager_parent_class);
obj = parent_class->constructor (type, n_construct_properties, construct_properties);
self = SETTINGS_MANAGER (obj);
_tmp0_ = g_settings_new ("com.canonical.indicators.sound");
_g_object_unref0 (self->priv->settings);
self->priv->settings = _tmp0_;
- _tmp1_ = self->priv->settings;
- g_signal_connect_object (_tmp1_, "changed::blacklisted-media-players", (GCallback) _settings_manager_on_blacklist_event_g_settings_changed, self, 0);
+ g_signal_connect_object (self->priv->settings, "changed::blacklisted-media-players", (GCallback) _settings_manager_on_blacklist_event_g_settings_changed, self, 0);
return obj;
}