@@ -19,6 +19,7 @@
19#include <QDir>
19#include <QDir>
20#include <QDateTime>
20#include <QDateTime>
21#include <QStandardPaths>
21#include <QStandardPaths>
22+#include <QTemporaryDir>
22#include <QtGui/QImage>
23#include <QtGui/QImage>
23#include <QtGui/QGuiApplication>
24#include <QtGui/QGuiApplication>
24#include <QtQuick/QQuickWindow>
25#include <QtQuick/QQuickWindow>
@@ -42,8 +43,9 @@ ScreenGrabber::ScreenGrabber(QObject *parent)
42 QDir screenshotsDir;
43 QDir screenshotsDir;
43 if (qEnvironmentVariableIsSet("UNITY_TESTING")) {
44 if (qEnvironmentVariableIsSet("UNITY_TESTING")) {
44 qDebug() << "Using test environment";
45 qDebug() << "Using test environment";
45− QStandardPaths::setTestModeEnabled(true);
46+ QTemporaryDir tDir;
46− screenshotsDir = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
47+ tDir.setAutoRemove(false);
48+ screenshotsDir = tDir.path();
48 qDebug() << "Using real environment";
50 qDebug() << "Using real environment";
49 screenshotsDir = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
51 screenshotsDir = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);