From 7f2064ed526db2e54b3ebde04e58beaffbb397ed Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Sun, 15 Apr 2018 21:58:06 +0200 Subject: Finish master password unload issue. Fix an old bug reintroduced by the magic of copy & paste --- src/inputdialog.c | 17 ++++++++++++++--- src/main.c | 3 --- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/inputdialog.c b/src/inputdialog.c index 2510bbb..cdfb997 100644 --- a/src/inputdialog.c +++ b/src/inputdialog.c @@ -159,9 +159,20 @@ gchar *input_dialog_query_password(const gchar *server, const gchar *user) gchar *input_dialog_query_master_password(void) { - return input_dialog_with_invisible(_("Input password"), - _("Master password"), - NULL); + gchar *mp_input; + + mp_input = input_dialog_with_invisible(_("Input password"), + _("Master password"), + NULL); + + if (prefs_common.use_master_password && + prefs_common.auto_unload_master_password) + { + g_timeout_add(1000 * 30, unload_master_password, NULL); + debug_print("Master password to be unloaded in 30 seconds\n"); + } + + return mp_input; } gchar *input_dialog_set_new_password(guint max_attempts) diff --git a/src/main.c b/src/main.c index 7c37e96..97a4bd0 100644 --- a/src/main.c +++ b/src/main.c @@ -426,9 +426,6 @@ int main(int argc, char *argv[]) if (prefs_common.auto_unload_master_password && master_password_active()) { debug_print("Auto unloading master password\n"); unload_master_password(); - /* call this function every 10th minute in case a reload took place */ - /* TODO: Perhaps a more elegant solution could be developed */ - g_timeout_add(1000 * 60 * 10, unload_master_password, NULL); } #endif -- cgit v1.3