mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-04 12:52:06 -04:00
* feat(lockscreen): enable use of videos as screensaver in the lock screen * reducing debug logs * feature becomes available only when QtMultimedia is available
36 lines
779 B
QML
36 lines
779 B
QML
pragma Singleton
|
|
pragma ComponentBehavior: Bound
|
|
|
|
import QtQuick
|
|
import Quickshell
|
|
|
|
Singleton {
|
|
id: root
|
|
|
|
property bool available: false
|
|
|
|
function detectAvailability() {
|
|
try {
|
|
const testObj = Qt.createQmlObject(`
|
|
import QtQuick
|
|
import QtMultimedia
|
|
Item {}
|
|
`, root, "MultimediaService.TestComponent");
|
|
if (testObj) {
|
|
testObj.destroy();
|
|
}
|
|
available = true;
|
|
return true;
|
|
} catch (e) {
|
|
available = false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
Component.onCompleted: {
|
|
if (!detectAvailability()) {
|
|
console.warn("MultimediaService: QtMultimedia not available");
|
|
}
|
|
}
|
|
}
|