From 743c7beae7d024c92076d33dea325276bde840d2 Mon Sep 17 00:00:00 2001 From: Christian Schuett Date: Mon, 16 Mar 2015 10:23:32 +0100 Subject: [PATCH] timerd: remove unnecessary workarounds when saving events to file Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c11e75846b42ae9016832e8544fc2c0391ab5169 Author: Christian Schuett Date: 2015-03-16 (Mon, 16 Mar 2015) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/timerd/timermanager.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index f46a05bc8..ff6757cd0 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -438,8 +438,7 @@ void CTimerManager::loadEventsFromConfig() } else { - std::vector savedIDs; - savedIDs = config.getInt32Vector ("IDS"); + std::vector savedIDs = config.getInt32Vector("IDS"); dprintf("%d timer(s) in config\n", (int)savedIDs.size()); for(unsigned int i=0; i < savedIDs.size(); i++) { @@ -1019,19 +1018,11 @@ void CTimerEvent::printEvent(void) void CTimerEvent::saveToConfig(CConfigFile *config) { dprintf("CTimerEvent::saveToConfig\n"); - std::vector allIDs; - allIDs.clear(); - if (!(config->getString("IDS").empty())) - { - // sonst bekommen wir den bloeden 0er - allIDs=config->getInt32Vector("IDS"); - } + std::vector allIDs = config->getInt32Vector("IDS"); allIDs.push_back(eventID); - dprintf("adding %d to IDS\n",eventID); - //SetInt-Vector haengt komischerweise nur an, deswegen erst loeschen - config->setString("IDS",""); - config->setInt32Vector ("IDS",allIDs); + dprintf("adding %d to IDS\n", eventID); + config->setInt32Vector("IDS", allIDs); std::stringstream ostr; ostr << eventID;