diff options
-rw-r--r-- | tdmlib/kgreet_classic.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/tdmlib/kgreet_classic.cpp b/tdmlib/kgreet_classic.cpp index 3d1cedc19..acb953b54 100644 --- a/tdmlib/kgreet_classic.cpp +++ b/tdmlib/kgreet_classic.cpp @@ -402,22 +402,32 @@ KClassicGreeter::failed() void // virtual KClassicGreeter::revive() { - // assert( !running ); - setActive2( true ); + // assert(!running); + setActive2(true); if (authTok) { - passwd1Edit->erase(); - passwd2Edit->erase(); - passwd1Edit->setFocus(); - } else { + if (passwd1Edit) { + passwd1Edit->erase(); + } + if (passwd2Edit) { + passwd2Edit->erase(); + } + if (passwd1Edit) { + passwd1Edit->setFocus(); + } + } + else { passwdEdit->erase(); - if (loginEdit && loginEdit->isEnabled()) + if (loginEdit && loginEdit->isEnabled()) { passwdEdit->setEnabled( true ); + } else { setActive( true ); - if (loginEdit && loginEdit->text().isEmpty()) + if (loginEdit && loginEdit->text().isEmpty()) { loginEdit->setFocus(); - else + } + else { passwdEdit->setFocus(); + } } } } |