Author: lslezak Date: Thu Aug 28 09:57:24 2008 New Revision: 50425 URL: http://svn.opensuse.org/viewcvs/yast?rev=50425&view=rev Log: - do not export function which use unsupported data type (like function references) Modified: branches/tmp/lslezak/core/dbus/namespace_service/DBusModulesServer.cc Modified: branches/tmp/lslezak/core/dbus/namespace_service/DBusModulesServer.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/dbus/namespace_service/DBusModulesServer.cc?rev=50425&r1=50424&r2=50425&view=diff ============================================================================== --- branches/tmp/lslezak/core/dbus/namespace_service/DBusModulesServer.cc (original) +++ branches/tmp/lslezak/core/dbus/namespace_service/DBusModulesServer.cc Thu Aug 28 09:57:24 2008 @@ -198,8 +198,8 @@ } } - // set 5 seconds timeout - connection.setTimeout(5000); + // set 1 second timeout + connection.setTimeout(1000); // try reading a message from DBus DBusMsg request(connection.receive()); @@ -411,6 +411,8 @@ case(YT_PATH) : ret = DBUS_TYPE_STRING_AS_STRING; break; case(YT_SYMBOL) : ret = DBUS_TYPE_STRING_AS_STRING; break; case(YT_LIST) : ret = DBUS_TYPE_ARRAY_AS_STRING; break; + + default : y2warning("Value type %d is not supported", vt); break; /* case(YT_MAP) : ret = DBUS_TYPE__AS_STRING; break; case(YT_) : ret = DBUS_TYPE__AS_STRING; break; @@ -523,35 +525,45 @@ constTypePtr rettype = fptr->returnType(); - ret += " <method name='" + std::string(name) + "'>"; + std::string method(" <method name='" + std::string(name) + "'>"); // add return type std::string rett(Y2Dtype(rettype)); if (!rett.empty()) { - ret += " <arg name='ret' type='" + rett + "' direction='out'/>"; + method += " <arg name='ret' type='" + rett + "' direction='out'/>"; } // add parameter types int params = fptr->parameterCount(); int parindex = 0; + bool params_ok = true; while(parindex < params) { std::string partype(Y2Dtype(fptr->parameterType(parindex))); if (!partype.empty()) { - ret += " <arg name='param' type='" + partype + "' direction='in'/>"; + method += " <arg name='param' type='" + partype + "' direction='in'/>"; + } + else + { + y2warning("Function %s is not exported due to an unsupported parameter type", name); + params_ok = false; + break; } parindex++; } - ret += " </method>"; + if (params_ok) + { + method += " </method>"; + ret += method; + } } - } index++; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org