gnucash maint: Bug 775385 - Confusing error message which includes the text "file file"

John Ralls jralls at code.gnucash.org
Fri Dec 9 19:38:07 EST 2016


Updated	 via  https://github.com/Gnucash/gnucash/commit/fc3dc3e7 (commit)
	from  https://github.com/Gnucash/gnucash/commit/7b7c780a (commit)



commit fc3dc3e7a84ebed127e3d074e8db36aa10603b8f
Author: John Ralls <jralls at ceridwen.us>
Date:   Fri Dec 9 16:09:33 2016 -0800

    Bug 775385 - Confusing error message which includes the text "file file"
    
    Remove the scheme from file URIs before displaying
    error messages and change the one file error message that can show up in
    database dialogs to say "file/URI foo" instead of "file foo".

diff --git a/src/gnome-utils/gnc-file.c b/src/gnome-utils/gnc-file.c
index 62b253b..ed01fa9 100644
--- a/src/gnome-utils/gnc-file.c
+++ b/src/gnome-utils/gnc-file.c
@@ -206,7 +206,12 @@ show_session_error (QofBackendError io_error,
     else if (! gnc_uri_is_file_uri (newfile)) /* Hide the db password in error messages */
         displayname = gnc_uri_normalize_uri ( newfile, FALSE);
     else
-        displayname = g_strdup (newfile);
+    {
+        /* Strip the protocol from the file name. */
+        char *uri = gnc_uri_normalize_uri(newfile, FALSE);
+        displayname = gnc_uri_get_path(uri);
+        g_free(uri);
+    }
 
     switch (io_error)
     {
@@ -366,7 +371,7 @@ show_session_error (QofBackendError io_error,
         }
         else
         {
-            fmt = _("The file %s could not be found.");
+            fmt = _("The file/URI %s could not be found.");
             gnc_error_dialog (parent, fmt, displayname);
         }
         break;



Summary of changes:
 src/gnome-utils/gnc-file.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)



More information about the gnucash-changes mailing list