214
213
PlaceRemote::Connect ()
216
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
217
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
223
on_service_proxy_ready,
226
if (_uri_regex || _mime_regex)
215
// We do not connect the entries, or ourselves, to the the daemon automatically at startup to
216
// increase the total login time of the desktop as we then reduce the number of things
217
// trashing the disk (i.e. zeitgeist/gwibber/etc) and taking CPU time
219
// What this means in to Unity is that it needs to make sure to have called Connect before
220
// trying to do use the Place or it's PlaceEntry's
222
if (!_conn_attempt && !G_IS_DBUS_PROXY (_service_proxy))
227
224
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
228
225
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
234
(GAsyncReadyCallback)PlaceRemote::OnActivationProxyReady,
231
on_service_proxy_ready,
234
if (_uri_regex || _mime_regex)
235
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
236
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
242
(GAsyncReadyCallback)PlaceRemote::OnActivationProxyReady,
245
std::vector<PlaceEntry *>::iterator it, eit = _entries.end ();
246
for (it = _entries.begin (); it != eit; ++it)
248
PlaceEntryRemote *entry = static_cast<PlaceEntryRemote *> (*it);
252
_conn_attempt = true;
238
256
std::vector<PlaceEntry *>&
309
329
g_signal_connect (_service_proxy, "g-signal",
310
330
G_CALLBACK (on_service_proxy_signal_received), this);
331
g_signal_connect (_service_proxy, "notify::g-name-owner",
332
G_CALLBACK (PlaceRemote::OnProxyNameOwnerChanged), this);
311
333
g_dbus_proxy_call (_service_proxy,
346
PlaceRemote::OnProxyNameOwnerChanged (GDBusProxy *proxy,
350
gchar *name_owner = g_dbus_proxy_get_name_owner (proxy);
354
// Remote proxy has died
355
g_debug ("Remote PlaceRemote proxy %s no longer exists, reconnecting", self->_dbus_name);
356
g_object_unref (self->_service_proxy);
357
g_object_unref (self->_activation_proxy);
358
self->_service_proxy = NULL;
359
self->_activation_proxy = NULL;
324
368
PlaceRemote::OnEntriesReceived (GVariant *args)
326
370
GVariantIter *iter;