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

Function GetDefaultSettingsSaveLocation

lib/utils/path-helpers.cpp:21–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21QString GetDefaultSettingsSaveLocation()
22{
23 QString desktopPath = QStandardPaths::writableLocation(
24 QStandardPaths::DesktopLocation);
25
26 auto scName = obs_frontend_get_current_scene_collection();
27 QString sceneCollectionName(scName);
28 bfree(scName);
29
30 auto timestamp = QDateTime::currentDateTime();
31 auto path = desktopPath + "/adv-ss-" + sceneCollectionName + "-" +
32 timestamp.toString("yyyy.MM.dd.hh.mm.ss");
33
34 // Check if scene collection name contains invalid path characters
35 QFile file(path);
36 if (file.exists()) {
37 return path;
38 }
39
40 bool validPath = file.open(QIODevice::WriteOnly);
41 if (validPath) {
42 file.remove();
43 return path;
44 }
45
46 return desktopPath + "/adv-ss-" +
47 timestamp.toString("yyyy.MM.dd.hh.mm.ss");
48}
49
50} // namespace advss

Callers 2

showBackupDialogsFunction · 0.70

Calls 2

toStringMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected