[dia] Fix SOZI_PATH specific code.
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] Fix SOZI_PATH specific code.
- Date: Thu, 22 Jan 2015 20:12:56 +0000 (UTC)
commit 3939b5d1977e164e104da406e0f82d1d14b405f0
Author: Paul Chavent <paul chavent fnac net>
Date: Sun Jan 18 22:06:09 2015 +0100
Fix SOZI_PATH specific code.
External ressources array size.
Log message more concise.
Signed-off-by: Hans Breuer <hans breuer org>
objects/Sozi/sozi-object.c | 22 +++++++---------------
1 files changed, 7 insertions(+), 15 deletions(-)
---
diff --git a/objects/Sozi/sozi-object.c b/objects/Sozi/sozi-object.c
index 27c1d6f..0db90a9 100644
--- a/objects/Sozi/sozi-object.c
+++ b/objects/Sozi/sozi-object.c
@@ -101,25 +101,23 @@ sozi_player_get(gchar **sozi_version_ptr, gchar **sozi_js_ptr, gchar **sozi_extr
{
const gchar * filename;
gchar ** data;
- } external_sozi[3] =
+ } external_sozi[] =
{
- { SOZI_PATH"/sozi.version" , sozi_version_ptr },
- { SOZI_PATH"/sozi.js" , sozi_js_ptr },
- { SOZI_PATH"/extras/sozi_extras_media.js" , sozi_extras_media_js_ptr },
- { SOZI_PATH"/sozi.css" , sozi_css_ptr }
+ { SOZI_PATH"/sozi.version" , sozi_version_ptr },
+ { SOZI_PATH"/sozi.js" , sozi_js_ptr },
+ { SOZI_PATH"/sozi_extras_media.js" , sozi_extras_media_js_ptr },
+ { SOZI_PATH"/sozi.css" , sozi_css_ptr }
};
static const unsigned external_sozi_cnt = sizeof(external_sozi)/sizeof(external_sozi[0]);
unsigned i;
-
+
for (i = 0; i < external_sozi_cnt; i++) {
GError * err = 0;
if (!g_file_get_contents(external_sozi[i].filename,
external_sozi[i].data,
NULL,
&err)) {
- message_error("sozi-object : unable to read file \"%s\" : %s",
- external_sozi[i].filename,
- err->message);
+ message_error("sozi-object : %s\nWill use builtin player", err->message);
g_error_free (err);
while(i--) {
g_free (*external_sozi[i].data);
@@ -132,8 +130,6 @@ sozi_player_get(gchar **sozi_version_ptr, gchar **sozi_js_ptr, gchar **sozi_extr
/* that's ok, don't need to go further */
return;
}
-
- dia_log_message("sozi-object : use builtin player");
#endif /* defined(SOZI_PATH) */
/* if SOZI_PATH isn't defined, fallback to the player that comes with dia sources */
@@ -141,10 +137,6 @@ sozi_player_get(gchar **sozi_version_ptr, gchar **sozi_js_ptr, gchar **sozi_extr
*sozi_js_ptr = g_strdup((const gchar *)sozi_min_js);
*sozi_extras_media_js_ptr = g_strdup((const gchar *)sozi_extras_media_min_js);
*sozi_css_ptr = g_strdup((const gchar *)sozi_min_css);
-
-#if defined(SOZI_PATH)
- dia_log_message("sozi-object : use sozi player version '%s'", *sozi_version_ptr);
-#endif /* defined(SOZI_PATH) */
}
/******************************************************************************
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]