summaryrefslogtreecommitdiff
path: root/Assistant
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-11-13 17:50:54 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-11-13 17:50:54 -0400
commit66cfb61912d2f7fc04b9716b82aad9b02096a6ad (patch)
treeb901cadef39781a9f0e87caa6a80d7bdcc293a40 /Assistant
parentb48755af70f229dce53138100105f352c8f6580c (diff)
automatic repolist updating
Diffstat (limited to 'Assistant')
-rw-r--r--Assistant/DaemonStatus.hs5
-rw-r--r--Assistant/Threads/ConfigMonitor.hs5
-rw-r--r--Assistant/Types/DaemonStatus.hs3
3 files changed, 10 insertions, 3 deletions
diff --git a/Assistant/DaemonStatus.hs b/Assistant/DaemonStatus.hs
index 8a4a7a16d..cb9133b2a 100644
--- a/Assistant/DaemonStatus.hs
+++ b/Assistant/DaemonStatus.hs
@@ -44,6 +44,7 @@ modifyDaemonStatus a = do
sendNotification $ changeNotifier s
return b
+
{- Returns a function that updates the lists of syncable remotes. -}
calcSyncRemotes :: Annex (DaemonStatus -> DaemonStatus)
calcSyncRemotes = do
@@ -60,7 +61,9 @@ calcSyncRemotes = do
{- Updates the sycRemotes list from the list of all remotes in Annex state. -}
updateSyncRemotes :: Assistant ()
-updateSyncRemotes = modifyDaemonStatus_ =<< liftAnnex calcSyncRemotes
+updateSyncRemotes = do
+ modifyDaemonStatus_ =<< liftAnnex calcSyncRemotes
+ liftIO . sendNotification =<< syncRemotesNotifier <$> getDaemonStatus
{- Load any previous daemon status file, and store it in a MVar for this
- process to use as its DaemonStatus. Also gets current transfer status. -}
diff --git a/Assistant/Threads/ConfigMonitor.hs b/Assistant/Threads/ConfigMonitor.hs
index 2d012ad80..47e197116 100644
--- a/Assistant/Threads/ConfigMonitor.hs
+++ b/Assistant/Threads/ConfigMonitor.hs
@@ -72,8 +72,9 @@ reloadConfigs changedconfigs = do
sequence_ as
void preferredContentMapLoad
{- Changes to the remote log, or the trust log, can affect the
- - syncRemotes list -}
- when (Logs.Remote.remoteLog `elem` fs || Logs.Trust.trustLog `elem` fs) $
+ - syncRemotes list. Changes to the uuid log may affect its
+ - display so are also included. -}
+ when (any (`elem` fs) [remoteLog, trustLog, uuidLog]) $
updateSyncRemotes
where
(fs, as) = unzip $ filter (flip S.member changedfiles . fst)
diff --git a/Assistant/Types/DaemonStatus.hs b/Assistant/Types/DaemonStatus.hs
index df0928d6e..7f868d957 100644
--- a/Assistant/Types/DaemonStatus.hs
+++ b/Assistant/Types/DaemonStatus.hs
@@ -47,6 +47,8 @@ data DaemonStatus = DaemonStatus
, transferNotifier :: NotificationBroadcaster
-- Broadcasts notifications when there's a change to the alerts
, alertNotifier :: NotificationBroadcaster
+ -- Broadcasts notifications when the syncRemotes change
+ , syncRemotesNotifier :: NotificationBroadcaster
}
type TransferMap = M.Map Transfer TransferInfo
@@ -70,3 +72,4 @@ newDaemonStatus = DaemonStatus
<*> newNotificationBroadcaster
<*> newNotificationBroadcaster
<*> newNotificationBroadcaster
+ <*> newNotificationBroadcaster