Changed config type of the FeedReader. There was a conflict with general config.

Added warning in p3ConfigMgr::addConfiguration when a config type is used twice.
Removed checkbox for "Experimental Features" in general page without function.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6027 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-12-22 00:02:40 +00:00
parent fc78f6c7ac
commit 13ac670eec
4 changed files with 28 additions and 27 deletions

View File

@ -615,6 +615,14 @@ void p3ConfigMgr::addConfiguration(std::string file, pqiConfig *conf)
filename += file;
conf->setFilename(filename);
std::map<uint32_t, pqiConfig *>::iterator cit = configs.find(conf->Type());
if (cit != configs.end())
{
std::cerr << "p3Config::addConfiguration() WARNING: type " << conf->Type();
std::cerr << " with filename " << filename;
std::cerr << " already added with filename " << cit->second->Filename() << std::endl;
}
configs[conf->Type()] = conf;
}
@ -1174,7 +1182,7 @@ p3GeneralConfig::p3GeneralConfig()
}
// General Configuration System
std::string p3GeneralConfig::getSetting(std::string opt)
std::string p3GeneralConfig::getSetting(const std::string &opt)
{
#ifdef CONFIG_DEBUG
std::cerr << "p3GeneralConfig::getSetting(" << opt << ")";
@ -1192,29 +1200,29 @@ std::string p3GeneralConfig::getSetting(std::string opt)
return it->second;
}
void p3GeneralConfig::setSetting(std::string opt, std::string val)
void p3GeneralConfig::setSetting(const std::string &opt, const std::string &val)
{
#ifdef CONFIG_DEBUG
std::cerr << "p3GeneralConfig::setSetting(" << opt << " = " << val << ")";
std::cerr << std::endl;
#endif
{
RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/
/* extract from config */
std::map<std::string, std::string>::iterator it;
if (settings.end() != (it = settings.find(opt)))
{
if (it->second == val)
{
/* no change */
return;
}
}
RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/
settings[opt] = val;
}
/* outside mutex */
/* extract from config */
std::map<std::string, std::string>::iterator it;
if (settings.end() != (it = settings.find(opt)))
{
if (it->second == val)
{
/* no change */
return;
}
}
settings[opt] = val;
}
/* outside mutex */
IndicateConfigChanged();
return;

View File

@ -382,8 +382,8 @@ class p3GeneralConfig: public p3Config
p3GeneralConfig();
// General Configuration System
std::string getSetting(std::string opt);
void setSetting(std::string opt, std::string val);
std::string getSetting(const std::string &opt);
void setSetting(const std::string &opt, const std::string &val);
protected:

View File

@ -28,7 +28,7 @@
#include "p3FeedReader.h"
const uint32_t CONFIG_TYPE_FEEDREADER = 0x0001; // is this correct?
const uint32_t CONFIG_TYPE_FEEDREADER = 0xf001; // is this correct?
const uint8_t RS_PKT_SUBTYPE_FEEDREADER_FEED = 0x02;
const uint8_t RS_PKT_SUBTYPE_FEEDREADER_MSG = 0x03;

View File

@ -80,13 +80,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkAdvanced_2">
<property name="text">
<string>Enable Experimental Features (Restart Required)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>