1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-18 08:22:33 +02:00

Fix more casing errors of wallpaper type

This commit is contained in:
Elias Steurer 2020-06-01 18:46:58 +02:00
parent 4cf2318147
commit 9410375a4b
4 changed files with 20 additions and 23 deletions

View File

@ -91,10 +91,10 @@ void SDKConnector::closeAllConnections()
void SDKConnector::closeAllWallpapers()
{
QStringList types {
"videoWallpaper",
"qmlWallpaper",
"htmlWallpaper",
"godotWallpaper"
"VideoWallpaper",
"QmlWallpaper",
"HtmlWallpaper",
"GodotWallpaper"
};
closeConntectionByType(types);
@ -111,9 +111,9 @@ void SDKConnector::closeAllWallpapers()
void SDKConnector::closeAllWidgets()
{
QStringList types {
"qmlWidget",
"htmlWidget",
"standaloneWidget"
"QmlWidget",
"HtmlWidget",
"StandaloneWidget"
};
closeConntectionByType(types);
@ -125,7 +125,7 @@ void SDKConnector::closeAllWidgets()
void SDKConnector::closeConntectionByType(const QStringList& list)
{
for (auto& client : m_clients) {
if (list.contains(client->type())) {
if (list.contains(client->type(), Qt::CaseInsensitive)) {
client->close();
m_clients.removeOne(client);
}

View File

@ -55,10 +55,6 @@ Rectangle {
loader.webViewUrl = Qt.resolvedUrl(window.fullContentPath)
loader.source = "qrc:/WebView.qml"
break
case Wallpaper.WallpaperType.ThreeJSScene:
loader.webViewUrl = Qt.resolvedUrl(window.fullContentPath)
loader.source = "qrc:/WebView.qml"
break
case Wallpaper.WallpaperType.Qml:
loader.source = Qt.resolvedUrl(window.fullContentPath)
imgCover.state = "out"

View File

@ -69,25 +69,27 @@ BaseWindow::BaseWindow(QString projectFilePath, const QVector<int> activeScreens
QObject::connect(&m_fileSystemWatcher, &QFileSystemWatcher::fileChanged, this, &BaseWindow::reloadQML);
m_fileSystemWatcher.addPaths({ projectFilePath, projectFilePath + "/" + projectObject.value("file").toString() });
if (projectObject.value("type") == "videoWallpaper") {
QString type = projectObject.value("type").toString().toLower();
if (type.contains("VideoWallpaper", Qt::CaseInsensitive)) {
setType(BaseWindow::WallpaperType::Video);
return;
}
if (projectObject.value("type") == "threeJSWallpaper") {
setType(BaseWindow::WallpaperType::ThreeJSScene);
return;
}
if (projectObject.value("type") == "qmlWallpaper") {
if (type.contains("QmlWallpaper", Qt::CaseInsensitive)) {
setType(BaseWindow::WallpaperType::Qml);
return;
}
if (projectObject.value("type") == "htmlWallpaper") {
if (type.contains("HtmlWallpaper", Qt::CaseInsensitive)) {
setType(BaseWindow::WallpaperType::Html);
return;
}
if (type.contains("GodotWallpaper", Qt::CaseInsensitive)) {
setType(BaseWindow::WallpaperType::Godot);
return;
}
}
void BaseWindow::messageReceived(QString key, QString value)
@ -130,7 +132,7 @@ void BaseWindow::messageReceived(QString key, QString value)
if (key == "fillmode") {
// HTML5 Video uses - that c++ enums cannot
if(QVariant(value).toString() == "Scale_Down"){
if (QVariant(value).toString() == "Scale_Down") {
setFillMode("Scale-Down");
} else {
setFillMode(QVariant(value).toString());

View File

@ -78,11 +78,10 @@ public:
Q_PROPERTY(WallpaperType type READ type WRITE setType NOTIFY typeChanged)
Q_PROPERTY(QString OSVersion READ OSVersion WRITE setOSVersion NOTIFY OSVersionChanged)
enum class WallpaperType {
Video,
Html,
ThreeJSScene,
Godot,
Qml,
};
Q_ENUM(WallpaperType)