Re-formatted all source files
This commit is contained in:
parent
5c6ed8191b
commit
d0f64ef440
77 changed files with 2443 additions and 2332 deletions
|
@ -1,36 +1,36 @@
|
|||
#include "CheckableItem.h"
|
||||
|
||||
CheckableItem::CheckableItem(const std::string &text)
|
||||
: m_text(text)
|
||||
CheckableItem::CheckableItem(const std::string& text)
|
||||
: m_text(text)
|
||||
{
|
||||
}
|
||||
|
||||
std::string CheckableItem::getText() const
|
||||
{
|
||||
return m_text;
|
||||
return m_text;
|
||||
}
|
||||
|
||||
bool CheckableItem::isChecked() const
|
||||
{
|
||||
return m_checked;
|
||||
return m_checked;
|
||||
}
|
||||
|
||||
void CheckableItem::setState(bool checked)
|
||||
{
|
||||
m_checked = checked;
|
||||
m_checked = checked;
|
||||
}
|
||||
|
||||
unsigned int CheckableItem::value() const
|
||||
{
|
||||
return m_value;
|
||||
return m_value;
|
||||
}
|
||||
|
||||
void CheckableItem::setValue(unsigned int value)
|
||||
{
|
||||
m_value = value;
|
||||
m_value = value;
|
||||
}
|
||||
|
||||
unsigned int CheckableItem::points() const
|
||||
{
|
||||
return m_checked ? m_value : 0;
|
||||
return m_checked ? m_value : 0;
|
||||
}
|
||||
|
|
|
@ -7,21 +7,21 @@
|
|||
class CheckableItem
|
||||
{
|
||||
private:
|
||||
bool m_checked = false;
|
||||
std::string m_text;
|
||||
unsigned int m_value = 1;
|
||||
bool m_checked = false;
|
||||
std::string m_text;
|
||||
unsigned int m_value = 1;
|
||||
|
||||
public:
|
||||
CheckableItem() = default;
|
||||
CheckableItem(const std::string &text);
|
||||
CheckableItem() = default;
|
||||
CheckableItem(const std::string& text);
|
||||
|
||||
std::string getText() const;
|
||||
std::string getText() const;
|
||||
|
||||
bool isChecked() const;
|
||||
void setState(bool checked);
|
||||
bool isChecked() const;
|
||||
void setState(bool checked);
|
||||
|
||||
unsigned int value() const;
|
||||
void setValue(unsigned int value);
|
||||
unsigned int value() const;
|
||||
void setValue(unsigned int value);
|
||||
|
||||
unsigned int points() const;
|
||||
unsigned int points() const;
|
||||
};
|
||||
|
|
|
@ -6,15 +6,15 @@
|
|||
|
||||
CheckableItems::CheckableItems(std::initializer_list<std::string> itemNames)
|
||||
{
|
||||
for (const auto &itemName : itemNames)
|
||||
{
|
||||
emplace_back(itemName);
|
||||
}
|
||||
for (const auto& itemName : itemNames)
|
||||
{
|
||||
emplace_back(itemName);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int CheckableItems::getPoints() const
|
||||
{
|
||||
return std::accumulate(begin(), end(), 0, [](int base, const CheckableItem &item) {
|
||||
return base + item.points();
|
||||
});
|
||||
return std::accumulate(begin(), end(), 0, [](int base, const CheckableItem& item) {
|
||||
return base + item.points();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
class CheckableItems : public std::vector<CheckableItem>
|
||||
{
|
||||
public:
|
||||
CheckableItems(std::initializer_list<std::string> itemNames);
|
||||
CheckableItems(std::initializer_list<std::string> itemNames);
|
||||
|
||||
unsigned int getPoints() const;
|
||||
unsigned int getPoints() const;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue