[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    Re: Setting date when editting message in outbox
From:       Jacek Stolarczyk <jacek () mer ! chemia ! polsl ! gliwice ! pl>
Date:       2000-03-31 19:37:14
[Download RAW message or body]

On Fri, 31 Mar 2000, Don Sanders wrote:
>This was meant to go to the list.
>
>On Fri, 31 Mar 2000, Don Sanders wrote:
>> KMail in the HEAD branch has been updated so that when you send a message the
>> message date is set to the sending date rather than the creation date.
>> 
>> This change below sounds fine, but could you please fix the HEAD branch.
>> 
I looked into the current state of this issue (cvs HEAD branch from
about noon GMT, friday). It seems to me that you have already solved the
problem with addition of setDateToday() to KMComposeWin::doSend.
Setting current date is called regardless of whether the message is
about to be "sent now" or "sent later". So when you edit a message from
outbox folder and you've made some changes then you have three ways to
close the window:
1) send now -> setDateToday is called
2) send later -> setDateToday is called
3) close from menu or X button on titlebar -> you're asked whether to
discard changes.
  -  If you choose "Yes" then changes get lost so the date should
      not be updated.
  -  If you choose "No" then you're back with your editor
  Effectively you have only options 1) and 2) which both set the date.

On the other hand this procedure may lead to confusion:
Say you have a message in outbox.
1) choose "Send queued" from main window menu -> no change in date
occurs
2) open message from outbox folder and choose "send later" or "send" ->
both ways the date is updated

Possible solution:
1) call SetDateToday() in doSend only if mSendNow == 0 (this way it
won't get called twice)
2) add SetDateToday() to KMSender::doSendMsg()

This way we would always set the date when the message is really sent
and when we edit it (without sending) from outbox. IMHO it's a better
solution. It may not be too important for people with normal connection
to the net, but for people with dialup connections these dates may
differ significantly.

Sorry, this message got that long. Patch included at the end. Shall I
commit it?

Best wishes,

Jacek Stolarczyk
-- 
jstolarz on cvs.kde.org
Coordinator of Polish translations of KDE

-----------------------------------------------------
--- kmcomposewin.cpp	Fri Mar 31 14:55:26 2000
+++ kmcomposewin.cpp.new	Fri Mar 31 21:33:50 2000
@@ -1657,7 +1657,8 @@
 
   kernel->kbp()->busy();
   //applyChanges();  // is called twice otherwise. Lars
-  mMsg->setDateToday();
+  if (!aSendNow) //to avoid calling twice in other cases.
+    mMsg->setDateToday();
   sentOk = (applyChanges() && kernel->msgSender()->send(mMsg, aSendNow));
   kernel->kbp()->idle();
------------------------------------------------------
--- kmsender.cpp	Tue Mar 28 12:18:13 2000
+++ kmsender.cpp.new	Fri Mar 31 21:31:58 2000
@@ -272,6 +272,7 @@
   // remove header fields that shall not be included in sending
   mCurrentMsg->removeHeaderField("Status");
   mCurrentMsg->removeHeaderField("X-Status");
+  mCurrentMsg->setDateToday();
 
   // start sending the current message
   mSendProc->preSendInit();

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic