Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/plugin/PluginUserSettings.cpp

Issue 11013110: Cleanup (Closed)
Patch Set: Created July 5, 2013, 3:28 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/plugin/PluginUserSettings.cpp
===================================================================
--- a/src/plugin/PluginUserSettings.cpp
+++ b/src/plugin/PluginUserSettings.cpp
@@ -3,7 +3,7 @@
#include <algorithm>
#include "PluginSettings.h"
#include "PluginClient.h"
-#include "PluginIniFileW.h"
+#include "../shared/Dictionary.h"
static const CString s_GetMessage = L"GetMessage";
static const CString s_GetLanguageCount = L"GetLanguageCount";
@@ -93,34 +93,20 @@
static CString sGetLanguage()
{
CPluginSettings* settings = CPluginSettings::GetInstance();
-
- return settings->GetString(SETTING_LANGUAGE);
-}
-
-
-static bool sReadSettingsPageFile(CPluginIniFileW& iniFile)
-{
- return iniFile.HasSection(sGetLanguage());
-}
-
-
-static CPluginIniFileW& sReadSettingsPageFile(bool& readOK)
-{
- static CPluginIniFileW iniFile(CPluginSettings::GetDataPath(SETTING_PAGE_INI_FILE));
- static bool s_readOK = iniFile.Read();
-
- readOK = s_readOK;
-
- return iniFile;
+ return settings->GetSubscription();
}
CStringW sGetMessage(const CString& key)
{
- bool readOK = false;
- CPluginIniFileW& iniFile = sReadSettingsPageFile(readOK);
+ Dictionary* dictionary = Dictionary::GetInstance();
+ return CString(dictionary->Lookup("settings", std::string(CW2A(key))).c_str());
Wladimir Palant 2013/07/05 09:26:45 CString => CStringW here to match return type?
+}
- return iniFile.GetValue(sGetLanguage(), key);
+std::wstring sGetMessage(const std::string& key)
+{
+ Dictionary* dictionary = Dictionary::GetInstance();
+ return dictionary->Lookup("settings", key);
}

Powered by Google App Engine
This is Rietveld