GTK: fix history when clicking on HOME button

This commit is contained in:
2016-04-20 00:48:34 +02:00
parent 9d572c8a6e
commit 3c6aca04b4

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.