MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / createScriptFile

Function createScriptFile

plugins/scripting/utils/inline-script.cpp:95–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95static bool createScriptFile(const char *settingsFile, const char *content)
96{
97 const QFileInfo fileInfo(settingsFile);
98 const QString dirPath = fileInfo.absolutePath();
99 const QDir dir(dirPath);
100 if (!dir.exists() && !dir.mkpath(dirPath)) {
101 blog(LOG_WARNING, "could not create script file! (mkpath)");
102 return false;
103 }
104
105 QFile file(settingsFile);
106 if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
107 return false;
108 }
109
110 auto out = QTextStream(&file);
111 out << content;
112
113 return true;
114}
115
116InlineScript::InlineScript() : _instanceId(_instanceIdCounter++)
117{

Callers 2

SetupFileMethod · 0.85
SetupInlineMethod · 0.85

Calls 1

openMethod · 0.45

Tested by

no test coverage detected