fix build when dbus is enabled

Broken in commit 8040ecf9b8
This commit is contained in:
Joey Hess 2022-07-05 13:06:45 -04:00
parent ad34d7996d
commit f58fb6a79a
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -34,7 +34,7 @@ notifyTransfer :: Transferrable t => Observable v => Direction -> t -> (NotifyWi
notifyTransfer direction t a = case descTransfrerrable t of notifyTransfer direction t a = case descTransfrerrable t of
Nothing -> a NotifyWitness Nothing -> a NotifyWitness
Just desc -> do Just desc -> do
wanted <- Annex.getState Annex.desktopnotify wanted <- Annex.getRead Annex.desktopnotify
if (notifyStart wanted || notifyFinish wanted) if (notifyStart wanted || notifyFinish wanted)
then do then do
client <- liftIO DBus.Client.connectSession client <- liftIO DBus.Client.connectSession
@ -57,7 +57,7 @@ notifyDrop :: AssociatedFile -> Bool -> Annex ()
notifyDrop (AssociatedFile Nothing) _ = noop notifyDrop (AssociatedFile Nothing) _ = noop
#ifdef WITH_DBUS_NOTIFICATIONS #ifdef WITH_DBUS_NOTIFICATIONS
notifyDrop (AssociatedFile (Just f)) ok = do notifyDrop (AssociatedFile (Just f)) ok = do
wanted <- Annex.getState Annex.desktopnotify wanted <- Annex.getRead Annex.desktopnotify
when (notifyFinish wanted) $ liftIO $ do when (notifyFinish wanted) $ liftIO $ do
client <- DBus.Client.connectSession client <- DBus.Client.connectSession
void $ Notify.notify client (droppedNote ok (fromRawFilePath f)) void $ Notify.notify client (droppedNote ok (fromRawFilePath f))