1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-07-18 18:48:28 +02:00

Fix website wallpaper not included in installed

This commit is contained in:
Elias Steurer 2023-11-22 11:55:21 +01:00
parent 395fe67bd4
commit fafd85d403

View File

@ -36,22 +36,25 @@ bool ProjectFile::init()
}
type = typeParsed.value();
// Required:
if (!obj.contains("file"))
// File is required. Website Wallpaper doe not have a file, but a url
if (!obj.contains("file") && type != ScreenPlay::InstalledType::InstalledType::WebsiteWallpaper)
return false;
file = obj.value("file").toString();
if (type == ScreenPlay::InstalledType::InstalledType::GodotWallpaper) {
QFileInfo fileInfo(folder.path() + "/wallpaper.tscn");
if (!fileInfo.exists()) {
qCritical() << "Requested file:" << fileInfo.absoluteFilePath() << "does not exist!";
return false;
}
} else {
QFileInfo fileInfo(folder.path() + "/" + file);
if (!fileInfo.exists()) {
qCritical() << "Requested file:" << fileInfo.absoluteFilePath() << "does not exist!";
return false;
if (type != ScreenPlay::InstalledType::InstalledType::WebsiteWallpaper) {
file = obj.value("file").toString();
if (type == ScreenPlay::InstalledType::InstalledType::GodotWallpaper) {
QFileInfo fileInfo(folder.path() + "/wallpaper.tscn");
if (!fileInfo.exists()) {
qCritical() << "Requested file:" << fileInfo.absoluteFilePath() << "does not exist!";
return false;
}
} else {
QFileInfo fileInfo(folder.path() + "/" + file);
if (!fileInfo.exists()) {
qCritical() << "Requested file:" << fileInfo.absoluteFilePath() << "does not exist!";
return false;
}
}
}