From 7d78fce0a72d4f1ce91c8eef42ffe066b5c78dc6 Mon Sep 17 00:00:00 2001
From: Jens Nolte <jens@nightmarestudio.de>
Date: Tue, 3 Dec 2019 22:59:31 +0100
Subject: [PATCH] Remove (now unnecessary) updateBar'

---
 src/QBar/Core.hs   | 9 +++------
 src/QBar/Server.hs | 4 ++--
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/QBar/Core.hs b/src/QBar/Core.hs
index a280586..fd0ae51 100644
--- a/src/QBar/Core.hs
+++ b/src/QBar/Core.hs
@@ -317,7 +317,7 @@ startPersistentBlockScript path = do
     fromHandle bar handle = forever $ do
       line <- lift $ TIO.hGetLine handle
       yield $ pangoMarkup $ createBlock line
-      lift $ updateBar'' bar
+      lift $ updateBar' bar
 
 pangoColor :: RGB Double -> T.Text
 pangoColor (RGB r g b) =
@@ -342,11 +342,8 @@ addBlock block = do
 updateBar :: BarIO ()
 updateBar = liftIO =<< asks requestBarUpdate
 
-updateBar' :: BarUpdateChannel -> IO ()
-updateBar' (BarUpdateChannel updateAction) = updateAction
-
-updateBar'' :: Bar -> IO ()
-updateBar'' = updateBar' . BarUpdateChannel . requestBarUpdate
+updateBar' :: Bar -> IO ()
+updateBar' = runReaderT updateBar
 
 barAsync :: BarIO a -> BarIO (Async a)
 barAsync action = do
diff --git a/src/QBar/Server.hs b/src/QBar/Server.hs
index 1229aa8..f6c5be9 100644
--- a/src/QBar/Server.hs
+++ b/src/QBar/Server.hs
@@ -155,7 +155,7 @@ installSignalHandlers = do
     sigContAction :: Bar -> IO ()
     sigContAction bar = do
       hPutStrLn stderr "SIGCONT received"
-      updateBar'' bar
+      updateBar' bar
 
 runBarConfiguration :: BarIO () -> MainOptions -> IO ()
 runBarConfiguration generateBarConfig options = do
@@ -210,7 +210,7 @@ runBarConfiguration generateBarConfig options = do
     case command of
       SetFilter blockFilter -> atomicWriteIORef activeFilter blockFilter
       Block -> error "TODO"
-    updateBar'' bar
+    updateBar' bar
   link socketUpdateAsync
 
   runReaderT (renderLoop options handle barUpdateEvent initialOutput newBlockChan) bar
-- 
GitLab