From ed37e1acc0929c59fd53f13d3646f4e86fd0a0b9 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 3 Feb 2010 16:20:10 +0000 Subject: [PATCH] if the UI file is bogus for whatever reason (not just "we can't open it") call the script's createConfigurationInterface to see if that works any better svn path=/branches/KDE/4.4/kdelibs/; revision=1084730 --- applet.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/applet.cpp b/applet.cpp index b8043b497..21e051696 100644 --- a/applet.cpp +++ b/applet.cpp @@ -1717,26 +1717,22 @@ void Applet::showConfigurationInterface() QString uiFile = d->package->filePath("mainconfigui"); if (!uiFile.isEmpty()) { - dialog->setWindowTitle(d->configWindowTitle()); - dialog->setAttribute(Qt::WA_DeleteOnClose, true); - - QUiLoader loader; QFile f(uiFile); - if (!f.open(QIODevice::ReadOnly)) { + QUiLoader loader; + QWidget *w = loader.load(&f); + if (!w) { delete dialog; if (d->script) { d->script->showConfigurationInterface(); } + return; } - QWidget *w = loader.load(&f); - f.close(); - - if (w) { - dialog->addPage(w, i18n("Settings"), icon(), i18n("%1 Settings", name())); - } + dialog->setWindowTitle(d->configWindowTitle()); + dialog->setAttribute(Qt::WA_DeleteOnClose, true); + dialog->addPage(w, i18n("Settings"), icon(), i18n("%1 Settings", name())); } d->addGlobalShortcutsPage(dialog);