diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-12-01 21:29:42 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-12-01 21:29:42 +0100 |
commit | 93b406d1914a5512aec6ca737ba8326a21191227 (patch) | |
tree | 0f869f201815ae862bc2853de0b2007ff1515bf1 /tests/hawd/modules/list.cpp | |
parent | ae7cc26c8350b427870f83687f83184c2c211250 (diff) | |
download | sink-93b406d1914a5512aec6ca737ba8326a21191227.tar.gz sink-93b406d1914a5512aec6ca737ba8326a21191227.zip |
HAWD: Ensure the column order is maintained
By turning the columns into an array instead of an object,
we can print the values in the same order as in the definition file.
Previosly the order was random, and even headers and values were
somtimes mixed up.
Diffstat (limited to 'tests/hawd/modules/list.cpp')
-rw-r--r-- | tests/hawd/modules/list.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/hawd/modules/list.cpp b/tests/hawd/modules/list.cpp index efb000b..aa80126 100644 --- a/tests/hawd/modules/list.cpp +++ b/tests/hawd/modules/list.cpp | |||
@@ -60,10 +60,8 @@ bool List::list(const QStringList &commands, State &state) | |||
60 | if (dataset.isValid()) { | 60 | if (dataset.isValid()) { |
61 | DatasetDefinition dataset(project.absoluteFilePath(file)); | 61 | DatasetDefinition dataset(project.absoluteFilePath(file)); |
62 | std::cout << '\t' << QObject::tr("Dataset: %1").arg(dataset.name()).toStdString() << std::endl; | 62 | std::cout << '\t' << QObject::tr("Dataset: %1").arg(dataset.name()).toStdString() << std::endl; |
63 | QHashIterator<QString, DataDefinition> it(dataset.columns()); | 63 | for (const auto &column : dataset.columns()) { |
64 | while (it.hasNext()) { | 64 | std::cout << "\t\t" << column.second.typeString().toStdString() << ' ' << column.first.toStdString() << std::endl; |
65 | it.next(); | ||
66 | std::cout << "\t\t" << it.value().typeString().toStdString() << ' ' << it.key().toStdString() << std::endl; | ||
67 | } | 65 | } |
68 | } else { | 66 | } else { |
69 | std::cout << QObject::tr("Problem with dataset %1. Check with 'check' command.").arg(file).toStdString() << std::endl; | 67 | std::cout << QObject::tr("Problem with dataset %1. Check with 'check' command.").arg(file).toStdString() << std::endl; |