[Kde-pim] Proposal for a solution for bug 77862

Guy Maurel guy-kde at maurel.de
Tue May 11 19:00:26 BST 2010


Hi!

On Tuesday 11 May 2010 02:22:34 Thomas McGuire wrote:
> Hi,

> > NO, no CMD_DISCONNECT is send.
It isn't exact!

Your proposal:
  the_acctMgr->cancelMailCheck();
is almost correct. I modify what I have written yesterday!

It calls:
kdepim/kmail/kmacctimap.cpp:152
  KMAcctImap::killAllJobs( bool disconnectSlave )
which, at line 185, makes a call "KIO::Scheduler::disconnectSlave( slave() );"
kdelibs/kio/kio/slavebase.cpp:1099
  SchedulerPrivate::disconnectSlave(KIO::Slave *slave)
which, at line 1127, makes a call "slave->send( CMD_DISCONNECT );"

It is **the call** I was looking for.

kdelibs/kio/kio/slave.cpp:312
  Slave::send(int cmd, const QByteArray &arr)
which, at line 315, makes a call "d->connection->send(cmd, arr);"
kdelibs/kio/kio/connection.cpp:480
  Connection::send(int cmd, const QByteArray& data)
which, at line 489, makes a call "sendnow(cmd, data);"
kdelibs/kio/kio/connection.cpp:278
  SocketConnectionBackend::sendCommand(const Task &task)
    sprintf(buffer, "%6x_%2x_", task.data.size(), task.cmd);
    socket->write(buffer, HeaderSize);
    socket->write(task.data);

This is transmitted to the slave which dispatch it to
kdepimlibs/kioslave/imap4/imap4.cpp:1981
  IMAP4Protocol::closeConnection()

The problem is that the protected variable "currentState" has the value "ISTATE_NO".
It means a "return" without doing a "doCommand (imapCommand::clientLogout());"

**WHY** do we need this "if (getState() == ISTATE_NO)" ?

Many of the other calls to "closeConnection()" are preceded by a
  setState(ISTATE_CONNECT);

This is what we cannot set as we make a call 
  the_acctMgr->cancelMailCheck();

Have you any idea, how to go on?

guy
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list