From e30dee631975a2373bfe49212a7e044fb67447d2 Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Sat, 18 Jan 2014 15:03:50 +0200 Subject: [PATCH] Fix 'preview file' regression. Closes #1285. --- src/previewselect.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/previewselect.cpp b/src/previewselect.cpp index ae4dc7bab..85708ee5a 100644 --- a/src/previewselect.cpp +++ b/src/previewselect.cpp @@ -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