diff --git a/src/oxt/main.cxx b/src/oxt/main.cxx index a2f2500..523b1cc 100644 --- a/src/oxt/main.cxx +++ b/src/oxt/main.cxx @@ -301,6 +301,8 @@ void pw3270::uno_impl::failed(const char *fmt, ...) throw( ::com::sun::star::uno closelog(); #endif // HAVE_SYSLOG + trace("%s: %s",__FUNCTION__,msg); + ::rtl::OUString str = OUString(msg, strlen(msg), RTL_TEXTENCODING_UTF8, RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); free(msg); diff --git a/src/oxt/remote.cxx b/src/oxt/remote.cxx index e34a6dd..bc87757 100644 --- a/src/oxt/remote.cxx +++ b/src/oxt/remote.cxx @@ -224,8 +224,11 @@ pw3270::ipc3270_session::ipc3270_session(uno_impl *obj, const char *name) throw( conn = dbus_bus_get(DBUS_BUS_SESSION, &err); + trace("conn=%p",conn); + if (dbus_error_is_set(&err)) { + trace("DBUS Connection Error (%s)", err.message); obj->failed("DBUS Connection Error (%s)", err.message); dbus_error_free(&err); return; @@ -253,7 +256,27 @@ pw3270::ipc3270_session::ipc3270_session(uno_impl *obj, const char *name) throw( conn = NULL; return; } + else + { + DBusMessage * reply; + DBusMessage * msg = create_message("getRevision"); + DBusError error; + + dbus_error_init(&error); + reply = dbus_connection_send_with_reply_and_block(conn,msg,10000,&error); + dbus_message_unref(msg); + if(reply) + { + log("%s","PW3270 DBus object found"); + dbus_message_unref(reply); + } + else + { + obj->failed("DBUS error: %s",error.message); + dbus_error_free(&error); + } + } #else #endif // HAVE_DBUS diff --git a/src/oxt/testprogram.cxx b/src/oxt/testprogram.cxx index f2bfa5f..886b9b0 100644 --- a/src/oxt/testprogram.cxx +++ b/src/oxt/testprogram.cxx @@ -107,8 +107,19 @@ int SAL_CALL main(int argc, char **argv) char buffer[4096]; OString str; + try + { + srv->setSession(OUString::createFromAscii("pw3270:a")); + } + catch( RuntimeException & e ) + { + OString o = OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ); + fprintf( stderr, "%s\n", o.pData->buffer ); + exit(-1); + } + printf("Revision:\t%d\n",srv->getRevision()); srv->dsTrace(true); -- libgit2 0.21.2