mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
DolphinQt: Move GraphicsModListWidget::ClearLayoutRecursively() to QtUtils.
This commit is contained in:
@ -19,6 +19,7 @@
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "DolphinQt/Config/GraphicsModWarningWidget.h"
|
||||
#include "DolphinQt/QtUtils/ClearLayoutRecursively.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
#include "UICommon/GameFile.h"
|
||||
#include "VideoCommon/GraphicsModSystem/Config/GraphicsMod.h"
|
||||
@ -240,31 +241,6 @@ void GraphicsModListWidget::SaveModList()
|
||||
m_needs_save = true;
|
||||
}
|
||||
|
||||
void GraphicsModListWidget::ClearLayoutRecursively(QLayout* layout)
|
||||
{
|
||||
while (QLayoutItem* child = layout->takeAt(0))
|
||||
{
|
||||
if (child == nullptr)
|
||||
continue;
|
||||
|
||||
if (child->widget())
|
||||
{
|
||||
layout->removeWidget(child->widget());
|
||||
delete child->widget();
|
||||
}
|
||||
else if (child->layout())
|
||||
{
|
||||
ClearLayoutRecursively(child->layout());
|
||||
layout->removeItem(child);
|
||||
}
|
||||
else
|
||||
{
|
||||
layout->removeItem(child);
|
||||
}
|
||||
delete child;
|
||||
}
|
||||
}
|
||||
|
||||
void GraphicsModListWidget::SaveToDisk()
|
||||
{
|
||||
m_needs_save = false;
|
||||
|
@ -56,8 +56,6 @@ private:
|
||||
|
||||
void SaveModList();
|
||||
|
||||
void ClearLayoutRecursively(QLayout* layout);
|
||||
|
||||
void OpenGraphicsModDir();
|
||||
|
||||
void CalculateGameRunning(Core::State state);
|
||||
|
Reference in New Issue
Block a user