From ecf6050aca941d7f4e797da22e13f047c5356d62 Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Thu, 23 Nov 2023 21:45:01 +0100 Subject: [PATCH] Update qopenhd.cpp --- app/util/qopenhd.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/app/util/qopenhd.cpp b/app/util/qopenhd.cpp index 4a4e3d9b3..c88902391 100644 --- a/app/util/qopenhd.cpp +++ b/app/util/qopenhd.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -305,11 +306,16 @@ bool QOpenHD::is_platform_rpi() bool QOpenHD::is_platform_rock() { -#ifdef IS_PLATFORM_Rock - return true; -#else - return false; -#endif +const char* rockPlatformPath = "/usr/local/share/openhd/platform/rock/"; + struct stat info; + if (stat(rockPlatformPath, &info) != 0) { + return false; + } + if (info.st_mode & S_IFDIR) { + return true; + } else { + return false; + } } void QOpenHD::keep_screen_on(bool on)