mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-24 02:00:24 +07:00
isWorkingOnPlatform function added
This commit is contained in:
@@ -136,3 +136,29 @@ Protocol ContainerProps::defaultProtocol(DockerContainer c)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ContainerProps::isWorkingOnPlatform(DockerContainer c)
|
||||||
|
{
|
||||||
|
#ifdef Q_OS_WINDOWS
|
||||||
|
return true;
|
||||||
|
#elif defined (Q_OS_MAC)
|
||||||
|
|
||||||
|
#elif defined (Q_OS_IOS)
|
||||||
|
switch (c) {
|
||||||
|
case DockerContainer::WireGuard: return true;
|
||||||
|
case DockerContainer::OpenVpn: return true;
|
||||||
|
default: return false;
|
||||||
|
}
|
||||||
|
#elif defined (Q_OS_ANDROID)
|
||||||
|
switch (c) {
|
||||||
|
case DockerContainer::WireGuard: return true;
|
||||||
|
case DockerContainer::OpenVpn: return true;
|
||||||
|
default: return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#elif defined (Q_OS_LINUX)
|
||||||
|
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ public:
|
|||||||
// binding between Docker container and main protocol of given container
|
// binding between Docker container and main protocol of given container
|
||||||
// it may be changed fot future containers :)
|
// it may be changed fot future containers :)
|
||||||
Q_INVOKABLE static Protocol defaultProtocol(DockerContainer c);
|
Q_INVOKABLE static Protocol defaultProtocol(DockerContainer c);
|
||||||
|
|
||||||
|
Q_INVOKABLE static bool isWorkingOnPlatform(DockerContainer c);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user