Second step of making IMAP working again. At least read-only it works again.

Moving messages doesn't crash anymore but causes mail eating.
Maybe I should demand a whole draught :-)

svn path=/trunk/kdenetwork/kmail/; revision=110262
wilder-work
Michael Haeckel 25 years ago
parent 7cdee24dfe
commit 557c7eed67
  1. 14
      kmacctimap.cpp
  2. 5
      kmacctimap.h
  3. 24
      kmfolderimap.cpp
  4. 12
      kmfolderimap.h

@ -442,6 +442,20 @@ void KMAcctImap::killJobsForItem(KMFolderTreeItem * fti)
}
//-----------------------------------------------------------------------------
void KMAcctImap::slotSimpleResult(KIO::Job * job)
{
QMap<KIO::Job *, jobData>::Iterator it = mapJobData.find(job);
if (it != mapJobData.end()) mapJobData.remove(it);
if (job->error())
{
job->showErrorDialog();
if (job->error() == KIO::ERR_SLAVE_DIED) mSlave = NULL;
}
displayProgress();
}
//=============================================================================
//
// Class KMImapPasswdDialog

@ -217,6 +217,11 @@ protected slots:
*/
void slotAbortRequested();
/**
* Only delete information about the job
*/
void slotSimpleResult(KIO::Job * job);
/**
* Display an error message, that connecting failed
*/

@ -47,7 +47,6 @@
KMFolderImap::KMFolderImap(KMFolderDir* aParent, const QString& aName)
: KMFolderImapInherited(aParent, aName)
{
setAutoCreateIndex(false);
}
KMFolderImap::~KMFolderImap()
@ -455,7 +454,7 @@ void KMFolderImap::slotListFolderResult(KIO::Job * job)
jd2.total = 0;
mAccount->mapJobData.insert(newJob, jd2);
connect(newJob, SIGNAL(result(KIO::Job *)),
this, SLOT(slotSimpleResult(KIO::Job *)));
mAccount, SLOT(slotSimpleResult(KIO::Job *)));
connect(newJob, SIGNAL(data(KIO::Job *, const QByteArray &)),
this, SLOT(slotGetMessagesData(KIO::Job *, const QByteArray &)));
uids = "";
@ -879,7 +878,7 @@ void KMFolderImap::deleteMessage(KMMessage * msg)
jd.total = 1; jd.done = 0; jd.parent = NULL;
mAccount->mapJobData.insert(job, jd);
connect(job, SIGNAL(result(KIO::Job *)),
this, SLOT(slotSimpleResult(KIO::Job *)));
mAccount, SLOT(slotSimpleResult(KIO::Job *)));
mAccount->displayProgress();
}
@ -923,7 +922,7 @@ void KMFolderImap::setStatus(KMMessage * msg, KMMsgStatus status)
jd.total = 1; jd.done = 0; jd.parent = NULL;
mAccount->mapJobData.insert(job, jd);
connect(job, SIGNAL(result(KIO::Job *)),
this, SLOT(slotSimpleResult(KIO::Job *)));
mAccount, SLOT(slotSimpleResult(KIO::Job *)));
mAccount->displayProgress();
}
@ -942,22 +941,7 @@ void KMFolderImap::expungeFolder(KMFolderImap * aFolder)
jd.total = 1; jd.done = 0;
mAccount->mapJobData.insert(job, jd);
connect(job, SIGNAL(result(KIO::Job *)),
this, SLOT(slotSimpleResult(KIO::Job *)));
mAccount->displayProgress();
}
//-----------------------------------------------------------------------------
void KMFolderImap::slotSimpleResult(KIO::Job * job)
{
QMap<KIO::Job *, KMAcctImap::jobData>::Iterator it =
mAccount->mapJobData.find(job);
if (it != mAccount->mapJobData.end()) mAccount->mapJobData.remove(it);
if (job->error())
{
job->showErrorDialog();
if (job->error() == KIO::ERR_SLAVE_DIED) mAccount->slaveDied();
}
mAccount, SLOT(slotSimpleResult(KIO::Job *)));
mAccount->displayProgress();
}

@ -25,7 +25,7 @@
#define kmfolderimap_h
#include "kmacctimap.h"
#include "kmfoldermaildir.h"
#include "kmfoldermbox.h"
#include "kmmsgbase.h"
#include "kio/job.h"
@ -33,7 +33,6 @@
class KMFolderTreeItem;
class KMFolderImap;
class KMFolderMaildir;
class KMImapJob : public QObject
{
@ -66,9 +65,9 @@ private:
int mTotal, mDone, mOffset;
};
#define KMFolderImapInherited KMFolderMaildir
#define KMFolderImapInherited KMFolderMbox
class KMFolderImap : public KMFolderMaildir
class KMFolderImap : public KMFolderMbox
{
Q_OBJECT
friend class KMImapJob;
@ -237,11 +236,6 @@ protected slots:
*/
void slotCreateFolderResult(KIO::Job * job);
/**
* Only delete information about the job
*/
void slotSimpleResult(KIO::Job * job);
/**
* Only delete information about the job and ignore write errors
*/

Loading…
Cancel
Save