gnucash maint: Multiple changes pushed
Geert Janssens
gjanssens at code.gnucash.org
Wed Aug 8 09:47:32 EDT 2018
Updated via https://github.com/Gnucash/gnucash/commit/239ee679 (commit)
via https://github.com/Gnucash/gnucash/commit/e330a781 (commit)
via https://github.com/Gnucash/gnucash/commit/97c191cd (commit)
via https://github.com/Gnucash/gnucash/commit/641925f2 (commit)
from https://github.com/Gnucash/gnucash/commit/3b74574c (commit)
commit 239ee6797a95b24f8f865997cc4ddb1d91f882ae
Author: Geert Janssens <geert at kobaltwit.be>
Date: Wed Aug 8 15:46:23 2018 +0200
Fix crash when cancelling a Save As... overwrite action
This was discovered while trying to fix bug 796792. However that bug itself
is totally unrelated.
diff --git a/libgnucash/backend/xml/gnc-xml-backend.hpp b/libgnucash/backend/xml/gnc-xml-backend.hpp
index 2710115..cc3ff7c 100644
--- a/libgnucash/backend/xml/gnc-xml-backend.hpp
+++ b/libgnucash/backend/xml/gnc-xml-backend.hpp
@@ -61,6 +61,6 @@ private:
std::string m_linkfile;
int m_lockfd;
- QofBook* m_book; /* The primary, main open book */
+ QofBook* m_book = nullptr; /* The primary, main open book */
};
#endif // __GNC_XML_BACKEND_HPP__
commit e330a781f0360a1c5a031c47a67cf5fae1db6126
Merge: 3b74574 97c191c
Author: Geert Janssens <geert at kobaltwit.be>
Date: Wed Aug 8 14:22:49 2018 +0200
Merge branch 'Bug796792' of https://github.com/Bob-IT/gnucash into maint
commit 97c191cd4208fb5a8f4894968686dbe178f06bbd
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Aug 7 10:33:04 2018 +0100
Replace tabs with spaces and fix some indenting in gnc-file.c
diff --git a/gnucash/gnome-utils/gnc-file.c b/gnucash/gnome-utils/gnc-file.c
index 840601e..d983061 100644
--- a/gnucash/gnome-utils/gnc-file.c
+++ b/gnucash/gnome-utils/gnc-file.c
@@ -834,8 +834,8 @@ RESTART:
if (!show_session_error (parent, io_err, newfile, GNC_FILE_DIALOG_OPEN))
{
/* user told us to create a new database. Do it. We
- * shouldn't have to worry about locking or clobbering,
- * it's supposed to be new. */
+ * shouldn't have to worry about locking or clobbering,
+ * it's supposed to be new. */
qof_session_begin (new_session, newfile, FALSE, TRUE, FALSE);
}
}
@@ -1193,14 +1193,14 @@ gnc_file_do_export(GtkWindow *parent, const char * filename)
/* Some extra steps for file based uri's only */
if (gnc_uri_is_file_protocol(protocol))
{
- if (check_file_path (path))
- {
- show_session_error (parent, ERR_FILEIO_RESERVED_WRITE, newfile,
- GNC_FILE_DIALOG_SAVE);
- return;
- }
- gnc_set_default_directory (GNC_PREFS_GROUP_OPEN_SAVE,
- g_path_get_dirname(path));
+ if (check_file_path (path))
+ {
+ show_session_error (parent, ERR_FILEIO_RESERVED_WRITE, newfile,
+ GNC_FILE_DIALOG_SAVE);
+ return;
+ }
+ gnc_set_default_directory (GNC_PREFS_GROUP_OPEN_SAVE,
+ g_path_get_dirname(path));
}
/* Check to see if the user specified the same file as the current
* file. If so, prevent the export from happening to avoid killing this file */
@@ -1425,14 +1425,14 @@ gnc_file_do_save_as (GtkWindow *parent, const char* filename)
/* Some extra steps for file based uri's only */
if (gnc_uri_is_file_protocol(protocol))
{
- if (check_file_path (path))
- {
- show_session_error (parent, ERR_FILEIO_RESERVED_WRITE, newfile,
- GNC_FILE_DIALOG_SAVE);
- return;
- }
- gnc_set_default_directory (GNC_PREFS_GROUP_OPEN_SAVE,
- g_path_get_dirname (path));
+ if (check_file_path (path))
+ {
+ show_session_error (parent, ERR_FILEIO_RESERVED_WRITE, newfile,
+ GNC_FILE_DIALOG_SAVE);
+ return;
+ }
+ gnc_set_default_directory (GNC_PREFS_GROUP_OPEN_SAVE,
+ g_path_get_dirname (path));
}
/* Check to see if the user specified the same file as the current
commit 641925f2d0b7fc54824b7b05136ada0bd605da6f
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Aug 7 10:31:13 2018 +0100
Bug 796792 - SaveAs Overwrite dialogue in background and not visible
Firstly the wrong parent was being used for these secondary warning
messages, should be the dialogue and not the main Gnucash application so
these have been changed.
Also some of these secondary warning dialogues still had NULL as the
parent and so the transient parent warning would occur, added parent.
diff --git a/gnucash/gnome-utils/dialog-file-access.c b/gnucash/gnome-utils/dialog-file-access.c
index ce88602..3126d3b 100644
--- a/gnucash/gnome-utils/dialog-file-access.c
+++ b/gnucash/gnome-utils/dialog-file-access.c
@@ -146,15 +146,15 @@ gnc_ui_file_access_response_cb(GtkDialog *dialog, gint response, GtkDialog *unus
gboolean open_readonly = faw->readonly_checkbutton
? gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(faw->readonly_checkbutton))
: FALSE;
- gnc_file_open_file (gnc_ui_get_main_window (GTK_WIDGET (dialog)), url, open_readonly);
+ gnc_file_open_file (GTK_WINDOW(dialog), url, open_readonly);
}
else if ( faw->type == FILE_ACCESS_SAVE_AS )
{
- gnc_file_do_save_as (gnc_ui_get_main_window (GTK_WIDGET (dialog)), url);
+ gnc_file_do_save_as (GTK_WINDOW(dialog), url);
}
else if ( faw->type == FILE_ACCESS_EXPORT )
{
- gnc_file_do_export (gnc_ui_get_main_window (GTK_WIDGET (dialog)), url);
+ gnc_file_do_export (GTK_WINDOW(dialog), url);
}
break;
diff --git a/gnucash/gnome-utils/gnc-file.c b/gnucash/gnome-utils/gnc-file.c
index 72dddbe..840601e 100644
--- a/gnucash/gnome-utils/gnc-file.c
+++ b/gnucash/gnome-utils/gnc-file.c
@@ -1019,7 +1019,7 @@ RESTART:
{
gchar *message = gnc_account_name_violations_errmsg ( gnc_get_account_separator_string(),
invalid_account_names );
- gnc_warning_dialog(NULL, "%s", message);
+ gnc_warning_dialog(parent, "%s", message);
g_free ( message );
}
return TRUE;
@@ -1234,7 +1234,7 @@ gnc_file_do_export(GtkWindow *parent, const char * filename)
else
name = gnc_uri_normalize_uri ( newfile, FALSE );
/* if user says cancel, we should break out */
- if (!gnc_verify_dialog (NULL, FALSE, format, name))
+ if (!gnc_verify_dialog (parent, FALSE, format, name))
{
return;
}
@@ -1269,7 +1269,7 @@ gnc_file_do_export(GtkWindow *parent, const char * filename)
/* %s is the strerror(3) error string of the error that occurred. */
const char *format = _("There was an error saving the file.\n\n%s");
- gnc_error_dialog (NULL, format, strerror(errno));
+ gnc_error_dialog (parent, format, strerror(errno));
return;
}
}
@@ -1471,7 +1471,7 @@ gnc_file_do_save_as (GtkWindow *parent, const char* filename)
name = gnc_uri_normalize_uri ( newfile, FALSE );
/* if user says cancel, we should break out */
- if (!gnc_verify_dialog (NULL, FALSE, format, name ))
+ if (!gnc_verify_dialog (parent, FALSE, format, name ))
{
xaccLogDisable();
qof_session_destroy (new_session);
@@ -1600,7 +1600,7 @@ gnc_file_revert (GtkWindow *parent)
else
filename = fileurl;
- if (!gnc_verify_dialog (NULL, FALSE, title, filename))
+ if (!gnc_verify_dialog (parent, FALSE, title, filename))
return;
qof_book_mark_session_saved (qof_session_get_book (session));
Summary of changes:
gnucash/gnome-utils/dialog-file-access.c | 6 ++--
gnucash/gnome-utils/gnc-file.c | 46 +++++++++++++++---------------
libgnucash/backend/xml/gnc-xml-backend.hpp | 2 +-
3 files changed, 27 insertions(+), 27 deletions(-)
More information about the gnucash-changes
mailing list