[gedit/wip/loader-saver: 58/59] GEDIT_DOCUMENT_ERROR_CANT_CREATE_BACKUP is unused



commit 1e0edb2f749560b6060bff666ab34c052e072ec7
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Mon Jan 6 15:42:04 2014 +0100

    GEDIT_DOCUMENT_ERROR_CANT_CREATE_BACKUP is unused
    
    So to simplify the code we can remove its support.
    G_IO_ERROR_CANT_CREATE_BACKUP is used instead.

 gedit/gedit-document.h          |    2 +-
 gedit/gedit-io-error-info-bar.c |    6 ++----
 gedit/gedit-tab.c               |    6 ++----
 3 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/gedit/gedit-document.h b/gedit/gedit-document.h
index cef8cf9..d5a417c 100644
--- a/gedit/gedit-document.h
+++ b/gedit/gedit-document.h
@@ -171,7 +171,7 @@ struct _GeditDocumentClass
 enum
 {
        GEDIT_DOCUMENT_ERROR_EXTERNALLY_MODIFIED,
-       GEDIT_DOCUMENT_ERROR_CANT_CREATE_BACKUP,
+       GEDIT_DOCUMENT_ERROR_CANT_CREATE_BACKUP, /* unused */
        GEDIT_DOCUMENT_ERROR_TOO_BIG,
        GEDIT_DOCUMENT_ERROR_ENCODING_AUTO_DETECTION_FAILED,
        GEDIT_DOCUMENT_ERROR_CONVERSION_FALLBACK,
diff --git a/gedit/gedit-io-error-info-bar.c b/gedit/gedit-io-error-info-bar.c
index 1763294..4c3a5d9 100644
--- a/gedit/gedit-io-error-info-bar.c
+++ b/gedit/gedit-io-error-info-bar.c
@@ -904,10 +904,8 @@ gedit_no_backup_saving_error_info_bar_new (GFile        *location,
 
        g_return_val_if_fail (G_IS_FILE (location), NULL);
        g_return_val_if_fail (error != NULL, NULL);
-       g_return_val_if_fail (((error->domain == GEDIT_DOCUMENT_ERROR &&
-                               error->code == GEDIT_DOCUMENT_ERROR_CANT_CREATE_BACKUP) ||
-                              (error->domain == G_IO_ERROR &&
-                               error->code == G_IO_ERROR_CANT_CREATE_BACKUP)), NULL);
+       g_return_val_if_fail (error->domain == G_IO_ERROR &&
+                             error->code == G_IO_ERROR_CANT_CREATE_BACKUP, NULL);
 
        full_formatted_uri = g_file_get_parse_name (location);
 
diff --git a/gedit/gedit-tab.c b/gedit/gedit-tab.c
index 84c4c0b..d5c70a4 100644
--- a/gedit/gedit-tab.c
+++ b/gedit/gedit-tab.c
@@ -1448,10 +1448,8 @@ document_saved (GeditDocument *document,
                                          G_CALLBACK (externally_modified_error_info_bar_response),
                                          tab);
                }
-               else if ((error->domain == GEDIT_DOCUMENT_ERROR &&
-                         error->code == GEDIT_DOCUMENT_ERROR_CANT_CREATE_BACKUP) ||
-                        (error->domain == G_IO_ERROR &&
-                         error->code == G_IO_ERROR_CANT_CREATE_BACKUP))
+               else if (error->domain == G_IO_ERROR &&
+                        error->code == G_IO_ERROR_CANT_CREATE_BACKUP)
                {
                        /* This error is recoverable */
                        emsg = gedit_no_backup_saving_error_info_bar_new (


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]