From 4341fcacd4987b16ebcfa0db176c0ccf287268c4 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 4 Nov 2024 13:03:43 +0100 Subject: [PATCH] Keep saved username/password between connects The UserDialog object is now only created for a single connection at a time, which means we need to make sure the cached username and password survive until the subsequent object. --- vncviewer/UserDialog.cxx | 3 +++ vncviewer/UserDialog.h | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/vncviewer/UserDialog.cxx b/vncviewer/UserDialog.cxx index b3840d62..ed75a53c 100644 --- a/vncviewer/UserDialog.cxx +++ b/vncviewer/UserDialog.cxx @@ -57,6 +57,9 @@ using namespace rfb; static Fl_Pixmap secure_icon(secure); static Fl_Pixmap insecure_icon(insecure); +std::string UserDialog::savedUsername; +std::string UserDialog::savedPassword; + static long ret_val = 0; static void button_cb(Fl_Widget *widget, long val) { diff --git a/vncviewer/UserDialog.h b/vncviewer/UserDialog.h index c16923c1..ddafbc3c 100644 --- a/vncviewer/UserDialog.h +++ b/vncviewer/UserDialog.h @@ -38,8 +38,8 @@ public: void resetPassword(); private: - std::string savedUsername; - std::string savedPassword; + static std::string savedUsername; + static std::string savedPassword; }; #endif -- 2.39.5