summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-04-02 18:09:27 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-04-02 18:10:03 -0400
commitd48a880a90b6e498014ec64a5f826f303bbdcb25 (patch)
tree16b2d04003901c18e7b95241200df77eb6a361a5
parent135cdc8836cdf4d426f13c9000e097602315c3a4 (diff)
fix warning on !dbus
-rw-r--r--Annex/Notification.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Annex/Notification.hs b/Annex/Notification.hs
index 9a2b3956f..06a099888 100644
--- a/Annex/Notification.hs
+++ b/Annex/Notification.hs
@@ -10,9 +10,9 @@
module Annex.Notification where
import Common.Annex
-import qualified Annex
import Logs.Transfer
#ifdef WITH_DBUS_NOTIFICATIONS
+import qualified Annex
import Types.DesktopNotify
import qualified DBus.Notify as Notify
import qualified DBus.Client
@@ -26,8 +26,8 @@ data NotifyWitness = NotifyWitness
- for it. -}
notifyTransfer :: Direction -> Maybe FilePath -> (NotifyWitness -> Annex Bool) -> Annex Bool
notifyTransfer _ Nothing a = a NotifyWitness
-notifyTransfer direction (Just f) a = do
#ifdef WITH_DBUS_NOTIFICATIONS
+notifyTransfer direction (Just f) a = do
wanted <- Annex.getState Annex.desktopnotify
let action = if direction == Upload then "uploading" else "downloading"
let basedesc = action ++ " " ++ f
@@ -49,13 +49,13 @@ notifyTransfer direction (Just f) a = do
return ok
else a NotifyWitness
#else
- a NotifyWitness
+notifyTransfer _ (Just _) a = do a NotifyWitness
#endif
notifyDrop :: Maybe FilePath -> Bool -> Annex ()
notifyDrop Nothing _ = noop
-notifyDrop (Just f) ok = do
#ifdef WITH_DBUS_NOTIFICATIONS
+notifyDrop (Just f) ok = do
wanted <- Annex.getState Annex.desktopnotify
when (notifyFinish wanted) $ liftIO $ do
client <- DBus.Client.connectSession
@@ -64,7 +64,7 @@ notifyDrop (Just f) ok = do
else "failed to drop" ++ f
void $ Notify.notify client (mkNote msg)
#else
- noop
+notifyDrop (Just _) _ = noop
#endif
#ifdef WITH_DBUS_NOTIFICATIONS