application: settings: Add autoload-plugins setting
This setting will be used to define the provider plugins to be loaded on application startup if calls has been invoked without `--provider`
This commit is contained in:
@@ -40,6 +40,7 @@ enum {
|
||||
PROP_0,
|
||||
PROP_AUTO_USE_DEFAULT_ORIGINS,
|
||||
PROP_COUNTRY_CODE,
|
||||
PROP_AUTOLOAD_PLUGINS,
|
||||
PROP_LAST_PROP
|
||||
};
|
||||
static GParamSpec *props[PROP_LAST_PROP];
|
||||
@@ -70,6 +71,10 @@ calls_settings_set_property (GObject *object,
|
||||
calls_settings_set_country_code (self, g_value_get_string (value));
|
||||
break;
|
||||
|
||||
case PROP_AUTOLOAD_PLUGINS:
|
||||
calls_settings_set_autoload_plugins (self, g_value_get_boxed (value));
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
@@ -94,6 +99,10 @@ calls_settings_get_property (GObject *object,
|
||||
g_value_set_string (value, calls_settings_get_country_code (self));
|
||||
break;
|
||||
|
||||
case PROP_AUTOLOAD_PLUGINS:
|
||||
g_value_set_boxed (value, calls_settings_get_autoload_plugins (self));
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
@@ -147,6 +156,13 @@ calls_settings_class_init (CallsSettingsClass *klass)
|
||||
"",
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
props[PROP_AUTOLOAD_PLUGINS] =
|
||||
g_param_spec_boxed ("autoload-plugins",
|
||||
"autoload plugins",
|
||||
"The plugins to automatically load on startup",
|
||||
G_TYPE_STRV,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
g_object_class_install_properties (object_class, PROP_LAST_PROP, props);
|
||||
}
|
||||
|
||||
@@ -232,3 +248,22 @@ calls_settings_set_country_code (CallsSettings *self,
|
||||
g_debug ("Setting country code to %s", country_code);
|
||||
g_settings_set_string (G_SETTINGS (self->settings), "country-code", country_code);
|
||||
}
|
||||
|
||||
|
||||
char **
|
||||
calls_settings_get_autoload_plugins (CallsSettings *self)
|
||||
{
|
||||
g_return_val_if_fail (CALLS_IS_SETTINGS (self), NULL);
|
||||
|
||||
return g_settings_get_strv (G_SETTINGS (self->settings), "autoload-plugins");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
calls_settings_set_autoload_plugins (CallsSettings *self,
|
||||
const char * const *plugins)
|
||||
{
|
||||
g_return_if_fail (CALLS_IS_SETTINGS (self));
|
||||
|
||||
g_settings_set_strv (G_SETTINGS (self->settings), "autoload-plugins", plugins);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user