Merge branch 'KDE/4.7' into ksecretsservice

This commit is contained in:
Valentin Rusu 2011-11-02 22:23:01 +01:00
commit f4d5df71f9
2 changed files with 56 additions and 8 deletions

View File

@ -6,6 +6,7 @@ if(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
set(PLASMA_NO_KNEWSTUFF TRUE)
set(PLASMA_NO_SOLID TRUE)
set(PLASMA_NO_KIO TRUE)
set(PLASMA_NO_KUTILS TRUE)
endif(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
@ -13,7 +14,8 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${KDE4_KDEUI_INCLUDES}
${CMAKE_SOURCE_DIR}/experimental/libkdeclarative
${CMAKE_BINARY_DIR}/experimental/libkdeclarative
${CMAKE_SOURCE_DIR}/threadweaver/
${CMAKE_SOURCE_DIR}/kutils
${CMAKE_SOURCE_DIR}/threadweaver
${CMAKE_SOURCE_DIR}/plasma/extenders
${CMAKE_SOURCE_DIR}/plasma/remote
${CMAKE_SOURCE_DIR}/plasma/private/qtjolie-branch/qtjolie
@ -261,7 +263,7 @@ kde4_add_library(plasma ${LIBRARY_TYPE} ${plasma_LIB_SRCS})
#add kdeclarative after the 4.7 release
target_link_libraries(plasma ${QT_QTUITOOLS_LIBRARY} ${QT_QTWEBKIT_LIBRARY}
${QT_QTSCRIPT_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTSQL_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY}
${KDE4_KDEUI_LIBS} kdnssd threadweaver ${PLASMA_EXTRA_LIBS})
${KDE4_KDEUI_LIBS} ${KDE4_KUTILS_LIBS} kdnssd threadweaver ${PLASMA_EXTRA_LIBS})
if(QCA2_FOUND)
target_link_libraries(plasma ${QCA2_LIBRARIES})

View File

@ -54,6 +54,7 @@
#include <kauthorized.h>
#include <kcolorscheme.h>
#include <kdialog.h>
#include <kdesktopfile.h>
#include <kicon.h>
#include <kiconloader.h>
#include <kkeysequencewidget.h>
@ -65,6 +66,11 @@
#include <kwindowsystem.h>
#include <kpushbutton.h>
#ifndef PLASMA_NO_KUTILS
#include <kcmoduleinfo.h>
#include <kcmoduleproxy.h>
#endif
#ifndef PLASMA_NO_SOLID
#include <solid/powermanagement.h>
#endif
@ -1882,22 +1888,62 @@ void Applet::showConfigurationInterface()
}
d->publishUI.publishCheckbox = 0;
if (d->package && d->configLoader) {
if (d->package) {
KConfigDialog *dialog = 0;
QString uiFile = d->package->filePath("mainconfigui");
if (!uiFile.isEmpty()) {
const QString uiFile = d->package->filePath("mainconfigui");
KDesktopFile df(d->package->path() + "/metadata.desktop");
const QStringList kcmPlugins = df.desktopGroup().readEntry("X-Plasma-ConfigPlugins", QStringList());
if (!uiFile.isEmpty() || !kcmPlugins.isEmpty()) {
KConfigSkeleton *configLoader = d->configLoader ? d->configLoader : new KConfigSkeleton(0);
dialog = new AppletConfigDialog(0, d->configDialogId(), configLoader);
dialog->setWindowTitle(d->configWindowTitle());
dialog->setAttribute(Qt::WA_DeleteOnClose, true);
bool hasPages = false;
QFile f(uiFile);
QUiLoader loader;
QWidget *w = loader.load(&f);
if (w) {
dialog = new AppletConfigDialog(0, d->configDialogId(), d->configLoader);
dialog->setWindowTitle(d->configWindowTitle());
dialog->setAttribute(Qt::WA_DeleteOnClose, true);
dialog->addPage(w, i18n("Settings"), icon(), i18n("%1 Settings", name()));
hasPages = true;
}
foreach (const QString &kcm, kcmPlugins) {
#ifndef PLASMA_NO_KUTILS
KCModuleProxy *module = new KCModuleProxy(kcm);
if (module->realModule()) {
dialog->addPage(module, module->moduleInfo().moduleName(), module->moduleInfo().icon());
hasPages = true;
} else {
delete module;
}
#else
KService::Ptr service = KService::serviceByStorageId(kcm);
if (service) {
QString error;
KCModule *module = service->createInstance<KCModule>(dialog, QVariantList(), &error);
if (module) {
connect(module, SIGNAL(changed(bool)), dialog, SLOT(settingsModified(bool)));
dialog->addPage(module, service->name(), service->icon());
hasPages = true;
} else {
#ifndef NDEBUG
kDebug() << "failed to load kcm" << kcm << "for" << name();
#endif
}
}
#endif
}
if (hasPages) {
d->addGlobalShortcutsPage(dialog);
d->addPublishPage(dialog);
dialog->show();
} else {
delete dialog;
dialog = 0;
}
}