[Xfce4-commits] <midori:master> Clean up data file handling in Form History
Christian Dywan
noreply at xfce.org
Sun May 22 15:52:01 CEST 2011
Updating branch refs/heads/master
to 6cc4c9db4e56d6e9e2e1bdc44678eac21d61d3aa (commit)
from a95f2f0f7facd379de0ce1fa1bf01c0fdb4b6a10 (commit)
commit 6cc4c9db4e56d6e9e2e1bdc44678eac21d61d3aa
Author: Paweł Forysiuk <tuxator at o2.pl>
Date: Sun May 22 15:49:49 2011 +0200
Clean up data file handling in Form History
extensions/formhistory.c | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/extensions/formhistory.c b/extensions/formhistory.c
index dc5daed..9fbc19a 100644
--- a/extensions/formhistory.c
+++ b/extensions/formhistory.c
@@ -27,24 +27,30 @@ static gchar* jsforms;
static gboolean
formhistory_prepare_js ()
{
- gchar* data_name;
gchar* data_path;
gchar* autosuggest;
gchar* style;
guint i;
gchar* file;
- data_name = g_build_filename (PACKAGE_NAME, "res", NULL);
- data_path = sokoke_find_data_filename (data_name);
- g_free (data_name);
- file = g_build_filename (data_path, G_DIR_SEPARATOR_S, "autosuggestcontrol.js",NULL);
+ data_path = g_build_filename (PACKAGE_NAME, "res", "autosuggestcontrol.js", NULL);
+ file = sokoke_find_data_filename (data_path);
if (!g_file_get_contents (file, &autosuggest, NULL, NULL))
+ {
+ g_free (data_path);
+ g_free (file);
return FALSE;
+ }
g_strchomp (autosuggest);
- file = g_build_filename (data_path, G_DIR_SEPARATOR_S, "autosuggestcontrol.css",NULL);
- if(!g_file_get_contents (file, &style, NULL, NULL))
+ katze_assign (data_path, g_build_filename (PACKAGE_NAME, "res", "autosuggestcontrol.css", 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;
+ }
g_strchomp (style);
i = 0;
while (style[i])
More information about the Xfce4-commits
mailing list