summaryrefslogtreecommitdiffstats
path: root/src/declarative/declarativeserviceaction.cpp
blob: a070b4289cb8888272458f6053e978b117da75dd (plain)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#include "declarativeserviceaction_p.h"

#include <QtCore/QDebug>

// ------------------------------------------------------------------------------------------------

DeclarativeServiceAction::DeclarativeServiceAction(QObject *theParent) :
        QObject(theParent),
        m_ServiceAction()
{}

// ------------------------------------------------------------------------------------------------

DeclarativeServiceAction::DeclarativeServiceAction(const QServiceAction &other, QObject *theParent) :
        QObject(theParent),
        m_ServiceAction(other)
{}

// ------------------------------------------------------------------------------------------------

DeclarativeServiceAction::~DeclarativeServiceAction()
{
    //qDebug() << Q_FUNC_INFO << "name():" << name();
}

// ------------------------------------------------------------------------------------------------

void DeclarativeServiceAction::assign(DeclarativeServiceAction *other)
{
    if (other == 0) {
        qWarning() << Q_FUNC_INFO << "other:" << other;
        return;
    }

    m_ServiceAction = other->m_ServiceAction;
}

// ------------------------------------------------------------------------------------------------

bool DeclarativeServiceAction::equals(DeclarativeServiceAction *other) const
{
    if (other == 0) {
        qWarning() << Q_FUNC_INFO << "other:" << other;
        return false;
    }

    return m_ServiceAction == other->m_ServiceAction;
}

// ------------------------------------------------------------------------------------------------

QServiceAction DeclarativeServiceAction::serviceAction() const
{
    return m_ServiceAction;
}

// ------------------------------------------------------------------------------------------------

bool DeclarativeServiceAction::isValid() const
{
    return m_ServiceAction.isValid();
}

// ------------------------------------------------------------------------------------------------

const QServiceActionName &DeclarativeServiceAction::name() const
{
    return m_ServiceAction.name();
}

// ------------------------------------------------------------------------------------------------

void DeclarativeServiceAction::setName(const QServiceActionName &newName)
{
    m_ServiceAction = QServiceAction(newName, m_ServiceAction.displayName(), m_ServiceAction.iconUrl());
}

// ------------------------------------------------------------------------------------------------

QString DeclarativeServiceAction::displayName() const
{
    return m_ServiceAction.displayName();
}

// ------------------------------------------------------------------------------------------------

void DeclarativeServiceAction::setDisplayName(const QString &newDisplayName)
{
    m_ServiceAction = QServiceAction(m_ServiceAction.name(), newDisplayName, m_ServiceAction.iconUrl());
}

// ------------------------------------------------------------------------------------------------

QString DeclarativeServiceAction::iconUrl() const
{
    return m_ServiceAction.iconUrl();
}

// ------------------------------------------------------------------------------------------------

void DeclarativeServiceAction::setIconUrl(const QString &newIconUrl)
{
    m_ServiceAction = QServiceAction(m_ServiceAction.name(), m_ServiceAction.displayName(), newIconUrl);
}