Qml Containers Page refact
This commit is contained in:
parent
0faf6c8599
commit
a390f2e988
22 changed files with 191 additions and 197 deletions
|
@ -1,9 +1,9 @@
|
|||
#include "protocols_defs.h"
|
||||
|
||||
QDebug operator<<(QDebug debug, const amnezia::Protocol &p)
|
||||
QDebug operator<<(QDebug debug, const amnezia::ProtocolEnumNS::Protocol &p)
|
||||
{
|
||||
QDebugStateSaver saver(debug);
|
||||
debug.nospace() << protoToString(p);
|
||||
debug.nospace() << amnezia::protoToString(p);
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ QMap<amnezia::Protocol, QString> amnezia::protocolDescriptions()
|
|||
return {};
|
||||
}
|
||||
|
||||
bool amnezia::isProtocolVpnType(Protocol p)
|
||||
bool amnezia::isProtocolVpnType(ProtocolEnumNS::Protocol p)
|
||||
{
|
||||
switch (p) {
|
||||
case Protocol::Any : return false;
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
#include <QQmlEngine>
|
||||
|
||||
namespace amnezia {
|
||||
namespace config_key {
|
||||
|
@ -113,6 +114,7 @@ constexpr char serverPskKeyPath[] = "/opt/amnezia/wireguard/wireguard_psk.key";
|
|||
|
||||
} // namespace protocols
|
||||
|
||||
namespace ProtocolEnumNS {
|
||||
Q_NAMESPACE
|
||||
enum class Protocol {
|
||||
Any,
|
||||
|
@ -122,6 +124,9 @@ enum class Protocol {
|
|||
WireGuard
|
||||
};
|
||||
Q_ENUM_NS(Protocol)
|
||||
} // namespace ProtocolEnumNS
|
||||
|
||||
using namespace ProtocolEnumNS;
|
||||
|
||||
QVector<Protocol> allProtocols();
|
||||
|
||||
|
@ -134,7 +139,7 @@ bool isProtocolVpnType(Protocol p);
|
|||
|
||||
static void declareQmlProtocolEnum() {
|
||||
qmlRegisterUncreatableMetaObject(
|
||||
PageEnumNS::staticMetaObject,
|
||||
ProtocolEnumNS::staticMetaObject,
|
||||
"ProtocolEnum",
|
||||
1, 0,
|
||||
"ProtocolEnum",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue