From a380c01573c4f55b8b2665cdc24b49407b2d0359 Mon Sep 17 00:00:00 2001 From: itdominator <1itdominator@gmail.com> Date: Sat, 29 Jan 2022 15:14:50 -0600 Subject: [PATCH] Path handling and settings changes --- .../SolarFM/solarfm/shellfm/windows/view/Path.py | 9 ++++----- .../SolarFM/solarfm/shellfm/windows/view/View.py | 2 +- .../solarfm/shellfm/windows/view/utils/Settings.py | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/shellfm/windows/view/Path.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/shellfm/windows/view/Path.py index 9c3a8a7..ecce282 100644 --- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/shellfm/windows/view/Path.py +++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/shellfm/windows/view/Path.py @@ -11,10 +11,7 @@ class Path: return os.path.expanduser("~") + self.subpath def get_path(self): - if self.path: - return f"/{'/'.join(self.path)}" - else: - return f"/{''.join(self.path)}" + return f"/{'/'.join(self.path)}" if self.path else f"/{''.join(self.path)}" def get_path_list(self): return self.path @@ -24,7 +21,7 @@ class Path: self.load_directory() def pop_from_path(self): - if len(self.path) > 1: + try: self.path.pop() if not self.go_past_home: @@ -32,6 +29,8 @@ class Path: self.set_to_home() self.load_directory() + except Exception as e: + pass def set_path(self, path): if path == self.get_path(): diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/shellfm/windows/view/View.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/shellfm/windows/view/View.py index 9a0485b..594dee1 100644 --- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/shellfm/windows/view/View.py +++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/shellfm/windows/view/View.py @@ -199,7 +199,7 @@ class View(Settings, FileHandler, Launcher, Icon, Path): def get_current_sub_path(self): path = self.get_path() - home = self.get_home() + "/" + home = f"{self.get_home()}/" return path.replace(home, "") def get_end_of_path(self): diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/shellfm/windows/view/utils/Settings.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/shellfm/windows/view/utils/Settings.py index d1229c2..e4d9323 100644 --- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/shellfm/windows/view/utils/Settings.py +++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/shellfm/windows/view/utils/Settings.py @@ -59,7 +59,7 @@ class Settings: subpath = settings["base_of_home"] HIDE_HIDDEN_FILES = True if settings["hide_hidden_files"] == "true" else False FFMPG_THUMBNLR = FFMPG_THUMBNLR if settings["thumbnailer_path"] == "" else settings["thumbnailer_path"] - go_past_home = True if settings["go_past_home"] == "true" else False + go_past_home = True if settings["go_past_home"] == "" else settings["go_past_home"] lock_folder = True if settings["lock_folder"] == "true" else False locked_folders = settings["locked_folders"].split("::::") mplayer_options = settings["mplayer_options"].split()