1
0
Fork 0
mirror of synced 2024-06-02 18:54:41 +12:00

Downloads: Code clarity

This commit is contained in:
loathingKernel 2023-09-04 23:28:34 +03:00
parent f2c575e082
commit 083094bcfc
No known key found for this signature in database
GPG key ID: CE0C72D0B53821FD
2 changed files with 9 additions and 9 deletions

View file

@ -102,7 +102,7 @@ class DownloadsTab(QWidget):
@pyqtSlot(str) @pyqtSlot(str)
@pyqtSlot(RareGame) @pyqtSlot(RareGame)
def __add_update(self, update: Union[str,RareGame]): def __add_update(self, update: Union[str, RareGame]):
if isinstance(update, str): if isinstance(update, str):
update = self.rcore.get_game(update) update = self.rcore.get_game(update)
if update.metadata.auto_update or QSettings().value("auto_update", False, bool): if update.metadata.auto_update or QSettings().value("auto_update", False, bool):
@ -192,12 +192,12 @@ class DownloadsTab(QWidget):
if item.expired: if item.expired:
self.__refresh_download(item) self.__refresh_download(item)
return return
thread = DlThread(item, self.rcore.get_game(item.options.app_name), self.core, self.args.debug) dl_thread = DlThread(item, self.rcore.get_game(item.options.app_name), self.core, self.args.debug)
thread.result.connect(self.__on_download_result) dl_thread.result.connect(self.__on_download_result)
thread.progress.connect(self.__on_download_progress) dl_thread.progress.connect(self.__on_download_progress)
thread.finished.connect(thread.deleteLater) dl_thread.finished.connect(dl_thread.deleteLater)
thread.start() dl_thread.start()
self.__thread = thread self.__thread = dl_thread
self.download_widget.ui.kill_button.setDisabled(False) self.download_widget.ui.kill_button.setDisabled(False)
self.download_widget.ui.dl_name.setText(item.download.game.app_title) self.download_widget.ui.dl_name.setText(item.download.game.app_title)
self.download_widget.setPixmap( self.download_widget.setPixmap(

View file

@ -5,8 +5,8 @@ from typing import Optional
@dataclass @dataclass
class UIUpdate: class UIUpdate:
""" """
Status update object sent from the manager to the CLI/GUI to update status indicators Status update object sent from the manager to the CLI/GUI to update status indicators
Inheritance doesn't work due to optional arguments in UIUpdate proper Inheritance doesn't work due to optional arguments in UIUpdate proper
""" """
progress: float progress: float
download_speed: float download_speed: float