Commit 0f2002c9 authored by Jehan's avatar Jehan

plug-ins: check GError domain and code, not the message.

When there is a well-documented GError domain/code, use these,
especially since messages can be localized (not sure if that is the case
for this one, but theoretically it could) and change over time.

Also remove the "nice-to-have" comment on file-pdf-load since we won't
be changing it now, but leave it on file-pdf-load2 parameters which can
still change before 2.10.
parent 19b300ef
......@@ -265,12 +265,6 @@ query (void)
{ GIMP_PDB_INT32, "run-mode", "The run mode { RUN-INTERACTIVE (0), RUN-NONINTERACTIVE (1) }" },
{ GIMP_PDB_STRING, "filename", "The name of the file to load" },
{ GIMP_PDB_STRING, "raw-filename", "The name entered" }
/* XXX: Nice to have API at some point, but needs work
{ GIMP_PDB_INT32, "resolution", "Resolution to rasterize to (dpi)" },
{ GIMP_PDB_INT32, "antialiasing", "Use anti-aliasing" },
{ GIMP_PDB_INT32, "n-pages", "Number of pages to load (0 for all)" },
{ GIMP_PDB_INT32ARRAY,"pages", "The pages to load" }
*/
};
static const GimpParamDef load2_args[] =
......@@ -633,7 +627,9 @@ open_document (const gchar *filename,
GtkWidget *label;
label = gtk_label_new (_("PDF is password protected, please input the password:"));
while (error && strcmp (error->message, "Document is encrypted") == 0)
while (error &&
error->domain == POPPLER_ERROR &&
error->code == POPPLER_ERROR_ENCRYPTED)
{
GtkWidget *vbox;
GtkWidget *dialog;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment