Ensure main.qml presence

BUG: 304881
REVIEW: 106062
FIXED-IN: 4.9.1
This commit is contained in:
Thomas Lübking 2012-08-17 13:19:21 +02:00
parent f82fffdd71
commit 4f3b3ee154

View file

@ -47,6 +47,7 @@
#include <KAboutData>
#include <KDialog>
#include <KLocale>
#include <KMessageBox>
#include <KNS3/DownloadDialog>
#include <KDE/KStandardDirs>
#include <KPluginFactory>
@ -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, "<h1>Installation error</h1>"
"The resource<h2>kwin/kcm_kwindecoration/main.qml</h2>could not be located in any application data path."
"<h2>Please contact your distribution</h2>"
"The application will now abort", "Installation Error");
abort();
}
qmlRegisterType<Aurorae::AuroraeTheme>("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);