| 15 | {} |
| 16 | |
| 17 | BaseTask *TaskRegistry::createTask(const QString &taskType, QObject *parent) const |
| 18 | { |
| 19 | LOG_MESSAGE(QString("Trying to create task: %1").arg(taskType)); |
| 20 | |
| 21 | if (m_creators.contains(taskType)) { |
| 22 | LOG_MESSAGE(QString("Found creator for task type: %1").arg(taskType)); |
| 23 | try { |
| 24 | BaseTask *task = m_creators[taskType](parent); |
| 25 | if (task) { |
| 26 | LOG_MESSAGE(QString("Successfully created task: %1").arg(taskType)); |
| 27 | return task; |
| 28 | } |
| 29 | } catch (...) { |
| 30 | LOG_MESSAGE(QString("Exception while creating task of type: %1").arg(taskType)); |
| 31 | } |
| 32 | } else { |
| 33 | LOG_MESSAGE(QString("No creator found for task type: %1").arg(taskType)); |
| 34 | } |
| 35 | |
| 36 | return nullptr; |
| 37 | } |
| 38 | |
| 39 | QStringList TaskRegistry::getAvailableTypes() const |
| 40 | { |
nothing calls this directly
no outgoing calls
no test coverage detected