summaryrefslogtreecommitdiff
path: root/src/gui/login.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/login.cpp')
-rw-r--r--src/gui/login.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/login.cpp b/src/gui/login.cpp
index 836c1c14..e3828af7 100644
--- a/src/gui/login.cpp
+++ b/src/gui/login.cpp
@@ -133,7 +133,12 @@ LoginDialog::LoginDialog(LoginData *loginData):
serverField->setText(config.getValue("host", ""));
- wrongDataNoticeListener = NULL;
+ wrongDataNoticeListener = new WrongDataNoticeListener();
+}
+
+LoginDialog::~LoginDialog()
+{
+ delete wrongDataNoticeListener;
}
void
@@ -160,10 +165,9 @@ LoginDialog::action(const std::string& eventId)
// Check login
if (user.length() == 0)
{
- wrongDataNoticeListener = new WrongDataNoticeListener();
wrongDataNoticeListener->setTarget(this->passField);
- new OkDialog("Error", "Enter your username first",
- wrongDataNoticeListener);
+ OkDialog *dlg = new OkDialog("Error", "Enter your username first");
+ dlg->addActionListener(wrongDataNoticeListener);
}
else
{