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

Unified Diff: src/plugin/PluginUserSettings.cpp

Issue 11013110: Cleanup (Closed)
Patch Set: More beautification and addressing comments Created July 29, 2013, 12:13 p.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
« no previous file with comments | « src/plugin/PluginTabBase.cpp ('k') | src/plugin/PluginWbPassThrough.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
+}
- return iniFile.GetValue(sGetLanguage(), key);
+std::wstring sGetMessage(const std::string& key)
+{
+ Dictionary* dictionary = Dictionary::GetInstance();
+ return dictionary->Lookup("settings", key);
}
« no previous file with comments | « src/plugin/PluginTabBase.cpp ('k') | src/plugin/PluginWbPassThrough.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld