17 #include "launcheritem.h"
18 #include "quicklistmodel.h"
22 LauncherItem::LauncherItem(
const QString &appId,
const QString &name,
const QString &icon, QObject *parent) :
23 LauncherItemInterface(parent),
32 m_countVisible(false),
35 m_quickList(new QuickListModel(this))
37 QuickListEntry nameAction;
38 nameAction.setActionId(QStringLiteral(
"launch_item"));
39 nameAction.setText(m_name);
40 m_quickList->appendAction(nameAction);
43 QString LauncherItem::appId()
const
48 QString LauncherItem::name()
const
53 void LauncherItem::setName(
const QString &name)
58 entry.setActionId(QStringLiteral(
"launch_item"));
59 entry.setText(m_name);
60 m_quickList->updateAction(entry);
61 Q_EMIT nameChanged(name);
65 QString LauncherItem::icon()
const
70 void LauncherItem::setIcon(
const QString &icon)
74 Q_EMIT iconChanged(icon);
78 bool LauncherItem::pinned()
const
83 void LauncherItem::setPinned(
bool pinned)
85 if (m_pinned != pinned) {
87 Q_EMIT pinnedChanged(pinned);
91 bool LauncherItem::running()
const
96 void LauncherItem::setRunning(
bool running)
98 if (m_running != running) {
100 Q_EMIT runningChanged(running);
104 bool LauncherItem::recent()
const
109 void LauncherItem::setRecent(
bool recent)
111 if (m_recent != recent) {
113 Q_EMIT recentChanged(recent);
117 int LauncherItem::progress()
const
122 void LauncherItem::setProgress(
int progress)
124 if (m_progress != progress) {
125 m_progress = progress;
126 Q_EMIT progressChanged(progress);
130 int LauncherItem::count()
const
135 void LauncherItem::setCount(
int count)
137 if (m_count != count) {
139 Q_EMIT countChanged(count);
143 bool LauncherItem::countVisible()
const
145 return m_countVisible;
148 void LauncherItem::setCountVisible(
bool countVisible)
150 if (m_countVisible != countVisible) {
151 m_countVisible = countVisible;
152 Q_EMIT countVisibleChanged(countVisible);
156 bool LauncherItem::focused()
const
161 void LauncherItem::setFocused(
bool focused)
163 if (m_focused != focused) {
165 Q_EMIT focusedChanged(focused);
169 bool LauncherItem::alerting()
const
174 void LauncherItem::setAlerting(
bool alerting)
176 if (m_alerting != alerting) {
177 m_alerting = alerting;
178 Q_EMIT alertingChanged(alerting);
182 unity::shell::launcher::QuickListModelInterface *LauncherItem::quickList()
const