diff --git a/src/LayoutSaver.cpp b/src/LayoutSaver.cpp index 661280a8..f5628f6d 100644 --- a/src/LayoutSaver.cpp +++ b/src/LayoutSaver.cpp @@ -82,29 +82,14 @@ public: struct RAIIIsRestoring { - RAIIIsRestoring() - { - LayoutSaver::Private::s_restoreInProgress = true; - } - - ~RAIIIsRestoring() - { - LayoutSaver::Private::s_restoreInProgress = false; - } + RAIIIsRestoring(); + ~RAIIIsRestoring(); Q_DISABLE_COPY(RAIIIsRestoring) }; - Private(RestoreOptions options) - : m_dockRegistry(DockRegistry::self()) - , m_restoreOptions(internalRestoreOptions(options)) - { - } - - bool matchesAffinity(const QStringList &affinities) const { - return m_affinityNames.isEmpty() || affinities.isEmpty() || DockRegistry::self()->affinitiesMatch(m_affinityNames, affinities); - } - + explicit Private(RestoreOptions options); + bool matchesAffinity(const QStringList &affinities) const; void floatWidgetsWhichSkipRestore(const QStringList &mainWindowNames); template @@ -385,6 +370,18 @@ void LayoutSaver::Private::deserializeWindowGeometry(const T &saved, QWidgetOrQu topLevel->setVisible(saved.isVisible); } +LayoutSaver::Private::Private(RestoreOptions options) + : m_dockRegistry(DockRegistry::self()) + , m_restoreOptions(internalRestoreOptions(options)) +{ +} + +bool LayoutSaver::Private::matchesAffinity(const QStringList &affinities) const +{ + return m_affinityNames.isEmpty() || affinities.isEmpty() + || DockRegistry::self()->affinitiesMatch(m_affinityNames, affinities); +} + void LayoutSaver::Private::floatWidgetsWhichSkipRestore(const QStringList &mainWindowNames) { // Widgets with the DockWidget::LayoutSaverOption::Skip flag skip restore completely. @@ -1082,3 +1079,13 @@ void LayoutSaver::ScalingInfo::applyFactorsTo(QRect &rect) const rect.moveTopLeft(pos); rect.setSize(size); } + +LayoutSaver::Private::RAIIIsRestoring::RAIIIsRestoring() +{ + LayoutSaver::Private::s_restoreInProgress = true; +} + +LayoutSaver::Private::RAIIIsRestoring::~RAIIIsRestoring() +{ + LayoutSaver::Private::s_restoreInProgress = false; +}