summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/nntpwrapper.cpp
Side-by-side diff
Diffstat (limited to 'kmicromail/libmailwrapper/nntpwrapper.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/nntpwrapper.cpp25
1 files changed, 8 insertions, 17 deletions
diff --git a/kmicromail/libmailwrapper/nntpwrapper.cpp b/kmicromail/libmailwrapper/nntpwrapper.cpp
index f5d7f16..93cd2b5 100644
--- a/kmicromail/libmailwrapper/nntpwrapper.cpp
+++ b/kmicromail/libmailwrapper/nntpwrapper.cpp
@@ -117,40 +117,31 @@ void NNTPwrapper::login()
if ( m_nntp != NULL )
return;
- const char *server, *user, *pass;
+ QString server;
QString User,Pass;
uint16_t port;
int err = NEWSNNTP_NO_ERROR;
- server = account->getServer().latin1();
+ server = account->getServer();
port = account->getPort().toUInt();
- user = pass = 0;
-
if ( ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) && account->getLogin() ) {
LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true );
login.show();
if ( QDialog::Accepted == login.exec() ) {
// ok
- User = login.getUser().latin1();
- Pass = login.getPassword().latin1();
+ User = login.getUser();
+ Pass = login.getPassword();
} else {
// cancel
; // << "NNTP: Login canceled" << oendl;
return;
}
} else {
- User = account->getUser().latin1();
- Pass = account->getPassword().latin1();
+ User = account->getUser();
+ Pass = account->getPassword();
}
- if (User.isEmpty()) {
- user=0;
- pass = 0;
- } else {
- user=User.latin1();
- pass=Pass.latin1();
- }
// bool ssl = account->getSSL();
m_nntp=mailstorage_new(NULL);
@@ -167,8 +158,8 @@ void NNTPwrapper::login()
conntype = CONNECTION_TYPE_TRY_STARTTLS;
}
- nntp_mailstorage_init(m_nntp,(char*)server, port, NULL, CONNECTION_TYPE_PLAIN, NNTP_AUTH_TYPE_PLAIN,
- (char*)user,(char*)pass,0,0,0);
+ nntp_mailstorage_init(m_nntp,(char*)server.latin1(), port, NULL, CONNECTION_TYPE_PLAIN, NNTP_AUTH_TYPE_PLAIN,
+ (char*)User.latin1(),(char*)Pass.latin1(),0,0,0);
err = mailstorage_connect( m_nntp );