From 4f3b3ee154751886cf88d6f6c429c12767199f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Fri, 17 Aug 2012 13:19:21 +0200 Subject: [PATCH] Ensure main.qml presence BUG: 304881 REVIEW: 106062 FIXED-IN: 4.9.1 --- kcmkwin/kwindecoration/kwindecoration.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/kcmkwin/kwindecoration/kwindecoration.cpp b/kcmkwin/kwindecoration/kwindecoration.cpp index 1f7a20969b..b135fcf46c 100644 --- a/kcmkwin/kwindecoration/kwindecoration.cpp +++ b/kcmkwin/kwindecoration/kwindecoration.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -78,6 +79,15 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const QVariantList & , m_lastPreviewWidth(-1) , m_previewUpdateTimer(NULL) { + const QString mainQmlPath = KStandardDirs::locate("data", "kwin/kcm_kwindecoration/main.qml"); + if (mainQmlPath.isNull()) { + // TODO 4.10 i18n this + KMessageBox::error(this, "

Installation error

" + "The resource

kwin/kcm_kwindecoration/main.qml

could not be located in any application data path." + "

Please contact your distribution

" + "The application will now abort", "Installation Error"); + abort(); + } qmlRegisterType("org.kde.kwin.aurorae", 0, 1, "AuroraeTheme"); m_ui = new KWinDecorationForm(this); m_ui->configureDecorationButton->setIcon(KIcon("configure")); @@ -102,7 +112,7 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const QVariantList & m_ui->decorationList->rootContext()->setContextProperty("highlightColor", m_ui->decorationList->palette().color(QPalette::Highlight)); m_ui->decorationList->rootContext()->setContextProperty("sliderWidth", m_ui->decorationList->verticalScrollBar()->width()); m_ui->decorationList->rootContext()->setContextProperty("auroraeSource", KStandardDirs::locate("data", "kwin/aurorae/aurorae.qml")); - m_ui->decorationList->setSource(KStandardDirs::locate("data", "kwin/kcm_kwindecoration/main.qml")); + m_ui->decorationList->setSource(mainQmlPath); readConfig(style);