diff options
author | tv <tv@shackspace.de> | 2015-01-31 15:51:57 +0100 |
---|---|---|
committer | tv <tv@shackspace.de> | 2015-01-31 15:51:57 +0100 |
commit | ef48d081dfd0e817c4959dbbd49929ae760a310e (patch) | |
tree | 54867be238b6f8707a43fa7af6d16d3f59144f73 /TreeView.hs | |
parent | 39e76d0c83515a98f84f06b1c3b430d1e67cd1cd (diff) |
Notmuch: replace {un,}setTag by notmuchTag
Diffstat (limited to 'TreeView.hs')
-rw-r--r-- | TreeView.hs | 60 |
1 files changed, 2 insertions, 58 deletions
diff --git a/TreeView.hs b/TreeView.hs index 470913b..dff50e8 100644 --- a/TreeView.hs +++ b/TreeView.hs @@ -4,7 +4,7 @@ module TreeView - ( TreeView (..) + ( module Export , getMessage , getSearchTerm , isTVMessage @@ -12,14 +12,12 @@ module TreeView , fromSearchResults , fromMessageForest , fromMessageTree - , treeViewId , loadSubForest , unloadSubForest , hasUnloadedSubForest ) where -import qualified Data.CaseInsensitive as CI import qualified Data.Text as T import Control.Applicative import Data.Monoid @@ -27,61 +25,7 @@ import Data.Tree import Notmuch import Notmuch.Message import Notmuch.SearchResult - - -type LineNr = Int - - -data TreeView - = TVMessage Message - | TVMessageHeaderField Message (CI.CI T.Text) - | TVMessagePart Message MessagePart - | TVMessageQuoteLine Message MessagePart LineNr String - | TVMessageLine Message MessagePart LineNr String - | TVSearch String - | TVSearchResult SearchResult - deriving (Show) - - -instance Eq TreeView where - x1 == x2 = treeViewId x1 == treeViewId x2 - - -data TreeViewId - = TVIDMessage T.Text - | TVIDMessageHeaderField T.Text T.Text - | TVIDMessagePart T.Text Int - | TVIDMessageLine T.Text Int Int - | TVIDSearch T.Text - | TVIDSearchResult T.Text - deriving (Eq,Show) - - -treeViewId :: TreeView -> TreeViewId -treeViewId = \case - TVMessage m -> - TVIDMessage (fromMessage m) - - TVMessageHeaderField m mhf -> - TVIDMessageHeaderField (fromMessage m) (CI.foldedCase mhf) - - TVMessagePart m mp -> - TVIDMessagePart (fromMessage m) (partID mp) - - TVMessageLine m mp lineNr _ -> - TVIDMessageLine (fromMessage m) (partID mp) lineNr - - TVMessageQuoteLine m mp lineNr _ -> - TVIDMessageLine (fromMessage m) (partID mp) lineNr - - TVSearch s -> - TVIDSearch (T.pack s) - - TVSearchResult sr -> - TVIDSearchResult (T.pack $ unThreadID $ searchThread sr) - - where - fromMessage = T.pack . unMessageID . messageId +import TreeView.Types as Export getMessage :: TreeView -> Maybe Message |