Save extension settings to a filename based folder
This prevents different folders from being created depending on the user language.
This commit is contained in:
parent
a6bea88932
commit
05967054c6
1 changed files with 7 additions and 4 deletions
|
@ -459,8 +459,7 @@ midori_extension_get_app (MidoriExtension* extension)
|
||||||
* @extension: a #MidoriExtension
|
* @extension: a #MidoriExtension
|
||||||
*
|
*
|
||||||
* Retrieves the path to a directory reserved for configuration
|
* Retrieves the path to a directory reserved for configuration
|
||||||
* files specific to the extension. For that purpose the 'name'
|
* files specific to the extension.
|
||||||
* of the extension is actually part of the path.
|
|
||||||
*
|
*
|
||||||
* If settings are installed on the extension, they will be
|
* If settings are installed on the extension, they will be
|
||||||
* loaded from and saved to a file "config" in this path.
|
* loaded from and saved to a file "config" in this path.
|
||||||
|
@ -470,12 +469,16 @@ midori_extension_get_app (MidoriExtension* extension)
|
||||||
const gchar*
|
const gchar*
|
||||||
midori_extension_get_config_dir (MidoriExtension* extension)
|
midori_extension_get_config_dir (MidoriExtension* extension)
|
||||||
{
|
{
|
||||||
|
|
||||||
g_return_val_if_fail (midori_extension_is_prepared (extension), NULL);
|
g_return_val_if_fail (midori_extension_is_prepared (extension), NULL);
|
||||||
|
|
||||||
if (!extension->priv->config_dir)
|
if (!extension->priv->config_dir)
|
||||||
|
{
|
||||||
|
gchar* filename = g_object_get_data (G_OBJECT (extension), "filename");
|
||||||
|
g_return_val_if_fail (filename != NULL, NULL);
|
||||||
extension->priv->config_dir = g_build_filename (
|
extension->priv->config_dir = g_build_filename (
|
||||||
sokoke_set_config_dir (NULL), "extensions",
|
sokoke_set_config_dir (NULL), "extensions", filename, NULL);
|
||||||
extension->priv->name, NULL);
|
}
|
||||||
|
|
||||||
return extension->priv->config_dir;
|
return extension->priv->config_dir;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue