Core: Minot Ini refactoring

git-svn-id: svn://ultimatepp.org/upp/trunk@9181 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-11-12 14:59:16 +00:00
parent ac6ccfdb3e
commit aae63d1385
2 changed files with 14 additions and 15 deletions

View file

@ -124,19 +124,6 @@ String GetIniFile()
static VectorMap<String, String>& sIniKeys()
{
static VectorMap<String, String> key;
return key;
}
VectorMap<String, String> GetIniKeys()
{
Mutex::Lock __(sMtx);
return VectorMap<String, String>(sIniKeys(), 0);
}
String GetIniKey(const char *id, const String& def) {
ASSERT_(IsMainRunning(), "GetIniKey is allowed only after APP_MAIN has started");
Mutex::Lock __(sMtx);
VectorMap<String, String>& key = sIniKeys();
static int version;
if(version != ini_version__) {
version = ini_version__;
@ -152,7 +139,19 @@ String GetIniKey(const char *id, const String& def) {
key = LoadIniFile(GetHomeDirFile("q.ini"));
#endif
}
return key.Get(id, def);
return key;
}
VectorMap<String, String> GetIniKeys()
{
Mutex::Lock __(sMtx);
return clone(sIniKeys());
}
String GetIniKey(const char *id, const String& def) {
ASSERT_(IsMainRunning(), "GetIniKey is allowed only after APP_MAIN has started");
Mutex::Lock __(sMtx);
return sIniKeys().Get(id, def);
}
String GetIniKey(const char *id)

View file

@ -112,7 +112,7 @@ class ImageDraw : public SystemDraw {
void FetchStraight(ImageBuffer& b) const;
public:
Draw& Alpha();
Draw& Alpha();
operator Image() const;