From kde-commits Sat Nov 11 22:21:20 2006 From: Tom Albers Date: Sat, 11 Nov 2006 22:21:20 +0000 To: kde-commits Subject: playground/pim/mailody Message-Id: <1163283680.863420.26172.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=116328371122719 SVN commit 604188 by toma: Speed up deleting for allee, dont crash on wrong smtp server for fdoving M +2 -2 TODO M +3 -1 src/composer.cpp M +10 -17 src/imap.cpp M +1 -1 src/imap.h M +1 -1 src/main.cpp M +8 -10 src/mainwindow.cpp M +1 -1 src/messageview.cpp M +3 -1 src/socketsafe.cpp --- trunk/playground/pim/mailody/TODO #604187:604188 @@ -1,6 +1,7 @@ General: mulitple identities icw multiple smtp servers save send message for mailinglist is a bit weird +sometime after deleting /purging messages dont work anymore ------------------------------------ @@ -21,6 +22,7 @@ hide folders / unsubscribe [fdoving] reparent everything under inbox to toplevel [fdoving] make it possible to remove columns. +maybe add the count for deleted ------------------------------------ @@ -31,7 +33,6 @@ size column [allee] on resync(slotFetchMailBox()) save uid and reselect that one [allee] select all [allee] -delete a bunch is slow [allee] ------------------------------------ @@ -42,4 +43,3 @@ single click selects? [toma] bookmarks [allee] -sending crashes on wrong smtpserver --- trunk/playground/pim/mailody/src/composer.cpp #604187:604188 @@ -759,6 +759,7 @@ void Composer::slotError(const QString& error) { + //kdDebug()<< "slotError " << error << endl; // There is a 10% chance for a crash remaining here // on a timeout error // Thiago guarded for that for KDE 3.5.6 - comitted on 2006-10-29 @@ -768,7 +769,7 @@ m_smtp = 0; } - KMessageBox::information(0,error); + KMessageBox::information(this, error); } void Composer::slotRead(const QString& dataIn) @@ -864,6 +865,7 @@ void Composer::showError(const QString& error) { + //kdDebug()<< "showError " << error << endl; m_currentCommand = NotDone; m_smtp->aboutToClose(); m_smtp->write("QUIT"); --- trunk/playground/pim/mailody/src/imap.cpp #604187:604188 @@ -139,7 +139,7 @@ } else if (received.find("a02 NO") != -1 && (m_currentQueueItem.state() == Queue::SyncMailBox || - m_currentQueueItem.state() == Queue::QuickSelectMailBox)) + m_currentQueueItem.state() == Queue::SelectMailBox)) { // if we get here because the queue was delayed, then we // need to remove it from the queue to prevent a loop. @@ -247,21 +247,17 @@ else if (m_currentQueueItem.state() == Queue::Move) { QRegExp rx("a02 OK"); - if (rx.search(received.stripWhiteSpace()) != -1) - kdDebug() << "STORE COMPLETED!! Deleting can begin" << endl; - else + if (rx.search(received.stripWhiteSpace()) == -1) { - kdDebug() << "STORE FAILED, removing the delete command" << endl; + kdDebug() << "Store failed, removing the delete command" << endl; m_queue.pop_front(); } } else if (m_currentQueueItem.state() == Queue::SaveMessage) { QRegExp rx("a02 OK"); - if (rx.search(received.stripWhiteSpace()) != -1) - kdDebug() << "STORE COMPLETED!!" << endl; - else - kdDebug() << "STORE FAILED" << endl; + if (rx.search(received.stripWhiteSpace()) == -1) + kdDebug() << "Store failed" << endl; } else if (m_currentQueueItem.state() == Queue::CheckMail) { @@ -308,7 +304,6 @@ int mailsReal = m_db->getTotalMessagesMessages(mb); - if (totalShouldBe > mailsReal) getHeaderList(mailsReal+1, totalShouldBe, mb); else if (totalShouldBe != mailsReal) @@ -323,7 +318,7 @@ } } else if (m_currentQueueItem.state() == Queue::SyncMailBox || - m_currentQueueItem.state() == Queue::QuickSelectMailBox || + m_currentQueueItem.state() == Queue::SelectMailBox || m_currentQueueItem.state() == Queue::Expunge) { QRegExp rx1(" (\\d+) EXISTS"); @@ -477,7 +472,7 @@ if (m_selectedMailbox == m_currentQueueItem.mailbox() || m_currentQueueItem.mailbox().isEmpty() || m_currentQueueItem.state() == Queue::SyncMailBox || - m_currentQueueItem.state() == Queue::QuickSelectMailBox || + m_currentQueueItem.state() == Queue::SelectMailBox || m_currentQueueItem.state() == Queue::CheckMail) { if (m_currentQueueItem.state() == Queue::CheckMail) @@ -493,6 +488,8 @@ emit status(i18n("Retrieving mailbox list")); else if (m_currentQueueItem.state() == Queue::GetMessage) emit status(i18n("Retrieving message")); + else if (m_currentQueueItem.state() == Queue::Move) + emit status(i18n("Moving message")); write( m_currentQueueItem.command() ); m_queue.pop_front(); @@ -521,7 +518,7 @@ void Imap::checkMailBox(const QString& box) { - m_queue.prepend(Queue(Queue::QuickSelectMailBox, box, "select \""+box+"\"")); + m_queue.prepend(Queue(Queue::SelectMailBox, box, "select \""+box+"\"")); checkMail(box); } @@ -538,8 +535,6 @@ void Imap::expungeMailBox(const QString& box) { - // Dont use QuickSelect here, because that will _not_ check if the - // currently selected mailbox is box (hence firing it at the wrong folder) m_queue.append(Queue(Queue::Expunge, box, "EXPUNGE")); // Delete them from the database.. @@ -564,7 +559,6 @@ "UID STORE " + QString::number(uid) + " +FLAGS (" + flag + ')')); m_db->addFlag(uid, box, flag); - checkMail(box); // so the count gets updated.... } void Imap::addFlag(const QString& box, const QString& flag) @@ -578,7 +572,6 @@ + QString::number(min) + ":" + QString::number(max) + " +FLAGS (" + flag + ')')); m_db->addFlag(box, flag); - checkMail(box); // so the count gets updated.... } void Imap::removeFlag(const int uid, const QString& box, const QString& flag) --- trunk/playground/pim/mailody/src/imap.h #604187:604188 @@ -37,7 +37,7 @@ Auth, GetMailBoxList, CheckMail, - QuickSelectMailBox, + SelectMailBox, SyncMailBox, GetHeaderList, GetHeaders, --- trunk/playground/pim/mailody/src/main.cpp #604187:604188 @@ -28,7 +28,7 @@ { KAboutData aboutData( "mailody", I18N_NOOP("Mailody"), - "0.2.0-beta1", + "0.2.0-rc1", I18N_NOOP("An IMAP mail client"), KAboutData::License_GPL, "(c) 2006, KovoKs", "http://www.mailody.net"); --- trunk/playground/pim/mailody/src/mainwindow.cpp #604187:604188 @@ -1073,9 +1073,6 @@ void MainWindow::slotDropped(QDropEvent *e) { - // Yes, I know this will be far from efficient when moving multiple msg.. - // I don't care for now.... - // Do not use a dropped signal which emits the klistviewitem, // these seem to return a previous item sometimes. hence we // calculate the item ourselfes. @@ -1094,6 +1091,7 @@ kdDebug() << text << " dropped on " << destbox << endl; QStringList movable = QStringList::split("\n", text); QStringList::Iterator it = movable.begin(); + QMap origBoxesUsed; while (it != movable.end()) { QString uid = *it; @@ -1111,15 +1109,14 @@ } m_connection->moveMessage(uid.toInt(), origbox, destbox); - - //Probably selected... - m_connection->checkMailBox(origbox); - - // should not be selected... - m_connection->checkMail(destbox); - + origBoxesUsed[origbox] = true; ++it; } + + QMapIterator ita = origBoxesUsed.begin(); + for (; ita != origBoxesUsed.end(); ++ita) + m_connection->checkMailBox(ita.key()); //Probably selected... + m_connection->checkMail(destbox); m_headerList->triggerUpdate(); } @@ -1454,6 +1451,7 @@ { statusBar()->changeItem(text,1); QApplication::restoreOverrideCursor(); + //kdDebug() << "status: " << text << endl; kapp->processEvents(); m_statusTimer->start(3000, true); } --- trunk/playground/pim/mailody/src/messageview.cpp #604187:604188 @@ -431,7 +431,7 @@ } top(); update(); - kdDebug() << "t: " << m_currentMessage->body() << endl; + // kdDebug() << "t: " << m_currentMessage->body() << endl; setText(m_currentMessage->body()); } --- trunk/playground/pim/mailody/src/socketsafe.cpp #604187:604188 @@ -143,7 +143,9 @@ slotDisconnected(); else err = m_socket->errorString(); - emit error(i18n("Creating the connection failed, " + + if (!m_aboutToClose) + emit error(i18n("Creating the connection failed, " "the error:\n\n%1").arg(err)); }