config_dir = midori_extension_get_config_dir (extension);
config_file = g_build_filename (config_dir, "addons", NULL);
- katze_mkdir_with_parents (config_dir, 0700);
+ if (config_dir != NULL)
+ katze_mkdir_with_parents (config_dir, 0700);
sokoke_key_file_save_to_file (keyfile, config_file, &error);
- /* If the folder is /, this is a test run, thus no error */
- if (error && !g_str_equal (config_dir, "/"))
+ if (error && midori_extension_get_config_dir (extension) != NULL)
{
g_warning (_("The configuration of the extension '%s' couldn't be saved: %s\n"),
_("User addons"), error->message);
formhistory_construct_popup_gui (priv);
config_dir = midori_extension_get_config_dir (extension);
- katze_mkdir_with_parents (config_dir, 0700);
+ if (config_dir != NULL)
+ katze_mkdir_with_parents (config_dir, 0700);
filename = g_build_filename (config_dir, "forms.db", NULL);
if (sqlite3_open (filename, &db) != SQLITE_OK)
{
- /* If the folder is /, this is a test run, thus no error */
- if (!g_str_equal (midori_extension_get_config_dir (extension), "/"))
+ if (config_dir != NULL)
g_warning (_("Failed to open database: %s\n"), sqlite3_errmsg (db));
sqlite3_close (db);
}
if (!extension->priv->config_dir)
{
gchar* filename = g_object_get_data (G_OBJECT (extension), "filename");
- if (!filename)
- return "/";
- extension->priv->config_dir = g_build_filename (
- midori_paths_get_config_dir (), "extensions", filename, NULL);
+ if (filename != NULL)
+ extension->priv->config_dir = g_build_filename (
+ midori_paths_get_config_dir (), "extensions", filename, NULL);
+ else
+ extension->priv->config_dir = NULL;
}
return extension->priv->config_dir;