mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-10-22 18:56:08 +03:00
Simplify m_creatorThread initialization
This commit is contained in:
parent
7de1aba092
commit
a4141fd151
1 changed files with 6 additions and 8 deletions
|
@ -66,7 +66,7 @@ namespace
|
||||||
TorrentCreatorDlg::TorrentCreatorDlg(QWidget *parent, const QString &defaultPath)
|
TorrentCreatorDlg::TorrentCreatorDlg(QWidget *parent, const QString &defaultPath)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
, m_ui(new Ui::TorrentCreatorDlg)
|
, m_ui(new Ui::TorrentCreatorDlg)
|
||||||
, m_creatorThread(nullptr)
|
, m_creatorThread(new BitTorrent::TorrentCreatorThread(this))
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
@ -78,6 +78,10 @@ TorrentCreatorDlg::TorrentCreatorDlg(QWidget *parent, const QString &defaultPath
|
||||||
connect(m_ui->addFolder_button, SIGNAL(clicked(bool)), SLOT(onAddFolderButtonClicked()));
|
connect(m_ui->addFolder_button, SIGNAL(clicked(bool)), SLOT(onAddFolderButtonClicked()));
|
||||||
connect(m_ui->buttonBox, SIGNAL(accepted()), SLOT(onCreateButtonClicked()));
|
connect(m_ui->buttonBox, SIGNAL(accepted()), SLOT(onCreateButtonClicked()));
|
||||||
|
|
||||||
|
connect(m_creatorThread, SIGNAL(creationSuccess(QString, QString)), this, SLOT(handleCreationSuccess(QString, QString)));
|
||||||
|
connect(m_creatorThread, SIGNAL(creationFailure(QString)), this, SLOT(handleCreationFailure(QString)));
|
||||||
|
connect(m_creatorThread, SIGNAL(updateProgress(int)), this, SLOT(updateProgressBar(int)));
|
||||||
|
|
||||||
loadSettings();
|
loadSettings();
|
||||||
updateInputPath(defaultPath);
|
updateInputPath(defaultPath);
|
||||||
|
|
||||||
|
@ -178,13 +182,7 @@ void TorrentCreatorDlg::onCreateButtonClicked()
|
||||||
QStringList urlSeeds = m_ui->URLSeeds_list->toPlainText().split("\n");
|
QStringList urlSeeds = m_ui->URLSeeds_list->toPlainText().split("\n");
|
||||||
QString comment = m_ui->txt_comment->toPlainText();
|
QString comment = m_ui->txt_comment->toPlainText();
|
||||||
|
|
||||||
// Create the creator thread
|
// run the creator thread
|
||||||
if (!m_creatorThread) {
|
|
||||||
m_creatorThread = new BitTorrent::TorrentCreatorThread(this);
|
|
||||||
connect(m_creatorThread, SIGNAL(creationSuccess(QString, QString)), this, SLOT(handleCreationSuccess(QString, QString)));
|
|
||||||
connect(m_creatorThread, SIGNAL(creationFailure(QString)), this, SLOT(handleCreationFailure(QString)));
|
|
||||||
connect(m_creatorThread, SIGNAL(updateProgress(int)), this, SLOT(updateProgressBar(int)));
|
|
||||||
}
|
|
||||||
m_creatorThread->create(input, destination, trackers, urlSeeds, comment, m_ui->check_private->isChecked(), getPieceSize());
|
m_creatorThread->create(input, destination, trackers, urlSeeds, comment, m_ui->check_private->isChecked(), getPieceSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue