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 {
24 }
25 
26 QString QuickListEntry::actionId() const
27 {
28  return m_actionId;
29 }
30 
31 void QuickListEntry::setActionId(const QString &actionId)
32 {
33  m_actionId = actionId;
34 }
35 
36 QString QuickListEntry::text() const
37 {
38  return m_text;
39 }
40 
41 void QuickListEntry::setText(const QString &text)
42 {
43  m_text = text;
44 }
45 
46 QString QuickListEntry::icon() const
47 {
48  return m_icon;
49 }
50 
51 void QuickListEntry::setIcon(const QString &icon)
52 {
53  m_icon = icon;
54 }
55 
56 bool QuickListEntry::clickable() const
57 {
58  return !m_actionId.isEmpty();
59 }
60 
61 void QuickListEntry::setHasSeparator(bool hasSeparator)
62 {
63  m_hasSeparator = hasSeparator;
64 }
65 
66 bool QuickListEntry::hasSeparator() const
67 {
68  return m_hasSeparator;
69 }
70 
71 bool QuickListEntry::operator==(const QuickListEntry &other)
72 {
73  return !other.actionId().isEmpty() && other.actionId() == m_actionId;
74 }