[devhelp] SettingsBuilder: set default paths only if needed
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp] SettingsBuilder: set default paths only if needed
- Date: Mon, 2 Apr 2018 13:33:18 +0000 (UTC)
commit 121ed0933cd72fbcc0f9331572695a0c1f5fa24e
Author: Sébastien Wilmet <swilmet gnome org>
Date: Mon Apr 2 15:31:03 2018 +0200
SettingsBuilder: set default paths only if needed
devhelp/dh-settings-builder.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/devhelp/dh-settings-builder.c b/devhelp/dh-settings-builder.c
index bc7745d..29144ea 100644
--- a/devhelp/dh-settings-builder.c
+++ b/devhelp/dh-settings-builder.c
@@ -80,14 +80,6 @@ static void
dh_settings_builder_init (DhSettingsBuilder *builder)
{
builder->priv = dh_settings_builder_get_instance_private (builder);
-
- /* Set default paths.
- * Use all the set functions to test those code paths, instead of
- * calling g_strdup() directly.
- */
-
- // Must be compatible with Devhelp app version 3.28:
- dh_settings_builder_set_contents_path (builder, "/org/gnome/devhelp/state/main/contents/");
}
/**
@@ -109,7 +101,7 @@ dh_settings_builder_new (void)
*
* Sets the path for the "contents" schema.
*
- * If this function is not called, the default path for this schema will be
+ * If you don't call this function, the default path for this schema will be
* used.
*
* Since: 3.30
@@ -137,5 +129,14 @@ dh_settings_builder_create_object (DhSettingsBuilder *builder)
{
g_return_val_if_fail (DH_IS_SETTINGS_BUILDER (builder), NULL);
+ /* Set default paths if needed.
+ * Use all the set functions to test them, to have the same code paths
+ * as if the set functions were already called.
+ */
+ if (builder->priv->contents_path == NULL) {
+ // Must be compatible with Devhelp app version 3.28:
+ dh_settings_builder_set_contents_path (builder, "/org/gnome/devhelp/state/main/contents/");
+ }
+
return _dh_settings_new (builder->priv->contents_path);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]