refactor: split formatters and matchers into separated singleton classes (#166)

* split formatter into separated singleton classes

* split data engine matchers to classes

* nodiscard attribute for formatter methods

* small refactoring in matchers

* fix codefactor warnings

* fix test building
This commit is contained in:
2024-04-30 21:52:39 +03:00
parent 95572364c1
commit 64b4618904
182 changed files with 4928 additions and 766 deletions

View File

@ -121,7 +121,7 @@ queueLimit=0
swapTooltip=true
swapTooltipColor=#ffff00
tempUnits=Celsius
text="<body bgcolor=\"#000000\">\n<p align=\"justify\">Uptime: $cuptime<br>\nRAM: &nbsp;$mem&nbsp;&nbsp;$bar5<br>\nSwap: $swap&nbsp;&nbsp;$bar6<br>\nCPU: &nbsp;$cpu&nbsp;&nbsp;$bar7<br>\nCPU Temp: $temp0&deg;C<br>\nDown: $down$downunits&nbsp;&nbsp;&nbsp;&nbsp;$downtot<br>\n$bar8<br>\nUp:&nbsp;&nbsp; $up$upunits&nbsp;&nbsp;&nbsp;&nbsp;$uptot<br>\n$bar9<br></p>\n</body>\n"
text="<body bgcolor=\"#000000\">\n<p align=\"justify\">Uptime: $uptime<br>\nRAM: &nbsp;$mem&nbsp;&nbsp;$bar5<br>\nSwap: $swap&nbsp;&nbsp;$bar6<br>\nCPU: &nbsp;$cpu&nbsp;&nbsp;$bar7<br>\nCPU Temp: $temp0&deg;C<br>\nDown: $down$downunits&nbsp;&nbsp;&nbsp;&nbsp;$downtot<br>\n$bar8<br>\nUp:&nbsp;&nbsp; $up$upunits&nbsp;&nbsp;&nbsp;&nbsp;$uptot<br>\n$bar9<br></p>\n</body>\n"
textAlign=center
tooltipBackground=#ffffff
tooltipNumber=100

View File

@ -85,7 +85,7 @@ public:
auto found = std::find_if(m_items.cbegin(), m_items.cend(),
[&_tag, &_type](auto item) { return item->tag(_type) == _tag; });
if (found == std::end(m_items)) {
if (found == m_items.cend()) {
qCWarning(LOG_LIB) << "Could not find item by tag" << _tag;
return nullptr;
}
@ -99,7 +99,7 @@ public:
auto found = std::find_if(m_items.cbegin(), m_items.cend(),
[_number](auto item) { return item->number() == _number; });
if (found == std::end(m_items)) {
if (found == m_items.cend()) {
qCWarning(LOG_LIB) << "Could not find item by number" << _number;
return nullptr;
}