[gtk/wip/compose-parser] composetable: Add a one-time warning



commit 027830ae62fef59b34239c2c0391e8311295d440
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jul 14 07:38:32 2021 -0400

    composetable: Add a one-time warning
    
    When we see a cache in the old format, tell the user
    to add an include line to their Compose file. Since
    the cache is going to get replaced immediately after,
    this message is only going to show up one time.

 gtk/gtkcomposetable.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcomposetable.c b/gtk/gtkcomposetable.c
index eb1ceeeca1..830f503f92 100644
--- a/gtk/gtkcomposetable.c
+++ b/gtk/gtkcomposetable.c
@@ -780,8 +780,12 @@ gtk_compose_table_load_cache (const char *compose_file)
   GET_GUINT16 (version);
   if (version != GTK_COMPOSE_TABLE_VERSION)
     {
-      g_warning ("cache version is different %u != %u",
-                 version, GTK_COMPOSE_TABLE_VERSION);
+      if (version < GTK_COMPOSE_TABLE_VERSION)
+        g_warning ("Since GTK 4.4,\n"
+                   "Compose files replace the builtin compose sequences.\n"
+                   "To keep them and add your sequences on top, add the line:\n\n"
+                   "  include \"%%L\"\n\n"
+                   "to the Compose file %s.\n", compose_file);
       goto out_load_cache;
     }
 


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