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

Unified Diff: src/plugin/PluginSettings.cpp

Issue 10825021: Move settings page into the application directory (Closed)
Patch Set: Fixed nit and removed copying of html directory Created June 4, 2013, 9:15 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
« no previous file with comments | « src/plugin/PluginClass.cpp ('k') | src/plugin/PluginTabBase.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginSettings.cpp
===================================================================
--- a/src/plugin/PluginSettings.cpp
+++ b/src/plugin/PluginSettings.cpp
@@ -99,49 +99,16 @@ CPluginSettings::CPluginSettings() :
if (!is.is_open())
{
TCHAR pf[MAX_PATH];
SHGetSpecialFolderPath(
0,
pf,
CSIDL_PROGRAM_FILESX86,
FALSE );
- //No files found, copy from the dll location
- CString pathToDll;
- DWORD pathResult = GetModuleFileNameW((HINSTANCE)&__ImageBase, pathToDll.GetBufferSetLength(MAX_PATH), MAX_PATH);
- if (pathResult > 0)
- {
- CString cpyPath;
- cpyPath = pathToDll.Left(pathToDll.ReverseFind('\\') + 1);
-
- BOOL res = CopyFile(cpyPath + SETTINGS_INI_FILE, GetDataPath(SETTINGS_INI_FILE), TRUE);
- res = CopyFile(cpyPath + DICTIONARY_INI_FILE, GetDataPath(DICTIONARY_INI_FILE), TRUE);
- res = CopyFile(cpyPath + SETTING_PAGE_INI_FILE, GetDataPath(SETTING_PAGE_INI_FILE), TRUE);
-
- SHFILEOPSTRUCT pFileStruct;
- ZeroMemory(&pFileStruct, sizeof(SHFILEOPSTRUCT));
- pFileStruct.hwnd = NULL;
- pFileStruct.wFunc = FO_COPY;
- WCHAR fromPath[MAX_PATH + 2];
- WCHAR toPath[MAX_PATH + 2];
-
- CString source = cpyPath + "html\\*";
- wcscpy(fromPath, source);
- fromPath[source.GetLength()] = '\0';
- fromPath[source.GetLength() + 1] = '\0';
-
- wcscpy(toPath, GetDataPath(L"html"));
- toPath[GetDataPath(L"html").GetLength()] = '\0';
- toPath[GetDataPath(L"html").GetLength() + 1] = '\0';
-
- pFileStruct.pFrom = fromPath;
- pFileStruct.pTo = toPath;
- pFileStruct.fFlags = FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR | FOF_NO_UI | FOF_RENAMEONCOLLISION;
- SHFileOperation(&pFileStruct);
- }
is.open(GetDataPath(SETTINGS_INI_FILE), std::ios_base::in);
if (!is.is_open())
{
m_isDirty = true;
}
else
{
is.close();
« no previous file with comments | « src/plugin/PluginClass.cpp ('k') | src/plugin/PluginTabBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld