mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44:06 +02:00
move thread safety into Application from caller
This commit is contained in:
parent
ba72dc6375
commit
d0b58d8f8e
2 changed files with 14 additions and 14 deletions
|
@ -5171,19 +5171,23 @@ void Application::toggleLogDialog() {
|
|||
}
|
||||
|
||||
void Application::takeSnapshot(bool notify, float aspectRatio) {
|
||||
QMediaPlayer* player = new QMediaPlayer();
|
||||
QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav");
|
||||
player->setMedia(QUrl::fromLocalFile(inf.absoluteFilePath()));
|
||||
player->play();
|
||||
postLambdaEvent([notify, aspectRatio, this] {
|
||||
QMediaPlayer* player = new QMediaPlayer();
|
||||
QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav");
|
||||
player->setMedia(QUrl::fromLocalFile(inf.absoluteFilePath()));
|
||||
player->play();
|
||||
|
||||
QString path = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getScreenshot(aspectRatio));
|
||||
QString path = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getScreenshot(aspectRatio));
|
||||
|
||||
emit DependencyManager::get<WindowScriptingInterface>()->snapshotTaken(path, notify);
|
||||
emit DependencyManager::get<WindowScriptingInterface>()->snapshotTaken(path, notify);
|
||||
});
|
||||
}
|
||||
|
||||
void Application::shareSnapshot(const QString& path) {
|
||||
// not much to do here, everything is done in snapshot code...
|
||||
Snapshot::uploadSnapshot(path);
|
||||
postLambdaEvent([path] {
|
||||
// not much to do here, everything is done in snapshot code...
|
||||
Snapshot::uploadSnapshot(path);
|
||||
});
|
||||
}
|
||||
|
||||
float Application::getRenderResolutionScale() const {
|
||||
|
|
|
@ -205,13 +205,9 @@ void WindowScriptingInterface::copyToClipboard(const QString& text) {
|
|||
}
|
||||
|
||||
void WindowScriptingInterface::takeSnapshot(bool notify, float aspectRatio) {
|
||||
qApp->postLambdaEvent([notify, aspectRatio] {
|
||||
qApp->takeSnapshot(notify, aspectRatio);
|
||||
});
|
||||
qApp->takeSnapshot(notify, aspectRatio);
|
||||
}
|
||||
|
||||
void WindowScriptingInterface::shareSnapshot(const QString& path) {
|
||||
qApp->postLambdaEvent([path] {
|
||||
qApp->shareSnapshot(path);
|
||||
});
|
||||
qApp->shareSnapshot(path);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue