diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2019-05-23 13:55:24 +0200 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2019-05-23 13:55:24 +0200 |
| commit | 3b6e0696b58f14b8082f06577896fed9c21ea606 (patch) | |
| tree | 16ea5f71ddd22a64102054bbb3a5723bc54deb0f /src | |
| parent | 579e8b1fabbf30ef24178f979b671bc221c0bee1 (diff) | |
| download | manager-3b6e0696b58f14b8082f06577896fed9c21ea606.tar.gz manager-3b6e0696b58f14b8082f06577896fed9c21ea606.zip | |
Replace deprecated QSignalMapper with lambda
Diffstat (limited to 'src')
| -rw-r--r-- | src/CrServerManager.pro | 2 | ||||
| -rw-r--r-- | src/crsm.cpp | 5 | ||||
| -rw-r--r-- | src/crsm.hpp | 2 |
3 files changed, 2 insertions, 7 deletions
diff --git a/src/CrServerManager.pro b/src/CrServerManager.pro index be9f8c4..6fad2e9 100644 --- a/src/CrServerManager.pro +++ b/src/CrServerManager.pro @@ -53,4 +53,4 @@ HEADERS += \ IrcIngameChat.hpp equals(QT_ARCH, "x86_64"):linux-*: DEFINES += Q_OS_LINUX64 -QMAKE_CXXFLAGS *= -std=c++11 -Wall -Wextra -Werror -Wunused +QMAKE_CXXFLAGS *= -std=c++2a -Wall -Wextra -Werror -Wunused diff --git a/src/crsm.cpp b/src/crsm.cpp index 902e813..3aeb6c4 100644 --- a/src/crsm.cpp +++ b/src/crsm.cpp @@ -75,8 +75,6 @@ CRSM::CRSM(QObject *parent) : QFile sessionFile(Config.CRSM.SessionFile); if(sessionFile.exists()) sessionFile.remove(); - connect(&greetMapper, SIGNAL(mapped(QString)), this, SLOT(greet(QString))); - autoHost = Config.Hosting.Auto; connect(processManager, SIGNAL(readyRead()), this, SLOT(readServerOutput())); @@ -317,9 +315,8 @@ bool CRSM::clientMessage(ClientInfo& client, const QString& message, ClonkOutput bool CRSM::clientConnected(const ClientInfo& client) { QTimer *timer = new QTimer; - connect(timer, SIGNAL(timeout()), &greetMapper, SLOT(map())); + connect(timer, &QTimer::timeout, [this, pcName = client.pcName]{ greet(pcName); }); connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater())); - greetMapper.setMapping(timer, client.pcName); timer->start(1000); if(Session.CountDown != -1 && Session.CountDown <= Config.Clonk.Server.JoinStopCountDown) { diff --git a/src/crsm.hpp b/src/crsm.hpp index b7633dd..95d5698 100644 --- a/src/crsm.hpp +++ b/src/crsm.hpp @@ -14,7 +14,6 @@ #include <Irc> #include <IrcConnection> #include <IrcCommand> -#include <QSignalMapper> #include <QTcpServer> #include <QTcpSocket> #include <QTimer> @@ -182,7 +181,6 @@ private: bool finish; IrcConnection *connection = 0; bool autoHost = true; - QSignalMapper greetMapper; QFile *logfile; QTextCodec *codec; QStringList ircModIOList; |
