Unity 8
quicklistentry.cpp
1 /* Copyright (C) 2013, 2015 Canonical, Ltd.
2  *
3  * Authors:
4  * Michael Zanetti <michael.zanetti@canonical.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; version 3.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #include "quicklistentry.h"
20 
21 QuickListEntry::QuickListEntry()
22  : m_hasSeparator(false)
23  , m_isPrivate(false)
24 {
25 }
26 
27 QString QuickListEntry::actionId() const
28 {
29  return m_actionId;
30 }
31 
32 void QuickListEntry::setActionId(const QString &actionId)
33 {
34  m_actionId = actionId;
35 }
36 
37 QString QuickListEntry::text() const
38 {
39  return m_text;
40 }
41 
42 void QuickListEntry::setText(const QString &text)
43 {
44  m_text = text;
45 }
46 
47 QString QuickListEntry::icon() const
48 {
49  return m_icon;
50 }
51 
52 void QuickListEntry::setIcon(const QString &icon)
53 {
54  m_icon = icon;
55 }
56 
57 bool QuickListEntry::clickable() const
58 {
59  return !m_actionId.isEmpty();
60 }
61 
62 void QuickListEntry::setHasSeparator(bool hasSeparator)
63 {
64  m_hasSeparator = hasSeparator;
65 }
66 
67 bool QuickListEntry::hasSeparator() const
68 {
69  return m_hasSeparator;
70 }
71 
72 bool QuickListEntry::operator==(const QuickListEntry &other)
73 {
74  return !other.actionId().isEmpty() && other.actionId() == m_actionId;
75 }
76 
77 bool QuickListEntry::isPrivate() const
78 {
79  return m_isPrivate;
80 }
81 
82 void QuickListEntry::setIsPrivate(bool isPrivate)
83 {
84  m_isPrivate = isPrivate;
85 }