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:
Thomas Hartmann
2016-12-21 14:28:39 +01:00
parent 8f74cc3b7c
commit d4aa4523b7
4 changed files with 10 additions and 0 deletions

View File

@@ -373,6 +373,7 @@ void DesignDocument::deleteSelected()
QmlObjectNode(node).destroy();
}
transaction.commit();
} catch (const RewritingException &e) {
e.showException();
}
@@ -536,6 +537,7 @@ void DesignDocument::paste()
}
view.setSelectedModelNodes(pastedNodeList);
transaction.commit();
} catch (const RewritingException &e) {
qWarning() << e.description(); //silent error
}
@@ -574,6 +576,7 @@ void DesignDocument::paste()
NodeMetaInfo::clearCache();
view.setSelectedModelNodes(QList<ModelNode>() << pastedNode);
transaction.commit();
} catch (const RewritingException &e) {
qWarning() << e.description(); //silent error
}