author | alwin <alwin> | 2004-03-05 13:14:20 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-05 13:14:20 (UTC) |
commit | 5af6bb27d2ba6a1d00fd0a6df0550d02164f87e6 (patch) (unidiff) | |
tree | 8172212622ad2105138e8d6e5bf7c7b6009b9e4f | |
parent | 5604399762f55e1b2709cd12d3d894666d19ae99 (diff) | |
download | opie-5af6bb27d2ba6a1d00fd0a6df0550d02164f87e6.zip opie-5af6bb27d2ba6a1d00fd0a6df0550d02164f87e6.tar.gz opie-5af6bb27d2ba6a1d00fd0a6df0550d02164f87e6.tar.bz2 |
moved string parameters for construktor to const references
possible problem with not initialized variables fixed
-rw-r--r-- | noncore/net/mail/libmailwrapper/logindialog.cpp | 13 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/logindialog.h | 2 |
2 files changed, 9 insertions, 6 deletions
diff --git a/noncore/net/mail/libmailwrapper/logindialog.cpp b/noncore/net/mail/libmailwrapper/logindialog.cpp index d2c6a07..67479e6 100644 --- a/noncore/net/mail/libmailwrapper/logindialog.cpp +++ b/noncore/net/mail/libmailwrapper/logindialog.cpp | |||
@@ -1,26 +1,29 @@ | |||
1 | #include <qlineedit.h> | 1 | #include <qlineedit.h> |
2 | 2 | ||
3 | #include "logindialog.h" | 3 | #include "logindialog.h" |
4 | 4 | ||
5 | LoginDialog::LoginDialog( QString user, QString pass, QWidget *parent, const char *name, bool modal, WFlags flags ) | 5 | LoginDialog::LoginDialog(const QString&user,const QString&pass, QWidget *parent, const char *name, bool modal, WFlags flags ) |
6 | : LoginDialogUI( parent, name, modal, flags ) | 6 | : LoginDialogUI( parent, name, modal, flags ) |
7 | { | 7 | { |
8 | userLine->setText( user ); | 8 | userLine->setText( (user.isEmpty()?"":user) ); |
9 | passLine->setText( pass ); | 9 | passLine->setText( (pass.isEmpty()?"":pass) ); |
10 | _user = user; | 10 | _user = user; |
11 | _pass = pass; | 11 | _pass = pass; |
12 | 12 | ||
13 | if ( user.isEmpty() ) { | 13 | if ( user.isEmpty() ) { |
14 | userLine->setFocus(); | 14 | userLine->setFocus(); |
15 | } else { | 15 | } else { |
16 | passLine->setFocus(); | 16 | passLine->setFocus(); |
17 | } | 17 | } |
18 | } | 18 | } |
19 | 19 | ||
20 | void LoginDialog::accept() | 20 | void LoginDialog::accept() |
21 | { | 21 | { |
22 | _user.replace( 0, _user.length(), userLine->text() ); | 22 | //_user.replace( 0, _user.length(), userLine->text() ); |
23 | _pass.replace( 0, _pass.length(), passLine->text() ); | 23 | //_pass.replace( 0, _pass.length(), passLine->text() ); |
24 | _user = userLine->text(); | ||
25 | _pass = passLine->text(); | ||
24 | 26 | ||
27 | qDebug("User im accept: |%s|",_user.latin1()); | ||
25 | QDialog::accept(); | 28 | QDialog::accept(); |
26 | } | 29 | } |
diff --git a/noncore/net/mail/libmailwrapper/logindialog.h b/noncore/net/mail/libmailwrapper/logindialog.h index 7a0d1b0..f406f2c 100644 --- a/noncore/net/mail/libmailwrapper/logindialog.h +++ b/noncore/net/mail/libmailwrapper/logindialog.h | |||
@@ -3,17 +3,17 @@ | |||
3 | 3 | ||
4 | #include "logindialogui.h" | 4 | #include "logindialogui.h" |
5 | 5 | ||
6 | class LoginDialog : public LoginDialogUI | 6 | class LoginDialog : public LoginDialogUI |
7 | { | 7 | { |
8 | Q_OBJECT | 8 | Q_OBJECT |
9 | 9 | ||
10 | public: | 10 | public: |
11 | LoginDialog( QString user, QString pass, QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags flags = 0 ); | 11 | LoginDialog(const QString&user,const QString&pass, QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags flags = 0 ); |
12 | QString getUser() { return _user; } | 12 | QString getUser() { return _user; } |
13 | QString getPassword() { return _pass; } | 13 | QString getPassword() { return _pass; } |
14 | 14 | ||
15 | protected slots: | 15 | protected slots: |
16 | void accept(); | 16 | void accept(); |
17 | 17 | ||
18 | private: | 18 | private: |
19 | QString _user, _pass; | 19 | QString _user, _pass; |