more OsPath conversion
Sponsored-by: mycroft
This commit is contained in:
parent
917c43f31f
commit
22c2451e26
11 changed files with 46 additions and 44 deletions
|
@ -50,7 +50,7 @@ import Key
|
|||
import Utility.Metered
|
||||
import Utility.Percentage
|
||||
import Utility.Aeson
|
||||
import Utility.FileSystemEncoding
|
||||
import Utility.OsPath
|
||||
import Types.Messages
|
||||
|
||||
-- A global lock to avoid concurrent threads emitting json at the same time.
|
||||
|
@ -76,7 +76,7 @@ type JSONBuilder = Maybe (Object, Bool) -> Maybe (Object, Bool)
|
|||
none :: JSONBuilder
|
||||
none = id
|
||||
|
||||
start :: String -> Maybe RawFilePath -> Maybe Key -> SeekInput -> JSONBuilder
|
||||
start :: String -> Maybe OsPath -> Maybe Key -> SeekInput -> JSONBuilder
|
||||
start command file key si _ = case j of
|
||||
Object o -> Just (o, False)
|
||||
_ -> Nothing
|
||||
|
@ -84,7 +84,7 @@ start command file key si _ = case j of
|
|||
j = toJSON' $ JSONActionItem
|
||||
{ itemCommand = Just command
|
||||
, itemKey = key
|
||||
, itemFile = fromRawFilePath <$> file
|
||||
, itemFile = fromOsPath <$> file
|
||||
, itemUUID = Nothing
|
||||
, itemFields = Nothing :: Maybe Bool
|
||||
, itemSeekInput = si
|
||||
|
@ -98,7 +98,7 @@ startActionItem command ai si _ = case j of
|
|||
j = toJSON' $ JSONActionItem
|
||||
{ itemCommand = Just command
|
||||
, itemKey = actionItemKey ai
|
||||
, itemFile = fromRawFilePath <$> actionItemFile ai
|
||||
, itemFile = fromOsPath <$> actionItemFile ai
|
||||
, itemUUID = actionItemUUID ai
|
||||
, itemFields = Nothing :: Maybe Bool
|
||||
, itemSeekInput = si
|
||||
|
|
|
@ -55,7 +55,7 @@ instance MeterSize KeySource where
|
|||
- This allows uploads of keys without size to still have progress
|
||||
- displayed.
|
||||
-}
|
||||
data KeySizer = KeySizer Key (Annex (Maybe RawFilePath))
|
||||
data KeySizer = KeySizer Key (Annex (Maybe OsPath))
|
||||
|
||||
instance MeterSize KeySizer where
|
||||
getMeterSize (KeySizer k getsrcfile) = case fromKey keySize k of
|
||||
|
@ -171,7 +171,7 @@ metered' st setclear othermeterupdate msize bwlimit showoutput a = go st
|
|||
minratelimit = min consoleratelimit jsonratelimit
|
||||
|
||||
{- Poll file size to display meter. -}
|
||||
meteredFile :: RawFilePath -> Maybe MeterUpdate -> Key -> (MeterUpdate -> Annex a) -> Annex a
|
||||
meteredFile :: OsPath -> Maybe MeterUpdate -> Key -> (MeterUpdate -> Annex a) -> Annex a
|
||||
meteredFile file combinemeterupdate key a =
|
||||
metered combinemeterupdate key Nothing $ \_ p ->
|
||||
watchFileSize file p a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue