From: Michal Maly Date: Sat, 2 Aug 2014 07:48:27 +0000 (+0200) Subject: Eradicate unordered_maps, round 2 X-Git-Tag: 0.3d~1 X-Git-Url: https://gitweb.devoid-pointer.net/?a=commitdiff_plain;h=3b9099ae6a16ae2222b5b0d06e66301a912524c0;p=anyanka.git Eradicate unordered_maps, round 2 --- 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();