Commit d11a8e84 authored by Jesse van den Kieboom's avatar Jesse van den Kieboom

Added domain checks for CONVERSION_FALLBACK errors

parent 6e0d6d5a
......@@ -1216,7 +1216,9 @@ document_loader_loaded (GeditDocumentLoader *loader,
GeditDocument *doc)
{
/* load was successful */
if (error == NULL || error->code == GEDIT_DOCUMENT_ERROR_CONVERSION_FALLBACK)
if (error == NULL ||
(error->domain == GEDIT_DOCUMENT_ERROR &&
error->code == GEDIT_DOCUMENT_ERROR_CONVERSION_FALLBACK))
{
GtkTextIter iter;
GFileInfo *info;
......
......@@ -896,7 +896,8 @@ document_loaded (GeditDocument *document,
uri = gedit_document_get_uri (document);
/* if the error is CONVERSION FALLBACK don't treat it as a normal error */
if (error != NULL && error->code != GEDIT_DOCUMENT_ERROR_CONVERSION_FALLBACK)
if (error != NULL &&
(error->domain != GEDIT_DOCUMENT_ERROR || error->code != GEDIT_DOCUMENT_ERROR_CONVERSION_FALLBACK))
{
if (tab->priv->state == GEDIT_TAB_STATE_LOADING)
gedit_tab_set_state (tab, GEDIT_TAB_STATE_LOADING_ERROR);
......@@ -905,7 +906,7 @@ document_loaded (GeditDocument *document,
encoding = gedit_document_get_encoding (document);
if (error->domain == G_IO_ERROR &&
if (error->domain == G_IO_ERROR &&
error->code == G_IO_ERROR_CANCELLED)
{
/* remove the tab, but in an idle handler, since
......@@ -975,7 +976,9 @@ document_loaded (GeditDocument *document,
mime);
g_free (mime);
if (error && error->code == GEDIT_DOCUMENT_ERROR_CONVERSION_FALLBACK)
if (error &&
error->domain == GEDIT_DOCUMENT_ERROR &&
error->code == GEDIT_DOCUMENT_ERROR_CONVERSION_FALLBACK)
{
GtkWidget *emsg;
......
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