From: Andrea Zagli Date: Sun, 5 Jul 2015 16:30:45 +0000 (+0200) Subject: Alcuni aggiustamenti. X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=ff06bb256c9b7180139decc2db5094aca24599f3;p=solipa%2Flibsolipa Alcuni aggiustamenti. --- 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 a79f5d0..951228f 100644 Binary files a/.anjuta_sym_db.db and b/.anjuta_sym_db.db differ diff --git a/.gitignore b/.gitignore index b7716d9..1b4271e 100644 --- a/.gitignore +++ b/.gitignore @@ -54,11 +54,14 @@ tests/mail tests/mail_get_addresses_from_string tests/mail_check_address tests/mailui +tests/log tests/ooo +tests/ooo_pycmd tests/progresswindow tests/utils tests/utils_apri_collegamento tests/utils_codfisc_piva +tests/utils_compare_version tests/utils_format_money tests/utils_gdatetime tests/utils_gstring_initial_capital diff --git a/configure.ac b/configure.ac index 0302e63..aaa7771 100644 --- a/configure.ac +++ b/configure.ac @@ -33,9 +33,7 @@ AC_PROG_RANLIB PKG_CHECK_MODULES(SOLIPA, [libgdaex >= 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 */