fix build warning

This commit is contained in:
Joey Hess 2014-08-08 13:55:09 -04:00
parent 2d344edf60
commit ec11e0b89a

View file

@ -117,7 +117,7 @@ listenNMConnections client setconnected =
#else #else
listen client matcher listen client matcher
#endif #endif
$ \event -> mapM_ handle $ \event -> mapM_ handleevent
(map dictionaryItems $ mapMaybe fromVariant $ signalBody event) (map dictionaryItems $ mapMaybe fromVariant $ signalBody event)
where where
matcher = matchAny matcher = matchAny
@ -128,7 +128,7 @@ listenNMConnections client setconnected =
nm_activatingconnection_key = toVariant ("ActivatingConnection" :: String) nm_activatingconnection_key = toVariant ("ActivatingConnection" :: String)
noconnections = Just $ toVariant $ toVariant ([] :: [ObjectPath]) noconnections = Just $ toVariant $ toVariant ([] :: [ObjectPath])
rootconnection = Just $ toVariant $ toVariant $ objectPath_ "/" rootconnection = Just $ toVariant $ toVariant $ objectPath_ "/"
handle m handleevent m
| lookup nm_active_connections_key m == noconnections = | lookup nm_active_connections_key m == noconnections =
setconnected False setconnected False
| lookup nm_activatingconnection_key m == rootconnection = | lookup nm_activatingconnection_key m == rootconnection =
@ -150,7 +150,7 @@ listenWicdConnections client setconnected = do
match connmatcher $ \event -> match connmatcher $ \event ->
when (any (== wicd_success) (signalBody event)) $ when (any (== wicd_success) (signalBody event)) $
setconnected True setconnected True
match statusmatcher $ \event -> handle (signalBody event) match statusmatcher $ \event -> handleevent (signalBody event)
where where
connmatcher = matchAny connmatcher = matchAny
{ matchInterface = Just "org.wicd.daemon" { matchInterface = Just "org.wicd.daemon"
@ -162,7 +162,7 @@ listenWicdConnections client setconnected = do
} }
wicd_success = toVariant ("success" :: String) wicd_success = toVariant ("success" :: String)
wicd_disconnected = toVariant [toVariant ("" :: String)] wicd_disconnected = toVariant [toVariant ("" :: String)]
handle status handleevent status
| any (== wicd_disconnected) status = setconnected False | any (== wicd_disconnected) status = setconnected False
| otherwise = noop | otherwise = noop
match matcher a = match matcher a =