~jbicha/lo-menubar/description-lp-733615

« back to all changes in this revision

Viewing changes to src/FrameJob.cxx

  • Committer: Alberto Ruiz
  • Date: 2011-03-11 11:09:47 UTC
  • Revision ID: alberto.ruiz@codethink.co.uk-20110311110947-br3voapaq877s0j2
Finished work to shut down the service on component detaching

Show diffs side-by-side

added added

removed removed

Lines of Context:
305
305
 
306
306
        Reference< XController > xController( xModel->getCurrentController(), UNO_QUERY);
307
307
        
308
 
        exportMenus     (Reference< XFrame > ( xController->getFrame(), UNO_QUERY));
 
308
        exportMenus (Reference< XFrame > ( xController->getFrame(), UNO_QUERY));
309
309
}
310
310
 
311
311
 
316
316
 
317
317
        this->xFrame = xFrame;
318
318
 
319
 
        //TODO: Find a smarter way to check if the object is there
320
 
        GDBusProxy *proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
321
 
                                                           (GDBusProxyFlags)(G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES),
322
 
                                                           NULL,
323
 
                                                           LIBREOFFICE_BUSNAME,
324
 
                                                           xid_to_object_path(getXID (xFrame)).getStr(),
325
 
                                                           "org.freedesktop.DBus.Properties",
326
 
                                                           NULL,
327
 
                                                           NULL);
328
 
                                       
329
 
        if (proxy)
330
 
        {
331
 
                GError *error = NULL;
332
 
                GVariant * result = g_dbus_proxy_call_sync      (proxy,
333
 
                                                         "org.freedesktop.DBus.Properties.Get",
334
 
                                                                 g_variant_new ("(ss)",
335
 
                                                                                "com.canonical.dbusmenu",
336
 
                                                                                "com.canonical.dbusmenu.version"),
337
 
                                                                                                                                                
338
 
                                                         G_DBUS_CALL_FLAGS_NONE,
339
 
                                                         90,
340
 
                                                         NULL,
341
 
                                                         &error);
342
 
                if (!error)
343
 
                {
344
 
                        // The object exists, we quit
345
 
                        g_debug ("not error");
346
 
                        if (result)
347
 
                                g_variant_unref (result);
348
 
                                
349
 
                        g_object_unref (proxy);
350
 
                        return;
351
 
                }
352
 
                g_debug ("error");
353
 
                //free error
354
 
                g_object_unref (proxy);
355
 
        }
356
 
        
357
 
 
358
 
 
359
319
        //Create dbusmenu server object path string
360
320
        DbusmenuServer *server = dbusmenu_server_new (xid_to_object_path(getXID (xFrame)).getStr());
361
321