From 93b406d1914a5512aec6ca737ba8326a21191227 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 1 Dec 2015 21:29:42 +0100 Subject: 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. --- tests/hawd/modules/list.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tests/hawd/modules') 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) if (dataset.isValid()) { DatasetDefinition dataset(project.absoluteFilePath(file)); std::cout << '\t' << QObject::tr("Dataset: %1").arg(dataset.name()).toStdString() << std::endl; - QHashIterator it(dataset.columns()); - while (it.hasNext()) { - it.next(); - std::cout << "\t\t" << it.value().typeString().toStdString() << ' ' << it.key().toStdString() << std::endl; + for (const auto &column : dataset.columns()) { + std::cout << "\t\t" << column.second.typeString().toStdString() << ' ' << column.first.toStdString() << std::endl; } } else { std::cout << QObject::tr("Problem with dataset %1. Check with 'check' command.").arg(file).toStdString() << std::endl; -- cgit v1.2.3