diff options
author | hut <hut@lavabit.com> | 2010-10-02 16:10:21 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-10-02 16:10:21 +0200 |
commit | 1ef0ade55d7e678ee036a821b26dbf9dc95fb877 (patch) | |
tree | 4cb2d8ca25a43531c9282ea0ff4903a406407988 /ranger | |
parent | 1120d70c8f259a55bfeeb4c97c5a1e9d78ddebaf (diff) | |
download | ranger-1ef0ade55d7e678ee036a821b26dbf9dc95fb877.tar.gz |
core.fm: Don't check bookmarks when not needed
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/core/actions.py | 3 | ||||
-rw-r--r-- | ranger/core/fm.py | 6 | ||||
-rw-r--r-- | ranger/gui/widgets/browserview.py | 1 |
3 files changed, 6 insertions, 4 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 59902bab..4b3752ef 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -472,6 +472,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): def enter_bookmark(self, key): """Enter the bookmark with the name <key>""" try: + self.bookmarks.update_if_outdated() destination = self.bookmarks[key] cwd = self.env.cwd if destination.path != cwd.path: @@ -482,10 +483,12 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): def set_bookmark(self, key): """Set the bookmark with the name <key> to the current directory""" + self.bookmarks.update_if_outdated() self.bookmarks[key] = self.env.cwd def unset_bookmark(self, key): """Delete the bookmark with the name <key>""" + self.bookmarks.update_if_outdated() self.bookmarks.delete(key) def draw_bookmarks(self): diff --git a/ranger/core/fm.py b/ranger/core/fm.py index 7f655aa6..5e01f96f 100644 --- a/ranger/core/fm.py +++ b/ranger/core/fm.py @@ -134,14 +134,12 @@ class FM(Actions, SignalDispatcher): # for faster lookup: ui = self.ui throbber = ui.throbber - bookmarks = self.bookmarks loader = self.loader env = self.env has_throbber = hasattr(ui, 'throbber') try: while True: - bookmarks.update_if_outdated() loader.work() if has_throbber: if loader.has_work(): @@ -166,5 +164,5 @@ class FM(Actions, SignalDispatcher): raise SystemExit finally: - bookmarks.remember(env.cwd) - bookmarks.save() + self.bookmarks.remember(env.cwd) + self.bookmarks.save() diff --git a/ranger/gui/widgets/browserview.py b/ranger/gui/widgets/browserview.py index c80e4885..142e7985 100644 --- a/ranger/gui/widgets/browserview.py +++ b/ranger/gui/widgets/browserview.py @@ -117,6 +117,7 @@ class BrowserView(Widget, DisplayableContainer): pass def _draw_bookmarks(self): + self.fm.bookmarks.update_if_outdated() self.color_reset() self.need_clear = True |