Commit a6bf868a authored by Milan Crha's avatar Milan Crha
Browse files

Use SRV records for configuration lookup

These are marked as incomplete, because the SRV record contains only
host name and port, thus all the other values being set are just a guess.
The change also makes prefer complete lookup results over those incomplete.
parent 9b8ddaf1
...@@ -439,6 +439,7 @@ src/modules/calendar/e-task-shell-view.c ...@@ -439,6 +439,7 @@ src/modules/calendar/e-task-shell-view.c
src/modules/calendar/e-task-shell-view-private.c src/modules/calendar/e-task-shell-view-private.c
src/modules/composer-to-meeting/e-composer-to-meeting.c src/modules/composer-to-meeting/e-composer-to-meeting.c
src/modules/composer-to-meeting/e-meeting-to-composer.c src/modules/composer-to-meeting/e-meeting-to-composer.c
src/modules/config-lookup/e-srv-config-lookup.c
src/modules/itip-formatter/e-mail-formatter-itip.c src/modules/itip-formatter/e-mail-formatter-itip.c
src/modules/itip-formatter/itip-view.c src/modules/itip-formatter/itip-view.c
src/modules/itip-formatter/org-gnome-itip-formatter.error.xml src/modules/itip-formatter/org-gnome-itip-formatter.error.xml
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
struct _EConfigLookupResultSimplePrivate { struct _EConfigLookupResultSimplePrivate {
EConfigLookupResultKind kind; EConfigLookupResultKind kind;
gint priority; gint priority;
gboolean is_complete;
gchar *protocol; gchar *protocol;
gchar *display_name; gchar *display_name;
gchar *description; gchar *description;
...@@ -52,6 +53,7 @@ enum { ...@@ -52,6 +53,7 @@ enum {
PROP_0, PROP_0,
PROP_KIND, PROP_KIND,
PROP_PRIORITY, PROP_PRIORITY,
PROP_IS_COMPLETE,
PROP_PROTOCOL, PROP_PROTOCOL,
PROP_DISPLAY_NAME, PROP_DISPLAY_NAME,
PROP_DESCRIPTION PROP_DESCRIPTION
...@@ -114,6 +116,14 @@ config_lookup_result_simple_get_priority (EConfigLookupResult *lookup_result) ...@@ -114,6 +116,14 @@ config_lookup_result_simple_get_priority (EConfigLookupResult *lookup_result)
return E_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result)->priv->priority; return E_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result)->priv->priority;
} }
static gboolean
config_lookup_result_simple_get_is_complete (EConfigLookupResult *lookup_result)
{
g_return_val_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result), FALSE);
return E_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result)->priv->is_complete;
}
static const gchar * static const gchar *
config_lookup_result_simple_get_protocol (EConfigLookupResult *lookup_result) config_lookup_result_simple_get_protocol (EConfigLookupResult *lookup_result)
{ {
...@@ -155,16 +165,26 @@ config_lookup_result_simple_configure_source (EConfigLookupResult *lookup_result ...@@ -155,16 +165,26 @@ config_lookup_result_simple_configure_source (EConfigLookupResult *lookup_result
for (link = result_simple->priv->values; link; link = g_slist_next (link)) { for (link = result_simple->priv->values; link; link = g_slist_next (link)) {
ValueData *vd = link->data; ValueData *vd = link->data;
gpointer extension; gpointer object;
if (!vd) if (!vd)
return FALSE; return FALSE;
extension = e_source_get_extension (source, vd->extension_name); if (vd->extension_name && *vd->extension_name) {
g_warn_if_fail (extension != NULL); object = e_source_get_extension (source, vd->extension_name);
/* Special-case the ESourceCamel extension, where the properties
reference the CamelSettings object, not the extension itself. */
if (object && E_IS_SOURCE_CAMEL (object))
object = e_source_camel_get_settings (object);
} else {
object = source;
}
g_warn_if_fail (object != NULL);
if (extension) if (object)
g_object_set_property (extension, vd->property_name, &vd->value); g_object_set_property (object, vd->property_name, &vd->value);
} }
return TRUE; return TRUE;
...@@ -205,6 +225,15 @@ config_lookup_result_simple_set_priority (EConfigLookupResultSimple *result_simp ...@@ -205,6 +225,15 @@ config_lookup_result_simple_set_priority (EConfigLookupResultSimple *result_simp
result_simple->priv->priority = priority; result_simple->priv->priority = priority;
} }
static void
config_lookup_result_simple_set_is_complete (EConfigLookupResultSimple *result_simple,
gboolean is_complete)
{
g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (result_simple));
result_simple->priv->is_complete = is_complete;
}
static void static void
config_lookup_result_simple_set_string (EConfigLookupResultSimple *result_simple, config_lookup_result_simple_set_string (EConfigLookupResultSimple *result_simple,
const gchar *value, const gchar *value,
...@@ -236,6 +265,11 @@ config_lookup_result_simple_set_property (GObject *object, ...@@ -236,6 +265,11 @@ config_lookup_result_simple_set_property (GObject *object,
result_simple, g_value_get_int (value)); result_simple, g_value_get_int (value));
return; return;
case PROP_IS_COMPLETE:
config_lookup_result_simple_set_is_complete (
result_simple, g_value_get_boolean (value));
return;
case PROP_PROTOCOL: case PROP_PROTOCOL:
config_lookup_result_simple_set_string ( config_lookup_result_simple_set_string (
result_simple, g_value_get_string (value), result_simple, g_value_get_string (value),
...@@ -279,6 +313,13 @@ config_lookup_result_simple_get_property (GObject *object, ...@@ -279,6 +313,13 @@ config_lookup_result_simple_get_property (GObject *object,
E_CONFIG_LOOKUP_RESULT (object))); E_CONFIG_LOOKUP_RESULT (object)));
return; return;
case PROP_IS_COMPLETE:
g_value_set_boolean (
value,
config_lookup_result_simple_get_is_complete (
E_CONFIG_LOOKUP_RESULT (object)));
return;
case PROP_PROTOCOL: case PROP_PROTOCOL:
g_value_set_string ( g_value_set_string (
value, value,
...@@ -371,6 +412,26 @@ e_config_lookup_result_simple_class_init (EConfigLookupResultSimpleClass *klass) ...@@ -371,6 +412,26 @@ e_config_lookup_result_simple_class_init (EConfigLookupResultSimpleClass *klass)
G_PARAM_CONSTRUCT_ONLY | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
/**
* EConfigLookupResultSimple:is-complete:
*
* Whether the #EConfigLookupResult is complete, that is, whether it doesn't
* require any further user interaction.
*
* Since: 3.26
**/
g_object_class_install_property (
object_class,
PROP_IS_COMPLETE,
g_param_spec_boolean (
"is-complete",
"Is Complete",
NULL,
FALSE,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
/** /**
* EConfigLookupResultSimple:protocol: * EConfigLookupResultSimple:protocol:
* *
...@@ -434,6 +495,7 @@ e_config_lookup_result_simple_result_init (EConfigLookupResultInterface *iface) ...@@ -434,6 +495,7 @@ e_config_lookup_result_simple_result_init (EConfigLookupResultInterface *iface)
{ {
iface->get_kind = config_lookup_result_simple_get_kind; iface->get_kind = config_lookup_result_simple_get_kind;
iface->get_priority = config_lookup_result_simple_get_priority; iface->get_priority = config_lookup_result_simple_get_priority;
iface->get_is_complete = config_lookup_result_simple_get_is_complete;
iface->get_protocol = config_lookup_result_simple_get_protocol; iface->get_protocol = config_lookup_result_simple_get_protocol;
iface->get_display_name = config_lookup_result_simple_get_display_name; iface->get_display_name = config_lookup_result_simple_get_display_name;
iface->get_description = config_lookup_result_simple_get_description; iface->get_description = config_lookup_result_simple_get_description;
...@@ -450,6 +512,7 @@ e_config_lookup_result_simple_init (EConfigLookupResultSimple *result_simple) ...@@ -450,6 +512,7 @@ e_config_lookup_result_simple_init (EConfigLookupResultSimple *result_simple)
* e_config_lookup_result_simple_new: * e_config_lookup_result_simple_new:
* @kind: a kind of the result, one of #EConfigLookupResultKind * @kind: a kind of the result, one of #EConfigLookupResultKind
* @priority: a priority of the result * @priority: a priority of the result
* @is_complete: whether the result is complete
* @protocol: (nullable): protocol name of the result, or %NULL * @protocol: (nullable): protocol name of the result, or %NULL
* @display_name: display name of the result * @display_name: display name of the result
* @description: description of the result * @description: description of the result
...@@ -463,6 +526,7 @@ e_config_lookup_result_simple_init (EConfigLookupResultSimple *result_simple) ...@@ -463,6 +526,7 @@ e_config_lookup_result_simple_init (EConfigLookupResultSimple *result_simple)
EConfigLookupResult * EConfigLookupResult *
e_config_lookup_result_simple_new (EConfigLookupResultKind kind, e_config_lookup_result_simple_new (EConfigLookupResultKind kind,
gint priority, gint priority,
gboolean is_complete,
const gchar *protocol, const gchar *protocol,
const gchar *display_name, const gchar *display_name,
const gchar *description) const gchar *description)
...@@ -474,6 +538,7 @@ e_config_lookup_result_simple_new (EConfigLookupResultKind kind, ...@@ -474,6 +538,7 @@ e_config_lookup_result_simple_new (EConfigLookupResultKind kind,
return g_object_new (E_TYPE_CONFIG_LOOKUP_RESULT_SIMPLE, return g_object_new (E_TYPE_CONFIG_LOOKUP_RESULT_SIMPLE,
"kind", kind, "kind", kind,
"priority", priority, "priority", priority,
"is-complete", is_complete,
"protocol", protocol, "protocol", protocol,
"display-name", display_name, "display-name", display_name,
"description", description, "description", description,
...@@ -483,13 +548,13 @@ e_config_lookup_result_simple_new (EConfigLookupResultKind kind, ...@@ -483,13 +548,13 @@ e_config_lookup_result_simple_new (EConfigLookupResultKind kind,
/** /**
* e_config_lookup_result_simple_add_value: * e_config_lookup_result_simple_add_value:
* @lookup_result: an #EConfigLookupResultSimple * @lookup_result: an #EConfigLookupResultSimple
* @extension_name: extension name * @extension_name: (nullable): extension name, or %NULL, to change property of the #ESource itself
* @property_name: property name within the extension * @property_name: property name within the extension
* @value: value to be set * @value: value to be set
* *
* Adds a value to be stored into an #ESource when e_config_lookup_result_configure_source(). * Adds a value to be stored into an #ESource when e_config_lookup_result_configure_source().
* is called. The @value is identified as a property named @property_name in an extension * is called. The @value is identified as a property named @property_name in an extension
* named @extension_name. * named @extension_name, or in the #ESource itself, when @extension_name is %NULL.
* *
* In case multiple values are stored for the same extension and property, * In case multiple values are stored for the same extension and property,
* then the first is saved. * then the first is saved.
...@@ -505,7 +570,6 @@ e_config_lookup_result_simple_add_value (EConfigLookupResult *lookup_result, ...@@ -505,7 +570,6 @@ e_config_lookup_result_simple_add_value (EConfigLookupResult *lookup_result,
EConfigLookupResultSimple *result_simple; EConfigLookupResultSimple *result_simple;
g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result)); g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result));
g_return_if_fail (extension_name != NULL);
g_return_if_fail (property_name != NULL); g_return_if_fail (property_name != NULL);
g_return_if_fail (value != NULL); g_return_if_fail (value != NULL);
...@@ -518,7 +582,7 @@ e_config_lookup_result_simple_add_value (EConfigLookupResult *lookup_result, ...@@ -518,7 +582,7 @@ e_config_lookup_result_simple_add_value (EConfigLookupResult *lookup_result,
/** /**
* e_config_lookup_result_simple_add_boolean: * e_config_lookup_result_simple_add_boolean:
* @lookup_result: an #EConfigLookupResultSimple * @lookup_result: an #EConfigLookupResultSimple
* @extension_name: extension name * @extension_name: (nullable): extension name, or %NULL, to change property of the #ESource itself
* @property_name: property name within the extension * @property_name: property name within the extension
* @value: value to set * @value: value to set
* *
...@@ -536,7 +600,6 @@ e_config_lookup_result_simple_add_boolean (EConfigLookupResult *lookup_result, ...@@ -536,7 +600,6 @@ e_config_lookup_result_simple_add_boolean (EConfigLookupResult *lookup_result,
GValue gvalue; GValue gvalue;
g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result)); g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result));
g_return_if_fail (extension_name != NULL);
g_return_if_fail (property_name != NULL); g_return_if_fail (property_name != NULL);
memset (&gvalue, 0, sizeof (GValue)); memset (&gvalue, 0, sizeof (GValue));
...@@ -551,7 +614,7 @@ e_config_lookup_result_simple_add_boolean (EConfigLookupResult *lookup_result, ...@@ -551,7 +614,7 @@ e_config_lookup_result_simple_add_boolean (EConfigLookupResult *lookup_result,
/** /**
* e_config_lookup_result_simple_add_int: * e_config_lookup_result_simple_add_int:
* @lookup_result: an #EConfigLookupResultSimple * @lookup_result: an #EConfigLookupResultSimple
* @extension_name: extension name * @extension_name: (nullable): extension name, or %NULL, to change property of the #ESource itself
* @property_name: property name within the extension * @property_name: property name within the extension
* @value: value to set * @value: value to set
* *
...@@ -569,7 +632,6 @@ e_config_lookup_result_simple_add_int (EConfigLookupResult *lookup_result, ...@@ -569,7 +632,6 @@ e_config_lookup_result_simple_add_int (EConfigLookupResult *lookup_result,
GValue gvalue; GValue gvalue;
g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result)); g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result));
g_return_if_fail (extension_name != NULL);
g_return_if_fail (property_name != NULL); g_return_if_fail (property_name != NULL);
memset (&gvalue, 0, sizeof (GValue)); memset (&gvalue, 0, sizeof (GValue));
...@@ -584,7 +646,7 @@ e_config_lookup_result_simple_add_int (EConfigLookupResult *lookup_result, ...@@ -584,7 +646,7 @@ e_config_lookup_result_simple_add_int (EConfigLookupResult *lookup_result,
/** /**
* e_config_lookup_result_simple_add_uint: * e_config_lookup_result_simple_add_uint:
* @lookup_result: an #EConfigLookupResultSimple * @lookup_result: an #EConfigLookupResultSimple
* @extension_name: extension name * @extension_name: (nullable): extension name, or %NULL, to change property of the #ESource itself
* @property_name: property name within the extension * @property_name: property name within the extension
* @value: value to set * @value: value to set
* *
...@@ -602,7 +664,6 @@ e_config_lookup_result_simple_add_uint (EConfigLookupResult *lookup_result, ...@@ -602,7 +664,6 @@ e_config_lookup_result_simple_add_uint (EConfigLookupResult *lookup_result,
GValue gvalue; GValue gvalue;
g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result)); g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result));
g_return_if_fail (extension_name != NULL);
g_return_if_fail (property_name != NULL); g_return_if_fail (property_name != NULL);
memset (&gvalue, 0, sizeof (GValue)); memset (&gvalue, 0, sizeof (GValue));
...@@ -617,7 +678,7 @@ e_config_lookup_result_simple_add_uint (EConfigLookupResult *lookup_result, ...@@ -617,7 +678,7 @@ e_config_lookup_result_simple_add_uint (EConfigLookupResult *lookup_result,
/** /**
* e_config_lookup_result_simple_add_int64: * e_config_lookup_result_simple_add_int64:
* @lookup_result: an #EConfigLookupResultSimple * @lookup_result: an #EConfigLookupResultSimple
* @extension_name: extension name * @extension_name: (nullable): extension name, or %NULL, to change property of the #ESource itself
* @property_name: property name within the extension * @property_name: property name within the extension
* @value: value to set * @value: value to set
* *
...@@ -635,7 +696,6 @@ e_config_lookup_result_simple_add_int64 (EConfigLookupResult *lookup_result, ...@@ -635,7 +696,6 @@ e_config_lookup_result_simple_add_int64 (EConfigLookupResult *lookup_result,
GValue gvalue; GValue gvalue;
g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result)); g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result));
g_return_if_fail (extension_name != NULL);
g_return_if_fail (property_name != NULL); g_return_if_fail (property_name != NULL);
memset (&gvalue, 0, sizeof (GValue)); memset (&gvalue, 0, sizeof (GValue));
...@@ -650,7 +710,7 @@ e_config_lookup_result_simple_add_int64 (EConfigLookupResult *lookup_result, ...@@ -650,7 +710,7 @@ e_config_lookup_result_simple_add_int64 (EConfigLookupResult *lookup_result,
/** /**
* e_config_lookup_result_simple_add_uint64: * e_config_lookup_result_simple_add_uint64:
* @lookup_result: an #EConfigLookupResultSimple * @lookup_result: an #EConfigLookupResultSimple
* @extension_name: extension name * @extension_name: (nullable): extension name, or %NULL, to change property of the #ESource itself
* @property_name: property name within the extension * @property_name: property name within the extension
* @value: value to set * @value: value to set
* *
...@@ -668,7 +728,6 @@ e_config_lookup_result_simple_add_uint64 (EConfigLookupResult *lookup_result, ...@@ -668,7 +728,6 @@ e_config_lookup_result_simple_add_uint64 (EConfigLookupResult *lookup_result,
GValue gvalue; GValue gvalue;
g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result)); g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result));
g_return_if_fail (extension_name != NULL);
g_return_if_fail (property_name != NULL); g_return_if_fail (property_name != NULL);
memset (&gvalue, 0, sizeof (GValue)); memset (&gvalue, 0, sizeof (GValue));
...@@ -683,7 +742,7 @@ e_config_lookup_result_simple_add_uint64 (EConfigLookupResult *lookup_result, ...@@ -683,7 +742,7 @@ e_config_lookup_result_simple_add_uint64 (EConfigLookupResult *lookup_result,
/** /**
* e_config_lookup_result_simple_add_double: * e_config_lookup_result_simple_add_double:
* @lookup_result: an #EConfigLookupResultSimple * @lookup_result: an #EConfigLookupResultSimple
* @extension_name: extension name * @extension_name: (nullable): extension name, or %NULL, to change property of the #ESource itself
* @property_name: property name within the extension * @property_name: property name within the extension
* @value: value to set * @value: value to set
* *
...@@ -701,7 +760,6 @@ e_config_lookup_result_simple_add_double (EConfigLookupResult *lookup_result, ...@@ -701,7 +760,6 @@ e_config_lookup_result_simple_add_double (EConfigLookupResult *lookup_result,
GValue gvalue; GValue gvalue;
g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result)); g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result));
g_return_if_fail (extension_name != NULL);
g_return_if_fail (property_name != NULL); g_return_if_fail (property_name != NULL);
memset (&gvalue, 0, sizeof (GValue)); memset (&gvalue, 0, sizeof (GValue));
...@@ -716,7 +774,7 @@ e_config_lookup_result_simple_add_double (EConfigLookupResult *lookup_result, ...@@ -716,7 +774,7 @@ e_config_lookup_result_simple_add_double (EConfigLookupResult *lookup_result,
/** /**
* e_config_lookup_result_simple_add_string: * e_config_lookup_result_simple_add_string:
* @lookup_result: an #EConfigLookupResultSimple * @lookup_result: an #EConfigLookupResultSimple
* @extension_name: extension name * @extension_name: (nullable): extension name, or %NULL, to change property of the #ESource itself
* @property_name: property name within the extension * @property_name: property name within the extension
* @value: value to set * @value: value to set
* *
...@@ -734,7 +792,6 @@ e_config_lookup_result_simple_add_string (EConfigLookupResult *lookup_result, ...@@ -734,7 +792,6 @@ e_config_lookup_result_simple_add_string (EConfigLookupResult *lookup_result,
GValue gvalue; GValue gvalue;
g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result)); g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result));
g_return_if_fail (extension_name != NULL);
g_return_if_fail (property_name != NULL); g_return_if_fail (property_name != NULL);
memset (&gvalue, 0, sizeof (GValue)); memset (&gvalue, 0, sizeof (GValue));
...@@ -749,7 +806,7 @@ e_config_lookup_result_simple_add_string (EConfigLookupResult *lookup_result, ...@@ -749,7 +806,7 @@ e_config_lookup_result_simple_add_string (EConfigLookupResult *lookup_result,
/** /**
* e_config_lookup_result_simple_add_enum: * e_config_lookup_result_simple_add_enum:
* @lookup_result: an #EConfigLookupResultSimple * @lookup_result: an #EConfigLookupResultSimple
* @extension_name: extension name * @extension_name: (nullable): extension name, or %NULL, to change property of the #ESource itself
* @property_name: property name within the extension * @property_name: property name within the extension
* @enum_type: a #GType of the enum * @enum_type: a #GType of the enum
* @value: value to set * @value: value to set
...@@ -769,7 +826,6 @@ e_config_lookup_result_simple_add_enum (EConfigLookupResult *lookup_result, ...@@ -769,7 +826,6 @@ e_config_lookup_result_simple_add_enum (EConfigLookupResult *lookup_result,
GValue gvalue; GValue gvalue;
g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result)); g_return_if_fail (E_IS_CONFIG_LOOKUP_RESULT_SIMPLE (lookup_result));
g_return_if_fail (extension_name != NULL);
g_return_if_fail (property_name != NULL); g_return_if_fail (property_name != NULL);
memset (&gvalue, 0, sizeof (GValue)); memset (&gvalue, 0, sizeof (GValue));
......
...@@ -76,6 +76,7 @@ GType e_config_lookup_result_simple_get_type (void) G_GNUC_CONST; ...@@ -76,6 +76,7 @@ GType e_config_lookup_result_simple_get_type (void) G_GNUC_CONST;
EConfigLookupResult * EConfigLookupResult *
e_config_lookup_result_simple_new (EConfigLookupResultKind kind, e_config_lookup_result_simple_new (EConfigLookupResultKind kind,
gint priority, gint priority,
gboolean is_complete,
const gchar *protocol, const gchar *protocol,
const gchar *display_name, const gchar *display_name,
const gchar *description); const gchar *description);
......
...@@ -42,6 +42,7 @@ e_config_lookup_result_default_init (EConfigLookupResultInterface *iface) ...@@ -42,6 +42,7 @@ e_config_lookup_result_default_init (EConfigLookupResultInterface *iface)
{ {
iface->get_kind = NULL; iface->get_kind = NULL;
iface->get_priority = NULL; iface->get_priority = NULL;
iface->get_is_complete = NULL;
iface->get_protocol = NULL; iface->get_protocol = NULL;
iface->get_display_name = NULL; iface->get_display_name = NULL;
iface->get_description = NULL; iface->get_description = NULL;
...@@ -92,6 +93,29 @@ e_config_lookup_result_get_priority (EConfigLookupResult *lookup_result) ...@@ -92,6 +93,29 @@ e_config_lookup_result_get_priority (EConfigLookupResult *lookup_result)
return iface->get_priority (lookup_result); return iface->get_priority (lookup_result);
} }
/**
* e_config_lookup_result_get_is_complete:
* @lookup_result: an #EConfigLookupResult
*
* Returns: whether the result is complete, that is, whether it doesn't require
* any further user interaction
*
* Since: 3.26
**/
gboolean
e_config_lookup_result_get_is_complete (EConfigLookupResult *lookup_result)
{
EConfigLookupResultInterface *iface;
g_return_val_if_fail (E_IS_CONFIG_LOOKUP_RESULT (lookup_result), FALSE);
iface = E_CONFIG_LOOKUP_RESULT_GET_INTERFACE (lookup_result);
g_return_val_if_fail (iface != NULL, FALSE);
g_return_val_if_fail (iface->get_is_complete != NULL, FALSE);
return iface->get_is_complete (lookup_result);
}
/** /**
* e_config_lookup_result_get_protocol: * e_config_lookup_result_get_protocol:
* @lookup_result: an #EConfigLookupResult * @lookup_result: an #EConfigLookupResult
...@@ -194,7 +218,8 @@ e_config_lookup_result_configure_source (EConfigLookupResult *lookup_result, ...@@ -194,7 +218,8 @@ e_config_lookup_result_configure_source (EConfigLookupResult *lookup_result,
* when @lookup_result_a is before @lookup_result_b, 0 when they are the same * when @lookup_result_a is before @lookup_result_b, 0 when they are the same
* and value greater than 0, when @lookup_result_a is after @lookup_result_b. * and value greater than 0, when @lookup_result_a is after @lookup_result_b.
* *
* The comparison is done on kind, priority and display name values, in this order. * The comparison is done on kind, is-complete, priority and display name values,
* in this order.
* *
* Returns: strcmp()-like value, what the position between @lookup_result_a and * Returns: strcmp()-like value, what the position between @lookup_result_a and
* @lookup_result_b is. * @lookup_result_b is.
...@@ -216,6 +241,9 @@ e_config_lookup_result_compare (gconstpointer lookup_result_a, ...@@ -216,6 +241,9 @@ e_config_lookup_result_compare (gconstpointer lookup_result_a,
res = e_config_lookup_result_get_kind (lra) - e_config_lookup_result_get_kind (lrb); res = e_config_lookup_result_get_kind (lra) - e_config_lookup_result_get_kind (lrb);
if (!res)
res = (e_config_lookup_result_get_is_complete (lra) ? -1 : 0) - (e_config_lookup_result_get_is_complete (lrb) ? -1 : 0);
if (!res) if (!res)
res = e_config_lookup_result_get_priority (lra) - e_config_lookup_result_get_priority (lrb); res = e_config_lookup_result_get_priority (lra) - e_config_lookup_result_get_priority (lrb);
......
...@@ -60,6 +60,7 @@ struct _EConfigLookupResultInterface { ...@@ -60,6 +60,7 @@ struct _EConfigLookupResultInterface {
EConfigLookupResultKind EConfigLookupResultKind
(* get_kind) (EConfigLookupResult *lookup_result); (* get_kind) (EConfigLookupResult *lookup_result);
gint (* get_priority) (EConfigLookupResult *lookup_result); gint (* get_priority) (EConfigLookupResult *lookup_result);
gboolean (* get_is_complete) (EConfigLookupResult *lookup_result);
const gchar * (* get_protocol) (EConfigLookupResult *lookup_result); const gchar * (* get_protocol) (EConfigLookupResult *lookup_result);
const gchar * (* get_display_name) (EConfigLookupResult *lookup_result); const gchar * (* get_display_name) (EConfigLookupResult *lookup_result);
const gchar * (* get_description) (EConfigLookupResult *lookup_result); const gchar * (* get_description) (EConfigLookupResult *lookup_result);
...@@ -71,6 +72,7 @@ GType e_config_lookup_result_get_type (void); ...@@ -71,6 +72,7 @@ GType e_config_lookup_result_get_type (void);
EConfigLookupResultKind EConfigLookupResultKind
e_config_lookup_result_get_kind (EConfigLookupResult *lookup_result); e_config_lookup_result_get_kind (EConfigLookupResult *lookup_result);
gint e_config_lookup_result_get_priority (EConfigLookupResult *lookup_result); gint e_config_lookup_result_get_priority (EConfigLookupResult *lookup_result);
gboolean e_config_lookup_result_get_is_complete (EConfigLookupResult *lookup_result);
const gchar * e_config_lookup_result_get_protocol (EConfigLookupResult *lookup_result); const gchar * e_config_lookup_result_get_protocol (EConfigLookupResult *lookup_result);
const gchar * e_config_lookup_result_get_display_name (EConfigLookupResult *lookup_result); const gchar * e_config_lookup_result_get_display_name (EConfigLookupResult *lookup_result);
const gchar * e_config_lookup_result_get_description (EConfigLookupResult *lookup_result); const gchar * e_config_lookup_result_get_description (EConfigLookupResult *lookup_result);
......
...@@ -585,6 +585,7 @@ e_mail_config_lookup_result_new (EConfigLookupResultKind kind, ...@@ -585,6 +585,7 @@ e_mail_config_lookup_result_new (EConfigLookupResultKind kind,
mail_result = g_object_new (E_TYPE_MAIL_CONFIG_LOOKUP_RESULT, mail_result = g_object_new (E_TYPE_MAIL_CONFIG_LOOKUP_RESULT,
"kind", kind, "kind", kind,
"priority", priority, "priority", priority,
"is-complete", TRUE,
"protocol", protocol, "protocol", protocol,
"display-name", display_name, "display-name", display_name,
"description", description, "description", description,
......
...@@ -290,8 +290,9 @@ mail_config_assistant_config_lookup_run_cb (GObject *source_object, ...@@ -290,8 +290,9 @@ mail_config_assistant_config_lookup_run_cb (GObject *source_object,
{ {
EMailConfigAssistantPrivate *priv; EMailConfigAssistantPrivate *priv;
ConfigLookupContext *context; ConfigLookupContext *context;
gint n_pages, ii; gint n_pages, ii, complete = 0;
gboolean any_configured = FALSE; gboolean any_configured = FALSE;