Clean up PreviewSelectDialog class

This commit is contained in:
Chocobo1 2019-10-02 19:19:33 +08:00
parent a9e6ef183b
commit 0607050ecc
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
5 changed files with 11 additions and 12 deletions

View file

@ -45,7 +45,7 @@
#define SETTINGS_KEY(name) "PreviewSelectDialog/" name
PreviewSelectDialog::PreviewSelectDialog(QWidget *parent, BitTorrent::TorrentHandle *const torrent)
PreviewSelectDialog::PreviewSelectDialog(QWidget *parent, const BitTorrent::TorrentHandle *torrent)
: QDialog(parent)
, m_ui(new Ui::PreviewSelectDialog)
, m_torrent(torrent)
@ -53,13 +53,12 @@ PreviewSelectDialog::PreviewSelectDialog(QWidget *parent, BitTorrent::TorrentHan
, m_storeTreeHeaderState(SETTINGS_KEY("HeaderState"))
{
m_ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Preview"));
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &PreviewSelectDialog::previewButtonClicked);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
Preferences *const pref = Preferences::instance();
const Preferences *pref = Preferences::instance();
// Preview list
m_previewListModel = new QStandardItemModel(0, NB_COLUMNS, this);
m_previewListModel->setHeaderData(NAME, Qt::Horizontal, tr("Name"));