File indexing completed on 2024-12-08 03:28:44

0001 /* GCompris - ApplicationSettingsMock.h
0002  *
0003  * SPDX-FileCopyrightText: 2018 Himanshu Vishwakarma <himvish997@gmail.com>
0004  * GCompris  (C) 2018 GCompris Developers  <gcompris-devel@kde.org>
0005  *
0006  * Authors:
0007  *   Himanshu Vishwakarma <himvish997@gmail.com>
0008  *
0009  *   SPDX-License-Identifier: GPL-3.0-or-later
0010  */
0011 
0012 /* This file is used for the unit tests */
0013 
0014 #ifndef APPLICATIONSETTINGSMOCK_H
0015 #define APPLICATIONSETTINGSMOCK_H
0016 
0017 #include <QObject>
0018 
0019 #include "src/core/ApplicationSettings.h"
0020 
0021 class ApplicationSettingsMock : public ApplicationSettings
0022 {
0023 public:
0024     ApplicationSettingsMock() : ApplicationSettings(QStringLiteral("./dummy_application_settings.conf"))
0025     {
0026     }
0027 
0028     static ApplicationSettings *getInstance() {
0029         if(!m_instance) {
0030             m_instance = new ApplicationSettingsMock();
0031         }
0032         return m_instance;
0033     }
0034 };
0035 
0036 #endif // APPLICATIONSETTINGSMOCK_H