From 112eb60fcc0b3d8075c6dd5d522e1669210a6629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20Kaijanm=C3=A4ki?= Date: Wed, 2 Apr 2014 13:15:29 +0300 Subject: revert the last commit. --- libqmenumodel/src/unitymenumodel.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'libqmenumodel/src') diff --git a/libqmenumodel/src/unitymenumodel.cpp b/libqmenumodel/src/unitymenumodel.cpp index 6b57493..a2aae31 100644 --- a/libqmenumodel/src/unitymenumodel.cpp +++ b/libqmenumodel/src/unitymenumodel.cpp @@ -294,23 +294,13 @@ void UnityMenuModel::setBusName(const QByteArray &name) { priv->clearName(); - if (priv->nameWatchId) { + if (priv->nameWatchId) g_bus_unwatch_name (priv->nameWatchId); - priv->nameWatchId = 0; - } - priv->busName = name; - if (name.isEmpty()) - return; - - /* We could do a g_dbus_is_name() check here if we want to - * validate the name before passing it to g_bus_watch_name(). - * Currently if an invalid name is passed nameWatchId becomes 0 - * and g_bus_watch_name() prints out a nasty GCritical. - */ priv->nameWatchId = g_bus_watch_name (G_BUS_TYPE_SESSION, name.constData(), G_BUS_NAME_WATCHER_FLAGS_AUTO_START, UnityMenuModelPrivate::nameAppeared, UnityMenuModelPrivate::nameVanished, priv, NULL); + priv->busName = name; } QVariantMap UnityMenuModel::actions() const -- cgit v1.2.3