diff --git a/krunner/view.cpp b/krunner/view.cpp index a2ee843ba..92f4bc685 100644 --- a/krunner/view.cpp +++ b/krunner/view.cpp @@ -99,7 +99,7 @@ View::View(QWindow *) package.setPath(packageName); } - m_qmlObj->setSource(QUrl::fromLocalFile(package.filePath("runcommandmainscript"))); + m_qmlObj->setSource(package.fileUrl("runcommandmainscript")); m_qmlObj->engine()->rootContext()->setContextProperty(QStringLiteral("runnerWindow"), this); m_qmlObj->completeInitialization(); diff --git a/shell/containmentconfigview.cpp b/shell/containmentconfigview.cpp index 8d6df0d49..134f15e46 100644 --- a/shell/containmentconfigview.cpp +++ b/shell/containmentconfigview.cpp @@ -73,7 +73,7 @@ ContainmentConfigView::~ContainmentConfigView() void ContainmentConfigView::init() { - setSource(QUrl::fromLocalFile(m_containment->corona()->kPackage().filePath("containmentconfigurationui"))); + setSource(m_containment->corona()->kPackage().fileUrl("containmentconfigurationui")); } PlasmaQuick::ConfigModel *ContainmentConfigView::containmentActionConfigModel() diff --git a/shell/desktopview.cpp b/shell/desktopview.cpp index 998b9dbd0..955628b2f 100644 --- a/shell/desktopview.cpp +++ b/shell/desktopview.cpp @@ -50,7 +50,7 @@ DesktopView::DesktopView(Plasma::Corona *corona, QScreen *targetScreen) setTitle(corona->kPackage().metadata().name()); setIcon(QIcon::fromTheme(corona->kPackage().metadata().iconName())); rootContext()->setContextProperty(QStringLiteral("desktop"), this); - setSource(QUrl::fromLocalFile(corona->kPackage().filePath("views", QStringLiteral("Desktop.qml")))); + setSource(corona->kPackage().fileUrl("views", QStringLiteral("Desktop.qml"))); connect(this, &QWindow::screenChanged, this, &DesktopView::adaptToScreen); @@ -295,7 +295,7 @@ void DesktopView::screenGeometryChanged() void DesktopView::coronaPackageChanged(const KPackage::Package &package) { setContainment(0); - setSource(QUrl::fromLocalFile(package.filePath("views", QStringLiteral("Desktop.qml")))); + setSource(package.fileUrl("views", QStringLiteral("Desktop.qml"))); } void DesktopView::setupWaylandIntegration() diff --git a/shell/osd.cpp b/shell/osd.cpp index 2dc8cd6c2..2f5ed8e0e 100644 --- a/shell/osd.cpp +++ b/shell/osd.cpp @@ -31,7 +31,7 @@ Osd::Osd(KSharedConfig::Ptr config, ShellCorona *corona) : QObject(corona) - , m_osdPath(corona->lookAndFeelPackage().filePath("osdmainscript")) + , m_osdUrl(corona->lookAndFeelPackage().fileUrl("osdmainscript")) , m_config(config) { QDBusConnection::sessionBus().registerObject(QStringLiteral("/org/kde/osdService"), this, QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals); @@ -162,7 +162,7 @@ bool Osd::init() return true; } - if (m_osdPath.isEmpty()) { + if (m_osdUrl.isEmpty()) { return false; } @@ -170,10 +170,10 @@ bool Osd::init() m_osdObject = new KDeclarative::QmlObject(this); } - m_osdObject->setSource(QUrl::fromLocalFile(m_osdPath)); + m_osdObject->setSource(m_osdUrl); if (m_osdObject->status() != QQmlComponent::Ready) { - qWarning() << "Failed to load OSD QML file" << m_osdPath; + qWarning() << "Failed to load OSD QML file" << m_osdUrl; return false; } diff --git a/shell/osd.h b/shell/osd.h index ca6a54867..3ceddaece 100644 --- a/shell/osd.h +++ b/shell/osd.h @@ -21,6 +21,7 @@ #include #include +#include #include @@ -68,7 +69,7 @@ private: void showProgress(const QString &icon, const int percent, const QString &additionalText = QString()); void showOsd(); - QString m_osdPath; + QUrl m_osdUrl; KDeclarative::QmlObject *m_osdObject = nullptr; QTimer *m_osdTimer = nullptr; int m_timeout = 0; diff --git a/shell/panelconfigview.cpp b/shell/panelconfigview.cpp index a7f2ecd34..f7a1456fe 100644 --- a/shell/panelconfigview.cpp +++ b/shell/panelconfigview.cpp @@ -83,7 +83,7 @@ PanelConfigView::~PanelConfigView() void PanelConfigView::init() { - setSource(QUrl::fromLocalFile(m_containment->corona()->kPackage().filePath("panelconfigurationui"))); + setSource(m_containment->corona()->kPackage().fileUrl("panelconfigurationui")); syncGeometry(); syncLocation(); } diff --git a/shell/panelview.cpp b/shell/panelview.cpp index 3084cfc18..1d1b529e9 100644 --- a/shell/panelview.cpp +++ b/shell/panelview.cpp @@ -105,7 +105,7 @@ PanelView::PanelView(ShellCorona *corona, QScreen *targetScreen, QWindow *parent qmlRegisterType(); rootContext()->setContextProperty(QStringLiteral("panel"), this); - setSource(QUrl::fromLocalFile(m_corona->kPackage().filePath("views", QStringLiteral("Panel.qml")))); + setSource(m_corona->kPackage().fileUrl("views", QStringLiteral("Panel.qml"))); } PanelView::~PanelView() diff --git a/shell/shellcorona.cpp b/shell/shellcorona.cpp index 98667ec4f..361619d2b 100644 --- a/shell/shellcorona.cpp +++ b/shell/shellcorona.cpp @@ -810,14 +810,14 @@ void ShellCorona::screenInvariants() const void ShellCorona::showAlternativesForApplet(Plasma::Applet *applet) { - const QString alternativesQML = package().filePath("appletalternativesui"); + const QUrl alternativesQML = kPackage().fileUrl("appletalternativesui"); if (alternativesQML.isEmpty()) { return; } KDeclarative::QmlObject *qmlObj = new KDeclarative::QmlObject(this); qmlObj->setInitializationDelayed(true); - qmlObj->setSource(QUrl::fromLocalFile(alternativesQML)); + qmlObj->setSource(alternativesQML); AlternativesHelper *helper = new AlternativesHelper(applet, qmlObj); qmlObj->rootContext()->setContextProperty(QStringLiteral("alternativesHelper"), helper); @@ -1409,14 +1409,14 @@ void ShellCorona::loadInteractiveConsole() } if (!m_interactiveConsole) { - const QString consoleQML = package().filePath("interactiveconsole"); + const QUrl consoleQML = kPackage().fileUrl("interactiveconsole"); if (consoleQML.isEmpty()) { return; } m_interactiveConsole = new KDeclarative::QmlObject(this); m_interactiveConsole->setInitializationDelayed(true); - m_interactiveConsole->setSource(QUrl::fromLocalFile(consoleQML)); + m_interactiveConsole->setSource(consoleQML); QObject *engine = new WorkspaceScripting::ScriptEngine(this, m_interactiveConsole); m_interactiveConsole->rootContext()->setContextProperty(QStringLiteral("scriptEngine"), engine);