summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/imapwrapper.cpp
authorzautrix <zautrix>2004-09-10 16:47:36 (UTC)
committer zautrix <zautrix>2004-09-10 16:47:36 (UTC)
commit157120031b77a3d9f10d780a66b6441dac1399fa (patch) (side-by-side diff)
treefe756e71b5290940d2824d06c11e5f887a6f00e2 /kmicromail/libmailwrapper/imapwrapper.cpp
parent3b3e910d97287f6a538c114458d97800d430799a (diff)
downloadkdepimpi-157120031b77a3d9f10d780a66b6441dac1399fa.zip
kdepimpi-157120031b77a3d9f10d780a66b6441dac1399fa.tar.gz
kdepimpi-157120031b77a3d9f10d780a66b6441dac1399fa.tar.bz2
Fixes in password dislog handling
Diffstat (limited to 'kmicromail/libmailwrapper/imapwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/imapwrapper.cpp18
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
@@ -93,13 +93,13 @@ bool IMAPwrapper::start_tls(bool force_tls)
}
return try_tls;
}
void IMAPwrapper::login()
{
- const char *server, *user, *pass;
+ QString server, user, pass;
uint16_t port;
int err = MAILIMAP_NO_ERROR;
if (account->getOffline()) return;
/* we are connected this moment */
/* TODO: setup a timer holding the line or if connection closed - delete the value */
@@ -109,28 +109,28 @@ void IMAPwrapper::login()
logout();
} else {
mailstream_flush(m_imap->imap_stream);
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 );
/* connect */
bool ssl = false;
@@ -143,15 +143,15 @@ void IMAPwrapper::login()
if (account->ConnectionType()==1) {
force_tls = true;
}
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 &&
err != MAILIMAP_NO_ERROR_AUTHENTICATED &&
err != MAILIMAP_NO_ERROR_NON_AUTHENTICATED ) {
QString failure = "";
@@ -177,13 +177,13 @@ 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;
}
}
if (!ok) {