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
1111 #include <QtCore/QLoggingCategory>
1212 #include <QtCore/QThread>
1313
14+#include <shared/FileUtils.h>
1415 #include <shared/QtHelpers.h>
1516 #include <DependencyManager.h>
16−#include <Trace.h>
17−#include <StatTracker.h>
1817 #include <OffscreenUi.h>
18+#include <StatTracker.h>
19+#include <Trace.h>
1920
2021 #include "Application.h"
2122
@@ -141,8 +142,13 @@ void TestScriptingInterface::endTraceEvent(QString name) { · 119 unmodified lines
141142 tracing::traceEvent(trace_test(), name, tracing::DurationEnd);
142143 }
143144
144−void TestScriptingInterface::savePhysicsSimulationStats(QString filename) {
145− qApp->saveNextPhysicsStats(filename);
145+void TestScriptingInterface::savePhysicsSimulationStats(QString originalPath) {
146+ QString path = FileUtils::replaceDateTimeTokens(originalPath);
147+ path = FileUtils::computeDocumentPath(path);
148+ if (!FileUtils::canCreateFile(path)) {
149+ return;
150+ }
151+ qApp->saveNextPhysicsStats(path);
146152 }
147153
148154 void TestScriptingInterface::profileRange(const QString& name, QScriptValue fn) {