Diffstat (limited to 'kmicromail/libmailwrapper/imapwrapper.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.cpp | 18 |
1 files changed, 9 insertions, 9 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 @@ -96,7 +96,7 @@ 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; @@ -112,22 +112,22 @@ void IMAPwrapper::login() return; } } - server = account->getServer().latin1(); + server = account->getServer(); port = account->getPort().toUInt(); if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { 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 return; } } else { - user = account->getUser().latin1(); - pass = account->getPassword().latin1(); + user = account->getUser(); + pass = account->getPassword(); } m_imap = mailimap_new( 20, &imap_progress ); @@ -146,9 +146,9 @@ 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 ); } if ( err != MAILIMAP_NO_ERROR && @@ -180,7 +180,7 @@ void IMAPwrapper::login() /* 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)); ok = false; |