[yast-commit] r55809 - in /branches/tmp/lslezak/core: configure.in.in dbus/namespace_service/DBusModulesServer.cc dbus/namespace_service/Yast_dbus_names.h.in liby2dbus/src/DBusServerBase.cc
Author: lslezak
Date: Fri Feb 27 10:56:56 2009
New Revision: 55809
URL: http://svn.opensuse.org/viewcvs/yast?rev=55809&view=rev
Log:
- DBus service - use /org/opensuse/YaST/modules object prefix
Modified:
branches/tmp/lslezak/core/configure.in.in
branches/tmp/lslezak/core/dbus/namespace_service/DBusModulesServer.cc
branches/tmp/lslezak/core/dbus/namespace_service/Yast_dbus_names.h.in
branches/tmp/lslezak/core/liby2dbus/src/DBusServerBase.cc
Modified: branches/tmp/lslezak/core/configure.in.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/configure.in.in?rev=55809&r1=55808&r2=55809&view=diff
==============================================================================
--- branches/tmp/lslezak/core/configure.in.in (original)
+++ branches/tmp/lslezak/core/configure.in.in Fri Feb 27 10:56:56 2009
@@ -144,6 +144,8 @@
AC_SUBST(YAST_DBUS_YCP_INTERFACE)
YAST_DBUS_MGR_INTERFACE=org.opensuse.YaST.modules.ModuleManager
AC_SUBST(YAST_DBUS_MGR_INTERFACE)
+YAST_DBUS_OBJ_PREFIX=/org/opensuse/YaST/modules
+AC_SUBST(YAST_DBUS_OBJ_PREFIX)
YAST_POLKIT_PREFIX_MANAGER=org.opensuse.yast.module-manager
AC_SUBST(YAST_POLKIT_PREFIX_MANAGER)
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=55809&r1=55808&r2=55809&view=diff
==============================================================================
--- branches/tmp/lslezak/core/dbus/namespace_service/DBusModulesServer.cc (original)
+++ branches/tmp/lslezak/core/dbus/namespace_service/DBusModulesServer.cc Fri Feb 27 10:56:56 2009
@@ -135,11 +135,11 @@
{
sig_raw.params = p_raw;
// register the function: register_function(object, interface, method, signature, handler)
- register_method(nspace, YAST_DBUS_RAW_INTERFACE, fname, sig_raw, e);
+ register_method(YAST_DBUS_OBJ_PREFIX"/" + nspace, YAST_DBUS_RAW_INTERFACE, fname, sig_raw, e);
}
sig_marshalled.params = p_marshalled;
- register_method(nspace, YAST_DBUS_YCP_INTERFACE, fname, sig_marshalled, e);
+ register_method(YAST_DBUS_OBJ_PREFIX"/" + nspace, YAST_DBUS_YCP_INTERFACE, fname, sig_marshalled, e);
return true;
}
@@ -221,12 +221,12 @@
sig.params = p;
// register the manager object: register_function(object, interface, method, signature, handler)
- register_method("", YAST_DBUS_MGR_INTERFACE, YAST_DBUS_MANAGER_IMPORT_METHOD, sig, manager_callback);
+ register_method("/", YAST_DBUS_MGR_INTERFACE, YAST_DBUS_MANAGER_IMPORT_METHOD, sig, manager_callback);
DBusSignature void_sig;
// register the manager object: register_function(object, interface, method, signature, handler)
- register_method("", YAST_DBUS_MGR_INTERFACE, YAST_DBUS_MANAGER_UNLOCK_METHOD, void_sig, manager_callback);
- register_method("", YAST_DBUS_MGR_INTERFACE, YAST_DBUS_MANAGER_LOCK_METHOD, void_sig, manager_callback);
+ register_method("/", YAST_DBUS_MGR_INTERFACE, YAST_DBUS_MANAGER_UNLOCK_METHOD, void_sig, manager_callback);
+ register_method("/", YAST_DBUS_MGR_INTERFACE, YAST_DBUS_MANAGER_LOCK_METHOD, void_sig, manager_callback);
}
std::string DBusModulesServer::Y2Dtype(constTypePtr type) const
@@ -599,10 +599,18 @@
? YAST_POLKIT_PREFIX_MANAGER : YAST_POLKIT_PREFIX_MODULES);
std::string obj(msg.path());
-
+
+ // convert object path "/org/opensuse/yast/Label" to PolKit path "Label"
if (!obj.empty())
{
- if (obj[0] == '/')
+ if (obj[obj.size() - 1] == '/')
+ {
+ obj.erase(obj.end());
+ }
+
+ obj.erase(0, obj.rfind("/"));
+
+ if (!obj.empty() && obj[0] == '/')
{
obj.erase(obj.begin());
}
@@ -615,6 +623,7 @@
ret += '.' + msg.method();
+ // make it valid action ID (lowercase chars, replace invalid chars)
if (!PolKit::isValidActionID(ret))
{
ret = PolKit::makeValidActionID(ret);
Modified: branches/tmp/lslezak/core/dbus/namespace_service/Yast_dbus_names.h.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/dbus/namespace_service/Yast_dbus_names.h.in?rev=55809&r1=55808&r2=55809&view=diff
==============================================================================
--- branches/tmp/lslezak/core/dbus/namespace_service/Yast_dbus_names.h.in (original)
+++ branches/tmp/lslezak/core/dbus/namespace_service/Yast_dbus_names.h.in Fri Feb 27 10:56:56 2009
@@ -9,6 +9,9 @@
// name of the Yast DBus service
#define YAST_DBUS_SERVICE_NAME "@YAST_DBUS_SERVICE@"
+// object(path) prefix
+#define YAST_DBUS_OBJ_PREFIX "@YAST_DBUS_OBJ_PREFIX@"
+
// interface name for marshalled YCPValues - using (bsv) DBus structure
#define YAST_DBUS_YCP_INTERFACE "@YAST_DBUS_YCP_INTERFACE@"
// interface name for raw (direct) DBus values
Modified: branches/tmp/lslezak/core/liby2dbus/src/DBusServerBase.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/liby2dbus/src/DBusServerBase.cc?rev=55809&r1=55808&r2=55809&view=diff
==============================================================================
--- branches/tmp/lslezak/core/liby2dbus/src/DBusServerBase.cc (original)
+++ branches/tmp/lslezak/core/liby2dbus/src/DBusServerBase.cc Fri Feb 27 10:56:56 2009
@@ -12,6 +12,8 @@
#include
participants (1)
-
lslezak@svn.opensuse.org