+cleanSharesTask :: Int MTaskDevice -> Task [MTaskShare]
+cleanSharesTask taskid d
+| not (trace_tn $ printToString taskid) = undef
+| not (trace_tn $ printToString d.deviceTasks) = undef
+| not (trace_tn $ printToString $ getNames taskid d) = undef
+= upd (map $ up $ getNames taskid d) sdsStore
+ where
+ getNames :: Int MTaskDevice -> [String]
+ getNames i d = [t.MTaskTask.name\\t<-d.deviceTasks|t.ident==i]
+
+ up :: [String] MTaskShare -> MTaskShare
+ up ns s = {MTaskShare | s & withTask=[t\\t<-s.withTask|not (isMember t ns)]}
+
+cleanSharesDevice :: String -> Task [MTaskShare]
+cleanSharesDevice did = upd (map (up did)) sdsStore
+ where
+ up :: String MTaskShare -> MTaskShare
+ up i s = {MTaskShare | s & withDevice = [wt\\wt<-s.withDevice|wt <> i]}