1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-27 06:54:20 +00:00

Fix 'preview file' regression. Closes #1285.

This commit is contained in:
sledgehammer999 2014-01-18 15:03:50 +02:00
parent ceba1dc734
commit e30dee6319

View File

@ -76,9 +76,6 @@ PreviewSelect::PreviewSelect(QWidget* parent, QTorrentHandle h): QDialog(parent)
}
}
previewList->selectionModel()->select(previewListModel->index(0, NAME), QItemSelectionModel::Select);
previewList->selectionModel()->select(previewListModel->index(0, SIZE), QItemSelectionModel::Select);
previewList->selectionModel()->select(previewListModel->index(0, PROGRESS), QItemSelectionModel::Select);
if (!previewListModel->rowCount()) {
QMessageBox::critical(0, tr("Preview impossible"), tr("Sorry, we can't preview this file"));
close();
@ -86,6 +83,7 @@ PreviewSelect::PreviewSelect(QWidget* parent, QTorrentHandle h): QDialog(parent)
connect(this, SIGNAL(readyToPreviewFile(QString)), parent, SLOT(previewFile(QString)));
previewListModel->sort(NAME);
previewList->header()->setSortIndicator(0, Qt::AscendingOrder);
previewList->selectionModel()->select(previewListModel->index(0, NAME), QItemSelectionModel::Select | QItemSelectionModel::Rows);
if (previewListModel->rowCount() == 1) {
qDebug("Torrent file only contains one file, no need to display selection dialog before preview");
@ -104,7 +102,6 @@ PreviewSelect::~PreviewSelect() {
void PreviewSelect::on_previewButton_clicked() {
QModelIndex index;
QModelIndexList selectedIndexes = previewList->selectionModel()->selectedRows(FILE_INDEX);
if (selectedIndexes.size() == 0) return;
// Flush data