Merge pull request #11317 from Chocobo1/preview

Fix "preview file" action not working
This commit is contained in:
Mike Tzou 2019-11-04 11:32:14 +08:00 committed by GitHub
commit 2fb1182700
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 40 additions and 35 deletions

View file

@ -504,13 +504,16 @@ void TransferListWidget::openSelectedTorrentsFolder() const
void TransferListWidget::previewSelectedTorrents()
{
for (BitTorrent::TorrentHandle *const torrent : asConst(getSelectedTorrents())) {
for (const BitTorrent::TorrentHandle *torrent : asConst(getSelectedTorrents())) {
if (torrentContainsPreviewableFiles(torrent)) {
const auto *dialog = new PreviewSelectDialog(this, torrent);
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"));
QMessageBox::critical(this, tr("Unable to preview"), tr("The selected torrent \"%1\" does not contain previewable files")
.arg(torrent->name()));
}
}
}