diff options
author | Joey Hess <joey@kitenet.net> | 2012-10-31 02:34:03 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-10-31 02:34:03 -0400 |
commit | acec36711090577752532a39f472e734e6b67fdb (patch) | |
tree | 6a3a5de0ec092e19c28464f4e2703fda9571b264 /Assistant/Threads | |
parent | 661eda766a8aa5c548ad89d8360bd4219eea138b (diff) |
where indentation
Diffstat (limited to 'Assistant/Threads')
-rw-r--r-- | Assistant/Threads/Merger.hs | 12 | ||||
-rw-r--r-- | Assistant/Threads/MountWatcher.hs | 60 | ||||
-rw-r--r-- | Assistant/Threads/PairListener.hs | 4 | ||||
-rw-r--r-- | Assistant/Threads/Pusher.hs | 4 | ||||
-rw-r--r-- | Assistant/Threads/TransferWatcher.hs | 8 | ||||
-rw-r--r-- | Assistant/Threads/Transferrer.hs | 4 |
6 files changed, 46 insertions, 46 deletions
diff --git a/Assistant/Threads/Merger.hs b/Assistant/Threads/Merger.hs index 44056dc35..105f0cc9f 100644 --- a/Assistant/Threads/Merger.hs +++ b/Assistant/Threads/Merger.hs @@ -86,15 +86,15 @@ onAdd file equivBranches :: Git.Ref -> Git.Ref -> Bool equivBranches x y = base x == base y - where - base = takeFileName . show + where + base = takeFileName . show isAnnexBranch :: FilePath -> Bool isAnnexBranch f = n `isSuffixOf` f - where - n = "/" ++ show Annex.Branch.name + where + n = "/" ++ show Annex.Branch.name fileToBranch :: FilePath -> Git.Ref fileToBranch f = Git.Ref $ "refs" </> base - where - base = Prelude.last $ split "/refs/" f + where + base = Prelude.last $ split "/refs/" f diff --git a/Assistant/Threads/MountWatcher.hs b/Assistant/Threads/MountWatcher.hs index d3da50dd4..fa7d4ec3c 100644 --- a/Assistant/Threads/MountWatcher.hs +++ b/Assistant/Threads/MountWatcher.hs @@ -119,36 +119,36 @@ startOneService client (x:xs) = do {- Filter matching events recieved when drives are mounted and unmounted. -} mountChanged :: [MatchRule] mountChanged = [gvfs True, gvfs False, kde, kdefallback] - where - {- gvfs reliably generates this event whenever a drive is mounted/unmounted, - - whether automatically, or manually -} - gvfs mount = matchAny - { matchInterface = Just "org.gtk.Private.RemoteVolumeMonitor" - , matchMember = Just $ if mount then "MountAdded" else "MountRemoved" - } - {- This event fires when KDE prompts the user what to do with a drive, - - but maybe not at other times. And it's not received -} - kde = matchAny - { matchInterface = Just "org.kde.Solid.Device" - , matchMember = Just "setupDone" - } - {- This event may not be closely related to mounting a drive, but it's - - observed reliably when a drive gets mounted or unmounted. -} - kdefallback = matchAny - { matchInterface = Just "org.kde.KDirNotify" - , matchMember = Just "enteredDirectory" - } + where + {- gvfs reliably generates this event whenever a + - drive is mounted/unmounted, whether automatically, or manually -} + gvfs mount = matchAny + { matchInterface = Just "org.gtk.Private.RemoteVolumeMonitor" + , matchMember = Just $ if mount then "MountAdded" else "MountRemoved" + } + {- This event fires when KDE prompts the user what to do with a drive, + - but maybe not at other times. And it's not received -} + kde = matchAny + { matchInterface = Just "org.kde.Solid.Device" + , matchMember = Just "setupDone" + } + {- This event may not be closely related to mounting a drive, but it's + - observed reliably when a drive gets mounted or unmounted. -} + kdefallback = matchAny + { matchInterface = Just "org.kde.KDirNotify" + , matchMember = Just "enteredDirectory" + } #endif pollingThread :: Assistant () pollingThread = go =<< liftIO currentMountPoints - where - go wasmounted = do - liftIO $ threadDelaySeconds (Seconds 10) - nowmounted <- liftIO currentMountPoints - handleMounts wasmounted nowmounted - go nowmounted + where + go wasmounted = do + liftIO $ threadDelaySeconds (Seconds 10) + nowmounted <- liftIO currentMountPoints + handleMounts wasmounted nowmounted + go nowmounted handleMounts :: MountPoints -> MountPoints -> Assistant () handleMounts wasmounted nowmounted = @@ -179,11 +179,11 @@ remotesUnder dir = do liftAnnex $ Annex.changeState $ \s -> s { Annex.remotes = rs' } updateSyncRemotes return $ map snd $ filter fst pairs - where - checkremote repotop r = case Remote.localpath r of - Just p | dirContains dir (absPathFrom repotop p) -> - (,) <$> pure True <*> updateRemote r - _ -> return (False, r) + where + checkremote repotop r = case Remote.localpath r of + Just p | dirContains dir (absPathFrom repotop p) -> + (,) <$> pure True <*> updateRemote r + _ -> return (False, r) type MountPoints = S.Set Mntent diff --git a/Assistant/Threads/PairListener.hs b/Assistant/Threads/PairListener.hs index f29bec4b4..90fce8777 100644 --- a/Assistant/Threads/PairListener.hs +++ b/Assistant/Threads/PairListener.hs @@ -96,8 +96,8 @@ pairListenerThread urlrenderer = NamedThread "PairListener" $ do if n < chunksz then return $ c ++ msg else getmsg sock $ c ++ msg - where - chunksz = 1024 + where + chunksz = 1024 {- Show an alert when a PairReq is seen. -} pairReqReceived :: Bool -> UrlRenderer -> PairMsg -> Assistant () diff --git a/Assistant/Threads/Pusher.hs b/Assistant/Threads/Pusher.hs index ac65ca14c..69974a21c 100644 --- a/Assistant/Threads/Pusher.hs +++ b/Assistant/Threads/Pusher.hs @@ -34,8 +34,8 @@ pushRetryThread = NamedThread "PushRetrier" $ runEvery (Seconds halfhour) <~> do void $ alertWhile (pushRetryAlert topush) $ do now <- liftIO $ getCurrentTime pushToRemotes now True topush - where - halfhour = 1800 + where + halfhour = 1800 {- This thread pushes git commits out to remotes soon after they are made. -} pushThread :: NamedThread diff --git a/Assistant/Threads/TransferWatcher.hs b/Assistant/Threads/TransferWatcher.hs index 7b789b8b6..7deafb14d 100644 --- a/Assistant/Threads/TransferWatcher.hs +++ b/Assistant/Threads/TransferWatcher.hs @@ -76,10 +76,10 @@ onModify file = do case parseTransferFile file of Nothing -> noop Just t -> go t =<< liftIO (readTransferInfoFile Nothing file) - where - go _ Nothing = noop - go t (Just newinfo) = alterTransferInfo t $ - \i -> i { bytesComplete = bytesComplete newinfo } + where + go _ Nothing = noop + go t (Just newinfo) = alterTransferInfo t $ + \i -> i { bytesComplete = bytesComplete newinfo } {- This thread can only watch transfer sizes when the DirWatcher supports - tracking modificatons to files. -} diff --git a/Assistant/Threads/Transferrer.hs b/Assistant/Threads/Transferrer.hs index 84013eaa7..1d23487fa 100644 --- a/Assistant/Threads/Transferrer.hs +++ b/Assistant/Threads/Transferrer.hs @@ -104,5 +104,5 @@ shouldTransfer t info notElem (Remote.uuid remote) <$> loggedLocations key | otherwise = return False - where - key = transferKey t + where + key = transferKey t |