fix missing settings_reload_repo_credentials call

Mon, 28 Oct 2024 16:47:59 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Mon, 28 Oct 2024 16:47:59 +0100
changeset 66
eee1f3092844
parent 65
48f43130b4a2
child 67
3f987dde3be2

fix missing settings_reload_repo_credentials call

application/settings.c file | annotate | diff | comparison | revisions
libidav/pwdstore.c file | annotate | diff | comparison | revisions
--- a/application/settings.c	Mon Oct 28 15:20:58 2024 +0100
+++ b/application/settings.c	Mon Oct 28 16:47:59 2024 +0100
@@ -322,7 +322,7 @@
         return;
     }
     PwdStore *pwdstore = get_pwdstore();
-    pwdstore = !pwdstore ? pwdstore_new() : pwdstore_clone(pwdstore);
+    pwdstore = pwdstore ? pwdstore_clone(pwdstore) : pwdstore_new();
     
     UiObject *obj = ui_simple_window("Settings", NULL);
     ui_context_closefunc(obj->ctx, settings_close, NULL);
@@ -555,7 +555,7 @@
     settings_update_repolist(settings);
     settings_reload_keys(settings);
     settings_reload_credentials(settings);
-    void settings_reload_repo_credentials(SettingsWindow *settings);
+    settings_reload_repo_credentials(settings);
     
     settings->selected_repo = -1;
 }
--- a/libidav/pwdstore.c	Mon Oct 28 15:20:58 2024 +0100
+++ b/libidav/pwdstore.c	Mon Oct 28 16:47:59 2024 +0100
@@ -140,11 +140,7 @@
     CxIterator i = cxMapIterator(p->ids);
     cx_foreach(CxMapEntry *, e, i) {
         PwdEntry *entry = e->value;
-        PwdEntry *new_entry = malloc(sizeof(PwdEntry));
-        new_entry->id = strdup(entry->id);
-        new_entry->user = entry->user ? strdup(entry->user) : NULL;
-        new_entry->password = entry->password ? strdup(entry->password) : NULL;
-        cxMapPut(newp->ids, *e->key, new_entry);
+        pwdstore_put(newp, entry->id, entry->user, entry->password);
     }
     
     i = cxMapIterator(p->index);
@@ -158,7 +154,7 @@
                 cxListAdd(locations, strdup(location));
             }
         }        
-        pwdstore_put_index(newp, entry->id, locations);
+        pwdstore_put_index(newp, strdup(entry->id), locations);
     }
     
     return newp;

mercurial