+2009-02-05 Christian Persch <chpe@gnome.org>
+
+ * 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 <hib@hiberis.nl>
* shell/ev-application.c:
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
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);
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;
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;