History

save files to Documents by default

Andrew Meadows committed 8 years ago

Commit 87fa9191 parent 74a1f5d4 files · +66 −41Browse files

Showing the changes to interface/src/scripting/TestScriptingInterface.cpp (1 of 4 files). Show all

Unified · Split

interface/src/scripting/TestScriptingInterface.cpp+10−4
@@ -11,11 +11,12 @@ · 10 unmodified lines
11#include <QtCore/QLoggingCategory>11#include <QtCore/QLoggingCategory>
12#include <QtCore/QThread>12#include <QtCore/QThread>
13 13
14#include <shared/FileUtils.h>
14#include <shared/QtHelpers.h>15#include <shared/QtHelpers.h>
15#include <DependencyManager.h>16#include <DependencyManager.h>
16#include <Trace.h>
17#include <StatTracker.h>
18#include <OffscreenUi.h>17#include <OffscreenUi.h>
18#include <StatTracker.h>
19#include <Trace.h>
19 20
20#include "Application.h"21#include "Application.h"
21 22
@@ -141,8 +142,13 @@ void TestScriptingInterface::endTraceEvent(QString name) { · 119 unmodified lines
141 tracing::traceEvent(trace_test(), name, tracing::DurationEnd);142 tracing::traceEvent(trace_test(), name, tracing::DurationEnd);
142}143}
143 144
144void TestScriptingInterface::savePhysicsSimulationStats(QString filename) {145void TestScriptingInterface::savePhysicsSimulationStats(QString originalPath) {
145 qApp->saveNextPhysicsStats(filename);146 QString path = FileUtils::replaceDateTimeTokens(originalPath);
147 path = FileUtils::computeDocumentPath(path);
148 if (!FileUtils::canCreateFile(path)) {
149 return;
150 }
151 qApp->saveNextPhysicsStats(path);
146}152}
147 153
148void TestScriptingInterface::profileRange(const QString& name, QScriptValue fn) {154void TestScriptingInterface::profileRange(const QString& name, QScriptValue fn) {