Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all
Unified · Split
| @@ -8456,28 +8456,30 @@ bool Application::takeSnapshotOperators(std::queue<SnapshotOperator>& snapshotOp · 8455 unmodified lines | ||
| 8456 | 8456 | |
| 8457 | 8457 | void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio, const QString& filename) { |
| 8458 | 8458 | addSnapshotOperator(std::make_tuple([notify, includeAnimated, aspectRatio, filename](const QImage& snapshot) { |
| 8459 | − QString path = DependencyManager::get<Snapshot>()->saveSnapshot(snapshot, filename, TestScriptingInterface::getInstance()->getTestResultsLocation()); | |
| 8460 | − | |
| 8461 | − // If we're not doing an animated snapshot as well... | |
| 8462 | − if (!includeAnimated) { | |
| 8463 | − if (!path.isEmpty()) { | |
| 8464 | − // Tell the dependency manager that the capture of the still snapshot has taken place. | |
| 8465 | − emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(path, notify); | |
| 8466 | − } | |
| 8467 | − } else if (!SnapshotAnimated::isAlreadyTakingSnapshotAnimated()) { | |
| 8468 | − qApp->postLambdaEvent([path, aspectRatio] { | |
| 8459 | + qApp->postLambdaEvent([snapshot, notify, includeAnimated, aspectRatio, filename] { | |
| 8460 | + QString path = DependencyManager::get<Snapshot>()->saveSnapshot(snapshot, filename, TestScriptingInterface::getInstance()->getTestResultsLocation()); | |
| 8461 | + | |
| 8462 | + // If we're not doing an animated snapshot as well... | |
| 8463 | + if (!includeAnimated) { | |
| 8464 | + if (!path.isEmpty()) { | |
| 8465 | + // Tell the dependency manager that the capture of the still snapshot has taken place. | |
| 8466 | + emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(path, notify); | |
| 8467 | + } | |
| 8468 | + } else if (!SnapshotAnimated::isAlreadyTakingSnapshotAnimated()) { | |
| 8469 | 8469 | // Get an animated GIF snapshot and save it |
| 8470 | 8470 | SnapshotAnimated::saveSnapshotAnimated(path, aspectRatio, DependencyManager::get<WindowScriptingInterface>()); |
| 8471 | − }); | |
| 8472 | − } | |
| 8471 | + } | |
| 8472 | + }); | |
| 8473 | 8473 | }, aspectRatio, true)); |
| 8474 | 8474 | } |
| 8475 | 8475 | |
| 8476 | 8476 | void Application::takeSecondaryCameraSnapshot(const bool& notify, const QString& filename) { |
| 8477 | 8477 | addSnapshotOperator(std::make_tuple([notify, filename](const QImage& snapshot) { |
| 8478 | − QString snapshotPath = DependencyManager::get<Snapshot>()->saveSnapshot(snapshot, filename, TestScriptingInterface::getInstance()->getTestResultsLocation()); | |
| 8478 | + qApp->postLambdaEvent([snapshot, notify, filename] { | |
| 8479 | + QString snapshotPath = DependencyManager::get<Snapshot>()->saveSnapshot(snapshot, filename, TestScriptingInterface::getInstance()->getTestResultsLocation()); | |
| 8479 | 8480 | |
| 8480 | − emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(snapshotPath, notify); | |
| 8481 | + emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(snapshotPath, notify); | |
| 8482 | + }); | |
| 8481 | 8483 | }, 0.0f, false)); |
| 8482 | 8484 | } |
| 8483 | 8485 | |