From 84ac01754c10ebf3f90d76c6e9cfb1c494a8a2a7 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 ea932705d6..5876288a8d 100644 --- a/kcmkwin/kwindecoration/kwindecoration.cpp +++ b/kcmkwin/kwindecoration/kwindecoration.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -81,6 +82,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")); @@ -110,7 +120,7 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const QVariantList & m_ui->decorationList->rootContext()->setContextProperty("decorationInactiveCaptionColor", KDecoration::options()->color(ColorFont, false)); m_ui->decorationList->rootContext()->setContextProperty("decorationActiveTitleBarColor", KDecoration::options()->color(ColorTitleBar, true)); m_ui->decorationList->rootContext()->setContextProperty("decorationInactiveTitleBarColor", KDecoration::options()->color(ColorTitleBar, false)); - m_ui->decorationList->setSource(KStandardDirs::locate("data", "kwin/kcm_kwindecoration/main.qml")); + m_ui->decorationList->setSource(mainQmlPath); readConfig(style);