Mac: make windows not restorable on 10.7 and later

The default value for NSWindow::setRestorable: is true, it means
application will have some information for each window stored.
After a crash happened and application relaunched, the application
tries to restore those windows from the broken file. And then the
"Retore Windows" will pop up. There is no workaround for
application users or develoeprs. What they can do is to manually
remove the the saved application state file for the applicaiton.

To avoid that, better to switch it off.

Task-number: QTBUG-28281
Change-Id: I8ce3cd94f5ae81d7877a346743ca4e0e188baa02
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
Liang Qi 2012-12-10 11:19:52 +01:00 committed by The Qt Project
parent 7d757fc8fe
commit 2aef22b77a

View File

@ -710,6 +710,11 @@ NSWindow * QCocoaWindow::createNSWindow()
createdWindow = window;
}
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if ([createdWindow respondsToSelector:@selector(setRestorable:)])
[createdWindow setRestorable: NO];
#endif
NSInteger level = windowLevel(flags);
[createdWindow setLevel:level];
m_windowModality = window()->modality();