1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-12-12 07:37:35 +00:00

provider: whitespace and indentation

This commit is contained in:
Evangelos Ribeiro Tzaras 2021-05-04 17:12:07 +02:00
parent 2ac43f391a
commit 1543802c88
2 changed files with 36 additions and 43 deletions

View file

@ -81,15 +81,14 @@ calls_provider_get_property (GObject *object,
{ {
CallsProvider *self = CALLS_PROVIDER (object); CallsProvider *self = CALLS_PROVIDER (object);
switch (prop_id) switch (prop_id) {
{ case PROP_STATUS:
case PROP_STATUS: g_value_set_string (value, calls_provider_get_status (self));
g_value_set_string (value, calls_provider_get_status (self)); break;
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
} }
} }
static void static void
@ -179,40 +178,35 @@ calls_provider_load_plugin (const char *name)
// Find the plugin // Find the plugin
info = peas_engine_get_plugin_info (plugins, name); info = peas_engine_get_plugin_info (plugins, name);
if (!info) if (!info) {
{ g_debug ("Could not find plugin `%s'", name);
g_debug ("Could not find plugin `%s'", name); return NULL;
return NULL; }
}
// Possibly load the plugin // Possibly load the plugin
if (!peas_plugin_info_is_loaded (info)) if (!peas_plugin_info_is_loaded (info)) {
{ peas_engine_load_plugin (plugins, info);
peas_engine_load_plugin (plugins, info);
if (!peas_plugin_info_is_available (info, &error)) if (!peas_plugin_info_is_available (info, &error)) {
{ g_debug ("Error loading plugin `%s': %s", name, error->message);
g_debug ("Error loading plugin `%s': %s", name, error->message);
return NULL;
}
g_debug ("Loaded plugin `%s'", name);
}
// Check the plugin provides CallsProvider
if (!peas_engine_provides_extension (plugins, info, CALLS_TYPE_PROVIDER))
{
g_debug ("Plugin `%s' does not have a provider extension", name);
return NULL; return NULL;
} }
g_debug ("Loaded plugin `%s'", name);
}
// Check the plugin provides CallsProvider
if (!peas_engine_provides_extension (plugins, info, CALLS_TYPE_PROVIDER)) {
g_debug ("Plugin `%s' does not have a provider extension", name);
return NULL;
}
// Get the extension // Get the extension
extension = peas_engine_create_extensionv (plugins, info, CALLS_TYPE_PROVIDER, 0, NULL); extension = peas_engine_create_extensionv (plugins, info, CALLS_TYPE_PROVIDER, 0, NULL);
if (!extension) if (!extension) {
{ g_debug ("Could not create provider from plugin `%s'", name);
g_debug ("Could not create provider from plugin `%s'", name); return NULL;
return NULL; }
}
g_debug ("Created provider from plugin `%s'", name); g_debug ("Created provider from plugin `%s'", name);
return CALLS_PROVIDER (extension); return CALLS_PROVIDER (extension);

View file

@ -44,17 +44,16 @@ struct _CallsProviderClass
{ {
GObjectClass parent_class; GObjectClass parent_class;
const char *(*get_name) (CallsProvider *self); const char *(*get_name) (CallsProvider *self);
const char *(*get_status) (CallsProvider *self); const char *(*get_status) (CallsProvider *self);
GListModel *(*get_origins) (CallsProvider *self); GListModel *(*get_origins) (CallsProvider *self);
}; };
const char *calls_provider_get_name (CallsProvider *self);
const char *calls_provider_get_name (CallsProvider *self); const char *calls_provider_get_status (CallsProvider *self);
const char *calls_provider_get_status (CallsProvider *self); GListModel *calls_provider_get_origins (CallsProvider *self);
GListModel *calls_provider_get_origins (CallsProvider *self); CallsProvider *calls_provider_load_plugin (const char *name);
CallsProvider *calls_provider_load_plugin (const char *name); void calls_provider_unload_plugin (const char *name);
void calls_provider_unload_plugin (const char *name);
G_END_DECLS G_END_DECLS