LIB/GTK: refactor File base type
We have now ditched AnchoredFile and just use File with Path Abs in the path field. This is useful since we now: * don't allow "." or ".." as filenames anymore * normalise paths in our path parsers and reject paths with ".." This also allows us to know that filepaths are always valid. In addition the 'basename' function from hpath may throw an exception if run on the root dir "/". This exception is basically uncatched currently, which is fine, because it's not a selectable directory.
This commit is contained in:
@@ -91,13 +91,14 @@ data FMSettings = MkFMSettings {
|
||||
data FMView = FMTreeView TreeView
|
||||
| FMIconView IconView
|
||||
|
||||
type Item = AnchoredFile FileInfo
|
||||
type Item = File FileInfo
|
||||
|
||||
|
||||
-- |This describes the contents of the current vie and is separated from MyGUI,
|
||||
-- because we might want to have multiple views.
|
||||
data MyView = MkMyView {
|
||||
view :: TVar FMView
|
||||
, cwd :: MVar Item
|
||||
, rawModel :: TVar (ListStore Item)
|
||||
, sortedModel :: TVar (TypedTreeModelSort Item)
|
||||
, filteredModel :: TVar (TypedTreeModelFilter Item)
|
||||
|
||||
Reference in New Issue
Block a user