mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
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:
@@ -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";
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user