split cost out into its own module

Added a function to insert a new cost into a list, which could be used to
asjust costs after a drag and drop.
This commit is contained in:
Joey Hess 2013-03-13 16:16:01 -04:00
parent 672fb29b06
commit 19c0a0d5b1
18 changed files with 103 additions and 37 deletions

View file

@ -16,6 +16,7 @@ import Common
import qualified Git
import qualified Git.Config
import Utility.DataUnits
import Config.Cost
{- Main git-annex settings. Each setting corresponds to a git-config key
- such as annex.foo -}
@ -77,7 +78,7 @@ extractGitConfig r = GitConfig
- key such as <remote>.annex-foo, or if that is not set, a default from
- annex.foo -}
data RemoteGitConfig = RemoteGitConfig
{ remoteAnnexCost :: Maybe Int
{ remoteAnnexCost :: Maybe Cost
, remoteAnnexCostCommand :: Maybe String
, remoteAnnexIgnore :: Bool
, remoteAnnexSync :: Bool

View file

@ -17,6 +17,7 @@ import Types.Key
import Types.UUID
import Types.Meters
import Types.GitConfig
import Config.Cost
type RemoteConfigKey = String
type RemoteConfig = M.Map RemoteConfigKey String
@ -46,7 +47,7 @@ data RemoteA a = Remote {
-- each Remote has a human visible name
name :: String,
-- Remotes have a use cost; higher is more expensive
cost :: Int,
cost :: Cost,
-- Transfers a key to the remote.
storeKey :: Key -> AssociatedFile -> MeterUpdate -> a Bool,
-- retrieves a key's contents to a file