mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Remove ColumnChooser "duplicates"
.. where metadata fields are actually for metric overrides we do not need to add to the list - since they are already there as metrics.
This commit is contained in:
@@ -1298,10 +1298,15 @@ ColumnChooser::ColumnChooser(QList<QString>&logicalHeadings)
|
||||
QList<QString> buttonNames = logicalHeadings;
|
||||
qSort(buttonNames.begin(), buttonNames.end(), insensitiveLessThan);
|
||||
|
||||
QString last;
|
||||
foreach (QString column, buttonNames) {
|
||||
|
||||
// ignore groupby
|
||||
if (column == "*") continue;
|
||||
|
||||
// ignore meta fields that are metrics or duplicates
|
||||
if (column == last || column.contains("_")) continue;
|
||||
|
||||
// setup button
|
||||
QPushButton *add = new QPushButton(column, this);
|
||||
add->setFont(small);
|
||||
@@ -1310,6 +1315,10 @@ ColumnChooser::ColumnChooser(QList<QString>&logicalHeadings)
|
||||
|
||||
connect(add, SIGNAL(pressed()), clicked, SLOT(map()));
|
||||
clicked->setMapping(add, column);
|
||||
|
||||
// for spotting duplicates
|
||||
last = column;
|
||||
|
||||
}
|
||||
scrollarea->setWidget(but);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user