| 1 | /* |
|---|---|
| 2 | This file is part of KNewStuffCore. |
| 3 | SPDX-FileCopyrightText: 2016 Dan Leinir Turthra Jensen <admin@leinir.dk> |
| 4 | |
| 5 | SPDX-License-Identifier: LGPL-2.1-or-later |
| 6 | */ |
| 7 | |
| 8 | #include "questionmanager.h" |
| 9 | |
| 10 | #include "question.h" |
| 11 | |
| 12 | namespace KNSCore |
| 13 | { |
| 14 | class QuestionManagerHelper |
| 15 | { |
| 16 | public: |
| 17 | QuestionManagerHelper() = default; |
| 18 | ~QuestionManagerHelper() |
| 19 | { |
| 20 | delete q; |
| 21 | } |
| 22 | QuestionManager *q = nullptr; |
| 23 | }; |
| 24 | Q_GLOBAL_STATIC(QuestionManagerHelper, s_kns3_questionManager) |
| 25 | |
| 26 | QuestionManager *QuestionManager::instance() |
| 27 | { |
| 28 | if (!s_kns3_questionManager()->q) { |
| 29 | s_kns3_questionManager()->q = new QuestionManager; |
| 30 | } |
| 31 | return s_kns3_questionManager()->q; |
| 32 | } |
| 33 | |
| 34 | QuestionManager::QuestionManager() |
| 35 | : QObject() |
| 36 | { |
| 37 | Q_UNUSED(d) |
| 38 | } |
| 39 | |
| 40 | QuestionManager::~QuestionManager() = default; |
| 41 | } |
| 42 | |
| 43 | #include "moc_questionmanager.cpp" |
| 44 |
