aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKevin Kuehler <keur@xcf.berkeley.edu>2019-10-28 12:07:07 -0700
committerBen Burwell <ben@benburwell.com>2019-10-29 11:07:55 -0400
commit8bc3ccb9017b04aafccafa294f219ced5b41a372 (patch)
tree73abb7b026bf955582ca3e9c8f84c8b3c858258b /lib
parent37f33ad65bfbfa69e620fcb0fdcff6393a251ac7 (diff)
Add manual threading to the pipeline
Signed-off-by: Kevin Kuehler <keur@xcf.berkeley.edu>
Diffstat (limited to 'lib')
-rw-r--r--lib/msgstore.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go
index ccde2c2..bc55255 100644
--- a/lib/msgstore.go
+++ b/lib/msgstore.go
@@ -171,6 +171,15 @@ func (store *MessageStore) Update(msg types.WorkerMessage) {
case *types.DirectoryInfo:
store.DirInfo = *msg.Info
if store.thread {
+ store.worker.PostAction(&types.FetchNativeThreadSupport{}, nil)
+ } else {
+ store.worker.PostAction(&types.FetchDirectoryContents{
+ SortCriteria: store.defaultSortCriteria,
+ }, nil)
+ }
+ update = true
+ case *types.NativeThreadSupport:
+ if msg.HasSupport {
store.worker.PostAction(&types.FetchDirectoryThreaded{
SortCriteria: store.defaultSortCriteria,
}, nil)
@@ -178,8 +187,8 @@ func (store *MessageStore) Update(msg types.WorkerMessage) {
store.worker.PostAction(&types.FetchDirectoryContents{
SortCriteria: store.defaultSortCriteria,
}, nil)
+ update = true
}
- update = true
case *types.DirectoryThreaded:
var (
uids []uint32
@@ -190,7 +199,7 @@ func (store *MessageStore) Update(msg types.WorkerMessage) {
msg.ThreadRoot.Traverse(false, func(t *types.Thread) bool {
uid := t.Uid
uids = append([]uint32{uid}, uids...)
- flattened = append([]*types.Thread{t}, flattened...)
+ flattened = append(flattened, t)
if msg, ok := store.Messages[uid]; ok {
newMap[uid] = msg
} else {