~mzanetti/unity8/panel-button-fixes

« back to all changes in this revision

Viewing changes to plugins/ScreenGrabber/screengrabber.cpp

  • Committer: CI Train Bot
  • Author(s): Albert Astals Cid, Michał Sawicz
  • Date: 2015-09-22 12:57:02 UTC
  • mfrom: (1752.8.47 origin/autopkgtests)
  • Revision ID: ci-train-bot@canonical.com-20150922125702-wboqbqanpto9l9s2
Add DEP-8 test for all our UI and unit tests

Some refactoring was needed:
- added a basic Ubuntu.Web mock
- made plugin path an environment, not a compiled-in bit
- moved Unity.Application resources into .qrc

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include <QDir>
20
20
#include <QDateTime>
21
21
#include <QStandardPaths>
 
22
#include <QTemporaryDir>
22
23
#include <QtGui/QImage>
23
24
#include <QtGui/QGuiApplication>
24
25
#include <QtQuick/QQuickWindow>
42
43
    QDir screenshotsDir;
43
44
    if (qEnvironmentVariableIsSet("UNITY_TESTING")) {
44
45
        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();
47
49
    } else {
48
50
        qDebug() << "Using real environment";
49
51
        screenshotsDir = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);