Move frequent locations to separate XML file - #622
Conversation
|
Hi ph10w, thanks for working on this. I think the motivation here makes sense, given that locations will typically be tied to a single machine. To merge this, I'll also add some comments on the code itself. |
| 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"; |
There was a problem hiding this comment.
The filename here definitely needs to change. The name config.xml was a bad choice and should really be changed, but new files should use a clearer naming scheme. Perhaps explorer++_frequent_locations.xml.
| return configFilePath.c_str(); | ||
| } | ||
|
|
||
| std::wstring GetFrequentLocationsFilePath() |
There was a problem hiding this comment.
I think GetConfigFilePath should probably be refactored so that it takes a filename of a config file and returns the path. Something like GetPathForXmlStorageFile. GetConfigFilePath and GetFrequentLocationsFilePath can then both call that.
| ASSERT_TRUE(path.ends_with(L"config.xml")); | ||
| } | ||
|
|
||
| TEST(StorageTest, FrequentLocationsFilePath) |
There was a problem hiding this comment.
With the change above, GetFrequentLocationsFilePath would be a simple wrapper, so there would be no need for this test.
Summary
frequent_locations.xmlfile when XML preferences are enabledconfig.xmlwhen the new file does not exist, allowing it to migrate on the next saveconfig.xmllocation, including whenEXPLORERPP_CONFIGis usedMotivation
Frequent locations are machine-specific usage data rather than portable application preferences. Keeping them in
config.xmlmakes that file less suitable for reuse on another PC.User impact
Users can copy
config.xmlbetween machines without also copying their frequent-location history. Existing XML configurations migrate automatically without losing their current frequent locations.Validation
Explorer++inRelease|x64TestExplorer++inRelease|x64FrequentLocations*testsStorageTest.ConfigEnvVarandStorageTest.FrequentLocationsFilePath