summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-09-22 11:22:41 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-09-22 11:22:41 -0400
commitb754146eafade95039417bb54be94d945d9cdfb3 (patch)
tree6ec679fe41fb013f99556872b188bb7e8660abad
parent3ca6049b1ec994216a1091f88e0d99e14498b721 (diff)
avoid using split unnecessarily
I'd like to get rid of all uses of Data.String.Utils eventually..
-rw-r--r--Utility/FreeDesktop.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Utility/FreeDesktop.hs b/Utility/FreeDesktop.hs
index abaa313df..49cee0aff 100644
--- a/Utility/FreeDesktop.hs
+++ b/Utility/FreeDesktop.hs
@@ -38,7 +38,6 @@ import Utility.Directory
import System.Environment
import System.FilePath
import Data.List
-import Data.String.Utils
import Data.Maybe
import Control.Applicative
import Prelude
@@ -54,12 +53,13 @@ toString (StringV s) = s
toString (BoolV b)
| b = "true"
| otherwise = "false"
-toString(NumericV f) = show f
+toString (NumericV f) = show f
toString (ListV l)
| null l = ""
- | otherwise = (intercalate ";" $ map (escapesemi . toString) l) ++ ";"
+ | otherwise = (intercalate ";" $ map (concatMap escapesemi . toString) l) ++ ";"
where
- escapesemi = intercalate "\\;" . split ";"
+ escapesemi ';' = "\\;"
+ escapesemi c = [c]
genDesktopEntry :: String -> String -> Bool -> FilePath -> Maybe String -> [String] -> DesktopEntry
genDesktopEntry name comment terminal program icon categories = catMaybes