mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
Use std::optional<bool> instead of custom TriStateBool
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user