@@ -66,7 +66,7 @@ QString DBusInterface::introspect(const QString &path) const
66 "<interface name=\"com.canonical.Unity.Launcher.Item\">"
66 "<interface name=\"com.canonical.Unity.Launcher.Item\">"
67 "<property name=\"count\" type=\"i\" access=\"readwrite\" />"
67 "<property name=\"count\" type=\"i\" access=\"readwrite\" />"
68 "<property name=\"countVisible\" type=\"b\" access=\"readwrite\" />"
68 "<property name=\"countVisible\" type=\"b\" access=\"readwrite\" />"
69− "<property name=\"alerting\" type=\"b\" access=\"readwrite\" />"
69+ "<method name=\"Alert\" />"
70 "</interface>";
70 "</interface>";
71 return nodeiface;
71 return nodeiface;
@@ -127,6 +127,19 @@ bool DBusInterface::handleMessage(const QDBusMessage& message, const QDBusConnec
127 return false;
127 return false;
130+ /* Break down the path to just the app id */
131+ QString pathtemp = message.path();
132+ if (!pathtemp.startsWith("/com/canonical/Unity/Launcher/")) {
135+ pathtemp.remove("/com/canonical/Unity/Launcher/");
136+ if (pathtemp.indexOf('/') >= 0) {
140+ /* Find ourselves an appid */
141+ QString appid = decodeAppId(pathtemp);
130 // First handle methods of the Launcher interface
143 // First handle methods of the Launcher interface
131 if (message.interface() == "com.canonical.Unity.Launcher") {
144 if (message.interface() == "com.canonical.Unity.Launcher") {
132 if (message.member() == "Refresh") {
145 if (message.member() == "Refresh") {
@@ -134,6 +147,13 @@ bool DBusInterface::handleMessage(const QDBusMessage& message, const QDBusConnec
134 Q_EMIT refreshCalled();
147 Q_EMIT refreshCalled();
135 return connection.send(reply);
148 return connection.send(reply);
150+ } else if (message.interface() == "com.canonical.Unity.Launcher.Item") {
151+ // Handle methods of the Launcher-Item interface
152+ if (message.member() == "Alert") {
153+ QDBusMessage reply = message.createReply();
154+ Q_EMIT alertCalled(appid);
155+ return connection.send(reply);
139 // Now handle dynamic properties (for launcher emblems)
159 // Now handle dynamic properties (for launcher emblems)
@@ -145,18 +165,6 @@ bool DBusInterface::handleMessage(const QDBusMessage& message, const QDBusConnec
145 return false;
165 return false;
148− /* Break down the path to just the app id */
149− QString pathtemp = message.path();
150− if (!pathtemp.startsWith("/com/canonical/Unity/Launcher/")) {
153− pathtemp.remove("/com/canonical/Unity/Launcher/");
154− if (pathtemp.indexOf('/') >= 0) {
158− /* Find ourselves an appid */
159− QString appid = decodeAppId(pathtemp);
160 int index = m_launcherModel->findApplication(appid);
168 int index = m_launcherModel->findApplication(appid);
161 LauncherItem *item = static_cast<LauncherItem*>(m_launcherModel->get(index));
169 LauncherItem *item = static_cast<LauncherItem*>(m_launcherModel->get(index));
@@ -169,8 +177,6 @@ bool DBusInterface::handleMessage(const QDBusMessage& message, const QDBusConnec
169 retval.append(QVariant::fromValue(QDBusVariant(item->count())));
177 retval.append(QVariant::fromValue(QDBusVariant(item->count())));
170 } else if (message.arguments()[1].toString() == "countVisible") {
178 } else if (message.arguments()[1].toString() == "countVisible") {
171 retval.append(QVariant::fromValue(QDBusVariant(item->countVisible())));
179 retval.append(QVariant::fromValue(QDBusVariant(item->countVisible())));
172− } else if (message.arguments()[1].toString() == "alerting") {
173− retval.append(QVariant::fromValue(QDBusVariant(item->alerting())));
175 } else if (message.member() == "Set") {
181 } else if (message.member() == "Set") {
176 if (message.arguments()[1].toString() == "count") {
182 if (message.arguments()[1].toString() == "count") {
@@ -185,12 +191,6 @@ bool DBusInterface::handleMessage(const QDBusMessage& message, const QDBusConnec
185 Q_EMIT countVisibleChanged(appid, newVisible);
191 Q_EMIT countVisibleChanged(appid, newVisible);
186 notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "countVisible", newVisible);
192 notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "countVisible", newVisible);
188− } else if (message.arguments()[1].toString() == "alerting") {
189− bool newAlerting = message.arguments()[2].value<QDBusVariant>().variant().toBool();
190− if (!item || newAlerting != item->alerting()) {
191− Q_EMIT alertingChanged(appid, newAlerting);
192− notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "alerting", newAlerting);
195 } else if (message.member() == "GetAll") {
195 } else if (message.member() == "GetAll") {
196 if (item) {
196 if (item) {