mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-22 01:44:49 -05:00
Add RemoveItemsByName()
Helper function to remove Items by name from std::queue of Item
This commit is contained in:
parent
ce501bd972
commit
d71c87535f
|
|
@ -347,4 +347,18 @@ void Item::Save(obs_data_t *obj) const
|
|||
obs_data_set_string(obj, "name", _name.c_str());
|
||||
}
|
||||
|
||||
void RemoveItemsByName(std::deque<std::shared_ptr<Item>> &items,
|
||||
const QStringList &names)
|
||||
{
|
||||
for (const auto &name : names) {
|
||||
items.erase(std::remove_if(
|
||||
items.begin(), items.end(),
|
||||
[name](const std::shared_ptr<Item> &item) {
|
||||
return item->Name() ==
|
||||
name.toStdString();
|
||||
}),
|
||||
items.end());
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@ protected:
|
|||
friend ItemSettingsDialog;
|
||||
};
|
||||
|
||||
void EXPORT RemoveItemsByName(std::deque<std::shared_ptr<Item>> &items,
|
||||
const QStringList &names);
|
||||
|
||||
class ItemSettingsDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user