Add default constructor, fix debug output.

This commit is contained in:
Gerhard Hoffmann 2024-09-11 11:35:17 +02:00
parent 7a53a68850
commit f322d30e36

View File

@ -15,6 +15,19 @@ struct ATBCarryOver {
int id; int id;
explicit ATBCarryOver()
: id(-1) {
for (int i = 0 ; i < 8; ++i) {
carryover[i].day = -1;
carryover[i].seemless = false;
carryover[i].never = false;
carryover[i].static_start = QTime(23, 59, 59);
carryover[i].static_end = QTime(0, 0, 0);
carryover[i].duration = -1;
}
}
friend QDebug operator<<(QDebug debug, ATBCarryOver const &co) { friend QDebug operator<<(QDebug debug, ATBCarryOver const &co) {
QDebugStateSaver saver(debug); QDebugStateSaver saver(debug);
@ -31,21 +44,21 @@ struct ATBCarryOver {
<< " day: " << co.carryover[(int)Qt::Tuesday].day << "\n" << " day: " << co.carryover[(int)Qt::Tuesday].day << "\n"
<< " static_start: " << co.carryover[(int)Qt::Tuesday].static_start.toString(Qt::ISODate) << "\n" << " static_start: " << co.carryover[(int)Qt::Tuesday].static_start.toString(Qt::ISODate) << "\n"
<< " static_end: " << co.carryover[(int)Qt::Tuesday].static_end.toString(Qt::ISODate) << "\n" << " static_end: " << co.carryover[(int)Qt::Tuesday].static_end.toString(Qt::ISODate) << "\n"
<< " duration: " << co.carryover[(int)Qt::Monday].duration << "\n" << " duration: " << co.carryover[(int)Qt::Tuesday].duration << "\n"
<< " anytime: " << co.carryover[(int)Qt::Tuesday].seemless << "\n" << " anytime: " << co.carryover[(int)Qt::Tuesday].seemless << "\n"
<< " never: " << co.carryover[(int)Qt::Tuesday].never << "\n" << " never: " << co.carryover[(int)Qt::Tuesday].never << "\n"
<< " **** Wednesday **** \n" << " **** Wednesday **** \n"
<< " day: " << co.carryover[(int)Qt::Wednesday].day << "\n" << " day: " << co.carryover[(int)Qt::Wednesday].day << "\n"
<< " static_start: " << co.carryover[(int)Qt::Wednesday].static_start.toString(Qt::ISODate) << "\n" << " static_start: " << co.carryover[(int)Qt::Wednesday].static_start.toString(Qt::ISODate) << "\n"
<< " static_end: " << co.carryover[(int)Qt::Wednesday].static_end.toString(Qt::ISODate) << "\n" << " static_end: " << co.carryover[(int)Qt::Wednesday].static_end.toString(Qt::ISODate) << "\n"
<< " duration: " << co.carryover[(int)Qt::Monday].duration << "\n" << " duration: " << co.carryover[(int)Qt::Wednesday].duration << "\n"
<< " anytime: " << co.carryover[(int)Qt::Wednesday].seemless << "\n" << " anytime: " << co.carryover[(int)Qt::Wednesday].seemless << "\n"
<< " never: " << co.carryover[(int)Qt::Wednesday].never << "\n" << " never: " << co.carryover[(int)Qt::Wednesday].never << "\n"
<< " **** Thursday **** \n" << " **** Thursday **** \n"
<< " day: " << co.carryover[(int)Qt::Thursday].day << "\n" << " day: " << co.carryover[(int)Qt::Thursday].day << "\n"
<< " static_start: " << co.carryover[(int)Qt::Thursday].static_start.toString(Qt::ISODate) << "\n" << " static_start: " << co.carryover[(int)Qt::Thursday].static_start.toString(Qt::ISODate) << "\n"
<< " static_end: " << co.carryover[(int)Qt::Thursday].static_end.toString(Qt::ISODate) << "\n" << " static_end: " << co.carryover[(int)Qt::Thursday].static_end.toString(Qt::ISODate) << "\n"
<< " duration: " << co.carryover[(int)Qt::Monday].duration << "\n" << " duration: " << co.carryover[(int)Qt::Thursday].duration << "\n"
<< " anytime: " << co.carryover[(int)Qt::Thursday].seemless << "\n" << " anytime: " << co.carryover[(int)Qt::Thursday].seemless << "\n"
<< " never: " << co.carryover[(int)Qt::Thursday].never << "\n" << " never: " << co.carryover[(int)Qt::Thursday].never << "\n"
<< " **** Friday **** \n" << " **** Friday **** \n"
@ -58,14 +71,14 @@ struct ATBCarryOver {
<< " day: " << co.carryover[(int)Qt::Saturday].day << "\n" << " day: " << co.carryover[(int)Qt::Saturday].day << "\n"
<< " static_start: " << co.carryover[(int)Qt::Saturday].static_start.toString(Qt::ISODate) << "\n" << " static_start: " << co.carryover[(int)Qt::Saturday].static_start.toString(Qt::ISODate) << "\n"
<< " static_end: " << co.carryover[(int)Qt::Saturday].static_end.toString(Qt::ISODate) << "\n" << " static_end: " << co.carryover[(int)Qt::Saturday].static_end.toString(Qt::ISODate) << "\n"
<< " duration: " << co.carryover[(int)Qt::Monday].duration << "\n" << " duration: " << co.carryover[(int)Qt::Saturday].duration << "\n"
<< " anytime: " << co.carryover[(int)Qt::Saturday].seemless << "\n" << " anytime: " << co.carryover[(int)Qt::Saturday].seemless << "\n"
<< " never: " << co.carryover[(int)Qt::Saturday].never << "\n" << " never: " << co.carryover[(int)Qt::Saturday].never << "\n"
<< " **** Sunday **** \n" << " **** Sunday **** \n"
<< " day: " << co.carryover[(int)Qt::Sunday].day << "\n" << " day: " << co.carryover[(int)Qt::Sunday].day << "\n"
<< " static_start: " << co.carryover[(int)Qt::Sunday].static_start.toString(Qt::ISODate) << "\n" << " static_start: " << co.carryover[(int)Qt::Sunday].static_start.toString(Qt::ISODate) << "\n"
<< " static_end: " << co.carryover[(int)Qt::Sunday].static_end.toString(Qt::ISODate) << "\n" << " static_end: " << co.carryover[(int)Qt::Sunday].static_end.toString(Qt::ISODate) << "\n"
<< " duration: " << co.carryover[(int)Qt::Monday].duration << "\n" << " duration: " << co.carryover[(int)Qt::Sunday].duration << "\n"
<< " anytime: " << co.carryover[(int)Qt::Sunday].seemless << "\n" << " anytime: " << co.carryover[(int)Qt::Sunday].seemless << "\n"
<< " never: " << co.carryover[(int)Qt::Sunday].never << "\n"; << " never: " << co.carryover[(int)Qt::Sunday].never << "\n";