mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 12:35:46 +00:00
Use move semantics for tools
This commit is contained in:
parent
a41259cca8
commit
737d3b499b
@ -85,7 +85,7 @@ namespace ESSImport
|
||||
Misc::StringUtils::lowerCaseInPlace(group);
|
||||
|
||||
ESM::AnimationState::ScriptedAnimation scriptedAnim;
|
||||
scriptedAnim.mGroup = group;
|
||||
scriptedAnim.mGroup = std::move(group);
|
||||
scriptedAnim.mTime = anis.mTime;
|
||||
scriptedAnim.mAbsolute = true;
|
||||
// Neither loop count nor queueing seems to be supported by the ess format.
|
||||
|
@ -306,12 +306,12 @@ namespace ESSImport
|
||||
mMarkers.push_back(marker);
|
||||
}
|
||||
|
||||
newcell.mRefs = cellrefs;
|
||||
newcell.mRefs = std::move(cellrefs);
|
||||
|
||||
if (cell.isExterior())
|
||||
mExtCells[std::make_pair(cell.mData.mX, cell.mData.mY)] = newcell;
|
||||
mExtCells[std::make_pair(cell.mData.mX, cell.mData.mY)] = std::move(newcell);
|
||||
else
|
||||
mIntCells[cell.mName] = newcell;
|
||||
mIntCells[cell.mName] = std::move(newcell);
|
||||
}
|
||||
|
||||
void ConvertCell::writeCell(const Cell& cell, ESM::ESMWriter& esm)
|
||||
|
@ -624,7 +624,7 @@ bool CSMFilter::Parser::parse(const std::string& filter, bool allowPredefined)
|
||||
}
|
||||
|
||||
if (node)
|
||||
mFilter = node;
|
||||
mFilter = std::move(node);
|
||||
else
|
||||
{
|
||||
// Empty filter string equals to filter "true".
|
||||
|
@ -171,7 +171,7 @@ void CSMTools::ReportModel::flagAsReplaced(int index)
|
||||
|
||||
hint[0] = 'r';
|
||||
|
||||
line.mHint = hint;
|
||||
line.mHint = std::move(hint);
|
||||
|
||||
emit dataChanged(this->index(index, 0), this->index(index, columnCount()));
|
||||
}
|
||||
|
@ -468,13 +468,13 @@ namespace CSMWorld
|
||||
if (type == UniversalId::Type_Creature)
|
||||
{
|
||||
// Valid creature record
|
||||
setupCreature(id, data);
|
||||
setupCreature(id, std::move(data));
|
||||
emit actorChanged(id);
|
||||
}
|
||||
else if (type == UniversalId::Type_Npc)
|
||||
{
|
||||
// Valid npc record
|
||||
setupNpc(id, data);
|
||||
setupNpc(id, std::move(data));
|
||||
emit actorChanged(id);
|
||||
}
|
||||
else
|
||||
@ -665,7 +665,7 @@ namespace CSMWorld
|
||||
RaceDataPtr data = mCachedRaces.get(race);
|
||||
if (data)
|
||||
{
|
||||
setupRace(race, data);
|
||||
setupRace(race, std::move(data));
|
||||
// Race was changed. Need to mark actor dependencies as dirty.
|
||||
// Cannot use markDirtyDependency because that would invalidate
|
||||
// the current iterator.
|
||||
@ -683,7 +683,7 @@ namespace CSMWorld
|
||||
ActorDataPtr data = mCachedActors.get(actor);
|
||||
if (data)
|
||||
{
|
||||
setupActor(actor, data);
|
||||
setupActor(actor, std::move(data));
|
||||
}
|
||||
}
|
||||
mDirtyActors.clear();
|
||||
|
@ -504,7 +504,7 @@ namespace CSMWorld
|
||||
|
||||
auto record2 = std::make_unique<Record<ESXRecordT>>();
|
||||
record2->mState = Record<ESXRecordT>::State_ModifiedOnly;
|
||||
record2->mModified = record;
|
||||
record2->mModified = std::move(record);
|
||||
|
||||
insertRecord(std::move(record2), getAppendIndex(id, type), type);
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ void CSVWorld::TableSubView::createFilterRequest(std::vector<CSMWorld::Universal
|
||||
|
||||
CSVFilter::FilterData filterData;
|
||||
filterData.searchData = qData;
|
||||
filterData.columns = searchColumns;
|
||||
filterData.columns = std::move(searchColumns);
|
||||
|
||||
sourceFilterByValue.emplace_back(filterData);
|
||||
|
||||
|
@ -810,8 +810,7 @@ bool Wizard::UnshieldWorker::extractFile(
|
||||
if (!dir.mkpath(path))
|
||||
return false;
|
||||
|
||||
QString fileName(path);
|
||||
fileName.append(QString::fromUtf8(unshield_file_name(unshield, index)));
|
||||
path.append(QString::fromUtf8(unshield_file_name(unshield, index)));
|
||||
|
||||
// Calculate the percentage done
|
||||
int progress = (((float)counter / (float)unshield_file_count(unshield)) * 100);
|
||||
@ -825,13 +824,13 @@ bool Wizard::UnshieldWorker::extractFile(
|
||||
emit textChanged(tr("Extracting: %1").arg(QString::fromUtf8(unshield_file_name(unshield, index))));
|
||||
emit progressChanged(progress);
|
||||
|
||||
QByteArray array(fileName.toUtf8());
|
||||
QByteArray array(path.toUtf8());
|
||||
success = unshield_file_save(unshield, index, array.constData());
|
||||
|
||||
if (!success)
|
||||
{
|
||||
qDebug() << "error";
|
||||
dir.remove(fileName);
|
||||
dir.remove(path);
|
||||
}
|
||||
|
||||
return success;
|
||||
|
Loading…
x
Reference in New Issue
Block a user