forked from Silverfish/proton-bridge
GODT-2153: use file socket for bridge gRPC on linux & macOS.
Other: fix integration tests.
This commit is contained in:
@ -237,4 +237,47 @@ SPUser randomUser()
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return The OS the application is running on.
|
||||
//****************************************************************************************************************************************************
|
||||
OS os()
|
||||
{
|
||||
QString const osStr = QSysInfo::productType();
|
||||
if ((osStr == "macos") || (osStr == "osx")) // Qt < 5 returns "osx", Qt6 returns "macos".
|
||||
return OS::MacOS;
|
||||
|
||||
if (osStr == "windows")
|
||||
return OS::Windows;
|
||||
|
||||
return OS::Linux;
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return true if and only if the application is currently running on Linux.
|
||||
//****************************************************************************************************************************************************
|
||||
bool onLinux()
|
||||
{
|
||||
return OS::Linux == os();
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return true if and only if the application is currently running on MacOS.
|
||||
//****************************************************************************************************************************************************
|
||||
bool onMacOS()
|
||||
{
|
||||
return OS::MacOS == os();
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return true if and only if the application is currently running on Windows.
|
||||
//****************************************************************************************************************************************************
|
||||
bool onWindows()
|
||||
{
|
||||
return OS::Windows == os();
|
||||
}
|
||||
|
||||
|
||||
} // namespace bridgepp
|
||||
|
||||
Reference in New Issue
Block a user