mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-25 17:21:27 -05:00
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:
parent
fc78f6c7ac
commit
13ac670eec
@ -615,6 +615,14 @@ void p3ConfigMgr::addConfiguration(std::string file, pqiConfig *conf)
|
|||||||
filename += file;
|
filename += file;
|
||||||
|
|
||||||
conf->setFilename(filename);
|
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;
|
configs[conf->Type()] = conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1174,7 +1182,7 @@ p3GeneralConfig::p3GeneralConfig()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// General Configuration System
|
// General Configuration System
|
||||||
std::string p3GeneralConfig::getSetting(std::string opt)
|
std::string p3GeneralConfig::getSetting(const std::string &opt)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
std::cerr << "p3GeneralConfig::getSetting(" << opt << ")";
|
std::cerr << "p3GeneralConfig::getSetting(" << opt << ")";
|
||||||
@ -1192,29 +1200,29 @@ std::string p3GeneralConfig::getSetting(std::string opt)
|
|||||||
return it->second;
|
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
|
#ifdef CONFIG_DEBUG
|
||||||
std::cerr << "p3GeneralConfig::setSetting(" << opt << " = " << val << ")";
|
std::cerr << "p3GeneralConfig::setSetting(" << opt << " = " << val << ")";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#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)
|
RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/
|
||||||
{
|
|
||||||
/* no change */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
settings[opt] = val;
|
/* extract from config */
|
||||||
}
|
std::map<std::string, std::string>::iterator it;
|
||||||
/* outside mutex */
|
if (settings.end() != (it = settings.find(opt)))
|
||||||
|
{
|
||||||
|
if (it->second == val)
|
||||||
|
{
|
||||||
|
/* no change */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
settings[opt] = val;
|
||||||
|
}
|
||||||
|
/* outside mutex */
|
||||||
IndicateConfigChanged();
|
IndicateConfigChanged();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -382,8 +382,8 @@ class p3GeneralConfig: public p3Config
|
|||||||
p3GeneralConfig();
|
p3GeneralConfig();
|
||||||
|
|
||||||
// General Configuration System
|
// General Configuration System
|
||||||
std::string getSetting(std::string opt);
|
std::string getSetting(const std::string &opt);
|
||||||
void setSetting(std::string opt, std::string val);
|
void setSetting(const std::string &opt, const std::string &val);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#include "p3FeedReader.h"
|
#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_FEED = 0x02;
|
||||||
const uint8_t RS_PKT_SUBTYPE_FEEDREADER_MSG = 0x03;
|
const uint8_t RS_PKT_SUBTYPE_FEEDREADER_MSG = 0x03;
|
||||||
|
@ -80,13 +80,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="checkAdvanced_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>Enable Experimental Features (Restart Required)</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user