Don't build a new connection if it already exists
There was also a lot of unneeded overhead in Connection::new() to get the path to compare against, so split that out into a settings struct
This commit is contained in:
@@ -24,7 +24,7 @@ impl telepathy::ConnectionInterfaceRequests for Connection {
|
||||
&self,
|
||||
request: HashMap<&str, VarArg>,
|
||||
) -> Result<(dbus::Path<'static>, HashMap<String, VarArg>), MethodErr> {
|
||||
println!("Connection<{}>::create_channel({:?})", self.id, request);
|
||||
println!("Connection<{}>::create_channel({:?})", self.id(), request);
|
||||
|
||||
Err(MethodErr::no_arg()) // FIXME: should be NotImplemented?
|
||||
}
|
||||
@@ -33,17 +33,17 @@ impl telepathy::ConnectionInterfaceRequests for Connection {
|
||||
&self,
|
||||
request: HashMap<&str, VarArg>,
|
||||
) -> Result<(bool, dbus::Path<'static>, HashMap<String, VarArg>), MethodErr> {
|
||||
println!("Connection<{}>::ensure_channel({:?})", self.id, request);
|
||||
println!("Connection<{}>::ensure_channel({:?})", self.id(), request);
|
||||
Err(MethodErr::no_arg()) // FIXME: should be NotImplemented?
|
||||
}
|
||||
|
||||
fn channels(&self) -> Result<Vec<ChannelSpec>, MethodErr> {
|
||||
println!("Connection<{}>::channels()", self.id);
|
||||
println!("Connection<{}>::channels()", self.id());
|
||||
Ok(vec![])
|
||||
}
|
||||
|
||||
fn requestable_channel_classes(&self) -> Result<Vec<RequestableChannelSpec>, MethodErr> {
|
||||
println!("Connection<{}>::requestable_channel_classes()", self.id);
|
||||
println!("Connection<{}>::requestable_channel_classes()", self.id());
|
||||
Ok(crate::padfoot::requestables())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user