Update for latest D

This commit is contained in:
Tristan Hume 2015-12-12 14:17:08 -05:00
parent a138584b87
commit 3132716945
2 changed files with 9 additions and 5 deletions

View file

@ -9,3 +9,7 @@ end
task :testSignal do task :testSignal do
sh "dbus-send --dest=ca.thume.ddbus.test /signaler ca.thume.test.signal int32:9" sh "dbus-send --dest=ca.thume.ddbus.test /signaler ca.thume.test.signal int32:9"
end end
task :testDbus do
sh "dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames"
end

View file

@ -76,13 +76,13 @@ class MessageRouter {
handleIntrospect(pattern.path, msg, conn); handleIntrospect(pattern.path, msg, conn);
return true; return true;
} }
MessageHandler* handler = (pattern in callTable); MessageHandler* handler = (pattern in callTable);
if(handler is null) return false; if(handler is null) return false;
// Check for matching argument types // Check for matching argument types
version(DDBusNoChecking) { version(DDBusNoChecking) {
} else { } else {
if(!equal(join(handler.argSig), msg.signature())) { if(!equal(join(handler.argSig), msg.signature())) {
return false; return false;
@ -122,8 +122,8 @@ class MessageRouter {
string introspectXML(string path) { string introspectXML(string path) {
auto methods = callTable.byKey().filter!(a => (a.path == path) && !a.signal)().array() auto methods = callTable.byKey().filter!(a => (a.path == path) && !a.signal)().array()
// .schwartzSort!((a) => a.iface, "a<b")(); // .schwartzSort!((a) => a.iface, "a<b")();
.sort!((a,b) => a.iface < b.iface)().release(); .sort!((a,b) => a.iface < b.iface)();
auto ifaces = groupBy!((a) => a.iface)(methods); auto ifaces = methods.groupBy();
auto app = appender!string; auto app = appender!string;
formattedWrite(app,introspectHeader,path); formattedWrite(app,introspectHeader,path);
foreach(iface; ifaces) { foreach(iface; ifaces) {
@ -153,7 +153,7 @@ class MessageRouter {
foreach(child; children) { foreach(child; children) {
formattedWrite(app,`<node name="%s"/>`,child); formattedWrite(app,`<node name="%s"/>`,child);
} }
app.put("</node>"); app.put("</node>");
return app.data; return app.data;
} }