File indexing completed on 2024-03-24 03:59:14
0001 /* 0002 This file is part of KNewStuffCore. 0003 SPDX-FileCopyrightText: 2016 Dan Leinir Turthra Jensen <admin@leinir.dk> 0004 0005 SPDX-License-Identifier: LGPL-2.1-or-later 0006 */ 0007 0008 #include "questionmanager.h" 0009 0010 #include "question.h" 0011 0012 namespace KNSCore 0013 { 0014 class QuestionManagerHelper 0015 { 0016 public: 0017 QuestionManagerHelper() = default; 0018 ~QuestionManagerHelper() 0019 { 0020 delete q; 0021 } 0022 QuestionManager *q = nullptr; 0023 }; 0024 Q_GLOBAL_STATIC(QuestionManagerHelper, s_kns3_questionManager) 0025 0026 QuestionManager *QuestionManager::instance() 0027 { 0028 if (!s_kns3_questionManager()->q) { 0029 s_kns3_questionManager()->q = new QuestionManager; 0030 } 0031 return s_kns3_questionManager()->q; 0032 } 0033 0034 QuestionManager::QuestionManager() 0035 : QObject() 0036 { 0037 Q_UNUSED(d) 0038 } 0039 0040 QuestionManager::~QuestionManager() = default; 0041 } 0042 0043 #include "moc_questionmanager.cpp"