# HG changeset patch # User Chris Cannam # Date 1433938305 -3600 # Node ID 6ea7761a418b003a40f9fc14a030baa82e320d10 # Parent ce82bcdc95d048c1dc34afd5bff7888e3e46747a Emit a signal if transform fails diff -r ce82bcdc95d0 -r 6ea7761a418b transform/ModelTransformer.h --- a/transform/ModelTransformer.h Wed Jun 10 13:10:26 2015 +0100 +++ b/transform/ModelTransformer.h Wed Jun 10 13:11:45 2015 +0100 @@ -68,6 +68,12 @@ void abandon() { m_abandoned = true; } /** + * Return true if the processing thread is being or has been + * abandoned, i.e. if abandon() has been called. + */ + bool isAbandoned() const { return m_abandoned; } + + /** * Return the input model for the transform. */ Model *getInputModel() { return m_input.getModel(); } diff -r ce82bcdc95d0 -r 6ea7761a418b transform/ModelTransformerFactory.cpp --- a/transform/ModelTransformerFactory.cpp Wed Jun 10 13:10:26 2015 +0100 +++ b/transform/ModelTransformerFactory.cpp Wed Jun 10 13:11:45 2015 +0100 @@ -285,6 +285,12 @@ m_handlers.erase(transformer); } + if (transformer->isAbandoned()) { + if (transformer->getMessage() != "") { + emit transformFailed("", transformer->getMessage()); + } + } + transformer->wait(); // unnecessary but reassuring delete transformer; } diff -r ce82bcdc95d0 -r 6ea7761a418b transform/ModelTransformerFactory.h --- a/transform/ModelTransformerFactory.h Wed Jun 10 13:10:26 2015 +0100 +++ b/transform/ModelTransformerFactory.h Wed Jun 10 13:11:45 2015 +0100 @@ -145,6 +145,9 @@ QString &message, AdditionalModelHandler *handler = 0); +signals: + void transformFailed(QString transformName, QString message); + protected slots: void transformerFinished();