Abdelrazak Younes schrieb:
Stephan Witt wrote:
Andre Poenitz schrieb:
On Tue, Aug 21, 2007 at 10:31:57AM +0200, Stephan Witt wrote:
////////////////////////////////////////////////////////////////////////
 // X11 specific stuff goes here...
 #ifdef Q_WS_X11
+
+void GuiApplication::commitData(QSessionManager & sm)
+{
+    /// The implementation is required to avoid an application exit
+    /// when session state save is triggered by session manager.
+    /// The default implementation sends a close event to all
+    /// visible top level widgets when session managment allows
+    /// interaction.
+    /// We are changeing that to write all unsaved buffers...
+    if ( sm.allowsInteraction() ) {
+         if ( !theBufferList().quitWriteAll() ) {

Spacing.

Thanks. Very clear. Did you try it?

I'll provide a modified patch when there is a need for.
Do you want the "if (sm.allowsInteraction()) {" style?

Yes, that's what he meant. I'll go even further ;-)

    if (sm.allowsInteraction() && !theBufferList().quitWriteAll())
         sm.cancel();

I am OK with the patch but I would like to know first if there are any drawbacks, I am not on X11.

I tested this patch with Qt 4.1.2 and it is working without drawbacks.
AFAIK older Qt versions are not supported anymore were I had problems with the popping up of the dialog asking the user to confirm the file save operation. So two years ago the patch did not work (with Qt 3.x).
I cannot tell anything about the behaviour on Windows.
Do you need a new patch from me or will you change it yourself?
I'm online next week again.

Thanks,
Stephan

Reply via email to