on xenial help sign in
Use a trully temp dir on test mode

Helps when run under adt-run + schroot

commitec409dcc35e07cc20b55297e6db82692c43025a0 authorAlbert Astals Cid <albert.astals@canonical.com> dateMon 17 Aug 2015, 11:56 (11 years ago) parent0773ca8
1 file changed+4−2
plugins/ScreenGrabber/screengrabber.cpp+4−2
plugins/ScreenGrabber/screengrabber.cpp+4−2
@@ -19,6 +19,7 @@
1919#include <QDir>
2020#include <QDateTime>
2121#include <QStandardPaths>
22+#include <QTemporaryDir>
2223#include <QtGui/QImage>
2324#include <QtGui/QGuiApplication>
2425#include <QtQuick/QQuickWindow>
@@ -42,8 +43,9 @@ ScreenGrabber::ScreenGrabber(QObject *parent)
4243 QDir screenshotsDir;
4344 if (qEnvironmentVariableIsSet("UNITY_TESTING")) {
4445 qDebug() << "Using test environment";
45− QStandardPaths::setTestModeEnabled(true);
46− screenshotsDir = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
46+ QTemporaryDir tDir;
47+ tDir.setAutoRemove(false);
48+ screenshotsDir = tDir.path();
4749 } else {
4850 qDebug() << "Using real environment";
4951 screenshotsDir = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);