Big fixes

This commit is contained in:
itdominator 2023-03-27 20:54:52 -05:00
parent ca61d5348f
commit f82541b37a
2 changed files with 15 additions and 12 deletions

View File

@ -36,18 +36,17 @@ class FileActionSignalsMixin:
# NOTE: Too lazy to impliment a proper update handler and so just regen store and update tab. # NOTE: Too lazy to impliment a proper update handler and so just regen store and update tab.
# Use a lock system to prevent too many update calls for certain instances but user can manually refresh if they have urgency # Use a lock system to prevent too many update calls for certain instances but user can manually refresh if they have urgency
def dir_watch_updates(self, file_monitor, file, other_file=None, eve_type=None, data=None): def dir_watch_updates(self, file_monitor, file, other_file=None, eve_type=None, data=None):
if eve_type == Gio.FileMonitorEvent.CHANGES_DONE_HINT: if eve_type in [Gio.FileMonitorEvent.CREATED, Gio.FileMonitorEvent.DELETED,
if eve_type in [Gio.FileMonitorEvent.CREATED, Gio.FileMonitorEvent.DELETED, Gio.FileMonitorEvent.RENAMED, Gio.FileMonitorEvent.MOVED_IN,
Gio.FileMonitorEvent.RENAMED, Gio.FileMonitorEvent.MOVED_IN, Gio.FileMonitorEvent.MOVED_OUT]:
Gio.FileMonitorEvent.MOVED_OUT]: logger.debug(eve_type)
logger.debug(eve_type)
if eve_type in [Gio.FileMonitorEvent.MOVED_IN, Gio.FileMonitorEvent.MOVED_OUT]: if eve_type in [Gio.FileMonitorEvent.MOVED_IN, Gio.FileMonitorEvent.MOVED_OUT]:
self.update_on_soft_lock_end(data[0]) self.update_on_soft_lock_end(data[0])
elif data[0] in self.soft_update_lock.keys(): elif data[0] in self.soft_update_lock.keys():
self.soft_update_lock[data[0]]["last_update_time"] = time.time() self.soft_update_lock[data[0]]["last_update_time"] = time.time()
else: else:
self.soft_lock_countdown(data[0]) self.soft_lock_countdown(data[0])
@threaded @threaded
def soft_lock_countdown(self, tab_widget): def soft_lock_countdown(self, tab_widget):

View File

@ -10,6 +10,10 @@ from gi.repository import Gio
class BottomStatusInfoException(Exception):
...
class BottomStatusInfoWidget: class BottomStatusInfoWidget:
"""docstring for BottomStatusInfoWidget.""" """docstring for BottomStatusInfoWidget."""
@ -80,7 +84,7 @@ class BottomStatusInfoWidget:
cancellable=None) cancellable=None)
file_size = file_info.get_size() file_size = file_info.get_size()
combined_size += file_size combined_size += file_size
except WindowException as e: except BottomStatusInfoException as e:
logger.debug(repr(e)) logger.debug(repr(e))
formatted_size = sizeof_fmt(combined_size) formatted_size = sizeof_fmt(combined_size)