Kaydet (Commit) 5aaf314d authored tarafından Suleyman Poyraz's avatar Suleyman Poyraz

Lanet olası boş lisste döndürme hatası yamandı.

üst 0f7b6b53
......@@ -108,3 +108,6 @@ install_manifest.txt
Makefile
cmake_install.cmake
#Test file
scom_root
scom
......@@ -10,11 +10,11 @@
<arg name="package" type="s" direction="in"/>
<annotation name="org.freedesktop.DBus.Method.NoReply" value="true"/>
</method>
<method name="listModelApplications" action_id="">
<method name="listModelApplications" action_id="tr.org.sulin.scom.listModelApplications">
<arg name="model" type="s" direction="in"/>
<arg name="apps" type="as" direction="out"/>
</method>
<method name="listApplicationModels" action_id="">
<method name="listApplicationModels" action_id="tr.org.sulin.scom.listApplicationModels">
<arg name="app" type="s" direction="in"/>
<arg name="models" type="as" direction="out"/>
</method>
......
......@@ -59,7 +59,6 @@ bus_send(DBusMessage *bus_msg)
*/
dbus_uint32_t serial = 0;
dbus_connection_send(bus_conn, bus_msg, &serial);
dbus_connection_flush(bus_conn);
}
......@@ -94,6 +93,7 @@ bus_reply_object(DBusMessage *bus_msg, PyObject *py_obj, char *signature)
// If signature is not null, append Python object to message
if (strcmp(signature, "") != 0) {
PyObject *py_tuple;
if (!PyTuple_Check(py_obj)) {
py_tuple = PyTuple_New(1);
PyTuple_SetItem(py_tuple, 0, py_obj);
......
......@@ -214,7 +214,7 @@ filter_func(DBusConnection *conn, DBusMessage *bus_msg, void *data)
if (strcmp(config_interface, iface) == 0 && strcmp(path, "/") == 0) {
// "setLocale" and "cancel" methods are handled in main process
if (strcmp(method, "setLocale") == 0 || strcmp(method, "cancel") == 0 || strcmp(method, "listRunning") == 0) {
handle_core_message(bus_msg, path, iface, method, sender, py_args);
handle_core_message(bus_msg, path, iface, method, sender, py_args);
}
else {
// Else, handle in child process
......
......@@ -292,6 +292,10 @@ pydbus_export_item(DBusMessageIter *iter, PyObject *obj, char *signature)
if (PyBytes_Check(obj)) {
p.s = PyBytes_AsString(obj);
}
//If returned Unicode type return utf-8 coded string
if (PyUnicode_Check(obj)) {
p.s = PyUnicode_AsUTF8(obj);
}
else {
// TODO: Raise error
p.s = "";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment