From 0e7bb3210dc91cde7a9dffecc3c8447f9789c295 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Wed, 17 Aug 2005 18:53:08 +0000 Subject: Use g_filename_display_name for displaying filenames and revert string 2005-08-17 Carlos Garcia Campos * ps/ps-document.c: Use g_filename_display_name for displaying filenames and revert string freeze breackage --- (limited to 'ps/ps-document.c') diff --git a/ps/ps-document.c b/ps/ps-document.c index f9663e5..5a4a457 100644 --- a/ps/ps-document.c +++ b/ps/ps-document.c @@ -904,19 +904,13 @@ check_filecompressed (PSDocument * gs) /* sucessfully uncompressed file */ gs->gs_filename_unc = filename_unc; } else { - gchar *utf8 = NULL; + gchar *filename_dsp; gchar *msg; /* report error */ - utf8 = g_locale_to_utf8 (gs->gs_filename, -1, NULL, NULL, NULL); - - if (utf8) { - msg = g_strdup_printf (_("Error while decompressing file %s:\n"), utf8); - } else { - msg = g_strdup (_("Error while decompressing file\n")); - } - - g_free (utf8); + filename_dsp = g_filename_display_name (gs->gs_filename); + msg = g_strdup_printf (_("Error while decompressing file %s:\n"), filename_dsp); + g_free (filename_dsp); interpreter_failed (gs, msg); g_free (msg); @@ -971,18 +965,12 @@ document_load (PSDocument *gs, const gchar *fname) gchar *filename = NULL; if (!file_readable(fname)) { - gchar *utf8 = NULL; + gchar *filename_dsp; gchar *msg; - utf8 = g_locale_to_utf8 (fname, -1, NULL, NULL, NULL); - - if (utf8) { - msg = g_strdup_printf (_("Cannot open file %s.\n"), utf8); - } else { - msg = g_strdup (_("Cannot open file.\n")); - } - - g_free (utf8); + filename_dsp = g_filename_display_name (fname); + msg = g_strdup_printf (_("Cannot open file %s.\n"), filename_dsp); + g_free (filename_dsp); interpreter_failed (gs, msg); g_free (msg); @@ -1097,22 +1085,16 @@ ps_document_load (EvDocument *document, result = document_load (PS_DOCUMENT (document), filename); if (!result) { - gchar *utf8 = NULL; + gchar *filename_dsp; - utf8 = g_locale_to_utf8 (filename, -1, NULL, NULL, NULL); + filename_dsp = g_filename_display_name (filename); - if (utf8) { - g_set_error (error, G_FILE_ERROR, - G_FILE_ERROR_FAILED, - _("Failed to load document '%s'"), - utf8); - } else { - g_set_error (error, G_FILE_ERROR, - G_FILE_ERROR_FAILED, - _("Failed to load document")); - } + g_set_error (error, G_FILE_ERROR, + G_FILE_ERROR_FAILED, + _("Failed to load document '%s'"), + filename_dsp); - g_free (utf8); + g_free (filename_dsp); } g_free (filename); -- cgit v0.9.1