Fixing folder move/rename

This commit is contained in:
itdominator 2021-12-06 21:59:52 -06:00
parent a3e1cf8a37
commit 3eebf34106
2 changed files with 2 additions and 4 deletions

View File

@ -51,7 +51,7 @@ class FileHandler:
def move_file(self, fFile, tFile): def move_file(self, fFile, tFile):
try: try:
print(f"Moving: {fFile} --> {tFile}") print(f"Moving: {fFile} --> {tFile}")
if os.path.exists(fFile) and os.path.exists(tFile): if os.path.exists(fFile) and not os.path.exists(tFile):
if not tFile.endswith("/"): if not tFile.endswith("/"):
tFile += "/" tFile += "/"

View File

@ -287,14 +287,12 @@ class WidgetFileActionMixin:
wid, tid = self.window_controller.get_active_data() wid, tid = self.window_controller.get_active_data()
view = self.get_fm_window(wid).get_view_by_id(tid) view = self.get_fm_window(wid).get_view_by_id(tid)
fPath = file.get_path() fPath = file.get_path()
tPath = None tPath = target.get_path()
state = True state = True
if action == "copy": if action == "copy":
tPath = target.get_path()
view.copy_file(fPath, tPath) view.copy_file(fPath, tPath)
if action == "move" or action == "rename": if action == "move" or action == "rename":
tPath = target.get_parent().get_path()
view.move_file(fPath, tPath) view.move_file(fPath, tPath)
else: else:
if action == "copy": if action == "copy":