Author: lslezak Date: Mon Jul 14 15:21:31 2008 New Revision: 49050 URL: http://svn.opensuse.org/viewcvs/yast?rev=49050&view=rev Log: - added SCR::RegisterAgent() - DBusConn - reset the error structure Modified: branches/tmp/lslezak/workshop/core/libscr/src/SCR.cc branches/tmp/lslezak/workshop/core/scr/src/DBusConn.cc branches/tmp/lslezak/workshop/core/scr/src/DBusServer.cc Modified: branches/tmp/lslezak/workshop/core/libscr/src/SCR.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/workshop/core/libscr/src/SCR.cc?rev=49050&r1=49049&r2=49050&view=diff ============================================================================== --- branches/tmp/lslezak/workshop/core/libscr/src/SCR.cc (original) +++ branches/tmp/lslezak/workshop/core/libscr/src/SCR.cc Mon Jul 14 15:21:31 2008 @@ -259,11 +259,9 @@ static YCPValue SCRRegisterAgentS (const YCPPath &path, const YCPString &arg) { - // TODO FIXME if (connection != NULL) { - y2error("SCR::RegisterAgent() call is not implemented yet in DBus layer!"); - return YCPVoid(); + return CallDBus("RegisterAgent", path, arg); } if (! SCRAgent::instance()) @@ -279,11 +277,9 @@ static YCPValue SCRRegisterAgentT (const YCPPath &path, const YCPTerm &arg) { - // TODO FIXME if (connection != NULL) { - y2error("SCR::RegisterAgent() call is not implemented yet in DBus layer!"); - return YCPVoid(); + return CallDBus("RegisterAgent", path, arg); } if (! SCRAgent::instance()) Modified: branches/tmp/lslezak/workshop/core/scr/src/DBusConn.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/workshop/core/scr/src/DBusConn.cc?rev=49050&r1=49049&r2=49050&view=diff ============================================================================== --- branches/tmp/lslezak/workshop/core/scr/src/DBusConn.cc (original) +++ branches/tmp/lslezak/workshop/core/scr/src/DBusConn.cc Mon Jul 14 15:21:31 2008 @@ -117,6 +117,12 @@ { DBusMessage *reply = dbus_connection_send_with_reply_and_block(connection, msg.getMessage(), -1, &dbus_error); + if (dbus_error_is_set(&dbus_error)) + { + y2error("DBus error: %s", dbus_error.message); + dbus_error_free(&dbus_error); + } + DBusMsg ret; if (reply != NULL) { Modified: branches/tmp/lslezak/workshop/core/scr/src/DBusServer.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/workshop/core/scr/src/DBusServer.cc?rev=49050&r1=49049&r2=49050&view=diff ============================================================================== --- branches/tmp/lslezak/workshop/core/scr/src/DBusServer.cc (original) +++ branches/tmp/lslezak/workshop/core/scr/src/DBusServer.cc Mon Jul 14 15:21:31 2008 @@ -94,7 +94,7 @@ if (method == "Read" || method == "Write" || method == "Execute" || method == "Dir" || method == "Error" || method == "UnregisterAgent" || method == "UnregisterAllAgents" || method == "UnmountAgent" || - method == "RegisterNewAgents") + method == "RegisterNewAgents" || method == "RegisterAgent") { YCPValue arg = request.getYCPValue(1); YCPValue opt = request.getYCPValue(2); @@ -141,6 +141,10 @@ ret = sa->UnmountAgent(pth); else if (method == "RegisterNewAgents") ret = sa->RegisterNewAgents(); + else if (method == "RegisterAgent") + ret = sa->RegisterAgent(pth, arg); + else + y2internal("Unhandled method %s", method.c_str()); reply.createReply(request); @@ -221,6 +225,11 @@ " <method name='RegisterNewAgents'>" " <arg name='ret' type='b' direction='out'/>" " </method>" +" <method name='RegisterAgent'>" +" <arg name='path' type='s' direction='in'/>" +" <arg name='arg' type='v' direction='in'/>" +" <arg name='ret' type='b' direction='out'/>" +" </method>" " <method name='UnmountAgent'>" " <arg name='path' type='s' direction='in'/>" " <arg name='ret' type='b' direction='out'/>" -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org