mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-08 06:00:59 -07:00
Use std::optional<bool> instead of custom TriStateBool
This commit is contained in:
parent
d0cac421bb
commit
531ae501ad
17 changed files with 75 additions and 235 deletions
|
@ -269,10 +269,8 @@ void AutomatedRssDownloader::updateRuleDefinitionBox()
|
|||
if (m_currentRule.assignedCategory().isEmpty())
|
||||
m_ui->comboCategory->clearEditText();
|
||||
int index = 0;
|
||||
if (m_currentRule.addPaused() == TriStateBool::True)
|
||||
index = 1;
|
||||
else if (m_currentRule.addPaused() == TriStateBool::False)
|
||||
index = 2;
|
||||
if (m_currentRule.addPaused().has_value())
|
||||
index = (*m_currentRule.addPaused() ? 1 : 2);
|
||||
m_ui->comboAddPaused->setCurrentIndex(index);
|
||||
index = 0;
|
||||
if (m_currentRule.torrentContentLayout())
|
||||
|
@ -347,11 +345,11 @@ void AutomatedRssDownloader::updateEditedRule()
|
|||
m_currentRule.setEpisodeFilter(m_ui->lineEFilter->text());
|
||||
m_currentRule.setSavePath(m_ui->checkBoxSaveDiffDir->isChecked() ? m_ui->lineSavePath->selectedPath() : "");
|
||||
m_currentRule.setCategory(m_ui->comboCategory->currentText());
|
||||
TriStateBool addPaused; // Undefined by default
|
||||
std::optional<bool> addPaused;
|
||||
if (m_ui->comboAddPaused->currentIndex() == 1)
|
||||
addPaused = TriStateBool::True;
|
||||
addPaused = true;
|
||||
else if (m_ui->comboAddPaused->currentIndex() == 2)
|
||||
addPaused = TriStateBool::False;
|
||||
addPaused = false;
|
||||
m_currentRule.setAddPaused(addPaused);
|
||||
|
||||
std::optional<BitTorrent::TorrentContentLayout> contentLayout;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue