~ci-train-bot/ubuntu-system-settings/ubuntu-system-settings-ubuntu-yakkety-landing-027

« back to all changes in this revision

Viewing changes to tests/mocks/Ubuntu/DownloadManager/MockMetadata.cpp

  • Committer: Bileto Bot
  • Author(s): jonas-drange
  • Date: 2016-08-17 11:18:05 UTC
  • mfrom: (1631.6.245 updates-rewrite)
  • Revision ID: ci-train-bot@canonical.com-20160817111805-moyvik9wloy79ul3
rewrite the system update panel

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
#include "MockMetadata.h"
 
20
#include <QDebug>
 
21
 
 
22
MockMetadata::MockMetadata(QObject* parent)
 
23
    : QObject(parent)
 
24
    , m_map()
 
25
    , m_custom()
 
26
{
 
27
}
 
28
 
 
29
QString MockMetadata::title() const
 
30
{
 
31
    return m_map.value("title", "").toString();
 
32
}
 
33
 
 
34
void MockMetadata::setTitle(QString title)
 
35
{
 
36
    m_map.insert("title", title);
 
37
}
 
38
 
 
39
bool MockMetadata::showInIndicator() const
 
40
{
 
41
    return false;
 
42
}
 
43
 
 
44
void MockMetadata::setShowInIndicator(bool shown)
 
45
{
 
46
 
 
47
}
 
48
 
 
49
QVariantMap MockMetadata::map() const
 
50
{
 
51
    return QVariantMap();
 
52
}
 
53
 
 
54
QStringList MockMetadata::command() const
 
55
{
 
56
    return m_map.contains("command") ? m_map.value("command").toStringList():QStringList();
 
57
}
 
58
 
 
59
void MockMetadata::setCommand(const QStringList &command)
 
60
{
 
61
    m_map.insert("command", command);
 
62
}
 
63
 
 
64
 
 
65
QVariantMap MockMetadata::custom() const
 
66
{
 
67
    return m_custom;
 
68
}
 
69
 
 
70
void MockMetadata::setCustom(const QVariantMap &custom)
 
71
{
 
72
    m_custom = custom;
 
73
}