Cleanup and slight change to pathgrid editing controls.

Now that there is a drag indicator, it is easy to tell if an
operation is active or not.
coverity_scan^2
Aesylwinn 9 years ago
parent 5eaaed05fc
commit cc4655e9c7

@ -36,6 +36,7 @@ CSMWorld::ModifyCommand::ModifyCommand (QAbstractItemModel& model, const QModelI
{
IdTree& tree = static_cast<CSMWorld::IdTree&>(*mModel);
// ModifyNestedCommand will add its own command to change the modify status if needed
mModifyNestedCommand = new ModifyNestedCommand(tree, mIndex, new_, this);
setText(mModifyNestedCommand->text());
}
@ -48,12 +49,7 @@ CSMWorld::ModifyCommand::ModifyCommand (QAbstractItemModel& model, const QModelI
{
mHasRecordState = true;
int stateColumnIndex = table->findColumnIndex(Columns::ColumnId_Modification);
int rowIndex = mIndex.row();
if (mIndex.parent().isValid())
{
rowIndex = mIndex.parent().row();
}
mRecordStateIndex = table->index(rowIndex, stateColumnIndex);
mOldRecordState = static_cast<CSMWorld::RecordBase::State>(table->data(mRecordStateIndex).toInt());

@ -265,6 +265,7 @@ namespace CSMWorld
case 0: return; // return without saving
case 1:
{
// Remove current and add new while adjusting each points connection count
edges.erase(edges.begin()+subRowIndex);
if (static_cast<size_t>(edge.mV0) < points.size())
@ -272,10 +273,10 @@ namespace CSMWorld
edge.mV0 = value.toInt();
// Place in correct order
if (static_cast<size_t>(edge.mV0) < points.size())
++points[edge.mV0].mConnectionNum;
// Place in correct order
ESM::Pathgrid::EdgeList::iterator it = edges.begin();
for (; it != edges.end(); ++it)
{

@ -332,7 +332,7 @@ void CSVRender::PagedWorldspaceWidget::pathgridAboutToBeRemoved (const QModelInd
void CSVRender::PagedWorldspaceWidget::pathgridAdded(const QModelIndex& parent, int start, int end)
{
const CSMWorld::SubCellCollection<CSMWorld::Pathgrid>& pathgrids = mDocument.getData().getPathgrids();
const CSMWorld::SubCellCollection<CSMWorld::Pathgrid>& pathgrids = mDocument.getData().getPathgrids();
if (!parent.isValid())
{

@ -131,9 +131,10 @@ namespace CSVRender
if (!selection.empty())
{
mDragMode = DragMode_Move;
return true;
}
return true;
return false;
}
bool PathgridMode::secondaryEditStartDrag(const QPoint& pos)
@ -148,10 +149,11 @@ namespace CSVRender
mFromNode = SceneUtil::getPathgridNode(static_cast<unsigned short>(hit.index0));
tag->getPathgrid()->setupConnectionIndicator(mFromNode);
return true;
}
}
return true;
return false;
}
void PathgridMode::drag(const QPoint& pos, int diffX, int diffY, double speedFactor)

Loading…
Cancel
Save