Fix "preview file" action not working

Root cause is the PreviewSelectDialog::readyToPreviewFile signal is
emitted before it is connected to a slot.
Only single-file torrents are affected.

Closes #11315.
This commit is contained in:
Chocobo1 2019-10-02 19:29:28 +08:00
parent 0607050ecc
commit 7ed0cd0c35
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
2 changed files with 11 additions and 12 deletions

View file

@ -506,6 +506,7 @@ void TransferListWidget::previewSelectedTorrents()
auto *dialog = new PreviewSelectDialog(this, torrent);
dialog->setAttribute(Qt::WA_DeleteOnClose);
connect(dialog, &PreviewSelectDialog::readyToPreviewFile, this, &TransferListWidget::previewFile);
dialog->show();
}
else {
QMessageBox::critical(this, tr("Unable to preview"), tr("The selected torrent does not contain previewable files"));