From 3b9099ae6a16ae2222b5b0d06e66301a912524c0 Mon Sep 17 00:00:00 2001 From: Michal Maly Date: Sat, 2 Aug 2014 09:48:27 +0200 Subject: [PATCH] Eradicate unordered_maps, round 2 --- datamanager.cpp | 10 ++++------ singlerundata.h | 6 ++++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/datamanager.cpp b/datamanager.cpp index 6175aba..74fdbea 100644 --- a/datamanager.cpp +++ b/datamanager.cpp @@ -688,12 +688,10 @@ void DataManager::onSingleRunSelected(const QString& key) std::shared_ptr srdata = m_activeSequence->selectedRun(); emit cleanDashboard(); - std::vector allKeys = srdata->allKeys(); - std::vector::const_reverse_iterator rit = allKeys.crbegin(); - qDebug() << QString::fromStdString(*rit); - while (rit != allKeys.crend()) { - showOneSignal(srdata->controllerAt(*rit)); - rit++; + SignalControllersMap::iterator it = srdata->ctrls_begin(); + while (it != srdata->ctrls_end()) { + showOneSignal(it->second); + it++; } emit setSingleRunInfo(srdata->methodName(), srdata->operatorName(), srdata->sampleInfo(), srdata->date().toString() +" "+ srdata->time().toString()); diff --git a/singlerundata.h b/singlerundata.h index 2419717..b27cb4b 100644 --- a/singlerundata.h +++ b/singlerundata.h @@ -31,8 +31,8 @@ #include #include -typedef std::unordered_map> SignalControllersMap; -typedef std::unordered_map> SignalsMap; +typedef std::map> SignalControllersMap; +typedef std::map> SignalsMap; class SingleRunData : public QObject { @@ -45,9 +45,11 @@ public: const SignalControllersMap& allControllers() const { return m_ctrls; } std::vector allKeys() const; const SignalsMap& allSignals() const { return m_signals; } + SignalControllersMap::iterator ctrls_begin() { return m_ctrls.begin(); } std::shared_ptr controllerAt(const std::string& key); QDate date() const { return m_date; } QString dirName() const { return m_dirName; } + SignalControllersMap::iterator ctrls_end() { return m_ctrls.end(); } QString methodName() const { return m_methodName; } QString operatorName() const { return m_operatorName; } void readUserDataFromJSON(); -- 2.43.5