Some chatcleaner fixes for Qt5 (and other stuff).
This commit is contained in:
@@ -29,6 +29,8 @@
|
|||||||
* as that of the covered work. *
|
* as that of the covered work. *
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
#include "cleanerconfig.h"
|
#include "cleanerconfig.h"
|
||||||
|
#include <QtCore>
|
||||||
|
|
||||||
#include <tinyxml.h>
|
#include <tinyxml.h>
|
||||||
|
|
||||||
#define MODUS 0711
|
#define MODUS 0711
|
||||||
@@ -46,8 +48,6 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include <QtCore>
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,9 @@ CleanerServer::~CleanerServer()
|
|||||||
|
|
||||||
void CleanerServer::newCon()
|
void CleanerServer::newCon()
|
||||||
{
|
{
|
||||||
if(!blockConnection) {
|
if(blockConnection) {
|
||||||
|
tcpServer->nextPendingConnection()->close();
|
||||||
|
} else {
|
||||||
tcpSocket = tcpServer->nextPendingConnection();
|
tcpSocket = tcpServer->nextPendingConnection();
|
||||||
connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(onRead()));
|
connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(onRead()));
|
||||||
connect(tcpSocket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(socketStateChanged(QAbstractSocket::SocketState)));
|
connect(tcpSocket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(socketStateChanged(QAbstractSocket::SocketState)));
|
||||||
@@ -113,6 +115,7 @@ void CleanerServer::onRead()
|
|||||||
if (error) {
|
if (error) {
|
||||||
qDebug() << "Error handling packets from client.";
|
qDebug() << "Error handling packets from client.";
|
||||||
tcpSocket->close();
|
tcpSocket->close();
|
||||||
|
blockConnection = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* char buf[1024];
|
/* char buf[1024];
|
||||||
|
|||||||
@@ -33,7 +33,9 @@
|
|||||||
|
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#ifndef Q_MOC_RUN
|
||||||
#include <third_party/boost/timers.hpp>
|
#include <third_party/boost/timers.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
class BadWordCheck;
|
class BadWordCheck;
|
||||||
class TextFloodCheck;
|
class TextFloodCheck;
|
||||||
|
|||||||
@@ -32,7 +32,9 @@
|
|||||||
#define TEXTFLOODCHECK_H
|
#define TEXTFLOODCHECK_H
|
||||||
|
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
|
#ifndef Q_MOC_RUN
|
||||||
#include <third_party/boost/timers.hpp>
|
#include <third_party/boost/timers.hpp>
|
||||||
|
#endif
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user