[glib: 12/19] GWin32AppInfo: simplify appinfo wait condition




commit 10def41dc5a7848c8cd63ea731da3f46ed49ccdc
Author: Руслан Ижбулатов <lrn1986 gmail com>
Date:   Fri Dec 11 15:18:18 2020 +0000

    GWin32AppInfo: simplify appinfo wait condition

 gio/gwin32appinfo.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)
---
diff --git a/gio/gwin32appinfo.c b/gio/gwin32appinfo.c
index 57e63c7bb..9544719b8 100644
--- a/gio/gwin32appinfo.c
+++ b/gio/gwin32appinfo.c
@@ -3802,17 +3802,11 @@ gio_win32_appinfo_init (gboolean do_wait)
   if (!do_wait)
     return;
 
-  /* If any of the keys had a change, then we've already initiated
-   * a tree re-build in keys_updated(). Just wait for it to finish.
+  /* Previously, we checked each of the watched keys here.
+   * Now we just look at the update counter, because each key
+   * has a change callback keys_updated, which increments this counter.
    */
-  if ((url_associations_key       && g_win32_registry_key_has_changed (url_associations_key))       ||
-      (file_exts_key              && g_win32_registry_key_has_changed (file_exts_key))              ||
-      (user_clients_key           && g_win32_registry_key_has_changed (user_clients_key))           ||
-      (system_clients_key         && g_win32_registry_key_has_changed (system_clients_key))         ||
-      (applications_key           && g_win32_registry_key_has_changed (applications_key))           ||
-      (user_registered_apps_key   && g_win32_registry_key_has_changed (user_registered_apps_key))   ||
-      (system_registered_apps_key && g_win32_registry_key_has_changed (system_registered_apps_key)) ||
-      (classes_root_key           && g_win32_registry_key_has_changed (classes_root_key)))
+  if (g_atomic_int_get (&gio_win32_appinfo_update_counter) > 0)
     {
       g_mutex_lock (&gio_win32_appinfo_mutex);
       while (g_atomic_int_get (&gio_win32_appinfo_update_counter) > 0)


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