Browse Source

Merge pull request #10763 from Chocobo1/connect

Use Qt5 connect syntax
adaptive-webui-19844
Mike Tzou 6 years ago committed by GitHub
parent
commit
f3c0cc3cee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      src/gui/previewselectdialog.cpp
  2. 9
      src/gui/transferlistwidget.cpp

1
src/gui/previewselectdialog.cpp

@ -96,7 +96,6 @@ PreviewSelectDialog::PreviewSelectDialog(QWidget *parent, BitTorrent::TorrentHan
} }
} }
connect(this, SIGNAL(readyToPreviewFile(QString)), parent, SLOT(previewFile(QString)));
m_previewListModel->sort(NAME); m_previewListModel->sort(NAME);
m_ui->previewList->header()->setSortIndicator(0, Qt::AscendingOrder); m_ui->previewList->header()->setSortIndicator(0, Qt::AscendingOrder);
m_ui->previewList->selectionModel()->select(m_previewListModel->index(0, NAME), QItemSelectionModel::Select | QItemSelectionModel::Rows); m_ui->previewList->selectionModel()->select(m_previewListModel->index(0, NAME), QItemSelectionModel::Select | QItemSelectionModel::Rows);

9
src/gui/transferlistwidget.cpp

@ -605,11 +605,14 @@ void TransferListWidget::openSelectedTorrentsFolder() const
void TransferListWidget::previewSelectedTorrents() void TransferListWidget::previewSelectedTorrents()
{ {
for (BitTorrent::TorrentHandle *const torrent : asConst(getSelectedTorrents())) { for (BitTorrent::TorrentHandle *const torrent : asConst(getSelectedTorrents())) {
if (torrentContainsPreviewableFiles(torrent)) if (torrentContainsPreviewableFiles(torrent)) {
new PreviewSelectDialog(this, torrent); const auto *dialog = new PreviewSelectDialog(this, torrent);
else connect(dialog, &PreviewSelectDialog::readyToPreviewFile, this, &TransferListWidget::previewFile);
}
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 does not contain previewable files"));
} }
}
} }
void TransferListWidget::setDlLimitSelectedTorrents() void TransferListWidget::setDlLimitSelectedTorrents()

Loading…
Cancel
Save