qt: Disable NET_FIGHT_SUPPORT

Because QNetworkConfigurationManager, QNetworkConfiguration and QNetworkSession
are deprecated, to be removed in Qt 6.
This commit is contained in:
Calcitem 2021-10-24 17:17:26 +08:00
parent 472b184566
commit f1f3514fae
No known key found for this signature in database
GPG Key ID: F67E4F8CB7B5EED2
5 changed files with 26 additions and 3 deletions

View File

@ -51,7 +51,8 @@
#define UCI_AUTO_RE_GO
#endif
#define NET_FIGHT_SUPPORT
// Play via network (TODO: Port to Qt 6)
//#define NET_FIGHT_SUPPORT
/// Qt simple GUI like a mobile app (WIP)
//#define QT_MOBILE_APP_UI

View File

@ -16,6 +16,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#ifdef NET_FIGHT_SUPPORT
#include <QtWidgets>
#include <QtNetwork>
@ -199,3 +203,4 @@ void Client::sessionOpened()
enableGetActionButton();
}
#endif // NET_FIGHT_SUPPORT

View File

@ -19,6 +19,10 @@
#ifndef CLIENT_H
#define CLIENT_H
#include "config.h"
#ifdef NET_FIGHT_SUPPORT
#include <QDataStream>
#include <QDialog>
#include <QTcpSocket>
@ -72,10 +76,13 @@ private:
QDataStream in;
QString currentAction;
// TODO: 'QNetworkSession': was declared deprecated
QNetworkSession *networkSession = nullptr;
uint16_t port {};
};
#endif // NET_FIGHT_SUPPORT
#endif // CLIENT_H

View File

@ -16,6 +16,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#ifdef NET_FIGHT_SUPPORT
#include <QtWidgets>
#include <QtNetwork>
#include <QtCore>
@ -193,3 +197,5 @@ void Server::sendAction()
actions.pop();
}
}
#endif // NET_FIGHT_SUPPORT

View File

@ -19,14 +19,16 @@
#ifndef SERVER_H
#define SERVER_H
#include "config.h"
#ifdef NET_FIGHT_SUPPORT
#include <QDialog>
#include <QString>
#include <QVector>
#include <queue>
#include <string>
#include "config.h"
using std::string;
QT_BEGIN_NAMESPACE
@ -65,4 +67,6 @@ private:
QString action;
};
#endif // NET_FIGHT_SUPPORT
#endif // SERVER_H