From: Christian Persch Date: Thu, 5 Feb 2009 13:08:29 +0000 (+0000) Subject: Use g_set_error_literal now that we depend on glib 2.18. X-Git-Tag: EVINCE_2_25_91~60 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=ef262303183a13c3d166dd4873e74a78b38cee28;p=evince.git Use g_set_error_literal now that we depend on glib 2.18. * backend/comics/comics-document.c: (comics_document_load): * backend/djvu/djvu-document.c: (djvu_document_load): * backend/dvi/dvi-document.c: (dvi_document_load): * backend/impress/impress-document.c: (impress_document_load): * backend/pdf/ev-poppler.cc: * libdocument/ev-document-factory.c: (get_document_from_uri), (ev_document_factory_get_document): * shell/ev-print-operation.c: (ev_print_operation_export_print_dialog_response_cb): Use g_set_error_literal now that we depend on glib 2.18. svn path=/trunk/; revision=3419 --- diff --git a/ChangeLog b/ChangeLog index eae30817..b479590d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2009-02-05 Christian Persch + + * backend/comics/comics-document.c: (comics_document_load): + * backend/djvu/djvu-document.c: (djvu_document_load): + * backend/dvi/dvi-document.c: (dvi_document_load): + * backend/impress/impress-document.c: (impress_document_load): + * backend/pdf/ev-poppler.cc: + * libdocument/ev-document-factory.c: (get_document_from_uri), + (ev_document_factory_get_document): + * shell/ev-print-operation.c: + (ev_print_operation_export_print_dialog_response_cb): Use + g_set_error_literal now that we depend on glib 2.18. + 2009-02-05 Hib Eris * shell/ev-application.c: diff --git a/backend/comics/comics-document.c b/backend/comics/comics-document.c index 4bf9d831..82b3e398 100644 --- a/backend/comics/comics-document.c +++ b/backend/comics/comics-document.c @@ -156,10 +156,10 @@ comics_document_load (EvDocument *document, if (!success) { return FALSE; } else if (retval != 0) { - g_set_error (error, - EV_DOCUMENT_ERROR, - EV_DOCUMENT_ERROR_INVALID, - _("File corrupted.")); + g_set_error_literal (error, + EV_DOCUMENT_ERROR, + EV_DOCUMENT_ERROR_INVALID, + _("File corrupted.")); return FALSE; } diff --git a/backend/djvu/djvu-document.c b/backend/djvu/djvu-document.c index 0c996683..31fbd94b 100644 --- a/backend/djvu/djvu-document.c +++ b/backend/djvu/djvu-document.c @@ -241,11 +241,11 @@ djvu_document_load (EvDocument *document, g_free (filename); if (missing_files) { - g_set_error (error, - G_FILE_ERROR, - G_FILE_ERROR_EXIST, - _("The document is composed by several files. " - "One or more of such files cannot be accessed.")); + g_set_error_literal (error, + G_FILE_ERROR, + G_FILE_ERROR_EXIST, + _("The document is composed by several files. " + "One or more of such files cannot be accessed.")); return FALSE; } diff --git a/backend/dvi/dvi-document.c b/backend/dvi/dvi-document.c index 1d6ca082..e2df8753 100644 --- a/backend/dvi/dvi-document.c +++ b/backend/dvi/dvi-document.c @@ -90,10 +90,10 @@ dvi_document_load (EvDocument *document, filename = g_filename_from_uri (uri, NULL, error); if (!filename) { - g_set_error (error, - EV_DOCUMENT_ERROR, - EV_DOCUMENT_ERROR_INVALID, - _("File not available")); + g_set_error_literal (error, + EV_DOCUMENT_ERROR, + EV_DOCUMENT_ERROR_INVALID, + _("File not available")); return FALSE; } @@ -106,10 +106,10 @@ dvi_document_load (EvDocument *document, g_free (filename); if (!dvi_document->context) { - g_set_error (error, - EV_DOCUMENT_ERROR, - EV_DOCUMENT_ERROR_INVALID, - _("DVI document has incorrect format")); + g_set_error_literal (error, + EV_DOCUMENT_ERROR, + EV_DOCUMENT_ERROR_INVALID, + _("DVI document has incorrect format")); return FALSE; } diff --git a/backend/impress/impress-document.c b/backend/impress/impress-document.c index 2daf3fc3..3f7a3290 100644 --- a/backend/impress/impress-document.c +++ b/backend/impress/impress-document.c @@ -291,10 +291,10 @@ impress_document_load (EvDocument *document, filename = g_filename_from_uri (uri, NULL, error); if (!filename) { - g_set_error (error, - EV_DOCUMENT_ERROR, - EV_DOCUMENT_ERROR_INVALID, - _("Remote files aren't supported")); + g_set_error_literal (error, + EV_DOCUMENT_ERROR, + EV_DOCUMENT_ERROR_INVALID, + _("Remote files aren't supported")); return FALSE; } @@ -302,10 +302,10 @@ impress_document_load (EvDocument *document, if (!imp) { - g_set_error (error, - EV_DOCUMENT_ERROR, - EV_DOCUMENT_ERROR_INVALID, - _("Invalid document")); + g_set_error_literal (error, + EV_DOCUMENT_ERROR, + EV_DOCUMENT_ERROR_INVALID, + _("Invalid document")); g_free (filename); return FALSE; } diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc index 2e48df9d..746b945a 100644 --- a/backend/pdf/ev-poppler.cc +++ b/backend/pdf/ev-poppler.cc @@ -239,12 +239,10 @@ convert_error (GError *poppler_error, else if (poppler_error->code == POPPLER_ERROR_ENCRYPTED) code = EV_DOCUMENT_ERROR_ENCRYPTED; - - g_set_error (error, - EV_DOCUMENT_ERROR, - code, - poppler_error->message, - NULL); + g_set_error_literal (error, + EV_DOCUMENT_ERROR, + code, + poppler_error->message); } else { g_propagate_error (error, poppler_error); } diff --git a/libdocument/ev-document-factory.c b/libdocument/ev-document-factory.c index 3b9129af..c7f2a224 100644 --- a/libdocument/ev-document-factory.c +++ b/libdocument/ev-document-factory.c @@ -121,10 +121,10 @@ get_document_from_uri (const char *uri, g_free (mime_type); if (*error == NULL) { - g_set_error (error, - EV_DOCUMENT_ERROR, - 0, - _("Unknown MIME Type")); + g_set_error_literal (error, + EV_DOCUMENT_ERROR, + EV_DOCUMENT_ERROR_INVALID, + _("Unknown MIME Type")); } return NULL; @@ -143,7 +143,7 @@ get_document_from_uri (const char *uri, mime_desc = g_content_type_get_description (mime_type); g_set_error (error, EV_DOCUMENT_ERROR, - 0, + EV_DOCUMENT_ERROR_INVALID, _("File type %s (%s) is not supported"), mime_desc, mime_type); g_free (mime_desc); @@ -242,10 +242,10 @@ ev_document_factory_get_document (const char *uri, GError **error) if (result == FALSE) { if (*error == NULL) { - g_set_error (error, - EV_DOCUMENT_ERROR, - 0, - _("Unknown MIME Type")); + g_set_error_literal (error, + EV_DOCUMENT_ERROR, + EV_DOCUMENT_ERROR_INVALID, + _("Unknown MIME Type")); } else if ((*error)->domain == EV_DOCUMENT_ERROR && (*error)->code == EV_DOCUMENT_ERROR_ENCRYPTED) { return document; diff --git a/shell/ev-print-operation.c b/shell/ev-print-operation.c index 44ce674b..8498dceb 100644 --- a/shell/ev-print-operation.c +++ b/shell/ev-print-operation.c @@ -1004,10 +1004,10 @@ ev_print_operation_export_print_dialog_response_cb (GtkDialog *dial if (!gtk_printer_accepts_ps (export->printer)) { gtk_widget_destroy (GTK_WIDGET (dialog)); - g_set_error (&export->error, - GTK_PRINT_ERROR, - GTK_PRINT_ERROR_GENERAL, - "%s", _("Printing is not supported on this printer.")); + g_set_error_literal (&export->error, + GTK_PRINT_ERROR, + GTK_PRINT_ERROR_GENERAL, + _("Printing is not supported on this printer.")); g_signal_emit (op, signals[DONE], 0, GTK_PRINT_OPERATION_RESULT_ERROR); return;