GTK: clear move buffer after move

Doesn't make sense to keep it since the buffer
will probably point to a non-existing file afterwards.
This commit is contained in:
Julian Ospald 2016-04-18 01:02:18 +02:00
parent 8b8c9a669f
commit 9b43814846
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28

View File

@ -352,7 +352,7 @@ copyInit _ _ _ = withErrorDialog
-- |Finalizes a file operation, such as copy or move.
operationFinal :: MyGUI -> MyView -> Maybe Item -> IO ()
operationFinal _ myview mitem = withErrorDialog $ do
operationFinal mygui myview mitem = withErrorDialog $ do
op <- readTVarIO (operationBuffer myview)
cdir <- case mitem of
Nothing -> path <$> getCurrentDir myview
@ -363,15 +363,16 @@ operationFinal _ myview mitem = withErrorDialog $ do
++ " to \"" ++ P.fpToString (P.fromAbs cdir)
++ "\"?"
withConfirmationDialog cmsg . withCopyModeDialog
$ \cm -> void $ runFileOp (FMove . MC s cdir $ cm)
return ()
$ \cm -> do
void $ runFileOp (FMove . MC s cdir $ cm)
popStatusbar mygui
writeTVarIO (operationBuffer myview) None
FCopy (CP1 s) -> do
let cmsg = "Really copy " ++ imsg s
++ " to \"" ++ P.fpToString (P.fromAbs cdir)
++ "\"?"
withConfirmationDialog cmsg . withCopyModeDialog
$ \cm -> void $ runFileOp (FCopy . CC s cdir $ cm)
return ()
_ -> return ()
where
imsg s = case s of