Skip to content

Commit 8d6bbef

Browse files
committed
Remove dependency on MissingH
1 parent 0acd48f commit 8d6bbef

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

vcsgui/src/VCSGui/Common/SetupConfig.hs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ import Data.Maybe
2121
import Control.Monad
2222
import System.Directory
2323
import System.Directory(doesDirectoryExist)
24-
import Data.List.Utils(elemRIndex)
25-
import Data.List(isInfixOf)
24+
import Data.List(findIndex)
2625
import Paths_vcsgui(getDataFileName)
2726

2827
import VCSGui.Common.Error
@@ -241,15 +240,12 @@ initSetupRepoGui mbConfig gui = do
241240
H.set (entRepo gui) $ path
242241
availableVCS <- discoverVCS path
243242
H.set (comboBoxVCSType gui) $ map (\vcs -> show vcs) availableVCS
244-
if isInfixOf [vcsType] availableVCS
245-
then do
246-
--get position (hopefully always index in liststore = index in list)
247-
let index = elemRIndex vcsType availableVCS
248-
249-
--set active
250-
comboBoxSetActive (H.getItem (comboBoxVCSType gui)) $ fromMaybe (-1) index
251-
else do
252-
return ()
243+
--get position (hopefully always index in liststore = index in list)
244+
case findIndex (== vcsType) availableVCS of
245+
Just index ->
246+
--set active
247+
comboBoxSetActive (H.getItem (comboBoxVCSType gui)) index
248+
_ -> return ()
253249
case mbExec of
254250
Nothing -> do
255251
H.set (checkbtExec gui) False

vcsgui/vcsgui.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ flag gtk3
3434
default: True
3535

3636
library
37-
build-depends: MissingH >=1.1.0.3 && <1.3,
37+
build-depends:
3838
filepath >=1.2.0.0 && < 1.4,
3939
base >=4.0.0.0 && <4.8,
4040
directory >=1.1.0.0 && <1.3,
@@ -63,7 +63,7 @@ library
6363

6464
executable vcsgui
6565
main-is: Main.hs
66-
build-depends: MissingH >=1.1.0.3 && <1.3,
66+
build-depends:
6767
filepath >=1.2.0.0 && < 1.4,
6868
base >=4.0.0.0 && <4.8,
6969
directory >=1.1.0.0 && <1.3,
@@ -91,7 +91,7 @@ executable vcsgui
9191

9292
executable vcsgui-askpass
9393
main-is: Main.hs
94-
build-depends: MissingH >=1.1.0.3 && <1.3,
94+
build-depends:
9595
filepath >=1.2.0.0 && < 1.4,
9696
base >=4.0.0.0 && <4.8,
9797
directory >=1.1.0.0 && <1.3,

0 commit comments

Comments
 (0)