-
-
Notifications
You must be signed in to change notification settings - Fork 425
Move frequent locations to separate XML file #622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,9 @@ inline const wchar_t CONFIG_FILE_FILENAME[] = L"config.xml"; | |
| inline const wchar_t CONFIG_FILE_ROOT_NODE_NAME[] = L"ExplorerPlusPlus"; | ||
| inline const wchar_t CONFIG_FILE_SETTINGS_NODE_NAME[] = L"Settings"; | ||
| inline const wchar_t CONFIG_FILE_ENV_VAR_NAME[] = L"EXPLORERPP_CONFIG"; | ||
| inline const wchar_t FREQUENT_LOCATIONS_FILE_FILENAME[] = L"frequent_locations.xml"; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The filename here definitely needs to change. The name |
||
|
|
||
| std::wstring GetConfigFilePath(); | ||
| std::wstring GetFrequentLocationsFilePath(); | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,3 +25,21 @@ TEST(StorageTest, ConfigEnvVar) | |
| path = Storage::GetConfigFilePath(); | ||
| ASSERT_TRUE(path.ends_with(L"config.xml")); | ||
| } | ||
|
|
||
| TEST(StorageTest, FrequentLocationsFilePath) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the change above, |
||
| { | ||
| auto set = SetEnvironmentVariable(Storage::CONFIG_FILE_ENV_VAR_NAME, NULL); | ||
| ASSERT_TRUE(set); | ||
| auto path = Storage::GetFrequentLocationsFilePath(); | ||
| ASSERT_TRUE(path.ends_with(L"frequent_locations.xml")); | ||
|
|
||
| set = SetEnvironmentVariable(L"FOO", L"BAR"); | ||
| ASSERT_TRUE(set); | ||
| set = SetEnvironmentVariable(Storage::CONFIG_FILE_ENV_VAR_NAME, L"%FOO%\\explorerpp.xml"); | ||
| ASSERT_TRUE(set); | ||
| path = Storage::GetFrequentLocationsFilePath(); | ||
| ASSERT_EQ(path, L"BAR\\frequent_locations.xml"); | ||
|
|
||
| set = SetEnvironmentVariable(Storage::CONFIG_FILE_ENV_VAR_NAME, NULL); | ||
| ASSERT_TRUE(set); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
GetConfigFilePathshould probably be refactored so that it takes a filename of a config file and returns the path. Something likeGetPathForXmlStorageFile.GetConfigFilePathandGetFrequentLocationsFilePathcan then both call that.