20 #include "launcheritem.h"
21 #include "quicklistmodel.h"
25 LauncherItem::LauncherItem(
const QString &appId,
const QString &name,
const QString &icon, QObject *parent) :
26 LauncherItemInterface(parent),
36 m_quickList(new QuickListModel(this))
38 QuickListEntry nameAction;
39 nameAction.setText(m_name);
40 m_quickList->appendAction(nameAction);
41 QuickListEntry pinningAction;
42 pinningAction.setActionId(
"pin_item");
43 pinningAction.setText(gettext(
"Pin shortcut"));
44 m_quickList->appendAction(pinningAction);
47 QString LauncherItem::appId()
const
52 QString LauncherItem::name()
const
57 QString LauncherItem::icon()
const
62 bool LauncherItem::pinned()
const
67 void LauncherItem::setPinned(
bool pinned)
69 if (m_pinned != pinned) {
72 entry.setActionId(
"pin_item");
73 entry.setText(pinned ? gettext(
"Unpin shortcut") : gettext(
"Pin shortcut"));
74 m_quickList->updateAction(entry);
75 Q_EMIT pinnedChanged(pinned);
79 bool LauncherItem::running()
const
84 void LauncherItem::setRunning(
bool running)
86 if (m_running != running) {
88 Q_EMIT runningChanged(running);
92 bool LauncherItem::recent()
const
97 void LauncherItem::setRecent(
bool recent)
99 if (m_recent != recent) {
101 Q_EMIT recentChanged(recent);
105 int LauncherItem::progress()
const
110 void LauncherItem::setProgress(
int progress)
112 if (m_progress != progress) {
113 m_progress = progress;
114 Q_EMIT progressChanged(progress);
118 int LauncherItem::count()
const
123 void LauncherItem::setCount(
int count)
125 if (m_count != count) {
127 Q_EMIT countChanged(count);
131 bool LauncherItem::focused()
const
136 void LauncherItem::setFocused(
bool focused)
138 if (m_focused != focused) {
140 Q_EMIT focusedChanged(focused);
144 unity::shell::launcher::QuickListModelInterface *LauncherItem::quickList()
const