Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
geigi committed May 30, 2021
1 parent d379ce3 commit 8de52fa
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
19 changes: 0 additions & 19 deletions cozy/ui/book_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class BookElement(Gtk.FlowBoxChild):
track_box = None
current_track_element = None
context_menu = None
_filesystem_monitor = inject.attr("FilesystemMonitor")
_settings = inject.attr(Settings)

def __init__(self, book: Book):
self.book: Book = book
Expand Down Expand Up @@ -77,8 +75,6 @@ def __init__(self, book: Book):
self.art.connect("play-pause-clicked", self._on_album_art_press_event)
self.event_box.connect("button-press-event", self.__on_button_press_event)
self.connect("key-press-event", self.__on_key_press_event)
self._filesystem_monitor.add_listener(self.__on_storage_changed)
self._settings.add_listener(self.__on_storage_changed)

def set_playing(self, is_playing):
if is_playing:
Expand Down Expand Up @@ -148,21 +144,6 @@ def __jump_to_folder(self, _, __):
path = os.path.dirname(track.file)
subprocess.Popen(['xdg-open', path])

def __on_storage_changed(self, event, message):
if event == "storage-online" or event == "external-storage-removed":
if message in self.book.chapters[0].file:
self.box.set_tooltip_text(self.ONLINE_TOOLTIP_TEXT)
elif event == "storage-offline":
if message in self.book.chapters[0].file and not self.book.offline:
self.box.set_tooltip_text(self.OFFLINE_TOOLTIP_TEXT)
elif event == "external-storage-added":
if not self._filesystem_monitor.get_book_online(self.book):
self.box.set_tooltip_text(self.OFFLINE_TOOLTIP_TEXT)
if event == "external-storage-removed":
first_track = self.book.chapters[0]
if first_track and message in first_track.file:
self.box.set_tooltip_text(self.ONLINE_TOOLTIP_TEXT)


GObject.type_register(AlbumElement)
GObject.signal_new('play-pause-clicked', BookElement, GObject.SIGNAL_RUN_LAST, GObject.TYPE_PYOBJECT,
Expand Down
3 changes: 0 additions & 3 deletions cozy/view_model/book_detail_view_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,8 @@ def _on_offline_cache_event(self, event, message):
return

if event == "book-offline-removed":
# TODO: Remove this when offline cache refactoring is complete
self._book.downloaded = False
self._notify("downloaded")
elif event == "book-offline":
self._book.downloaded = True
self._notify("downloaded")

def _on_app_setting_changed(self, event, _):
Expand Down

0 comments on commit 8de52fa

Please sign in to comment.