Clean up data file handling in Form History
This commit is contained in:
parent
a95f2f0f7f
commit
6cc4c9db4e
1 changed files with 13 additions and 7 deletions
|
@ -27,24 +27,30 @@ static gchar* jsforms;
|
||||||
static gboolean
|
static gboolean
|
||||||
formhistory_prepare_js ()
|
formhistory_prepare_js ()
|
||||||
{
|
{
|
||||||
gchar* data_name;
|
|
||||||
gchar* data_path;
|
gchar* data_path;
|
||||||
gchar* autosuggest;
|
gchar* autosuggest;
|
||||||
gchar* style;
|
gchar* style;
|
||||||
guint i;
|
guint i;
|
||||||
gchar* file;
|
gchar* file;
|
||||||
|
|
||||||
data_name = g_build_filename (PACKAGE_NAME, "res", NULL);
|
data_path = g_build_filename (PACKAGE_NAME, "res", "autosuggestcontrol.js", NULL);
|
||||||
data_path = sokoke_find_data_filename (data_name);
|
file = sokoke_find_data_filename (data_path);
|
||||||
g_free (data_name);
|
|
||||||
file = g_build_filename (data_path, G_DIR_SEPARATOR_S, "autosuggestcontrol.js",NULL);
|
|
||||||
if (!g_file_get_contents (file, &autosuggest, NULL, NULL))
|
if (!g_file_get_contents (file, &autosuggest, NULL, NULL))
|
||||||
|
{
|
||||||
|
g_free (data_path);
|
||||||
|
g_free (file);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
g_strchomp (autosuggest);
|
g_strchomp (autosuggest);
|
||||||
|
|
||||||
file = g_build_filename (data_path, G_DIR_SEPARATOR_S, "autosuggestcontrol.css",NULL);
|
katze_assign (data_path, g_build_filename (PACKAGE_NAME, "res", "autosuggestcontrol.css", NULL));
|
||||||
if(!g_file_get_contents (file, &style, NULL, NULL))
|
katze_assign (file, sokoke_find_data_filename (data_path));
|
||||||
|
if (!g_file_get_contents (file, &style, NULL, NULL))
|
||||||
|
{
|
||||||
|
g_free (data_path);
|
||||||
|
g_free (file);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
g_strchomp (style);
|
g_strchomp (style);
|
||||||
i = 0;
|
i = 0;
|
||||||
while (style[i])
|
while (style[i])
|
||||||
|
|
Loading…
Reference in a new issue