Standardize Image Resizer naming (#14694)

* Standardize Image Resizer naming

* Use no-throw methods

* Do not move if new dir already exist

* Update test files paths
This commit is contained in:
Stefan Markovic
2021-12-02 09:08:43 +01:00
committed by GitHub
parent 22f8390ef9
commit 87f6278bf9
22 changed files with 26 additions and 9 deletions

View File

@@ -7,5 +7,6 @@ namespace ImageResizerConstants
inline const std::wstring ModuleKey = L"Image Resizer";
// Name of the ImageResizer save folder.
inline const std::wstring ModuleSaveFolderKey = L"ImageResizer";
inline const std::wstring ModuleOldSaveFolderKey = L"ImageResizer";
inline const std::wstring ModuleSaveFolderKey = L"Image Resizer";
}

View File

@@ -40,7 +40,7 @@ BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", COMPANY_NAME
VALUE "FileDescription", "ImageResizer PowerToy"
VALUE "FileDescription", "Image Resizer PowerToy"
VALUE "FileVersion", FILE_VERSION_STRING
VALUE "InternalName", "ImageResizerExt.dll"
VALUE "LegalCopyright", COPYRIGHT_NOTE

View File

@@ -45,8 +45,16 @@ namespace
CSettings::CSettings()
{
std::wstring result = PTSettingsHelper::get_module_save_folder_location(ImageResizerConstants::ModuleSaveFolderKey);
jsonFilePath = result + std::wstring(c_imageResizerDataFilePath);
std::wstring oldSavePath = PTSettingsHelper::get_module_save_folder_location(ImageResizerConstants::ModuleOldSaveFolderKey);
std::wstring savePath = PTSettingsHelper::get_module_save_folder_location(ImageResizerConstants::ModuleSaveFolderKey);
std::error_code ec;
if (std::filesystem::exists(oldSavePath, ec))
{
std::filesystem::copy(oldSavePath, savePath, std::filesystem::copy_options::recursive, ec);
std::filesystem::remove_all(oldSavePath, ec);
}
jsonFilePath = savePath + std::wstring(c_imageResizerDataFilePath);
Load();
}