@ -483,14 +483,15 @@ void
gnc_launch_assoc ( const char * uri )
{
wchar_t * winuri = NULL ;
gchar * filename = NULL ;
/* ShellExecuteW open doesn't decode http escapes if it's passed a
* file URI so we have to do it . */
if ( gnc_uri_is_file_uri ( uri ) )
{
gchar * uri_ue = g_uri_unescape_string ( uri , NULL ) ;
gchar * filename = gnc_uri_get_path ( uri_ue ) ;
filename = gnc_uri_get_path ( uri_ue ) ;
filename = g_strdelimit ( filename , " / " , ' \\ ' ) ; // needed for unc paths
winuri = ( wchar_t * ) g_utf8_to_utf16 ( filename , - 1 , NULL , NULL , NULL ) ;
g_free ( filename ) ;
g_free ( uri_ue ) ;
}
else
@ -505,10 +506,11 @@ gnc_launch_assoc (const char *uri)
{
const gchar * message =
_ ( " GnuCash could not find the associated file " ) ;
gnc_error_dialog ( NULL , " %s: %s" , message , uri ) ;
gnc_error_dialog ( NULL , " %s: \n %s " , message , filename ) ;
}
g_free ( wincmd ) ;
g_free ( winuri ) ;
g_free ( filename ) ;
}
}
@ -533,9 +535,23 @@ gnc_launch_assoc (const char *uri)
g_assert ( error ! = NULL ) ;
{
gchar * error_uri = NULL ;
const gchar * message =
_ ( " GnuCash could not open the associated URI: " ) ;
gnc_error_dialog ( NULL , " %s \n %s " , message , uri ) ;
if ( gnc_uri_is_file_uri ( uri ) )
{
gchar * uri_ue = g_uri_unescape_string ( uri , NULL ) ;
gchar * filename = gnc_uri_get_path ( uri_ue ) ;
error_uri = g_strdup ( filename ) ;
g_free ( uri_ue ) ;
g_free ( filename ) ;
}
else
error_uri = g_strdup ( uri ) ;
gnc_error_dialog ( NULL , " %s \n %s " , message , error_uri ) ;
g_free ( error_uri ) ;
}
PERR ( " %s " , error - > message ) ;
g_error_free ( error ) ;