moved app name to constructor to init only once

This commit is contained in:
Alekhya Kommuru 2020-01-17 14:23:07 -08:00
parent bf48729354
commit 197286c21e
2 changed files with 2 additions and 2 deletions

View File

@ -21,6 +21,7 @@ struct InvokeStruct
CPowerRenameMenu::CPowerRenameMenu()
{
ModuleAddRef();
app_name = GET_RESOURCE_STRING(IDS_POWERRENAME);
}
CPowerRenameMenu::~CPowerRenameMenu()
@ -197,7 +198,6 @@ DWORD WINAPI CPowerRenameMenu::s_PowerRenameUIThreadProc(_In_ void* pData)
HRESULT __stdcall CPowerRenameMenu::GetTitle(IShellItemArray* /*psiItemArray*/, LPWSTR* ppszName)
{
app_name = GET_RESOURCE_STRING(IDS_POWERRENAME);
return SHStrDup(app_name.c_str(), ppszName);
}

View File

@ -167,7 +167,6 @@ public:
// Return the display name of the powertoy, this will be cached
virtual PCWSTR get_name() override
{
app_name = GET_RESOURCE_STRING(IDS_POWERRENAME);
return app_name.c_str();
}
@ -301,6 +300,7 @@ public:
PowerRenameModule()
{
init_settings();
app_name = GET_RESOURCE_STRING(IDS_POWERRENAME);
}
~PowerRenameModule(){};