When listing DBus services, also list activatable services.

This commit is contained in:
Sebastian Reuße 2015-06-02 15:58:48 +02:00 committed by Joey Hess
parent 2d7e11cd3e
commit ef0e3ac22e

View file

@ -22,8 +22,14 @@ type ServiceName = String
listServiceNames :: Client -> IO [ServiceName]
listServiceNames client = do
reply <- callDBus client "ListNames" []
return $ fromMaybe [] $ fromVariant =<< headMaybe (methodReturnBody reply)
active <- do
reply <- callDBus client "ListNames" []
return $ fromVariant =<< headMaybe (methodReturnBody reply)
activatable <- do
reply <- callDBus client "ListActivatableNames" []
return $ fromVariant =<< headMaybe (methodReturnBody reply)
let service_names = fromMaybe [] active ++ fromMaybe [] activatable
return service_names
callDBus :: Client -> MemberName -> [Variant] -> IO MethodReturn
callDBus client name params = call_ client $