diff options
| author | Tannin <devnull@localhost> | 2014-11-21 15:07:31 +0100 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2014-11-21 15:07:31 +0100 |
| commit | 45a46778fb9c7195cb09fbba4a2c502dca6bca13 (patch) | |
| tree | c304a6ffa3412fa66edab50fd293cc7fd13faaa9 /src/shared/fallout3info.cpp | |
| parent | cfb863f6c3ae7406028b9e167a3115250fefbca3 (diff) | |
| parent | f2f9e11fdd876821107cff0c1c5b9d8ecf66691f (diff) | |
Merge
Diffstat (limited to 'src/shared/fallout3info.cpp')
| -rw-r--r-- | src/shared/fallout3info.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/shared/fallout3info.cpp b/src/shared/fallout3info.cpp index 9487d2de..82b285b7 100644 --- a/src/shared/fallout3info.cpp +++ b/src/shared/fallout3info.cpp @@ -54,15 +54,17 @@ std::wstring Fallout3Info::getRegPathStatic() 0, KEY_QUERY_VALUE, &key);
if (errorcode != ERROR_SUCCESS) {
- return L"";
+ return std::wstring();
}
WCHAR temp[MAX_PATH];
DWORD bufferSize = MAX_PATH;
- errorcode = ::RegQueryValueExW(key, L"Installed Path", NULL, NULL, (LPBYTE)temp, &bufferSize);
-
- return std::wstring(temp);
+ if (::RegQueryValueExW(key, L"Installed Path", NULL, NULL, (LPBYTE)temp, &bufferSize) == ERROR_SUCCESS) {
+ return std::wstring(temp);
+ } else {
+ return std::wstring();
+ }
}
std::wstring Fallout3Info::getInvalidationBSA()
@@ -233,15 +235,12 @@ void Fallout3Info::createProfile(const std::wstring &directory, bool useDefaults }
}
{ // copy falloutprefs.ini-file
- std::wstring target = directory.substr().append(L"\\falloutprefs.ini");
+ std::wstring target = directory + L"\\falloutprefs.ini";
if (!FileExists(target)) {
- std::wostringstream source;
- source << getMyGamesDirectory() << L"\\Fallout3\\falloutprefs.ini";
- if (!::CopyFileW(source.str().c_str(), target.c_str(), true)) {
+ std::wstring source = getMyGamesDirectory() + L"\\Fallout3\\falloutprefs.ini";
+ if (!::CopyFileW(source.c_str(), target.c_str(), true)) {
if (::GetLastError() != ERROR_FILE_EXISTS) {
- std::ostringstream stream;
- stream << "failed to copy ini file: " << ToString(source.str(), false);
- throw windows_error(stream.str());
+ throw windows_error(std::string("failed to copy ini file: ") + ToString(source, false));
}
}
}
@@ -268,7 +267,7 @@ bool Fallout3Info::rerouteToProfile(const wchar_t *fileName, const wchar_t*) }
-std::vector<ExecutableInfo> Fallout3Info::getExecutables()
+/*std::vector<ExecutableInfo> Fallout3Info::getExecutables()
{
std::vector<ExecutableInfo> result;
result.push_back(ExecutableInfo(L"FOSE", L"fose_loader.exe", L"", L"", DEFAULT_CLOSE));
@@ -279,5 +278,5 @@ std::vector<ExecutableInfo> Fallout3Info::getExecutables() result.push_back(ExecutableInfo(L"BOSS", L"BOSS/BOSS.exe", L"", L"", NEVER_CLOSE));
return result;
-}
+}*/
} // namespace MOShared
|
