~ci-train-bot/ubuntu-system-settings/ubuntu-system-settings-ubuntu-zesty-2679

« back to all changes in this revision

Viewing changes to tests/mocks/plugins/system-update/fakeimagemanager.h

  • Committer: Ken VanDine
  • Date: 2017-03-15 19:17:14 UTC
  • mto: This revision was merged to the branch mainline in revision 1766.
  • Revision ID: ken.vandine@canonical.com-20170315191714-1appjzosayvmf246
removed more click/updates stuff

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * This file is part of system-settings
3
 
 *
4
 
 * Copyright (C) 2016 Canonical Ltd.
5
 
 *
6
 
 * This program is free software: you can redistribute it and/or modify it
7
 
 * under the terms of the GNU General Public License version 3, as published
8
 
 * by the Free Software Foundation.
9
 
 *
10
 
 * This program is distributed in the hope that it will be useful, but
11
 
 * WITHOUT ANY WARRANTY; without even the implied warranties of
12
 
 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
13
 
 * PURPOSE.  See the GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License along
16
 
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 
 */
18
 
 
19
 
#ifndef MOCK_IMAGE_MANAGER_H
20
 
#define MOCK_IMAGE_MANAGER_H
21
 
 
22
 
#include "image/imagemanager.h"
23
 
 
24
 
namespace UpdatePlugin
25
 
{
26
 
class MockImageManager : public Image::Manager
27
 
{
28
 
public:
29
 
    MockImageManager(QObject *parent = nullptr)
30
 
        : Image::Manager(parent) {};
31
 
    virtual ~MockImageManager() {};
32
 
 
33
 
    virtual void check() override
34
 
    {
35
 
        m_checkingForUpdates = true;
36
 
        Q_EMIT checkingForUpdatesChanged();
37
 
    }
38
 
 
39
 
    virtual void cancel() override
40
 
    {
41
 
        m_checkingForUpdates = false;
42
 
        Q_EMIT checkingForUpdatesChanged();
43
 
    }
44
 
 
45
 
    virtual bool checkingForUpdates() const override
46
 
    {
47
 
        return m_checkingForUpdates;
48
 
    }
49
 
 
50
 
    void mockChecking(const bool checking) {
51
 
        m_checkingForUpdates = checking;
52
 
        Q_EMIT checkingForUpdatesChanged();
53
 
    }
54
 
 
55
 
    bool m_checkingForUpdates = false;
56
 
    QString m_launched = QString::null;
57
 
};
58
 
} // UpdatePlugin
59
 
#endif // MOCK_IMAGE_MANAGER_H