From ff06bb256c9b7180139decc2db5094aca24599f3 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Sun, 5 Jul 2015 18:30:45 +0200 Subject: [PATCH] Alcuni aggiustamenti. --- .anjuta/session/anjuta.session | 1 + .anjuta_sym_db.db | Bin 983040 -> 983040 bytes .gitignore | 3 +++ configure.ac | 11 ++++++++--- src/Makefile.am | 2 ++ src/ooo.c | 32 +++++++++++++++++++++----------- 6 files changed, 35 insertions(+), 14 deletions(-) diff --git a/.anjuta/session/anjuta.session b/.anjuta/session/anjuta.session index 70a2860..a999cde 100644 --- a/.anjuta/session/anjuta.session +++ b/.anjuta/session/anjuta.session @@ -6,6 +6,7 @@ Geometry=1366x715+0+27 bookmarks=\n\n [Project Manager] +Shortcut=libsolipa//src//libsolipa.la%%%libsolipa//src//libsolipaooo.la%%%libsolipa//tests//allegato%%%libsolipa//tests//mail%%%libsolipa//tests//mail_check_address%%%libsolipa//tests//mail_get_addresses_from_string%%%libsolipa//tests//mailui%%%libsolipa//tests//ooo%%%libsolipa//tests//progresswindow%%%libsolipa//tests//utils%%%libsolipa//tests//utils_apri_collegamento%%%libsolipa//tests//utils_codfisc_piva%%%libsolipa//tests//utils_format_money%%%libsolipa//tests//utils_gdatetime%%%libsolipa//tests//utils_gstring_initial_capital%%%libsolipa//tests//utils_gtktreemodel_copy%%%libsolipa//tests//utils_infobar%%%libsolipa//tests//utils_round Expand=libsolipa [Execution] diff --git a/.anjuta_sym_db.db b/.anjuta_sym_db.db index a79f5d0a423df85fbfffeef2097d485b8119453e..951228fd5cb0b7d9b384fa97e28fc00265376f49 100644 GIT binary patch delta 313 zcmZo@uxV(pnIJ7_$iToL2gEQSJWp?g z8kkD|BLs{Lr#I9ymm&+aH88g|uxx8!l@4R%+%9vCbu}Z0REi>-Eh8hx^ov`0q^7^T z&bos0Vv-7*BO?>c+_v5OChI3I#=v&FC#*os2E^<@%mKulK+FZi z+(68;-R=qR!6HVf=^LH-RHwgB2NGW4d_jzyAc27CZ^QZG7%xu05Wy!pecls3?&&!Z ae91u5fdXq~83U(ZEaMZ~KBbH=rxO6wYvr$tUq6WxPEK> ziu#!wHy+B~cwoQq_L=_~V;UxZ{V%wkt$`{3KewT!f{~$>p@EgD#q@@H=2B#Vwg%?5 z29|9NtkPkOjN4_dv94z15K2*Gvt?xDn0|39kJR*+*I8F^o=j3y7#pvB`_kY= 0.5.0 libgtkform >= 0.5.0 gio-2.0 >= 2.36 - gio-windows-2.0 >= 2.36 - gtk+-3.0 >= 3.0 - gtk+-win32-3.0 >= 3.0]) + gtk+-3.0 >= 3.0]) AC_SUBST(SOLIPA_CFLAGS) AC_SUBST(SOLIPA_LIBS) @@ -93,6 +91,13 @@ esac AM_CONDITIONAL(PLATFORM_WIN32, [test $platform_win32 = yes]) +if test x$platform_win32 = xyes; then + PKG_CHECK_MODULES(SOLIPA_WIN32, [gio-windows-2.0 >= 2.36 + gtk+-win32-3.0 >= 3.0]) +fi +AC_SUBST(SOLIPA_WIN32_CFLAGS) +AC_SUBST(SOLIPA_WIN32_LIBS) + # Output files AC_CONFIG_FILES([ libsolipa.pc diff --git a/src/Makefile.am b/src/Makefile.am index a178933..6421d3f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,6 +7,7 @@ WIN32_LIBS= endif LIBS = $(SOLIPA_LIBS) \ + $(SOLIPA_WIN32_LIBS) \ $(CAMEL_LIBS) \ $(WIN32_LIBS) @@ -21,6 +22,7 @@ endif endif AM_CPPFLAGS = $(SOLIPA_CFLAGS) \ + $(SOLIPA_WIN32_CFLAGS) \ $(CAMEL_CFLAGS) \ -DGUIDIR=\""$(guidir)"\" \ -DG_LOG_DOMAIN=\"Solipa\" \ diff --git a/src/ooo.c b/src/ooo.c index c4475cb..ccdcbcc 100644 --- a/src/ooo.c +++ b/src/ooo.c @@ -450,7 +450,11 @@ solipa_ooo_pycmd_apri_openoffice (SolipaOOO *ooo) gchar *curdir; curdir = g_get_current_dir (); - chdir (priv->ooo_path); + if (g_chdir (priv->ooo_path) == -1) + { + g_warning ("Unable to change directory"); + return FALSE; + } str = g_string_new (ENCODING "\n"); @@ -544,8 +548,13 @@ solipa_ooo_pycmd_apri_openoffice (SolipaOOO *ooo) gtk_widget_destroy (dialog); - chdir (curdir); + if (g_chdir (curdir) == -1) + { + g_warning ("Unable to change directory."); + } g_free (curdir); + + return TRUE; } static gboolean @@ -774,9 +783,6 @@ solipa_ooo_salva_documento (SolipaOOO *ooo, const gchar *filename) { gchar *str; - PyObject *obj; - - SolipaOOOPrivate *priv = SOLIPA_OOO_GET_PRIVATE (ooo); str = solipa_ooo_pycmd_salva_documento (ooo, filename); PyRun_SimpleString (str); @@ -818,9 +824,6 @@ solipa_ooo_salva_documento_pdf (SolipaOOO *ooo, const gchar *filename) { gchar *str; - PyObject *obj; - - SolipaOOOPrivate *priv = SOLIPA_OOO_GET_PRIVATE (ooo); str = solipa_ooo_pycmd_salva_documento_pdf (ooo, filename); @@ -891,7 +894,7 @@ solipa_ooo_pycmd_exec_script (SolipaOOO *ooo, const gchar *body) str = g_string_new (solipa_ooo_pycmd_header (ooo)); - g_string_append_printf (str, body); + g_string_append (str, body); /* creo il file temporaneo da eseguire */ stream = NULL; @@ -920,7 +923,11 @@ solipa_ooo_pycmd_exec_script (SolipaOOO *ooo, const gchar *body) g_output_stream_close (ostream, NULL, &error); gchar *curdir = g_get_current_dir (); - chdir (priv->ooo_path); + if (g_chdir (priv->ooo_path) == -1) + { + g_warning ("Unable to change directory."); + return; + } tmp_path = g_file_get_path (gfile); g_string_printf (str, "python.exe %s", tmp_path); @@ -930,7 +937,10 @@ solipa_ooo_pycmd_exec_script (SolipaOOO *ooo, const gchar *body) pclose (pipa); - chdir (curdir); + if (g_chdir (curdir) == -1) + { + g_warning ("Unable to change directory."); + } g_free (curdir); /* elimino il file */ -- 2.49.0