mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-07 17:16:00 -05:00
Rework MacroRef
This should resolve issues of macro names / selections not properly updating after renaming / grouping / un-grouping macros
This commit is contained in:
@@ -69,17 +69,20 @@ MacroList::MacroList(QWidget *parent, bool allowDuplicates, bool reorder)
|
||||
void MacroList::SetContent(const std::vector<MacroRef> ¯os)
|
||||
{
|
||||
for (auto &m : macros) {
|
||||
QString name;
|
||||
if (!m.get()) {
|
||||
name = QString::fromStdString(m.RefName()) + "<" +
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.macroList.deleted") +
|
||||
">";
|
||||
QString listEntryName;
|
||||
auto macroName = m.Name();
|
||||
if (macroName.empty()) {
|
||||
listEntryName = QString::fromStdString(
|
||||
std::string("<") +
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.macroList.deleted") +
|
||||
">");
|
||||
} else {
|
||||
name = QString::fromStdString(m->Name());
|
||||
listEntryName = QString::fromStdString(macroName);
|
||||
}
|
||||
QListWidgetItem *item = new QListWidgetItem(name, _list);
|
||||
item->setData(Qt::UserRole, name);
|
||||
QListWidgetItem *item =
|
||||
new QListWidgetItem(listEntryName, _list);
|
||||
item->setData(Qt::UserRole, listEntryName);
|
||||
}
|
||||
SetMacroListSize();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user