GTK: validate arguments to main program
This commit is contained in:
parent
400a0242d6
commit
35e6f5df82
@ -218,9 +218,13 @@ startMainWindow startdir = do
|
|||||||
"refreshView"
|
"refreshView"
|
||||||
|
|
||||||
-- create initial list store model with unsorted data
|
-- create initial list store model with unsorted data
|
||||||
|
-- we check that the startdir passed by the user is valid
|
||||||
|
-- TODO: maybe move this to a separate function
|
||||||
|
sd <- (\x -> if (failed . file $ x) || (not . isAbsolute . anchor $ x)
|
||||||
|
then Data.DirTree.readFile "/"
|
||||||
|
else return x) =<< Data.DirTree.readFile startdir
|
||||||
rawModel <- newTVarIO =<< listStoreNew
|
rawModel <- newTVarIO =<< listStoreNew
|
||||||
=<< Data.DirTree.getContents
|
=<< Data.DirTree.getContents sd
|
||||||
=<< Data.DirTree.readFile startdir
|
|
||||||
|
|
||||||
filteredModel <- newTVarIO =<< (\x -> treeModelFilterNew x [])
|
filteredModel <- newTVarIO =<< (\x -> treeModelFilterNew x [])
|
||||||
=<< readTVarIO rawModel
|
=<< readTVarIO rawModel
|
||||||
|
Loading…
Reference in New Issue
Block a user