def scan_tasks(self, ignore_shutdown=False):
for row in self.liststore:<EOL><INDENT>if len(self.workers.keys()) >= self.app.profile['<STR_LIT>']:<EOL><INDENT>break<EOL><DEDENT>if row[STATE_COL] == State.WAITING:<EOL><INDENT>self.start_worker(row)<EOL><DEDENT><DEDENT>if not self.shutdown_button.get_active() or ignore_shutdown:<EOL><INDENT>return<EOL><DEDENT>for row in self.liststore:<EOL><INDENT>if (row[STATE_COL] not in<EOL>(State.PAUSED, State.FINISHED, State.CANCELED)):<EOL><INDENT>return<EOL><DEDENT><DEDENT>self.shutdown.shutdown()<EOL>
扫描所有下载任务, 并在需要时启动新的下载.