File indexing completed on 2024-05-12 15:44:45

0001 /*
0002     SPDX-FileCopyrightText: 2011 Marco Martin <mart@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "runnermodelplugin.h"
0008 
0009 #include <QQmlEngine>
0010 
0011 #include "krunner_debug.h"
0012 
0013 #include <KRunner/QueryMatch>
0014 
0015 #include "runnermodel.h"
0016 
0017 void RunnerModelPlugin::registerTypes(const char *uri)
0018 {
0019     qCWarning(KRUNNER) << "Using deprecated import org.kde.runnermodel, please port to org.kde.plasma.core";
0020     Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.runnermodel"));
0021     qmlRegisterType<RunnerModel>(uri, 2, 0, "RunnerModel");
0022     // to port this to Qt5.15-non-deprecated variant
0023     // qmlRegisterInterface<Plasma::QueryMatch>(uri, 1);
0024     // QueryMatch would need to get a Q_GAGDET added just for this
0025     // As this plugin is deprecated, this is not worth it,
0026     // so we just disable the deprecation warning
0027     QT_WARNING_PUSH
0028     QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations")
0029     QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
0030     qmlRegisterInterface<Plasma::QueryMatch>("QueryMatch");
0031     QT_WARNING_POP
0032     qRegisterMetaType<Plasma::QueryMatch *>("QueryMatch");
0033 }
0034 
0035 #include "moc_runnermodelplugin.cpp"