mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 15:37:26 -06:00
Clean up code
* Use compiler generated comparison function * Use designated initializers * Convert to proper type * Use reference * Remove redundant text The `msg` already contain the text `Reason:` so it isn't needed. PR #20312.
This commit is contained in:
@@ -227,20 +227,20 @@ void TorrentCreatorDialog::onCreateButtonClicked()
|
||||
.replace(QRegularExpression(u"\n\n[\n]+"_s), u"\n\n"_s).split(u'\n');
|
||||
const BitTorrent::TorrentCreatorParams params
|
||||
{
|
||||
m_ui->checkPrivate->isChecked()
|
||||
.isPrivate = m_ui->checkPrivate->isChecked(),
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
, getTorrentFormat()
|
||||
.torrentFormat = getTorrentFormat(),
|
||||
#else
|
||||
, m_ui->checkOptimizeAlignment->isChecked()
|
||||
, getPaddedFileSizeLimit()
|
||||
.isAlignmentOptimized = m_ui->checkOptimizeAlignment->isChecked(),
|
||||
.paddedFileSizeLimit = getPaddedFileSizeLimit(),
|
||||
#endif
|
||||
, getPieceSize()
|
||||
, inputPath
|
||||
, destPath
|
||||
, m_ui->txtComment->toPlainText()
|
||||
, m_ui->lineEditSource->text()
|
||||
, trackers
|
||||
, m_ui->URLSeedsList->toPlainText().split(u'\n', Qt::SkipEmptyParts)
|
||||
.pieceSize = getPieceSize(),
|
||||
.inputPath = inputPath,
|
||||
.savePath = destPath,
|
||||
.comment = m_ui->txtComment->toPlainText(),
|
||||
.source = m_ui->lineEditSource->text(),
|
||||
.trackers = trackers,
|
||||
.urlSeeds = m_ui->URLSeedsList->toPlainText().split(u'\n', Qt::SkipEmptyParts)
|
||||
};
|
||||
|
||||
auto *torrentCreator = new BitTorrent::TorrentCreator(params);
|
||||
@@ -257,7 +257,7 @@ void TorrentCreatorDialog::handleCreationFailure(const QString &msg)
|
||||
{
|
||||
// Remove busy cursor
|
||||
setCursor(QCursor(Qt::ArrowCursor));
|
||||
QMessageBox::information(this, tr("Torrent creation failed"), tr("Reason: %1").arg(msg));
|
||||
QMessageBox::information(this, tr("Torrent creation failed"), msg);
|
||||
setInteractionEnabled(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user