[evolution-data-server] e-categories: Show migration runtime warning only if the file exists



commit 0d17f90e452f7c550fa3e13f567e12a676cf2200
Author: Milan Crha <mcrha redhat com>
Date:   Thu Nov 26 14:25:46 2020 +0100

    e-categories: Show migration runtime warning only if the file exists
    
    The categories migration code can fail on the first install on the machine
    where was no old or new Evolution installed, but the runtime warning was
    printed even in case the source file was not found, which is in most
    of the cases and, more importantly, it's not a real problem when the file
    is missing.

 src/libedataserver/e-categories.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/libedataserver/e-categories.c b/src/libedataserver/e-categories.c
index 04c96863b..aca6cfefb 100644
--- a/src/libedataserver/e-categories.c
+++ b/src/libedataserver/e-categories.c
@@ -140,7 +140,7 @@ build_categories_filename (void)
                old_filename = g_build_filename (
                        g_get_home_dir (), ".evolution",
                        "categories.xml", NULL);
-               if (g_rename (old_filename, filename) == -1) {
+               if (g_rename (old_filename, filename) == -1 && errno != ENOENT) {
                        g_warning ("%s: Failed to rename '%s' to '%s': %s", G_STRFUNC, old_filename, 
filename, g_strerror (errno));
                }
                g_free (old_filename);


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