Skip to content

Commit

Permalink
QmlDesigner: Crash fix
Browse files Browse the repository at this point in the history
If the item did not have an id Qt Quick Designer crashed.
While we do ensure the item does get an id, we used the empty id
when refactoring later.
Now we use the generated id.

Change-Id: I71b9731270dc91537c17f6cb4fed3403d1001137
Reviewed-by: Tim Jenssen <[email protected]>
  • Loading branch information
ThomasHartmannQt committed Jun 7, 2016
1 parent 75e408b commit 3aae298
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -639,12 +639,9 @@ static QStringList getSortedSignalNameList(const ModelNode &modelNode)

void gotoImplementation(const SelectionContext &selectionState)
{
QString itemId;
ModelNode modelNode;
if (selectionState.singleNodeIsSelected()) {
itemId = selectionState.selectedModelNodes().first().id();
if (selectionState.singleNodeIsSelected())
modelNode = selectionState.selectedModelNodes().first();
}

bool isModelNodeRoot = true;

Expand All @@ -670,6 +667,8 @@ void gotoImplementation(const SelectionContext &selectionState)
}
}

QString itemId = modelNode.id();

const QString fileName = QmlDesignerPlugin::instance()->documentManager().currentDesignDocument()->fileName().toString();
const QString typeName = QmlDesignerPlugin::instance()->documentManager().currentDesignDocument()->fileName().toFileInfo().baseName();

Expand Down

0 comments on commit 3aae298

Please sign in to comment.