diff --git a/lib/libconfigfile/configfile.cpp b/lib/libconfigfile/configfile.cpp index 52830b3c0..4814cdda9 100644 --- a/lib/libconfigfile/configfile.cpp +++ b/lib/libconfigfile/configfile.cpp @@ -91,20 +91,22 @@ 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); + modifiedFlag = false; return true; } else @@ -387,6 +389,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 +404,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; } 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 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 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); }