aboutsummaryrefslogtreecommitdiff
path: root/src/settings-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings-manager.c')
-rw-r--r--src/settings-manager.c289
1 files changed, 212 insertions, 77 deletions
diff --git a/src/settings-manager.c b/src/settings-manager.c
index 52530ab..ede9947 100644
--- a/src/settings-manager.c
+++ b/src/settings-manager.c
@@ -1,4 +1,4 @@
-/* settings-manager.c generated by valac 0.12.1, the Vala compiler
+/* settings-manager.c generated by valac 0.14.2, the Vala compiler
* generated from settings-manager.vala, do not modify */
/*
@@ -68,6 +68,7 @@ gchar** settings_manager_fetch_blacklist (SettingsManager* self, int* result_len
GeeArrayList* settings_manager_fetch_interested (SettingsManager* self);
static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle);
void settings_manager_clear_list (SettingsManager* self);
+void settings_manager_remove_interested (SettingsManager* self, const gchar* app_desktop_name);
void settings_manager_add_interested (SettingsManager* self, const gchar* app_desktop_name);
static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value);
static void settings_manager_on_blacklist_event (SettingsManager* self);
@@ -94,16 +95,20 @@ SettingsManager* settings_manager_new (void) {
gchar** settings_manager_fetch_blacklist (SettingsManager* self, int* result_length1) {
gchar** result = NULL;
- gchar** _tmp0_;
- gchar** _tmp1_ = NULL;
- gchar** _tmp2_;
+ GSettings* _tmp0_;
+ gchar** _tmp1_;
+ gchar** _tmp2_ = NULL;
+ gchar** _tmp3_;
+ gint _tmp3__length1;
g_return_val_if_fail (self != NULL, NULL);
- _tmp1_ = _tmp0_ = g_settings_get_strv (self->priv->settings, "blacklisted-media-players");
- _tmp2_ = _tmp1_;
+ _tmp0_ = self->priv->settings;
+ _tmp2_ = _tmp1_ = g_settings_get_strv (_tmp0_, "blacklisted-media-players");
+ _tmp3_ = _tmp2_;
+ _tmp3__length1 = _vala_array_length (_tmp1_);
if (result_length1) {
- *result_length1 = _vala_array_length (_tmp0_);
+ *result_length1 = _tmp3__length1;
}
- result = _tmp2_;
+ result = _tmp3_;
return result;
}
@@ -121,58 +126,83 @@ static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gc
GeeArrayList* settings_manager_fetch_interested (SettingsManager* self) {
GeeArrayList* result = NULL;
- gchar** _tmp0_;
- gchar** _tmp1_ = NULL;
+ GSettings* _tmp0_;
+ gchar** _tmp1_;
+ gchar** _tmp2_ = NULL;
gchar** blacklisted;
gint blacklisted_length1;
gint _blacklisted_size_;
- gchar** _tmp2_;
- gchar** _tmp3_ = NULL;
+ GSettings* _tmp3_;
+ gchar** _tmp4_;
+ gchar** _tmp5_ = NULL;
gchar** interested;
gint interested_length1;
gint _interested_size_;
- GeeArrayList* _tmp4_ = NULL;
+ GeeArrayList* _tmp6_;
GeeArrayList* list;
+ gchar** _tmp7_;
+ gint _tmp7__length1;
g_return_val_if_fail (self != NULL, NULL);
- _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_;
+ _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;
{
- 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_;
+ 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_;
{
- gboolean _tmp7_;
- if (g_strcmp0 (s, "banshee-1") == 0) {
- gchar* _tmp6_;
- _tmp6_ = g_strdup ("banshee");
+ 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");
_g_free0 (s);
- s = _tmp6_;
+ s = _tmp10_;
}
- _tmp7_ = gee_abstract_collection_contains ((GeeAbstractCollection*) list, s);
- if (_tmp7_) {
+ _tmp11_ = list;
+ _tmp12_ = s;
+ _tmp13_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp11_, _tmp12_);
+ if (_tmp13_) {
_g_free0 (s);
continue;
}
- if (_vala_string_array_contains (blacklisted, blacklisted_length1, s)) {
+ _tmp14_ = s;
+ _tmp15_ = blacklisted;
+ _tmp15__length1 = blacklisted_length1;
+ if (_vala_string_array_contains (_tmp15_, _tmp15__length1, _tmp14_)) {
_g_free0 (s);
continue;
}
- gee_abstract_collection_add ((GeeAbstractCollection*) list, s);
+ _tmp16_ = list;
+ _tmp17_ = s;
+ gee_abstract_collection_add ((GeeAbstractCollection*) _tmp16_, _tmp17_);
_g_free0 (s);
}
}
@@ -185,8 +215,83 @@ GeeArrayList* settings_manager_fetch_interested (SettingsManager* self) {
void settings_manager_clear_list (SettingsManager* self) {
+ GSettings* _tmp0_;
g_return_if_fail (self != NULL);
- g_settings_reset (self->priv->settings, "interested-media-players");
+ _tmp0_ = self->priv->settings;
+ g_settings_reset (_tmp0_, "interested-media-players");
+}
+
+
+void settings_manager_remove_interested (SettingsManager* self, const gchar* app_desktop_name) {
+ GSettings* _tmp0_;
+ gchar** _tmp1_;
+ gchar** _tmp2_ = NULL;
+ gchar** already_interested;
+ gint already_interested_length1;
+ gint _already_interested_size_;
+ GeeArrayList* _tmp3_;
+ GeeArrayList* list;
+ gchar** _tmp4_;
+ gint _tmp4__length1;
+ GSettings* _tmp10_;
+ GeeArrayList* _tmp11_;
+ gint _tmp12_ = 0;
+ gpointer* _tmp13_ = NULL;
+ gchar** _tmp14_;
+ gint _tmp14__length1;
+ GSettings* _tmp15_;
+ 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_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL);
+ list = _tmp3_;
+ _tmp4_ = already_interested;
+ _tmp4__length1 = already_interested_length1;
+ {
+ gchar** s_collection = NULL;
+ gint s_collection_length1 = 0;
+ gint _s_collection_size_ = 0;
+ gint s_it = 0;
+ s_collection = _tmp4_;
+ s_collection_length1 = _tmp4__length1;
+ for (s_it = 0; s_it < _tmp4__length1; s_it = s_it + 1) {
+ gchar* _tmp5_;
+ gchar* s = NULL;
+ _tmp5_ = g_strdup (s_collection[s_it]);
+ s = _tmp5_;
+ {
+ const gchar* _tmp6_;
+ const gchar* _tmp7_;
+ GeeArrayList* _tmp8_;
+ const gchar* _tmp9_;
+ _tmp6_ = s;
+ _tmp7_ = app_desktop_name;
+ if (g_strcmp0 (_tmp6_, _tmp7_) == 0) {
+ _g_free0 (s);
+ continue;
+ }
+ _tmp8_ = list;
+ _tmp9_ = s;
+ gee_abstract_collection_add ((GeeAbstractCollection*) _tmp8_, _tmp9_);
+ _g_free0 (s);
+ }
+ }
+ }
+ _tmp10_ = self->priv->settings;
+ _tmp11_ = list;
+ _tmp13_ = gee_abstract_collection_to_array ((GeeAbstractCollection*) _tmp11_, &_tmp12_);
+ _tmp14_ = _tmp13_;
+ _tmp14__length1 = _tmp12_;
+ g_settings_set_strv (_tmp10_, "interested-media-players", _tmp14_);
+ _tmp14_ = (_vala_array_free (_tmp14_, _tmp14__length1, (GDestroyNotify) g_free), NULL);
+ _tmp15_ = self->priv->settings;
+ g_settings_apply (_tmp15_);
+ _g_object_unref0 (list);
+ already_interested = (_vala_array_free (already_interested, already_interested_length1, (GDestroyNotify) g_free), NULL);
}
@@ -201,31 +306,49 @@ 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) {
- gchar** _tmp0_;
- gchar** _tmp1_ = NULL;
+ GSettings* _tmp0_;
+ gchar** _tmp1_;
+ gchar** _tmp2_ = NULL;
gchar** already_interested;
gint already_interested_length1;
gint _already_interested_size_;
- gchar* _tmp3_;
+ gchar** _tmp3_;
+ gint _tmp3__length1;
+ gchar** _tmp7_;
+ gint _tmp7__length1;
+ const gchar* _tmp8_;
+ gchar* _tmp9_;
+ GSettings* _tmp10_;
+ gchar** _tmp11_;
+ gint _tmp11__length1;
+ GSettings* _tmp12_;
g_return_if_fail (self != NULL);
g_return_if_fail (app_desktop_name != NULL);
- _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_);
+ _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;
{
- 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_;
+ 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_;
{
- if (g_strcmp0 (s, app_desktop_name) == 0) {
+ const gchar* _tmp5_;
+ const gchar* _tmp6_;
+ _tmp5_ = s;
+ _tmp6_ = app_desktop_name;
+ if (g_strcmp0 (_tmp5_, _tmp6_) == 0) {
_g_free0 (s);
already_interested = (_vala_array_free (already_interested, already_interested_length1, (GDestroyNotify) g_free), NULL);
return;
@@ -234,25 +357,34 @@ void settings_manager_add_interested (SettingsManager* self, const gchar* app_de
}
}
}
- _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);
+ _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_);
already_interested = (_vala_array_free (already_interested, already_interested_length1, (GDestroyNotify) g_free), NULL);
}
static void settings_manager_on_blacklist_event (SettingsManager* self) {
- gchar** _tmp0_;
- gchar** _tmp1_ = NULL;
- gchar** _tmp2_;
- gint _tmp2__length1;
+ GSettings* _tmp0_;
+ gchar** _tmp1_;
+ gchar** _tmp2_ = NULL;
+ gchar** _tmp3_;
+ gint _tmp3__length1;
g_return_if_fail (self != 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);
+ _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);
}
@@ -260,7 +392,8 @@ 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, data2;
+ register gpointer data1;
+ register gpointer data2;
cc = (GCClosure *) closure;
g_return_if_fail (n_param_values == 3);
if (G_CCLOSURE_SWAP_DATA (closure)) {
@@ -284,14 +417,16 @@ static GObject * settings_manager_constructor (GType type, guint n_construct_pro
GObject * obj;
GObjectClass * parent_class;
SettingsManager * self;
- GSettings* _tmp0_ = NULL;
+ GSettings* _tmp0_;
+ GSettings* _tmp1_;
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.indicator.sound");
_g_object_unref0 (self->priv->settings);
self->priv->settings = _tmp0_;
- g_signal_connect_object (self->priv->settings, "changed::blacklisted-media-players", (GCallback) _settings_manager_on_blacklist_event_g_settings_changed, self, 0);
+ _tmp1_ = self->priv->settings;
+ g_signal_connect_object (_tmp1_, "changed::blacklisted-media-players", (GCallback) _settings_manager_on_blacklist_event_g_settings_changed, self, 0);
return obj;
}