Skip to content

Commit

Permalink
Fix issue #738 - hide start number in html startlist when no start nu…
Browse files Browse the repository at this point in the history
…mber in class / club
  • Loading branch information
arnost00 committed Aug 2, 2022
1 parent 654bc23 commit 3a02470
Showing 1 changed file with 27 additions and 17 deletions.
44 changes: 27 additions & 17 deletions quickevent/app/quickevent/plugins/Runs/src/runsplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1709,13 +1709,18 @@ void RunsPlugin::export_startListClassesHtml()
append_list(table, ltr);
}
qf::core::utils::TreeTable tt2 = tt1.row(i).table();
QVariantList trr{"tr",
QVariantList{"th", tr("St. Num")},
QVariantList{"th", tr("Name")},
QVariantList{"th", tr("Registration")},
QVariantList{"th", tr("SI")},
QVariantList{"th", QVariantMap{{"colspan", "3"}}, tr("Start")}
};
bool show_start_number = false;
for(int j=0; j<tt2.rowCount(); j++) {
if (tt2.row(j).value(QStringLiteral("startNumber")).toInt() > 0)
show_start_number = true;
}
QVariantList trr{"tr"};
if (show_start_number)
append_list(trr, QVariantList{"th", tr("St. Num")});
append_list(trr, QVariantList{"th", tr("Name")});
append_list(trr,QVariantList{"th", tr("Registration")});
append_list(trr,QVariantList{"th", tr("SI")});
append_list(trr,QVariantList{"th", QVariantMap{{"colspan", "3"}}, tr("Start")});
append_list(table, trr);
for(int j=0; j<tt2.rowCount(); j++) {
qf::core::utils::TreeTableRow tt2_row = tt2.row(j);
Expand All @@ -1724,7 +1729,7 @@ void RunsPlugin::export_startListClassesHtml()
trr << QVariantMap{{"class", "odd"}};
if (tt2_row.value(QStringLiteral("startNumber")).toInt() > 0)
append_list(trr, QVariantList{"td", tt2_row.value(QStringLiteral("startNumber"))});
else
else if (show_start_number)
append_list(trr, QVariantList{"td", ""});
append_list(trr, QVariantList{"td", tt2_row.value(QStringLiteral("competitorName"))});
append_list(trr, QVariantList{"td", tt2_row.value(QStringLiteral("registration"))});
Expand Down Expand Up @@ -1803,14 +1808,19 @@ void RunsPlugin::export_startListClubsHtml()
append_list(table, ltr);
}
qf::core::utils::TreeTable tt2 = tt1_row.table();
QVariantList trr{"tr",
QVariantList{"th", tr("St. Num")},
QVariantList{"th", tr("Class")},
QVariantList{"th", tr("Name")},
QVariantList{"th", tr("Registration")},
QVariantList{"th", tr("SI")},
QVariantList{"th", QVariantMap{{"colspan", "3"}}, tr("Start")}
};
bool show_start_number = false;
for(int j=0; j<tt2.rowCount(); j++) {
if (tt2.row(j).value(QStringLiteral("startNumber")).toInt() > 0)
show_start_number = true;
}
QVariantList trr{"tr"};
if (show_start_number)
append_list(trr, QVariantList{"th", tr("St. Num")});
append_list(trr, QVariantList{"th", tr("Class")});
append_list(trr, QVariantList{"th", tr("Name")});
append_list(trr,QVariantList{"th", tr("Registration")});
append_list(trr,QVariantList{"th", tr("SI")});
append_list(trr,QVariantList{"th", QVariantMap{{"colspan", "3"}}, tr("Start")});
append_list(table, trr);
for(int j=0; j<tt2.rowCount(); j++) {
qf::core::utils::TreeTableRow tt2_row = tt2.row(j);
Expand All @@ -1819,7 +1829,7 @@ void RunsPlugin::export_startListClubsHtml()
trr << QVariantMap{{"class", "odd"}};
if (tt2_row.value(QStringLiteral("startNumber")).toInt() > 0)
append_list(trr, QVariantList{"td", tt2_row.value(QStringLiteral("startNumber"))});
else
else if (show_start_number)
append_list(trr, QVariantList{"td", ""});
append_list(trr, QVariantList{"td", tt2_row.value(QStringLiteral("classes.name"))});
append_list(trr, QVariantList{"td", tt2_row.value(QStringLiteral("competitorName"))});
Expand Down

0 comments on commit 3a02470

Please sign in to comment.