aboutsummaryrefslogtreecommitdiff
path: root/Types/View.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-02-19 15:10:18 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-02-19 16:29:56 -0400
commiteaf19cc8c9be6e53c0ae7a1fba48a947c41d2ee6 (patch)
treebac64b7fde8afb83661ac5384a2181cb91bd0926 /Types/View.hs
parent22b8d9c7603d6ed610ed9bbc3e59dbdb39e885c5 (diff)
add tip about metadata driven views (and more flexible view filtering)
While writing this documentation, I realized that there needed to be a way to stay in a view like tag=* while adding a filter like tag=work that applies to the same field. So, there are really two ways a view can be refined. It can have a new "field=explicitvalue" filter added to it, which does not change the "shape" of the view, but narrows the files it shows. Or, it can have a new view added, which adds another level of subdirectories. So, added a vfilter command, which takes explicit values to add to the filter, and rejects changes that would change the shape of the view. And, made vadd only accept changes that change the shape of the view. And, changed the View data type slightly; now components that can match multiple metadata values can be visible, or not visible. This commit was sponsored by Stelian Iancu.
Diffstat (limited to 'Types/View.hs')
-rw-r--r--Types/View.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Types/View.hs b/Types/View.hs
index 7ef44db11..04b002879 100644
--- a/Types/View.hs
+++ b/Types/View.hs
@@ -28,11 +28,12 @@ instance Arbitrary View where
data ViewComponent = ViewComponent
{ viewField :: MetaField
, viewFilter :: ViewFilter
+ , viewVisible :: Bool
}
deriving (Eq, Read, Show)
instance Arbitrary ViewComponent where
- arbitrary = ViewComponent <$> arbitrary <*> arbitrary
+ arbitrary = ViewComponent <$> arbitrary <*> arbitrary <*> arbitrary
{- Only files with metadata matching the view are displayed. -}
type FileView = FilePath