-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.cpp | 18 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/nntpwrapper.cpp | 25 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/pop3wrapper.cpp | 18 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/smtpwrapper.cpp | 19 |
4 files changed, 34 insertions, 46 deletions
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index 11d3343..021633b 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp @@ -97,5 +97,5 @@ bool IMAPwrapper::start_tls(bool force_tls) void IMAPwrapper::login() { - const char *server, *user, *pass; + QString server, user, pass; uint16_t port; int err = MAILIMAP_NO_ERROR; @@ -113,5 +113,5 @@ void IMAPwrapper::login() } } - server = account->getServer().latin1(); + server = account->getServer(); port = account->getPort().toUInt(); if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { @@ -120,6 +120,6 @@ void IMAPwrapper::login() if ( QDialog::Accepted == login.exec() ) { // ok - user = login.getUser().latin1(); - pass = login.getPassword().latin1(); + user = login.getUser(); + pass = login.getPassword(); } else { // cancel @@ -127,6 +127,6 @@ void IMAPwrapper::login() } } else { - user = account->getUser().latin1(); - pass = account->getPassword().latin1(); + user = account->getUser(); + pass = account->getPassword(); } @@ -147,7 +147,7 @@ void IMAPwrapper::login() if ( ssl ) { qDebug("using ssl "); - err = mailimap_ssl_connect( m_imap, (char*)server, port ); + err = mailimap_ssl_connect( m_imap, (char*)server.latin1(), port ); } else { - err = mailimap_socket_connect( m_imap, (char*)server, port ); + err = mailimap_socket_connect( m_imap, (char*)server.latin1(), port ); } @@ -181,5 +181,5 @@ void IMAPwrapper::login() if (ok) { - err = mailimap_login_simple( m_imap, (char*)user, (char*)pass ); + err = mailimap_login_simple( m_imap, (char*)user.latin1(), (char*)pass.latin1() ); if ( err != MAILIMAP_NO_ERROR ) { Global::statusMessage(tr("error logging in imap server: %1").arg(m_imap->imap_response)); 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 @@ -118,14 +118,12 @@ void NNTPwrapper::login() 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 ); @@ -133,6 +131,6 @@ void NNTPwrapper::login() if ( QDialog::Accepted == login.exec() ) { // ok - User = login.getUser().latin1(); - Pass = login.getPassword().latin1(); + User = login.getUser(); + Pass = login.getPassword(); } else { // cancel @@ -141,15 +139,8 @@ void NNTPwrapper::login() } } 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(); @@ -168,6 +159,6 @@ void NNTPwrapper::login() } - 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 ); diff --git a/kmicromail/libmailwrapper/pop3wrapper.cpp b/kmicromail/libmailwrapper/pop3wrapper.cpp index 0e6612c..f430121 100644 --- a/kmicromail/libmailwrapper/pop3wrapper.cpp +++ b/kmicromail/libmailwrapper/pop3wrapper.cpp @@ -119,5 +119,5 @@ void POP3wrapper::login() return; - const char *server, *user, *pass; + QString server,user, pass; uint16_t port; int err = MAILPOP3_NO_ERROR; @@ -131,6 +131,7 @@ void POP3wrapper::login() if ( QDialog::Accepted == login.exec() ) { // ok - user = login.getUser().latin1(); - pass = login.getPassword().latin1(); + qDebug("ok "); + user = login.getUser(); + pass = login.getPassword(); } else { // cancel @@ -139,12 +140,10 @@ void POP3wrapper::login() } } else { - user = account->getUser().latin1(); - pass = account->getPassword().latin1(); + user = account->getUser(); + pass = account->getPassword(); } - // bool ssl = account->getSSL(); m_pop3=mailstorage_new(NULL); - int conntypeset = account->ConnectionType(); int conntype = 0; @@ -161,7 +160,6 @@ void POP3wrapper::login() //(ssl?CONNECTION_TYPE_TLS:CONNECTION_TYPE_PLAIN); - pop3_mailstorage_init(m_pop3,(char*)server, port, NULL, conntype, POP3_AUTH_TYPE_PLAIN, - (char*)user,(char*)pass,0,0,0); - + pop3_mailstorage_init(m_pop3,(char*)server.latin1(), port, NULL, conntype, POP3_AUTH_TYPE_PLAIN, + (char*)user.latin1(),(char*)pass.latin1(),0,0,0); err = mailstorage_connect(m_pop3); diff --git a/kmicromail/libmailwrapper/smtpwrapper.cpp b/kmicromail/libmailwrapper/smtpwrapper.cpp index 6a1b505..d5a528c 100644 --- a/kmicromail/libmailwrapper/smtpwrapper.cpp +++ b/kmicromail/libmailwrapper/smtpwrapper.cpp @@ -183,5 +183,5 @@ int SMTPwrapper::start_smtp_tls() void SMTPwrapper::connect_server() { - const char *server, *user, *pass; + QString server, user, pass; bool ssl; uint16_t port; @@ -189,5 +189,4 @@ void SMTPwrapper::connect_server() bool try_tls = true; bool force_tls=false; - server = user = pass = 0; QString failuretext = ""; @@ -195,5 +194,5 @@ void SMTPwrapper::connect_server() return; } - server = m_SmtpAccount->getServer().latin1(); + server = m_SmtpAccount->getServer(); if ( m_SmtpAccount->ConnectionType() == 2 ) { ssl = true; @@ -216,8 +215,8 @@ void SMTPwrapper::connect_server() if ( ssl ) { ; // odebug << "SSL session" << oendl; - err = mailsmtp_ssl_connect( m_smtp, server, port ); + err = mailsmtp_ssl_connect( m_smtp, server.latin1(), port ); } else { ; // odebug << "No SSL session" << oendl; - err = mailsmtp_socket_connect( m_smtp, server, port ); + err = mailsmtp_socket_connect( m_smtp, server.latin1(), port ); } if ( err != MAILSMTP_NO_ERROR ) { @@ -259,6 +258,6 @@ void SMTPwrapper::connect_server() if ( QDialog::Accepted == login.exec() ) { // ok - user = login.getUser().latin1(); - pass = login.getPassword().latin1(); + user = login.getUser(); + pass = login.getPassword(); } else { result = 0; @@ -266,10 +265,10 @@ void SMTPwrapper::connect_server() } } else { - user = m_SmtpAccount->getUser().latin1(); - pass = m_SmtpAccount->getPassword().latin1(); + user = m_SmtpAccount->getUser(); + pass = m_SmtpAccount->getPassword(); } ; // odebug << "session->auth: " << m_smtp->auth << "" << oendl; if (result) { - err = mailsmtp_auth( m_smtp, (char*)user, (char*)pass ); + err = mailsmtp_auth( m_smtp, (char*)user.latin1(), (char*)pass.latin1() ); if ( err == MAILSMTP_NO_ERROR ) { ; // odebug << "auth ok" << oendl; |