MCPcopy Create free account
hub / github.com/bumptop/BumpTop / onStateChanged

Method onStateChanged

trunk/win/Source/BT_AutomatedJSONTesting.cpp:48–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48void AutomatedJSONTestSuite::PrepareScene::onStateChanged()
49{
50 // Clear out all files from the training directory
51 StrList dirContents = fsManager->getDirectoryContents(native(winOS->GetTrainingDirectory()));
52 for_each(QString filename, dirContents)
53 {
54 fsManager->deleteFileByName(filename, true); // delete silently
55 }
56
57 // Copy files over that we need to the training directory
58 QDir dataPath = scnManager->JSONTestFilesPath;
59 QDir desktopPath = scnManager->getWorkingDirectory();
60 QString desktopPathStr = native(desktopPath);
61 QString trainingDir = native(winOS->GetTrainingDirectory());
62
63 int argc;
64 LPWSTR *argv = CommandLineToArgvW((LPCWSTR)GetCommandLineA(), &argc);
65
66 StrList dirList = fsManager->getDirectoryContents(native(dataPath));
67 for (int i = 0; i < dirList.size(); ++i)
68 {
69 QString fileName = filename(dirList[i]);
70 if (!desktopPath.exists(fileName))
71 fsManager->copyFileByName(dirList[i], trainingDir, fileName, false, true);
72 }
73
74 GLOBAL(skipSavingSceneFile) = true; // This will prevent saving of the scene file
75
76 // Switch BumpTop to use the training directory for now
77 scnManager->setWorkingDirectory(winOS->GetTrainingDirectory());
78
79 // Let's clear out the desktop for the demo purposes
80 ClearBumpTop();
81 CreateBumpObjectsFromDirectory(native(winOS->GetTrainingDirectory()));
82}
83
84bool AutomatedJSONTestSuite::PrepareScene::finalizeStateChanged()
85{

Callers

nothing calls this directly

Calls 12

filenameFunction · 0.85
ClearBumpTopFunction · 0.85
Key_ReloadSceneFunction · 0.85
getDirectoryContentsMethod · 0.80
GetTrainingDirectoryMethod · 0.80
getWorkingDirectoryMethod · 0.80
copyFileByNameMethod · 0.80
setWorkingDirectoryMethod · 0.80
nativeFunction · 0.70
sizeMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected