From 3f900c5587dd21b4c6bc825fbd3b67a6bca6475d Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Fri, 22 Feb 2013 17:16:43 +0100 Subject: [PATCH 1/6] channellist: initialize values to satisfy valgrind Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b0c7ca94a7ab4ff32334da58c09cc86abe66bd37 Author: Stefan Seyfried Date: 2013-02-22 (Fri, 22 Feb 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index d70859c64..f8437f611 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2158,6 +2158,7 @@ void CChannelList::paint_events(int index) evt.description = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS); evt.eventID = 0; + evt.startTime = 0; evtlist.push_back(evt); } @@ -2218,6 +2219,7 @@ void CChannelList::readEvents(const t_channel_id channel_id) CChannelEvent evt; evt.description = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS); evt.eventID = 0; + evt.startTime = 0; evtlist.push_back(evt); } else From 32b4ee678f319e90354001728460c1dc9cc3c639 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Fri, 22 Feb 2013 17:17:05 +0100 Subject: [PATCH 2/6] infoviewer_bb: initialize values to satisfy valgrind Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a410dabcdb3b2ace2c91e611a6fe9de678b112ea Author: Stefan Seyfried Date: 2013-02-22 (Fri, 22 Feb 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer_bb.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 82f53c622..131c0a506 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -106,6 +106,7 @@ void CInfoViewerBB::Init() for (int i = 0; i < CInfoViewerBB::BUTTON_MAX; i++) { tmp_bbButtonInfoText[i] = ""; + bbButtonInfo[i].x = -1; } // get HDD info in a separate thread From c63da7e9a9d9867cb235f27984623392355d3553 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 23 Feb 2013 15:34:47 +0100 Subject: [PATCH 3/6] configfile: set the modified flag correctly on set*Vector methods Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/07a8027b4d99f3dda11944dcdc226a7a6cb3adfd Author: Stefan Seyfried Date: 2013-02-23 (Sat, 23 Feb 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libconfigfile/configfile.cpp | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/lib/libconfigfile/configfile.cpp b/lib/libconfigfile/configfile.cpp index 52830b3c0..67848ead5 100644 --- a/lib/libconfigfile/configfile.cpp +++ b/lib/libconfigfile/configfile.cpp @@ -387,6 +387,9 @@ void CConfigFile::setString(const std::string & key, const std::string & val) void CConfigFile::setInt32Vector(const std::string & key, const std::vector vec) { + bool tmpUnknownKeyQueryedFlag = unknownKeyQueryedFlag; + unknownKeyQueryedFlag = false; + std::string oldVal = getString(key); std::stringstream s; for (std::vector::const_iterator it = vec.begin(); ; ) @@ -399,21 +402,35 @@ void CConfigFile::setInt32Vector(const std::string & key, const std::vector> configData[key]; + if (oldVal != s.str() || unknownKeyQueryedFlag) + { + modifiedFlag = true; + configData[key] = s.str(); + } + unknownKeyQueryedFlag = tmpUnknownKeyQueryedFlag; } void CConfigFile::setStringVector(const std::string & key, const std::vector vec) { - configData[key] = ""; + bool tmpUnknownKeyQueryedFlag = unknownKeyQueryedFlag; + unknownKeyQueryedFlag = false; + std::string oldVal = getString(key); + std::string newVal = ""; for (std::vector::const_iterator it = vec.begin(); ; ) { if (it == vec.end()) break; - configData[key] += *it; + newVal += *it; ++it; if (it == vec.end()) break; - configData[key] += delimiter; + newVal += delimiter; } + if (oldVal != newVal || unknownKeyQueryedFlag) + { + modifiedFlag = true; + configData[key] = newVal; + } + unknownKeyQueryedFlag = tmpUnknownKeyQueryedFlag; } From 6a1032441798cf5d50d77beb11be459df3345072 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 23 Feb 2013 15:36:02 +0100 Subject: [PATCH 4/6] configfile: reset modified flag after saving Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/809db6211e0509903e2d50bcd86483cc8a395b18 Author: Stefan Seyfried Date: 2013-02-23 (Sat, 23 Feb 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libconfigfile/configfile.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libconfigfile/configfile.cpp b/lib/libconfigfile/configfile.cpp index 67848ead5..4c303cde7 100644 --- a/lib/libconfigfile/configfile.cpp +++ b/lib/libconfigfile/configfile.cpp @@ -105,6 +105,7 @@ bool CConfigFile::saveConfig(const char * const filename) chmod(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + modifiedFlag = false; return true; } else From 66a4c73f2d5295a551dc795494811f8391e86df2 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 23 Feb 2013 15:42:22 +0100 Subject: [PATCH 5/6] configfile: don't do a full sync() after saving Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/804bed4e733d3f000228f86cec2646dae7b7543f Author: Stefan Seyfried Date: 2013-02-23 (Sat, 23 Feb 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libconfigfile/configfile.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libconfigfile/configfile.cpp b/lib/libconfigfile/configfile.cpp index 4c303cde7..4814cdda9 100644 --- a/lib/libconfigfile/configfile.cpp +++ b/lib/libconfigfile/configfile.cpp @@ -91,17 +91,18 @@ bool CConfigFile::loadConfig(const std::string & filename) bool CConfigFile::saveConfig(const char * const filename) { - std::ofstream configFile(filename); + std::fstream configFile(filename); if (configFile != NULL) { + std::cout << "[ConfigFile] saving " << filename << std::endl; for (ConfigDataMap::const_iterator it = configData.begin(); it != configData.end(); ++it) { configFile << it->first << "=" << it->second << std::endl; } + configFile.sync(); configFile.close(); - sync(); chmod(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); From ef0196c06d36e7add8f98336fc8f436ba3646d07 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 23 Feb 2013 15:49:06 +0100 Subject: [PATCH 6/6] femanager: remove workaround after libconfigfile fix Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/05fdc3c08dc19362577edb50da09d7c9668a867f Author: Stefan Seyfried Date: 2013-02-23 (Sat, 23 Feb 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/src/femanager.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/zapit/src/femanager.cpp b/src/zapit/src/femanager.cpp index 20e8f0b8d..468edb6c6 100644 --- a/src/zapit/src/femanager.cpp +++ b/src/zapit/src/femanager.cpp @@ -263,8 +263,7 @@ void CFEManager::saveSettings(bool write) sprintf(cfg_key, "fe%d_satellites", fe->fenumber); configfile.setInt32Vector(cfg_key, satList); } - //setInt32Vector dont set modified flag ! - if (write /*&& configfile.getModifiedFlag()*/) { + if (write && configfile.getModifiedFlag()) { config_exist = configfile.saveConfig(FECONFIGFILE); //configfile.setModifiedFlag(false); }