mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-09 10:06:04 -05:00
Move AskForBackup() definition
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
#include "scene-selection.hpp"
|
||||
#include "regex-config.hpp"
|
||||
|
||||
#include <QStandardPaths>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
#include <QLabel>
|
||||
#include <QMessageBox>
|
||||
@@ -1088,4 +1090,33 @@ void replaceAll(std::string &str, const std::string &from,
|
||||
}
|
||||
}
|
||||
|
||||
QString GetDefaultSettingsSaveLocation()
|
||||
{
|
||||
QString desktopPath = QStandardPaths::writableLocation(
|
||||
QStandardPaths::DesktopLocation);
|
||||
|
||||
auto scName = obs_frontend_get_current_scene_collection();
|
||||
QString sceneCollectionName(scName);
|
||||
bfree(scName);
|
||||
|
||||
auto timestamp = QDateTime::currentDateTime();
|
||||
auto path = desktopPath + "/adv-ss-" + sceneCollectionName + "-" +
|
||||
timestamp.toString("yyyy.MM.dd.hh.mm.ss");
|
||||
|
||||
// Check if scene collection name contains invalid path characters
|
||||
QFile file(path);
|
||||
if (file.exists()) {
|
||||
return path;
|
||||
}
|
||||
|
||||
bool validPath = file.open(QIODevice::WriteOnly);
|
||||
if (validPath) {
|
||||
file.remove();
|
||||
return path;
|
||||
}
|
||||
|
||||
return desktopPath + "/adv-ss-" +
|
||||
timestamp.toString("yyyy.MM.dd.hh.mm.ss");
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
|
||||
@@ -123,5 +123,6 @@ bool doubleEquals(double left, double right, double epsilon);
|
||||
std::pair<int, int> getCursorPos();
|
||||
void replaceAll(std::string &str, const std::string &from,
|
||||
const std::string &to);
|
||||
QString GetDefaultSettingsSaveLocation();
|
||||
|
||||
} // namespace advss
|
||||
|
||||
Reference in New Issue
Block a user