History

Moved ownership of test location into the Test Scripting class.

NissimHadar committed 8 years ago

Commit d4d2f3c1 parent 8e3844a4 files · +15 −15Browse files

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

Unified · Split

interface/src/scripting/TestScriptingInterface.cpp+4−5
@@ -162,8 +162,7 @@ void TestScriptingInterface::clearCaches() { · 161 unmodified lines
162 162
163// Writes a JSON object from javascript to a file163// Writes a JSON object from javascript to a file
164void TestScriptingInterface::saveObject(QVariant variant, const QString& filename) {164void TestScriptingInterface::saveObject(QVariant variant, const QString& filename) {
165 QString testResultsLocation = qApp->getTestResultsLocation();165 if (_testResultsLocation.isNull()) {
166 if (testResultsLocation.isNull()) {
167 return;166 return;
168 }167 }
169 168
@@ -176,11 +175,11 @@ void TestScriptingInterface::saveObject(QVariant variant, const QString& filenam · 6 unmodified lines
176 QByteArray jsonData = jsonDocument.toJson();175 QByteArray jsonData = jsonDocument.toJson();
177 176
178 // Append trailing slash if needed177 // Append trailing slash if needed
179 if (testResultsLocation.right(1) != "/") {178 if (_testResultsLocation.right(1) != "/") {
180 testResultsLocation += "/";179 _testResultsLocation += "/";
181 }180 }
182 181
183 QString filepath = QDir::cleanPath(testResultsLocation + filename);182 QString filepath = QDir::cleanPath(_testResultsLocation + filename);
184 QFile file(filepath);183 QFile file(filepath);
185 184
186 file.open(QFile::WriteOnly);185 file.open(QFile::WriteOnly);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t