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

List:       kde-commits
Subject:    branches/kdepim/enterprise/kdepim/kmail
From:       Allen Winter <winter () kde ! org>
Date:       2010-09-28 19:50:37
Message-ID: 20100928195037.81794AC88E () svn ! kde ! org
[Download RAW message or body]

SVN commit 1180751 by winterz:

add a new callback UpdateReaderWindow that can be used by the plugins
to redraw the current message.

use UpdateReaderWindow() in mailICal() when the user doesn't want to
automatically delete after mailing replies.

to be used in various places to not confuse the user who doesn't
opt to remove invitations after replying to them.
MERGE: trunk


 M  +16 -7     callback.cpp  
 M  +3 -0      callback.h  


--- branches/kdepim/enterprise/kdepim/kmail/callback.cpp #1180750:1180751
@@ -111,11 +111,13 @@
     msg->setBody( iCal.utf8() );
   }
 
-  if ( delMessage && deleteInvitationAfterReply() )
+  if ( delMessage && deleteInvitationAfterReply() ) {
     /* We want the triggering mail to be moved to the trash once this one
     * has been sent successfully. Set a link header which accomplishes that. */
     msg->link( mMsg, KMMsgStatusDeleted );
-
+  } else {
+    mReaderWin->updateReaderWin();
+  }
   // Try and match the receiver with an identity.
   // Setting the identity here is important, as that is used to select the correct
   // transport later
@@ -240,6 +242,11 @@
   return mReceiver;
 }
 
+void Callback::updateReaderWindow() const
+{
+  mReaderWin->updateReaderWin();
+}
+
 void Callback::closeIfSecondaryWindow() const
 {
   KMail::SecondaryWindow *window = dynamic_cast<KMail::SecondaryWindow*>( mReaderWin->mainWindow() );
@@ -249,14 +256,16 @@
 
 bool Callback::askForComment( KCal::Attendee::PartStat status ) const
 {
-    if ( ( status != KCal::Attendee::Accepted
-            && GlobalSettings::self()->askForCommentWhenReactingToInvitation()
-            == GlobalSettings:: EnumAskForCommentWhenReactingToInvitation::AskForAllButAcceptance )
-        || GlobalSettings::self()->askForCommentWhenReactingToInvitation()
-        == GlobalSettings:: EnumAskForCommentWhenReactingToInvitation::AlwaysAsk )
+  if ( ( status != KCal::Attendee::Accepted &&
+         GlobalSettings::self()->askForCommentWhenReactingToInvitation() ==
+         GlobalSettings:: EnumAskForCommentWhenReactingToInvitation::AskForAllButAcceptance ) ||
+       GlobalSettings::self()->askForCommentWhenReactingToInvitation() ==
+       GlobalSettings:: EnumAskForCommentWhenReactingToInvitation::AlwaysAsk ) {
         return true;
+  } else {
     return false;
 }
+}
 
 bool Callback::deleteInvitationAfterReply() const
 {
--- branches/kdepim/enterprise/kdepim/kmail/callback.h #1180750:1180751
@@ -72,6 +72,9 @@
   /** Returns the sender of the mail. */
   QString sender() const;
 
+  /** Updates the current reader window. */
+  void updateReaderWindow() const;
+
   /** Close the main window showing this message, if it's a secondary window. */
   void closeIfSecondaryWindow() const;
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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