| 19 | } |
| 20 | |
| 21 | QString 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 |
no test coverage detected