-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkcm.cpp
More file actions
44 lines (31 loc) · 1.15 KB
/
Copy pathkcm.cpp
File metadata and controls
44 lines (31 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* SPDX-FileCopyrightText: 2026
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "kcm.h"
#include "efibootentrymodel.h"
#include "efibootmanager.h"
#include <KPluginFactory>
#include <QQmlEngine>
K_PLUGIN_CLASS_WITH_JSON(EfiBootKCM, "kcm_efiboot.json")
EfiBootKCM::EfiBootKCM(QObject *parent, const KPluginMetaData &data, const QVariantList &args)
: KQuickConfigModule(parent, data)
, m_manager(new EfiBootManager(this))
{
Q_UNUSED(args)
// Hide OK/Apply/Cancel buttons since changes are applied immediately via helper actions
setButtons(KQuickConfigModule::NoAdditionalButton);
constexpr const char *uri = "org.kde.plasma.kcm.efiboot";
qmlRegisterUncreatableType<EfiBootEntryModel>(uri, 1, 0, "EfiBootEntryModel", QStringLiteral("Provided by the KCM"));
qmlRegisterUncreatableType<EfiBootManager>(uri, 1, 0, "EfiBootManager", QStringLiteral("Provided by the KCM"));
connect(this, &KQuickConfigModule::mainUiReady, this, &EfiBootKCM::load, Qt::SingleShotConnection);
}
EfiBootManager *EfiBootKCM::manager() const
{
return m_manager;
}
void EfiBootKCM::load()
{
m_manager->refresh();
}
#include "kcm.moc"