Editor/Undo: Mark relevant variables as maybe unused

Prevents potential warnings on release mode.
This commit is contained in:
Lioncache
2025-12-07 02:30:02 -05:00
parent deb1aaae01
commit f577335087
4 changed files with 9 additions and 9 deletions

View File

@@ -35,11 +35,11 @@ public:
protected:
void DoMove(const TString& rkPath, bool IsAutoDir)
{
TString ResName = mpEntry->CookedAssetPath(true).GetFileName();
const TString ResName = mpEntry->CookedAssetPath(true).GetFileName();
gpEdApp->ResourceBrowser()->ResourceAboutToBeMoved(mpEntry, TO_QSTRING(rkPath + ResName));
CVirtualDirectory *pOldDir = mpEntry->Directory();
bool Success = mpEntry->Move(rkPath, IsAutoDir);
[[maybe_unused]] const bool Success = mpEntry->Move(rkPath, IsAutoDir);
ASSERT(Success); // todo better error handling
gpEdApp->ResourceBrowser()->ResourceMoved(mpEntry, pOldDir, mpEntry->Name());

View File

@@ -29,11 +29,11 @@ public:
protected:
void DoMove(const TString& rkName)
{
QString ParentPath = TO_QSTRING(mpDir->Parent() ? mpDir->Parent()->FullPath() : "");
const QString ParentPath = TO_QSTRING(mpDir->Parent() ? mpDir->Parent()->FullPath() : "");
gpEdApp->ResourceBrowser()->DirectoryAboutToBeMoved(mpDir, ParentPath + TO_QSTRING(rkName));
TString OldName = mpDir->Name();
bool Success = mpDir->Rename(rkName);
const TString OldName = mpDir->Name();
[[maybe_unused]] const bool Success = mpDir->Rename(rkName);
ASSERT(Success);
gpEdApp->ResourceBrowser()->DirectoryMoved(mpDir, mpDir->Parent(), OldName);

View File

@@ -31,11 +31,11 @@ public:
protected:
void DoMove(const TString& rkName, bool IsAutoName)
{
TString FullNewName = rkName + "." + mpEntry->CookedExtension().ToString();
const TString FullNewName = rkName + "." + mpEntry->CookedExtension().ToString();
gpEdApp->ResourceBrowser()->ResourceAboutToBeMoved(mpEntry, TO_QSTRING(mpEntry->Directory()->FullPath() + FullNewName));
TString OldName = mpEntry->Name();
bool Success = mpEntry->Rename(rkName, IsAutoName);
const TString OldName = mpEntry->Name();
[[maybe_unused]] const bool Success = mpEntry->Rename(rkName, IsAutoName);
ASSERT(Success);
gpEdApp->ResourceBrowser()->ResourceMoved(mpEntry, mpEntry->Directory(), OldName);

View File

@@ -46,7 +46,7 @@ protected:
if (mpDir->IsEmpty(true))
{
gpEdApp->ResourceBrowser()->DirectoryAboutToBeDeleted(mpDir);
bool DeleteSuccess = mpDir->Delete();
[[maybe_unused]] const bool DeleteSuccess = mpDir->Delete();
ASSERT(DeleteSuccess);
gpEdApp->ResourceBrowser()->DirectoryDeleted();