From ba13492c7ef070b976a015a5680c366567fef75b Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Thu, 22 Apr 2021 18:27:55 +0200 Subject: [PATCH] Fix OSX compilation --- ScreenPlayWallpaper/CMakeLists.txt | 2 +- ScreenPlayWallpaper/Wallpaper.qml | 7 ++---- ScreenPlayWallpaper/main.cpp | 34 +++++++++++++-------------- ScreenPlayWallpaper/src/macwindow.cpp | 23 ++++++++++++------ ScreenPlayWallpaper/src/macwindow.h | 14 ++++++----- 5 files changed, 44 insertions(+), 36 deletions(-) diff --git a/ScreenPlayWallpaper/CMakeLists.txt b/ScreenPlayWallpaper/CMakeLists.txt index 6eedbcfd..87f61364 100644 --- a/ScreenPlayWallpaper/CMakeLists.txt +++ b/ScreenPlayWallpaper/CMakeLists.txt @@ -43,7 +43,7 @@ if(APPLE) target_link_libraries(${PROJECT_NAME} PRIVATE "-framework Cocoa") endif() -target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Quick Qt5::Gui Qt5::Widgets Qt5::Core Qt5::WebEngine shcore.lib ScreenPlaySDK ScreenPlayUtil) +target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Quick Qt5::Gui Qt5::Widgets Qt5::Core Qt5::WebEngine ScreenPlaySDK ScreenPlayUtil) diff --git a/ScreenPlayWallpaper/Wallpaper.qml b/ScreenPlayWallpaper/Wallpaper.qml index 864ab7f2..b11aacd2 100644 --- a/ScreenPlayWallpaper/Wallpaper.qml +++ b/ScreenPlayWallpaper/Wallpaper.qml @@ -146,6 +146,8 @@ Rectangle { if (Qt.platform.os === "windows") { return Qt.resolvedUrl( "file:///" + Wallpaper.windowsDesktopProperties.wallpaperPath) + } else { + return "" } } @@ -292,11 +294,6 @@ Rectangle { text: "Wallpaper.canFade " + Wallpaper.canFade font.pointSize: 14 } - Text { - text: "imgCover.source " + Qt.resolvedUrl( - "file:///" + Wallpaper.windowsDesktopProperties.wallpaperPath) - font.pointSize: 14 - } Text { text: "imgCover.status " + imgCover.status font.pointSize: 14 diff --git a/ScreenPlayWallpaper/main.cpp b/ScreenPlayWallpaper/main.cpp index 45690b0c..0f8d81fd 100644 --- a/ScreenPlayWallpaper/main.cpp +++ b/ScreenPlayWallpaper/main.cpp @@ -43,7 +43,7 @@ int main(int argc, char* argv[]) LinuxWindow window({ 0 }, "/home/graphicscore/Desktop/wallpapers/MechaGirl", "appid", "1", "fill", false); #endif #if defined(Q_OS_OSX) - MacWindow window({ 0 }, "test", "appid", "1", "fill"); + MacWindow window({ 0 }, "test", "appID=test", "1", "fill", "videoWallpaper", true, true); #endif return app.exec(); @@ -89,26 +89,26 @@ int main(int argc, char* argv[]) #if defined(Q_OS_LINUX) LinuxWindow window( - activeScreensList.value(), - projectPath, - appID, - fillmode, - volume, - checkWallpaperVisible); - QObject::connect(&sdk, &ScreenPlaySDK::sdkDisconnected, &window, &LinuxWindow::destroyThis); - QObject::connect(&sdk, &ScreenPlaySDK::incommingMessage, &window, &LinuxWindow::messageReceived); + activeScreensList.value(), + projectFilePath, + appID, + volume, + fillmode, + type, + checkWallpaperVisible, + debugMode); #endif #if defined(Q_OS_OSX) MacWindow window( - activeScreensList.value(), - projectPath, - appID, - fillmode, - volume, - checkWallpaperVisible); - QObject::connect(&sdk, &ScreenPlaySDK::sdkDisconnected, &window, &MacWindow::destroyThis); - QObject::connect(&sdk, &ScreenPlaySDK::incommingMessage, &window, &MacWindow::messageReceived); + activeScreensList.value(), + projectFilePath, + appID, + volume, + fillmode, + type, + checkWallpaperVisible, + debugMode); #endif return app.exec(); diff --git a/ScreenPlayWallpaper/src/macwindow.cpp b/ScreenPlayWallpaper/src/macwindow.cpp index 6df388d1..7f98762e 100644 --- a/ScreenPlayWallpaper/src/macwindow.cpp +++ b/ScreenPlayWallpaper/src/macwindow.cpp @@ -1,14 +1,23 @@ #include "macwindow.h" MacWindow::MacWindow( - const QVector& activeScreensList, - const QString& projectPath, - const QString& id, - const QString& volume, - const QString& fillmode) - : BaseWindow(projectPath, activeScreensList, false) + const QVector& activeScreensList, + const QString& projectFilePath, + const QString& appID, + const QString& volume, + const QString& fillmode, + const QString& type, + const bool checkWallpaperVisible, + const bool debugMode) + : BaseWindow( + activeScreensList, + projectFilePath, + type, + checkWallpaperVisible, + appID, + debugMode) { - setAppID(id); + setAppID(appID); bool ok = false; float volumeParsed = volume.toFloat(&ok); if (!ok) { diff --git a/ScreenPlayWallpaper/src/macwindow.h b/ScreenPlayWallpaper/src/macwindow.h index ad4ae00d..50ac64a2 100644 --- a/ScreenPlayWallpaper/src/macwindow.h +++ b/ScreenPlayWallpaper/src/macwindow.h @@ -51,12 +51,14 @@ class MacWindow : public BaseWindow { Q_OBJECT public: - explicit MacWindow( - const QVector& activeScreensList, - const QString& projectPath, - const QString& id, - const QString& volume, - const QString& fillmode); + explicit MacWindow( const QVector& activeScreensList, + const QString& projectFilePath, + const QString& appID, + const QString& volume, + const QString& fillmode, + const QString& type, + const bool checkWallpaperVisible, + const bool debugMode); signals: