Commit 731f5fa8 authored by David Redondo's avatar David Redondo 🏎
Browse files

osd: Use qrc for the singular QML file

No need to search around on the file system.
parent 36cf7aed
Pipeline #206988 passed with stage
in 1 minute and 13 seconds
add_executable(kscreen_osd_service main.cpp osdmanager.cpp osd.cpp ../common/osdaction.cpp)
add_executable(kscreen_osd_service main.cpp osdmanager.cpp osd.cpp ../common/osdaction.cpp qml.qrc)
qt_add_dbus_adaptor(DBUS_SRC org.kde.kscreen.osdService.xml osdmanager.h KScreen::OsdManager)
target_sources(kscreen_osd_service PRIVATE ${DBUS_SRC})
......
......@@ -42,19 +42,14 @@ Osd::~Osd()
void Osd::showActionSelector()
{
if (!m_osdActionSelector) {
const QString osdPath = QStandardPaths::locate(QStandardPaths::QStandardPaths::GenericDataLocation, QStringLiteral("kded_kscreen/qml/OsdSelector.qml"));
if (osdPath.isEmpty()) {
qWarning() << "Failed to find action selector OSD QML file" << osdPath;
return;
}
m_osdActionSelector = std::make_unique<QQuickView>(&m_engine, nullptr);
m_osdActionSelector->setInitialProperties({{QLatin1String("actions"), QVariant::fromValue(OsdAction::availableActions())}});
m_osdActionSelector->setSource(QUrl::fromLocalFile(osdPath));
m_osdActionSelector->setSource(QStringLiteral("qrc:/qml/OsdSelector.qml"));
m_osdActionSelector->setColor(Qt::transparent);
m_osdActionSelector->setFlag(Qt::FramelessWindowHint);
if (m_osdActionSelector->status() != QQuickView::Ready) {
qWarning() << "Failed to load OSD QML file" << osdPath;
qWarning() << "Failed to load OSD QML file";
m_osdActionSelector.reset();
return;
}
......
<RCC>
<qresource prefix="/">
<file>qml/OsdSelector.qml</file>
</qresource>
</RCC>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment