Добавил привязку действий к событиям

за баллы канала и за донаты можено можно выполнять списки действий, за каждое событие свой набор
This commit is contained in:
2026-02-22 10:20:04 +03:00
parent eb494ae8fa
commit 5094834ea1
7 changed files with 371 additions and 5 deletions
+10
View File
@@ -37,6 +37,8 @@ bool ActionManager::deleteAction(int id)
{
if (!m_db) return false;
if (!m_db->deleteAction(id)) return false;
// Удаляем все связи с этим действием
m_db->deleteLinksByActionId(id);
for (int i = 0; i < m_actions.size(); ++i) {
if (m_actions[i].id == id) {
@@ -60,3 +62,11 @@ bool ActionManager::loadFromDatabase()
emit dataChanged();
return true;
}
ActionData ActionManager::getAction(int id) const
{
for (const ActionData &a : m_actions) {
if (a.id == id) return a;
}
return ActionData(); // с id = -1
}