diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llappviewerlinux.cpp | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/linden/indra/newview/llappviewerlinux.cpp b/linden/indra/newview/llappviewerlinux.cpp index d2ed5d2..9727dcf 100644 --- a/linden/indra/newview/llappviewerlinux.cpp +++ b/linden/indra/newview/llappviewerlinux.cpp | |||
@@ -369,6 +369,7 @@ G_DEFINE_TYPE(ViewerAppAPI, viewerappapi, G_TYPE_OBJECT); | |||
369 | 369 | ||
370 | void viewerappapi_class_init(ViewerAppAPIClass *klass) | 370 | void viewerappapi_class_init(ViewerAppAPIClass *klass) |
371 | { | 371 | { |
372 | LL_DEBUGS("DBUS")<< "Debug DBUS1"<< LL_ENDL; | ||
372 | } | 373 | } |
373 | 374 | ||
374 | static bool dbus_server_init = false; | 375 | static bool dbus_server_init = false; |
@@ -376,19 +377,23 @@ static bool dbus_server_init = false; | |||
376 | void viewerappapi_init(ViewerAppAPI *server) | 377 | void viewerappapi_init(ViewerAppAPI *server) |
377 | { | 378 | { |
378 | // Connect to the default DBUS, register our service/API. | 379 | // Connect to the default DBUS, register our service/API. |
379 | 380 | LL_DEBUGS("DBUS")<< "Debug DBUS2"<< LL_ENDL; | |
380 | if (!dbus_server_init) | 381 | if (!dbus_server_init) |
381 | { | 382 | { |
383 | LL_DEBUGS("DBUS")<< "Debug DBUS3"<< LL_ENDL; | ||
382 | GError *error = NULL; | 384 | GError *error = NULL; |
383 | 385 | ||
384 | server->connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error); | 386 | server->connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error); |
387 | LL_DEBUGS("DBUS")<< "Debug DBUS4"<< LL_ENDL; | ||
385 | if (server->connection) | 388 | if (server->connection) |
386 | { | 389 | { |
387 | dbus_g_object_type_install_info(viewerappapi_get_type(), &dbus_glib_viewerapp_object_info); | 390 | dbus_g_object_type_install_info(viewerappapi_get_type(), &dbus_glib_viewerapp_object_info); |
388 | 391 | LL_DEBUGS("DBUS")<< "Debug DBUS5"<< LL_ENDL; | |
389 | dbus_g_connection_register_g_object(server->connection, VIEWERAPI_PATH, G_OBJECT(server)); | 392 | dbus_g_connection_register_g_object(server->connection, VIEWERAPI_PATH, G_OBJECT(server)); |
390 | 393 | LL_DEBUGS("DBUS")<< "Debug DBUS6"<< LL_ENDL; | |
394 | |||
391 | DBusGProxy *serverproxy = dbus_g_proxy_new_for_name(server->connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); | 395 | DBusGProxy *serverproxy = dbus_g_proxy_new_for_name(server->connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); |
396 | LL_DEBUGS("DBUS")<< "Debug DBUS7"<< LL_ENDL; | ||
392 | 397 | ||
393 | guint request_name_ret_unused; | 398 | guint request_name_ret_unused; |
394 | // akin to org_freedesktop_DBus_request_name | 399 | // akin to org_freedesktop_DBus_request_name |
@@ -396,6 +401,7 @@ void viewerappapi_init(ViewerAppAPI *server) | |||
396 | { | 401 | { |
397 | // total success. | 402 | // total success. |
398 | dbus_server_init = true; | 403 | dbus_server_init = true; |
404 | LL_DEBUGS("DBUS")<< "Debug DBUS8"<< LL_ENDL; | ||
399 | } | 405 | } |
400 | else | 406 | else |
401 | { | 407 | { |
@@ -403,6 +409,7 @@ void viewerappapi_init(ViewerAppAPI *server) | |||
403 | } | 409 | } |
404 | 410 | ||
405 | g_object_unref(serverproxy); | 411 | g_object_unref(serverproxy); |
412 | LL_DEBUGS("DBUS")<< "Debug DBUS9"<< LL_ENDL; | ||
406 | } | 413 | } |
407 | else | 414 | else |
408 | { | 415 | { |
@@ -410,8 +417,16 @@ void viewerappapi_init(ViewerAppAPI *server) | |||
410 | } | 417 | } |
411 | 418 | ||
412 | if (error) | 419 | if (error) |
420 | { | ||
413 | g_error_free(error); | 421 | g_error_free(error); |
422 | LL_DEBUGS("DBUS")<< "Debug DBUS10"<< LL_ENDL; | ||
423 | } | ||
424 | |||
414 | } | 425 | } |
426 | else | ||
427 | LL_DEBUGS("DBUS")<< "Debug DBUS11"<< LL_ENDL; | ||
428 | |||
429 | LL_DEBUGS("DBUS")<< "Debug DBUS End"<< LL_ENDL; | ||
415 | } | 430 | } |
416 | 431 | ||
417 | gboolean viewer_app_api_GoSLURL(ViewerAppAPI *obj, gchar *slurl, gboolean **success_rtn, GError **error) | 432 | gboolean viewer_app_api_GoSLURL(ViewerAppAPI *obj, gchar *slurl, gboolean **success_rtn, GError **error) |
@@ -442,7 +457,11 @@ gboolean viewer_app_api_GoSLURL(ViewerAppAPI *obj, gchar *slurl, gboolean **succ | |||
442 | //virtual | 457 | //virtual |
443 | bool LLAppViewerLinux::initSLURLHandler() | 458 | bool LLAppViewerLinux::initSLURLHandler() |
444 | { | 459 | { |
460 | if (gSavedSettings.getBOOL("DisableDBUS")) | ||
461 | return false; | ||
462 | |||
445 | g_type_init(); | 463 | g_type_init(); |
464 | LL_DEBUGS("DBUS")<< "Debug DBUS Start"<< LL_ENDL; | ||
446 | 465 | ||
447 | //ViewerAppAPI *api_server = (ViewerAppAPI*) | 466 | //ViewerAppAPI *api_server = (ViewerAppAPI*) |
448 | g_object_new(viewerappapi_get_type(), NULL); | 467 | g_object_new(viewerappapi_get_type(), NULL); |
@@ -453,6 +472,9 @@ bool LLAppViewerLinux::initSLURLHandler() | |||
453 | //virtual | 472 | //virtual |
454 | bool LLAppViewerLinux::sendURLToOtherInstance(const std::string& url) | 473 | bool LLAppViewerLinux::sendURLToOtherInstance(const std::string& url) |
455 | { | 474 | { |
475 | if (gSavedSettings.getBOOL("DisableDBUS")) | ||
476 | return false; | ||
477 | |||
456 | bool success = false; | 478 | bool success = false; |
457 | DBusGConnection *bus; | 479 | DBusGConnection *bus; |
458 | GError *error = NULL; | 480 | GError *error = NULL; |