forked from qt-creator/qt-creator
QmlDesigner: Avoid throwing in the destructor of transactions
Since C++11 destructors do not throw by default. Change-Id: Ic6403704587999464011fcaa1f9ac7df3e4ee49d Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -230,6 +230,7 @@ void raise(const SelectionContext &selectionState)
|
|||||||
node.setVariantProperty("z", z);
|
node.setVariantProperty("z", z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
transaction.commit();
|
||||||
} catch (const RewritingException &e) { //better save then sorry
|
} catch (const RewritingException &e) { //better save then sorry
|
||||||
e.showException();
|
e.showException();
|
||||||
}
|
}
|
||||||
@@ -251,6 +252,7 @@ void lower(const SelectionContext &selectionState)
|
|||||||
node.setVariantProperty("z", z);
|
node.setVariantProperty("z", z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
transaction.commit();
|
||||||
} catch (const RewritingException &e) { //better save then sorry
|
} catch (const RewritingException &e) { //better save then sorry
|
||||||
e.showException();
|
e.showException();
|
||||||
}
|
}
|
||||||
@@ -333,6 +335,7 @@ void resetPosition(const SelectionContext &selectionState)
|
|||||||
node.removeProperty("x");
|
node.removeProperty("x");
|
||||||
node.removeProperty("y");
|
node.removeProperty("y");
|
||||||
}
|
}
|
||||||
|
transaction.commit();
|
||||||
} catch (const RewritingException &e) { //better save then sorry
|
} catch (const RewritingException &e) { //better save then sorry
|
||||||
e.showException();
|
e.showException();
|
||||||
}
|
}
|
||||||
@@ -663,6 +666,7 @@ void addSignalHandlerOrGotoImplementation(const SelectionContext &selectionState
|
|||||||
|
|
||||||
QmlObjectNode qmlObjectNode(modelNode);
|
QmlObjectNode qmlObjectNode(modelNode);
|
||||||
qmlObjectNode.ensureAliasExport();
|
qmlObjectNode.ensureAliasExport();
|
||||||
|
transaction.commit();
|
||||||
} catch (RewritingException &exception) { //better safe than sorry! There always might be cases where we fail
|
} catch (RewritingException &exception) { //better safe than sorry! There always might be cases where we fail
|
||||||
exception.showException();
|
exception.showException();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -373,6 +373,7 @@ void DesignDocument::deleteSelected()
|
|||||||
QmlObjectNode(node).destroy();
|
QmlObjectNode(node).destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
} catch (const RewritingException &e) {
|
} catch (const RewritingException &e) {
|
||||||
e.showException();
|
e.showException();
|
||||||
}
|
}
|
||||||
@@ -536,6 +537,7 @@ void DesignDocument::paste()
|
|||||||
}
|
}
|
||||||
|
|
||||||
view.setSelectedModelNodes(pastedNodeList);
|
view.setSelectedModelNodes(pastedNodeList);
|
||||||
|
transaction.commit();
|
||||||
} catch (const RewritingException &e) {
|
} catch (const RewritingException &e) {
|
||||||
qWarning() << e.description(); //silent error
|
qWarning() << e.description(); //silent error
|
||||||
}
|
}
|
||||||
@@ -574,6 +576,7 @@ void DesignDocument::paste()
|
|||||||
NodeMetaInfo::clearCache();
|
NodeMetaInfo::clearCache();
|
||||||
|
|
||||||
view.setSelectedModelNodes(QList<ModelNode>() << pastedNode);
|
view.setSelectedModelNodes(QList<ModelNode>() << pastedNode);
|
||||||
|
transaction.commit();
|
||||||
} catch (const RewritingException &e) {
|
} catch (const RewritingException &e) {
|
||||||
qWarning() << e.description(); //silent error
|
qWarning() << e.description(); //silent error
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -717,6 +717,7 @@ void NavigatorTreeModel::moveNodesInteractive(NodeAbstractProperty &parentProper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
transaction.commit();
|
||||||
} catch (const RewritingException &exception) { //better safe than sorry! There always might be cases where we fail
|
} catch (const RewritingException &exception) { //better safe than sorry! There always might be cases where we fail
|
||||||
exception.showException();
|
exception.showException();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,6 +188,8 @@ void ModelMerger::replaceModel(const ModelNode &modelNode)
|
|||||||
syncNodeProperties(rootNode, modelNode, idRenamingHash, view());
|
syncNodeProperties(rootNode, modelNode, idRenamingHash, view());
|
||||||
syncNodeListProperties(rootNode, modelNode, idRenamingHash, view());
|
syncNodeListProperties(rootNode, modelNode, idRenamingHash, view());
|
||||||
m_view->changeRootNodeType(modelNode.type(), modelNode.majorVersion(), modelNode.minorVersion());
|
m_view->changeRootNodeType(modelNode.type(), modelNode.majorVersion(), modelNode.minorVersion());
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
} catch (const RewritingException &e) {
|
} catch (const RewritingException &e) {
|
||||||
qWarning() << e.description(); //silent error
|
qWarning() << e.description(); //silent error
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user