RareCore: Return a list instead of an iterator to freely use remove()
This commit is contained in:
parent
d8c31a05c2
commit
b405ff615e
2 changed files with 7 additions and 5 deletions
|
@ -241,7 +241,8 @@ class MainWindow(QMainWindow):
|
|||
self,
|
||||
self.tr("Quit {}?").format(QApplication.applicationName()),
|
||||
self.tr(
|
||||
"There are active operations. The application cannot exit until they are completed.\n"
|
||||
"There are currently running operations. "
|
||||
"Rare cannot exit until they are completed.\n\n"
|
||||
"Do you want to clear the queue?"
|
||||
),
|
||||
buttons=(QMessageBox.Yes | QMessageBox.No),
|
||||
|
@ -259,7 +260,8 @@ class MainWindow(QMainWindow):
|
|||
self,
|
||||
self.tr("Quit {}?").format(QApplication.applicationName()),
|
||||
self.tr(
|
||||
"There is an active download. Quitting will stop the download.\n"
|
||||
"There is an active download. "
|
||||
"Quitting Rare now will stop the download.\n\n"
|
||||
"Are you sure you want to quit?"
|
||||
),
|
||||
buttons=(QMessageBox.Yes | QMessageBox.No),
|
||||
|
|
|
@ -63,10 +63,10 @@ class RareCore(QObject):
|
|||
self.__signals.application.update_statusbar.emit()
|
||||
|
||||
def active_workers(self) -> Iterator[QueueWorker]:
|
||||
return filter(lambda w: w.state == QueueWorkerState.ACTIVE, self.queue_workers)
|
||||
return list(filter(lambda w: w.state == QueueWorkerState.ACTIVE, self.queue_workers))
|
||||
|
||||
def queued_workers(self) -> Iterator[QueueWorker]:
|
||||
return filter(lambda w: w.state == QueueWorkerState.QUEUED, self.queue_workers)
|
||||
return list(filter(lambda w: w.state == QueueWorkerState.QUEUED, self.queue_workers))
|
||||
|
||||
def queue_info(self) -> List[QueueWorkerInfo]:
|
||||
return [w.worker_info() for w in self.queue_workers]
|
||||
|
|
Loading…
Reference in a new issue