Merged revisions 851016 via svnmerge from

https://vkrause@svn.kde.org/home/kde/branches/kdepim/enterprise/kdepim

........
  r851016 | vkrause | 2008-08-22 20:54:09 +0200 (Fri, 22 Aug 2008) | 8 lines
  
  Wait until the composer has saved the currently edited message. This is
  extemely ugly, but as this happens very late in the shutdown, there are
  not many options left.
  This fixes the loss of unsaved composer content when KMail/Kontact is
  closed.
  
  Kolab issue 2927
........

svn path=/branches/kdepim/enterprise4/kdepim/; revision=856711
wilder-work
Volker Krause 18 years ago
parent ae123a9fba
commit f002d5fe0d
  1. 5
      composer.h
  2. 5
      kmcomposewin.h
  3. 12
      kmkernel.cpp

@ -71,6 +71,11 @@ class Composer : public KMail::SecondaryWindow
virtual void setMsg( KMMessage *newMsg, bool mayAutoSign=true,
bool allowDecryption=false, bool isModified=false ) = 0;
/**
* Returns @c true while the message composing is in progress.
*/
virtual bool isComposing() const = 0;
public: // kmkernel
/**
* Set the filename which is used for autosaving.

@ -183,6 +183,11 @@ class KMComposeWin : public KMail::Composer
*/
void disableWordWrap();
/**
* Returns @c true while the message composing is in progress.
*/
bool isComposing() const { return mComposer != 0; }
private: // kmedit
/**
* Returns message of the composer. To apply the user changes to the

@ -1795,9 +1795,17 @@ void KMKernel::dumpDeadLetters()
return; //All documents should be saved before shutting down is set!
// make all composer windows autosave their contents
foreach ( KMainWindow* window, KMainWindow::memberList() )
if ( KMail::Composer * win = ::qobject_cast<KMail::Composer*>( window ) )
foreach ( KMainWindow* window, KMainWindow::memberList() ) {
if ( KMail::Composer * win = ::qobject_cast<KMail::Composer*>( window ) ) {
win->autoSaveMessage();
// saving the message has to be finished right here, we are called from a dtor,
// therefore we have no chance to finish this later
// yes, this is ugly and potentially dangerous, but the alternative is losing
// currently composed messages...
while ( win->isComposing() )
qApp->processEvents();
}
}
}

Loading…
Cancel
Save