Use std::optional instead of boost::optional

This commit is contained in:
Vladimir Golovnev (Glassez)
2021-01-02 15:45:36 +03:00
committed by sledgehammer999
parent dc464d4d41
commit dab32f2090
7 changed files with 17 additions and 19 deletions

View File

@@ -124,7 +124,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP
m_ui->checkBoxRememberLastSavePath->setChecked(rememberLastSavePath);
m_ui->contentLayoutComboBox->setCurrentIndex(
static_cast<int>(m_torrentParams.contentLayout ? *m_torrentParams.contentLayout : session->torrentContentLayout()));
static_cast<int>(m_torrentParams.contentLayout.value_or(session->torrentContentLayout())));
m_ui->sequentialCheckBox->setChecked(m_torrentParams.sequential);
m_ui->firstLastCheckBox->setChecked(m_torrentParams.firstLastPiecePriority);

View File

@@ -354,7 +354,7 @@ void AutomatedRssDownloader::updateEditedRule()
addPaused = TriStateBool::False;
m_currentRule.setAddPaused(addPaused);
boost::optional<BitTorrent::TorrentContentLayout> contentLayout;
std::optional<BitTorrent::TorrentContentLayout> contentLayout;
if (m_ui->comboContentLayout->currentIndex() > 0)
contentLayout = static_cast<BitTorrent::TorrentContentLayout>(m_ui->comboContentLayout->currentIndex() - 1);
m_currentRule.setTorrentContentLayout(contentLayout);