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),
34 m_quickList(new QuickListModel(this))
36 QuickListEntry nameAction;
37 nameAction.setActionId(
"launch_item");
38 nameAction.setText(m_name);
39 m_quickList->appendAction(nameAction);
42 QString LauncherItem::appId()
const
47 QString LauncherItem::name()
const
52 void LauncherItem::setName(
const QString &name)
57 entry.setActionId(
"launch_item");
58 entry.setText(m_name);
59 m_quickList->updateAction(entry);
60 Q_EMIT nameChanged(name);
64 QString LauncherItem::icon()
const
69 void LauncherItem::setIcon(
const QString &icon)
73 Q_EMIT iconChanged(icon);
77 bool LauncherItem::pinned()
const
82 void LauncherItem::setPinned(
bool pinned)
84 if (m_pinned != pinned) {
86 Q_EMIT pinnedChanged(pinned);
90 bool LauncherItem::running()
const
95 void LauncherItem::setRunning(
bool running)
97 if (m_running != running) {
99 Q_EMIT runningChanged(running);
103 bool LauncherItem::recent()
const
108 void LauncherItem::setRecent(
bool recent)
110 if (m_recent != recent) {
112 Q_EMIT recentChanged(recent);
116 int LauncherItem::progress()
const
121 void LauncherItem::setProgress(
int progress)
123 if (m_progress != progress) {
124 m_progress = progress;
125 Q_EMIT progressChanged(progress);
129 int LauncherItem::count()
const
134 void LauncherItem::setCount(
int count)
136 if (m_count != count) {
138 Q_EMIT countChanged(count);
142 bool LauncherItem::countVisible()
const
144 return m_countVisible;
147 void LauncherItem::setCountVisible(
bool countVisible)
149 if (m_countVisible != countVisible) {
150 m_countVisible = countVisible;
151 Q_EMIT countVisibleChanged(countVisible);
155 bool LauncherItem::focused()
const
160 void LauncherItem::setFocused(
bool focused)
162 if (m_focused != focused) {
164 Q_EMIT focusedChanged(focused);
168 unity::shell::launcher::QuickListModelInterface *LauncherItem::quickList()
const