refactor Security8021x to compatible QML classes
issue - #15
CmakeFiles
For the new editor, i have created a new module that will contain all the new C++ backend classes and QML files. Here is an overview 
The new EditorQML will only be built if BUILD_EDITORQML is enabled.
Security8081x Security8021xSetting is a QObject with QML_ELEMENT. Each EAP method is a separate QML file (EapTls.qml, EapPeap.qml, etc.) that is only visible when the properties setting.showTls / setting.showPeap etc. is true. The securityType property drives which EAP methods appear in the menu by loading that specific qml. List of properties that is refactored/added from old Widget file security802-1x.cpp
| Property | Type | Replaces |
|---|---|---|
eapMethod |
EapMethod (enum) |
m_ui->auth->currentData().toInt() |
securityType |
SecurityType (enum) |
Constructor Type parameter |
PasswordOption |
`PasswordOption (enum) | passwordOption that inherits PasswordField |
showMd5 |
bool |
currentAuthChanged() — setRowVisible(md5UserName, true) |
showTls |
bool |
currentAuthChanged() — setRowVisible(tlsIdentity, true) |
showLeap |
bool |
currentAuthChanged() — setRowVisible(leapUsername, true) |
showPwd |
bool |
currentAuthChanged() — setRowVisible(pwdUsername, true) |
showFast |
bool |
currentAuthChanged() — setRowVisible(fastAnonIdentity, true) |
showTtls |
bool |
currentAuthChanged() — setRowVisible(ttlsAnonIdentity, true) |
showPeap |
bool |
currentAuthChanged() — setRowVisible(peapAnonIdentity, true) |
valid |
bool |
isValid() |
Similarly, for each EAP, i have created its own properties. Few examples -
MD5
| Property | Replaces |
|---|---|
md5Username |
m_ui->md5UserName->text() |
md5Password |
m_ui->md5Password->text() |
md5PasswordOption |
m_ui->md5Password->passwordOption() |
Key design changes
- The
Security8021xconstructor is completely removed. - The new backend sets
m_securityTypewhich shows which items to be shown. currentAuthChanged(int)changed to QMLshowproperties.- Every
setRowVisible()call incurrentAuthChangedis replaced by a QML property. - Remaining static methods are kept intact.
Functions that are directly imported from old code
pkcs12CanDecryptis directly copied fromsecurity802-1x.cpp(https://invent.kde.org/plasma/plasma-nm/-/blob/master/libs/editor/settings/security802-1x.cpp#L273)
Edited by Tushar Gupta