Drop deprecated migrateState

migrateState is only necessary when _live_ upgrading from xmonad 0.12,
so I believe we can drop it now.

This fixes a compilation warning that we'd otherwise have to suppress.
This commit is contained in:
Tomas Janousek
2021-03-29 16:51:30 +01:00
parent 14d9fa247a
commit 22b579bd14
2 changed files with 0 additions and 16 deletions

View File

@@ -68,7 +68,6 @@ xmonad conf = do
args <- getArgs
case args of
("--resume": ws : xs : args') -> migrateState dirs ws xs >> launch' args'
["--help"] -> usage
["--recompile"] -> recompile dirs True >>= flip unless exitFailure
["--restart"] -> sendRestart

View File

@@ -36,7 +36,6 @@ import qualified Control.Exception as C
import System.IO
import System.Directory
import System.FilePath ((</>))
import System.Posix.Process (executeFile)
import Graphics.X11.Xlib
import Graphics.X11.Xinerama (getScreenInfo)
@@ -522,20 +521,6 @@ readStateFile xmc = do
readStrict :: Handle -> IO String
readStrict h = hGetContents h >>= \s -> length s `seq` return s
-- | Migrate state from a previously running xmonad instance that used
-- the older @--resume@ technique.
{-# DEPRECATED migrateState "will be removed some point in the future." #-}
migrateState :: (Functor m, MonadIO m) => Dirs -> String -> String -> m ()
migrateState Dirs{ dataDir } ws xs = do
io (putStrLn "WARNING: --resume is no longer supported.")
whenJust stateData $ \s ->
catchIO (writeFile (dataDir </> "xmonad.state") $ show s)
where
stateData = StateFile <$> maybeRead ws <*> maybeRead xs
maybeRead s = case reads s of
[(x, "")] -> Just x
_ -> Nothing
-- | @restart name resume@. Attempt to restart xmonad by executing the program
-- @name@. If @resume@ is 'True', restart with the current window state.
-- When executing another window manager, @resume@ should be 'False'.