File indexing completed on 2024-05-12 05:34:01

0001 /*
0002     SPDX-FileCopyrightText: 2020 Arjen Hiemstra <ahiemstra@heimr.nl>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "ProcessPlugin.h"
0008 
0009 #include <QQmlEngine>
0010 
0011 #include "application_data_model.h"
0012 #include "process_attribute_model.h"
0013 #include "process_controller.h"
0014 #include "process_data_model.h"
0015 
0016 #include "ProcessEnums.h"
0017 
0018 using namespace KSysGuard;
0019 
0020 void ProcessPlugin::registerTypes(const char *uri)
0021 {
0022     Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.ksysguard.process"));
0023 
0024     qRegisterMetaType<KSysGuard::ProcessController::Signal>();
0025     qRegisterMetaType<KSysGuard::ProcessController::Result>();
0026     qRegisterMetaType<KSysGuardProcess::ProcessStatus>();
0027     qRegisterMetaType<KSysGuardProcess::IoPriorityClass>();
0028     qRegisterMetaType<KSysGuardProcess::Scheduler>();
0029 
0030     qmlRegisterType<ProcessController>(uri, 1, 0, "ProcessController");
0031     qmlRegisterUncreatableMetaObject(KSysGuardProcess::staticMetaObject, uri, 1, 0, "Process", QStringLiteral("Contains process enums"));
0032     qmlRegisterType<ProcessDataModel>(uri, 1, 0, "ProcessDataModel");
0033     qmlRegisterUncreatableType<ProcessAttributeModel>(uri, 1, 0, "ProcessAttributeModel", QStringLiteral("Available through ProcessDataModel"));
0034     qmlRegisterType<ApplicationDataModel>(uri, 1, 0, "ApplicationDataModel");
0035 }