This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch desktop-restore
in repository terminology.

View the commit online.

commit 0f33732df46a8d317a0b9c096fe7f0e374242a7b
Author: [email protected] <[email protected]>
AuthorDate: Fri Mar 20 10:26:27 2026 -0600

    feat: use session_meta_list for load/save hoversel population
    
    Replace session_list() calls in the load and save-pick hoversels
    with session_meta_list() for consistency with the metadata cache.
    Add session_meta_cache_invalidate() calls after session_save() and
    session_del() for immediate cache consistency.
---
 src/bin/controls.c | 30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/src/bin/controls.c b/src/bin/controls.c
index f9d59ec0..8b130ab1 100644
--- a/src/bin/controls.c
+++ b/src/bin/controls.c
@@ -312,6 +312,7 @@ _cb_session_del_btn(void *data,
    /* Ignore return value: session_del logs ERR() on failure; the entry is
     * cleared regardless so the user can correct the name and retry. */
    (void)session_del(plain);
+   session_meta_cache_invalidate();
    free(plain);
    elm_entry_entry_set(ctx->session_entry, "");
 }
@@ -336,6 +337,8 @@ _cb_session_save_btn(void *data,
      }
 
    Eina_Bool ok = session_save(plain, ctx->wn);
+   if (ok)
+     session_meta_cache_invalidate();
    free(plain);
    if (ok)
      controls_hide(ctx, EINA_TRUE);
@@ -419,19 +422,21 @@ _sep_add_h(Evas_Object *win)
 static void
 _session_hoversel_repopulate(Evas_Object *hs)
 {
-   Eina_List *sessions, *l;
-   const char *sname;
+   Eina_List *metas, *l;
+   Session_Meta *sm;
 
    if (!hs) return;
    /* Close any open dropdown first — elm_hoversel_clear calls hover_end per
     * item which causes a use-after-free if the popup is already expanded. */
    elm_hoversel_hover_end(hs);
    elm_hoversel_clear(hs);
-   sessions = session_list();
-   EINA_LIST_FOREACH(sessions, l, sname)
-     elm_hoversel_item_add(hs, sname, NULL, ELM_ICON_NONE, NULL, NULL);
-   session_list_free(sessions);
-   elm_object_disabled_set(hs, !sessions);
+
+   metas = session_meta_list();
+   EINA_LIST_FOREACH(metas, l, sm)
+     elm_hoversel_item_add(hs, sm->name, NULL, ELM_ICON_NONE, NULL, NULL);
+
+   elm_object_disabled_set(hs, !metas);
+   session_meta_list_free(metas);
 }
 
 static Eina_Bool
@@ -453,6 +458,7 @@ _cb_session_dir_changed(void *data, int _type EINA_UNUSED, void *event)
    if (len <= 4 || strcmp(path + len - 4, ".ses") != 0)
      return ECORE_CALLBACK_PASS_ON;
 
+   session_meta_cache_invalidate();
    _session_hoversel_repopulate(ctx->session_load_hs);
    _session_hoversel_repopulate(ctx->session_pick_hs);
 
@@ -607,8 +613,6 @@ controls_show(Evas_Object *win, Evas_Object *base, Evas_Object *bg,
         /* Session load: full-width hoversel listing all saved sessions */
         {
            Evas_Object *hs;
-           Eina_List *sessions, *l;
-           const char *sname;
 
            hs = elm_hoversel_add(win);
            elm_hoversel_hover_parent_set(hs, win);
@@ -618,15 +622,9 @@ controls_show(Evas_Object *win, Evas_Object *base, Evas_Object *bg,
            evas_object_smart_callback_add(hs, "selected",
                                           _cb_session_hoversel_sel, ctx);
 
-           sessions = session_list();
-           EINA_LIST_FOREACH(sessions, l, sname)
-             elm_hoversel_item_add(hs, sname, NULL, ELM_ICON_NONE, NULL, NULL);
-           session_list_free(sessions);
-           if (!sessions)
-             elm_object_disabled_set(hs, EINA_TRUE);
-
            evas_object_show(hs);
            ctx->session_load_hs = hs;
+           _session_hoversel_repopulate(hs);
            elm_box_pack_end(ct_boxv, hs);
         }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to