[gnumeric] Call pygobject_init() if needed. [#368]
- From: Jean Bréfort <jbrefort src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Call pygobject_init() if needed. [#368]
- Date: Tue, 20 Nov 2018 16:53:42 +0000 (UTC)
commit 54b4c077f90782ac7aa774576f45d4abb797025c
Author: Jean Brefort <jean brefort normalesup org>
Date: Tue Nov 20 17:52:33 2018 +0100
Call pygobject_init() if needed. [#368]
NEWS | 1 +
plugins/python-loader/ChangeLog | 6 ++++++
plugins/python-loader/python-loader.c | 23 ++++++++++++++++++-----
src/dialogs/ChangeLog | 4 +---
4 files changed, 26 insertions(+), 8 deletions(-)
---
diff --git a/NEWS b/NEWS
index 9067c2177..3c9ac77ab 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ Gnumeric 1.12.44
Jean:
* Fix document properties types. [#367]
+ * Call pygobject_init() if needed. [#368]
Morten:
* Fix SWITCH's default argument. [#354]
diff --git a/plugins/python-loader/ChangeLog b/plugins/python-loader/ChangeLog
index 4d16d6fde..9811e7c5e 100644
--- a/plugins/python-loader/ChangeLog
+++ b/plugins/python-loader/ChangeLog
@@ -1,3 +1,9 @@
+2018-11-20 Jean Brefort <jean brefort normalesup org>
+
+ * python-loader.c (gplp_func_file_probe), (gplp_func_file_open),
+ (gplp_func_file_save), (gplp_func_exec_action),
+ (gplp_service_unload): call pygobject_init() if needed. [#368]
+
2018-08-19 Morten Welinder <terra gnome org>
* Release 1.12.43
diff --git a/plugins/python-loader/python-loader.c b/plugins/python-loader/python-loader.c
index 4018274df..617256581 100644
--- a/plugins/python-loader/python-loader.c
+++ b/plugins/python-loader/python-loader.c
@@ -222,7 +222,10 @@ gplp_func_file_probe (G_GNUC_UNUSED GOFileOpener const *fo, GOPluginService *ser
g_return_val_if_fail (GO_IS_PLUGIN_SERVICE_FILE_OPENER (service), FALSE);
g_return_val_if_fail (input != NULL, FALSE);
- g_return_val_if_fail (_PyGObject_API != NULL, FALSE);
+ if (_PyGObject_API == NULL) {
+ pygobject_init (3, 0, 0);
+ g_return_if_fail (_PyGObject_API != NULL);
+ }
loader_data = g_object_get_data (G_OBJECT (service), "loader_data");
SWITCH_TO_PLUGIN (go_plugin_service_get_plugin (service));
@@ -265,7 +268,10 @@ gplp_func_file_open (G_GNUC_UNUSED GOFileOpener const *fo,
g_return_if_fail (GO_IS_PLUGIN_SERVICE_FILE_OPENER (service));
g_return_if_fail (input != NULL);
- g_return_if_fail (_PyGObject_API != NULL);
+ if (_PyGObject_API == NULL) {
+ pygobject_init (3, 0, 0);
+ g_return_if_fail (_PyGObject_API != NULL);
+ }
old_sheet = wb_view_cur_sheet (wb_view);
@@ -374,6 +380,10 @@ gplp_func_file_save (G_GNUC_UNUSED GOFileSaver const *fs, GOPluginService *servi
g_return_if_fail (GO_IS_PLUGIN_SERVICE_FILE_SAVER (service));
g_return_if_fail (output != NULL);
+ if (_PyGObject_API == NULL) {
+ pygobject_init (3, 0, 0);
+ g_return_if_fail (_PyGObject_API != NULL);
+ }
g_return_if_fail (_PyGObject_API != NULL);
saver_data = g_object_get_data (G_OBJECT (service), "loader_data");
@@ -788,7 +798,10 @@ gplp_func_exec_action (GOPluginService *service,
ServiceLoaderDataUI *loader_data;
PyObject *fn, *ret;
- g_return_if_fail (_PyGObject_API != NULL);
+ if (_PyGObject_API == NULL) {
+ pygobject_init (3, 0, 0);
+ g_return_if_fail (_PyGObject_API != NULL);
+ }
GO_INIT_RET_ERROR_INFO (ret_error);
loader_data = g_object_get_data (G_OBJECT (service), "loader_data");
@@ -880,9 +893,9 @@ static gboolean
gplp_service_unload (GOPluginLoader *l, GOPluginService *s, GOErrorInfo **err)
{
if (GNM_IS_PLUGIN_SERVICE_FUNCTION_GROUP (s))
- ;
- else if (GNM_IS_PLUGIN_SERVICE_UI (s))
gplp_unload_service_function_group (l, s, err);
+ else if (GNM_IS_PLUGIN_SERVICE_UI (s))
+ ;
else
return FALSE;
return TRUE;
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 56f7a1e19..11966641e 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,8 +1,6 @@
2018-11-19 Jean Brefort <jean brefort normalesup org>
- reviewed by: <delete if not using a buddy>
-
- * doc-meta-data.ui:
+ * doc-meta-data.ui: fix dataid type, a better fix for #367.
2018-11-18 Jean Brefort <jean brefort normalesup org>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]