File: khotnewstuff_test.h

package info (click to toggle)
knewstuff 5.54.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,556 kB
  • sloc: cpp: 12,289; xml: 69; sh: 64; makefile: 9
file content (65 lines) | stat: -rw-r--r-- 1,912 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
    This file is part of KNewStuff2.
    Copyright (c) 2007 Josef Spillner <spillner@kde.org>
    Copyright (c) 2018 Dan Leinir Turthra Jensen <admin@leinir.dk>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef KHOTNEWSTUFF_TEST_H
#define KHOTNEWSTUFF_TEST_H

#include <KNSCore/Provider>
#include <KNSCore/EntryInternal>

#include <QObject>
#include <QStandardItemModel>

namespace KNSCore
{
class Engine;
}

class KNewStuff2Test : public QObject
{
    Q_OBJECT
    Q_PROPERTY(bool testAll READ testAll WRITE setTestAll NOTIFY testAllChanged)
public:
    KNewStuff2Test(const QString &configFile);

    void setTestAll(bool testall);
    bool testAll() const;
    Q_SIGNAL void testAllChanged();

    Q_INVOKABLE void entryTest();
    Q_INVOKABLE void providerTest();
    Q_INVOKABLE void engineTest();

    Q_INVOKABLE QObject *messages();
    void addMessage(const QString &message, const QString &iconName = QStringLiteral());

public Q_SLOTS:
    void slotProvidersLoaded();
    void slotEngineError(const QString &error);
    void slotEntriesLoaded(const KNSCore::EntryInternal::List &entries);
    void slotInstallationFinished();

private:
    KNSCore::Engine *m_engine;
    bool m_testall;
    QString m_configFile;
    QStandardItemModel* m_messages;
};

#endif