Skip to content

Commit 12a2fc8

Browse files
committed
Persist setting path outside of the singleton.
1 parent 9a32e26 commit 12a2fc8

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/app/hideous_app.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
6868
GetModuleFileName(NULL, processPath, MAX_PATH);
6969
PathRemoveFileSpec(processPath);
7070

71-
SettingsManager::getInstance().persistSettingsPath(processPath);
71+
persistSettingsPath(processPath);
7272

7373
// Icons
7474
HICON hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APPICON));

src/common/settings.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ SettingsManager::SettingsManager()
142142
m_settings = loadSettings();
143143
}
144144

145-
bool SettingsManager::persistSettingsPath(const std::wstring &path)
145+
bool persistSettingsPath(const std::wstring &path)
146146
{
147147
HKEY hKey;
148148
LONG result = RegCreateKeyExW(
149-
HKEY_CURRENT_USER, // or HKEY_CURRENT_USER if preferred
149+
HKEY_CURRENT_USER,
150150
REG_KEY_PATH,
151151
0,
152152
NULL,

src/common/settings.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class SettingsManager
3434
const Settings &getSettings() const { return m_settings; }
3535
std::vector<std::wstring> getAvailableProfiles();
3636
bool switchToProfile(const std::wstring &profileName);
37-
bool persistSettingsPath(const std::wstring &path);
3837
std::wstring SettingsManager::currentProfile();
3938
std::wstring getAppPath();
4039

@@ -55,5 +54,6 @@ std::wstring trim(const std::wstring &str);
5554
std::wstring virtualKeyCodeToString(WORD vk);
5655
WORD stringToVirtualKeyCode(const std::wstring &str);
5756
std::vector<INPUT> convertStringToInput(const std::wstring &keyString);
57+
bool persistSettingsPath(const std::wstring &path);
5858

5959
extern std::unordered_map<std::wstring, WORD> keyMap;

0 commit comments

Comments
 (0)