Prevent flickering preview dialog

Avoid instantiation of a preview dialog, when torrent is not
previewable
This commit is contained in:
silver
2018-10-24 19:20:33 +02:00
committed by Chocobo1
parent 4e8ab08425
commit 0b47021504
2 changed files with 17 additions and 5 deletions

View File

@@ -93,10 +93,6 @@ PreviewSelectDialog::PreviewSelectDialog(QWidget *parent, BitTorrent::TorrentHan
}
}
if (m_previewListModel->rowCount() == 0) {
QMessageBox::critical(this->parentWidget(), tr("Preview impossible"), tr("Sorry, we can't preview this file"));
close();
}
connect(this, SIGNAL(readyToPreviewFile(QString)), parent, SLOT(previewFile(QString)));
m_previewListModel->sort(NAME);
previewList->header()->setSortIndicator(0, Qt::AscendingOrder);