Compare commits

...

3 Commits

9 changed files with 97 additions and 28 deletions

79
cabal.project.freeze Normal file
View File

@ -0,0 +1,79 @@
constraints: any.Cabal ==2.2.0.1,
any.HUnit ==1.6.0.0,
any.IfElse ==0.85,
any.QuickCheck ==2.12.4,
QuickCheck +templatehaskell,
any.alex ==3.2.4,
alex +small_base,
any.ansi-terminal ==0.8.1,
ansi-terminal -example,
any.array ==0.5.2.0,
any.base ==4.11.1.0,
any.binary ==0.8.5.1,
any.bytestring ==0.10.8.2,
any.cairo ==0.13.5.0,
cairo +cairo_pdf +cairo_ps +cairo_svg,
any.call-stack ==0.1.0,
any.clock ==0.7.2,
clock -llvm,
any.colour ==2.3.4,
any.containers ==0.5.11.0,
any.deepseq ==1.4.3.0,
any.directory ==1.3.1.5,
any.erf ==2.0.0.0,
any.exceptions ==0.10.0,
any.filepath ==1.4.2,
any.ghc-boot-th ==8.4.3,
any.ghc-prim ==0.5.2.0,
any.gio ==0.13.5.0,
any.glib ==0.13.6.0,
glib +closure_signals,
any.gtk2hs-buildtools ==0.13.4.0,
gtk2hs-buildtools +closuresignals,
any.gtk3 ==0.15.0,
gtk3 -build-demos +fmode-binary +have-gio,
any.happy ==1.19.9,
happy +small_base,
any.hashable ==1.2.7.0,
hashable -examples +integer-gmp +sse2 -sse41,
any.hashtables ==1.2.3.1,
hashtables -bounds-checking -debug -portable -sse42 +unsafe-tricks,
any.hinotify-bytestring ==0.3.8.1,
any.hpath ==0.9.2,
any.hspec ==2.5.6,
any.hspec-core ==2.5.6,
any.hspec-discover ==2.5.6,
any.hspec-expectations ==0.8.2,
any.integer-gmp ==1.0.2.0,
any.monad-loops ==0.4.3,
monad-loops +base4,
any.mtl ==2.2.2,
any.network ==2.8.0.0,
any.old-locale ==1.0.0.7,
any.pango ==0.13.5.0,
pango +new-exception,
any.parsec ==3.1.13.0,
any.pretty ==1.1.3.6,
any.primitive ==0.6.4.0,
any.process ==1.6.3.0,
any.quickcheck-io ==0.2.0,
any.random ==1.1,
any.rts ==1.0,
any.safe ==0.3.17,
any.setenv ==0.1.1.3,
any.simple-sendfile ==0.2.27,
simple-sendfile +allow-bsd,
any.stm ==2.4.5.1,
any.template-haskell ==2.13.0.0,
any.text ==1.2.3.0,
any.tf-random ==0.5,
any.time ==1.8.0.2,
any.transformers ==0.5.5.0,
any.transformers-compat ==0.6.2,
transformers-compat -five +five-three -four +generic-deriving +mtl -three -two,
any.unix ==2.7.2.2,
any.unix-bytestring ==0.3.7.3,
any.utf8-string ==1.0.1.1,
any.vector ==0.12.0.1,
vector +boundschecks -internalchecks -unsafechecks -wall,
any.word8 ==0.1.3

View File

@ -16,7 +16,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
--}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_HADDOCK ignore-exports #-}

View File

@ -16,7 +16,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
--}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_HADDOCK ignore-exports #-}
@ -67,7 +66,7 @@ instance GlibString BS.ByteString where
newUTFStringLen = newUTFStringLen . toString
genUTFOfs = genUTFOfs . toString
stringLength = BS.length
unPrintf s = BS.intercalate "%%" (BS.split _percent s)
unPrintf s = BS.intercalate (BS.pack [_percent, _percent]) (BS.split _percent s)
foreign import ccall unsafe "string.h strlen" c_strlen

View File

@ -16,17 +16,18 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
--}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_HADDOCK ignore-exports #-}
module Main where
import qualified Data.ByteString as BS
import Data.Maybe
(
fromJust
, fromMaybe
)
import Data.Word8
import Graphics.UI.Gtk
import qualified HPath as P
import HSFM.FileSystem.FileType
@ -45,15 +46,17 @@ import System.IO.Error
)
import qualified System.Posix.Env.ByteString as SPE
slash :: BS.ByteString
slash = BS.singleton _slash
main :: IO ()
main = do
args <- SPE.getArgs
let mdir = fromMaybe (fromJust $ P.parseAbs "/")
(P.parseAbs . headDef "/" $ args)
let mdir = fromMaybe (fromJust $ P.parseAbs slash)
(P.parseAbs . headDef slash $ args)
file <- catchIOError (pathToFile getFileInfo mdir) $
\_ -> pathToFile getFileInfo . fromJust $ P.parseAbs "/"
\_ -> pathToFile getFileInfo . fromJust $ P.parseAbs slash
_ <- initGUI
mygui <- createMyGUI

View File

@ -16,7 +16,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
--}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TupleSections #-}
{-# OPTIONS_HADDOCK ignore-exports #-}

View File

@ -16,7 +16,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
--}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS_HADDOCK ignore-exports #-}

View File

@ -254,9 +254,9 @@ withErrorDialog io =
-- |Asks the user which directory copy mode he wants via dialog popup
-- and returns 'DirCopyMode'.
textInputDialog :: GlibString string
=> string -- ^ window title
-> string -- ^ initial text in input widget
textInputDialog :: (GlibString s1, GlibString s2)
=> s1 -- ^ window title
-> s2 -- ^ initial text in input widget
-> IO (Maybe String)
textInputDialog title inittext = do
chooserDialog <- messageDialogNew Nothing

View File

@ -16,7 +16,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
--}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_HADDOCK ignore-exports #-}
@ -27,6 +26,7 @@ import Data.ByteString
(
ByteString
)
import qualified Data.ByteString.UTF8 as BU
import Data.Maybe
import System.Posix.Env.ByteString
import System.Posix.Process.ByteString
@ -49,11 +49,11 @@ import System.Posix.Process.ByteString
terminalCommand :: ByteString -- ^ current directory of the FM
-> IO a
terminalCommand cwd =
executeFile -- executes the given command
"sakura" -- the terminal command
True -- whether to search PATH
["-d", cwd] -- arguments for the command
Nothing -- optional custom environment: `Just [(String, String)]`
executeFile -- executes the given command
(BU.fromString "sakura") -- the terminal command
True -- whether to search PATH
[BU.fromString "-d", cwd] -- arguments for the command
Nothing -- optional custom environment: `Just [(String, String)]`
-- |The home directory. If you want to set it explicitly, you might
@ -63,5 +63,5 @@ terminalCommand cwd =
-- home = return "\/home\/wurst"
-- @
home :: IO ByteString
home = fromMaybe <$> return "/" <*> getEnv "HOME"
home = fromMaybe <$> return (BU.fromString "/") <*> getEnv (BU.fromString "HOME")

View File

@ -1,9 +0,0 @@
resolver: lts-12.1
packages:
- .
extra-deps:
- IfElse-0.85
- hinotify-bytestring-0.3.8.1
- hpath-0.9.2