Fix some warnings in ToolWindowManager so we can keep level 4 globally

* Nested foreach() hiding a local variable in the macro definition.
* Declarations of 'data' parameters that hide a class member variable.
This commit is contained in:
baldurk
2017-04-28 13:47:21 +01:00
parent 8e32da581e
commit 628df6d9c8
4 changed files with 26 additions and 30 deletions
@@ -81,17 +81,17 @@ QVariantMap ToolWindowManagerWrapper::saveState() {
return result;
}
void ToolWindowManagerWrapper::restoreState(const QVariantMap &data) {
restoreGeometry(QByteArray::fromBase64(data["geometry"].toByteArray()));
void ToolWindowManagerWrapper::restoreState(const QVariantMap &savedData) {
restoreGeometry(QByteArray::fromBase64(savedData["geometry"].toByteArray()));
if (layout()->count() > 0) {
qWarning("wrapper is not empty");
return;
}
if (data.contains("splitter")) {
layout()->addWidget(m_manager->restoreSplitterState(data["splitter"].toMap()));
} else if (data.contains("area")) {
if (savedData.contains("splitter")) {
layout()->addWidget(m_manager->restoreSplitterState(savedData["splitter"].toMap()));
} else if (savedData.contains("area")) {
ToolWindowManagerArea* area = m_manager->createArea();
area->restoreState(data["area"].toMap());
area->restoreState(savedData["area"].toMap());
layout()->addWidget(area);
}
}