~ubuntu-branches/ubuntu/utopic/cairo-dock-plug-ins/utopic

« back to all changes in this revision

Viewing changes to Status-Notifier/src/applet-item.c

Tags: upstream-2.4.0~0beta2
ImportĀ upstreamĀ versionĀ 2.4.0~0beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
353
353
CDStatusNotifierItem *cd_satus_notifier_create_item (const gchar *cService, const gchar *cObjectPath)
354
354
{
355
355
        g_return_val_if_fail  (cService != NULL, NULL);
356
 
        gchar *str = strchr (cService, '/');
 
356
        //g_print ("=== %s (%s)\n", __func__, cService);
 
357
        
 
358
        gchar *str = strchr (cService, '/');  // just to be sure.
357
359
        if (str)
358
360
                *str = '\0';
359
 
        //g_print ("=== %s (%s)\n", __func__, cService);
360
361
        
361
362
        // special case for Ubuntu indicators: we don't know their object path.
362
363
        if (cObjectPath != NULL && strncmp (cObjectPath, CD_INDICATOR_APPLICATION_ITEM_OBJ, strlen (CD_INDICATOR_APPLICATION_ITEM_OBJ)) == 0)
363
364
        {
 
365
                // I think this is because this path is actually the menu path, and fortunately it's just under the item object's path.
364
366
                gchar *str = strrchr (cObjectPath, '/');
365
367
                if (str)
366
368
                        *str = '\0';
367
369
        }
368
 
        else
 
370
        else if (cObjectPath == NULL || *cObjectPath == '\0')  // no path, let's assume it's the common one.
369
371
        {
370
372
                cObjectPath = CD_STATUS_NOTIFIER_ITEM_OBJ;
371
373
        }
372
374
        
 
375
        //g_print ("=== %s (cObjectPath: %s)\n", __func__, cObjectPath);
 
376
        
373
377
        //\_________________ get the properties of the item.
374
378
        DBusGProxy *pProxyItemProp = cairo_dock_create_new_session_proxy (
375
379
                cService,
378
382
        if (pProxyItemProp == NULL)
379
383
                return NULL;
380
384
        //g_print ("=== owner : %s\n", dbus_g_proxy_get_bus_name (pProxyItemProp));
381
 
        
 
385
 
 
386
        cd_debug ("%s, %s, %s", cService, cObjectPath, dbus_g_proxy_get_bus_name (pProxyItemProp));
 
387
 
382
388
        //g_print ("=== getting properties ...\n");
383
389
        GHashTable *hProps = cairo_dock_dbus_get_all_properties (pProxyItemProp, CD_STATUS_NOTIFIER_ITEM_IFACE);
384
390
        if (hProps == NULL)