Settings: offline mode

This commit is contained in:
tobtoht
2022-03-14 22:36:58 +01:00
parent 87e46fc961
commit 54140df597
13 changed files with 71 additions and 15 deletions
+5 -1
View File
@@ -238,7 +238,11 @@ bool xdgDesktopEntryRegister() {
return true;
}
bool portOpen(const QString &hostname, quint16 port){
bool portOpen(const QString &hostname, quint16 port) { // TODO: this call should be async
if (config()->get(Config::offlineMode).toBool()) {
return false;
}
QTcpSocket socket;
socket.connectToHost(hostname, port);
return socket.waitForConnected(600);