GraphicsModListWidget: Pass optional by const reference
All we do is read from it, so we don't need to copy the string if we happen to have one.
This commit is contained in:
parent
a1879ea099
commit
81aca79145
|
@ -185,7 +185,7 @@ void GraphicsModListWidget::ModItemChanged(QListWidgetItem* item)
|
||||||
m_needs_save = true;
|
m_needs_save = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsModListWidget::OnModChanged(std::optional<std::string> absolute_path)
|
void GraphicsModListWidget::OnModChanged(const std::optional<std::string>& absolute_path)
|
||||||
{
|
{
|
||||||
ClearLayoutRecursively(m_mod_meta_layout);
|
ClearLayoutRecursively(m_mod_meta_layout);
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ void GraphicsModListWidget::OnModChanged(std::optional<std::string> absolute_pat
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GraphicsModConfig* mod = m_mod_group.GetMod(*absolute_path);
|
const GraphicsModConfig* mod = m_mod_group.GetMod(*absolute_path);
|
||||||
if (!mod)
|
if (!mod)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ private:
|
||||||
void ModSelectionChanged();
|
void ModSelectionChanged();
|
||||||
void ModItemChanged(QListWidgetItem* item);
|
void ModItemChanged(QListWidgetItem* item);
|
||||||
|
|
||||||
void OnModChanged(std::optional<std::string> absolute_path);
|
void OnModChanged(const std::optional<std::string>& absolute_path);
|
||||||
|
|
||||||
void SaveModList();
|
void SaveModList();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue