705d15ec1f
The tracked source tree was stuck at KF6 6.10.0 with QML/Quick/kcmshell stripped out and kcmoduleloader/kcmultidialog gutted by sed/python hacks. Replace the local source with the upstream 6.27.0 tarball content, keeping only the .clang-format and docs/ extras. This restores: - add_subdirectory(qml) / (quick) / (kcmshell) - kcmoduleqml.cpp/h, KF6KCMUtilsQuick, Qt6::Qml/Quick/QuickWidgets links - kcmoduleloader.cpp and kcmultidialog.cpp QML code paths - ECMQmlModule and KF6KIO find_package in top-level CMakeLists.txt - Qt6Qml find_dependency in KF6KCMUtilsConfig.cmake.in Shrink the recipe build script to use cookbook_apply_patches of the external 01-initial-migration.patch and remove all sed/python hacks. Shrink the migration patch to only disable ki18n_install(po) (translations remain deferred until lupdate/lrelease is built for target).
35 lines
984 B
C++
35 lines
984 B
C++
/*
|
|
SPDX-FileCopyrightText: 2022 Nicolas Fella <nicolas.fella@gmx.de>
|
|
SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
|
*/
|
|
|
|
#include <KCModuleLoader>
|
|
|
|
#include <QObject>
|
|
#include <QQmlEngine>
|
|
#include <QTest>
|
|
|
|
class KCMTest : public QObject
|
|
{
|
|
Q_OBJECT
|
|
private Q_SLOTS:
|
|
void testLoadQmlPlugin()
|
|
{
|
|
auto parent = std::make_unique<QWidget>();
|
|
auto mod = KCModuleLoader::loadModule(KPluginMetaData(QStringLiteral("plasma/kcms/systemsettings/kcm_testqml")), parent.get());
|
|
QVERIFY(mod);
|
|
QCOMPARE(mod->metaObject()->className(), "KCModuleQml");
|
|
}
|
|
|
|
void testFallbackKCM()
|
|
{
|
|
auto parent = std::make_unique<QWidget>();
|
|
auto modFail = KCModuleLoader::loadModule(KPluginMetaData(QStringLiteral("nonexistent_kcm")), parent.get());
|
|
QVERIFY(modFail);
|
|
QCOMPARE(modFail->metaObject()->className(), "KCMError");
|
|
}
|
|
};
|
|
|
|
QTEST_MAIN(KCMTest)
|
|
#include "kcmloadtest.moc"
|