Move some Layout::Private method definitions out of the class

In preparation to move the class to an header
This commit is contained in:
Sergio Martins
2021-04-28 20:55:16 +01:00
parent d91a42930d
commit 6a205a5406

View File

@@ -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 <typename T>
@@ -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;
}