Fix defining QGuiApplication::sync() when QT_NO_SESSIONMANAGER is set

sync() is unconditionally declared in the QGuiApplication header, but
the definition was under QT_NO_SESSIONMANAGER guards.

This commit moves the definition of sync() outside of
the QT_NO_SESSIONMANAGER guards, since the sync code has nothing to do
with session management.

[ChangeLog][QtGui][QGuiApplication] Fixed a bug that would cause
QGuiApplication::sync() to be left undefined for Qt builds without
session management support.

Change-Id: Ieb46f7c90c9193e89469126170117d9df672f4cb
Task-number: QTBUG-51703
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Olivier Blin 2016-05-30 11:16:19 +02:00 committed by Olivier Blin
parent 8f85e82c5d
commit 3cc2884c03
1 changed files with 22 additions and 22 deletions

View File

@ -3275,28 +3275,6 @@ bool QGuiApplication::isSavingSession() const
return d->is_saving_session;
}
/*!
\since 5.2
Function that can be used to sync Qt state with the Window Systems state.
This function will first empty Qts events by calling QCoreApplication::processEvents(),
then the platform plugin will sync up with the windowsystem, and finally Qts events
will be delived by another call to QCoreApplication::processEvents();
This function is timeconsuming and its use is discouraged.
*/
void QGuiApplication::sync()
{
QCoreApplication::processEvents();
if (QGuiApplicationPrivate::platform_integration
&& QGuiApplicationPrivate::platform_integration->hasCapability(QPlatformIntegration::SyncState)) {
QGuiApplicationPrivate::platform_integration->sync();
QCoreApplication::processEvents();
QWindowSystemInterface::flushWindowSystemEvents();
}
}
void QGuiApplicationPrivate::commitData()
{
Q_Q(QGuiApplication);
@ -3321,6 +3299,28 @@ void QGuiApplicationPrivate::saveState()
}
#endif //QT_NO_SESSIONMANAGER
/*!
\since 5.2
Function that can be used to sync Qt state with the Window Systems state.
This function will first empty Qts events by calling QCoreApplication::processEvents(),
then the platform plugin will sync up with the windowsystem, and finally Qts events
will be delived by another call to QCoreApplication::processEvents();
This function is timeconsuming and its use is discouraged.
*/
void QGuiApplication::sync()
{
QCoreApplication::processEvents();
if (QGuiApplicationPrivate::platform_integration
&& QGuiApplicationPrivate::platform_integration->hasCapability(QPlatformIntegration::SyncState)) {
QGuiApplicationPrivate::platform_integration->sync();
QCoreApplication::processEvents();
QWindowSystemInterface::flushWindowSystemEvents();
}
}
/*!
\property QGuiApplication::layoutDirection
\brief the default layout direction for this application