GTK: fix history when clicking on HOME button

This commit is contained in:
Julian Ospald 2016-04-20 00:48:34 +02:00
parent 9d572c8a6e
commit 3c6aca04b4
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28

View File

@ -294,7 +294,9 @@ urlGoTo mygui myview = withErrorDialog $ do
goHome :: MyGUI -> MyView -> IO ()
goHome mygui myview = withErrorDialog $ do
mhomedir <- getEnv "HOME"
refreshView mygui myview (P.parseAbs =<< mhomedir)
forM_ (P.parseAbs =<< mhomedir :: Maybe (Path Abs)) $ \fp' ->
whenM (canOpenDirectory fp')
(goDir mygui myview =<< (readFile getFileInfo $ fp'))
-- |Supposed to be used with 'withRows'. Opens a file or directory.