KNewStuff

questionmanager.cpp
1 /*
2  This file is part of KNewStuffCore.
3 
4  Copyright (c) 2016 Dan Leinir Turthra Jensen <[email protected]>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with this library. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #include "questionmanager.h"
21 
22 using namespace KNSCore;
23 
24 class QuestionManagerHelper {
25 public:
26  QuestionManagerHelper() : q(nullptr) {}
27  ~QuestionManagerHelper() { delete q; }
28  QuestionManagerHelper(const QuestionManagerHelper &) = delete;
29  QuestionManagerHelper& operator=(const QuestionManagerHelper &) = delete;
30  QuestionManager *q;
31 };
32 Q_GLOBAL_STATIC(QuestionManagerHelper, s_kns3_questionManager)
33 
34 class QuestionManager::Private
35 {
36 public:
37  Private() {}
38 };
39 
40 
41 QuestionManager* QuestionManager::instance()
42 {
43  if(!s_kns3_questionManager()->q) {
44  new QuestionManager;
45  }
46  return s_kns3_questionManager()->q;
47 }
48 
49 QuestionManager::QuestionManager()
50  : QObject(nullptr)
51  , d(new Private)
52 {
53  s_kns3_questionManager()->q = this;
54 }
55 
56 QuestionManager::~QuestionManager()
57 {
58  delete d;
59 }
Contains the core functionality for handling interaction with NewStuff providers. ...
The central class handling Question redirection.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Aug 9 2020 22:43:40 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.