mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 06:53:52 +00:00
reformating
This commit is contained in:
parent
4d6fb31610
commit
316debb827
1 changed files with 28 additions and 28 deletions
|
@ -26,34 +26,6 @@ void CSMWorld::ModifyCommand::undo()
|
|||
mModel.setData(mIndex, mOld);
|
||||
}
|
||||
|
||||
CSMWorld::CloneCommand::CloneCommand(CSMWorld::IdTable& model,
|
||||
const std::string& idOrigin,
|
||||
const std::string& IdDestination,
|
||||
const CSMWorld::UniversalId::Type type,
|
||||
QUndoCommand* parent) :
|
||||
QUndoCommand(parent),
|
||||
mModel(model),
|
||||
mIdOrigin(idOrigin),
|
||||
mIdDestination(Misc::StringUtils::lowerCase(IdDestination)),
|
||||
mType(type)
|
||||
{
|
||||
setText(("Clone record " + idOrigin + " to the " + IdDestination).c_str());
|
||||
}
|
||||
|
||||
void CSMWorld::CloneCommand::redo()
|
||||
{
|
||||
mModel.cloneRecord(mIdOrigin, mIdDestination, mType);
|
||||
|
||||
for (std::map<int, QVariant>::const_iterator iter(mValues.begin()); iter != mValues.end(); ++iter)
|
||||
mModel.setData(mModel.getModelIndex(mIdDestination, iter->first), iter->second);
|
||||
}
|
||||
|
||||
void CSMWorld::CloneCommand::undo()
|
||||
{
|
||||
mModel.removeRow(mModel.getModelIndex(mIdDestination, 0).row());
|
||||
}
|
||||
|
||||
|
||||
CSMWorld::CreateCommand::CreateCommand(IdTable& model, const std::string& id, QUndoCommand* parent)
|
||||
: QUndoCommand(parent), mModel(model), mId(id), mType(UniversalId::Type_None)
|
||||
{
|
||||
|
@ -174,4 +146,32 @@ void CSMWorld::ReorderRowsCommand::undo()
|
|||
|
||||
mModel.reorderRows(mBaseIndex, reverse);
|
||||
}
|
||||
|
||||
CSMWorld::CloneCommand::CloneCommand(CSMWorld::IdTable& model,
|
||||
const std::string& idOrigin,
|
||||
const std::string& IdDestination,
|
||||
const CSMWorld::UniversalId::Type type,
|
||||
QUndoCommand* parent) :
|
||||
QUndoCommand(parent),
|
||||
mModel(model),
|
||||
mIdOrigin(idOrigin),
|
||||
mIdDestination(Misc::StringUtils::lowerCase(IdDestination)),
|
||||
mType(type)
|
||||
{
|
||||
setText(("Clone record " + idOrigin + " to the " + IdDestination).c_str());
|
||||
}
|
||||
|
||||
void CSMWorld::CloneCommand::redo()
|
||||
{
|
||||
mModel.cloneRecord(mIdOrigin, mIdDestination, mType);
|
||||
|
||||
for (std::map<int, QVariant>::const_iterator iter(mValues.begin()); iter != mValues.end(); ++iter)
|
||||
mModel.setData(mModel.getModelIndex(mIdDestination, iter->first), iter->second);
|
||||
}
|
||||
|
||||
void CSMWorld::CloneCommand::undo()
|
||||
{
|
||||
mModel.removeRow(mModel.getModelIndex(mIdDestination, 0).row());
|
||||
}
|
||||
|
||||
// kate: indent-mode cstyle; indent-width 4; replace-tabs on;
|
||||
|
|
Loading…
Reference in a new issue