Skip to content

Commit 4341fca

Browse files
committed
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.
1 parent a62b575 commit 4341fca

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

vncviewer/UserDialog.cxx

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ using namespace rfb;
5757
static Fl_Pixmap secure_icon(secure);
5858
static Fl_Pixmap insecure_icon(insecure);
5959

60+
std::string UserDialog::savedUsername;
61+
std::string UserDialog::savedPassword;
62+
6063
static long ret_val = 0;
6164

6265
static void button_cb(Fl_Widget *widget, long val) {

vncviewer/UserDialog.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class UserDialog
3838
void resetPassword();
3939

4040
private:
41-
std::string savedUsername;
42-
std::string savedPassword;
41+
static std::string savedUsername;
42+
static std::string savedPassword;
4343
};
4444

4545
#endif

0 commit comments

Comments
 (0)