1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-25 16:43:33 +00:00

Move local variables in GUI code

This commit is contained in:
Andrei Kortunov 2024-01-09 16:11:44 +04:00
parent a0c0509e3f
commit fbd99583ca
7 changed files with 9 additions and 7 deletions

View File

@ -395,8 +395,10 @@ namespace MWGui
{ {
std::string suggestedName = mAlchemy->suggestPotionName(); std::string suggestedName = mAlchemy->suggestPotionName();
if (suggestedName != mSuggestedPotionName) if (suggestedName != mSuggestedPotionName)
{
mNameEdit->setCaptionWithReplacing(suggestedName); mNameEdit->setCaptionWithReplacing(suggestedName);
mSuggestedPotionName = suggestedName; mSuggestedPotionName = std::move(suggestedName);
}
mSortModel->clearDragItems(); mSortModel->clearDragItems();

View File

@ -1065,7 +1065,7 @@ namespace MWGui
{ {
createActiveFormats(newBook); createActiveFormats(newBook);
mBook = newBook; mBook = std::move(newBook);
setPage(newPage); setPage(newPage);
if (newPage < mBook->mPages.size()) if (newPage < mBook->mPages.size())

View File

@ -440,7 +440,7 @@ namespace MWGui
// If new search term reset position, otherwise continue from current position // If new search term reset position, otherwise continue from current position
if (newSearchTerm != mCurrentSearchTerm) if (newSearchTerm != mCurrentSearchTerm)
{ {
mCurrentSearchTerm = newSearchTerm; mCurrentSearchTerm = std::move(newSearchTerm);
mCurrentOccurrenceIndex = std::string::npos; mCurrentOccurrenceIndex = std::string::npos;
} }

View File

@ -221,7 +221,7 @@ namespace MWGui::Formatting
} }
} }
mAttributes[key] = value; mAttributes[key] = std::move(value);
} }
} }

View File

@ -472,7 +472,7 @@ namespace MWGui
ESM::EffectList effectList; ESM::EffectList effectList;
effectList.mList = mEffects; effectList.mList = mEffects;
mSpell.mEffects = effectList; mSpell.mEffects = std::move(effectList);
mSpell.mData.mCost = int(y); mSpell.mData.mCost = int(y);
mSpell.mData.mType = ESM::Spell::ST_Spell; mSpell.mData.mType = ESM::Spell::ST_Spell;
mSpell.mData.mFlags = 0; mSpell.mData.mFlags = 0;

View File

@ -172,7 +172,7 @@ namespace MWGui
w += 16; w += 16;
ToolTipInfo* tooltipInfo = image->getUserData<ToolTipInfo>(); ToolTipInfo* tooltipInfo = image->getUserData<ToolTipInfo>();
tooltipInfo->text = sourcesDescription; tooltipInfo->text = std::move(sourcesDescription);
// Fade out // Fade out
if (totalDuration >= fadeTime && fadeTime > 0.f) if (totalDuration >= fadeTime && fadeTime > 0.f)

View File

@ -251,7 +251,7 @@ namespace MWGui
if (!cost.empty() && cost != "0") if (!cost.empty() && cost != "0")
info.text info.text
+= MWGui::ToolTips::getValueString(MWMechanics::calcSpellCost(*spell), "#{sCastCost}"); += MWGui::ToolTips::getValueString(MWMechanics::calcSpellCost(*spell), "#{sCastCost}");
info.effects = effects; info.effects = std::move(effects);
tooltipSize = createToolTip(info); tooltipSize = createToolTip(info);
} }
else if (type == "Layout") else if (type == "Layout")