fixed null pointer

This commit is contained in:
Liran BN 2014-06-26 18:30:49 +03:00
parent cc96141657
commit 43bf478b85
3 changed files with 2 additions and 10 deletions

View file

@ -11,7 +11,6 @@ TARGET = jceGrade
TEMPLATE = app
RC_FILE = appConfigure.rc
CONFIG += c++11 static
SOURCES += main/coursestablemanager.cpp \
main/loginhandler.cpp \
main/main.cpp \

View file

@ -1,6 +1,6 @@
#include "jcesslclient.h"
jceSSLClient::jceSSLClient(QObject *parent) : flag(false), packet("")
jceSSLClient::jceSSLClient() : flag(false), packet("")
{
connect(this,SIGNAL(error(QAbstractSocket::SocketError)),this,SLOT(checkErrors(QAbstractSocket::SocketError)));
connect(this,SIGNAL(connected()),this,SLOT(setConnected()));
@ -83,13 +83,11 @@ bool jceSSLClient::recieveData(std::string &str, bool fast)
{
p = readAll();
packet.append(p);
debugEdit->setPlainText(debugEdit->toPlainText() + "\n Size" + QString::number(p.size()));
}while (p.size() > 0);
}
}
str = packet.toStdString();
debugEdit->setPlainText(debugEdit->toPlainText() + "\n" + QString::fromStdString(str));
if (str.size() > 0)
sflag = true;
@ -103,7 +101,6 @@ void jceSSLClient::readIt()
{
p = readAll();
packet.append(p);
debugEdit->setPlainText(debugEdit->toPlainText() + "\n Size" + QString::number(p.size()));
}while (p.size() > 0);

View file

@ -10,13 +10,11 @@
#include <string>
#define milisTimeOut 3500
#include <QPlainTextEdit>
class jceSSLClient : QSslSocket
{
Q_OBJECT
public:
jceSSLClient(QObject *parent = 0);
jceSSLClient();
bool makeConnect(std::string server,int port);
bool isConnected();
@ -36,8 +34,6 @@ private:
bool flag;
QString packet;
QPlainTextEdit* debugEdit;
};
#endif // JCESSLCLIENT_H