~artmello/ubuntu-system-settings/ubuntu-system-settings-notifications_remove_list_check

« back to all changes in this revision

Viewing changes to tests/mocks/Ubuntu/SystemSettings/Notifications/plugin.cpp

Implement extended Notifications panel using Gsettings to store notifications settings for each app

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2016 Canonical, Ltd.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License as published by
 
6
 * the Free Software Foundation; version 3.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 */
 
16
 
 
17
#include "plugin.h"
 
18
#include "MockClickApplicationsModel.h"
 
19
#include "MockClickApplicationsNotifyModel.h"
 
20
 
 
21
#include <QtQml>
 
22
 
 
23
#define MAKE_SINGLETON_FACTORY(type) \
 
24
    static QObject* type##_singleton_factory(QQmlEngine* engine, QJSEngine* scriptEngine) { \
 
25
        Q_UNUSED(engine); \
 
26
        Q_UNUSED(scriptEngine); \
 
27
        return new type(); \
 
28
    }
 
29
 
 
30
MAKE_SINGLETON_FACTORY(MockClickApplicationsModel)
 
31
 
 
32
void BackendPlugin::registerTypes(const char *uri)
 
33
{
 
34
    Q_ASSERT(uri == QLatin1String("Ubuntu.SystemSettings.Notifications"));
 
35
    qmlRegisterSingletonType<MockClickApplicationsModel>(uri, 1, 0, "ClickApplicationsModel", MockClickApplicationsModel_singleton_factory);
 
36
    qmlRegisterType<MockClickApplicationsNotifyModel>(uri, 1, 0, "ClickApplicationsNotifyModel");
 
37
}